aboutsummaryrefslogtreecommitdiff
path: root/contrib/libvhost-user
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2018-03-12 17:21:01 +0000
committerMichael S. Tsirkin <mst@redhat.com>2018-03-20 05:03:27 +0200
commitd3dff7a5a1e0a6eff963fabc4d06879d060f34ee (patch)
tree6b9d1461eedf9181a91914876e4a8df0439fdba6 /contrib/libvhost-user
parent9ccbfe14ddfce379ee24684b3648376b130293cd (diff)
downloadqemu-d3dff7a5a1e0a6eff963fabc4d06879d060f34ee.zip
qemu-d3dff7a5a1e0a6eff963fabc4d06879d060f34ee.tar.gz
qemu-d3dff7a5a1e0a6eff963fabc4d06879d060f34ee.tar.bz2
vhost-user: Add 'VHOST_USER_POSTCOPY_ADVISE' message
Wire up a notifier to send a VHOST_USER_POSTCOPY_ADVISE message on an incoming advise. Later patches will fill in the behaviour/contents of the message. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-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>
Diffstat (limited to 'contrib/libvhost-user')
-rw-r--r--contrib/libvhost-user/libvhost-user.c11
-rw-r--r--contrib/libvhost-user/libvhost-user.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
index 2e358b5..37d4228 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -86,6 +86,7 @@ vu_request_to_string(unsigned int req)
REQ(VHOST_USER_SET_VRING_ENDIAN),
REQ(VHOST_USER_GET_CONFIG),
REQ(VHOST_USER_SET_CONFIG),
+ REQ(VHOST_USER_POSTCOPY_ADVISE),
REQ(VHOST_USER_MAX),
};
#undef REQ
@@ -857,6 +858,14 @@ vu_set_config(VuDev *dev, VhostUserMsg *vmsg)
}
static bool
+vu_set_postcopy_advise(VuDev *dev, VhostUserMsg *vmsg)
+{
+ /* TODO: Open ufd, pass it back in the request */
+ vmsg->size = 0;
+ return true; /* = send a reply */
+}
+
+static bool
vu_process_message(VuDev *dev, VhostUserMsg *vmsg)
{
int do_reply = 0;
@@ -927,6 +936,8 @@ vu_process_message(VuDev *dev, VhostUserMsg *vmsg)
return vu_set_config(dev, vmsg);
case VHOST_USER_NONE:
break;
+ case VHOST_USER_POSTCOPY_ADVISE:
+ return vu_set_postcopy_advise(dev, vmsg);
default:
vmsg_close_fds(vmsg);
vu_panic(dev, "Unhandled request: %d", vmsg->request);
diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-user/libvhost-user.h
index 96db29c..00d78a8 100644
--- a/contrib/libvhost-user/libvhost-user.h
+++ b/contrib/libvhost-user/libvhost-user.h
@@ -83,6 +83,9 @@ typedef enum VhostUserRequest {
VHOST_USER_SET_VRING_ENDIAN = 23,
VHOST_USER_GET_CONFIG = 24,
VHOST_USER_SET_CONFIG = 25,
+ VHOST_USER_CREATE_CRYPTO_SESSION = 26,
+ VHOST_USER_CLOSE_CRYPTO_SESSION = 27,
+ VHOST_USER_POSTCOPY_ADVISE = 28,
VHOST_USER_MAX
} VhostUserRequest;