All of lore.kernel.org
 help / color / mirror / Atom feed
From: marcandre.lureau@redhat.com
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: [PATCH v2 4/8] libvhost-user: drop qemu/osdep.h dependency
Date: Wed, 25 Nov 2020 14:06:36 +0400	[thread overview]
Message-ID: <20201125100640.366523-5-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20201125100640.366523-1-marcandre.lureau@redhat.com>

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



  parent reply	other threads:[~2020-11-25 10:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25 10:06 [PATCH v2 0/8] libvhost-user: make it a subproject (was: "lower dependency on QEMU headers") marcandre.lureau
2020-11-25 10:06 ` [PATCH v2 1/8] libvhost-user: replace qemu/bswap.h with glibc endian.h marcandre.lureau
2020-12-02 14:20   ` Stefan Hajnoczi
2020-11-25 10:06 ` [PATCH v2 2/8] libvhost-user: replace qemu/memfd.h usage marcandre.lureau
2020-12-02 14:20   ` Stefan Hajnoczi
2020-11-25 10:06 ` [PATCH v2 3/8] libvhost-user: remove qemu/compiler.h usage marcandre.lureau
2020-12-02 14:20   ` Stefan Hajnoczi
2020-11-25 10:06 ` marcandre.lureau [this message]
2020-12-02 14:20   ` [PATCH v2 4/8] libvhost-user: drop qemu/osdep.h dependency Stefan Hajnoczi
2020-11-25 10:06 ` [PATCH v2 5/8] libvhost-user: make it a meson subproject marcandre.lureau
2020-12-02 14:25   ` Stefan Hajnoczi
2020-11-25 10:06 ` [PATCH v2 6/8] libvhost-user: check memfd API marcandre.lureau
2020-12-02 14:27   ` Stefan Hajnoczi
2020-12-09 18:08     ` Michael S. Tsirkin
2020-11-25 10:06 ` [PATCH v2 7/8] libvhost-user: add a simple link test without glib marcandre.lureau
2020-12-02 14:28   ` Stefan Hajnoczi
2020-11-25 10:06 ` [PATCH v2 8/8] .gitlab-ci: add build-libvhost-user marcandre.lureau
2020-12-02 14:28   ` Stefan Hajnoczi
2020-12-02 14:49   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201125100640.366523-5-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.