[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] xen_disk: add discard support
From: |
Olaf Hering |
Subject: |
Re: [Qemu-devel] [PATCH] xen_disk: add discard support |
Date: |
Tue, 4 Feb 2014 16:47:37 +0100 |
User-agent: |
Mutt/1.5.22.rev6346 (2013-10-29) |
On Mon, Feb 03, Kevin Wolf wrote:
> Am 30.01.2014 um 16:02 hat Olaf Hering geschrieben:
> > +++ b/hw/block/xen_disk.c
> > + case BLKIF_OP_DISCARD:
> > + {
> > + struct blkif_request_discard *discard_req = (void *)&ioreq->req;
> > + bdrv_acct_start(blkdev->bs, &ioreq->acct,
> > + discard_req->nr_sectors * BLOCK_SIZE,
> > BDRV_ACCT_WRITE);
>
> Neither SCSI nor IDE account for discards. I think we should keep the
> behaviour consistent across devices.
Stefano,did you already put this change into your queue?
I will resubmit the patch with the change below.
Olaf
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index e74efc7..69ecc98 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -527,8 +527,6 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
case BLKIF_OP_DISCARD:
{
struct blkif_request_discard *discard_req = (void *)&ioreq->req;
- bdrv_acct_start(blkdev->bs, &ioreq->acct,
- discard_req->nr_sectors * BLOCK_SIZE, BDRV_ACCT_WRITE);
ioreq->aio_inflight++;
bdrv_aio_discard(blkdev->bs,
discard_req->sector_number, discard_req->nr_sectors,