From 0944b9c9706b08b0b8132ef84f489503d46f6383 Mon Sep 17 00:00:00 2001 From: Wouter Verhelst Date: Sat, 2 Jan 2016 20:37:31 +0100 Subject: [PATCH] Don't require a short device name only --- man/nbd-client.8.in.sgml | 15 +++++---------- nbd-client.c | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/man/nbd-client.8.in.sgml b/man/nbd-client.8.in.sgml index 7e04868..7dafeab 100644 --- a/man/nbd-client.8.in.sgml +++ b/man/nbd-client.8.in.sgml @@ -82,7 +82,7 @@ manpage.1: manpage.sgml &dhpackage; - short-device + nbd-device &dhpackage; @@ -167,15 +167,10 @@ manpage.1: manpage.sgml The block special file (/dev entry) which this nbd-client should connect to, specified as a full path. - - - - - The name of the block special file which this nbd-client should - connect to, but without the leading /dev part. - When this mode is used, &dhpackage; will look up the - necessary configuration in the nbdtab file. For - more information, see nbdtab(5). + When the mode is used wherein no hostname or export name is + specified, &dhpackage; will look up the necessary configuration in + the nbdtab file. For more information, see + nbdtab(5). diff --git a/nbd-client.c b/nbd-client.c index 87d5a72..a07b559 100644 --- a/nbd-client.c +++ b/nbd-client.c @@ -688,7 +688,7 @@ int main(int argc, char *argv[]) { #endif if(hostname) { if((!name || !nbddev) && !(opts & NBDC_DO_LIST)) { - if(!strncmp(hostname, "nbd", 3)) { + if(!strncmp(hostname, "nbd", 3) || !strncmp(hostname, "/dev/nbd", 8)) { if(!get_from_config(hostname, &name, &nbddev, &hostname, &blocksize, &timeout, &cont, &swap, &sdp, &b_unix, &port)) { usage("no valid configuration for specified device found", hostname); exit(EXIT_FAILURE); -- 2.11.4.GIT