On Tue, Mar 15, 2022 at 01:14:41PM +0000, Richard W.M. Jones wrote:
> The patches seem OK to me, but I don't really know enough about the
> internals of qemu-nbd to give a line-by-line review.  I did however
> build and test qemu-nbd with the patches:
> 
>   $ ./build/qemu-nbd /var/tmp/test.qcow2 
>   $ nbdinfo nbd://localhost
>   ...
>       can_multi_conn: false
> 
> 
>   $ ./build/qemu-nbd -e 2 /var/tmp/test.qcow2 
>   $ nbdinfo nbd://localhost
>   ...
>       can_multi_conn: false
> 
> ^^^ Is this expected?  It also happens with -e 0.

Yes, because qemu-nbd defaults to read-write connections, but to be
conservative, this patch defaults '-m auto' to NOT advertise
multi-conn for read-write; you need to be explicit:

> 
> 
>   $ ./build/qemu-nbd -e 2 -m on /var/tmp/test.qcow2 
>   $ nbdinfo nbd://localhost
>   ...
>       can_multi_conn: true

either with '-m on' as you did here, or with

build/qemu-nbd -r -e 2 /var/tmp/test.qcow2

where the '-m auto' default exposes multi-conn for a readonly client.

> 
> 
>   $ ./build/qemu-nbd -e 2 -m off /var/tmp/test.qcow2 
>   $ nbdinfo nbd://localhost
>   ...
>       can_multi_conn: false
> 
> 
> Rich.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


Reply via email to