s->path = g_strdup(qemu_opt_get(opts, "path"));
s->host = g_strdup(qemu_opt_get(opts, "host"));
+ s->port = g_strdup(qemu_opt_get(opts, "port"));
if (!s->path == !s->host) {
if (s->path) {
}
return NULL;
}
+ if (s->port && !s->host) {
+ error_setg(errp, "port may not be used without host");
+ return NULL;
+ }
saddr = g_new0(SocketAddress, 1);
} else {
InetSocketAddress *inet;
- s->port = g_strdup(qemu_opt_get(opts, "port"));
-
saddr->type = SOCKET_ADDRESS_KIND_INET;
inet = saddr->u.inet.data = g_new0(InetSocketAddress, 1);
inet->host = g_strdup(s->host);