[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/18] vhost-user: check reconnect comes with wait
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH 05/18] vhost-user: check reconnect comes with wait |
Date: |
Fri, 1 Apr 2016 13:16:15 +0200 |
From: Marc-André Lureau <address@hidden>
If the client socket has the 'reconnect' option, make sure the 'wait'
option is also used. That way, an initial connection will be ensured
before the VM start and the virtio device is configured.
Signed-off-by: Marc-André Lureau <address@hidden>
---
net/vhost-user.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/net/vhost-user.c b/net/vhost-user.c
index 1b9e73a..9007d0b 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -27,6 +27,8 @@ typedef struct VhostUserState {
typedef struct VhostUserChardevProps {
bool is_socket;
bool is_unix;
+ bool is_reconnect;
+ bool is_wait;
} VhostUserChardevProps;
VHostNetState *vhost_user_get_vhost_net(NetClientState *nc)
@@ -239,6 +241,10 @@ static int net_vhost_chardev_opts(void *opaque,
} else if (strcmp(name, "path") == 0) {
props->is_unix = true;
} else if (strcmp(name, "server") == 0) {
+ } else if (strcmp(name, "reconnect") == 0) {
+ props->is_reconnect = true;
+ } else if (strcmp(name, "wait") == 0) {
+ props->is_wait = true;
} else {
error_setg(errp,
"vhost-user does not support a chardev with option %s=%s",
@@ -271,6 +277,12 @@ static CharDriverState *net_vhost_parse_chardev(
return NULL;
}
+ if (props.is_reconnect && !props.is_wait) {
+ error_setg(errp, "chardev \"%s\" must also 'wait' with 'reconnect'",
+ opts->chardev);
+ return NULL;
+ }
+
qemu_chr_fe_claim_no_fail(chr);
return chr;
--
2.5.5
- [Qemu-devel] [PATCH 00/18] RFCv2: vhost-user: shutdown and reconnection, marcandre . lureau, 2016/04/01
- [Qemu-devel] [PATCH 01/18] tests: append i386 tests, marcandre . lureau, 2016/04/01
- [Qemu-devel] [PATCH 02/18] char: lower reconnect error to trace event, marcandre . lureau, 2016/04/01
- [Qemu-devel] [PATCH 03/18] char: use a trace for when the char is waiting, marcandre . lureau, 2016/04/01
- [Qemu-devel] [PATCH 04/18] char: add wait support for reconnect, marcandre . lureau, 2016/04/01
- [Qemu-devel] [PATCH 05/18] vhost-user: check reconnect comes with wait,
marcandre . lureau <=
- [Qemu-devel] [PATCH 07/18] vhost: add vhost_dev stop callback, marcandre . lureau, 2016/04/01
- [Qemu-devel] [PATCH 08/18] vhost-user: add vhost_user to hold the chr, marcandre . lureau, 2016/04/01
- [Qemu-devel] [PATCH 06/18] vhost-user: add ability to know vhost-user backend disconnection, marcandre . lureau, 2016/04/01
- [Qemu-devel] [PATCH 09/18] qemu-char: add qemu_chr_disconnect to close a fd accepted by listen fd, marcandre . lureau, 2016/04/01
- [Qemu-devel] [PATCH 10/18] vhost-user: add slave-fd support, marcandre . lureau, 2016/04/01
- [Qemu-devel] [PATCH 11/18] vhost-user: add shutdown support, marcandre . lureau, 2016/04/01