All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Avi Kivity <avi@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 3/4] Introduce block dma helpers
Date: Wed, 04 Feb 2009 13:29:28 -0600	[thread overview]
Message-ID: <4989EC98.1010606@us.ibm.com> (raw)
In-Reply-To: <1233750314-23301-4-git-send-email-avi@redhat.com>

Avi Kivity wrote:
> These helpers perform read/write requests on entire scatter/gather lists,
> relieving the device emulation code from mapping and unmapping physical
> memory, and from looping when map resources are exhausted.
>
> Signed-off-by: Avi Kivity <avi@redhat.com>
>   
<snip>
> +BlockDriverAIOCB *dma_bdrv_read(BlockDriverState *bs,
> +                                QEMUSGList *sg, uint64_t sector,
> +                                void (*cb)(void *opaque, int ret), void *opaque)
> +{
> +    return dma_bdrv_io(bs, sg, sector, cb, opaque, 0);
> +}
> +
> +BlockDriverAIOCB *dma_bdrv_write(BlockDriverState *bs,
> +                                 QEMUSGList *sg, uint64_t sector,
> +                                 void (*cb)(void *opaque, int ret), void *opaque)
> +{
> +    return dma_bdrv_io(bs, sg, sector, cb, opaque, 1);
> +}
>   

This came out really nicely.

Regards,

Anthony Liguori

> diff --git a/dma.h b/dma.h
> index 3b56fa6..5ce54fb 100644
> --- a/dma.h
> +++ b/dma.h
> @@ -3,6 +3,7 @@
>  
>  #include <stdio.h>
>  #include "cpu.h"
> +#include "block.h"
>  
>  typedef struct {
>      target_phys_addr_t base;
> @@ -21,4 +22,11 @@ void qemu_sglist_add(QEMUSGList *qsg, target_phys_addr_t base,
>                       target_phys_addr_t len);
>  void qemu_sglist_destroy(QEMUSGList *qsg);
>  
> +BlockDriverAIOCB *dma_bdrv_read(BlockDriverState *bs,
> +                                QEMUSGList *sg, uint64_t sector,
> +                                BlockDriverCompletionFunc *cb, void *opaque);
> +BlockDriverAIOCB *dma_bdrv_write(BlockDriverState *bs,
> +                                 QEMUSGList *sg, uint64_t sector,
> +                                 BlockDriverCompletionFunc *cb, void *opaque);
> +
>  #endif
>   

  reply	other threads:[~2009-02-04 19:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-04 12:25 [Qemu-devel] [PATCH 0/4] Block DMA helpers Avi Kivity
2009-02-04 12:25 ` [Qemu-devel] [PATCH 1/4] Add a scatter-gather list type and accessors Avi Kivity
2009-02-04 19:27   ` [Qemu-devel] " Anthony Liguori
2009-02-04 20:30     ` Avi Kivity
2009-02-04 20:36       ` Anthony Liguori
2009-02-04 20:46         ` Avi Kivity
2009-02-04 20:50           ` Anthony Liguori
2009-02-04 21:03             ` Avi Kivity
2009-02-04 23:58           ` Paul Brook
2009-02-05  7:25             ` Avi Kivity
2009-02-05  0:29         ` M. Warner Losh
2009-02-05  1:56           ` Anthony Liguori
2009-02-04 23:49     ` Paul Brook
2009-02-04 12:25 ` [Qemu-devel] [PATCH 2/4] Add qemu_iovec_reset() Avi Kivity
2009-02-04 12:25 ` [Qemu-devel] [PATCH 3/4] Introduce block dma helpers Avi Kivity
2009-02-04 19:29   ` Anthony Liguori [this message]
2009-02-04 12:25 ` [Qemu-devel] [PATCH 4/4] Convert IDE to use new " Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4989EC98.1010606@us.ibm.com \
    --to=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.