[libvirt] [PATCH 1/2] qemu: set jobinfo type to CANCELLED if migration is cancelled in all conditions

Martin Kletzander mkletzan at redhat.com
Thu Nov 27 10:48:42 UTC 2014


On Thu, Nov 27, 2014 at 04:26:24PM +0800, Wang Rui wrote:
>The migration job status is traced in qemuMigrationUpdateJobStatus which is
>called in qemuMigrationRun. But if migration is cancelled before the trace
>such as in qemuMigrationDriveMirror, the jobinfo type won't be update to
>CANCELLED. After this patch, we can get jobinfo type as CANCELLED if migration
>is cancelled during the drive mirror migration.
>
>Signed-off-by: Wang Rui <moon.wangrui at huawei.com>
>---
> src/qemu/qemu_migration.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
>index a1b1458..c678ba7 100644
>--- a/src/qemu/qemu_migration.c
>+++ b/src/qemu/qemu_migration.c
>@@ -1504,6 +1504,7 @@ qemuMigrationDriveMirror(virQEMUDriverPtr driver,
>                  * as this is a critical section so we are guaranteed
>                  * priv->job.asyncAbort will not change */
>                 qemuDomainObjExitMonitor(driver, vm);
>+                priv->job.current->type = VIR_DOMAIN_JOB_CANCELLED;
>                 virReportError(VIR_ERR_OPERATION_ABORTED, _("%s: %s"),
>                                qemuDomainAsyncJobTypeToString(priv->job.asyncJob),
>                                _("canceled by client"));
>@@ -3611,6 +3612,7 @@ qemuMigrationRun(virQEMUDriverPtr driver,
>          * as this is a critical section so we are guaranteed
>          * priv->job.asyncAbort will not change */
>         qemuDomainObjExitMonitor(driver, vm);
>+        priv->job.current->type = VIR_DOMAIN_JOB_CANCELLED;
>         virReportError(VIR_ERR_OPERATION_ABORTED, _("%s: %s"),
>                        qemuDomainAsyncJobTypeToString(priv->job.asyncJob),
>                        _("canceled by client"));
>--
>1.7.12.4
>

Can't we use qemuMigrationUpdateJobStatus() here?

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141127/a8cf82db/attachment-0001.sig>


More information about the libvir-list mailing list