+Tue Jul 29 14:08:00 CEST 2008 Chris Lalancette <clalance@redhat.com>
+
+ * src/qemu_conf.c: fix empty CD-ROM source device section
+ * tests/qemuxml2argvtest.c,
+ tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.xml,
+ tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args: Add test
+ for empty source CD-ROM device section
+
Tue Jul 29 10:41:30 CEST 2008 Daniel Veillard <veillard@redhat.com>
* src/openvz_conf.c: fix compilation with new XPath interface
goto error;
}
- if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
- media = "media=cdrom,";
-
switch (disk->device) {
case VIR_DOMAIN_DISK_DEVICE_CDROM:
bootable = bootCD;
bootCD = 0;
+ media = "media=cdrom,";
break;
case VIR_DOMAIN_DISK_DEVICE_FLOPPY:
bootable = bootFloppy;
}
snprintf(opt, PATH_MAX, "file=%s,if=%s,%sindex=%d%s",
- disk->src, bus,
+ disk->src ? disk->src : "", bus,
media ? media : "",
idx,
bootable &&
--- /dev/null
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -drive file=/dev/HostVG/QEMUGuest1,if=ide,index=0 -drive file=,if=ide,media=cdrom,index=2 -net none -serial none -parallel none -usb
\ No newline at end of file
--- /dev/null
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory>219200</memory>
+ <currentMemory>219200</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ </disk>
+ <disk type='file' device='cdrom'>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ </disk>
+ </devices>
+</domain>
+
DO_TEST("clock-utc", 0);
DO_TEST("clock-localtime", 0);
DO_TEST("disk-cdrom", 0);
+ DO_TEST("disk-cdrom-empty", QEMUD_CMD_FLAG_DRIVE);
DO_TEST("disk-floppy", 0);
DO_TEST("disk-many", 0);
DO_TEST("disk-virtio", QEMUD_CMD_FLAG_DRIVE |