summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorPaolo Bonzini2012-09-28 17:22:56 +0200
committerKevin Wolf2012-09-28 19:40:56 +0200
commit1ceee0d5cc841fc9ca8e72b81450b598ab307f14 (patch)
tree4aef038b723803cbc7369f415b41b05b5ddf9669 /hw
parentiostatus: move BlockdevOnError declaration to QAPI (diff)
downloadqemu-1ceee0d5cc841fc9ca8e72b81450b598ab307f14.tar.gz
qemu-1ceee0d5cc841fc9ca8e72b81450b598ab307f14.tar.xz
qemu-1ceee0d5cc841fc9ca8e72b81450b598ab307f14.zip
iostatus: change is_read to a bool
Do this while we are touching this part of the code, before introducing more uses of "int is_read". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/ide/core.c2
-rw-r--r--hw/ide/pci.c4
-rw-r--r--hw/scsi-disk.c2
-rw-r--r--hw/virtio-blk.c4
4 files changed, 6 insertions, 6 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 2620e87ae4..c03db4a3a2 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -556,7 +556,7 @@ void ide_dma_error(IDEState *s)
static int ide_handle_rw_error(IDEState *s, int error, int op)
{
- int is_read = (op & BM_STATUS_RETRY_READ);
+ bool is_read = (op & BM_STATUS_RETRY_READ) != 0;
BlockdevOnError action = bdrv_get_on_error(s->bs, is_read);
if (action == BLOCKDEV_ON_ERROR_IGNORE) {
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index 88c0942e34..644533f777 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -188,7 +188,7 @@ static void bmdma_restart_bh(void *opaque)
{
BMDMAState *bm = opaque;
IDEBus *bus = bm->bus;
- int is_read;
+ bool is_read;
int error_status;
qemu_bh_delete(bm->bh);
@@ -198,7 +198,7 @@ static void bmdma_restart_bh(void *opaque)
return;
}
- is_read = !!(bus->error_status & BM_STATUS_RETRY_READ);
+ is_read = (bus->error_status & BM_STATUS_RETRY_READ) != 0;
/* The error status must be cleared before resubmitting the request: The
* request may fail again, and this case can only be distinguished if the
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index c295326e99..2dd99a90a9 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -386,7 +386,7 @@ static void scsi_read_data(SCSIRequest *req)
*/
static int scsi_handle_rw_error(SCSIDiskReq *r, int error)
{
- int is_read = (r->req.cmd.xfer == SCSI_XFER_FROM_DEV);
+ bool is_read = (r->req.cmd.xfer == SCSI_XFER_FROM_DEV);
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
BlockdevOnError action = bdrv_get_on_error(s->qdev.conf.bs, is_read);
diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c
index f178fa86c7..1ac2483b53 100644
--- a/hw/virtio-blk.c
+++ b/hw/virtio-blk.c
@@ -64,7 +64,7 @@ static void virtio_blk_req_complete(VirtIOBlockReq *req, int status)
}
static int virtio_blk_handle_rw_error(VirtIOBlockReq *req, int error,
- int is_read)
+ bool is_read)
{
BlockdevOnError action = bdrv_get_on_error(req->dev->bs, is_read);
VirtIOBlock *s = req->dev;
@@ -98,7 +98,7 @@ static void virtio_blk_rw_complete(void *opaque, int ret)
trace_virtio_blk_rw_complete(req, ret);
if (ret) {
- int is_read = !(ldl_p(&req->out->type) & VIRTIO_BLK_T_OUT);
+ bool is_read = !(ldl_p(&req->out->type) & VIRTIO_BLK_T_OUT);
if (virtio_blk_handle_rw_error(req, -ret, is_read))
return;
}