mirror of
https://github.com/xemu-project/xemu.git
synced 2025-01-24 12:57:36 +00:00
macio: Account for failed operations
Signed-off-by: Alberto Garcia <berto@igalia.com> Message-id: ee6f4fde6a7c1071ca96d4ddd53e4934ff812fcd.1446044838.git.berto@igalia.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
ecca3b397d
commit
b88b3c8b83
@ -286,7 +286,11 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
|
||||
return;
|
||||
|
||||
done:
|
||||
block_acct_done(blk_get_stats(s->blk), &s->acct);
|
||||
if (ret < 0) {
|
||||
block_acct_failed(blk_get_stats(s->blk), &s->acct);
|
||||
} else {
|
||||
block_acct_done(blk_get_stats(s->blk), &s->acct);
|
||||
}
|
||||
io->dma_end(opaque);
|
||||
|
||||
return;
|
||||
@ -348,7 +352,11 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
|
||||
|
||||
done:
|
||||
if (s->dma_cmd == IDE_DMA_READ || s->dma_cmd == IDE_DMA_WRITE) {
|
||||
block_acct_done(blk_get_stats(s->blk), &s->acct);
|
||||
if (ret < 0) {
|
||||
block_acct_failed(blk_get_stats(s->blk), &s->acct);
|
||||
} else {
|
||||
block_acct_done(blk_get_stats(s->blk), &s->acct);
|
||||
}
|
||||
}
|
||||
io->dma_end(opaque);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user