From: Paolo Bonzini <pbonzini@redhat.com>
To: mc@linux.vnet.ibm.com
Cc: stefanha@linux.vnet.ibm.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org, zwanp@cn.ibm.com,
linuxram@us.ibm.com, senwang@linux.vnet.ibm.com,
virtualization@lists.linux-foundation.org,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [PATCH] virtio-scsi: hotplug suppot for virtio-scsi
Date: Mon, 02 Jul 2012 10:11:57 +0200 [thread overview]
Message-ID: <4FF157CD.7090001@redhat.com> (raw)
In-Reply-To: <20120702032057.Horde.WOVSk5ir309P8UvZ8oq3rUA@imap.linux.ibm.com>
Il 02/07/2012 09:20, mc@linux.vnet.ibm.com ha scritto:
>>> +static void virtscsi_handle_event(struct work_struct *work)
>>> +{
>>> + struct virtio_scsi_event_node *event_node =
>>> + container_of(work, struct virtio_scsi_event_node, work);
>>> + struct virtio_scsi *vscsi = event_node->vscsi;
>>> + struct virtio_scsi_event *event = &event_node->event;
>>> +
>>> + switch (event->event) {
>>> + case VIRTIO_SCSI_T_TRANSPORT_RESET:
>>> + virtscsi_handle_transport_reset(vscsi, event);
>>> + break;
>>
>> Please handle VIRTIO_SCSI_T_NO_EVENT too here, and mask out
>> VIRTIO_SCSI_T_EVENTS_MISSED even if you do not handle it by triggering a
>> full rescan.
>>
> Paolo, what's the appropriate action to response VIRTIO_SCSI_T_NO_EVENT
> event? An error message?
No, just do nothing.
> I also have some confusion on VIRTIO_SCSI_T_EVENTS_MISSED:
> Should VIRTIO_SCSI_T_EVENTS_MISSED always be used with other event flag?
Yes.
> For instanse:
> (VIRTIO_SCSI_T_EVENTS_MISSED|VIRTIO_SCSI_T_TRANSPORT_RESET) is used to
> report hotplug event dropped when a buffer available.
The idea in the spec was that QEMU would report VIRTIO_SCSI_T_NO_EVENT |
VIRTIO_SCSI_T_EVENTS_MISSED as soon as a buffer becomes available, but
technically this is indeed possible. So you need to handle
VIRTIO_SCSI_T_EVENTS_MISSED first, and the other bits separately.
Paolo
next prev parent reply other threads:[~2012-07-02 8:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1340175333-16803-1-git-send-email-mc@linux.vnet.ibm.com>
2012-07-01 13:24 ` [PATCH] virtio-scsi: hotplug suppot for virtio-scsi Paolo Bonzini
2012-07-02 7:20 ` mc
[not found] ` <20120702032057.Horde.WOVSk5ir309P8UvZ8oq3rUA@imap.linux.ibm.com>
2012-07-02 8:11 ` Paolo Bonzini [this message]
2012-06-20 6:55 Cong Meng
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=4FF157CD.7090001@redhat.com \
--to=pbonzini@redhat.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=anthony@codemonkey.ws \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxram@us.ibm.com \
--cc=mc@linux.vnet.ibm.com \
--cc=senwang@linux.vnet.ibm.com \
--cc=stefanha@linux.vnet.ibm.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=zwanp@cn.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).