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. --- src/util/virstoragefile.c | 3 +++ src/util/virstoragefile.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index dd4494940..df6a547b0 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -2042,6 +2042,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; @@ -3418,6 +3419,8 @@ virStorageSourceNewFromBacking(virStorageSourcePtr parent) goto error; } + ret->detected = true; + return ret; error: diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index 74dee10f2..5181d6cb9 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -295,6 +295,8 @@ struct _virStorageSource { char *tlsAlias; char *tlsCertdir; bool tlsVerify; + + bool detected; /* true if this entry was not provided by the user */ }; -- 2.14.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list