Re: [Qemu-devel] [PATCH 2/2] virtio-scsi: Implement hotplug support for virtio-scsi
From: Stefan Hajnoczi <hidden>
Date: 2012-06-25 09:10:21
On Mon, Jun 25, 2012 at 03:51:13AM -0400, mc@linux.vnet.ibm.com wrote:
Quoting Stefan Hajnoczi [off-list ref]:quoted
On Wed, Jun 20, 2012 at 7:47 AM, Cong Meng [off-list ref] wrote:quoted
Implement the hotplug() and hot_unplug() interfaces in virtio-scsi, by signal the virtio_scsi.ko in guest kernel via event virtual queue. The counterpart patch of virtio_scsi.ko will be sent soon in another thread.quoted
Signed-off-by: Cong Meng <redacted> Signed-off-by: Sen Wang <redacted> --- hw/virtio-scsi.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 69 insertions(+), 3 deletions(-)I compared against the virtio-scsi specification and this looks good: http://ozlabs.org/~rusty/virtio-spec/virtio-0.9.5.pdf Dropped events and event throttling are not implemented by this patch. This means that the guest can miss events if it runs out of event queue elements. A scenario that might be able to trigger this is if multiple LUNs are hotplugged in a single QEMU monitor callback. Implementing dropped events is easy in hw/virtio-scsi.c. Keep a bool or counter of dropped events and report them when the guest kicks us with a free event element (virtio_scsi_handle_event).Yes. It's easy to do this in qemu. But I'm not sure what should be done in virtio-scsi.ko to respond the "VIRTIO_SCSI_T_EVENTS_MISSED" event. The spec says "poll the logical units for unit attention conditions", or just a whole bus rescan?
I'm not sure what the answer is either, maybe you can find an existing SCSI LLD that does what you need. Stefan