diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-11-26 09:44:25 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-11-26 09:44:25 +0000 |
commit | 7ef7ddf37674f7147ef23c311cbc3c37e908c8b0 (patch) | |
tree | d315663ef19621cccfa09e00a136f6bdd66f48f7 /hw | |
parent | c7933a80bc6f3bb79c341f8fc17b4cf76622e2f3 (diff) | |
parent | 9c73517ca56d6611371376bd298b4b20f3ad6140 (diff) |
Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging
# gpg: Signature made Wed 25 Nov 2015 20:25:21 GMT using RSA key ID AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>"
* remotes/jnsnow/tags/ide-pull-request:
ide-test: fix timeouts
atapi: Fix code indentation
atapi: Account for failed and invalid operations in cd_read_sector()
ide-test: cdrom_pio_impl fixup
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ide/atapi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index 7b9f74c3b5..65f8dd457b 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; } @@ -441,7 +443,7 @@ eot: if (ret < 0) { block_acct_failed(blk_get_stats(s->blk), &s->acct); } else { - block_acct_done(blk_get_stats(s->blk), &s->acct); + block_acct_done(blk_get_stats(s->blk), &s->acct); } ide_set_inactive(s, false); } |