mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
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>
This commit is contained in:
32
contrib/libvhost-user/libvhost-user-glib.h
Normal file
32
contrib/libvhost-user/libvhost-user-glib.h
Normal file
@@ -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 */
|
||||
Reference in New Issue
Block a user