]> git.proxmox.com Git - mirror_qemu.git/commitdiff
dma-helpers: add accounting wrappers
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 5 Sep 2011 12:20:29 +0000 (14:20 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Feb 2012 12:29:07 +0000 (13:29 +0100)
The length of the transfer is already in the sglist, the wrapper simply
fetches it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
dma-helpers.c
dma.h

index df0a42172f15ae6b7fa353f266df8661dd5343ba..c29ea6d3abdf8d4344f53fa5fcb9fdfacf224fb8 100644 (file)
@@ -235,3 +235,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 346ac4f706b659e0f7f605f0086435bed1988503..20e86d28eefb3e032ab8f27eda939573f41745ce 100644 (file)
--- 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