]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: storage: Add shadow copies of few disk properties to virStorageSource
authorPeter Krempa <pkrempa@redhat.com>
Tue, 5 Dec 2017 13:06:13 +0000 (14:06 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 7 May 2018 12:47:43 +0000 (14:47 +0200)
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@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/util/virstoragefile.c
src/util/virstoragefile.h

index b10a40e545c8be96109681c2c6b46e57beba1293..eae1dc01dc0314b7cf4571393228d87e8f2ddae4 100644 (file)
@@ -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;
index 0909fe212c521547ec22cc549643997f79f38f48..03e9ba9d2dd8f63ceef66cb9b551181ea5f42eb1 100644 (file)
@@ -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 */
 };