Index: libvirt-0.6.1/src/capabilities.c
===================================================================
--- libvirt-0.6.1.orig/src/capabilities.c       2009-03-19 15:18:09.483317579 
+0100
+++ libvirt-0.6.1/src/capabilities.c    2009-03-19 15:42:31.027341187 +0100
@@ -468,14 +468,26 @@
  */
 extern const char *
 virCapabilitiesDefaultGuestArch(virCapsPtr caps,
-                                const char *ostype)
+                                const char *ostype,
+                                const char *domain)
 {
-    int i;
+    int i, j;
+    const char *arch = NULL;
     for (i = 0 ; i < caps->nguests ; i++) {
-        if (STREQ(caps->guests[i]->ostype, ostype))
-            return caps->guests[i]->arch.name;
+        if (STREQ(caps->guests[i]->ostype, ostype)) {
+            for (j = 0 ; j < caps->guests[i]->arch.ndomains ; j++) {
+                if (STREQ(caps->guests[i]->arch.domains[j]->type, domain)) {
+                    /* Use the first match... */
+                    if (!arch)
+                        arch = caps->guests[i]->arch.name;
+                    /* ...unless we can match the host's architecture. */
+                    if (STREQ(caps->guests[i]->arch.name, caps->host.arch))
+                        return caps->guests[i]->arch.name;
+                }
+            }
+        }
     }
-    return NULL;
+    return arch;
 }

 /**
Index: libvirt-0.6.1/src/capabilities.h
===================================================================
--- libvirt-0.6.1.orig/src/capabilities.h       2009-03-19 15:18:09.507338228 
+0100
+++ libvirt-0.6.1/src/capabilities.h    2009-03-19 15:42:31.027341187 +0100
@@ -177,7 +177,8 @@

 extern const char *
 virCapabilitiesDefaultGuestArch(virCapsPtr caps,
-                                const char *ostype);
+                                const char *ostype,
+                                const char *domain);
 extern const char *
 virCapabilitiesDefaultGuestMachine(virCapsPtr caps,
                                    const char *ostype,
Index: libvirt-0.6.1/src/domain_conf.c
===================================================================
--- libvirt-0.6.1.orig/src/domain_conf.c        2009-03-19 15:18:09.531341976 
+0100
+++ libvirt-0.6.1/src/domain_conf.c     2009-03-19 15:42:31.031345327 +0100
@@ -2146,7 +2146,7 @@
             goto error;
         }
     } else {
-        const char *defaultArch = virCapabilitiesDefaultGuestArch(caps, 
def->os.type);
+        const char *defaultArch = virCapabilitiesDefaultGuestArch(caps, 
def->os.type, virDomainVirtTypeToString(def->virtType));
         if (defaultArch == NULL) {
             virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
                                  _("no supported architecture for os type 
'%s'"),
Index: libvirt-0.6.1/src/xm_internal.c
===================================================================
--- libvirt-0.6.1.orig/src/xm_internal.c        2009-03-19 15:18:09.559316828 
+0100
+++ libvirt-0.6.1/src/xm_internal.c     2009-03-19 15:42:45.807318313 +0100
@@ -695,7 +695,7 @@
     if (!(def->os.type = strdup(hvm ? "hvm" : "xen")))
         goto no_memory;

-    defaultArch = virCapabilitiesDefaultGuestArch(priv->caps, def->os.type);
+    defaultArch = virCapabilitiesDefaultGuestArch(priv->caps, def->os.type, 
virDomainVirtTypeToString(def->virtType));
     if (defaultArch == NULL) {
         xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
                    _("no supported architecture for os type '%s'"),

--

-- 
Libvirt detection of KVM 64 bit abilities is broke
https://bugs.launchpad.net/bugs/351365
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to