libvhost-user-glib.h 926 B

123456789101112131415161718192021222324252627282930313233343536
  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. #ifndef LIBVHOST_USER_GLIB_H
  15. #define LIBVHOST_USER_GLIB_H
  16. #include <glib.h>
  17. #include "libvhost-user.h"
  18. typedef struct VugDev {
  19. VuDev parent;
  20. GHashTable *fdmap; /* fd -> gsource */
  21. GSource *src;
  22. } VugDev;
  23. bool vug_init(VugDev *dev, uint16_t max_queues, int socket,
  24. vu_panic_cb panic, const VuDevIface *iface);
  25. void vug_deinit(VugDev *dev);
  26. GSource *vug_source_new(VugDev *dev, int fd, GIOCondition cond,
  27. vu_watch_cb vu_cb, gpointer data);
  28. void vug_source_destroy(GSource *src);
  29. #endif /* LIBVHOST_USER_GLIB_H */