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

Re: [libvirt] [PATCH] Run 'cont' on successful migration finish.



On Fri, Aug 07, 2009 at 11:06:33AM +0200, Chris Lalancette wrote:
> As of qemu 0.10.6, qemu now honors the -S flag on incoming migration.
> That means that when the migration completes, we have to issue a
> 'cont' command to get the VM running again.  We do it unconditionally
> since it won't hurt on older qemu.
> 
> Signed-off-by: Chris Lalancette <clalance redhat com>
> ---
>  src/qemu_driver.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/src/qemu_driver.c b/src/qemu_driver.c
> index bcacd41..1fb2417 100644
> --- a/src/qemu_driver.c
> +++ b/src/qemu_driver.c
> @@ -6600,7 +6600,18 @@ qemudDomainMigrateFinish2 (virConnectPtr dconn,
>       */
>      if (retcode == 0) {
>          dom = virGetDomain (dconn, vm->def->name, vm->def->uuid);
> +
> +        /* run 'cont' on the destination, which allows migration on qemu
> +         * >= 0.10.6 to work properly.  This isn't strictly necessary on
> +         * older qemu's, but it also doesn't hurt anything there
> +         */
> +        if (qemudMonitorCommand(vm, "cont", &info) < 0) {
> +            qemudReportError(dconn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
> +                             "%s", _("resume operation failed"));
> +            goto cleanup;
> +        }
>          VIR_FREE(info);
> +
>          vm->state = VIR_DOMAIN_RUNNING;
>          event = virDomainEventNewFromObj(vm,
>                                           VIR_DOMAIN_EVENT_RESUMED,

ACK

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|


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