@@ -223,6 +223,13 @@ static void vp_slave_set_vring_base(VhostUserMsg *msg)
pvq_node->last_avail_idx = msg->payload.u64;
}
+static void vp_slave_set_vring_addr(VhostUserMsg *msg)
+{
+ PeerVqNode *pvq_node = QLIST_FIRST(&vp_slave->pvq_list);
+ memcpy(&pvq_node->addr, &msg->payload.addr,
+ sizeof(struct vhost_vring_addr));
+}
+
static int vp_slave_can_read(void *opaque)
{
return VHOST_USER_HDR_SIZE;
@@ -296,6 +303,9 @@ static void vp_slave_read(void *opaque, const uint8_t *buf, int size)
case VHOST_USER_SET_VRING_BASE:
vp_slave_set_vring_base(&msg);
break;
+ case VHOST_USER_SET_VRING_ADDR:
+ vp_slave_set_vring_addr(&msg);
+ break;
default:
error_report("vhost-pci-slave does not support msg request = %d",
msg.request);
@@ -1,6 +1,8 @@
#ifndef QEMU_VHOST_PCI_SLAVE_H
#define QEMU_VHOST_PCI_SLAVE_H
+#include <linux/vhost.h>
+
#include "sysemu/char.h"
#include "exec/memory.h"
#include "standard-headers/linux/vhost_pci_net.h"
@@ -8,6 +10,7 @@
typedef struct PeerVqNode {
uint16_t last_avail_idx;
uint32_t vring_num;
+ struct vhost_vring_addr addr;
QLIST_ENTRY(PeerVqNode) node;
} PeerVqNode;
Update the virtqueue addresses to the head node of the list. Signed-off-by: Wei Wang <wei.w.wang@intel.com> --- hw/virtio/vhost-pci-slave.c | 10 ++++++++++ include/hw/virtio/vhost-pci-slave.h | 3 +++ 2 files changed, 13 insertions(+)