From: Pavel Hrdina Date: Thu, 9 Mar 2017 12:57:54 +0000 (+0100) Subject: conf: add a new parse flag VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION X-Git-Tag: v3.3.0-rc1~121 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c7d88085a762cf4ecc9416a3b7581fa45738c2a;p=thirdparty%2Flibvirt.git conf: add a new parse flag VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION So far there is probably no change that is allowed to be done by the VIR_DOMAIN_DEF_PARSE_ABI_UPDATE flag that would break guest ABI but this may change in the future. This introduces new VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION which should be used only for ABI updates that are "safe" for persistent migration. Signed-off-by: Pavel Hrdina --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9bec68beb2..705deb39a1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3818,7 +3818,8 @@ virDomainDefPostParseMemory(virDomainDefPtr def, /* Attempt to infer the initial memory size from the sum NUMA memory sizes * in case ABI updates are allowed or the element wasn't specified */ if (def->mem.total_memory == 0 || - parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) + parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE || + parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION) numaMemory = virDomainNumaGetMemorySize(def->numa); /* calculate the sizes of hotplug memory */ diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 26c0e6b887..7da554f8ee 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2726,6 +2726,10 @@ typedef enum { VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE = 1 << 10, /* skip parsing of security labels */ VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL = 1 << 11, + /* Allows updates in post parse callback for incoming persistent migration + * that would break ABI otherwise. This should be used only if it's safe + * to do such change. */ + VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION = 1 << 12, } virDomainDefParseFlags; typedef enum { diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c index bd12f11246..12887892db 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -1173,7 +1173,7 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig, mig->persistent = virDomainDefParseNode(doc, nodes[0], caps, driver->xmlopt, NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE | - VIR_DOMAIN_DEF_PARSE_ABI_UPDATE | + VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE); if (!mig->persistent) { /* virDomainDefParseNode already reported