render / rpms / libvirt

Forked from rpms/libvirt 4 months ago
Clone
Mark McLoughlin 2c139b
From b7b6a28eb9eae641762de9408a90971d849ce92e Mon Sep 17 00:00:00 2001
Mark McLoughlin 2c139b
From: Mark McLoughlin <markmc@redhat.com>
Mark McLoughlin 2c139b
Date: Thu, 15 Oct 2009 12:09:17 +0100
Mark McLoughlin 2c139b
Subject: [PATCH] Don't copy old machines from a domain which has none
Mark McLoughlin 2c139b
Mark McLoughlin 2c139b
If the the qemu and kvm binaries are the same, we don't include machine
Mark McLoughlin 2c139b
types in the kvm domain info.
Mark McLoughlin 2c139b
Mark McLoughlin 2c139b
However, the code which refreshes the machine types info from the
Mark McLoughlin 2c139b
previous capabilities structure first looks at the kvm domain's info,
Mark McLoughlin 2c139b
finds it matches and then copies the empty machine types list over
Mark McLoughlin 2c139b
for the top-level qemu domain.
Mark McLoughlin 2c139b
Mark McLoughlin 2c139b
That doesn't make sense, we shouldn't copy an empty machin types list.
Mark McLoughlin 2c139b
Mark McLoughlin 2c139b
* src/qemu/qemu_conf.c: qemudGetOldMachinesFromInfo(): don't copy an
Mark McLoughlin 2c139b
  empty machine types list.
Mark McLoughlin 2c139b
Mark McLoughlin 2c139b
(cherry picked from commit 2210f8a3a8e2774ca4fb8b42e21899e5b85ca913)
Mark McLoughlin 2c139b
Mark McLoughlin 2c139b
Fedora-patch: libvirt-qemu-machine-type-fixes2.patch
Mark McLoughlin 2c139b
---
Mark McLoughlin 2c139b
 src/qemu/qemu_conf.c |    3 +++
Mark McLoughlin 2c139b
 1 files changed, 3 insertions(+), 0 deletions(-)
Mark McLoughlin 2c139b
Mark McLoughlin 2c139b
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
Mark McLoughlin 2c139b
index ac63570..b881f1e 100644
Mark McLoughlin 2c139b
--- a/src/qemu/qemu_conf.c
Mark McLoughlin 2c139b
+++ b/src/qemu/qemu_conf.c
Mark McLoughlin 2c139b
@@ -505,6 +505,9 @@ qemudGetOldMachinesFromInfo(virCapsGuestDomainInfoPtr info,
Mark McLoughlin 2c139b
     virCapsGuestMachinePtr *list;
Mark McLoughlin 2c139b
     int i;
Mark McLoughlin 2c139b
 
Mark McLoughlin 2c139b
+    if (!info->nmachines)
Mark McLoughlin 2c139b
+        return 0;
Mark McLoughlin 2c139b
+
Mark McLoughlin 2c139b
     if (!info->emulator || !STREQ(emulator, info->emulator))
Mark McLoughlin 2c139b
         return 0;
Mark McLoughlin 2c139b
 
Mark McLoughlin 2c139b
-- 
Mark McLoughlin 2c139b
1.6.2.5
Mark McLoughlin 2c139b