[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 27/44] vhost-user-blk-test: pass vhost-user socket fds to QSD
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 27/44] vhost-user-blk-test: pass vhost-user socket fds to QSD |
Date: |
Wed, 20 Oct 2021 06:20:28 -0400 |
From: Stefan Hajnoczi <stefanha@redhat.com>
qemu-storage-daemon is launched with the vhost-user listen socket path.
The path is first unlinked before opening the listen socket. This
prevents stale UNIX domain socket files from stopping socket
initialization.
This behavior is undesirable in vhost-user-blk-test and the cause of a
bug:
There is a race condition in vhost-user-blk-test when QEMU launches
before QSD. It connects to the old socket that QSD unlinks and the
vhost-user connection is never serviced, resulting in a hang.
Pass the listen socket fd to QSD to maintain listen socket continuity
and prevent the lost connection.
Fixes: 806952026df41939680abe92b329715b9b4e01cc ("test: new qTest case to test
the vhost-user-blk-server")
Cc: Raphael Norwitz <raphael.norwitz@nutanix.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: Coiby Xu <coiby.xu@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20211019135655.83067-1-stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
tests/qtest/vhost-user-blk-test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/qtest/vhost-user-blk-test.c
b/tests/qtest/vhost-user-blk-test.c
index 6f108a1b62..62e670f39b 100644
--- a/tests/qtest/vhost-user-blk-test.c
+++ b/tests/qtest/vhost-user-blk-test.c
@@ -906,9 +906,9 @@ static void start_vhost_user_blk(GString *cmd_line, int
vus_instances,
img_path = drive_create();
g_string_append_printf(storage_daemon_command,
"--blockdev driver=file,node-name=disk%d,filename=%s "
- "--export
type=vhost-user-blk,id=disk%d,addr.type=unix,addr.path=%s,"
+ "--export type=vhost-user-blk,id=disk%d,addr.type=fd,addr.str=%d,"
"node-name=disk%i,writable=on,num-queues=%d ",
- i, img_path, i, sock_path, i, num_queues);
+ i, img_path, i, fd, i, num_queues);
g_string_append_printf(cmd_line, "-chardev socket,id=char%d,path=%s ",
i + 1, sock_path);
--
MST
- [PULL v2 14/44] tests: migration-test: use qtest_has_accel() API, (continued)
- [PULL v2 14/44] tests: migration-test: use qtest_has_accel() API, Michael S. Tsirkin, 2021/10/20
- [PULL v2 13/44] tests: arm-cpu-features: use qtest_has_kvm() API, Michael S. Tsirkin, 2021/10/20
- [PULL v2 17/44] vdpa: Add vhost_vdpa_section_end, Michael S. Tsirkin, 2021/10/20
- [PULL v2 19/44] virtio-iommu: Remove the non transitional name, Michael S. Tsirkin, 2021/10/20
- [PULL v2 20/44] virtio-iommu: Drop base_name and change generic_name, Michael S. Tsirkin, 2021/10/20
- [PULL v2 23/44] vhost-user-rng-pci: Add vhost-user-rng-pci implementation, Michael S. Tsirkin, 2021/10/20
- [PULL v2 21/44] libvhost-user: fix VHOST_USER_REM_MEM_REG skipping mmap_addr, Michael S. Tsirkin, 2021/10/20
- [PULL v2 18/44] vdpa: Check for iova range at mappings changes, Michael S. Tsirkin, 2021/10/20
- [PULL v2 24/44] docs: Add documentation for vhost based RNG implementation, Michael S. Tsirkin, 2021/10/20
- [PULL v2 26/44] failover: fix a regression introduced by JSON'ification of -device, Michael S. Tsirkin, 2021/10/20
- [PULL v2 27/44] vhost-user-blk-test: pass vhost-user socket fds to QSD,
Michael S. Tsirkin <=
- [PULL v2 25/44] vhost-user: fix duplicated notifier MR init, Michael S. Tsirkin, 2021/10/20
- [PULL v2 22/44] vhost-user-rng: Add vhost-user-rng implementation, Michael S. Tsirkin, 2021/10/20
- [PULL v2 29/44] rebuild-expected-aml.sh: allow partial target list, Michael S. Tsirkin, 2021/10/20
- [PULL v2 30/44] bios-tables-test: don't disassemble empty files, Michael S. Tsirkin, 2021/10/20
- [PULL v2 28/44] qdev/qbus: remove failover specific code, Michael S. Tsirkin, 2021/10/20
- [PULL v2 33/44] vhost-vdpa: prepare for the multiqueue support, Michael S. Tsirkin, 2021/10/20
- [PULL v2 32/44] vhost-vdpa: classify one time request, Michael S. Tsirkin, 2021/10/20
- [PULL v2 34/44] vhost-vdpa: let net_vhost_vdpa_init() returns NetClientState *, Michael S. Tsirkin, 2021/10/20
- [PULL v2 31/44] vhost-vdpa: open device fd in net_init_vhost_vdpa(), Michael S. Tsirkin, 2021/10/20
- [PULL v2 36/44] vhost-net: control virtqueue support, Michael S. Tsirkin, 2021/10/20