]> xenbits.xensource.com Git - libvirt.git/commitdiff
Avoid starting a PowerPC VM with floppy disk
authorKothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
Thu, 30 Jul 2015 11:55:36 +0000 (07:55 -0400)
committerJán Tomko <jtomko@redhat.com>
Tue, 4 Aug 2015 08:17:07 +0000 (10:17 +0200)
PowerPC pseries based VMs do not support a floppy disk controller.
This prohibits libvirt from creating qemu command with floppy device.

Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
https://bugzilla.redhat.com/show_bug.cgi?id=1180486

Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-pseries.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-pseries.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c

index 09f30c40e765e43df75f3683726dc960454631a7..501c7df0485908735ec7094dd090556e3f3f5df5 100644 (file)
@@ -9767,6 +9767,14 @@ qemuBuildCommandLine(virConnectPtr conn,
                 continue;
             }
 
+            /* PowerPC pseries based VMs do not support floppy device */
+            if ((disk->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) &&
+                ARCH_IS_PPC64(def->os.arch) && STRPREFIX(def->os.machine, "pseries")) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("PowerPC pseries machines do not support floppy device"));
+                goto error;
+            }
+
             switch (disk->device) {
             case VIR_DOMAIN_DISK_DEVICE_CDROM:
                 bootindex = bootCD;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-pseries.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-pseries.args
new file mode 100644 (file)
index 0000000..6f68121
--- /dev/null
@@ -0,0 +1,6 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-ppc64 -S -M pseries -m 214 -smp 1 -nographic -monitor \
+unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -drive \
+file=/dev/HostVG/QEMUGuest1,if=ide,bus=0,unit=0 -drive \
+file=/dev/fd0,if=floppy,unit=0 -drive file=/tmp/firmware.img,if=floppy,unit=1 \
+-net none -serial none -parallel none
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-pseries.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-pseries.xml
new file mode 100644 (file)
index 0000000..be0ede6
--- /dev/null
@@ -0,0 +1,41 @@
+<domain type='qemu'>
+  <name>QEMUGuest1</name>
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='ppc64' machine='pseries'>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-system-ppc64</emulator>
+    <disk type='block' device='disk'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/HostVG/QEMUGuest1'/>
+      <target dev='hda' bus='ide'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='block' device='floppy'>
+      <driver name='qemu' type='raw'/>
+      <source dev='/dev/fd0'/>
+      <target dev='fda' bus='fdc'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='file' device='floppy'>
+      <driver name='qemu' type='raw'/>
+      <source file='/tmp/firmware.img'/>
+      <target dev='fdb' bus='fdc'/>
+      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
+    </disk>
+    <controller type='usb' index='0'/>
+    <controller type='fdc' index='0'/>
+    <controller type='ide' index='0'/>
+    <controller type='pci' index='0' model='pci-root'/>
+    <memballoon model='none'/>
+  </devices>
+</domain>
index f9b30d9781710b95f100b43a4aa96108246129dd..afd2ef3a9884cbc035858e439be6ebb47b0b0cde 100644 (file)
@@ -737,6 +737,7 @@ mymain(void)
             QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_VIRTIO_TX_ALG);
     DO_TEST("disk-cdrom-tray-no-device-cap", NONE);
     DO_TEST("disk-floppy", NONE);
+    DO_TEST_FAILURE("disk-floppy-pseries", QEMU_CAPS_DRIVE);
     DO_TEST("disk-floppy-tray-no-device-cap", NONE);
     DO_TEST("disk-floppy-tray",
             QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE);