[PATCH] openvswitch: Check if OVS_VSCTL exists when getting interface name

Ján Tomko jtomko at redhat.com
Mon Jan 11 14:49:08 UTC 2021

On a Monday in 2021, Michal Privoznik wrote:
>So far we assumed that any vhostuser interface is plugged into an
>OVS bridge and thus 'ovs-vsctl' exists. But this is not always
>true. In testing scenarios it is possible to create a vhostuser
>interface with this tool dpdk-testpmd (part of dpdk RPM) which
>creates/connects to UNIX socket needed for vhostuser. Of course,
>since there is no OVS then there is no interface name in which
>case virNetDevOpenvswitchGetVhostuserIfname() should return 0.
>The rest of APIs that assume OVS are not 'fixed' because we still
>want them to fail (e.g. getting statistics, plugging interface
>into an OVS bridge, unplugging it from an OVS bridge, ...).
>The only API that is fixed is
>virNetDevOpenvswitchGetVhostuserIfname() because it is called
>explicitly when starting a guest (and callers are okay if no name
>was found).
>The other way to fix this bug seems to be to simply require
>'ovs-vsctl' on spec file level, but that is too heavy gun given
>that vhostuser is used by a small set of our users (assumption
>made on requirements for vhostuser). Also, this way would drag in
>yet another dependency for all users (even those who want minimal
>Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1913156
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> src/util/virnetdevopenvswitch.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)

Reviewed-by: Ján Tomko <jtomko at redhat.com>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210111/16814e17/attachment-0001.sig>

More information about the libvir-list mailing list