Received: from eggs.gnu.org ([2001:4830:134:3::10]:37187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqbE4-0007oA-MD for qemu-devel@nongnu.org; Mon, 26 Oct 2015 02:25:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZqbE3-0005DY-PU for qemu-devel@nongnu.org; Mon, 26 Oct 2015 02:25:48 -0400 From: Fam Zheng Date: Mon, 26 Oct 2015 14:24:49 +0800 Message-Id: <1445840693-3177-6-git-send-email-famz@redhat.com> In-Reply-To: <1445840693-3177-1-git-send-email-famz@redhat.com> References: <1445840693-3177-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH 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 --- 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 84f05ad..b3d55aa 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -340,10 +340,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