]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virNetDevOpenvswitchGetVhostuserIfname: Actually use @path to lookup interface
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 16 Dec 2020 17:52:48 +0000 (18:52 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 17 Dec 2020 08:25:36 +0000 (09:25 +0100)
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 <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
src/util/virnetdevopenvswitch.c

index d380b0cf22d0261583cdc73694b646174388d4d0..7eabaa763dc788de6c8790d3cd50bdb4db8327a6 100644 (file)
@@ -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;