From 3791f56553ec1b0010e5dd38a49f1a2ead993060 Mon Sep 17 00:00:00 2001
Message-Id: <3791f56553ec1b0010e5dd38a49f1a2ead993060@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 26 Feb 2014 14:55:24 +0100
Subject: [PATCH] conf: Move qemuSnapshotDiskGetActualType to
virDomainSnapshotDiskGetActualType
https://bugzilla.redhat.com/show_bug.cgi?id=1032370
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
(cherry picked from commit 6fb5a397bf896682a242811cf1914f3557172767)
Conflicts:
src/conf/snapshot_conf.c
src/conf/snapshot_conf.h - context conflict as 670e86bf wasn't
backported
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
src/conf/snapshot_conf.c | 7 +++++++
src/conf/snapshot_conf.h | 3 +++
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, 14 insertions(+), 12 deletions(-)
diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index 3510677..a8f32f2 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -1104,3 +1104,10 @@ virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap)
{
return virDomainSnapshotDefIsExternal(snap->def);
}
+
+
+int
+virDomainSnapshotDiskGetActualType(virDomainSnapshotDiskDefPtr def)
+{
+ return def->type;
+}
diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h
index 12ece0c..f46acb3 100644
--- a/src/conf/snapshot_conf.h
+++ b/src/conf/snapshot_conf.h
@@ -174,6 +174,9 @@ int virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots,
bool virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def);
bool virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap);
+
+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 40b997b..5cf7039 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -643,6 +643,7 @@ virDomainSnapshotDefFormat;
virDomainSnapshotDefFree;
virDomainSnapshotDefIsExternal;
virDomainSnapshotDefParseString;
+virDomainSnapshotDiskGetActualType;
virDomainSnapshotDropParent;
virDomainSnapshotFindByName;
virDomainSnapshotForEach;
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 9b02886..7660e7d 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1430,13 +1430,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 e03be95..41edc3b 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -303,8 +303,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 03d94fc..a1145a2 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -12199,7 +12199,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:
@@ -12223,7 +12223,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:
@@ -12275,7 +12275,7 @@ qemuDomainSnapshotPrepareDiskExternal(virConnectPtr conn,
return -1;
}
- actualType = qemuSnapshotDiskGetActualType(snapdisk);
+ actualType = virDomainSnapshotDiskGetActualType(snapdisk);
switch ((enum virDomainDiskType) actualType) {
case VIR_DOMAIN_DISK_TYPE_BLOCK:
--
1.9.0