[Libvirt-cim] [PATCH 2 of 7] Fix xmlgen to include boot parameter for KVM

Dan Smith danms at us.ibm.com
Fri Jan 18 16:20:02 UTC 2008


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1200676369 28800
# Node ID 33713de8e682b9d91ed6fb6b03ab6518830268fd
# Parent  c884e68b522de2f9250bfde6f5e5cd99686e43fa
Fix xmlgen to include boot parameter for KVM

Signed-off-by: Dan Smith <danms at us.ibm.com>

diff -r c884e68b522d -r 33713de8e682 libxkutil/xmlgen.c
--- a/libxkutil/xmlgen.c	Fri Jan 18 09:12:48 2008 -0800
+++ b/libxkutil/xmlgen.c	Fri Jan 18 09:12:49 2008 -0800
@@ -462,21 +462,32 @@ static char *_kvm_os_xml(struct domain *
         int ret;
         char *xml;
         char *type;
+        char *boot;
+        struct kv bootattr = {"dev", NULL};
 
         if (os->type == NULL)
                 os->type = strdup("hvm");
 
+        if (os->boot == NULL)
+                os->boot = strdup("hd");
+
         type = tagify("type", os->type, NULL, 0);
 
+        bootattr.val = os->boot;
+        boot = tagify("boot", NULL, &bootattr, 1);
+
         ret = asprintf(&xml,
                        "<os>\n"
                        "  %s\n"
+                       "  %s\n"
                        "</os>\n",
-                       type);
+                       type,
+                       boot);
         if (ret == -1)
                 xml = NULL;
 
         free(type);
+        free(boot);
 
         return xml;
 }




More information about the Libvirt-cim mailing list