virtio-scsi: virtio_scsi_push_event() lacks VirtIOSCSIReq parsing
Hotplug of a virtio scsi disk is currently broken: no disk appears in the
guest (verified with a fedora 20 host running a fedora 20 guest with KVM).
Bisect leeds to Paolo's patches to support any_layout, especially this
commit:
commit 36b15c79aa
Author: Paolo Bonzini <pbonzini@redhat.com>
Date: Tue Jun 10 16:21:18 2014 +0200
virtio-scsi: start preparing for any_layout
It modifies virtio_scsi_pop_req() so that it is up to the callers to parse
the virtio scsi request. It seems that virtio_scsi_push_event() was not
modified accordingly...
This patch adds a call to virtio_scsi_parse_req(). It also drops some
sanity checks that are already performed by virtio_scsi_parse_req().
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
ec9fe956d5
commit
dfecbb95e3
|
@ -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,17 +576,12 @@ 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue