summaryrefslogtreecommitdiff
path: root/qemu-nbd.c
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2010-09-17 20:37:25 +0200
committerKevin Wolf <kwolf@redhat.com>2010-09-21 15:39:42 +0200
commitc2e2872bf49884d2b2382613891ce979e95c11ca (patch)
tree1b55530a55c645bc899c0b6374e713cbe3fd4bb3 /qemu-nbd.c
parent5fe16888d33af7aca0d613d888c161af68c755c3 (diff)
downloadqemu-c2e2872bf49884d2b2382613891ce979e95c11ca.tar.gz
qemu-c2e2872bf49884d2b2382613891ce979e95c11ca.tar.bz2
qemu-c2e2872bf49884d2b2382613891ce979e95c11ca.zip
nbd: correctly manage default port
block/nbd.c: use default port number when none is specified qemu-nbd.c: use IANA-assigned port number: 10809 Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-nbd.c')
-rw-r--r--qemu-nbd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 923a3bfd34..99f1d22884 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -44,7 +44,7 @@ static void usage(const char *name)
"Usage: %s [OPTIONS] FILE\n"
"QEMU Disk Network Block Device Server\n"
"\n"
-" -p, --port=PORT port to listen on (default `1024')\n"
+" -p, --port=PORT port to listen on (default `%d')\n"
" -o, --offset=OFFSET offset into the image\n"
" -b, --bind=IFACE interface to bind to (default `0.0.0.0')\n"
" -k, --socket=PATH path to the unix socket\n"
@@ -62,7 +62,7 @@ static void usage(const char *name)
" -V, --version output version information and exit\n"
"\n"
"Report bugs to <anthony@codemonkey.ws>\n"
- , name, "DEVICE");
+ , name, NBD_DEFAULT_PORT, "DEVICE");
}
static void version(const char *name)
@@ -188,7 +188,7 @@ int main(int argc, char **argv)
bool readonly = false;
bool disconnect = false;
const char *bindto = "0.0.0.0";
- int port = 1024;
+ int port = NBD_DEFAULT_PORT;
struct sockaddr_in addr;
socklen_t addr_len = sizeof(addr);
off_t fd_size;