diff options
author | Michal Privoznik <mprivozn@redhat.com> | 2012-09-19 11:23:11 +0200 |
---|---|---|
committer | Michal Privoznik <mprivozn@redhat.com> | 2012-09-20 10:15:27 +0200 |
commit | a5e8beef4fcb8be636136a2127239dceb459995c (patch) | |
tree | 7553e5c327e457ea73899af56e6af34dc4b1a015 /src | |
parent | network: fix element size / length in memmove (diff) | |
download | libvirt-a5e8beef4fcb8be636136a2127239dceb459995c.tar.gz libvirt-a5e8beef4fcb8be636136a2127239dceb459995c.tar.bz2 libvirt-a5e8beef4fcb8be636136a2127239dceb459995c.zip |
qemu: Transition domain to PAUSED after 'stop' command
Currently, we mark domain PAUSED (but not emit an event)
just before we issue 'stop' on monitor; This command can
take ages to finish, esp. when domain's doing a lot of
IO - users can enforce qemu to open files with O_DIRECT
which doesn't return from write() until data reaches the
block device. Having said that, we report PAUSED even if
domain is not paused yet.
Diffstat (limited to 'src')
-rw-r--r-- | src/qemu/qemu_process.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index c28f5a564..b6eb342c7 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2708,13 +2708,9 @@ int qemuProcessStopCPUs(struct qemud_driver *driver, virDomainObjPtr vm, enum qemuDomainAsyncJob asyncJob) { int ret; - int oldState; - int oldReason; qemuDomainObjPrivatePtr priv = vm->privateData; VIR_FREE(priv->lockState); - oldState = virDomainObjGetState(vm, &oldReason); - virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, reason); ret = qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob); if (ret == 0) { @@ -2723,11 +2719,10 @@ int qemuProcessStopCPUs(struct qemud_driver *driver, virDomainObjPtr vm, } if (ret == 0) { + virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, reason); if (virDomainLockProcessPause(driver->lockManager, vm, &priv->lockState) < 0) VIR_WARN("Unable to release lease on %s", vm->def->name); VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState)); - } else { - virDomainObjSetState(vm, oldState, oldReason); } return ret; |