mirror of https://gitee.com/openkylin/qemu.git
net/slirp: simplify checking for cmd: prefix
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This commit is contained in:
parent
44b4ff2488
commit
3624730a32
|
@ -773,7 +773,7 @@ static int slirp_guestfwd(SlirpState *s, const char *config_str, Error **errp)
|
|||
|
||||
snprintf(buf, sizeof(buf), "guestfwd.tcp.%d", port);
|
||||
|
||||
if ((strlen(p) > 4) && !strncmp(p, "cmd:", 4)) {
|
||||
if (g_str_has_prefix(p, "cmd:")) {
|
||||
if (slirp_add_exec(s->slirp, &p[4], &server, port) < 0) {
|
||||
error_setg(errp, "Conflicting/invalid host:port in guest "
|
||||
"forwarding rule '%s'", config_str);
|
||||
|
|
Loading…
Reference in New Issue