[Libvirt-cim] [PATCH] Don't drop disk type on redefine

Dan Smith danms at us.ibm.com
Wed Nov 5 16:22:58 UTC 2008


# HG changeset patch
# User Dan Smith <danms at us.ibm.com>
# Date 1225902171 28800
# Node ID 1d696e80fccc41c9b21b5f24b84deab82d1416cc
# Parent  ece7c71cd2aab612dec19cc6247194cdf8b5b049
Don't drop disk type on redefine

Right now, we track the status of disk/cdrom of a disk device, but don't
use it in the XML define.  This patch uses the value instead of a static
device='disk'.

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

diff -r ece7c71cd2aa -r 1d696e80fccc libxkutil/xmlgen.c
--- a/libxkutil/xmlgen.c	Wed Nov 05 08:15:51 2008 -0800
+++ b/libxkutil/xmlgen.c	Wed Nov 05 08:22:51 2008 -0800
@@ -119,12 +119,13 @@
         int ret;
 
         ret = asprintf(&xml,
-                       "<disk type='block' device='disk'>\n"
+                       "<disk type='block' device='%s'>\n"
                        "  <source dev='%s'/>\n"
                        "  <target dev='%s'/>\n"
                        "%s"
                        "%s"
                        "</disk>\n",
+                       dev->device,
                        dev->source,
                        dev->virtual_dev,
                        dev->readonly ? "<readonly/>\n" : "",
@@ -141,12 +142,13 @@
         int ret;
 
         ret = asprintf(&xml,
-                       "<disk type='file' device='disk'>\n"
+                       "<disk type='file' device='%s'>\n"
                        "  <source file='%s'/>\n"
                        "  <target dev='%s'/>\n"
                        "%s"
                        "%s"
                        "</disk>\n",
+                       dev->device,
                        dev->source,
                        dev->virtual_dev,
                        dev->readonly ? "<readonly/>" : "",




More information about the Libvirt-cim mailing list