[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v4 18/21] ide: Account for failed and invalid operat
From: |
Alberto Garcia |
Subject: |
[Qemu-block] [PATCH v4 18/21] ide: Account for failed and invalid operations |
Date: |
Wed, 28 Oct 2015 17:33:15 +0200 |
Signed-off-by: Alberto Garcia <address@hidden>
---
hw/ide/core.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index b559f1b..dd7e9c5 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -574,7 +574,6 @@ static void ide_sector_read_cb(void *opaque, int ret)
if (ret == -ECANCELED) {
return;
}
- block_acct_done(blk_get_stats(s->blk), &s->acct);
if (ret != 0) {
if (ide_handle_rw_error(s, -ret, IDE_RETRY_PIO |
IDE_RETRY_READ)) {
@@ -582,6 +581,8 @@ static void ide_sector_read_cb(void *opaque, int ret)
}
}
+ block_acct_done(blk_get_stats(s->blk), &s->acct);
+
n = s->nsector;
if (n > s->req_nb_sectors) {
n = s->req_nb_sectors;
@@ -621,6 +622,7 @@ static void ide_sector_read(IDEState *s)
if (!ide_sect_range_ok(s, sector_num, n)) {
ide_rw_error(s);
+ block_acct_invalid(blk_get_stats(s->blk), BLOCK_ACCT_READ);
return;
}
@@ -672,6 +674,7 @@ static int ide_handle_rw_error(IDEState *s, int error, int
op)
assert(s->bus->retry_unit == s->unit);
s->bus->error_status = op;
} else if (action == BLOCK_ERROR_ACTION_REPORT) {
+ block_acct_failed(blk_get_stats(s->blk), &s->acct);
if (op & IDE_RETRY_DMA) {
ide_dma_error(s);
} else {
@@ -750,6 +753,7 @@ static void ide_dma_cb(void *opaque, int ret)
if ((s->dma_cmd == IDE_DMA_READ || s->dma_cmd == IDE_DMA_WRITE) &&
!ide_sect_range_ok(s, sector_num, n)) {
ide_dma_error(s);
+ block_acct_invalid(blk_get_stats(s->blk), s->acct.type);
return;
}
@@ -826,7 +830,6 @@ static void ide_sector_write_cb(void *opaque, int ret)
if (ret == -ECANCELED) {
return;
}
- block_acct_done(blk_get_stats(s->blk), &s->acct);
s->pio_aiocb = NULL;
s->status &= ~BUSY_STAT;
@@ -837,6 +840,8 @@ static void ide_sector_write_cb(void *opaque, int ret)
}
}
+ block_acct_done(blk_get_stats(s->blk), &s->acct);
+
n = s->nsector;
if (n > s->req_nb_sectors) {
n = s->req_nb_sectors;
@@ -887,6 +892,7 @@ static void ide_sector_write(IDEState *s)
if (!ide_sect_range_ok(s, sector_num, n)) {
ide_rw_error(s);
+ block_acct_invalid(blk_get_stats(s->blk), BLOCK_ACCT_WRITE);
return;
}
--
2.6.1
- [Qemu-block] [PATCH v4 01/21] xen_disk: Account for flush operations, (continued)
- [Qemu-block] [PATCH v4 01/21] xen_disk: Account for flush operations, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 06/21] block: Add statistics for failed and invalid I/O operations, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 09/21] block: Add average I/O queue depth to BlockDeviceTimedStats, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 04/21] util: Infrastructure for computing recent averages, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 03/21] block: define 'clock_type' for the accounting code, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 16/21] xen_disk: Account for failed and invalid operations, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 11/21] qemu-io: Account for failed, invalid and flush operations, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 07/21] block: Allow configuring whether to account failed and invalid ops, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 08/21] block: Compute minimum, maximum and average I/O latencies, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 21/21] block: Update copyright of the accounting code, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 18/21] ide: Account for failed and invalid operations,
Alberto Garcia <=
- [Qemu-block] [PATCH v4 19/21] macio: Account for failed operations, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 13/21] iotests: Add test for the block device statistics, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 15/21] virtio-blk: Account for failed and invalid operations, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 20/21] scsi-disk: Account for failed operations, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 17/21] atapi: Account for failed and invalid operations, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 12/21] block: Use QEMU_CLOCK_VIRTUAL for the accounting code in qtest mode, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 10/21] block: New option to define the intervals for collecting I/O statistics, Alberto Garcia, 2015/10/28
- [Qemu-block] [PATCH v4 14/21] nvme: Account for failed and invalid operations, Alberto Garcia, 2015/10/28