Skip to content

Map empty string export name to default #9

@rwmjones

Description

@rwmjones

The NBD protocol says ...

A special, "empty", name (i.e., the length field is zero and no name is specified), is reserved for a "default" export, to be used in cases where explicitly specifying an export name makes no sense.

I notice that this server doesn't seem to do this:

$ nbdinfo nbd://localhost/
nbdinfo: nbd_opt_go: server replied with error to opt_go request: No such file or directory for the default export
nbdinfo: suggestion: to list all exports on the server, use --list
protocol: newstyle-fixed without TLS, using simple packets

Using --list shows that there is one export literally called default:

$ nbdinfo --list nbd://localhost
protocol: newstyle-fixed without TLS, using simple packets
export="default":
	export-size: 1073741824 (1G)
	uri: nbd://localhost:10809/default
	is_rotational: false
	is_read_only: false
	can_block_status_payload: false
	can_cache: false
	can_df: false
	can_fast_zero: false
	can_flush: false
	can_fua: false
	can_multi_conn: true
	can_trim: false
	can_zero: false
	block_size_minimum: 1
	block_size_preferred: 4096 (4K)
	block_size_maximum: 4294967295

I would suggest mapping the empty string to default export as per the specification.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions