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

[libvirt] [PATCH 2/3] qemu: support updating pool and volume info when disk is volume type



---
 src/conf/domain_conf.c   | 2 +-
 src/conf/domain_conf.h   | 1 +
 src/libvirt_private.syms | 1 +
 src/qemu/qemu_driver.c   | 5 +++++
 4 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a9656af..776c1ed 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1152,7 +1152,7 @@ void virDomainLeaseDefFree(virDomainLeaseDefPtr def)
     VIR_FREE(def);
 }
 
-static void
+void
 virDomainDiskSourcePoolDefFree(virDomainDiskSourcePoolDefPtr def)
 {
     if (!def)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 3a71d6c..ce8e744 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2125,6 +2125,7 @@ bool virDomainObjTaint(virDomainObjPtr obj,
 void virDomainResourceDefFree(virDomainResourceDefPtr resource);
 void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def);
 void virDomainInputDefFree(virDomainInputDefPtr def);
+void virDomainDiskSourcePoolDefFree(virDomainDiskSourcePoolDefPtr def);
 void virDomainDiskDefFree(virDomainDiskDefPtr def);
 void virDomainLeaseDefFree(virDomainLeaseDefPtr def);
 void virDomainDiskHostDefFree(virDomainDiskHostDefPtr def);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 9d5f74b..1e7e7e2 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -161,6 +161,7 @@ virDomainDiskProtocolTransportTypeToString;
 virDomainDiskProtocolTypeToString;
 virDomainDiskRemove;
 virDomainDiskRemoveByName;
+virDomainDiskSourcePoolDefFree;
 virDomainDiskTypeFromString;
 virDomainDiskTypeToString;
 virDomainEmulatorPinAdd;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 4a76f14..7ee1c47 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6322,6 +6322,11 @@ qemuDomainUpdateDeviceConfig(virQEMUCapsPtr qemuCaps,
         }
         if (disk->format)
             orig->format = disk->format;
+        if (disk->srcpool) {
+            virDomainDiskSourcePoolDefFree(orig->srcpool);
+            orig->srcpool = disk->srcpool;
+            disk->srcpool = NULL;
+        }
         disk->src = NULL;
         break;
 
-- 
1.8.1.4


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