diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2022-12-22 09:00:05 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2023-01-08 01:54:22 -0500 |
commit | 9d94c21363537903a594a3f44d2cf7fa7d4b2ea7 (patch) | |
tree | 6e129522e407527d7e08dfe975b0ecccb8ed1c3c /hw/virtio/virtio-qmp.h | |
parent | dd92cbb3665a47b9118cbd06a60ff0c75ad1f442 (diff) |
hw/virtio: Extract QMP QOM-specific functions to virtio-qmp.c
virtio.c is big enough, extract more QMP related code to virtio-qmp.c.
To do so, expose qmp_find_virtio_device() and declar virtio_list in
the internal virtio-qmp.h header.
Note we have to leave qmp_x_query_virtio_queue_status() and
qmp_x_query_virtio_queue_element(), because they access VirtQueue
internal fields, and VirtQueue is only declared within virtio.c.
Suggested-by: Jonah Palmer <jonah.palmer@oracle.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221222080005.27616-3-philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/virtio/virtio-qmp.h')
-rw-r--r-- | hw/virtio/virtio-qmp.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/virtio/virtio-qmp.h b/hw/virtio/virtio-qmp.h index 075fc27030..59681082e5 100644 --- a/hw/virtio/virtio-qmp.h +++ b/hw/virtio/virtio-qmp.h @@ -12,7 +12,16 @@ #define HW_VIRTIO_QMP_H #include "qapi/qapi-types-virtio.h" +#include "hw/virtio/virtio.h" +#include "qemu/queue.h" + +typedef QTAILQ_HEAD(QmpVirtIODeviceList, VirtIODevice) QmpVirtIODeviceList; + +/* QAPI list of realized VirtIODevices */ +extern QmpVirtIODeviceList virtio_list; + +VirtIODevice *qmp_find_virtio_device(const char *path); VirtioDeviceStatus *qmp_decode_status(uint8_t bitmap); VhostDeviceProtocols *qmp_decode_protocols(uint64_t bitmap); VirtioDeviceFeatures *qmp_decode_features(uint16_t device_id, uint64_t bitmap); |