[libvirt] [PATCH 07/10] Look up machine types from all domains in qemudGetOldMachines()

Mark McLoughlin markmc at redhat.com
Thu Sep 10 11:35:15 UTC 2009


Rather than just looking at the default domain info, look at all
domains

* src/qemu_conf.c: look at all domains in qemudGetOldMachines()
---
 src/qemu_conf.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index 882f9f9..0d498c2 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -554,12 +554,22 @@ qemudGetOldMachines(const char *ostype,
 
     for (i = 0; i < old_caps->nguests; i++) {
         virCapsGuestPtr guest = old_caps->guests[i];
+        int j;
 
         if (!STREQ(ostype, guest->ostype) ||
             !STREQ(arch, guest->arch.name) ||
             wordsize != guest->arch.wordsize)
             continue;
 
+        for (j = 0; j < guest->arch.ndomains; j++) {
+            virCapsGuestDomainPtr dom = guest->arch.domains[j];
+
+            if (qemudGetOldMachinesFromInfo(&dom->info,
+                                            emulator, emulator_mtime,
+                                            machines, nmachines))
+                return 1;
+        }
+
         if (qemudGetOldMachinesFromInfo(&guest->arch.defaultInfo,
                                         emulator, emulator_mtime,
                                         machines, nmachines))
-- 
1.6.2.5




More information about the libvir-list mailing list