[PATCH] Don't drop disk type on redefine

# HG changeset patch # User Dan Smith <danms@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@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/>" : "",

Dan Smith wrote:
# HG changeset patch # User Dan Smith <danms@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'.
The disk_rasd_to_vdev() function in VSMS doesn't set the device value of the disk struct. The guest fails to define due to a null device. <disk type='file' device='(null)'> <source file='/tmp/default-kvm-dimage'/> <target dev='hda'/> </disk> -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com

KR> The disk_rasd_to_vdev() function in VSMS doesn't set the device value KR> of the disk struct. The guest fails to define due to a null device. KR> <disk type='file' device='(null)'> KR> <source file='/tmp/default-kvm-dimage'/> KR> <target dev='hda'/> KR> </disk> Okay, good call. Before I commit this patch I'll write one that defaults that to disk. -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com
participants (2)
-
Dan Smith
-
Kaitlin Rupert