Tidied constants up a bit

This commit is contained in:
Patrick J Cherry
2018-02-02 20:34:49 +00:00
parent 72c8c6f757
commit 6aa5907f5e

View File

@@ -7,28 +7,34 @@
#define INIT_MAGIC 0x0000420281861253
#define REQUEST_MAGIC 0x25609513
#define REPLY_MAGIC 0x67446698
#define REQUEST_READ 0
#define REQUEST_READ 0
#define REQUEST_WRITE 1
#define REQUEST_DISCONNECT 2
#define REQUEST_FLUSH 3
#define REQUEST_TRIM 4
#define REQUEST_WRITE_ZEROES 6
/* values for flags field */
/* values for transmission flag field */
#define FLAG_HAS_FLAGS (1 << 0) /* Flags are there */
#define FLAG_SEND_FLUSH (1 << 2) /* Send FLUSH */
#define FLAG_SEND_FUA (1 << 3) /* Send FUA (Force Unit Access) */
/* values for command flag field */
#define CMD_FLAG_FUA (1 << 0)
#if 0
/* Not yet implemented by flexnbd */
#define REQUEST_TRIM 4
#define REQUEST_WRITE_ZEROES 6
#define FLAG_READ_ONLY (1 << 1) /* Device is read-only */
#define FLAG_ROTATIONAL (1 << 4) /* Use elevator algorithm - rotational media */
#define FLAG_SEND_TRIM (1 << 5) /* Send TRIM (discard) */
#define FLAG_SEND_WRITE_ZEROES (1 << 6) /* Send NBD_CMD_WRITE_ZEROES */
#define FLAG_CAN_MULTI_CONN (1 << 8) /* multiple connections are okay */
#define CMD_FLAG_FUA (1 << 0)
#define CMD_FLAG_NO_HOLE (1 << 1)
#endif
/* 32 MiB is the maximum qemu will send you:
* https://github.com/qemu/qemu/blob/v2.11.0/include/block/nbd.h#L183