Quoting Stefan Hajnoczi <stefa...@gmail.com>:
On Wed, Jun 20, 2012 at 7:47 AM, Cong Meng <m...@linux.vnet.ibm.com> wrote:
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.
Signed-off-by: Cong Meng <m...@linux.vnet.ibm.com>
Signed-off-by: Sen Wang <senw...@linux.vnet.ibm.com>
---
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?
Stefan