Few things which are currently stored the virDomainDiskDef structure are
actually relevant for the storage source as well. Add the fields with a
note that they are just mirror of the values from the disk.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/util/virstoragefile.c | 4 ++++
src/util/virstoragefile.h | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index d6ad6e1d0f..72584404da 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2042,6 +2042,10 @@ virStorageSourceCopy(const virStorageSource *src,
ret->detected = src->detected;
ret->debugLevel = src->debugLevel;
ret->debug = src->debug;
+ ret->iomode = src->iomode;
+ ret->cachemode = src->cachemode;
+ ret->discard = src->discard;
+ ret->detect_zeroes = src->detect_zeroes;
/* storage driver metadata are not copied */
ret->drv = NULL;
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index d129e81978..b450da55ae 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -305,6 +305,14 @@ struct _virStorageSource {
unsigned int debugLevel;
bool debug;
+
+ /* Libvirt currently stores the following properities in virDomainDiskDef.
+ * These instances are currently just copies from the parent definition and
+ * are not mapped back to the XML */
+ int iomode; /* enum virDomainDiskIo */
+ int cachemode; /* enum virDomainDiskCache */
+ int discard; /* enum virDomainDiskDiscard */
+ int detect_zeroes; /* enum virDomainDiskDetectZeroes */
};
--
2.16.2