From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxEzP-0006lr-Q6 for qemu-devel@nongnu.org; Wed, 18 Jun 2014 08:29:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxEzJ-0008Bz-0j for qemu-devel@nongnu.org; Wed, 18 Jun 2014 08:29:19 -0400 Message-ID: <53A1860E.6040304@redhat.com> Date: Wed, 18 Jun 2014 14:29:02 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1403093631-7384-1-git-send-email-ming.lei@canonical.com> In-Reply-To: <1403093631-7384-1-git-send-email-ming.lei@canonical.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio-scsi: fix object check failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ming Lei , Peter Maydell , qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Anthony Liguori , "Michael S. Tsirkin" Il 18/06/2014 14:13, Ming Lei ha scritto: > In case of vhost-scsi, the object type of VirtIODevice isn't > VirtIOSCSI, so use the cast trick to fix the problem like > in virtio_scsi_handle_cmd() > > Cc: qemu-stable@nongnu.org > Cc: Anthony Liguori > Cc: "Michael S. Tsirkin" > Cc: Paolo Bonzini > Signed-off-by: Ming Lei > --- > hw/scsi/virtio-scsi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c > index b0d7517..13700f5 100644 > --- a/hw/scsi/virtio-scsi.c > +++ b/hw/scsi/virtio-scsi.c > @@ -538,7 +538,7 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev, > > static void virtio_scsi_handle_event(VirtIODevice *vdev, VirtQueue *vq) > { > - VirtIOSCSI *s = VIRTIO_SCSI(vdev); > + VirtIOSCSI *s = (VirtIOSCSI *)vdev; > > if (s->events_dropped) { > virtio_scsi_push_event(s, NULL, VIRTIO_SCSI_T_NO_EVENT, 0); > This should never be triggered by vhost-scsi. Perhaps a bug in the kernel? Paolo