|
|
9119d9 |
From 70735dbc64bdc1331ef4bc1cb89a86232e114ee6 Mon Sep 17 00:00:00 2001
|
|
|
9119d9 |
Message-Id: <70735dbc64bdc1331ef4bc1cb89a86232e114ee6@dist-git>
|
|
|
9119d9 |
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
9119d9 |
Date: Mon, 8 Sep 2014 13:24:19 +0200
|
|
|
9119d9 |
Subject: [PATCH] qemu: snapshot: Fix snapshot function header formatting and
|
|
|
9119d9 |
spacing
|
|
|
9119d9 |
|
|
|
9119d9 |
https://bugzilla.redhat.com/show_bug.cgi?id=1134154
|
|
|
9119d9 |
|
|
|
9119d9 |
(cherry picked from commit d03044717dd8f41991bb0eb959e7aa5fba3de79a)
|
|
|
9119d9 |
|
|
|
9119d9 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
9119d9 |
---
|
|
|
9119d9 |
src/qemu/qemu_driver.c | 70 ++++++++++++++++++++++++++++++++++++--------------
|
|
|
9119d9 |
1 file changed, 51 insertions(+), 19 deletions(-)
|
|
|
9119d9 |
|
|
|
9119d9 |
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
|
9119d9 |
index fb4b508..d02c76d 100644
|
|
|
9119d9 |
--- a/src/qemu/qemu_driver.c
|
|
|
9119d9 |
+++ b/src/qemu/qemu_driver.c
|
|
|
9119d9 |
@@ -12193,6 +12193,7 @@ qemuDomainSnapshotFSFreeze(virQEMUDriverPtr driver,
|
|
|
9119d9 |
return frozen < 0 ? -2 : frozen;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
/* Return -1 on error, otherwise number of thawed filesystems. */
|
|
|
9119d9 |
static int
|
|
|
9119d9 |
qemuDomainSnapshotFSThaw(virQEMUDriverPtr driver,
|
|
|
9119d9 |
@@ -12238,6 +12239,7 @@ qemuDomainSnapshotFSThaw(virQEMUDriverPtr driver,
|
|
|
9119d9 |
return thawed;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
/* The domain is expected to be locked and inactive. */
|
|
|
9119d9 |
static int
|
|
|
9119d9 |
qemuDomainSnapshotCreateInactiveInternal(virQEMUDriverPtr driver,
|
|
|
9119d9 |
@@ -12247,6 +12249,7 @@ qemuDomainSnapshotCreateInactiveInternal(virQEMUDriverPtr driver,
|
|
|
9119d9 |
return qemuDomainSnapshotForEachQcow2(driver, vm, snap, "-c", false);
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
/* The domain is expected to be locked and inactive. */
|
|
|
9119d9 |
static int
|
|
|
9119d9 |
qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
|
|
|
9119d9 |
@@ -12428,6 +12431,7 @@ qemuDomainSnapshotCreateActiveInternal(virConnectPtr conn,
|
|
|
9119d9 |
return ret;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
static int
|
|
|
9119d9 |
qemuDomainSnapshotPrepareDiskExternalBackingInactive(virDomainDiskDefPtr disk)
|
|
|
9119d9 |
{
|
|
|
9119d9 |
@@ -12833,6 +12837,7 @@ qemuDomainSnapshotPrepare(virConnectPtr conn,
|
|
|
9119d9 |
return ret;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
/* The domain is expected to hold monitor lock. */
|
|
|
9119d9 |
static int
|
|
|
9119d9 |
qemuDomainSnapshotCreateSingleDiskActive(virQEMUDriverPtr driver,
|
|
|
9119d9 |
@@ -12951,6 +12956,7 @@ qemuDomainSnapshotCreateSingleDiskActive(virQEMUDriverPtr driver,
|
|
|
9119d9 |
return ret;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
/* The domain is expected to hold monitor lock. This is the
|
|
|
9119d9 |
* counterpart to qemuDomainSnapshotCreateSingleDiskActive, called
|
|
|
9119d9 |
* only on a failed transaction. */
|
|
|
9119d9 |
@@ -12989,6 +12995,7 @@ qemuDomainSnapshotUndoSingleDiskActive(virQEMUDriverPtr driver,
|
|
|
9119d9 |
}
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
/* The domain is expected to be locked and active. */
|
|
|
9119d9 |
static int
|
|
|
9119d9 |
qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
|
|
|
9119d9 |
@@ -13594,9 +13601,12 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
|
|
|
9119d9 |
return snapshot;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
-static int qemuDomainSnapshotListNames(virDomainPtr domain, char **names,
|
|
|
9119d9 |
- int nameslen,
|
|
|
9119d9 |
- unsigned int flags)
|
|
|
9119d9 |
+
|
|
|
9119d9 |
+static int
|
|
|
9119d9 |
+qemuDomainSnapshotListNames(virDomainPtr domain,
|
|
|
9119d9 |
+ char **names,
|
|
|
9119d9 |
+ int nameslen,
|
|
|
9119d9 |
+ unsigned int flags)
|
|
|
9119d9 |
{
|
|
|
9119d9 |
virDomainObjPtr vm = NULL;
|
|
|
9119d9 |
int n = -1;
|
|
|
9119d9 |
@@ -13619,8 +13629,10 @@ static int qemuDomainSnapshotListNames(virDomainPtr domain, char **names,
|
|
|
9119d9 |
return n;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
-static int qemuDomainSnapshotNum(virDomainPtr domain,
|
|
|
9119d9 |
- unsigned int flags)
|
|
|
9119d9 |
+
|
|
|
9119d9 |
+static int
|
|
|
9119d9 |
+qemuDomainSnapshotNum(virDomainPtr domain,
|
|
|
9119d9 |
+ unsigned int flags)
|
|
|
9119d9 |
{
|
|
|
9119d9 |
virDomainObjPtr vm = NULL;
|
|
|
9119d9 |
int n = -1;
|
|
|
9119d9 |
@@ -13642,8 +13654,10 @@ static int qemuDomainSnapshotNum(virDomainPtr domain,
|
|
|
9119d9 |
return n;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
static int
|
|
|
9119d9 |
-qemuDomainListAllSnapshots(virDomainPtr domain, virDomainSnapshotPtr **snaps,
|
|
|
9119d9 |
+qemuDomainListAllSnapshots(virDomainPtr domain,
|
|
|
9119d9 |
+ virDomainSnapshotPtr **snaps,
|
|
|
9119d9 |
unsigned int flags)
|
|
|
9119d9 |
{
|
|
|
9119d9 |
virDomainObjPtr vm = NULL;
|
|
|
9119d9 |
@@ -13666,6 +13680,7 @@ qemuDomainListAllSnapshots(virDomainPtr domain, virDomainSnapshotPtr **snaps,
|
|
|
9119d9 |
return n;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
static int
|
|
|
9119d9 |
qemuDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
char **names,
|
|
|
9119d9 |
@@ -13697,6 +13712,7 @@ qemuDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
return n;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
static int
|
|
|
9119d9 |
qemuDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
unsigned int flags)
|
|
|
9119d9 |
@@ -13725,6 +13741,7 @@ qemuDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
return n;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
static int
|
|
|
9119d9 |
qemuDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
virDomainSnapshotPtr **snaps,
|
|
|
9119d9 |
@@ -13755,9 +13772,11 @@ qemuDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
return n;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
-static virDomainSnapshotPtr qemuDomainSnapshotLookupByName(virDomainPtr domain,
|
|
|
9119d9 |
- const char *name,
|
|
|
9119d9 |
- unsigned int flags)
|
|
|
9119d9 |
+
|
|
|
9119d9 |
+static virDomainSnapshotPtr
|
|
|
9119d9 |
+qemuDomainSnapshotLookupByName(virDomainPtr domain,
|
|
|
9119d9 |
+ const char *name,
|
|
|
9119d9 |
+ unsigned int flags)
|
|
|
9119d9 |
{
|
|
|
9119d9 |
virDomainObjPtr vm;
|
|
|
9119d9 |
virDomainSnapshotObjPtr snap = NULL;
|
|
|
9119d9 |
@@ -13782,8 +13801,10 @@ static virDomainSnapshotPtr qemuDomainSnapshotLookupByName(virDomainPtr domain,
|
|
|
9119d9 |
return snapshot;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
-static int qemuDomainHasCurrentSnapshot(virDomainPtr domain,
|
|
|
9119d9 |
- unsigned int flags)
|
|
|
9119d9 |
+
|
|
|
9119d9 |
+static int
|
|
|
9119d9 |
+qemuDomainHasCurrentSnapshot(virDomainPtr domain,
|
|
|
9119d9 |
+ unsigned int flags)
|
|
|
9119d9 |
{
|
|
|
9119d9 |
virDomainObjPtr vm;
|
|
|
9119d9 |
int ret = -1;
|
|
|
9119d9 |
@@ -13804,6 +13825,7 @@ static int qemuDomainHasCurrentSnapshot(virDomainPtr domain,
|
|
|
9119d9 |
return ret;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
static virDomainSnapshotPtr
|
|
|
9119d9 |
qemuDomainSnapshotGetParent(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
unsigned int flags)
|
|
|
9119d9 |
@@ -13838,8 +13860,10 @@ qemuDomainSnapshotGetParent(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
return parent;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
-static virDomainSnapshotPtr qemuDomainSnapshotCurrent(virDomainPtr domain,
|
|
|
9119d9 |
- unsigned int flags)
|
|
|
9119d9 |
+
|
|
|
9119d9 |
+static virDomainSnapshotPtr
|
|
|
9119d9 |
+qemuDomainSnapshotCurrent(virDomainPtr domain,
|
|
|
9119d9 |
+ unsigned int flags)
|
|
|
9119d9 |
{
|
|
|
9119d9 |
virDomainObjPtr vm;
|
|
|
9119d9 |
virDomainSnapshotPtr snapshot = NULL;
|
|
|
9119d9 |
@@ -13866,8 +13890,10 @@ static virDomainSnapshotPtr qemuDomainSnapshotCurrent(virDomainPtr domain,
|
|
|
9119d9 |
return snapshot;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
-static char *qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
- unsigned int flags)
|
|
|
9119d9 |
+
|
|
|
9119d9 |
+static char *
|
|
|
9119d9 |
+qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
+ unsigned int flags)
|
|
|
9119d9 |
{
|
|
|
9119d9 |
virDomainObjPtr vm = NULL;
|
|
|
9119d9 |
char *xml = NULL;
|
|
|
9119d9 |
@@ -13895,6 +13921,7 @@ static char *qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
return xml;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
static int
|
|
|
9119d9 |
qemuDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
unsigned int flags)
|
|
|
9119d9 |
@@ -13954,6 +13981,7 @@ qemuDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
return ret;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
/* The domain is expected to be locked and inactive. */
|
|
|
9119d9 |
static int
|
|
|
9119d9 |
qemuDomainSnapshotRevertInactive(virQEMUDriverPtr driver,
|
|
|
9119d9 |
@@ -13965,8 +13993,10 @@ qemuDomainSnapshotRevertInactive(virQEMUDriverPtr driver,
|
|
|
9119d9 |
return ret > 0 ? -1 : ret;
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
-static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
- unsigned int flags)
|
|
|
9119d9 |
+
|
|
|
9119d9 |
+static int
|
|
|
9119d9 |
+qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
+ unsigned int flags)
|
|
|
9119d9 |
{
|
|
|
9119d9 |
virQEMUDriverPtr driver = snapshot->domain->conn->privateData;
|
|
|
9119d9 |
virDomainObjPtr vm = NULL;
|
|
|
9119d9 |
@@ -14337,6 +14367,7 @@ struct _virQEMUSnapReparent {
|
|
|
9119d9 |
virDomainSnapshotObjPtr last;
|
|
|
9119d9 |
};
|
|
|
9119d9 |
|
|
|
9119d9 |
+
|
|
|
9119d9 |
static void
|
|
|
9119d9 |
qemuDomainSnapshotReparentChildren(void *payload,
|
|
|
9119d9 |
const void *name ATTRIBUTE_UNUSED,
|
|
|
9119d9 |
@@ -14366,8 +14397,9 @@ qemuDomainSnapshotReparentChildren(void *payload,
|
|
|
9119d9 |
}
|
|
|
9119d9 |
|
|
|
9119d9 |
|
|
|
9119d9 |
-static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
- unsigned int flags)
|
|
|
9119d9 |
+static int
|
|
|
9119d9 |
+qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
|
|
|
9119d9 |
+ unsigned int flags)
|
|
|
9119d9 |
{
|
|
|
9119d9 |
virQEMUDriverPtr driver = snapshot->domain->conn->privateData;
|
|
|
9119d9 |
virDomainObjPtr vm = NULL;
|
|
|
9119d9 |
--
|
|
|
9119d9 |
2.1.0
|
|
|
9119d9 |
|