[libvirt] [PATCH] qemuProcessHandleMigrationStatus: Update migration status on ASYNC_JOB_SAVE too

Martin Kletzander mkletzan at redhat.com
Mon Jul 13 12:55:30 UTC 2015


On Mon, Jul 13, 2015 at 02:20:50PM +0200, Michal Privoznik wrote:
>After Jirka's migration patches libvirt is listening on migration
>events from qemu instead of actively polling on the monitor. There is,
>however, a little regression (introduced in 6d2edb6a42d0d41). The
>problem is, the current status of migration job is updated in
>qemuProcessHandleMigrationStatus if and only if migration job was
>started. But we have a separate job type for saving a domain into a
>file: QEMU_ASYNC_JOB_SAVE. Therefore, since this job is not strictly a
>migration job, internal state was not updated and later checks failed:
>
>  virsh # save fedora22 /tmp/fedora22_ble.save
>  error: Failed to save domain fedora22 to /tmp/fedora22_ble.save
>  error: operation failed: domain save job: is not active
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> src/qemu/qemu_process.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
>index 2a529f7..16d39b2 100644
>--- a/src/qemu/qemu_process.c
>+++ b/src/qemu/qemu_process.c
>@@ -1521,29 +1521,30 @@ static int
> qemuProcessHandleMigrationStatus(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
>                                  virDomainObjPtr vm,
>                                  int status,
>                                  void *opaque ATTRIBUTE_UNUSED)
> {
>     qemuDomainObjPrivatePtr priv;
>
>     virObjectLock(vm);
>
>     VIR_DEBUG("Migration of domain %p %s changed state to %s",
>               vm, vm->def->name,
>               qemuMonitorMigrationStatusTypeToString(status));
>
>     priv = vm->privateData;
>     if (priv->job.asyncJob != QEMU_ASYNC_JOB_MIGRATION_OUT &&
>-        priv->job.asyncJob != QEMU_ASYNC_JOB_MIGRATION_IN) {
>+        priv->job.asyncJob != QEMU_ASYNC_JOB_MIGRATION_IN &&
>+        priv->job.asyncJob != QEMU_ASYNC_JOB_SAVE) {

I think this should just be if priv->job.asyncJob !=
QEMU_ASYNC_JOB_NONE because all async jobs can ultimately be a
migration.

ACK with that changed.

>         VIR_DEBUG("got MIGRATION event without a migration job");
>         goto cleanup;
>     }
>
>     priv->job.current->status.status = status;
>     virDomainObjBroadcast(vm);
>
>  cleanup:
>     virObjectUnlock(vm);
>     return 0;
> }
>
>
>--
>2.3.6
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150713/8a1420e3/attachment-0001.sig>


More information about the libvir-list mailing list