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(a)redhat.com>