qemu/tests
Eric Blake 58a6fdcc9e nbd/server: Allow MULTI_CONN for shared writable exports
According to the NBD spec, a server that advertises
NBD_FLAG_CAN_MULTI_CONN promises that multiple client connections will
not see any cache inconsistencies: when properly separated by a single
flush, actions performed by one client will be visible to another
client, regardless of which client did the flush.

We always satisfy these conditions in qemu - even when we support
multiple clients, ALL clients go through a single point of reference
into the block layer, with no local caching.  The effect of one client
is instantly visible to the next client.  Even if our backend were a
network device, we argue that any multi-path caching effects that
would cause inconsistencies in back-to-back actions not seeing the
effect of previous actions would be a bug in that backend, and not the
fault of caching in qemu.  As such, it is safe to unconditionally
advertise CAN_MULTI_CONN for any qemu NBD server situation that
supports parallel clients.

Note, however, that we don't want to advertise CAN_MULTI_CONN when we
know that a second client cannot connect (for historical reasons,
qemu-nbd defaults to a single connection while nbd-server-add and QMP
commands default to unlimited connections; but we already have
existing means to let either style of NBD server creation alter those
defaults).  This is visible by no longer advertising MULTI_CONN for
'qemu-nbd -r' without -e, as in the iotest nbd-qemu-allocation.

The harder part of this patch is setting up an iotest to demonstrate
behavior of multiple NBD clients to a single server.  It might be
possible with parallel qemu-io processes, but I found it easier to do
in python with the help of libnbd, and help from Nir and Vladimir in
writing the test.

Signed-off-by: Eric Blake <eblake@redhat.com>
Suggested-by: Nir Soffer <nsoffer@redhat.com>
Suggested-by: Vladimir Sementsov-Ogievskiy <v.sementsov-og@mail.ru>
Message-Id: <20220512004924.417153-3-eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2022-05-12 13:10:52 +02:00
..
avocado test/avocado/machine_aspeed.py: Add ast1030 test case 2022-05-02 17:03:04 +02:00
bench
data
decode
docker Testing, docs and gdbstub updates: 2022-04-20 11:13:08 -07:00
fp compiler.h: replace QEMU_NORETURN with G_NORETURN 2022-04-21 17:03:51 +04:00
guest-debug tests/guest-debug: better handle gdb crashes 2022-04-20 16:04:20 +01:00
image-fuzzer
include
keys
lcitool tests: Drop perl-Test-Harness from the CI containers / VMs 2022-04-20 08:54:16 +02:00
migration
multiboot
perf/block/qcow2
plugin
qapi-schema qapi-schema: test: add a unit test for parsing array alternates 2022-04-21 10:11:25 +02:00
qemu-iotests nbd/server: Allow MULTI_CONN for shared writable exports 2022-05-12 13:10:52 +02:00
qtest tests/qtest/fdc-test: Add a regression test for CVE-2021-3507 2022-05-12 13:03:25 +02:00
rocker
tcg tests/tcg/xtensa: fix vectors and checks in timer test 2022-05-06 15:27:40 -07:00
tsan
uefi-test-tools
unit util: rename qemu_*block() socket functions 2022-05-03 15:53:20 +04:00
vm tests/vm: update openbsd to release 7.1 2022-05-09 08:21:14 +02:00
vmstate-static-checker-data
check-block.sh tests/qemu-iotests: Move the bash and sanitizer checks to meson.build 2022-04-20 09:46:54 +02:00
dbus-vmstate-daemon.sh
Makefile.include tests/tcg: invoke Makefile.target directly from QEMU's makefile 2022-04-20 16:04:20 +01:00
meson.build meson: create have_vhost_* variables 2022-05-07 07:46:58 +02:00
requirements.txt
test-qht-par.c
vhost-user-bridge.c