From: fred.konrad@greensocs.com
To: qemu-devel@nongnu.org, aliguori@us.ibm.com
Cc: cornelia.huck@de.ibm.com, peter.maydell@linaro.org,
mark.burton@greensocs.com, fred.konrad@greensocs.com
Subject: [Qemu-devel] [PATCH v4 1/7] virtio-bus: add new functions.
Date: Wed, 24 Apr 2013 10:21:17 +0200 [thread overview]
Message-ID: <1366791683-5350-2-git-send-email-fred.konrad@greensocs.com> (raw)
In-Reply-To: <1366791683-5350-1-git-send-email-fred.konrad@greensocs.com>
From: KONRAD Frederic <fred.konrad@greensocs.com>
This add two functions:
* virtio_bus_set_vdev_config.
* virtio_bus_set_vdev_feature.
Needed by virtio-ccw.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
---
hw/virtio/virtio-bus.c | 23 +++++++++++++++++++++++
include/hw/virtio/virtio-bus.h | 5 +++++
2 files changed, 28 insertions(+)
diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c
index 1596a1c..dd10849 100644
--- a/hw/virtio/virtio-bus.c
+++ b/hw/virtio/virtio-bus.c
@@ -124,6 +124,18 @@ uint32_t virtio_bus_get_vdev_features(VirtioBusState *bus,
return k->get_features(bus->vdev, requested_features);
}
+/* Set the features of the plugged device. */
+void virtio_bus_set_vdev_features(VirtioBusState *bus,
+ uint32_t requested_features)
+{
+ VirtioDeviceClass *k;
+ assert(bus->vdev != NULL);
+ k = VIRTIO_DEVICE_GET_CLASS(bus->vdev);
+ if (k->set_features != NULL) {
+ k->set_features(bus->vdev, requested_features);
+ }
+}
+
/* Get bad features of the plugged device. */
uint32_t virtio_bus_get_vdev_bad_features(VirtioBusState *bus)
{
@@ -148,6 +160,17 @@ void virtio_bus_get_vdev_config(VirtioBusState *bus, uint8_t *config)
}
}
+/* Set config of the plugged device. */
+void virtio_bus_set_vdev_config(VirtioBusState *bus, uint8_t *config)
+{
+ VirtioDeviceClass *k;
+ assert(bus->vdev != NULL);
+ k = VIRTIO_DEVICE_GET_CLASS(bus->vdev);
+ if (k->set_config != NULL) {
+ k->set_config(bus->vdev, config);
+ }
+}
+
static const TypeInfo virtio_bus_info = {
.name = TYPE_VIRTIO_BUS,
.parent = TYPE_BUS,
diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h
index 311e8c7..ec82238 100644
--- a/include/hw/virtio/virtio-bus.h
+++ b/include/hw/virtio/virtio-bus.h
@@ -86,9 +86,14 @@ size_t virtio_bus_get_vdev_config_len(VirtioBusState *bus);
/* Get the features of the plugged device. */
uint32_t virtio_bus_get_vdev_features(VirtioBusState *bus,
uint32_t requested_features);
+/* Set the features of the plugged device. */
+void virtio_bus_set_vdev_features(VirtioBusState *bus,
+ uint32_t requested_features);
/* Get bad features of the plugged device. */
uint32_t virtio_bus_get_vdev_bad_features(VirtioBusState *bus);
/* Get config of the plugged device. */
void virtio_bus_get_vdev_config(VirtioBusState *bus, uint8_t *config);
+/* Set config of the plugged device. */
+void virtio_bus_set_vdev_config(VirtioBusState *bus, uint8_t *config);
#endif /* VIRTIO_BUS_H */
--
1.7.11.7
next prev parent reply other threads:[~2013-04-24 8:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-24 8:21 [Qemu-devel] [PATCH v4 0/7] virtio-refactoring cleanup fred.konrad
2013-04-24 8:21 ` fred.konrad [this message]
2013-04-24 8:21 ` [Qemu-devel] [PATCH v4 2/7] virtio-bus: make virtio_x_bus_new static fred.konrad
2013-04-24 8:21 ` [Qemu-devel] [PATCH v4 3/7] virtio-pci: cleanup fred.konrad
2013-04-24 8:21 ` [Qemu-devel] [PATCH v4 4/7] virtio: remove the function pointer fred.konrad
2013-04-24 8:21 ` [Qemu-devel] [PATCH v4 5/7] virtio: remove virtiobindings fred.konrad
2013-04-24 8:21 ` [Qemu-devel] [PATCH v4 6/7] virtio: cleanup: init and exit function fred.konrad
2013-04-24 8:21 ` [Qemu-devel] [PATCH v4 7/7] virtio: drop unused function prototypes fred.konrad
2013-04-24 18:24 ` [Qemu-devel] [PATCH v4 0/7] virtio-refactoring cleanup Anthony Liguori
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=1366791683-5350-2-git-send-email-fred.konrad@greensocs.com \
--to=fred.konrad@greensocs.com \
--cc=aliguori@us.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=mark.burton@greensocs.com \
--cc=peter.maydell@linaro.org \
--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).