@@ -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;