aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/virtio.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/virtio/virtio.c')
-rw-r--r--hw/virtio/virtio.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 229a092c83..28fa7fe760 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -576,6 +576,19 @@ void *virtqueue_pop(VirtQueue *vq, size_t sz)
return elem;
}
+void *qemu_get_virtqueue_element(QEMUFile *f, size_t sz)
+{
+ VirtQueueElement *elem = g_malloc(sz);
+ qemu_get_buffer(f, (uint8_t *)elem, sizeof(VirtQueueElement));
+ virtqueue_map(elem);
+ return elem;
+}
+
+void qemu_put_virtqueue_element(QEMUFile *f, VirtQueueElement *elem)
+{
+ qemu_put_buffer(f, (uint8_t *)elem, sizeof(VirtQueueElement));
+}
+
/* virtio device */
static void virtio_notify_vector(VirtIODevice *vdev, uint16_t vector)
{