Message ID | 20201027173528.213464-1-stefanha@redhat.com |
---|---|
Headers | show |
Series | block/export: vhost-user-blk server cleanups and tests | expand |
On Tue, Oct 27, 2020 at 05:35:16PM +0000, Stefan Hajnoczi wrote: > This patch series solves some issues with the new vhost-user-blk-server and > adds the qtest test case. The test case was not included in the pull request > that introduced the vhost-user-blk server because of reliability issues that > are fixed in this patch series. Fails make check for me: Running test qtest-i386/qos-test Broken pipe ../qemu/tests/qtest/libqtest.c:161: kill_qemu() detected QEMU death from signal 11 (Segmentation fault) (core dumped) ERROR qtest-i386/qos-test - too few tests run (expected 92, got 65) make: *** [Makefile.mtest:1857: run-test-230] Error 1 > Coiby Xu (1): > test: new qTest case to test the vhost-user-blk-server > > Stefan Hajnoczi (11): > libvhost-user: follow QEMU comment style > configure: introduce --enable-vhost-user-blk-server > block/export: make vhost-user-blk config space little-endian > block/export: fix vhost-user-blk get_config() information leak > contrib/vhost-user-blk: fix get_config() information leak > tests/qtest: add multi-queue test case to vhost-user-blk-test > libqtest: add qtest_socket_server() > vhost-user-blk-test: rename destroy_drive() to destroy_file() > vhost-user-blk-test: close fork child file descriptors > vhost-user-blk-test: drop unused return value > vhost-user-blk-test: fix races by using fd passing > > configure | 15 + > contrib/libvhost-user/libvhost-user.h | 15 +- > tests/qtest/libqos/libqtest.h | 25 + > tests/qtest/libqos/vhost-user-blk.h | 48 ++ > block/export/export.c | 4 +- > block/export/vhost-user-blk-server.c | 28 +- > contrib/vhost-user-blk/vhost-user-blk.c | 2 + > tests/qtest/libqos/vhost-user-blk.c | 129 ++++ > tests/qtest/libqtest.c | 76 ++- > tests/qtest/vhost-user-blk-test.c | 843 ++++++++++++++++++++++++ > block/export/meson.build | 2 +- > tests/qtest/libqos/meson.build | 1 + > tests/qtest/meson.build | 2 + > util/meson.build | 2 +- > 14 files changed, 1151 insertions(+), 41 deletions(-) > create mode 100644 tests/qtest/libqos/vhost-user-blk.h > create mode 100644 tests/qtest/libqos/vhost-user-blk.c > create mode 100644 tests/qtest/vhost-user-blk-test.c > > -- > 2.26.2 >
On Fri, Oct 30, 2020 at 08:42:22AM -0400, Michael S. Tsirkin wrote: > On Tue, Oct 27, 2020 at 05:35:16PM +0000, Stefan Hajnoczi wrote: > > This patch series solves some issues with the new vhost-user-blk-server and > > adds the qtest test case. The test case was not included in the pull request > > that introduced the vhost-user-blk server because of reliability issues that > > are fixed in this patch series. > > > Fails make check for me: > > Running test qtest-i386/qos-test > Broken pipe > ../qemu/tests/qtest/libqtest.c:161: kill_qemu() detected QEMU death from signal 11 (Segmentation fault) (core dumped) > ERROR qtest-i386/qos-test - too few tests run (expected 92, got 65) > make: *** [Makefile.mtest:1857: run-test-230] Error 1 And here's the coredump: [mst@tuck qemu-oot]$ coredumpctl debug 853792 PID: 853792 (qemu-system-i38) UID: 1000 (mst) GID: 1000 (mst) Signal: 11 (SEGV) Timestamp: Fri 2020-10-30 08:41:31 EDT (2 days ago) Command Line: ./qemu-system-i386 -qtest unix:/tmp/qtest-853536.sock -qtest-log /dev/null -chardev socket,path=/tmp/qtest-853536.qmp,id=char0 -mon chardev=char0,mode=control -display none -M pc -device vhost-user-blk-pci,id=drv0,chardev=char1,addr=4.0 -object memory-backend-memfd,id=mem,size=256M,share=on -M memory-backend=mem -chardev socket,id=char1,path=/tmp/qtest-853536-sock.krlJyA -accel qtest Executable: /scm/qemu-oot/qemu-system-i386 Control Group: /user.slice/user-1000.slice/session-4.scope Unit: session-4.scope Slice: user-1000.slice Session: 4 Owner UID: 1000 (mst) Boot ID: 978b4cacb2df46319a9c6310b653f95d Machine ID: 6234c9d2c9c34980ad6b1b2de307f043 Hostname: tuck.redhat.com Storage: /var/lib/systemd/coredump/core.qemu-system-i38.1000.978b4cacb2df46319a9c6310b653f95d.853792.1604061691000000.lz4 Message: Process 853792 (qemu-system-i38) of user 1000 dumped core. Stack trace of thread 853792: #0 0x000055b2ace9ca0b vhost_dev_has_iommu (qemu-system-i386 + 0x657a0b) #1 0x000055b2ace9fbbf vhost_dev_prepare_inflight (qemu-system-i386 + 0x65abbf) #2 0x000055b2ace51d01 vhost_user_blk_start (qemu-system-i386 + 0x60cd01) #3 0x000055b2ace51f1a vhost_user_blk_set_status (qemu-system-i386 + 0x60cf1a) #4 0x000055b2acde489b virtio_set_status (qemu-system-i386 + 0x59f89b) #5 0x000055b2acb38638 virtio_pci_common_write (qemu-system-i386 + 0x2f3638) #6 0x000055b2ace4818c memory_region_write_accessor (qemu-system-i386 + 0x60318c) #7 0x000055b2ace46cae access_with_adjusted_size (qemu-system-i386 + 0x601cae) #8 0x000055b2ace4a4c3 memory_region_dispatch_write (qemu-system-i386 + 0x6054c3) #9 0x000055b2ace72010 flatview_write_continue (qemu-system-i386 + 0x62d010) #10 0x000055b2ace74fc5 flatview_write (qemu-system-i386 + 0x62ffc5) #11 0x000055b2acdc0981 qtest_process_command (qemu-system-i386 + 0x57b981) #12 0x000055b2acdc111d qtest_process_inbuf (qemu-system-i386 + 0x57c11d) #13 0x000055b2acf7092e tcp_chr_read (qemu-system-i386 + 0x72b92e) #14 0x00007f0554a5f78f g_main_context_dispatch (libglib-2.0.so.0 + 0x5278f) #15 0x000055b2acfbbed8 glib_pollfds_poll (qemu-system-i386 + 0x776ed8) #16 0x000055b2acdccbf2 qemu_main_loop (qemu-system-i386 + 0x587bf2) #17 0x000055b2acb0a5be main (qemu-system-i386 + 0x2c55be) #18 0x00007f0553000042 __libc_start_main (libc.so.6 + 0x27042) #19 0x000055b2acb0e97e _start (qemu-system-i386 + 0x2c997e) Stack trace of thread 853794: #0 0x00007f05530a1801 clock_nanosleep@@GLIBC_2.17 (libc.so.6 + 0xc8801) #1 0x00007f05530a7157 __nanosleep (libc.so.6 + 0xce157) #2 0x00007f0554a8b2d7 g_usleep (libglib-2.0.so.0 + 0x7e2d7) #3 0x000055b2acfbfa9a call_rcu_thread (qemu-system-i386 + 0x77aa9a) #4 0x000055b2acfd1cb9 qemu_thread_start (qemu-system-i386 + 0x78ccb9) #5 0x00007f05531ac432 start_thread (libpthread.so.0 + 0x9432) #6 0x00007f05530da913 __clone (libc.so.6 + 0x101913) Stack trace of thread 853796: #0 0x00007f0553016962 __sigtimedwait (libc.so.6 + 0x3d962) #1 0x00007f05531b75bc sigwait (libpthread.so.0 + 0x145bc) #2 0x000055b2ace8c223 dummy_cpu_thread_fn (qemu-system-i386 + 0x647223) #3 0x000055b2acfd1cb9 qemu_thread_start (qemu-system-i386 + 0x78ccb9) #4 0x00007f05531ac432 start_thread (libpthread.so.0 + 0x9432) #5 0x00007f05530da913 __clone (libc.so.6 + 0x101913) Stack trace of thread 853795: #0 0x00007f05530cfaaf __poll (libc.so.6 + 0xf6aaf) #1 0x00007f0554a5faae g_main_context_iterate.constprop.0 (libglib-2.0.so.0 + 0x52aae) #2 0x00007f0554a5fe33 g_main_loop_run (libglib-2.0.so.0 + 0x52e33) #3 0x000055b2acedcd01 iothread_run (qemu-system-i386 + 0x697d01) #4 0x000055b2acfd1cb9 qemu_thread_start (qemu-system-i386 + 0x78ccb9) #5 0x00007f05531ac432 start_thread (libpthread.so.0 + 0x9432) #6 0x00007f05530da913 __clone (libc.so.6 + 0x101913) GNU gdb (GDB) Fedora 9.1-6.fc32 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /scm/qemu-oot/qemu-system-i386... warning: core file may not match specified executable file. [New LWP 853792] [New LWP 853794] [New LWP 853796] [New LWP 853795] Core was generated by `./qemu-system-i386 -qtest unix:/tmp/qtest-853536.sock -qtest-log /dev/null -cha'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x000055b2ace9ca0b in ?? () [Current thread is 1 (LWP 853792)] warning: File "/scm/qemu/.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/usr/lib/golang/src/runtime/runtime-gdb.py". To enable execution of this file add add-auto-load-safe-path /scm/qemu/.gdbinit line to your configuration file "/home/mst/.gdbinit". To completely disable this security protection add set auto-load safe-path / line to your configuration file "/home/mst/.gdbinit". For more information about this security protection see the "Auto-loading safe path" section in the GDB manual. E.g., run from the shell: info "(gdb)Auto-loading safe path" > > > Coiby Xu (1): > > test: new qTest case to test the vhost-user-blk-server > > > > Stefan Hajnoczi (11): > > libvhost-user: follow QEMU comment style > > configure: introduce --enable-vhost-user-blk-server > > block/export: make vhost-user-blk config space little-endian > > block/export: fix vhost-user-blk get_config() information leak > > contrib/vhost-user-blk: fix get_config() information leak > > tests/qtest: add multi-queue test case to vhost-user-blk-test > > libqtest: add qtest_socket_server() > > vhost-user-blk-test: rename destroy_drive() to destroy_file() > > vhost-user-blk-test: close fork child file descriptors > > vhost-user-blk-test: drop unused return value > > vhost-user-blk-test: fix races by using fd passing > > > > configure | 15 + > > contrib/libvhost-user/libvhost-user.h | 15 +- > > tests/qtest/libqos/libqtest.h | 25 + > > tests/qtest/libqos/vhost-user-blk.h | 48 ++ > > block/export/export.c | 4 +- > > block/export/vhost-user-blk-server.c | 28 +- > > contrib/vhost-user-blk/vhost-user-blk.c | 2 + > > tests/qtest/libqos/vhost-user-blk.c | 129 ++++ > > tests/qtest/libqtest.c | 76 ++- > > tests/qtest/vhost-user-blk-test.c | 843 ++++++++++++++++++++++++ > > block/export/meson.build | 2 +- > > tests/qtest/libqos/meson.build | 1 + > > tests/qtest/meson.build | 2 + > > util/meson.build | 2 +- > > 14 files changed, 1151 insertions(+), 41 deletions(-) > > create mode 100644 tests/qtest/libqos/vhost-user-blk.h > > create mode 100644 tests/qtest/libqos/vhost-user-blk.c > > create mode 100644 tests/qtest/vhost-user-blk-test.c > > > > -- > > 2.26.2 > >
On Mon, Nov 02, 2020 at 05:43:19AM -0500, Michael S. Tsirkin wrote: > On Fri, Oct 30, 2020 at 08:42:22AM -0400, Michael S. Tsirkin wrote: > > On Tue, Oct 27, 2020 at 05:35:16PM +0000, Stefan Hajnoczi wrote: > > > This patch series solves some issues with the new vhost-user-blk-server and > > > adds the qtest test case. The test case was not included in the pull request > > > that introduced the vhost-user-blk server because of reliability issues that > > > are fixed in this patch series. > > > > > > Fails make check for me: > > > > Running test qtest-i386/qos-test > > Broken pipe > > ../qemu/tests/qtest/libqtest.c:161: kill_qemu() detected QEMU death from signal 11 (Segmentation fault) (core dumped) > > ERROR qtest-i386/qos-test - too few tests run (expected 92, got 65) > > make: *** [Makefile.mtest:1857: run-test-230] Error 1 > > And here's the coredump: Thanks! qemu.git/master is broken. The segfault was introduced in adb29c027341ba095a3ef4beef6aaef86d3a520e ("vhost-blk: set features before setting inflight feature"). The code in question has no test coverage so we didn't know that vhost-user-blk is broken in QEMU. I have sent a patch to revert the commit. Let's do that for QEMU 5.2 unless a straightforward fix can be provided in place of the revert. Stefan