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>
This commit is contained in:
commit
d94a658712
@ -163,10 +163,6 @@ dummy := $(call unnest-vars,.., \
|
|||||||
all-obj-y += $(common-obj-y)
|
all-obj-y += $(common-obj-y)
|
||||||
all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y)
|
all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y)
|
||||||
|
|
||||||
ifndef CONFIG_HAIKU
|
|
||||||
LIBS+=-lm
|
|
||||||
endif
|
|
||||||
|
|
||||||
# build either PROG or PROGW
|
# build either PROG or PROGW
|
||||||
$(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
|
$(QEMU_PROG_BUILD): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
|
||||||
$(call LINK,$^)
|
$(call LINK,$^)
|
||||||
|
2
configure
vendored
2
configure
vendored
@ -3453,7 +3453,7 @@ fi
|
|||||||
# Do we need libm
|
# Do we need libm
|
||||||
cat > $TMPC << EOF
|
cat > $TMPC << EOF
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
int main(void) { return isnan(sin(0.0)); }
|
int main(int argc, char **argv) { return isnan(sin((double)argc)); }
|
||||||
EOF
|
EOF
|
||||||
if compile_prog "" "" ; then
|
if compile_prog "" "" ; then
|
||||||
:
|
:
|
||||||
|
@ -565,7 +565,6 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev,
|
|||||||
VirtIOSCSIReq *req;
|
VirtIOSCSIReq *req;
|
||||||
VirtIOSCSIEvent *evt;
|
VirtIOSCSIEvent *evt;
|
||||||
VirtIODevice *vdev = VIRTIO_DEVICE(s);
|
VirtIODevice *vdev = VIRTIO_DEVICE(s);
|
||||||
int in_size;
|
|
||||||
|
|
||||||
if (!(vdev->status & VIRTIO_CONFIG_S_DRIVER_OK)) {
|
if (!(vdev->status & VIRTIO_CONFIG_S_DRIVER_OK)) {
|
||||||
return;
|
return;
|
||||||
@ -577,24 +576,19 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req->elem.out_num) {
|
|
||||||
virtio_scsi_bad_req();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (s->events_dropped) {
|
if (s->events_dropped) {
|
||||||
event |= VIRTIO_SCSI_T_EVENTS_MISSED;
|
event |= VIRTIO_SCSI_T_EVENTS_MISSED;
|
||||||
s->events_dropped = false;
|
s->events_dropped = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
in_size = iov_size(req->elem.in_sg, req->elem.in_num);
|
if (virtio_scsi_parse_req(req, 0, sizeof(VirtIOSCSIEvent))) {
|
||||||
if (in_size < sizeof(VirtIOSCSIEvent)) {
|
|
||||||
virtio_scsi_bad_req();
|
virtio_scsi_bad_req();
|
||||||
}
|
}
|
||||||
|
|
||||||
evt = &req->resp.event;
|
evt = &req->resp.event;
|
||||||
memset(evt, 0, sizeof(VirtIOSCSIEvent));
|
memset(evt, 0, sizeof(VirtIOSCSIEvent));
|
||||||
evt->event = event;
|
evt->event = virtio_tswap32(vdev, event);
|
||||||
evt->reason = reason;
|
evt->reason = virtio_tswap32(vdev, reason);
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
assert(event == VIRTIO_SCSI_T_EVENTS_MISSED);
|
assert(event == VIRTIO_SCSI_T_EVENTS_MISSED);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user