1*0df750e9SMarc-André Lureau /* 2*0df750e9SMarc-André Lureau * Vhost User library 3*0df750e9SMarc-André Lureau * 4*0df750e9SMarc-André Lureau * Copyright (c) 2016 Nutanix Inc. All rights reserved. 5*0df750e9SMarc-André Lureau * Copyright (c) 2017 Red Hat, Inc. 6*0df750e9SMarc-André Lureau * 7*0df750e9SMarc-André Lureau * Authors: 8*0df750e9SMarc-André Lureau * Marc-André Lureau <mlureau@redhat.com> 9*0df750e9SMarc-André Lureau * Felipe Franciosi <felipe@nutanix.com> 10*0df750e9SMarc-André Lureau * 11*0df750e9SMarc-André Lureau * This work is licensed under the terms of the GNU GPL, version 2 or 12*0df750e9SMarc-André Lureau * later. See the COPYING file in the top-level directory. 13*0df750e9SMarc-André Lureau */ 14*0df750e9SMarc-André Lureau 15*0df750e9SMarc-André Lureau #ifndef LIBVHOST_USER_GLIB_H 16*0df750e9SMarc-André Lureau #define LIBVHOST_USER_GLIB_H 17*0df750e9SMarc-André Lureau 18*0df750e9SMarc-André Lureau #include <glib.h> 19*0df750e9SMarc-André Lureau #include "libvhost-user.h" 20*0df750e9SMarc-André Lureau 21*0df750e9SMarc-André Lureau typedef struct VugDev { 22*0df750e9SMarc-André Lureau VuDev parent; 23*0df750e9SMarc-André Lureau 24*0df750e9SMarc-André Lureau GHashTable *fdmap; /* fd -> gsource */ 25*0df750e9SMarc-André Lureau GSource *src; 26*0df750e9SMarc-André Lureau } VugDev; 27*0df750e9SMarc-André Lureau 28*0df750e9SMarc-André Lureau bool vug_init(VugDev *dev, uint16_t max_queues, int socket, 29*0df750e9SMarc-André Lureau vu_panic_cb panic, const VuDevIface *iface); 30*0df750e9SMarc-André Lureau void vug_deinit(VugDev *dev); 31*0df750e9SMarc-André Lureau 32*0df750e9SMarc-André Lureau GSource *vug_source_new(VugDev *dev, int fd, GIOCondition cond, 33*0df750e9SMarc-André Lureau vu_watch_cb vu_cb, gpointer data); 34*0df750e9SMarc-André Lureau void vug_source_destroy(GSource *src); 35*0df750e9SMarc-André Lureau 36*0df750e9SMarc-André Lureau #endif /* LIBVHOST_USER_GLIB_H */ 37