3 @command{qemu-nbd} [OPTION]... @var{filename}
5 @command{qemu-nbd} @option{-d} @var{dev}
9 @c man begin DESCRIPTION
11 Export a QEMU disk image using the NBD protocol.
16 @var{filename} is a disk image filename.
18 @var{dev} is an NBD device.
21 @item -p, --port=@var{port}
22 The TCP port to listen on (default @samp{10809})
23 @item -o, --offset=@var{offset}
24 The offset into the image
25 @item -b, --bind=@var{iface}
26 The interface to bind to (default @samp{0.0.0.0})
27 @item -k, --socket=@var{path}
28 Use a unix socket with path @var{path}
29 @item -f, --format=@var{fmt}
30 Force the use of the block driver for format @var{fmt} instead of
33 Export the disk as read-only
34 @item -P, --partition=@var{num}
35 Only expose partition @var{num}
37 Use @var{filename} as an external snapshot, create a temporary
38 file with backing_file=@var{filename}, redirect the write to
40 @item -l, --load-snapshot=@var{snapshot_param}
41 Load an internal snapshot inside @var{filename} and export it
42 as an read-only device, @var{snapshot_param} format is
43 'snapshot.id=[ID],snapshot.name=[NAME]' or '[ID_OR_NAME]'
45 @itemx --cache=@var{cache}
46 The cache mode to be used with the file. See the documentation of
47 the emulator's @code{-drive cache=...} option for allowed values.
49 Set the asynchronous I/O mode between @samp{threads} (the default)
50 and @samp{native} (Linux only).
51 @item --discard=@var{discard}
52 Control whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap})
53 requests 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
56 @item --detect-zeroes=@var{detect-zeroes}
57 Control the automatic conversion of plain zero writes by the OS to
58 driver-specific optimized zero write commands. @var{detect-zeroes} is one of
59 @samp{off}, @samp{on} or @samp{unmap}. @samp{unmap}
60 converts 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}.
62 @item -c, --connect=@var{dev}
63 Connect @var{filename} to NBD device @var{dev}
64 @item -d, --disconnect
65 Disconnect the device @var{dev}
66 @item -e, --shared=@var{num}
67 Allow up to @var{num} clients to share the device (default @samp{1})
68 @item -t, --persistent
69 Don't exit on the last connection
71 Display extra debugging information
73 Display this help and exit
75 Display version information and exit
83 @settitle QEMU Disk Network Block Device Server
86 Copyright (C) 2006 Anthony Liguori <anthony@codemonkey.ws>.
87 This is free software; see the source for copying conditions. There is NO
88 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.