From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvceA-00056Q-HY for qemu-devel@nongnu.org; Sun, 08 Nov 2015 21:57:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zvce7-0005ml-Bp for qemu-devel@nongnu.org; Sun, 08 Nov 2015 21:57:30 -0500 From: Fam Zheng Date: Mon, 9 Nov 2015 10:56:44 +0800 Message-Id: <1447037808-31886-6-git-send-email-famz@redhat.com> In-Reply-To: <1447037808-31886-1-git-send-email-famz@redhat.com> References: <1447037808-31886-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v3 5/9] block: Add ioctl parameter fields to BlockRequest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , qemu-block@nongnu.org, Peter Lieven , Ronnie Sahlberg , Paolo Bonzini The two fields that will be used by ioctl handling code later are added as union, because it's used exclusively by ioctl code which dosn't need the four fields in the other struct of the union. Signed-off-by: Fam Zheng Reviewed-by: Kevin Wolf --- include/block/block.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/block/block.h b/include/block/block.h index 610db92..c8b40b7 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -335,10 +335,18 @@ void bdrv_aio_cancel_async(BlockAIOCB *acb); typedef struct BlockRequest { /* Fields to be filled by multiwrite caller */ - int64_t sector; - int nb_sectors; - int flags; - QEMUIOVector *qiov; + union { + struct { + int64_t sector; + int nb_sectors; + int flags; + QEMUIOVector *qiov; + }; + struct { + int req; + void *buf; + }; + }; BlockCompletionFunc *cb; void *opaque; -- 2.4.3