Skip to content

nbd-client: support device with and without '/dev/' prefix#189

Open
eworm-de wants to merge 1 commit intoNetworkBlockDevice:masterfrom
eworm-de:nbd-client-dev
Open

nbd-client: support device with and without '/dev/' prefix#189
eworm-de wants to merge 1 commit intoNetworkBlockDevice:masterfrom
eworm-de:nbd-client-dev

Conversation

@eworm-de
Copy link
Copy Markdown
Contributor

This broke with 8273f1e, where prefix must not be given.

Fixes: #187

This broke with 8273f1e, where prefix
must not be given.

Fixes: NetworkBlockDevice#187

Signed-off-by: Christian Hesse <mail@eworm.de>
Comment thread nbd-client.c
err("Invalid nbd device target\n");
if (sscanf(nbddev, "/dev/nbd%d", &index) != 1) {
if (sscanf(nbddev, "nbd%d", &index) != 1) {
err("Invalid nbd device target\n");
Copy link
Copy Markdown
Contributor

@RokerHRO RokerHRO Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why nested if instead of combine the conditions with && ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we have another case with nested if and I wanted to make things consistent. Happy to change this to concatenation... Actually that was my first idea.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened an alternative approach in #190 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regression in NBD 3.27.1

2 participants