From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmpSq-00013W-3Z for qemu-devel@nongnu.org; Mon, 16 Jan 2012 11:31:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RmpSi-0001Ur-6N for qemu-devel@nongnu.org; Mon, 16 Jan 2012 11:31:19 -0500 Received: from mail-vx0-f173.google.com ([209.85.220.173]:52073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmpSi-0001TY-46 for qemu-devel@nongnu.org; Mon, 16 Jan 2012 11:31:12 -0500 Received: by mail-vx0-f173.google.com with SMTP id fk14so763460vcb.4 for ; Mon, 16 Jan 2012 08:31:12 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 16 Jan 2012 17:30:45 +0100 Message-Id: <1326731457-9056-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1326731457-9056-1-git-send-email-pbonzini@redhat.com> References: <1326731457-9056-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 03/15] dma-helpers: add accounting wrappers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The length of the transfer is already in the sglist, and may be opaque to the device if it is not in hw/. So add a wrapper that fetches it. Signed-off-by: Paolo Bonzini --- dma-helpers.c | 6 ++++++ dma.h | 3 +++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/dma-helpers.c b/dma-helpers.c index f53a51f..a773489 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -234,3 +234,9 @@ uint64_t dma_buf_write(uint8_t *ptr, int32_t len, QEMUSGList *sg) { return dma_buf_rw(ptr, len, sg, 1); } + +void dma_acct_start(BlockDriverState *bs, BlockAcctCookie *cookie, + QEMUSGList *sg, enum BlockAcctType type) +{ + bdrv_acct_start(bs, cookie, sg->size, type); +} diff --git a/dma.h b/dma.h index 346ac4f..20e86d2 100644 --- a/dma.h +++ b/dma.h @@ -61,4 +61,7 @@ BlockDriverAIOCB *dma_bdrv_write(BlockDriverState *bs, uint64_t dma_buf_read(uint8_t *ptr, int32_t len, QEMUSGList *sg); uint64_t dma_buf_write(uint8_t *ptr, int32_t len, QEMUSGList *sg); +void dma_acct_start(BlockDriverState *bs, BlockAcctCookie *cookie, + QEMUSGList *sg, enum BlockAcctType type); + #endif -- 1.7.7.1