qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Patch] block:qemu will crash when vhost-scsi disk vm r


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [Patch] block:qemu will crash when vhost-scsi disk vm reboot
Date: Mon, 01 Sep 2014 11:38:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

Il 01/09/2014 11:33, Zhang Min ha scritto:
> From: subo <address@hidden>
> 
> 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 <address@hidden>
> Signed-off-by: subo <address@hidden>
> ---
>  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 via email to

[Prev in Thread] Current Thread [Next in Thread]