[pve-devel] [PATCH qemu-server 3/4] nbd: listen on UNIX socket

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Mar 6 11:20:34 CET 2020


extracted from WIP patch by Mira Limbeck. as-is, this is a very breaking
change, but it should be possible to integrate it in a backwards
compatible fashion.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 PVE/QemuServer.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 050c03b..be8bc4b 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5475,7 +5475,9 @@ sub vm_start {
 	    my $pfamily = PVE::Tools::get_host_address_family($nodename);
 	    my $storage_migrate_port = PVE::Tools::next_migrate_port($pfamily);
 
-	    mon_cmd($vmid, "nbd-server-start", addr => { type => 'inet', data => { host => "${localip}", port => "${storage_migrate_port}" } } );
+	      # nbd:unix:<socket>. only 1 server possible
+	      # mon_cmd($vmid, "nbd-server-start", addr =>  { type =>  'inet', data =>  { host =>  "${localip}", port =>  "${storage_migrate_port}" } } );
+	      mon_cmd($vmid, "nbd-server-start", addr =>  { type =>  'unix', data =>  { path =>  "/run/qemu-server/$vmid\_nbd.migrate" } } );
 
 	    $localip = "[$localip]" if Net::IP::ip_is_ipv6($localip);
 
@@ -5483,7 +5485,8 @@ sub vm_start {
 		my $drivestr = $local_volumes->{$opt};
 		mon_cmd($vmid, "nbd-server-add", device => "drive-$opt", writable => JSON::true );
 		my $migrate_storage_uri = "nbd:${localip}:${storage_migrate_port}:exportname=drive-$opt";
-		print "storage migration listens on $migrate_storage_uri volume:$drivestr\n";
+		# print "storage migration listens on $migrate_storage_uri volume:$volid\n";
+		print "storage migration listens on nbd:unix:/run/qemu-server/$vmid\_nbd.migrate:exportname=drive-$opt volume:$drivestr\n";
 	    }
 	}
 
-- 
2.20.1





More information about the pve-devel mailing list