On 02/11/2015 08:16 PM, zhanghailiang wrote: > This capability allows Primary VM (PVM) to be continuously checkpointed > to secondary VM. > > Signed-off-by: zhanghailiang <zhang.zhanghaili...@huawei.com> > Signed-off-by: Yang Hongyang <yan...@cn.fujitsu.com> > Signed-off-by: Gonglei <arei.gong...@huawei.com> > Signed-off-by: Lai Jiangshan <la...@cn.fujitsu.com> > --- > include/migration/migration.h | 1 + > migration/migration.c | 15 +++++++++++++++ > qapi-schema.json | 5 ++++- > 3 files changed, 20 insertions(+), 1 deletion(-) >
> +++ b/migration/migration.c > @@ -276,6 +276,15 @@ void > qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params, > } > > for (cap = params; cap; cap = cap->next) { > +#ifndef CONFIG_COLO > + if (cap->value->capability == MIGRATION_CAPABILITY_COLO && > + cap->value->state) { > + error_setg(errp, "COLO is not currently supported, please" > + " configure with --enable-colo option in order > to" > + " support COLO feature"); > + continue; > + } > +#endif > s->enabled_capabilities[cap->value->capability] = cap->value->state; > } Yuck. This means that probing whether colo is supported requires a usage test (try setting the capability with migrate-set-capabilities and see if it fails) instead of a query test (list the current capabilities; if colo is in the set then it is supported). Can you figure out a way to avoid exposing the colo capability if !CONFIG_COLO, so that query-migate-capabilities is sufficient to learn if colo is supported? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature