All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Ming Lei <ming.lei@canonical.com>, "Michael S. Tsirkin" <mst@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, Anthony Liguori <aliguori@amazon.com>,
	qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v1] virtio-scsi: fix object check failure
Date: Wed, 18 Jun 2014 17:53:03 +0200	[thread overview]
Message-ID: <53A1B5DF.7020303@redhat.com> (raw)
In-Reply-To: <CACVXFVPz8s9xcbSiqv4u4_QTmT+Ynz1o9eUtf5Tm3iepfWBa4g@mail.gmail.com>

Il 18/06/2014 17:48, Ming Lei ha scritto:
> On Wed, Jun 18, 2014 at 11:43 PM, Michael S. Tsirkin <mst@redhat.com> 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

Which I should have done in the first place when rebasing vhost-scsi, 
and I didn't only because I was lazy and thought this could not happen. 
:(  Turns out it only didn't because at the time the kernel did not 
support events.

Paolo

  reply	other threads:[~2014-06-18 15:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-18 15:32 [Qemu-devel] [PATCH v1] virtio-scsi: fix object check failure Ming Lei
2014-06-18 15:43 ` Michael S. Tsirkin
2014-06-18 15:48   ` Ming Lei
2014-06-18 15:53     ` Paolo Bonzini [this message]
2014-06-18 16:03       ` Ming Lei
2014-06-18 16:05         ` Paolo Bonzini

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=53A1B5DF.7020303@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=ming.lei@canonical.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /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.