On Fri, Sep 08, 2017 at 05:12:09PM +0800, ZhiPeng Lu wrote:
For vhost-user ports, Open vSwitch acts as the server and QEMU the
client.
When OVS crashed or restart, QEMU shoule be reconnect to OVS.
Signed-off-by: ZhiPeng Lu <lu.zhipeng(a)zte.com.cn>
---
docs/formatdomain.html.in | 6 +++--
docs/schemas/domaincommon.rng | 5 ++++
src/conf/domain_conf.c | 28 ++++++++++++++++++++--
.../qemuxml2argv-net-vhostuser-multiq.args | 2 +-
.../qemuxml2argv-net-vhostuser-multiq.xml | 2 +-
5 files changed, 37 insertions(+), 6 deletions(-)
I sent a revert for this patch since it's not completely correct.
This is the XML format that I'm proposing and it will be the same as for
chardev devices:
<interface type='vhostuser'>
<mac address='52:54:00:3b:83:1b'/>
<source type='unix' path='/tmp/vhost2.sock'
mode='client'>
<reconnect enabled='yes' timeout='10'/>
</source>
<model type='virtio'/>
<driver queues='5'/>
</interface>
The reason for that format is that it's generic and will work with other
hypervisors if they decide to introduce the same feature. Another thing
is that adding "reconnect=0" on QEMU command line disables the reconnect
feature and it's better to expose it as <reconnect enabled='no'/>.
The <reconnect> element should be parsed only if the interface type is
"vhostuser" and only if the source type is "unix" since that's the
only
type currently supported for "vhostuser" interface.
Check out this commit 9aa72a6dd5b3bd7a7139427dfa315cd36f7b4f0b, there
are virDomainChrSourceReconnectDefParseXML() and
virDomainChrSourceReconnectDefFormat() functions that should be used
for the "vhostuser" interface.
Pavel