[libvirt] [PATCH] Don't copy old machines from a domain which has none

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

 



If the the qemu and kvm binaries are the same, we don't include machine
types in the kvm domain info.

However, the code which refreshes the machine types info from the
previous capabilities structure first looks at the kvm domain's info,
finds it matches and then copies the empty machine types list over
for the top-level qemu domain.

That doesn't make sense, we shouldn't copy an empty machin types list.

* src/qemu/qemu_conf.c: qemudGetOldMachinesFromInfo(): don't copy an
  empty machine types list.
---
 src/qemu/qemu_conf.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index ac63570..b881f1e 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -505,6 +505,9 @@ qemudGetOldMachinesFromInfo(virCapsGuestDomainInfoPtr info,
     virCapsGuestMachinePtr *list;
     int i;
 
+    if (!info->nmachines)
+        return 0;
+
     if (!info->emulator || !STREQ(emulator, info->emulator))
         return 0;
 
-- 
1.6.2.5

--
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]