mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
Avoid starting a PowerPC VM with floppy disk
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>
This commit is contained in:
parent
020a178318
commit
d9557572ae
@ -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;
|
||||
|
@ -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
|
41
tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-pseries.xml
Normal file
41
tests/qemuxml2argvdata/qemuxml2argv-disk-floppy-pseries.xml
Normal file
@ -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>
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user