Richard W.M. Jones
2022-Jan-19 18:57 UTC
[Libguestfs] [PATCH v2v 2/3] lib/qemuNBD.ml: Use qemu-nbd --shared=0 flag to allow multiple connections
qemu-nbd --shared (-e) flag controls how many clients can connect concurrently. 0 means unlimited. We want to allow the sockets to be queried by other processes while virt-v2v is running and it should be safe to do this. The default configuration of qemu-nbd doesn't allow this so add --shared=0. Note this does not (in current qemu) enable multi-conn because we aren't using the -r (read-only) flag. --- lib/qemuNBD.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/qemuNBD.ml b/lib/qemuNBD.ml index 12d083aeb7..89c93d7072 100644 --- a/lib/qemuNBD.ml +++ b/lib/qemuNBD.ml @@ -90,7 +90,11 @@ let run_unix ?socket { disk; snapshot; format } (* Construct the qemu-nbd command line. *) let args = ref [] in List.push_back_list args - ["qemu-nbd"; "-t"; "--pid-file"; pidfile; "--socket"; socket]; + ["qemu-nbd"; + "-t"; + "--shared=0"; + "--pid-file"; pidfile; + "--socket"; socket]; (* -s adds a protective overlay. *) if snapshot then List.push_back args "-s"; -- 2.32.0
Laszlo Ersek
2022-Jan-20 12:30 UTC
[Libguestfs] [PATCH v2v 2/3] lib/qemuNBD.ml: Use qemu-nbd --shared=0 flag to allow multiple connections
On 01/19/22 19:57, Richard W.M. Jones wrote:> qemu-nbd --shared (-e) flag controls how many clients can connect > concurrently. 0 means unlimited. > > We want to allow the sockets to be queried by other processes while > virt-v2v is running and it should be safe to do this. The default > configuration of qemu-nbd doesn't allow this so add --shared=0. > > Note this does not (in current qemu) enable multi-conn because we > aren't using the -r (read-only) flag. > --- > lib/qemuNBD.ml | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/lib/qemuNBD.ml b/lib/qemuNBD.ml > index 12d083aeb7..89c93d7072 100644 > --- a/lib/qemuNBD.ml > +++ b/lib/qemuNBD.ml > @@ -90,7 +90,11 @@ let run_unix ?socket { disk; snapshot; format } > (* Construct the qemu-nbd command line. *) > let args = ref [] in > List.push_back_list args > - ["qemu-nbd"; "-t"; "--pid-file"; pidfile; "--socket"; socket]; > + ["qemu-nbd"; > + "-t"; > + "--shared=0"; > + "--pid-file"; pidfile; > + "--socket"; socket]; > > (* -s adds a protective overlay. *) > if snapshot then List.push_back args "-s"; >Reviewed-by: Laszlo Ersek <lersek at redhat.com>
Eric Blake
2022-Jan-20 17:22 UTC
[Libguestfs] [PATCH v2v 2/3] lib/qemuNBD.ml: Use qemu-nbd --shared=0 flag to allow multiple connections
On Wed, Jan 19, 2022 at 06:57:48PM +0000, Richard W.M. Jones wrote:> qemu-nbd --shared (-e) flag controls how many clients can connect > concurrently. 0 means unlimited.As of qemu commit 3dcf56e625 (v6.0.0). Does v2v need to cater to older qemu, or are we at the point where we can say "using this version of v2v requires at least X minimum version of qemu"?> > We want to allow the sockets to be queried by other processes while > virt-v2v is running and it should be safe to do this. The default > configuration of qemu-nbd doesn't allow this so add --shared=0. > > Note this does not (in current qemu) enable multi-conn because we > aren't using the -r (read-only) flag.Yeah, I still need to work on that for qemu 7.0 (my attempt for 6.2 garnered some interesting review comments from Kevin, which I still need to address). -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org