]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: add a new parse flag VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION
authorPavel Hrdina <phrdina@redhat.com>
Thu, 9 Mar 2017 12:57:54 +0000 (13:57 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Thu, 20 Apr 2017 07:03:53 +0000 (09:03 +0200)
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 <phrdina@redhat.com>
src/conf/domain_conf.c
src/conf/domain_conf.h
src/qemu/qemu_migration_cookie.c

index 9bec68beb22b9fb1691e8539d96e2cb396796456..705deb39a1bfff28b91e8185c2b7f7dec5c42f06 100644 (file)
@@ -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 <memory> 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 */
index 26c0e6b88759108fb5654fbddadd5ae15e874c60..7da554f8ee28eca0eed88ba4c91209d5041d93f4 100644 (file)
@@ -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 {
index bd12f11246a2a046fbad84ab07cfbd8d3ab2c965..12887892db9e2a28353f59af74074ba472393b16 100644 (file)
@@ -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