]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Look up machine types from all domains in qemudGetOldMachines()
authorMark McLoughlin <markmc@redhat.com>
Mon, 7 Sep 2009 11:50:36 +0000 (12:50 +0100)
committerMark McLoughlin <markmc@redhat.com>
Thu, 10 Sep 2009 11:37:42 +0000 (12:37 +0100)
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

index 882f9f9145be61a26c222b93c7fb3fe11216428f..0d498c2ed6c195a0f3b193dffef0168c63009eb4 100644 (file)
@@ -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))