Fix backup of stopped VMs by allowing multiple connections.

This commit is contained in:
Abhisar Sinha 2026-03-17 07:35:38 +05:30 committed by Abhishek Kumar
parent 29dbf69d27
commit d527762766
1 changed files with 3 additions and 1 deletions

View File

@ -68,8 +68,10 @@ public class LibvirtStartNBDServerCommandWrapper extends CommandWrapper<StartNBD
}
String socketName = "/tmp/imagetransfer/" + socket + ".sock";
// --persistent: Don't stop the service when the last client disconnects.
// --shared=NUM: Allow up to NUM clients to share the device (default 1), 0 for unlimited. Number of parallel connections is managed by the image server.
String systemdRunCmd = String.format(
"systemd-run --unit=%s --property=Restart=no qemu-nbd --export-name %s --socket %s --persistent %s %s %s",
"systemd-run --unit=%s --property=Restart=no qemu-nbd --export-name %s --socket %s --persistent --shared=0 %s %s %s",
unitName,
exportName,
socketName,