summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell2014-06-30 17:13:32 +0200
committerPeter Maydell2014-06-30 17:13:32 +0200
commit8954000b9ef88db809d23ce58a3221eacdf3b773 (patch)
tree63fe2d91cec70d8d4baca8279915a206a0577a36 /include
parentMerge remote-tracking branch 'remotes/bonzini/small-fixes' into staging (diff)
parentnbd: Handle NBD_OPT_LIST option. (diff)
downloadqemu-8954000b9ef88db809d23ce58a3221eacdf3b773.tar.gz
qemu-8954000b9ef88db809d23ce58a3221eacdf3b773.tar.xz
qemu-8954000b9ef88db809d23ce58a3221eacdf3b773.zip
Merge remote-tracking branch 'remotes/bonzini/nbd-next' into staging
* remotes/bonzini/nbd-next: nbd: Handle NBD_OPT_LIST option. nbd: Handle fixed new-style clients. nbd: Shutdown socket before closing. nbd: Don't validate from and len in NBD_CMD_DISC. nbd: Don't export a block device with no medium. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/block/nbd.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/block/nbd.h b/include/block/nbd.h
index 79502a090b..9e835d2cbb 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -45,6 +45,18 @@ struct nbd_reply {
#define NBD_FLAG_ROTATIONAL (1 << 4) /* Use elevator algorithm - rotational media */
#define NBD_FLAG_SEND_TRIM (1 << 5) /* Send TRIM (discard) */
+/* New-style global flags. */
+#define NBD_FLAG_FIXED_NEWSTYLE (1 << 0) /* Fixed newstyle protocol. */
+
+/* New-style client flags. */
+#define NBD_FLAG_C_FIXED_NEWSTYLE (1 << 0) /* Fixed newstyle protocol. */
+
+/* Reply types. */
+#define NBD_REP_ACK (1) /* Data sending finished. */
+#define NBD_REP_SERVER (2) /* Export description. */
+#define NBD_REP_ERR_UNSUP ((1 << 31) | 1) /* Unknown option. */
+#define NBD_REP_ERR_INVALID ((1 << 31) | 3) /* Invalid length. */
+
#define NBD_CMD_MASK_COMMAND 0x0000ffff
#define NBD_CMD_FLAG_FUA (1 << 16)