Blame SOURCES/libvirt-conf-Move-qemuSnapshotDiskGetActualType-to-virDomainSnapshotDiskGetActualType.patch

c401cc
From 3791f56553ec1b0010e5dd38a49f1a2ead993060 Mon Sep 17 00:00:00 2001
c401cc
Message-Id: <3791f56553ec1b0010e5dd38a49f1a2ead993060@dist-git>
c401cc
From: Peter Krempa <pkrempa@redhat.com>
c401cc
Date: Wed, 26 Feb 2014 14:55:24 +0100
c401cc
Subject: [PATCH] conf: Move qemuSnapshotDiskGetActualType to
c401cc
 virDomainSnapshotDiskGetActualType
c401cc
c401cc
https://bugzilla.redhat.com/show_bug.cgi?id=1032370
c401cc
c401cc
All the data for getting the actual type is present in the snapshot
c401cc
config. There is no need to have this function private to the qemu
c401cc
driver and it will be re-used later in other parts of libvirt
c401cc
c401cc
(cherry picked from commit 6fb5a397bf896682a242811cf1914f3557172767)
c401cc
c401cc
Conflicts:
c401cc
	src/conf/snapshot_conf.c
c401cc
	src/conf/snapshot_conf.h - context conflict as 670e86bf wasn't
c401cc
    backported
c401cc
c401cc
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c401cc
---
c401cc
 src/conf/snapshot_conf.c | 7 +++++++
c401cc
 src/conf/snapshot_conf.h | 3 +++
c401cc
 src/libvirt_private.syms | 1 +
c401cc
 src/qemu/qemu_conf.c     | 7 -------
c401cc
 src/qemu/qemu_conf.h     | 2 --
c401cc
 src/qemu/qemu_driver.c   | 6 +++---
c401cc
 6 files changed, 14 insertions(+), 12 deletions(-)
c401cc
c401cc
diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
c401cc
index 3510677..a8f32f2 100644
c401cc
--- a/src/conf/snapshot_conf.c
c401cc
+++ b/src/conf/snapshot_conf.c
c401cc
@@ -1104,3 +1104,10 @@ virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap)
c401cc
 {
c401cc
     return virDomainSnapshotDefIsExternal(snap->def);
c401cc
 }
c401cc
+
c401cc
+
c401cc
+int
c401cc
+virDomainSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def)
c401cc
+{
c401cc
+    return def->type;
c401cc
+}
c401cc
diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h
c401cc
index 12ece0c..f46acb3 100644
c401cc
--- a/src/conf/snapshot_conf.h
c401cc
+++ b/src/conf/snapshot_conf.h
c401cc
@@ -174,6 +174,9 @@ int virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots,
c401cc
 bool virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def);
c401cc
 bool virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap);
c401cc
 
c401cc
+
c401cc
+int virDomainSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def);
c401cc
+
c401cc
 VIR_ENUM_DECL(virDomainSnapshotLocation)
c401cc
 VIR_ENUM_DECL(virDomainSnapshotState)
c401cc
 
c401cc
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
c401cc
index 40b997b..5cf7039 100644
c401cc
--- a/src/libvirt_private.syms
c401cc
+++ b/src/libvirt_private.syms
c401cc
@@ -643,6 +643,7 @@ virDomainSnapshotDefFormat;
c401cc
 virDomainSnapshotDefFree;
c401cc
 virDomainSnapshotDefIsExternal;
c401cc
 virDomainSnapshotDefParseString;
c401cc
+virDomainSnapshotDiskGetActualType;
c401cc
 virDomainSnapshotDropParent;
c401cc
 virDomainSnapshotFindByName;
c401cc
 virDomainSnapshotForEach;
c401cc
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
c401cc
index 9b02886..7660e7d 100644
c401cc
--- a/src/qemu/qemu_conf.c
c401cc
+++ b/src/qemu/qemu_conf.c
c401cc
@@ -1430,13 +1430,6 @@ cleanup:
c401cc
 
c401cc
 
c401cc
 int
c401cc
-qemuSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def)
c401cc
-{
c401cc
-    return def->type;
c401cc
-}
c401cc
-
c401cc
-
c401cc
-int
c401cc
 qemuTranslateSnapshotDiskSourcePool(virConnectPtr conn ATTRIBUTE_UNUSED,
c401cc
                                     virDomainSnapshotDiskDefPtr def)
c401cc
 {
c401cc
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
c401cc
index e03be95..41edc3b 100644
c401cc
--- a/src/qemu/qemu_conf.h
c401cc
+++ b/src/qemu/qemu_conf.h
c401cc
@@ -303,8 +303,6 @@ virDomainXMLOptionPtr virQEMUDriverCreateXMLConf(virQEMUDriverPtr driver);
c401cc
 int qemuTranslateDiskSourcePool(virConnectPtr conn,
c401cc
                                 virDomainDiskDefPtr def);
c401cc
 
c401cc
-int qemuSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def);
c401cc
-
c401cc
 int qemuTranslateSnapshotDiskSourcePool(virConnectPtr conn,
c401cc
                                         virDomainSnapshotDiskDefPtr def);
c401cc
 
c401cc
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
c401cc
index 03d94fc..a1145a2 100644
c401cc
--- a/src/qemu/qemu_driver.c
c401cc
+++ b/src/qemu/qemu_driver.c
c401cc
@@ -12199,7 +12199,7 @@ qemuDomainSnapshotPrepareDiskExternalBackingActive(virDomainDiskDefPtr disk)
c401cc
 static int
c401cc
 qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr disk)
c401cc
 {
c401cc
-    int actualType = qemuSnapshotDiskGetActualType(disk);
c401cc
+    int actualType = virDomainSnapshotDiskGetActualType(disk);
c401cc
 
c401cc
     switch ((enum virDomainDiskType) actualType) {
c401cc
     case VIR_DOMAIN_DISK_TYPE_BLOCK:
c401cc
@@ -12223,7 +12223,7 @@ qemuDomainSnapshotPrepareDiskExternalOverlayActive(virDomainSnapshotDiskDefPtr d
c401cc
 static int
c401cc
 qemuDomainSnapshotPrepareDiskExternalOverlayInactive(virDomainSnapshotDiskDefPtr disk)
c401cc
 {
c401cc
-    int actualType = qemuSnapshotDiskGetActualType(disk);
c401cc
+    int actualType = virDomainSnapshotDiskGetActualType(disk);
c401cc
 
c401cc
     switch ((enum virDomainDiskType) actualType) {
c401cc
     case VIR_DOMAIN_DISK_TYPE_BLOCK:
c401cc
@@ -12275,7 +12275,7 @@ qemuDomainSnapshotPrepareDiskExternal(virConnectPtr conn,
c401cc
             return -1;
c401cc
     }
c401cc
 
c401cc
-    actualType = qemuSnapshotDiskGetActualType(snapdisk);
c401cc
+    actualType = virDomainSnapshotDiskGetActualType(snapdisk);
c401cc
 
c401cc
     switch ((enum virDomainDiskType) actualType) {
c401cc
     case VIR_DOMAIN_DISK_TYPE_BLOCK:
c401cc
-- 
c401cc
1.9.0
c401cc