All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Zhang Min <rudy.zhangmin@huawei.com>, qemu-devel@nongnu.org
Cc: peter.huangpeng@huawei.com, boby.chen@huawei.com,
	wu.wubin@huawei.com, subo7@huawei.com, mst@redhat.com
Subject: Re: [Qemu-devel] [Patch] block:qemu will crash when vhost-scsi disk vm reboot
Date: Mon, 01 Sep 2014 11:38:05 +0200	[thread overview]
Message-ID: <54043E7D.4010706@redhat.com> (raw)
In-Reply-To: <1409563995-9792-1-git-send-email-rudy.zhangmin@huawei.com>

Il 01/09/2014 11:33, Zhang Min ha scritto:
> From: subo <subo7@huawei.com>
> 
> When the vm reboot, it will call virtio_scsi_handle_event(),
> for vhost-scsi device,vdev is VIRTIO_SCSI_COMMON, not VIRTIO_SCSI,
> if vdev convert to the VIRTIO_SCSI, it will cause qemu crash.
> 
> Signed-off-by: Zhang Min <rudy.zhangmin@huawei.com>
> Signed-off-by: subo <subo7@huawei.com>
> ---
>  hw/scsi/virtio-scsi.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
> index 86aba88..7d3bc49 100644
> --- a/hw/scsi/virtio-scsi.c
> +++ b/hw/scsi/virtio-scsi.c
> @@ -630,7 +630,11 @@ 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;
> +
> +    s = (VirtIOSCSI *)object_dynamic_cast((Object *)vdev, TYPE_VIRTIO_SCSI);
> +    if (!s)
> +        return;
>  
>      if (s->events_dropped) {
>          virtio_scsi_push_event(s, NULL, VIRTIO_SCSI_T_NO_EVENT, 0);
> 

Should be already fixed in 2.1 by commit 91d670f (virtio-scsi: define
dummy handle_output for vhost-scsi vqs, 2014-06-19).

Paolo

      reply	other threads:[~2014-09-01  9:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01  9:33 [Qemu-devel] [Patch] block:qemu will crash when vhost-scsi disk vm reboot Zhang Min
2014-09-01  9:38 ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54043E7D.4010706@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=boby.chen@huawei.com \
    --cc=mst@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rudy.zhangmin@huawei.com \
    --cc=subo7@huawei.com \
    --cc=wu.wubin@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.