]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Don't copy old machines from a domain which has none
authorMark McLoughlin <markmc@redhat.com>
Thu, 15 Oct 2009 11:09:17 +0000 (12:09 +0100)
committerMark McLoughlin <markmc@redhat.com>
Thu, 15 Oct 2009 12:27:57 +0000 (13:27 +0100)
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

index ac63570e90ed7c7cd940650f1164c209bc13ee88..b881f1e4d16d4daaadbd97545b9ab473ecfb20ec 100644 (file)
@@ -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;