From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1gTk-0003AA-JB for qemu-devel@nongnu.org; Thu, 08 Sep 2011 11:25:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1gTf-0000q4-Mu for qemu-devel@nongnu.org; Thu, 08 Sep 2011 11:25:24 -0400 Received: from mail-vx0-f173.google.com ([209.85.220.173]:34597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1gTf-0000pt-Ka for qemu-devel@nongnu.org; Thu, 08 Sep 2011 11:25:19 -0400 Received: by vxi32 with SMTP id 32so830358vxi.4 for ; Thu, 08 Sep 2011 08:25:19 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Thu, 8 Sep 2011 17:24:55 +0200 Message-Id: <1315495505-28906-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1315495505-28906-1-git-send-email-pbonzini@redhat.com> References: <1315495505-28906-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 02/12] nbd: sync API definitions with upstream List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Paolo Bonzini --- nbd.c | 2 ++ nbd.h | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletions(-) diff --git a/nbd.c b/nbd.c index 07a8e53..9ed2239 100644 --- a/nbd.c +++ b/nbd.c @@ -66,6 +66,8 @@ #define NBD_PRINT_DEBUG _IO(0xab, 6) #define NBD_SET_SIZE_BLOCKS _IO(0xab, 7) #define NBD_DISCONNECT _IO(0xab, 8) +#define NBD_SET_TIMEOUT _IO(0xab, 9) +#define NBD_SET_FLAGS _IO(0xab, 10) #define NBD_OPT_EXPORT_NAME (1 << 0) diff --git a/nbd.h b/nbd.h index 938a021..41eb3c8 100644 --- a/nbd.h +++ b/nbd.h @@ -41,11 +41,20 @@ struct nbd_reply { #define NBD_FLAG_HAS_FLAGS (1 << 0) /* Flags are there */ #define NBD_FLAG_READ_ONLY (1 << 1) /* Device is read-only */ +#define NBD_FLAG_SEND_FLUSH (1 << 2) /* Send FLUSH */ +#define NBD_FLAG_SEND_FUA (1 << 3) /* Send FUA (Force Unit Access) */ +#define NBD_FLAG_ROTATIONAL (1 << 4) /* Use elevator algorithm - rotational media */ +#define NBD_FLAG_SEND_TRIM (1 << 5) /* Send TRIM (discard) */ + +#define NBD_CMD_MASK_COMMAND 0x0000ffff +#define NBD_CMD_FLAG_FUA (1 << 16) enum { NBD_CMD_READ = 0, NBD_CMD_WRITE = 1, - NBD_CMD_DISC = 2 + NBD_CMD_DISC = 2, + NBD_CMD_FLUSH = 3, + NBD_CMD_TRIM = 4 }; #define NBD_DEFAULT_PORT 10809 -- 1.7.6