[PATCH 1/2] virNetDevOpenvswitchGetVhostuserIfname: Actually use @path to lookup interface

Michal Privoznik mprivozn at redhat.com
Wed Dec 16 18:45:37 UTC 2020


In v6.10.0-rc1~221 I wanted to make virNetDevOpenvswitchGetVhostuserIfname()
lookup interface name even for vhostuser interfaces with mode='server'. For
these, were 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 <mprivozn at redhat.com>
---
 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;
 
-- 
2.26.2




More information about the libvir-list mailing list