提交 4b951d1e 编写于 作者: P Peter Krempa

qemu: snapshot: Don't attempt to resume cpus if they were not paused

External disk-only snapshots with recent enough qemu don't require
libvirt to pause the VM. The logic determining when to resume cpus was
slightly flawed and attempted to resume them even if they were not
paused by the snapshot code. This normally was not a problem, but with
locking enabled the code would attempt to acquire the lock twice.

The fallout of this bug would be a error from the API, but the actual
snapshot being created. The bug was introduced with when adding support
for external snapshots with memory (checkpoints) in commit f569b87f.

Resolves problems described by:
https://bugzilla.redhat.com/show_bug.cgi?id=1403691
上级 e8f167a6
...@@ -14472,8 +14472,6 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, ...@@ -14472,8 +14472,6 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PMSUSPENDED) { if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PMSUSPENDED) {
pmsuspended = true; pmsuspended = true;
} else if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) { } else if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
resume = true;
/* For external checkpoints (those with memory), the guest /* For external checkpoints (those with memory), the guest
* must pause (either by libvirt up front, or by qemu after * must pause (either by libvirt up front, or by qemu after
* _LIVE converges). For disk-only snapshots with multiple * _LIVE converges). For disk-only snapshots with multiple
...@@ -14496,6 +14494,8 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn, ...@@ -14496,6 +14494,8 @@ qemuDomainSnapshotCreateActiveExternal(virConnectPtr conn,
_("guest unexpectedly quit")); _("guest unexpectedly quit"));
goto cleanup; goto cleanup;
} }
resume = true;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册