util: storagefile: Track whether a virStorageSource was auto-detected

When formatting an inactive or migratable XML we will need to suppress
backing chain members which were detected from the disk to keep
semantics straight. This means we need to record, whether a
virStorageSource originates from autodetection.
This commit is contained in:
Peter Krempa 2017-09-26 13:52:43 +02:00
parent bf75ed463c
commit 4a5cbba4bc
2 changed files with 5 additions and 0 deletions

View File

@ -2060,6 +2060,7 @@ virStorageSourceCopy(const virStorageSource *src,
ret->haveTLS = src->haveTLS;
ret->tlsFromConfig = src->tlsFromConfig;
ret->tlsVerify = src->tlsVerify;
ret->detected = src->detected;
/* storage driver metadata are not copied */
ret->drv = NULL;
@ -3434,6 +3435,8 @@ virStorageSourceNewFromBacking(virStorageSourcePtr parent)
/* copy parent's labelling and other top level stuff */
if (virStorageSourceInitChainElement(ret, parent, true) < 0)
goto error;
ret->detected = true;
}
return ret;

View File

@ -296,6 +296,8 @@ struct _virStorageSource {
char *tlsAlias;
char *tlsCertdir;
bool tlsVerify;
bool detected; /* true if this entry was not provided by the user */
};