qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1] virtio-scsi: fix object check failure


From: Ming Lei
Subject: Re: [Qemu-devel] [PATCH v1] virtio-scsi: fix object check failure
Date: Thu, 19 Jun 2014 00:03:08 +0800

On Wed, Jun 18, 2014 at 11:53 PM, Paolo Bonzini <address@hidden> wrote:
> Il 18/06/2014 17:48, Ming Lei ha scritto:
>
>> On Wed, Jun 18, 2014 at 11:43 PM, Michael S. Tsirkin <address@hidden>
>> wrote:
>>>
>>> On Wed, Jun 18, 2014 at 11:32:33PM +0800, Ming Lei wrote:
>>>>
>>>> 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().
>>>>
>>>> Also 'events_dropped' need to be accessed in the path,
>>>
>>>
>>> in which path?
>>
>>
>> I mean vq's notify path, virtio_scsi_handle_event().
>
>
> A better way is this:
>
> - create a VirtIOSCSICommonClass struct and use it (virtio_scsi_common_info)
>
> - add three members virtio_scsi_handle_ctrl, virtio_scsi_handle_event,
> virtio_scsi_handle_cmd to VirtIOSCSICommonClass
>
> - initialize them to the existing functions in virtio_scsi_class_init
>
> - initialize them to dummy empty functions in vhost_scsi_class_init

But vhost does need the three functions as vq's handle_out callback.

Thanks,
--
Ming Lei



reply via email to

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