summary refs log tree commit diff stats
path: root/hw/virtio/vhost-user.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2015-10-09 17:17:23 +0200
committerMichael S. Tsirkin <mst@redhat.com>2015-10-22 14:34:49 +0300
commitc2bea314f6a2870b847c79e2e11263c5f9334db7 (patch)
tree4c59a51399045a2e0dab678f2f02f53bbdd6eded /hw/virtio/vhost-user.c
parent636f4dddfe48ccabaf5198bba440354d6a268d62 (diff)
downloadfocaccia-qemu-c2bea314f6a2870b847c79e2e11263c5f9334db7.tar.gz
focaccia-qemu-c2bea314f6a2870b847c79e2e11263c5f9334db7.zip
vhost: add vhost_set_log_base op
Split VHOST_SET_LOG_BASE call in a seperate function callback, so that
type safety works and more arguments can be added in the next patches.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Thibaut Collet <thibaut.collet@6wind.com>
Diffstat (limited to 'hw/virtio/vhost-user.c')
-rw-r--r--hw/virtio/vhost-user.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 9585637d07..5d512898cf 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -242,7 +242,6 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned long int request,
         break;
 
     case VHOST_USER_SET_FEATURES:
-    case VHOST_USER_SET_LOG_BASE:
     case VHOST_USER_SET_PROTOCOL_FEATURES:
         msg.u64 = *((__u64 *) arg);
         msg.size = sizeof(m.u64);
@@ -367,6 +366,20 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned long int request,
     return 0;
 }
 
+static int vhost_set_log_base(struct vhost_dev *dev, uint64_t base)
+{
+    VhostUserMsg msg = {
+        .request = VHOST_USER_SET_LOG_BASE,
+        .flags = VHOST_USER_VERSION,
+        .u64 = base,
+        .size = sizeof(m.u64),
+    };
+
+    vhost_user_write(dev, &msg, NULL, 0);
+
+    return 0;
+}
+
 static int vhost_user_init(struct vhost_dev *dev, void *opaque)
 {
     unsigned long long features;
@@ -453,4 +466,5 @@ const VhostOps user_ops = {
         .vhost_backend_get_vq_index = vhost_user_get_vq_index,
         .vhost_backend_set_vring_enable = vhost_user_set_vring_enable,
         .vhost_backend_memslots_limit = vhost_user_memslots_limit,
+        .vhost_set_log_base = vhost_set_log_base,
 };