aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-06-30 16:13:32 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-06-30 16:13:32 +0100
commit8954000b9ef88db809d23ce58a3221eacdf3b773 (patch)
tree63fe2d91cec70d8d4baca8279915a206a0577a36 /include
parentec9fe956d5c728da770db5ec9bc429080ccb5043 (diff)
parent32d7d2e068756874518f97d5a114e43d8977980b (diff)
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)