- To: mc@xxxxxxxxxxxxxxxxxx
- Subject: Re: [PATCH] virtio-scsi: hotplug suppot for virtio-scsi
- From: Paolo Bonzini <pbonzini@xxxxxxxxxx>
- Date: Mon, 02 Jul 2012 10:11:57 +0200
- Cc: Rusty Russell <rusty@xxxxxxxxxxxxxxx>, "Nicholas A. Bellinger" <nab@xxxxxxxxxxxxxxx>, stefanha@xxxxxxxxxxxxxxxxxx, linuxram@xxxxxxxxxx, Anthony Liguori <anthony@xxxxxxxxxxxxx>, senwang@xxxxxxxxxxxxxxxxxx, zwanp@xxxxxxxxxx, "James E.J. Bottomley" <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx
- In-reply-to: <20120702032057.Horde.WOVSk5ir309P8UvZ8oq3rUA@imap.linux.ibm.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0
Il 02/07/2012 09:20, mc@xxxxxxxxxxxxxxxxxx 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
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[SCSI Target Devel]
[Linux SCSI Target Infrastructure]
[Kernel Newbies]
[Share Photos]
[IDE]
[Security]
[Git]
[Netfilter]
[Bugtraq]
[Photos]
[Yosemite]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Linux ATA RAID]
[Linux IIO]
[Samba]
[Video 4 Linux]
[Device Mapper]
[Linux Resources]