aboutsummaryrefslogtreecommitdiff
path: root/contrib/libvhost-user/libvhost-user-glib.h
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-08-17 20:55:14 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-10-10 23:31:09 +0200
commit8bb7ddb78a1c68f2408a66a61c748330903fd5f2 (patch)
treeaa923eb191450bf1117ed15b7fca90cf2434878b /contrib/libvhost-user/libvhost-user-glib.h
parent422a26872e4c14292ad2adc1411d6eb2032255e9 (diff)
downloadqemu-8bb7ddb78a1c68f2408a66a61c748330903fd5f2.zip
qemu-8bb7ddb78a1c68f2408a66a61c748330903fd5f2.tar.gz
qemu-8bb7ddb78a1c68f2408a66a61c748330903fd5f2.tar.bz2
libvhost-user: add glib source helper
This file implements a bridge from the vu_init API of libvhost-user to GSource, so that libvhost-user can be used inside a GLib main loop. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'contrib/libvhost-user/libvhost-user-glib.h')
-rw-r--r--contrib/libvhost-user/libvhost-user-glib.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/contrib/libvhost-user/libvhost-user-glib.h b/contrib/libvhost-user/libvhost-user-glib.h
new file mode 100644
index 0000000..6b2110b
--- /dev/null
+++ b/contrib/libvhost-user/libvhost-user-glib.h
@@ -0,0 +1,32 @@
+/*
+ * Vhost User library
+ *
+ * Copyright (c) 2016 Nutanix Inc. All rights reserved.
+ * Copyright (c) 2017 Red Hat, Inc.
+ *
+ * Authors:
+ * Marc-André Lureau <mlureau@redhat.com>
+ * Felipe Franciosi <felipe@nutanix.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or
+ * later. See the COPYING file in the top-level directory.
+ */
+
+#ifndef LIBVHOST_USER_GLIB_H
+#define LIBVHOST_USER_GLIB_H
+
+#include <glib.h>
+#include "libvhost-user.h"
+
+typedef struct VugDev {
+ VuDev parent;
+
+ GHashTable *fdmap; /* fd -> gsource */
+ GSource *src;
+} VugDev;
+
+void vug_init(VugDev *dev, int socket,
+ vu_panic_cb panic, const VuDevIface *iface);
+void vug_deinit(VugDev *dev);
+
+#endif /* LIBVHOST_USER_GLIB_H */