summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-07-01 10:28:52 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-07-01 10:28:52 +0100
commitd94a658712591ba716f84d4295adaf463c2e4a84 (patch)
tree809afb539e2086492e7b7cf7023eea8d7f34230f /hw
parent53a259da5697ec8a82463161e2e32ff942a08bc2 (diff)
parentf80ea9862fed7ca89a672785bdce0e2611f9ba97 (diff)
downloadqemu-d94a658712591ba716f84d4295adaf463c2e4a84.tar.gz
Merge remote-tracking branch 'remotes/bonzini/scsi-next' into staging
* remotes/bonzini/scsi-next: configure: Fix -lm test, so that tools can be compiled on hosts that require -lm virtio-scsi: scsi events must be converted to target endianness virtio-scsi: virtio_scsi_push_event() lacks VirtIOSCSIReq parsing Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/scsi/virtio-scsi.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 04ecfa7e9a..0eb069ae9b 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -565,7 +565,6 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev,
VirtIOSCSIReq *req;
VirtIOSCSIEvent *evt;
VirtIODevice *vdev = VIRTIO_DEVICE(s);
- int in_size;
if (!(vdev->status & VIRTIO_CONFIG_S_DRIVER_OK)) {
return;
@@ -577,24 +576,19 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev,
return;
}
- if (req->elem.out_num) {
- virtio_scsi_bad_req();
- }
-
if (s->events_dropped) {
event |= VIRTIO_SCSI_T_EVENTS_MISSED;
s->events_dropped = false;
}
- in_size = iov_size(req->elem.in_sg, req->elem.in_num);
- if (in_size < sizeof(VirtIOSCSIEvent)) {
+ if (virtio_scsi_parse_req(req, 0, sizeof(VirtIOSCSIEvent))) {
virtio_scsi_bad_req();
}
evt = &req->resp.event;
memset(evt, 0, sizeof(VirtIOSCSIEvent));
- evt->event = event;
- evt->reason = reason;
+ evt->event = virtio_tswap32(vdev, event);
+ evt->reason = virtio_tswap32(vdev, reason);
if (!dev) {
assert(event == VIRTIO_SCSI_T_EVENTS_MISSED);
} else {