From d302b5896ecaf2dbbec5d2cfe199953b80811282 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Tue, 5 Dec 2017 14:06:13 +0100 Subject: [PATCH] util: storage: Add shadow copies of few disk properties to virStorageSource 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 Reviewed-by: John Ferlan --- 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 b10a40e545..eae1dc01dc 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 0909fe212c..03e9ba9d2d 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 */ }; -- GitLab