From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAHy9-0003HW-4f for qemu-devel@nongnu.org; Tue, 07 Jun 2016 10:27:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAHy2-0006cT-0z for qemu-devel@nongnu.org; Tue, 07 Jun 2016 10:27:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAHy1-0006cP-Rq for qemu-devel@nongnu.org; Tue, 07 Jun 2016 10:26:53 -0400 From: Stefan Hajnoczi Date: Tue, 7 Jun 2016 15:26:23 +0100 Message-Id: <1465309585-31551-11-git-send-email-stefanha@redhat.com> In-Reply-To: <1465309585-31551-1-git-send-email-stefanha@redhat.com> References: <1465309585-31551-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 10/12] block: Move BlockRequest type to io.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Eric Blake , Fam Zheng From: Eric Blake I was thrown by the fact that the public type BlockRequest had an anonymous union, but no obvious discriminator. Turns out that the only client of the second branch of the union was code internal to io.c, now that commit 91c6e4b killed public multiwrite, so move it into io.c and improve the comments. Signed-off-by: Eric Blake Message-Id: <1463699150-19445-1-git-send-email-eblake@redhat.com> Signed-off-by: Fam Zheng --- block/io.c | 21 +++++++++++++++++++++ include/block/block.h | 21 --------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/block/io.c b/block/io.c index e12f303..a2fba67 100644 --- a/block/io.c +++ b/block/io.c @@ -1902,6 +1902,27 @@ void bdrv_aio_cancel_async(BlockAIOCB *acb) /**************************************************************/ /* async block device emulation */ +typedef struct BlockRequest { + union { + /* Used during read, write, trim */ + struct { + int64_t sector; + int nb_sectors; + int flags; + QEMUIOVector *qiov; + }; + /* Used during ioctl */ + struct { + int req; + void *buf; + }; + }; + BlockCompletionFunc *cb; + void *opaque; + + int error; +} BlockRequest; + typedef struct BlockAIOCBCoroutine { BlockAIOCB common; BlockRequest req; diff --git a/include/block/block.h b/include/block/block.h index d6bb74d..3fd5043 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -320,27 +320,6 @@ BlockAIOCB *bdrv_aio_discard(BlockDriverState *bs, void bdrv_aio_cancel(BlockAIOCB *acb); void bdrv_aio_cancel_async(BlockAIOCB *acb); -typedef struct BlockRequest { - /* Fields to be filled by caller */ - union { - struct { - int64_t sector; - int nb_sectors; - int flags; - QEMUIOVector *qiov; - }; - struct { - int req; - void *buf; - }; - }; - BlockCompletionFunc *cb; - void *opaque; - - /* Filled by block layer */ - int error; -} BlockRequest; - /* sg packet commands */ int bdrv_ioctl(BlockDriverState *bs, unsigned long int req, void *buf); BlockAIOCB *bdrv_aio_ioctl(BlockDriverState *bs, -- 2.5.5