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

[libvirt] [PATCHv6 2/8] conf: Move qemuSnapshotDiskGetActualType to virDomainSnapshotDiskGetActualType



All the data for getting the actual type is present in the snapshot
config. There is no need to have this function private to the qemu
driver and it will be re-used later in other parts of libvirt
---

Notes:
    Version 6:
    - new in series

 src/conf/snapshot_conf.c | 7 +++++++
 src/conf/snapshot_conf.h | 2 ++
 src/libvirt_private.syms | 1 +
 src/qemu/qemu_conf.c     | 7 -------
 src/qemu/qemu_conf.h     | 2 --
 src/qemu/qemu_driver.c   | 6 +++---
 6 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index bb732a1..12b0930 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -1291,3 +1291,10 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain,
 cleanup:
     return ret;
 }
+
+
+int
+virDomainSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def)
+{
+    return def->type;
+}
diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h
index bcd92dc..59c6d92 100644
--- a/src/conf/snapshot_conf.h
+++ b/src/conf/snapshot_conf.h
@@ -187,6 +187,8 @@ int virDomainSnapshotRedefinePrep(virDomainPtr domain,
                                   bool *update_current,
                                   unsigned int flags);

+int virDomainSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def);
+
 VIR_ENUM_DECL(virDomainSnapshotLocation)
 VIR_ENUM_DECL(virDomainSnapshotState)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index aae6a3b..67d20ed 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -659,6 +659,7 @@ virDomainSnapshotDefFormat;
 virDomainSnapshotDefFree;
 virDomainSnapshotDefIsExternal;
 virDomainSnapshotDefParseString;
+virDomainSnapshotDiskGetActualType;
 virDomainSnapshotDropParent;
 virDomainSnapshotFindByName;
 virDomainSnapshotForEach;
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index dc4ded3..2c397b0 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1465,13 +1465,6 @@ cleanup:


 int
-qemuSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def)
-{
-    return def->type;
-}
-
-
-int
 qemuTranslateSnapshotDiskSourcePool(virConnectPtr conn ATTRIBUTE_UNUSED,
                                     virDomainSnapshotDiskDefPtr def)
 {
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 842b740..c181dc2 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -308,8 +308,6 @@ virDomainXMLOptionPtr virQEMUDriverCreateXMLConf(virQEMUDriverPtr driver);
 int qemuTranslateDiskSourcePool(virConnectPtr conn,
                                 virDomainDiskDefPtr def);

-int qemuSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def);
-
 int qemuTranslateSnapshotDiskSourcePool(virConnectPtr conn,
                                         virDomainSnapshotDiskDefPtr def);

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 6ddbd21..aa2e178 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -12321,7 +12321,7 @@ qemuDomainSnapshotPrepareDiskExternalBackingActive(virDomainDiskDefPtr disk)
 static int
 qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr disk)
 {
-    int actualType = qemuSnapshotDiskGetActualType(disk);
+    int actualType = virDomainSnapshotDiskGetActualType(disk);

     switch ((enum virDomainDiskType) actualType) {
     case VIR_DOMAIN_DISK_TYPE_BLOCK:
@@ -12345,7 +12345,7 @@ qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr d
 static int
 qemuDomainSnapshotPrepareDiskExternalOverlayInactive(virDomainSnapshotDiskDefPtr disk)
 {
-    int actualType = qemuSnapshotDiskGetActualType(disk);
+    int actualType = virDomainSnapshotDiskGetActualType(disk);

     switch ((enum virDomainDiskType) actualType) {
     case VIR_DOMAIN_DISK_TYPE_BLOCK:
@@ -12397,7 +12397,7 @@ qemuDomainSnapshotPrepareDiskExternal(virConnectPtr conn,
             return -1;
     }

-    actualType = qemuSnapshotDiskGetActualType(snapdisk);
+    actualType = virDomainSnapshotDiskGetActualType(snapdisk);

     switch ((enum virDomainDiskType) actualType) {
     case VIR_DOMAIN_DISK_TYPE_BLOCK:
-- 
1.8.5.3


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