From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Marcel Apfelbaum" <marcel@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Yuanhan Liu" <yuanhan.liu@linux.intel.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
=?UTF-8?q?Marc-Andr=C3=A9=20Lureau?=
<marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PULL 3/9] vhost-user-test: fix crash with glib < 2.36
Date: Wed, 2 Dec 2015 22:35:28 +0200 [thread overview]
Message-ID: <1449088478-21099-4-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1449088478-21099-1-git-send-email-mst@redhat.com>
From: Marc-André Lureau <marcandre.lureau@redhat.com>
The prepare callback needs to be implemented with glib < 2.36,
quoting glib documentation:
"Since 2.36 this may be NULL, in which case the effect is as if the
function always returns FALSE with a timeout of -1."
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
tests/vhost-user-test.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 29205ed..29de739 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -506,11 +506,22 @@ test_migrate_source_check(GSource *source)
return FALSE;
}
+#if !GLIB_CHECK_VERSION(2,36,0)
+/* this callback is unnecessary with glib >2.36, the default
+ * prepare for the source does the same */
+static gboolean
+test_migrate_source_prepare(GSource *source, gint *timeout)
+{
+ *timeout = -1;
+ return FALSE;
+}
+#endif
+
GSourceFuncs test_migrate_source_funcs = {
- NULL,
- test_migrate_source_check,
- NULL,
- NULL
+#if !GLIB_CHECK_VERSION(2,36,0)
+ .prepare = test_migrate_source_prepare,
+#endif
+ .check = test_migrate_source_check,
};
static void test_migrate(void)
--
MST
next prev parent reply other threads:[~2015-12-02 20:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-02 20:35 [Qemu-devel] [PULL 0/9] virtio,vhost,mmap fixes for 2.5 Michael S. Tsirkin
2015-12-02 20:35 ` [Qemu-devel] [PULL 1/9] vhost-user-test: fix chardriver race Michael S. Tsirkin
2015-12-02 20:35 ` [Qemu-devel] [PULL 2/9] vhost-user-test: use unix port for migration Michael S. Tsirkin
2015-12-02 20:35 ` Michael S. Tsirkin [this message]
2015-12-02 20:35 ` [Qemu-devel] [PULL 4/9] vhost-user: verify that number of queues is non-zero Michael S. Tsirkin
2015-12-02 20:35 ` [Qemu-devel] [PULL 5/9] vhost: drop dead code Michael S. Tsirkin
2015-12-02 20:35 ` [Qemu-devel] [PULL 6/9] tests/vhost-user-bridge.c: fix fd leakage Michael S. Tsirkin
2015-12-02 20:35 ` [Qemu-devel] [PULL 7/9] virtio: handle non-virtio-1-capable backend for ccw Michael S. Tsirkin
2015-12-02 20:35 ` [Qemu-devel] [PULL 8/9] virtio-pci: Set the QEMU_PCI_CAP_EXPRESS capability early in its DeviceClass realize method Michael S. Tsirkin
2015-12-02 20:35 ` [Qemu-devel] [PULL 9/9] util/mmap-alloc: fix hugetlb support on ppc64 Michael S. Tsirkin
2015-12-02 20:39 ` [Qemu-devel] [PULL 0/9] virtio,vhost,mmap fixes for 2.5 Michael S. Tsirkin
2015-12-03 10:43 ` Peter Maydell
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=1449088478-21099-4-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=marcel@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=yuanhan.liu@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).