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: Stefan Priebe - Profihost AG
Subject: Re: [Qemu-devel] scsi-hd with discard_granularity and unmap results in Aborted Commands
Date: Mon, 19 Nov 2012 15:48:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2

Am 19.11.2012 15:41, schrieb Paolo Bonzini:
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.

The iscsi driver still relies on canceled that's why i left it here in too.

So you mean in qemu_rbd_complete_aio i should remove the check for cancelled and then just overwrite acb->status to that it changes from -EINPROGRESS to something else?

And qemu_rbd_aio_cancel should just wait for status != -EINPROGRESS?

Stefan



reply via email to

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