diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c
index be194e3535..f3e8b55217 100644
--- a/src/xenconfig/xen_xl.c
+++ b/src/xenconfig/xen_xl.c
@@ -587,9 +587,8 @@ xenFormatXLDisk(virConfValuePtr list, virDomainDiskDefPtr disk)
int format = virDomainDiskGetFormat(disk);
const char *driver = virDomainDiskGetDriver(disk);
- /* target */
- virBufferAsprintf(&buf, "%s,", src);
/* format */
+ virBufferAddLit(&buf, "format=");
switch (format) {
case VIR_STORAGE_FILE_RAW:
virBufferAddLit(&buf, "raw,");
@@ -609,31 +608,37 @@ xenFormatXLDisk(virConfValuePtr list, virDomainDiskDefPtr disk)
}
/* device */
- virBufferAdd(&buf, disk->dst, -1);
-
- virBufferAddLit(&buf, ",");
+ virBufferAsprintf(&buf, "vdev=%s,", disk->dst);
+ /* access */
+ virBufferAddLit(&buf, "access=");
if (disk->src->readonly)
- virBufferAddLit(&buf, "r,");
+ virBufferAddLit(&buf, "ro,");
else if (disk->src->shared)
virBufferAddLit(&buf, "!,");
else
- virBufferAddLit(&buf, "w,");
+ virBufferAddLit(&buf, "rw,");
if (disk->transient) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("transient disks not supported yet"));
goto cleanup;
}
+ /* backendtype */
+ virBufferAddLit(&buf, "backendtype=");
if (STREQ_NULLABLE(driver, "qemu"))
- virBufferAddLit(&buf, "backendtype=qdisk");
+ virBufferAddLit(&buf, "qdisk,");
else if (STREQ_NULLABLE(driver, "tap"))
- virBufferAddLit(&buf, "backendtype=tap");
+ virBufferAddLit(&buf, "tap,");
else if (STREQ_NULLABLE(driver, "phy"))
- virBufferAddLit(&buf, "backendtype=phy");
+ virBufferAddLit(&buf, "phy,");
+ /* devtype */
if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
- virBufferAddLit(&buf, ",devtype=cdrom");
+ virBufferAddLit(&buf, "devtype=cdrom,");
+
+ /* target */
+ virBufferAsprintf(&buf, "target=%s", src);
if (virBufferCheckError(&buf) < 0)
goto cleanup;
diff --git a/tests/xlconfigdata/test-disk-positional-parms-full.cfg b/tests/xlconfigdata/test-disk-positional-parms-full.cfg
new file mode 100644
index 0000000000..026e451ca3
--- /dev/null
+++ b/tests/xlconfigdata/test-disk-positional-parms-full.cfg
@@ -0,0 +1,26 @@
+name = "XenGuest2"
+uuid = "c7a5fdb2-cdaf-9455-926a-d65c16db1809"
+maxmem = 579
+memory = 394
+vcpus = 1
+pae = 1
+acpi = 1
+apic = 1
+hap = 0
+viridian = 0
+rtc_timeoffset = 0
+localtime = 0
+on_poweroff = "destroy"
+on_reboot = "restart"
+on_crash = "restart"
+device_model = "/usr/lib/xen/bin/qemu-dm"
+sdl = 0
+vnc = 1
+vncunused = 1
+vnclisten = "127.0.0.1"
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000" ]
+parallel = "none"
+serial = "none"
+builder = "hvm"
+boot = "d"
+disk = [ "/dev/HostVG/XenGuest2,raw,hda,rw,backendtype=phy", "/var/lib/libvirt/images/XenGuest2-home,qcow2,hdb,rw", "/root/boot.iso,raw,hdc,ro,devtype=cdrom" ]
diff --git a/tests/xlconfigdata/test-disk-positional-parms-full.xml b/tests/xlconfigdata/test-disk-positional-parms-full.xml
new file mode 100644
index 0000000000..7fd189944b
--- /dev/null
+++ b/tests/xlconfigdata/test-disk-positional-parms-full.xml
@@ -0,0 +1,55 @@
+
+ XenGuest2
+ c7a5fdb2-cdaf-9455-926a-d65c16db1809
+ 592896
+ 403456
+ 1
+
+ hvm
+ /usr/lib/xen/boot/hvmloader
+
+
+
+
+
+
+
+
+ destroy
+ restart
+ restart
+
+ /usr/lib/xen/bin/qemu-dm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/xlconfigdata/test-disk-positional-parms-partial.cfg b/tests/xlconfigdata/test-disk-positional-parms-partial.cfg
new file mode 100644
index 0000000000..0591037c43
--- /dev/null
+++ b/tests/xlconfigdata/test-disk-positional-parms-partial.cfg
@@ -0,0 +1,26 @@
+name = "XenGuest2"
+uuid = "c7a5fdb2-cdaf-9455-926a-d65c16db1809"
+maxmem = 579
+memory = 394
+vcpus = 1
+pae = 1
+acpi = 1
+apic = 1
+hap = 0
+viridian = 0
+rtc_timeoffset = 0
+localtime = 0
+on_poweroff = "destroy"
+on_reboot = "restart"
+on_crash = "restart"
+device_model = "/usr/lib/xen/bin/qemu-dm"
+sdl = 0
+vnc = 1
+vncunused = 1
+vnclisten = "127.0.0.1"
+vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000" ]
+parallel = "none"
+serial = "none"
+builder = "hvm"
+boot = "d"
+disk = [ "/dev/HostVG/XenGuest2,,hda,,backendtype=phy", "/var/lib/libvirt/images/XenGuest2-home,,hdb,,", "/root/boot.iso,,hdc,,devtype=cdrom" ]
diff --git a/tests/xlconfigdata/test-disk-positional-parms-partial.xml b/tests/xlconfigdata/test-disk-positional-parms-partial.xml
new file mode 100644
index 0000000000..7c42736155
--- /dev/null
+++ b/tests/xlconfigdata/test-disk-positional-parms-partial.xml
@@ -0,0 +1,55 @@
+
+ XenGuest2
+ c7a5fdb2-cdaf-9455-926a-d65c16db1809
+ 592896
+ 403456
+ 1
+
+ hvm
+ /usr/lib/xen/boot/hvmloader
+
+
+
+
+
+
+
+
+ destroy
+ restart
+ restart
+
+ /usr/lib/xen/bin/qemu-dm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/xlconfigdata/test-fullvirt-direct-kernel-boot.cfg b/tests/xlconfigdata/test-fullvirt-direct-kernel-boot.cfg
index 32b08e1a87..9ebbc89fe0 100644
--- a/tests/xlconfigdata/test-fullvirt-direct-kernel-boot.cfg
+++ b/tests/xlconfigdata/test-fullvirt-direct-kernel-boot.cfg
@@ -27,4 +27,4 @@ kernel = "/tmp/vmlinuz"
ramdisk = "/tmp/initrd"
cmdline = "ignore_loglvl"
boot = "d"
-disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
+disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2", "format=raw,vdev=hdc,access=ro,backendtype=qdisk,devtype=cdrom,target=/root/boot.iso" ]
diff --git a/tests/xlconfigdata/test-fullvirt-multiusb.cfg b/tests/xlconfigdata/test-fullvirt-multiusb.cfg
index d0482a83ec..097de88b8f 100755
--- a/tests/xlconfigdata/test-fullvirt-multiusb.cfg
+++ b/tests/xlconfigdata/test-fullvirt-multiusb.cfg
@@ -24,6 +24,6 @@ parallel = "none"
serial = "none"
builder = "hvm"
boot = "d"
-disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
+disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2", "format=raw,vdev=hdc,access=ro,backendtype=qdisk,devtype=cdrom,target=/root/boot.iso" ]
usb = 1
usbdevice = [ "mouse", "tablet" ]
diff --git a/tests/xlconfigdata/test-new-disk.cfg b/tests/xlconfigdata/test-new-disk.cfg
index 9b9fb366b6..4a5b66e285 100644
--- a/tests/xlconfigdata/test-new-disk.cfg
+++ b/tests/xlconfigdata/test-new-disk.cfg
@@ -23,4 +23,4 @@ parallel = "none"
serial = "none"
builder = "hvm"
boot = "d"
-disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/var/lib/libvirt/images/XenGuest2-home,qcow2,hdb,w,backendtype=qdisk", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
+disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2", "format=qcow2,vdev=hdb,access=rw,backendtype=qdisk,target=/var/lib/libvirt/images/XenGuest2-home", "format=raw,vdev=hdc,access=ro,backendtype=qdisk,devtype=cdrom,target=/root/boot.iso" ]
diff --git a/tests/xlconfigdata/test-paravirt-cmdline.cfg b/tests/xlconfigdata/test-paravirt-cmdline.cfg
index c512a055e3..e82d900f4f 100644
--- a/tests/xlconfigdata/test-paravirt-cmdline.cfg
+++ b/tests/xlconfigdata/test-paravirt-cmdline.cfg
@@ -11,4 +11,4 @@ vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge" ]
kernel = "/tmp/vmlinuz"
ramdisk = "/tmp/initrd"
cmdline = "root=/dev/xvda1 console=hvc0"
-disk = [ "/dev/HostVG/XenGuest2,raw,xvda,w,backendtype=qdisk" ]
+disk = [ "format=raw,vdev=xvda,access=rw,backendtype=qdisk,target=/dev/HostVG/XenGuest2" ]
diff --git a/tests/xlconfigdata/test-paravirt-maxvcpus.cfg b/tests/xlconfigdata/test-paravirt-maxvcpus.cfg
index d506b7549a..8316774bb0 100644
--- a/tests/xlconfigdata/test-paravirt-maxvcpus.cfg
+++ b/tests/xlconfigdata/test-paravirt-maxvcpus.cfg
@@ -10,4 +10,4 @@ on_reboot = "restart"
on_crash = "preserve"
vif = [ "mac=5a:36:0e:be:00:09" ]
bootloader = "/usr/bin/pygrub"
-disk = [ "/var/lib/xen/images/debian/disk.qcow2,qcow2,xvda,w,backendtype=qdisk" ]
+disk = [ "format=qcow2,vdev=xvda,access=rw,backendtype=qdisk,target=/var/lib/xen/images/debian/disk.qcow2" ]
diff --git a/tests/xlconfigdata/test-spice-features.cfg b/tests/xlconfigdata/test-spice-features.cfg
index 152cb27ee3..8c1ca189cd 100644
--- a/tests/xlconfigdata/test-spice-features.cfg
+++ b/tests/xlconfigdata/test-spice-features.cfg
@@ -19,7 +19,7 @@ parallel = "none"
serial = "none"
builder = "hvm"
boot = "d"
-disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
+disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2", "format=raw,vdev=hdc,access=ro,backendtype=qdisk,devtype=cdrom,target=/root/boot.iso" ]
sdl = 0
vnc = 0
spice = 1
diff --git a/tests/xlconfigdata/test-spice.cfg b/tests/xlconfigdata/test-spice.cfg
index 1a96114a81..84b3ae6598 100644
--- a/tests/xlconfigdata/test-spice.cfg
+++ b/tests/xlconfigdata/test-spice.cfg
@@ -19,7 +19,7 @@ parallel = "none"
serial = "none"
builder = "hvm"
boot = "d"
-disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
+disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2", "format=raw,vdev=hdc,access=ro,backendtype=qdisk,devtype=cdrom,target=/root/boot.iso" ]
sdl = 0
vnc = 0
spice = 1
diff --git a/tests/xlconfigdata/test-vif-rate.cfg b/tests/xlconfigdata/test-vif-rate.cfg
index c5484dc50f..44bfa3c957 100644
--- a/tests/xlconfigdata/test-vif-rate.cfg
+++ b/tests/xlconfigdata/test-vif-rate.cfg
@@ -23,4 +23,4 @@ parallel = "none"
serial = "none"
builder = "hvm"
boot = "d"
-disk = [ "/dev/HostVG/XenGuest2,raw,hda,w,backendtype=phy", "/var/lib/libvirt/images/XenGuest2-home,qcow2,hdb,w,backendtype=qdisk", "/root/boot.iso,raw,hdc,r,backendtype=qdisk,devtype=cdrom" ]
+disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2", "format=qcow2,vdev=hdb,access=rw,backendtype=qdisk,target=/var/lib/libvirt/images/XenGuest2-home", "format=raw,vdev=hdc,access=ro,backendtype=qdisk,devtype=cdrom,target=/root/boot.iso" ]
diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c
index aa53ed8f70..13b99f2d92 100644
--- a/tests/xlconfigtest.c
+++ b/tests/xlconfigtest.c
@@ -208,6 +208,8 @@ mymain(void)
DO_TEST("paravirt-maxvcpus");
DO_TEST("new-disk");
+ DO_TEST_FORMAT("disk-positional-parms-full");
+ DO_TEST_FORMAT("disk-positional-parms-partial");
DO_TEST("spice");
DO_TEST("spice-features");
DO_TEST("vif-rate");