nbd-client: support device with and without '/dev/' prefix#189
Open
eworm-de wants to merge 1 commit intoNetworkBlockDevice:masterfrom
Open
nbd-client: support device with and without '/dev/' prefix#189eworm-de wants to merge 1 commit intoNetworkBlockDevice:masterfrom
eworm-de wants to merge 1 commit intoNetworkBlockDevice:masterfrom
Conversation
This broke with 8273f1e, where prefix must not be given. Fixes: NetworkBlockDevice#187 Signed-off-by: Christian Hesse <mail@eworm.de>
RokerHRO
reviewed
Apr 21, 2026
| 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"); |
Contributor
There was a problem hiding this comment.
why nested if instead of combine the conditions with && ?
Contributor
Author
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
Opened an alternative approach in #190 ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This broke with 8273f1e, where prefix must not be given.
Fixes: #187