On 05/17/2017 10:38 AM, Juan Quintela wrote: > From: "Dr. David Alan Gilbert" <dgilb...@redhat.com> > > 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 <dgilb...@redhat.com> > Signed-off-by: Juan Quintela <quint...@redhat.com> > --- > 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
signature.asc
Description: OpenPGP digital signature