qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/3] scsi/virtio-scsi: Prevent assertion on miss


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 3/3] scsi/virtio-scsi: Prevent assertion on missed events
Date: Tue, 14 Jan 2014 15:47:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9

Il 14/01/2014 15:24, Eric Farman ha scritto:
> In some cases, an unplug can cause events to be dropped, which
> leads to an assertion failure when preparing to notify the guest
> kernel.  This merely accommodates both variations of the "no event"
> value that could occur in this codepath.
> 
> Signed-off-by: Eric Farman <address@hidden>
> ---
>  hw/scsi/virtio-scsi.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
> index 49a9576..f8e3632 100644
> --- a/hw/scsi/virtio-scsi.c
> +++ b/hw/scsi/virtio-scsi.c
> @@ -521,7 +521,8 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, 
> SCSIDevice *dev,
>      evt->event = event;
>      evt->reason = reason;
>      if (!dev) {
> -        assert(event == VIRTIO_SCSI_T_NO_EVENT);
> +        assert(event == VIRTIO_SCSI_T_NO_EVENT ||
> +               event == VIRTIO_SCSI_T_EVENTS_MISSED);
>      } else {
>          evt->lun[0] = 1;
>          evt->lun[1] = dev->id;
> 

Ugh, you're right.  In fact, you can only have event ==
VIRTIO_SCSI_T_EVENTS_MISSED at this point.  Can you make v2 that
completely replaces the condition?

Paolo



reply via email to

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