[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH for-2.5 1/2] atapi: Account for failed and inval
From: |
John Snow |
Subject: |
Re: [Qemu-block] [PATCH for-2.5 1/2] atapi: Account for failed and invalid operations in cd_read_sector() |
Date: |
Tue, 24 Nov 2015 11:42:23 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 11/24/2015 07:17 AM, Alberto Garcia wrote:
> Commit 5f81724d made PIO read requests async but didn't add the
> relevant block_acct_failed() and block_acct_invalid() calls.
>
> Signed-off-by: Alberto Garcia <address@hidden>
> ---
> hw/ide/atapi.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
> index 7b9f74c..5e3791c 100644
> --- a/hw/ide/atapi.c
> +++ b/hw/ide/atapi.c
> @@ -148,17 +148,18 @@ static void cd_read_sector_cb(void *opaque, int ret)
> {
> IDEState *s = opaque;
>
> - block_acct_done(blk_get_stats(s->blk), &s->acct);
> -
> #ifdef DEBUG_IDE_ATAPI
> printf("cd_read_sector_cb: lba=%d ret=%d\n", s->lba, ret);
> #endif
>
> if (ret < 0) {
> + block_acct_failed(blk_get_stats(s->blk), &s->acct);
> ide_atapi_io_error(s, ret);
> return;
> }
>
> + block_acct_done(blk_get_stats(s->blk), &s->acct);
> +
> if (s->cd_sector_size == 2352) {
> cd_data_to_raw(s->io_buffer, s->lba);
> }
> @@ -173,6 +174,7 @@ static void cd_read_sector_cb(void *opaque, int ret)
> static int cd_read_sector(IDEState *s)
> {
> if (s->cd_sector_size != 2048 && s->cd_sector_size != 2352) {
> + block_acct_invalid(blk_get_stats(s->blk), BLOCK_ACCT_READ);
> return -EINVAL;
> }
>
>
Gah, sorry. I should have caught this during the merge. Thank you for
catching it.
Reviewed-by: John Snow <address@hidden>
I'll send the PR.
--js