[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 16/21] xen_disk: Account for failed and invalid o
From: |
Alberto Garcia |
Subject: |
[Qemu-devel] [PATCH v4 16/21] xen_disk: Account for failed and invalid operations |
Date: |
Wed, 28 Oct 2015 17:33:13 +0200 |
Signed-off-by: Alberto Garcia <address@hidden>
---
hw/block/xen_disk.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 4869518..02eda6e 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -537,7 +537,11 @@ static void qemu_aio_complete(void *opaque, int ret)
break;
}
case BLKIF_OP_READ:
- block_acct_done(blk_get_stats(ioreq->blkdev->blk), &ioreq->acct);
+ if (ioreq->status == BLKIF_RSP_OKAY) {
+ block_acct_done(blk_get_stats(ioreq->blkdev->blk), &ioreq->acct);
+ } else {
+ block_acct_failed(blk_get_stats(ioreq->blkdev->blk), &ioreq->acct);
+ }
break;
case BLKIF_OP_DISCARD:
default:
@@ -722,6 +726,23 @@ static void blk_handle_requests(struct XenBlkDev *blkdev)
/* parse them */
if (ioreq_parse(ioreq) != 0) {
+
+ switch (ioreq->req.operation) {
+ case BLKIF_OP_READ:
+ block_acct_invalid(blk_get_stats(blkdev->blk),
+ BLOCK_ACCT_READ);
+ break;
+ case BLKIF_OP_WRITE:
+ block_acct_invalid(blk_get_stats(blkdev->blk),
+ BLOCK_ACCT_WRITE);
+ break;
+ case BLKIF_OP_FLUSH_DISKCACHE:
+ block_acct_invalid(blk_get_stats(blkdev->blk),
+ BLOCK_ACCT_FLUSH);
+ default:
+ break;
+ };
+
if (blk_send_response_one(ioreq)) {
xen_be_send_notify(&blkdev->xendev);
}
--
2.6.1
- [Qemu-devel] [PATCH v4 00/21] Extended I/O accounting, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 02/21] ide: Account for write operations correctly, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 06/21] block: Add statistics for failed and invalid I/O operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 05/21] block: Add idle_time_ns to BlockDeviceStats, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 04/21] util: Infrastructure for computing recent averages, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 09/21] block: Add average I/O queue depth to BlockDeviceTimedStats, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 01/21] xen_disk: Account for flush operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 03/21] block: define 'clock_type' for the accounting code, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 07/21] block: Allow configuring whether to account failed and invalid ops, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 16/21] xen_disk: Account for failed and invalid operations,
Alberto Garcia <=
- [Qemu-devel] [PATCH v4 08/21] block: Compute minimum, maximum and average I/O latencies, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 15/21] virtio-blk: Account for failed and invalid operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 21/21] block: Update copyright of the accounting code, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 11/21] qemu-io: Account for failed, invalid and flush operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 20/21] scsi-disk: Account for failed operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 17/21] atapi: Account for failed and invalid operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 13/21] iotests: Add test for the block device statistics, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 14/21] nvme: Account for failed and invalid operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 18/21] ide: Account for failed and invalid operations, Alberto Garcia, 2015/10/28
- [Qemu-devel] [PATCH v4 19/21] macio: Account for failed operations, Alberto Garcia, 2015/10/28