[Libvirt-cim] [PATCH] Add support for <type> tag for Containers

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Mon Sep 29 17:47:24 UTC 2008


# HG changeset patch
# User Kaitlin Rupert <karupert at us.ibm.com>
# Date 1222710417 25200
# Node ID 726b7a1acb055a2b03919fc3571d24bc73c8800c
# Parent  330a579be15c3967ea54158f89c85fe10363db02
Add support for <type> tag for Containers.

Libvirt now requires a type tag for Containers guests.  This should be set to 'exe'.

Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>

diff -r 330a579be15c -r 726b7a1acb05 libxkutil/device_parsing.c
--- a/libxkutil/device_parsing.c	Mon Sep 29 08:53:57 2008 -0700
+++ b/libxkutil/device_parsing.c	Mon Sep 29 10:46:57 2008 -0700
@@ -935,6 +935,7 @@
                 free(dom->os_info.fv.loader);
                 free(dom->os_info.fv.boot);
         } else if (dom->type == DOMAIN_LXC) {
+                free(dom->os_info.lxc.type);
                 free(dom->os_info.lxc.init);
         } else {
                 CU_DEBUG("Unknown domain type %i", dom->type);
diff -r 330a579be15c -r 726b7a1acb05 libxkutil/device_parsing.h
--- a/libxkutil/device_parsing.h	Mon Sep 29 08:53:57 2008 -0700
+++ b/libxkutil/device_parsing.h	Mon Sep 29 10:46:57 2008 -0700
@@ -91,6 +91,7 @@
 };
 
 struct lxc_os_info {
+        char *type; /* Should always be 'exe' */
         char *init;
 };
 
diff -r 330a579be15c -r 726b7a1acb05 libxkutil/xmlgen.c
--- a/libxkutil/xmlgen.c	Mon Sep 29 08:53:57 2008 -0700
+++ b/libxkutil/xmlgen.c	Mon Sep 29 10:46:57 2008 -0700
@@ -587,11 +587,16 @@
         int ret;
         char *xml = NULL;
 
+        if (os->type == NULL)
+                os->type = strdup("exe");
+
         ret = asprintf(&xml,
                        "<os>\n"
                        "  <init>%s</init>\n"
+                       "  <type>%s</type>\n"
                        "</os>\n",
-                       os->init);
+                       os->init,
+                       os->type);
         if (ret == -1)
                 xml = NULL;
 




More information about the Libvirt-cim mailing list