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