[libvirt] [libvirt-designer 1/2] Fix libvirt caps -> libosinfo platform short id mapping

Christophe Fergeau cfergeau at redhat.com
Tue Mar 19 09:46:35 UTC 2013


The code was building an id starting with kvm- while libosinfo qemu
description uses qemu-kvm-. Also, starting from qemu 1.2.0, there is
no separate qemu-kvm tarball.
guess_platform_from_connect is starting to be a bit magic, it may
be better to add a <machine> attribute to libosinfo <platform>
description and to use this to improve the matching between
libosinfo data and libvirt caps.
---
 examples/virtxml.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/virtxml.c b/examples/virtxml.c
index 09f49cf..a68843d 100644
--- a/examples/virtxml.c
+++ b/examples/virtxml.c
@@ -442,13 +442,13 @@ guess_platform_from_connect(GVirConnection *conn)
     }
 
     /* do some mappings:
-     * QEMU -> kvm
+     * QEMU -> qemu-kvm
      * Xen -> xen
      */
     type = g_ascii_strdown(hv_type, -1);
-    if (g_str_equal(type, "qemu")) {
+    if (g_str_equal(type, "qemu") && ver <= 1002000) {
         g_free(type);
-        type = g_strdup("kvm");
+        type = g_strdup("qemu-kvm");
     }
 
     major = ver / 1000000;
-- 
1.8.1.4




More information about the libvir-list mailing list