[pve-devel] [RFC qemu-server 21/22] blockdev: add support for NBD paths

Fiona Ebner f.ebner at proxmox.com
Tue Jun 17 12:11:09 CEST 2025


Am 16.06.25 um 12:46 schrieb DERUMIER, Alexandre via pve-devel:
> 
> I think I have wrongly dropped  nbd with unix socket  in my last patch
> series, but previously it was:
> 
> 
> +    } elsif ($path =~ m/^nbd:(\S+):(\d+):exportname=(\S+)$/) {
> +	my $server = { type => 'inet', host => $1, port => $2 };
> +	$blockdev = { driver => 'nbd', server => $server, export => $3
> };
> +    } elsif ($path =~ m/^nbd:unix:(\S+):exportname=(\S+)$/) {
> +	my $server = { type => 'unix', path => $1 };
> +	$blockdev = { driver => 'nbd', server => $server, export => $2
> };

Right, we use those paths too, good catch!

Just noting for completeness: In the future, we might want to switch to
the more modern syntax, but that is something for later (and requires
proper backwards-compat handling for migration). From 'man kvm':

>               Syntax  for  specifying  a  NBD  device  using   TCP,   in   preferred   URI   form:
>               "nbd://<server-ip>[:<port>]/[<export>]"
> 
>               Syntax for specifying a NBD device using Unix Domain Sockets; remember that '?' is a
>               shell glob  character  and  may  need  quoting:  "nbd+unix:///[<export>]?socket=<do‐
>               main-socket>"
> 
>               Older syntax that is also recognized: "nbd:<server-ip>:<port>[:exportname=<export>]"
> 
>               Syntax  for  specifying  a  NBD  device  using  Unix  Domain  Sockets "nbd:unix:<do‐
>               main-socket>[:exportname=<export>]"





More information about the pve-devel mailing list