1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-04-01 20:05:19 +00:00

qemu: snapshot: Remove monitor code now that 'transaction' is always used

Since we now always do the snapshot via the 'transaction' command we can
drop the code which would enter monitor for individual disk snapshots.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2018-06-05 14:56:01 +02:00
parent aa65f0f2f1
commit d5d02aa900

View File

@ -14928,14 +14928,12 @@ qemuDomainSnapshotUpdateDiskSources(qemuDomainSnapshotDiskDataPtr dd,
}
/* The domain is expected to hold monitor lock. */
static int
qemuDomainSnapshotCreateSingleDiskActive(virQEMUDriverPtr driver,
virDomainObjPtr vm,
qemuDomainSnapshotDiskDataPtr dd,
virJSONValuePtr actions,
bool reuse,
qemuDomainAsyncJob asyncJob)
bool reuse)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
char *device = NULL;
@ -14967,23 +14965,10 @@ qemuDomainSnapshotCreateSingleDiskActive(virQEMUDriverPtr driver,
dd->prepared = true;
/* create the actual snapshot */
formatStr = virStorageFileFormatTypeToString(dd->src->format);
/* The monitor is only accessed if qemu doesn't support transactions.
* Otherwise the following monitor command only constructs the command.
*/
if (!actions &&
qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
goto cleanup;
ret = rc = qemuMonitorDiskSnapshot(priv->mon, actions, device, source,
formatStr, reuse);
if (!actions) {
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -1;
}
virDomainAuditDisk(vm, dd->disk->src, dd->src, "snapshot", rc >= 0);
cleanup:
@ -15035,11 +15020,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
ret = qemuDomainSnapshotCreateSingleDiskActive(driver, vm,
&diskdata[i],
actions, reuse, asyncJob);
/* without transaction support the change can't be rolled back */
if (!actions)
qemuDomainSnapshotUpdateDiskSources(&diskdata[i], &persist);
actions, reuse);
if (ret < 0)
goto error;
@ -15047,7 +15028,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
do_transaction = true;
}
if (actions && do_transaction) {
if (do_transaction) {
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
goto cleanup;