From: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: jasowang@redhat.com, mdroth@linux.vnet.ibm.com,
fred.konrad@greensocs.com
Subject: [Qemu-devel] [PATCH 0/3] Notify devices when a bus is attached
Date: Tue, 4 Jun 2013 11:22:42 -0500 [thread overview]
Message-ID: <1370362965-3937-1-git-send-email-jlarrew@linux.vnet.ibm.com> (raw)
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(-)
next reply other threads:[~2013-06-04 16:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-04 16:22 Jesse Larrew [this message]
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
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=1370362965-3937-1-git-send-email-jlarrew@linux.vnet.ibm.com \
--to=jlarrew@linux.vnet.ibm.com \
--cc=fred.konrad@greensocs.com \
--cc=jasowang@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/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).