]>
Commit | Line | Data |
---|---|---|
5135fe71 | 1 | QEMU supports the NBD protocol, and has an internal NBD client (see |
3229a835 VSO |
2 | block/nbd.c), an internal NBD server (see blockdev-nbd.c), and an |
3 | external NBD server tool (see qemu-nbd.c). The common code is placed | |
4 | in nbd/*. | |
5 | ||
6 | The NBD protocol is specified here: | |
7 | https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md | |
8 | ||
9 | The following paragraphs describe some specific properties of NBD | |
5135fe71 | 10 | protocol realization in QEMU. |
3229a835 VSO |
11 | |
12 | = Metadata namespaces = | |
13 | ||
5135fe71 | 14 | QEMU supports the "base:allocation" metadata context as defined in the |
3229a835 VSO |
15 | NBD protocol specification, and also defines an additional metadata |
16 | namespace "qemu". | |
17 | ||
3229a835 VSO |
18 | == "qemu" namespace == |
19 | ||
71719cd5 EB |
20 | The "qemu" namespace currently contains two available metadata context |
21 | types. The first is related to exposing the contents of a dirty | |
22 | bitmap alongside the associated disk contents. That metadata context | |
23 | is named with the following form: | |
3229a835 VSO |
24 | |
25 | qemu:dirty-bitmap:<dirty-bitmap-export-name> | |
26 | ||
27 | Each dirty-bitmap metadata context defines only one flag for extents | |
28 | in reply for NBD_CMD_BLOCK_STATUS: | |
29 | ||
71719cd5 EB |
30 | bit 0: NBD_STATE_DIRTY, set when the extent is "dirty" |
31 | ||
32 | The second is related to exposing the source of various extents within | |
33 | the image, with a single metadata context named: | |
34 | ||
35 | qemu:allocation-depth | |
36 | ||
37 | In the allocation depth context, the entire 32-bit value represents a | |
38 | depth of which layer in a thin-provisioned backing chain provided the | |
39 | data (0 for unallocated, 1 for the active layer, 2 for the first | |
40 | backing layer, and so forth). | |
3229a835 VSO |
41 | |
42 | For NBD_OPT_LIST_META_CONTEXT the following queries are supported | |
71719cd5 EB |
43 | in addition to the specific "qemu:allocation-depth" and |
44 | "qemu:dirty-bitmap:<dirty-bitmap-export-name>": | |
3229a835 VSO |
45 | |
46 | * "qemu:" - returns list of all available metadata contexts in the | |
47 | namespace. | |
48 | * "qemu:dirty-bitmap:" - returns list of all available dirty-bitmap | |
49 | metadata contexts. | |
ba2d3b3a EB |
50 | |
51 | = Features by version = | |
52 | ||
53 | The following list documents which qemu version first implemented | |
54 | various features (both as a server exposing the feature, and as a | |
55 | client taking advantage of the feature when present), to make it | |
56 | easier to plan for cross-version interoperability. Note that in | |
57 | several cases, the initial release containing a feature may require | |
58 | additional patches from the corresponding stable branch to fix bugs in | |
59 | the operation of that feature. | |
60 | ||
61 | * 2.6: NBD_OPT_STARTTLS with TLS X.509 Certificates | |
62 | * 2.8: NBD_CMD_WRITE_ZEROES | |
63 | * 2.10: NBD_OPT_GO, NBD_INFO_BLOCK | |
64 | * 2.11: NBD_OPT_STRUCTURED_REPLY | |
65 | * 2.12: NBD_CMD_BLOCK_STATUS for "base:allocation" | |
66 | * 3.0: NBD_OPT_STARTTLS with TLS Pre-Shared Keys (PSK), | |
67 | NBD_CMD_BLOCK_STATUS for "qemu:dirty-bitmap:", NBD_CMD_CACHE | |
76ca4b58 | 68 | * 4.2: NBD_FLAG_CAN_MULTI_CONN for shareable read-only exports, |
0a479545 | 69 | NBD_CMD_FLAG_FAST_ZERO |
71719cd5 | 70 | * 5.2: NBD_CMD_BLOCK_STATUS for "qemu:allocation-depth" |
58a6fdcc | 71 | * 7.1: NBD_FLAG_CAN_MULTI_CONN for shareable writable exports |