mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 15:52:55 +00:00
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:
parent
bf75ed463c
commit
4a5cbba4bc
src/util
@ -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;
|
||||
|
@ -296,6 +296,8 @@ struct _virStorageSource {
|
||||
char *tlsAlias;
|
||||
char *tlsCertdir;
|
||||
bool tlsVerify;
|
||||
|
||||
bool detected; /* true if this entry was not provided by the user */
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user