summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVictor Kaplansky2015-11-11 15:26:02 +0100
committerMichael S. Tsirkin2015-11-12 14:49:33 +0100
commit2b8819c6eee517c1582983773f8555bb3f9ed645 (patch)
tree92e42beb3ea73822d83b4457a384b41c5ade612a /tests
parentvirtio-pci: unbreak queue_enable read (diff)
downloadqemu-2b8819c6eee517c1582983773f8555bb3f9ed645.tar.gz
qemu-2b8819c6eee517c1582983773f8555bb3f9ed645.tar.xz
qemu-2b8819c6eee517c1582983773f8555bb3f9ed645.zip
vhost-user: modify SET_LOG_BASE to pass mmap size and offset
Unlike the kernel, vhost-user application accesses log table by mmaping it to its user space. This change adds two new fields to VhostUserMsg payload: mmap_size, and mmap_offset and make QEMU to pass the to vhost-user application in VHOST_USER_SET_LOG_BASE request. Signed-off-by: Victor Kaplansky <victork@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/vhost-user-test.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index b6dde753f8..f005ecfa68 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -86,6 +86,11 @@ typedef struct VhostUserMemory {
VhostUserMemoryRegion regions[VHOST_MEMORY_MAX_NREGIONS];
} VhostUserMemory;
+typedef struct VhostUserLog {
+ uint64_t mmap_size;
+ uint64_t mmap_offset;
+} VhostUserLog;
+
typedef struct VhostUserMsg {
VhostUserRequest request;
@@ -94,10 +99,13 @@ typedef struct VhostUserMsg {
uint32_t flags;
uint32_t size; /* the following payload size */
union {
+#define VHOST_USER_VRING_IDX_MASK (0xff)
+#define VHOST_USER_VRING_NOFD_MASK (0x1<<8)
uint64_t u64;
struct vhost_vring_state state;
struct vhost_vring_addr addr;
VhostUserMemory memory;
+ VhostUserLog log;
} payload;
} QEMU_PACKED VhostUserMsg;