[RFC PATCH 03/30] util: storage: Add shadow copies of few disk properties to virStorageSource

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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.14.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux