From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1g0g-0006Um-FK for qemu-devel@nongnu.org; Mon, 30 Jun 2014 14:09:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1g0X-00060c-DJ for qemu-devel@nongnu.org; Mon, 30 Jun 2014 14:08:58 -0400 Received: from mail-we0-x22e.google.com ([2a00:1450:400c:c03::22e]:51882) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1g0X-00060R-6F for qemu-devel@nongnu.org; Mon, 30 Jun 2014 14:08:49 -0400 Received: by mail-we0-f174.google.com with SMTP id u57so8377635wes.5 for ; Mon, 30 Jun 2014 11:08:48 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53B1A7AD.2080903@redhat.com> Date: Mon, 30 Jun 2014 20:08:45 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20140630153119.7794.63512.stgit@bahia.local> In-Reply-To: <20140630153119.7794.63512.stgit@bahia.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] virtio-scsi: virtio_scsi_push_event() lacks VirtIOSCSIReq parsing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz , "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org Il 30/06/2014 17:33, Greg Kurz ha scritto: > 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 36b15c79aa1bef5fe7543f9f2629b6413720bbfb > Author: Paolo Bonzini > 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 > --- > > Changes in v2: > - dropped now useless req->elem.out_num sanity check > > hw/scsi/virtio-scsi.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c > index 04ecfa7..3fecdca 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,17 +576,12 @@ 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(); > } > > > > Applying to scsi-next branch, thanks. Paolo