[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 47/65] libvhost-user: drop qemu/osdep.h dependency
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 47/65] libvhost-user: drop qemu/osdep.h dependency |
Date: |
Wed, 9 Dec 2020 13:10:14 -0500 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20201125100640.366523-5-marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@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);
--
MST
- [PULL v2 36/65] failover: make sure that id always exist, (continued)
- [PULL v2 36/65] failover: make sure that id always exist, Michael S. Tsirkin, 2020/12/09
- [PULL v2 38/65] failover: split failover_find_primary_device_id(), Michael S. Tsirkin, 2020/12/09
- [PULL v2 39/65] failover: We don't need to cache primary_device_id anymore, Michael S. Tsirkin, 2020/12/09
- [PULL v2 40/65] failover: Caller of this two functions already have primary_dev, Michael S. Tsirkin, 2020/12/09
- [PULL v2 42/65] failover: Remove primary_dev member, Michael S. Tsirkin, 2020/12/09
- [PULL v2 41/65] failover: simplify failover_unplug_primary, Michael S. Tsirkin, 2020/12/09
- [PULL v2 43/65] hw: add compat machines for 6.0, Michael S. Tsirkin, 2020/12/09
- [PULL v2 44/65] libvhost-user: replace qemu/bswap.h with glibc endian.h, Michael S. Tsirkin, 2020/12/09
- [PULL v2 45/65] libvhost-user: replace qemu/memfd.h usage, Michael S. Tsirkin, 2020/12/09
- [PULL v2 46/65] libvhost-user: remove qemu/compiler.h usage, Michael S. Tsirkin, 2020/12/09
- [PULL v2 47/65] libvhost-user: drop qemu/osdep.h dependency,
Michael S. Tsirkin <=
- [PULL v2 48/65] libvhost-user: make it a meson subproject, Michael S. Tsirkin, 2020/12/09
- [PULL v2 49/65] libvhost-user: add a simple link test without glib, Michael S. Tsirkin, 2020/12/09
- [PULL v2 51/65] contrib/vhost-user-blk: avoid g_return_val_if() input validation, Michael S. Tsirkin, 2020/12/09
- [PULL v2 50/65] .gitlab-ci: add build-libvhost-user, Michael S. Tsirkin, 2020/12/09
- [PULL v2 52/65] contrib/vhost-user-gpu: avoid g_return_val_if() input validation, Michael S. Tsirkin, 2020/12/09
- [PULL v2 53/65] contrib/vhost-user-input: avoid g_return_val_if() input validation, Michael S. Tsirkin, 2020/12/09
- [PULL v2 55/65] hw/i386/pc: add max combined fw size as machine configuration option, Michael S. Tsirkin, 2020/12/09