[libvirt] [PATCH 13/15] qemu: Send updated CPU in migration cookie

Pavel Hrdina phrdina at redhat.com
Wed Jun 7 07:00:35 UTC 2017


On Mon, Jun 05, 2017 at 11:27:01AM +0200, Jiri Denemark wrote:
> Since the domain XML send during migration uses the original guest CPU
> definition but we still want the destination to enforce ABI if it is new
> enough, we send the live updated CPU definition in a migration cookie.
> 
> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> ---
>  src/qemu/qemu_migration.c        | 11 ++++++++---
>  src/qemu/qemu_migration_cookie.c | 31 ++++++++++++++++++++++++++++++-
>  src/qemu/qemu_migration_cookie.h |  5 +++++
>  3 files changed, 43 insertions(+), 4 deletions(-)
> 
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 2cd862875..134c76c5e 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -2020,6 +2020,9 @@ qemuMigrationBeginPhase(virQEMUDriverPtr driver,
>           vm->newDef && !qemuDomainVcpuHotplugIsInOrder(vm->newDef)))
>          cookieFlags |= QEMU_MIGRATION_COOKIE_CPU_HOTPLUG;
>  
> +    if (priv->origCPU)
> +        cookieFlags |= QEMU_MIGRATION_COOKIE_CPU;
> +
>      if (!(mig = qemuMigrationEatCookie(driver, vm, NULL, 0, 0)))
>          goto cleanup;
>  
> @@ -2644,7 +2647,8 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
>                                         QEMU_MIGRATION_COOKIE_LOCKSTATE |
>                                         QEMU_MIGRATION_COOKIE_NBD |
>                                         QEMU_MIGRATION_COOKIE_MEMORY_HOTPLUG |
> -                                       QEMU_MIGRATION_COOKIE_CPU_HOTPLUG)))
> +                                       QEMU_MIGRATION_COOKIE_CPU_HOTPLUG |
> +                                       QEMU_MIGRATION_COOKIE_CPU)))
>          goto cleanup;
>  
>      if (STREQ_NULLABLE(protocol, "rdma") &&
> @@ -3644,8 +3648,9 @@ qemuMigrationRun(virQEMUDriverPtr driver,
>              if (!(persistDef = qemuMigrationPrepareDef(driver, persist_xml,
>                                                         NULL, NULL)))
>                  goto cleanup;
> -        } else if (vm->newDef) {
> -            if (!(persistDef = qemuDomainDefCopy(driver, vm->newDef,
> +        } else {
> +            virDomainDefPtr def = vm->newDef ? vm->newDef : vm->def;
> +            if (!(persistDef = qemuDomainDefCopy(driver, def,
>                                                   VIR_DOMAIN_XML_SECURE |
>                                                   VIR_DOMAIN_XML_MIGRATABLE)))

This hunk should be in a separate patch because it doesn't have anything
in common with the rest of the patch.

Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170607/98c37f1b/attachment-0001.sig>


More information about the libvir-list mailing list