qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 5/5] block migration: Allow compile time disable


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 5/5] block migration: Allow compile time disable
Date: Wed, 17 May 2017 11:01:39 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 05/17/2017 10:38 AM, Juan Quintela wrote:
> From: "Dr. David Alan Gilbert" <address@hidden>
> 
> Many users now prefer to use drive_mirror over NBD as an
> alternative to the older migrate -b option; drive_mirror is
> more complex to setup but gives you more options (e.g. only
> migrating some of the disks if some of them are shared).
> 
> Allow the large chunk of block migration code to be compiled
> out for those who don't use it.
> 
> Based on a downstream-patch we've had for a while by Jeff Cody.
> 
> Signed-off-by: Dr. David Alan Gilbert <address@hidden>
> Signed-off-by: Juan Quintela <address@hidden>
> ---
>  configure                 | 11 +++++++++++
>  include/migration/block.h | 24 +++++++++++++++++++++++-
>  migration/Makefile.objs   |  2 +-
>  migration/migration.c     | 13 +++++++++++++
>  4 files changed, 48 insertions(+), 2 deletions(-)

> @@ -763,6 +768,14 @@ void 
> qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params,
>      }
>  
>      for (cap = params; cap; cap = cap->next) {
> +#ifndef CONFIG_LIVE_BLOCK_MIGRATION
> +        if (cap->value->capability == MIGRATION_CAPABILITY_BLOCK) {
> +            error_setg(errp, "QEMU compiled without old-style (blk/-b, 
> inc/-i) "
> +                       "block migration");
> +            error_append_hint(errp, "Use drive_mirror+NBD instead.\n");
> +            continue;
> +        }
> +#endif

If I'm not mistaken, this will cause an unconditional error even if I do
the QMP { "command":"migrate", "arguments":{"uri":"...", "blk":false} }

Wouldn't it be better to make the conditional:

if (cap->value->capability == MIGRATION_CAPABILITY_BLOCK &&
cap->value->state) {

so that I can pass an explicit false, and the error only happens when
trying to set the optional parameter to true?  I ask, because libvirt
(currently) ALWAYS passes the "inc" and "blk" QMP parameters, but
generally to an explicit false when it uses NBD+mirror.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]