qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] scsi-hd with discard_granularity and unmap results in A


From: Paolo Bonzini
Subject: Re: [Qemu-devel] scsi-hd with discard_granularity and unmap results in Aborted Commands
Date: Mon, 19 Nov 2012 15:41:11 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1

Il 19/11/2012 15:28, Stefan Priebe - Profihost AG ha scritto:
>  typedef struct RADOSCB {
> @@ -376,6 +377,10 @@ static void qemu_rbd_complete_aio(RADOSCB *rcb)
>      RBDAIOCB *acb = rcb->acb;
>      int64_t r;
>  
> +    if (acb->bh) {
> +        return;
> +    }
> +
>      r = rcb->ret;
>  
>      if (acb->cmd == RBD_AIO_WRITE ||
> @@ -560,6 +565,20 @@ static void qemu_rbd_close(BlockDriverState *bs)
>      rados_shutdown(s->cluster);
>  }
>  
> +static void qemu_rbd_aio_abort(void *private_data)
> +{
> +    RBDAIOCB *acb = (RBDAIOCB *) private_data;
> +
> +    acb->status = -ECANCELED;
> +
> +    if (acb->bh) {
> +        return;
> +    }
> +
> +    acb->bh = qemu_bh_new(rbd_aio_bh_cb, acb);
> +    qemu_bh_schedule(acb->bh);
> +}

I think this is all unneeded.  Just store rcb->ret into
rcb->acb->status, and your version of qemu_rbd_aio_cancel should just work.

Also, I think the acb->cancelled field is not necessary anymore after
these changes.

Paolo



reply via email to

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