[PATCH 14/22] qemu: migration: Don't transfer 'allowReboot' flag

Peter Krempa pkrempa at redhat.com
Tue Aug 24 14:44:35 UTC 2021


The original idea was to ensure that the destination has the same
original state of the '-no-reboot' flag to ensure identical behaviour of
the 'vidDomainModifyLifecycleAction' API.

With newer qemu's we'll be able to modify the behaviour using the
monitor so old daemons won't be able to keep up anyways.

Remove this feature as it's not very useful and will be replaced by a
proper solution.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/qemu/qemu_migration.c                     |  5 -----
 src/qemu/qemu_migration_cookie.c              | 22 -------------------
 src/qemu/qemu_migration_cookie.h              |  4 ----
 .../basic-xml2xml-out.xml                     |  1 -
 .../full-xml2xml-out.xml                      |  1 -
 .../modern-dom-out-dest.xml                   |  1 -
 .../modern-dom-out-source.xml                 |  1 -
 .../nbd-bitmaps-xml2xml-out.xml               |  1 -
 8 files changed, 36 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index b441d0226c..dd226ea4bc 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2415,8 +2415,6 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
     if (priv->origCPU)
         cookieFlags |= QEMU_MIGRATION_COOKIE_CPU;

-    cookieFlags |= QEMU_MIGRATION_COOKIE_ALLOW_REBOOT;
-
     if (!(flags & VIR_MIGRATE_OFFLINE))
         cookieFlags |= QEMU_MIGRATION_COOKIE_CAPS;

@@ -2876,7 +2874,6 @@ qemuMigrationDstPrepareAny(virQEMUDriver *driver,
                                          QEMU_MIGRATION_COOKIE_MEMORY_HOTPLUG |
                                          QEMU_MIGRATION_COOKIE_CPU_HOTPLUG |
                                          QEMU_MIGRATION_COOKIE_CPU |
-                                         QEMU_MIGRATION_COOKIE_ALLOW_REBOOT |
                                          QEMU_MIGRATION_COOKIE_CAPS |
                                          QEMU_MIGRATION_COOKIE_BLOCK_DIRTY_BITMAPS)))
         goto cleanup;
@@ -2933,8 +2930,6 @@ qemuMigrationDstPrepareAny(virQEMUDriver *driver,
         goto stopjob;
     stopProcess = true;

-    priv->allowReboot = mig->allowReboot;
-
     if (!(incoming = qemuMigrationDstPrepare(vm, tunnel, protocol,
                                              listenAddress, port,
                                              dataFD[0])))
diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
index b67728f9c0..c7b010f0a0 100644
--- a/src/qemu/qemu_migration_cookie.c
+++ b/src/qemu/qemu_migration_cookie.c
@@ -558,18 +558,6 @@ qemuMigrationCookieAddCPU(qemuMigrationCookie *mig,
 }


-static void
-qemuMigrationCookieAddAllowReboot(qemuMigrationCookie *mig,
-                                  virDomainObj *vm)
-{
-    qemuDomainObjPrivate *priv = vm->privateData;
-
-    mig->allowReboot = priv->allowReboot;
-
-    mig->flags |= QEMU_MIGRATION_COOKIE_ALLOW_REBOOT;
-}
-
-
 static int
 qemuMigrationCookieAddCaps(qemuMigrationCookie *mig,
                            virDomainObj *vm,
@@ -901,9 +889,6 @@ qemuMigrationCookieXMLFormat(virQEMUDriver *driver,
     if (mig->flags & QEMU_MIGRATION_COOKIE_CPU && mig->cpu)
         virCPUDefFormatBufFull(buf, mig->cpu, NULL);

-    if (mig->flags & QEMU_MIGRATION_COOKIE_ALLOW_REBOOT)
-        qemuDomainObjPrivateXMLFormatAllowReboot(buf, mig->allowReboot);
-
     if (mig->flags & QEMU_MIGRATION_COOKIE_CAPS)
         qemuMigrationCookieCapsXMLFormat(buf, mig->caps);

@@ -1407,10 +1392,6 @@ qemuMigrationCookieXMLParse(qemuMigrationCookie *mig,
                           false) < 0)
         return -1;

-    if (flags & QEMU_MIGRATION_COOKIE_ALLOW_REBOOT &&
-        qemuDomainObjPrivateXMLParseAllowReboot(ctxt, &mig->allowReboot) < 0)
-        return -1;
-
     if (flags & QEMU_MIGRATION_COOKIE_CAPS &&
         !(mig->caps = qemuMigrationCookieCapsXMLParse(ctxt)))
         return -1;
@@ -1491,9 +1472,6 @@ qemuMigrationCookieFormat(qemuMigrationCookie *mig,
         qemuMigrationCookieAddCPU(mig, dom) < 0)
         return -1;

-    if (flags & QEMU_MIGRATION_COOKIE_ALLOW_REBOOT)
-        qemuMigrationCookieAddAllowReboot(mig, dom);
-
     if (flags & QEMU_MIGRATION_COOKIE_CAPS &&
         qemuMigrationCookieAddCaps(mig, dom, party) < 0)
         return -1;
diff --git a/src/qemu/qemu_migration_cookie.h b/src/qemu/qemu_migration_cookie.h
index 6ac7b2084c..1726e5f2da 100644
--- a/src/qemu/qemu_migration_cookie.h
+++ b/src/qemu/qemu_migration_cookie.h
@@ -52,7 +52,6 @@ typedef enum {
     QEMU_MIGRATION_COOKIE_MEMORY_HOTPLUG = (1 << QEMU_MIGRATION_COOKIE_FLAG_MEMORY_HOTPLUG),
     QEMU_MIGRATION_COOKIE_CPU_HOTPLUG = (1 << QEMU_MIGRATION_COOKIE_FLAG_CPU_HOTPLUG),
     QEMU_MIGRATION_COOKIE_CPU = (1 << QEMU_MIGRATION_COOKIE_FLAG_CPU),
-    QEMU_MIGRATION_COOKIE_ALLOW_REBOOT = (1 << QEMU_MIGRATION_COOKIE_FLAG_ALLOW_REBOOT),
     QEMU_MIGRATION_COOKIE_CAPS = (1 << QEMU_MIGRATION_COOKIE_FLAG_CAPS),
     QEMU_MIGRATION_COOKIE_BLOCK_DIRTY_BITMAPS = (1 << QEMU_MIGRATION_COOKIE_FLAG_BLOCK_DIRTY_BITMAPS),
 } qemuMigrationCookieFeatures;
@@ -168,9 +167,6 @@ struct _qemuMigrationCookie {
     /* If flags & QEMU_MIGRATION_COOKIE_CPU */
     virCPUDef *cpu;

-    /* If flags & QEMU_MIGRATION_COOKIE_ALLOW_REBOOT */
-    virTristateBool allowReboot;
-
     /* If flags & QEMU_MIGRATION_COOKIE_CAPS */
     qemuMigrationCookieCaps *caps;

diff --git a/tests/qemumigrationcookiexmldata/basic-xml2xml-out.xml b/tests/qemumigrationcookiexmldata/basic-xml2xml-out.xml
index 42b351047e..e05f3c3a83 100644
--- a/tests/qemumigrationcookiexmldata/basic-xml2xml-out.xml
+++ b/tests/qemumigrationcookiexmldata/basic-xml2xml-out.xml
@@ -3,7 +3,6 @@
   <uuid>dcf47dbd-46d1-4d5b-b442-262a806a333a</uuid>
   <hostname>hostname</hostname>
   <hostuuid>4a802f00-4cba-5df6-9679-a08c4c5b577f</hostuuid>
-  <allowReboot value='default'/>
   <capabilities>
   </capabilities>
 </qemu-migration>
diff --git a/tests/qemumigrationcookiexmldata/full-xml2xml-out.xml b/tests/qemumigrationcookiexmldata/full-xml2xml-out.xml
index a07dd1f147..61fcaff13f 100644
--- a/tests/qemumigrationcookiexmldata/full-xml2xml-out.xml
+++ b/tests/qemumigrationcookiexmldata/full-xml2xml-out.xml
@@ -211,7 +211,6 @@
     <auto_converge_throttle>14</auto_converge_throttle>
   </statistics>
   <cpu mode='host-passthrough' check='partial' migratable='on'/>
-  <allowReboot value='yes'/>
   <capabilities>
     <cap name='xbzrle' auto='yes'/>
     <cap name='postcopy-ram' auto='no'/>
diff --git a/tests/qemumigrationcookiexmldata/modern-dom-out-dest.xml b/tests/qemumigrationcookiexmldata/modern-dom-out-dest.xml
index ba84c65a3d..246efc06aa 100644
--- a/tests/qemumigrationcookiexmldata/modern-dom-out-dest.xml
+++ b/tests/qemumigrationcookiexmldata/modern-dom-out-dest.xml
@@ -6,7 +6,6 @@
   <feature name='memory-hotplug'/>
   <feature name='cpu-hotplug'/>
   <graphics type='spice' port='5900' listen='127.0.0.1' tlsPort='-1'/>
-  <allowReboot value='yes'/>
   <capabilities>
   </capabilities>
 </qemu-migration>
diff --git a/tests/qemumigrationcookiexmldata/modern-dom-out-source.xml b/tests/qemumigrationcookiexmldata/modern-dom-out-source.xml
index ba84c65a3d..246efc06aa 100644
--- a/tests/qemumigrationcookiexmldata/modern-dom-out-source.xml
+++ b/tests/qemumigrationcookiexmldata/modern-dom-out-source.xml
@@ -6,7 +6,6 @@
   <feature name='memory-hotplug'/>
   <feature name='cpu-hotplug'/>
   <graphics type='spice' port='5900' listen='127.0.0.1' tlsPort='-1'/>
-  <allowReboot value='yes'/>
   <capabilities>
   </capabilities>
 </qemu-migration>
diff --git a/tests/qemumigrationcookiexmldata/nbd-bitmaps-xml2xml-out.xml b/tests/qemumigrationcookiexmldata/nbd-bitmaps-xml2xml-out.xml
index 09b6fa291c..2bd6de42be 100644
--- a/tests/qemumigrationcookiexmldata/nbd-bitmaps-xml2xml-out.xml
+++ b/tests/qemumigrationcookiexmldata/nbd-bitmaps-xml2xml-out.xml
@@ -29,7 +29,6 @@
     <feature policy='disable' name='npt'/>
     <feature policy='disable' name='nrip-save'/>
   </cpu>
-  <allowReboot value='yes'/>
   <capabilities>
     <cap name='xbzrle' auto='no'/>
     <cap name='auto-converge' auto='no'/>
-- 
2.31.1




More information about the libvir-list mailing list