]> git.proxmox.com Git - mirror_qemu.git/commit
vhost-user-blk-test: pass vhost-user socket fds to QSD
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 19 Oct 2021 13:56:55 +0000 (14:56 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 20 Oct 2021 08:37:55 +0000 (04:37 -0400)
commit515efffc2fd0928317a0a1ec47b28a972c40ddad
treef4c7962ffa14c5a91ebd0ce8511a56f7b46222c2
parent7fe7791e3f652ac31ef98dcc94a8f2a317ab846b
vhost-user-blk-test: pass vhost-user socket fds to QSD

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