mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: Fix specifying char devs for PPC
QEMU ppce500 board uses the legacy -serial option. Other PPC boards don't give any way to explicitly wire in a -chardev except pseries which uses -device spapr-vty with -chardev. Add test case for -serial option for ppce500 Signed-off-by: Olivia Yin <Hong-Hua.Yin@freescale.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
61b1c681e0
commit
fd0f22ed41
@ -3466,6 +3466,12 @@ virQEMUCapsSupportsChardev(virDomainDefPtr def,
|
||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE))
|
||||
return false;
|
||||
|
||||
if ((def->os.arch == VIR_ARCH_PPC) || (def->os.arch == VIR_ARCH_PPC64)) {
|
||||
/* only pseries need -device spapr-vty with -chardev */
|
||||
return (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
|
||||
chr->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO);
|
||||
}
|
||||
|
||||
if ((def->os.arch != VIR_ARCH_ARMV7L) && (def->os.arch != VIR_ARCH_AARCH64))
|
||||
return true;
|
||||
|
||||
|
7
tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args
Normal file
7
tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args
Normal file
@ -0,0 +1,7 @@
|
||||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
|
||||
/usr/bin/qemu-system-ppc -S -M ppce500 -m 256 -smp 1 -nographic -nodefaults \
|
||||
-chardev socket,id=charmonitor,path=/tmp/test-monitor,server,nowait \
|
||||
-mon chardev=charmonitor,id=monitor,mode=readline -no-acpi -boot c \
|
||||
-kernel /media/ram/uImage -initrd /media/ram/ramdisk \
|
||||
-append 'root=/dev/ram rw console=ttyS0,115200' \
|
||||
-usb -serial pty -device virtio-balloon-pci,id=balloon0,bus=pci,addr=0x2
|
26
tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.xml
Normal file
26
tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<domain type='kvm'>
|
||||
<name>QEMUGuest1</name>
|
||||
<memory unit='KiB'>262144</memory>
|
||||
<currentMemory unit='KiB'>262144</currentMemory>
|
||||
<vcpu placement='static'>1</vcpu>
|
||||
<os>
|
||||
<type arch='ppc' machine='ppce500'>hvm</type>
|
||||
<kernel>/media/ram/uImage</kernel>
|
||||
<initrd>/media/ram/ramdisk</initrd>
|
||||
<cmdline>root=/dev/ram rw console=ttyS0,115200</cmdline>
|
||||
</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-ppc</emulator>
|
||||
<serial type='pty'>
|
||||
<target port='0'/>
|
||||
</serial>
|
||||
<console type='pty'>
|
||||
<target type='serial' port='0'/>
|
||||
</console>
|
||||
<memballoon model='virtio'/>
|
||||
</devices>
|
||||
</domain>
|
@ -1279,6 +1279,7 @@ mymain(void)
|
||||
QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM);
|
||||
|
||||
DO_TEST("ppc-dtb", QEMU_CAPS_KVM, QEMU_CAPS_DTB);
|
||||
DO_TEST("ppce500-serial", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE, QEMU_CAPS_CHARDEV);
|
||||
|
||||
DO_TEST("tpm-passthrough", QEMU_CAPS_DEVICE,
|
||||
QEMU_CAPS_DEVICE_TPM_PASSTHROUGH, QEMU_CAPS_DEVICE_TPM_TIS);
|
||||
|
Loading…
x
Reference in New Issue
Block a user