Skip to content

Commit

Permalink
char: fix avail_connections init in qemu_chr_open_eventfd()
Browse files Browse the repository at this point in the history
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 456d606
"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>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
  • Loading branch information
David Marchand authored and kraxel committed Jun 13, 2014
1 parent 2a2c483 commit e9d21c4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion qemu-char.c
Expand Up @@ -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

Expand Down

0 comments on commit e9d21c4

Please sign in to comment.