[PATCH 2/2] qemu: don't update cpu unconditionally for migratable flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Imagine if we use 'virsh dumpxml --migratable' for offline domain
to get config to tweak before migration. Currenly cpu section will
be expanded, host-cpu mode turns into custom and migration fails
because of ABI check.

Looks like ABI check does not make much sence for offline migration
but we don't want host-cpu mode to turn into custom in the first place.
Using --migratable is reasonable in this case because this flags
makes changes for inactive configs too like removing automatically
added parts that old versions can not handle.

I suggest not to update cpu for inactive configs. This appoach is
coherent with the way migration works for inactive configs in case
it is not specified externally to migration: function qemuMigrationCookieXMLFormat
don't expand cpu too.

Adding flag for active configs is useless because qemuDomainFormatXML
will clear it in this case. Thus we can skip adding update flag
altogether.

---

I suppose next usage of libvirt in case one need to migrate with tweaked configs:

inactive domain:

    virsh dumpxml DOM --migratable > dom.xml
    virsh migrate DOM --offline --persistent --xml dom.xml

active domain:

    virsh dumpxml DOM --migratable > active.xml
    virsh dumpxml DOM --migratable --inactive > inactive.xml
    virsh migrate DOM --persistent --xml active.xml --persistent-xml inactive.xml


 src/qemu/qemu_driver.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d9dff93..3223554 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6993,9 +6993,6 @@ static char
     if (qemuDomainUpdateCurrentMemorySize(driver, vm) < 0)
         goto cleanup;
 
-    if ((flags & VIR_DOMAIN_XML_MIGRATABLE))
-        flags |= VIR_DOMAIN_XML_UPDATE_CPU;
-
     ret = qemuDomainFormatXML(driver, vm, flags);
 
  cleanup:
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux