mbox series

[RFC,v2,0/3] Enable virtio-fs on s390x

Message ID 20200717092929.19453-1-mhartmay@linux.ibm.com (mailing list archive)
Headers show
Series Enable virtio-fs on s390x | expand

Message

Marc Hartmayer July 17, 2020, 9:29 a.m. UTC
This RFC is about enabling virtio-fs on s390x. For that we need
 + some shim code (first patch), and we need
 + libvhost-user to deal with virtio endiannes for non-legacy virtio
   devices as mandated by the spec.

libvhost-access.h is based on hw/virtio/virtio-access.h.

How to use?

For general instructions how to use virtio-fs (on x86) please have a
look at https://virtio-fs.gitlab.io/howto-qemu.html. Most of the
instructions can also be applied on s390x.

In short:

1. Install self-compiled QEMU with this patch series applied
2. Prepare host and guest kernel so they support virtio-fs

Start virtiofsd on the host

 $ virtiofsd -f --socket-path=/tmp/vhostqemu -o source=/tmp/shared

Now you can start QEMU in a separate shell on the host:

 $ qemu-system-s390x -machine type=s390-ccw-virtio,accel=kvm,memory-backend=mem \
   -object memory-backend-file,id=mem,size=2G,mem-path=/dev/shm/virtiofs,share=on,prealloc=on,prealloc-threads=1 \
   -chardev socket,id=char0,path=/tmp/vhostqemu -device vhost-user-fs-ccw,queue-size=1024,chardev=char0,tag=myfs \
   -drive if=virtio,file=disk.qcow2 \
   -m 2G -smp 2 -nographic

Log into the guest and mount it

 $ mount -t virtiofs myfs /mnt

Changelog:
 v1->v2:
  + rebased
  + drop patch "libvhost-user: print invalid address on vu_panic" as it's not related to this series
  + drop patch "[RFC 4/4] HACK: Hard-code the libvhost-user.o-cflags for s390x"
  + patch "virtio: add vhost-user-fs-ccw device": replace qdev_set_parent_bus and object_property_set_bool by qdev_realize
  + patch "libvhost-user: handle endianness as mandated by the spec":
    Drop support for legacy virtio devices
  + add patch to fence legacy virtio devices

Halil Pasic (1):
  virtio: add vhost-user-fs-ccw device

Marc Hartmayer (2):
  libvhost-user: handle endianness as mandated by the spec
  libvhost-user: fence legacy virtio devices

 contrib/libvhost-user/libvhost-access.h |  71 ++++++++++++++
 contrib/libvhost-user/libvhost-user.c   | 125 +++++++++++++-----------
 hw/s390x/Makefile.objs                  |   1 +
 hw/s390x/vhost-user-fs-ccw.c            |  73 ++++++++++++++
 4 files changed, 211 insertions(+), 59 deletions(-)
 create mode 100644 contrib/libvhost-user/libvhost-access.h
 create mode 100644 hw/s390x/vhost-user-fs-ccw.c

Comments

no-reply@patchew.org July 17, 2020, 10:26 a.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/20200717092929.19453-1-mhartmay@linux.ibm.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20200717092929.19453-1-mhartmay@linux.ibm.com
Subject: [RFC v2 0/3] Enable virtio-fs on s390x

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Switched to a new branch 'test'
a6d1b6d libvhost-user: fence legacy virtio devices
968857c libvhost-user: handle endianness as mandated by the spec
2c7bd4b virtio: add vhost-user-fs-ccw device

=== OUTPUT BEGIN ===
1/3 Checking commit 2c7bd4bc5216 (virtio: add vhost-user-fs-ccw device)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#25: 
new file mode 100644

ERROR: space required after that ',' (ctx:VxV)
#85: FILE: hw/s390x/vhost-user-fs-ccw.c:56:
+    device_class_set_props(dc,vhost_user_fs_ccw_properties);
                              ^

total: 1 errors, 1 warnings, 80 lines checked

Patch 1/3 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

2/3 Checking commit 968857cfd9be (libvhost-user: handle endianness as mandated by the spec)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#29: 
new file mode 100644

ERROR: braces {} are necessary for all arms of this statement
#75: FILE: contrib/libvhost-user/libvhost-access.h:42:
+    if (vu_access_is_big_endian(vdev))
[...]

ERROR: braces {} are necessary for all arms of this statement
#82: FILE: contrib/libvhost-user/libvhost-access.h:49:
+    if (vu_access_is_big_endian(vdev))
[...]

ERROR: braces {} are necessary for all arms of this statement
#89: FILE: contrib/libvhost-user/libvhost-access.h:56:
+    if (vu_access_is_big_endian(vdev))
[...]

WARNING: line over 80 characters
#347: FILE: contrib/libvhost-user/libvhost-user.c:2512:
+                               vu_ldq_p(dev, &desc[i].addr), vu_ldl_p(dev, &desc[i].len));

WARNING: line over 80 characters
#356: FILE: contrib/libvhost-user/libvhost-user.c:2520:
+                               vu_ldq_p(dev, &desc[i].addr), vu_ldl_p(dev, &desc[i].len));

total: 3 errors, 3 warnings, 362 lines checked

Patch 2/3 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

3/3 Checking commit a6d1b6dacac8 (libvhost-user: fence legacy virtio devices)
WARNING: Block comments use a leading /* on a separate line
#48: FILE: contrib/libvhost-user/libvhost-user.c:544:
+        /* We only support devices conforming to VIRTIO 1.0 or

WARNING: Block comments use a trailing */ on a separate line
#49: FILE: contrib/libvhost-user/libvhost-user.c:545:
+         * later */

WARNING: line over 80 characters
#50: FILE: contrib/libvhost-user/libvhost-user.c:546:
+        vu_panic(dev, "virtio legacy devices aren't supported by libvhost-user");

total: 0 errors, 3 warnings, 33 lines checked

Patch 3/3 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20200717092929.19453-1-mhartmay@linux.ibm.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
no-reply@patchew.org July 17, 2020, 10:31 a.m. UTC | #2
Patchew URL: https://patchew.org/QEMU/20200717092929.19453-1-mhartmay@linux.ibm.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=bdade74ad18e41e6bde3a38af0ee03ee', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-_1lsptde/src/docker-src.2020-07-17-06.22.37.2505:/var/tmp/qemu:z,ro', 'qemu/fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=bdade74ad18e41e6bde3a38af0ee03ee
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-_1lsptde/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    9m20.974s
user    0m9.037s


The full log is available at
http://patchew.org/logs/20200717092929.19453-1-mhartmay@linux.ibm.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com