[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 4/8] libvhost-user: drop qemu/osdep.h dependency
From: |
marcandre . lureau |
Subject: |
[PATCH v2 4/8] libvhost-user: drop qemu/osdep.h dependency |
Date: |
Wed, 25 Nov 2020 14:06:36 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
contrib/libvhost-user/libvhost-user-glib.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/contrib/libvhost-user/libvhost-user-glib.c
b/contrib/libvhost-user/libvhost-user-glib.c
index 0df2ec9271..efc9d814e3 100644
--- a/contrib/libvhost-user/libvhost-user-glib.c
+++ b/contrib/libvhost-user/libvhost-user-glib.c
@@ -12,10 +12,16 @@
* later. See the COPYING file in the top-level directory.
*/
-#include "qemu/osdep.h"
-
#include "libvhost-user-glib.h"
+#ifndef container_of
+#define container_of(ptr, type, member) \
+ __extension__({ \
+ void *__mptr = (void *)(ptr); \
+ ((type *)(__mptr - offsetof(type, member))); \
+ })
+#endif
+
/* glib event loop integration for libvhost-user and misc callbacks */
G_STATIC_ASSERT((int)G_IO_IN == (int)VU_WATCH_IN);
--
2.29.0
- [PATCH v2 0/8] libvhost-user: make it a subproject (was: "lower dependency on QEMU headers"), marcandre . lureau, 2020/11/25
- [PATCH v2 1/8] libvhost-user: replace qemu/bswap.h with glibc endian.h, marcandre . lureau, 2020/11/25
- [PATCH v2 2/8] libvhost-user: replace qemu/memfd.h usage, marcandre . lureau, 2020/11/25
- [PATCH v2 3/8] libvhost-user: remove qemu/compiler.h usage, marcandre . lureau, 2020/11/25
- [PATCH v2 4/8] libvhost-user: drop qemu/osdep.h dependency,
marcandre . lureau <=
- [PATCH v2 5/8] libvhost-user: make it a meson subproject, marcandre . lureau, 2020/11/25
- [PATCH v2 6/8] libvhost-user: check memfd API, marcandre . lureau, 2020/11/25
- [PATCH v2 7/8] libvhost-user: add a simple link test without glib, marcandre . lureau, 2020/11/25
- [PATCH v2 8/8] .gitlab-ci: add build-libvhost-user, marcandre . lureau, 2020/11/25