blob: 0027841ecbf2629d2d6e9d818df6fcd35aa115e6 [file] [log] [blame]
bellard7a5ca862008-05-27 21:13:40 +00001@example
2@c man begin SYNOPSIS
Sitsofe Wheeler7e8911b2016-01-05 07:33:31 +00003@command{qemu-nbd} [OPTION]... @var{filename}
4
5@command{qemu-nbd} @option{-d} @var{dev}
bellard7a5ca862008-05-27 21:13:40 +00006@c man end
7@end example
8
9@c man begin DESCRIPTION
10
Sitsofe Wheeler7e8911b2016-01-05 07:33:31 +000011Export a QEMU disk image using the NBD protocol.
bellard7a5ca862008-05-27 21:13:40 +000012
13@c man end
14
15@c man begin OPTIONS
Sitsofe Wheeler7e8911b2016-01-05 07:33:31 +000016@var{filename} is a disk image filename.
17
18@var{dev} is an NBD device.
19
aliguori4a6b8192008-09-22 20:41:57 +000020@table @option
aliguori4a6b8192008-09-22 20:41:57 +000021@item -p, --port=@var{port}
Sitsofe Wheeler50901212016-01-05 07:33:32 +000022The TCP port to listen on (default @samp{10809})
aliguori4a6b8192008-09-22 20:41:57 +000023@item -o, --offset=@var{offset}
Sitsofe Wheeler50901212016-01-05 07:33:32 +000024The offset into the image
aliguori4a6b8192008-09-22 20:41:57 +000025@item -b, --bind=@var{iface}
Sitsofe Wheeler50901212016-01-05 07:33:32 +000026The interface to bind to (default @samp{0.0.0.0})
aliguori4a6b8192008-09-22 20:41:57 +000027@item -k, --socket=@var{path}
Sitsofe Wheelerb9dbb612016-01-05 07:33:30 +000028Use a unix socket with path @var{path}
Sitsofe Wheeler7e8911b2016-01-05 07:33:31 +000029@item -f, --format=@var{fmt}
Sitsofe Wheeler50901212016-01-05 07:33:32 +000030Force the use of the block driver for format @var{fmt} instead of
Sitsofe Wheeler7e8911b2016-01-05 07:33:31 +000031auto-detecting
bellard7a5ca862008-05-27 21:13:40 +000032@item -r, --read-only
Sitsofe Wheeler50901212016-01-05 07:33:32 +000033Export the disk as read-only
aliguori4a6b8192008-09-22 20:41:57 +000034@item -P, --partition=@var{num}
Sitsofe Wheeler50901212016-01-05 07:33:32 +000035Only expose partition @var{num}
ths2f726482008-07-03 11:47:46 +000036@item -s, --snapshot
Sitsofe Wheeler50901212016-01-05 07:33:32 +000037Use @var{filename} as an external snapshot, create a temporary
Sitsofe Wheelerb9dbb612016-01-05 07:33:30 +000038file with backing_file=@var{filename}, redirect the write to
39the temporary one
Wenchao Xia8c116b02013-12-04 17:10:55 +080040@item -l, --load-snapshot=@var{snapshot_param}
Sitsofe Wheeler50901212016-01-05 07:33:32 +000041Load an internal snapshot inside @var{filename} and export it
Sitsofe Wheelerb9dbb612016-01-05 07:33:30 +000042as an read-only device, @var{snapshot_param} format is
43'snapshot.id=[ID],snapshot.name=[NAME]' or '[ID_OR_NAME]'
ths2f726482008-07-03 11:47:46 +000044@item -n, --nocache
Paolo Bonzini0eb256a2013-02-08 13:19:07 +010045@itemx --cache=@var{cache}
Sitsofe Wheeler50901212016-01-05 07:33:32 +000046The cache mode to be used with the file. See the documentation of
Sitsofe Wheelerb9dbb612016-01-05 07:33:30 +000047the emulator's @code{-drive cache=...} option for allowed values.
Paolo Bonzini0eb256a2013-02-08 13:19:07 +010048@item --aio=@var{aio}
Sitsofe Wheeler50901212016-01-05 07:33:32 +000049Set the asynchronous I/O mode between @samp{threads} (the default)
Sitsofe Wheelerb9dbb612016-01-05 07:33:30 +000050and @samp{native} (Linux only).
Paolo Bonzinided9d2d2013-02-08 14:06:13 +010051@item --discard=@var{discard}
Sitsofe Wheeler50901212016-01-05 07:33:32 +000052Control whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap})
Sitsofe Wheeler7e8911b2016-01-05 07:33:31 +000053requests are ignored or passed to the filesystem. @var{discard} is one of
54@samp{ignore} (or @samp{off}), @samp{unmap} (or @samp{on}). The default is
55@samp{ignore}.
56@item --detect-zeroes=@var{detect-zeroes}
Sitsofe Wheeler50901212016-01-05 07:33:32 +000057Control the automatic conversion of plain zero writes by the OS to
Sitsofe Wheeler7e8911b2016-01-05 07:33:31 +000058driver-specific optimized zero write commands. @var{detect-zeroes} is one of
59@samp{off}, @samp{on} or @samp{unmap}. @samp{unmap}
60converts a zero write to an unmap operation and can only be used if
61@var{discard} is set to @samp{unmap}. The default is @samp{off}.
Ryota Ozakibba7be92010-03-04 00:18:43 +090062@item -c, --connect=@var{dev}
Sitsofe Wheeler50901212016-01-05 07:33:32 +000063Connect @var{filename} to NBD device @var{dev}
thscd831bd2008-07-03 10:23:51 +000064@item -d, --disconnect
Sitsofe Wheeler50901212016-01-05 07:33:32 +000065Disconnect the device @var{dev}
aliguori4a6b8192008-09-22 20:41:57 +000066@item -e, --shared=@var{num}
Sitsofe Wheeler50901212016-01-05 07:33:32 +000067Allow up to @var{num} clients to share the device (default @samp{1})
ths75818252008-07-03 13:41:03 +000068@item -t, --persistent
Sitsofe Wheeler50901212016-01-05 07:33:32 +000069Don't exit on the last connection
bellard7a5ca862008-05-27 21:13:40 +000070@item -v, --verbose
Sitsofe Wheeler50901212016-01-05 07:33:32 +000071Display extra debugging information
bellard7a5ca862008-05-27 21:13:40 +000072@item -h, --help
Sitsofe Wheeler50901212016-01-05 07:33:32 +000073Display this help and exit
bellard7a5ca862008-05-27 21:13:40 +000074@item -V, --version
Sitsofe Wheeler50901212016-01-05 07:33:32 +000075Display version information and exit
bellard7a5ca862008-05-27 21:13:40 +000076@end table
77
78@c man end
79
80@ignore
81
82@setfilename qemu-nbd
83@settitle QEMU Disk Network Block Device Server
84
85@c man begin AUTHOR
86Copyright (C) 2006 Anthony Liguori <anthony@codemonkey.ws>.
87This is free software; see the source for copying conditions. There is NO
88warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
89@c man end
90
91@c man begin SEEALSO
Sitsofe Wheeler7e8911b2016-01-05 07:33:31 +000092qemu(1), qemu-img(1)
bellard7a5ca862008-05-27 21:13:40 +000093@c man end
94
95@end ignore