[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 18/21] ide: Account for failed and invalid operat
From: |
Alberto Garcia |
Subject: |
[Qemu-devel] [PATCH v3 18/21] ide: Account for failed and invalid operations |
Date: |
Thu, 22 Oct 2015 11:11:28 +0300 |
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-devel] [PATCH v3 05/21] block: Add idle_time_ns to BlockDeviceStats, (continued)
- [Qemu-devel] [PATCH v3 05/21] block: Add idle_time_ns to BlockDeviceStats, Alberto Garcia, 2015/10/22
- [Qemu-devel] [PATCH v3 04/21] util: Infrastructure for computing recent averages, Alberto Garcia, 2015/10/22
- [Qemu-devel] [PATCH v3 09/21] block: Add average I/O queue depth to BlockDeviceTimedStats, Alberto Garcia, 2015/10/22
- [Qemu-devel] [PATCH v3 21/21] block: Update copyright of the accounting code, Alberto Garcia, 2015/10/22
- [Qemu-devel] [PATCH v3 12/21] block: Use QEMU_CLOCK_VIRTUAL for the accounting code in qtest mode, Alberto Garcia, 2015/10/22
- [Qemu-devel] [PATCH v3 15/21] virtio-blk: Account for failed and invalid operations, Alberto Garcia, 2015/10/22
- [Qemu-devel] [PATCH v3 19/21] macio: Account for failed operations, Alberto Garcia, 2015/10/22
- [Qemu-devel] [PATCH v3 14/21] nvme: Account for failed and invalid operations, Alberto Garcia, 2015/10/22
- [Qemu-devel] [PATCH v3 18/21] ide: Account for failed and invalid operations,
Alberto Garcia <=
- [Qemu-devel] [PATCH v3 17/21] atapi: Account for failed and invalid operations, Alberto Garcia, 2015/10/22
- [Qemu-devel] [PATCH v3 11/21] qemu-io: Account for failed, invalid and flush operations, Alberto Garcia, 2015/10/22
- [Qemu-devel] [PATCH v3 20/21] scsi-disk: Account for failed operations, Alberto Garcia, 2015/10/22
- [Qemu-devel] [PATCH v3 13/21] iotests: Add test for the block device statistics, Alberto Garcia, 2015/10/22
- [Qemu-devel] [PATCH v3 16/21] xen_disk: Account for failed and invalid operations, Alberto Garcia, 2015/10/22
- [Qemu-devel] [PATCH v3 10/21] block: New option to define the intervals for collecting I/O statistics, Alberto Garcia, 2015/10/22
- Re: [Qemu-devel] [PATCH v3 00/21] Extended I/O accounting, Stefan Hajnoczi, 2015/10/23