qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 1/9] block: Add bdrv_aio_cancel_async


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [RFC PATCH 1/9] block: Add bdrv_aio_cancel_async
Date: Thu, 21 Aug 2014 14:44:58 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, Aug 21, 2014 at 07:56:48PM +0800, Fam Zheng wrote:
> +/* Async version of aio cancel. The caller is not blocked if the acb 
> implements
> + * cancel_async, otherwise fall back to bdrv_aio_cancel. In both cases, 
> acb->cb
> + * is guarenteed to be called, before or after function returns. */
> +void bdrv_aio_cancel_async(BlockDriverAIOCB *acb)
> +{
> +    if (acb->aiocb_info->cancel_async) {
> +        acb->aiocb_info->cancel_async(acb);
> +    } else {
> +        BlockDriverAIOCB *save = g_new(BlockDriverAIOCB, 1);

Please don't create a dummy BlockDriverAIOCB.  It makes the code
confusing because all other BlockDriverAIOCBs in QEMU are allocated with
qemu_aio_get() and behave in a certain way.

This is not really a BlockDriverAIOCB, it's just a struct to stash the
old cb/opaque in.

Attachment: pgpPgKP6G0Bjh.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]