aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/ide.c2
-rw-r--r--hw/scsi-disk.c4
-rw-r--r--hw/virtio-console.c6
-rw-r--r--hw/virtio-net.c2
4 files changed, 8 insertions, 6 deletions
diff --git a/hw/ide.c b/hw/ide.c
index f187546b4c..fc70f36967 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -1469,7 +1469,7 @@ static void ide_atapi_cmd_read_dma_cb(void *opaque, int ret)
#ifdef DEBUG_AIO
printf("aio_read_cd: lba=%u n=%d\n", s->lba, n);
#endif
- bm->iov.iov_base = s->io_buffer + data_offset;
+ bm->iov.iov_base = (void *)(s->io_buffer + data_offset);
bm->iov.iov_len = n * 4 * 512;
qemu_iovec_init_external(&bm->qiov, &bm->iov, 1);
bm->aiocb = bdrv_aio_readv(s->bs, (int64_t)s->lba << 2, &bm->qiov,
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 2edd047a8f..8f1afab51a 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -335,7 +335,7 @@ static uint8_t *scsi_get_buf(SCSIDevice *d, uint32_t tag)
BADF("Bad buffer tag 0x%x\n", tag);
return NULL;
}
- return r->iov.iov_base;
+ return (uint8_t *)r->iov.iov_base;
}
/* Execute a scsi command. Returns the length of the data expected by the
@@ -365,7 +365,7 @@ static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag,
/* ??? Tags are not unique for different luns. We only implement a
single lun, so this should not matter. */
r = scsi_new_request(s, tag);
- outbuf = r->iov.iov_base;
+ outbuf = (uint8_t *)r->iov.iov_base;
is_write = 0;
DPRINTF("Command: lun=%d tag=0x%x data=0x%02x", lun, tag, buf[0]);
switch (command >> 5) {
diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index 92455c850f..b263281d8f 100644
--- a/hw/virtio-console.c
+++ b/hw/virtio-console.c
@@ -38,8 +38,10 @@ static void virtio_console_handle_output(VirtIODevice *vdev, VirtQueue *vq)
ssize_t len = 0;
int d;
- for (d=0; d < elem.out_num; d++)
- len += qemu_chr_write(s->chr, elem.out_sg[d].iov_base,elem.out_sg[d].iov_len);
+ for (d = 0; d < elem.out_num; d++) {
+ len += qemu_chr_write(s->chr, (uint8_t *)elem.out_sg[d].iov_base,
+ elem.out_sg[d].iov_len);
+ }
virtqueue_push(vq, &elem, len);
virtio_notify(vdev, vq);
}
diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index ae9b7d92c7..88ec1ac793 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -313,7 +313,7 @@ static int iov_fill(struct iovec *iov, int iovcnt, const void *buf, int count)
static int receive_header(VirtIONet *n, struct iovec *iov, int iovcnt,
const void *buf, size_t size, size_t hdr_len)
{
- struct virtio_net_hdr *hdr = iov[0].iov_base;
+ struct virtio_net_hdr *hdr = (struct virtio_net_hdr *)iov[0].iov_base;
int offset = 0;
hdr->flags = 0;