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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]