[libvirt] [Patch v2 0/3] use -serial for ppce500 board and add test case

Machine name ppce500 is used to replace ppce500v2 supported by QEMU. QEMU ppce500 board uses the legacy -serial option. Test case ppce500-serial is used to verify this change. Olivia Yin (3): change machine name ppce500v2 as ppce500 qemu: Fix specifying char devs for PPC tests: add test case for -serial option for ppce500 docs/schemas/domaincommon.rng | 2 +- src/qemu/qemu_capabilities.c | 9 +++++++- tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.xml | 2 +- .../qemuxml2argv-ppce500-serial.args | 7 ++++++ .../qemuxml2argv-ppce500-serial.xml | 26 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + tests/testutilsqemu.c | 2 +- 8 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.xml -- 1.8.5

ppce500v2 is not machine supported by official release of QEMU. It should be replaced by ppce500. --- docs/schemas/domaincommon.rng | 2 +- tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.xml | 2 +- tests/testutilsqemu.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 4249ed5..af67123 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -371,7 +371,7 @@ <value>g3beige</value> <value>mac99</value> <value>prep</value> - <value>ppce500v2</value> + <value>ppce500</value> </choice> </attribute> </optional> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args b/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args index fd7e994..5d6dc45 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args @@ -1,5 +1,5 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -/usr/bin/qemu-system-ppc -S -M ppce500v2 -m 256 -smp 1 -nographic \ +/usr/bin/qemu-system-ppc -S -M ppce500 -m 256 -smp 1 -nographic \ -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \ -kernel /media/ram/uImage -initrd /media/ram/ramdisk \ -append 'root=/dev/ram rw console=ttyS0,115200' -dtb /media/ram/test.dtb \ diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.xml b/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.xml index 3674621..04f0eb6 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.xml @@ -5,7 +5,7 @@ <currentMemory unit='KiB'>262144</currentMemory> <vcpu placement='static'>1</vcpu> <os> - <type arch='ppc' machine='ppce500v2'>hvm</type> + <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> diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index a8884ba..7e24909 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -91,7 +91,7 @@ static int testQemuAddPPCGuest(virCapsPtr caps) static const char *machine[] = { "g3beige", "mac99", "prep", - "ppce500v2" }; + "ppce500" }; virCapsGuestMachinePtr *machines = NULL; virCapsGuestPtr guest; -- 1.8.5

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. Signed-off-by: Olivia Yin <Hong-Hua.Yin@freescale.com> --- src/qemu/qemu_capabilities.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 03d8842..1b09a17 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3467,7 +3467,14 @@ virQEMUCapsSupportsChardev(virDomainDefPtr def, return false; if ((def->os.arch != VIR_ARCH_ARMV7L) && (def->os.arch != VIR_ARCH_AARCH64)) - return true; + { + if ((def->os.arch != VIR_ARCH_PPC) && (def->os.arch != VIR_ARCH_PPC64)) + return true; + else + /* 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); + } /* This may not be true for all ARM machine types, but at least * the only supported non-virtio serial devices of vexpress and versatile -- 1.8.5

--- .../qemuxml2argv-ppce500-serial.args | 7 ++++++ .../qemuxml2argv-ppce500-serial.xml | 26 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 34 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args b/tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args new file mode 100644 index 0000000..a23ae41 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args @@ -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 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.xml b/tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.xml new file mode 100644 index 0000000..397aadc --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.xml @@ -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> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1ea7bf8..24d104e 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -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); -- 1.8.5

On 05/27/2014 07:44 AM, Olivia Yin wrote:
Machine name ppce500 is used to replace ppce500v2 supported by QEMU. QEMU ppce500 board uses the legacy -serial option. Test case ppce500-serial is used to verify this change.
Olivia Yin (3): change machine name ppce500v2 as ppce500 qemu: Fix specifying char devs for PPC tests: add test case for -serial option for ppce500
docs/schemas/domaincommon.rng | 2 +- src/qemu/qemu_capabilities.c | 9 +++++++- tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.xml | 2 +- .../qemuxml2argv-ppce500-serial.args | 7 ++++++ .../qemuxml2argv-ppce500-serial.xml | 26 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 1 + tests/testutilsqemu.c | 2 +- 8 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.xml
ACK series I have moved the PPC conditions above the "arch != arm" comparisons to reduce indentation, squashed the tests together with the second patch and pushed the series. Jan
participants (2)
-
Ján Tomko
-
Olivia Yin