All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] Notify devices when a bus is attached
@ 2013-06-04 16:22 Jesse Larrew
  2013-06-04 16:22 ` [Qemu-devel] [PATCH 1/3] virtio: add bus_plugged() callback to VirtioDeviceClass Jesse Larrew
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jesse Larrew @ 2013-06-04 16:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: jasowang, mdroth, fred.konrad

The virtio-net driver can determine the required size of the config struct
dynamically by inspecting the feature bits in host_features. The natural
place to perform this calculation is within the driver's init routine.
However, host_features isn't set until later when the device is plugged
into a bus.

VirtioBusClass includes a callback method, device_plugged(), that allows
the bus to perform additional setup tasks when a device is plugged into the
bus. This patch set similarly extends VirtioDeviceClass to add a callback,
bus_plugged(), to allow devices the same setup opportunity.

This allows virtio-net to defer the config size calculation until
host_features is available, which I think will be a better long-term fix to
the problem addressed in e9016ee2bda1b7757072b856b2196f691aee3388.

 [PATCH 1/3] virtio: add bus_plugged() callback to VirtioDeviceClass
 [PATCH 2/3] virtio-net: implement bus_plugged()
 [PATCH 3/3] virtio-net: revert MAC address workaround

 hw/net/virtio-net.c        | 20 +++++++++++++++++++-
 hw/virtio/virtio.c         |  3 +++
 include/hw/virtio/virtio.h |  1 +
 3 files changed, 23 insertions(+), 1 deletion(-)

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-06-05 15:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-04 16:22 [Qemu-devel] [PATCH 0/3] Notify devices when a bus is attached Jesse Larrew
2013-06-04 16:22 ` [Qemu-devel] [PATCH 1/3] virtio: add bus_plugged() callback to VirtioDeviceClass Jesse Larrew
2013-06-04 17:35   ` Andreas Färber
2013-06-04 20:02     ` Jesse Larrew
2013-06-05 15:18       ` Frederic Konrad
2013-06-05 15:09     ` Frederic Konrad
2013-06-04 16:22 ` [Qemu-devel] [PATCH 2/3] virtio-net: implement bus_plugged() Jesse Larrew
2013-06-04 16:22 ` [Qemu-devel] [PATCH 3/3] virtio-net: revert MAC address workaround Jesse Larrew

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.