From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] chardev: vhost-user: reconnect issue when QEMU as server
Date: Wed, 9 Mar 2016 21:29:06 +0800 [thread overview]
Message-ID: <20160309132906.GA2836@yliu-dev.sh.intel.com> (raw)
Hi,
Currently, the typical usage of vhost-user is QEMU as the client, while
the backend (say DPDK vhost-user) be the server. There is a major drawback:
the restart of the backend (say, upgrade) needs restart the QEMU.
The obvious solution would be let QEMU be the server and the backend
be the client. I did a quick try before, and it would work as expected,
if it's the first time the client tries to connect the server. However,
it would not, if it's the second (or later) times, say a client restart.
Per my understanding so far, there are two factors caused such issue:
1) QEMU socket char dev is designed as one server accepts one
client only. A server will not accept another client unless
there is no connection established, or the connection is
disconnected.
2) For vhost-user case, QEMU serves as the initiator, that sends
vhost-user messages on his own. In another word, QEMU will
not poll the socket fd, unlike DPDK vhost-user. That is to say
QEMU has no idea to know when the connection is disconnected.
According to 1), QEMU will not be able to accept the second
connect from DPDK, when DPDK vhost restarts.
In summary, we need figure out a way to detect the disconnect at QEMU.
I came up with a solution that might work: we poll the socket fd, and
peek (instead of read) the data. Peek would fail if a connection is
disconnected. I had a quick hack, unluckily, it didn't work as expected.
I'm thinking I might have missed something.
I could spend more time to dig it. But before that, I want to know
how you guys think about it? Does that proposal makes sense to you?
Or, any better ideas?
Thanks.
--yliu
next reply other threads:[~2016-03-09 13:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-09 13:29 Yuanhan Liu [this message]
2016-03-09 15:04 ` [Qemu-devel] chardev: vhost-user: reconnect issue when QEMU as server Marc-André Lureau
2016-03-10 5:58 ` Yuanhan Liu
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=20160309132906.GA2836@yliu-dev.sh.intel.com \
--to=yuanhan.liu@linux.intel.com \
--cc=mst@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 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).