File disk-type.patch of Package libvirt-cim
# HG changeset patch
# User Dan Smith <danms@us.ibm.com>
# Date 1226005678 28800
# Node ID 9d100a5442150eedf372598f5033db100f47eddd
# Parent 049f0bb012190e680257d00463138391405a5c60
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@us.ibm.com>
Index: libvirt-cim-0.5.2/libxkutil/xmlgen.c
===================================================================
--- libvirt-cim-0.5.2.orig/libxkutil/xmlgen.c
+++ libvirt-cim-0.5.2/libxkutil/xmlgen.c
@@ -119,12 +119,13 @@ static char *disk_block_xml(struct disk_
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 @@ static char *disk_file_xml(struct disk_d
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/>" : "",