[libvirt] [PATCH 0/3] qemu: virtio-9p-ccw support

Adding support and a test for virtio-9p-ccw. Changing the default from virtio-9p-pci to virtio-9p-ccw for s390-ccw-virtio machines. Boris Fiuczynski (3): qemu: Support for virtio-9p-ccw qemu: Make virtio-9p-ccw the default for s390-ccw-virtio machines qemu: Test for virtio-9p-ccw support src/qemu/qemu_command.c | 14 ++++++++- tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args | 16 ++++++++++ tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml | 36 +++++++++++++++++++++++ tests/qemuxml2argvtest.c | 4 +++ 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml -- 1.8.1.4

Adding the recently in qemu added 9pfs support for virtio-ccw. Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: Jason J. Herne <jjherne@us.ibm.com> Reviewed-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com> --- src/qemu/qemu_command.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 25a7bc6..58f3d9c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4386,7 +4386,11 @@ qemuBuildFSDevStr(virDomainDefPtr def, goto error; } - virBufferAddLit(&opt, "virtio-9p-pci"); + if (fs->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) + virBufferAddLit(&opt, "virtio-9p-ccw"); + else + virBufferAddLit(&opt, "virtio-9p-pci"); + virBufferAsprintf(&opt, ",id=%s", fs->info.alias); virBufferAsprintf(&opt, ",fsdev=%s%s", QEMU_FSDEV_HOST_PREFIX, fs->info.alias); virBufferAsprintf(&opt, ",mount_tag=%s", fs->dst); -- 1.8.1.4

For s390-ccw-virtio machines the default bus type is set to ccw. Specifing an address element allows to override the default. Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: Jason J. Herne <jjherne@us.ibm.com> Reviewed-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com> --- src/qemu/qemu_command.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 58f3d9c..fc2a1bd 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1273,6 +1273,7 @@ qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def, declare address-less virtio devices to be of address type 'type' disks, networks, consoles, controllers, memballoon and rng in this order + if type is ccw filesystem devices are declared to be of address type ccw */ size_t i; @@ -1309,6 +1310,13 @@ qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def, def->rngs[i]->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) def->rngs[i]->info.type = type; } + + if (type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) { + for (i = 0; i < def->nfss; i++) { + if (def->fss[i]->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) + def->fss[i]->info.type = type; + } + } } -- 1.8.1.4

This patch adds a test for the qemu command line generation. Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: Jason J. Herne <jjherne@us.ibm.com> Reviewed-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com> --- tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args | 16 ++++++++++ tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml | 36 +++++++++++++++++++++++ tests/qemuxml2argvtest.c | 4 +++ 3 files changed, 56 insertions(+) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args b/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args new file mode 100644 index 0000000..8d2f21a --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args @@ -0,0 +1,16 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu -S -M s390-ccw-virtio -m 214 -smp 1 \ +-nographic -nodefconfig -nodefaults \ +-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \ +-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-virtio-disk0 -device \ +virtio-blk-ccw,devno=fe.0.0000,drive=drive-virtio-disk0,id=virtio-disk0 \ +-fsdev local,security_model=passthrough,id=fsdev-fs0,\ +path=/export/to/guest -device virtio-9p-ccw,id=fs0,fsdev=fsdev-fs0,\ +mount_tag=/import/from/host,devno=fe.0.0001 \ +-fsdev local,security_model=mapped,writeout=immediate,id=fsdev-fs1,\ +path=/export/to/guest2 -device virtio-9p-ccw,id=fs1,fsdev=fsdev-fs1,\ +mount_tag=/import/from/host2,devno=fe.0.0002 \ +-fsdev handle,writeout=immediate,id=fsdev-fs2,\ +path=/export/to/guest3 -device virtio-9p-ccw,id=fs2,fsdev=fsdev-fs2,\ +mount_tag=/import/from/host3,devno=fe.0.0003 \ +-device virtio-balloon-ccw,id=balloon0,devno=fe.0.0004 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml b/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml new file mode 100644 index 0000000..860e34b --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml @@ -0,0 +1,36 @@ +<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='s390x' machine='s390-ccw-virtio'>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='virtio'/> + </disk> + <filesystem type='mount'> + <source dir='/export/to/guest'/> + <target dir='/import/from/host'/> + </filesystem> + <filesystem accessmode='mapped'> + <driver type='path' wrpolicy='immediate'/> + <source dir='/export/to/guest2'/> + <target dir='/import/from/host2'/> + </filesystem> + <filesystem> + <driver type='handle' wrpolicy='immediate'/> + <source dir='/export/to/guest3'/> + <target dir='/import/from/host3'/> + </filesystem> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 574777b..d3f09b1 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1219,6 +1219,10 @@ mymain(void) DO_TEST("fs9p", QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_FSDEV, QEMU_CAPS_FSDEV_WRITEOUT); + DO_TEST("fs9p-ccw", + QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_FSDEV, + QEMU_CAPS_FSDEV_WRITEOUT, QEMU_CAPS_DRIVE, + QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390); DO_TEST("hostdev-usb-address", NONE); DO_TEST("hostdev-usb-address-device", -- 1.8.1.4

Polite ping... On 07/07/2015 05:30 PM, Boris Fiuczynski wrote:
Adding support and a test for virtio-9p-ccw. Changing the default from virtio-9p-pci to virtio-9p-ccw for s390-ccw-virtio machines.
Boris Fiuczynski (3): qemu: Support for virtio-9p-ccw qemu: Make virtio-9p-ccw the default for s390-ccw-virtio machines qemu: Test for virtio-9p-ccw support
src/qemu/qemu_command.c | 14 ++++++++- tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args | 16 ++++++++++ tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml | 36 +++++++++++++++++++++++ tests/qemuxml2argvtest.c | 4 +++ 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml
-- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martina Köderitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On Tue, Jul 07, 2015 at 05:30:40PM +0200, Boris Fiuczynski wrote:
Adding support and a test for virtio-9p-ccw. Changing the default from virtio-9p-pci to virtio-9p-ccw for s390-ccw-virtio machines.
Boris Fiuczynski (3): qemu: Support for virtio-9p-ccw qemu: Make virtio-9p-ccw the default for s390-ccw-virtio machines qemu: Test for virtio-9p-ccw support
src/qemu/qemu_command.c | 14 ++++++++- tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args | 16 ++++++++++ tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml | 36 +++++++++++++++++++++++ tests/qemuxml2argvtest.c | 4 +++ 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.xml
ACK series. I have pushed it to master. Jan
participants (2)
-
Boris Fiuczynski
-
Ján Tomko