提交 0d1622a1 编写于 作者: P Peter Krempa

qemu: snapshot: Rename external disk snapshot handling functions

Fix and unify the naming of external snapshot preparation functions.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 e1b61f2c
...@@ -15266,7 +15266,7 @@ typedef qemuDomainSnapshotDiskData *qemuDomainSnapshotDiskDataPtr; ...@@ -15266,7 +15266,7 @@ typedef qemuDomainSnapshotDiskData *qemuDomainSnapshotDiskDataPtr;
static void static void
qemuDomainSnapshotDiskDataCleanup(qemuDomainSnapshotDiskDataPtr data, qemuDomainSnapshotDiskCleanup(qemuDomainSnapshotDiskDataPtr data,
size_t ndata, size_t ndata,
virQEMUDriverPtr driver, virQEMUDriverPtr driver,
virDomainObjPtr vm) virDomainObjPtr vm)
...@@ -15281,7 +15281,7 @@ qemuDomainSnapshotDiskDataCleanup(qemuDomainSnapshotDiskDataPtr data, ...@@ -15281,7 +15281,7 @@ qemuDomainSnapshotDiskDataCleanup(qemuDomainSnapshotDiskDataPtr data,
for (i = 0; i < ndata; i++) { for (i = 0; i < ndata; i++) {
/* on success of the snapshot the 'src' and 'persistsrc' properties will /* on success of the snapshot the 'src' and 'persistsrc' properties will
* be set to NULL by qemuDomainSnapshotUpdateDiskSources */ * be set to NULL by qemuDomainSnapshotDiskUpdateSource */
if (data[i].src) { if (data[i].src) {
if (data[i].created && if (data[i].created &&
virStorageFileUnlink(data[i].src) < 0) { virStorageFileUnlink(data[i].src) < 0) {
...@@ -15307,7 +15307,7 @@ qemuDomainSnapshotDiskDataCleanup(qemuDomainSnapshotDiskDataPtr data, ...@@ -15307,7 +15307,7 @@ qemuDomainSnapshotDiskDataCleanup(qemuDomainSnapshotDiskDataPtr data,
static int static int
qemuDomainSnapshotDiskDataCollectOne(virQEMUDriverPtr driver, qemuDomainSnapshotDiskPrepareOne(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDiskDefPtr disk, virDomainDiskDefPtr disk,
virDomainSnapshotDiskDefPtr snapdisk, virDomainSnapshotDiskDefPtr snapdisk,
...@@ -15366,13 +15366,13 @@ qemuDomainSnapshotDiskDataCollectOne(virQEMUDriverPtr driver, ...@@ -15366,13 +15366,13 @@ qemuDomainSnapshotDiskDataCollectOne(virQEMUDriverPtr driver,
/** /**
* qemuDomainSnapshotDiskDataCollect: * qemuDomainSnapshotDiskPrepare:
* *
* Collects and prepares a list of structures that hold information about disks * Collects and prepares a list of structures that hold information about disks
* that are selected for the snapshot. * that are selected for the snapshot.
*/ */
static int static int
qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr driver, qemuDomainSnapshotDiskPrepare(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainMomentObjPtr snap, virDomainMomentObjPtr snap,
bool reuse, bool reuse,
...@@ -15392,7 +15392,7 @@ qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr driver, ...@@ -15392,7 +15392,7 @@ qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr driver,
if (snapdef->disks[i].snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE) if (snapdef->disks[i].snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE)
continue; continue;
if (qemuDomainSnapshotDiskDataCollectOne(driver, vm, vm->def->disks[i], if (qemuDomainSnapshotDiskPrepareOne(driver, vm, vm->def->disks[i],
snapdef->disks + i, snapdef->disks + i,
data + ndata++, reuse) < 0) data + ndata++, reuse) < 0)
goto cleanup; goto cleanup;
...@@ -15403,13 +15403,13 @@ qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr driver, ...@@ -15403,13 +15403,13 @@ qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr driver,
ret = 0; ret = 0;
cleanup: cleanup:
qemuDomainSnapshotDiskDataCleanup(data, ndata, driver, vm); qemuDomainSnapshotDiskCleanup(data, ndata, driver, vm);
return ret; return ret;
} }
static void static void
qemuDomainSnapshotUpdateDiskSourcesRenumber(virStorageSourcePtr src) qemuDomainSnapshotDiskUpdateSourceRenumber(virStorageSourcePtr src)
{ {
virStorageSourcePtr next; virStorageSourcePtr next;
unsigned int idx = 1; unsigned int idx = 1;
...@@ -15420,7 +15420,7 @@ qemuDomainSnapshotUpdateDiskSourcesRenumber(virStorageSourcePtr src) ...@@ -15420,7 +15420,7 @@ qemuDomainSnapshotUpdateDiskSourcesRenumber(virStorageSourcePtr src)
/** /**
* qemuDomainSnapshotUpdateDiskSources: * qemuDomainSnapshotDiskUpdateSource:
* @driver: QEMU driver * @driver: QEMU driver
* @vm: domain object * @vm: domain object
* @dd: snapshot disk data object * @dd: snapshot disk data object
...@@ -15428,7 +15428,7 @@ qemuDomainSnapshotUpdateDiskSourcesRenumber(virStorageSourcePtr src) ...@@ -15428,7 +15428,7 @@ qemuDomainSnapshotUpdateDiskSourcesRenumber(virStorageSourcePtr src)
* Updates disk definition after a successful snapshot. * Updates disk definition after a successful snapshot.
*/ */
static void static void
qemuDomainSnapshotUpdateDiskSources(virQEMUDriverPtr driver, qemuDomainSnapshotDiskUpdateSource(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
qemuDomainSnapshotDiskDataPtr dd) qemuDomainSnapshotDiskDataPtr dd)
{ {
...@@ -15454,7 +15454,7 @@ qemuDomainSnapshotUpdateDiskSources(virQEMUDriverPtr driver, ...@@ -15454,7 +15454,7 @@ qemuDomainSnapshotUpdateDiskSources(virQEMUDriverPtr driver,
VIR_STEAL_PTR(dd->disk->src, dd->src); VIR_STEAL_PTR(dd->disk->src, dd->src);
/* fix numbering of disks */ /* fix numbering of disks */
qemuDomainSnapshotUpdateDiskSourcesRenumber(dd->disk->src); qemuDomainSnapshotDiskUpdateSourceRenumber(dd->disk->src);
if (dd->persistdisk) { if (dd->persistdisk) {
VIR_STEAL_PTR(dd->persistsrc->backingStore, dd->persistdisk->src); VIR_STEAL_PTR(dd->persistsrc->backingStore, dd->persistdisk->src);
...@@ -15519,7 +15519,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver, ...@@ -15519,7 +15519,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
/* prepare a list of objects to use in the vm definition so that we don't /* prepare a list of objects to use in the vm definition so that we don't
* have to roll back later */ * have to roll back later */
if (qemuDomainSnapshotDiskDataCollect(driver, vm, snap, reuse, if (qemuDomainSnapshotDiskPrepare(driver, vm, snap, reuse,
&diskdata, &ndiskdata) < 0) &diskdata, &ndiskdata) < 0)
goto cleanup; goto cleanup;
...@@ -15554,7 +15554,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver, ...@@ -15554,7 +15554,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
virDomainAuditDisk(vm, dd->disk->src, dd->src, "snapshot", rc >= 0); virDomainAuditDisk(vm, dd->disk->src, dd->src, "snapshot", rc >= 0);
if (rc == 0) if (rc == 0)
qemuDomainSnapshotUpdateDiskSources(driver, vm, dd); qemuDomainSnapshotDiskUpdateSource(driver, vm, dd);
} }
if (rc < 0) if (rc < 0)
...@@ -15568,7 +15568,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver, ...@@ -15568,7 +15568,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
ret = 0; ret = 0;
cleanup: cleanup:
qemuDomainSnapshotDiskDataCleanup(diskdata, ndiskdata, driver, vm); qemuDomainSnapshotDiskCleanup(diskdata, ndiskdata, driver, vm);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册