All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@6wind.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, cam@cs.ualberta.ca, kraxel@redhat.com,
	aliguori@amazon.com
Subject: [Qemu-devel] [PATCH v2] char: fix avail_connections init in qemu_chr_open_eventfd()
Date: Wed, 11 Jun 2014 17:25:16 +0200	[thread overview]
Message-ID: <1402500316-6894-1-git-send-email-david.marchand@6wind.com> (raw)
In-Reply-To: <53986E13.4090607@redhat.com>

When trying to use a ivshmem server with qemu, ivshmem init code tries to
create a CharDriverState object for each eventfd retrieved from the server.
To create this object, a call to qemu_chr_open_eventfd() is done.
Right after this, before adding a frontend, qemu_chr_fe_claim_no_fail() is
called.
qemu_chr_open_eventfd() does not set avail_connections to 1, so no frontend can
be associated because qemu_chr_fe_claim_no_fail() makes qemu stop right away.

This problem comes from 456d60692310e7ac25cf822cc1e98192ad636ece
"qemu-char: Call fe_claim / fe_release when not using qdev chr properties".

Fix this, by setting avail_connections to 1 in qemu_chr_open_eventfd().

Signed-off-by: David Marchand <david.marchand@6wind.com>
---
 qemu-char.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Changes since v1
- fix coding style issue (missing braces)


-- 
David Marchand

diff --git a/qemu-char.c b/qemu-char.c
index 17b476e..53eccc2 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2493,7 +2493,13 @@ static gboolean tcp_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque)
 #ifndef _WIN32
 CharDriverState *qemu_chr_open_eventfd(int eventfd)
 {
-    return qemu_chr_open_fd(eventfd, eventfd);
+    CharDriverState *chr = qemu_chr_open_fd(eventfd, eventfd);
+
+    if (chr) {
+        chr->avail_connections = 1;
+    }
+
+    return chr;
 }
 #endif
 
-- 
1.7.10.4

  reply	other threads:[~2014-06-11 15:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-04 21:17 [Qemu-devel] [PATCH RFC] char: fix avail_connections init in qemu_chr_open_eventfd() David Marchand
2014-02-13 14:47 ` David Marchand
2014-02-13 18:58 ` Cam Macdonell
2014-02-14 12:16   ` David Marchand
2014-02-17 11:52     ` David Marchand
2014-02-21 16:10       ` David Marchand
2014-03-27 15:20         ` David Marchand
2014-06-11 13:39 ` [Qemu-devel] [PATCH] " David Marchand
2014-06-11 14:56   ` Paolo Bonzini
2014-06-11 15:25     ` David Marchand [this message]
2014-06-12  9:10       ` [Qemu-devel] [PATCH v2] " Gerd Hoffmann

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=1402500316-6894-1-git-send-email-david.marchand@6wind.com \
    --to=david.marchand@6wind.com \
    --cc=aliguori@amazon.com \
    --cc=cam@cs.ualberta.ca \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.