From 0dd029b7f2e7d9619ca6a22f43857aafb449c3a7 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 16 Dec 2020 18:52:48 +0100 Subject: [PATCH] virNetDevOpenvswitchGetVhostuserIfname: Actually use @path to lookup interface In v6.10.0-rc1~221 I wanted to make virNetDevOpenvswitchGetVhostuserIfname() lookup interface name even for vhostuser interfaces with mode='server'. For these, we are given a socket path which is then created by QEMU and to which OpenVSwitch connects to and creates an interface. Because of this, we don't know the name of the interface upfront (when starting QEMU) and have to use the path to query OpenVSwitch later (using ovs-vsctl). What I intended to use was: ovs-vsctl --no-headings --columns=name find Interface options:vhost-server-path=$path But what my code does is: ovs-vsctl --no-headings --columns=name find Interface options:vhost-server-path=path and it's all because the argument to the function is named "path" which I then enclosed in double quotes while it should have been used as a variable. Fixes: e4c29e2904197472919d050c67acfd59f0144bbc Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1767013 Signed-off-by: Michal Privoznik Reviewed-by: Laine Stump --- src/util/virnetdevopenvswitch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c index d380b0cf22..7eabaa763d 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -494,7 +494,7 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *path, if (server) { virCommandAddArgList(cmd, "--no-headings", "--columns=name", "find", "Interface", NULL); - virCommandAddArgPair(cmd, "options:vhost-server-path", "path"); + virCommandAddArgPair(cmd, "options:vhost-server-path", path); } else { const char *tmpIfname = NULL;