From nobody Mon May 6 12:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605084273; cv=none; d=zohomail.com; s=zohoarc; b=h4+RnKa5KGFby+ifej5DfgzIzr1o4Z0Jfb9m99EB/NtVa3lIO7jvybxFYzMb7gHnucbX1dyCtyhikgNoCD5+NsNUwHLS9Uw6boQqjCk/zL0iDZYHtU0OXDP23naI4Xz2kOyxM1DWuWkq6K1R9iyfyFng8zhbJbGEjbxXFrHuyMs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605084273; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XLyCXJK9gaLnm9sw1bJrqyenPrE0B29TDyUCjpTSJds=; b=kJf8Fygwm8Swti9ZpS0KWyJBod5A4EMwFHtZoygj2C0Q4v60TCD7sL0IoShYKDHL1YBy/dx1EbEUWUPGsMtww6l3FbgYEzvjHyJJmt5nnWf+z3PaaJOCK799y6LU1wxDzl8xeF/DLqTrERUQ/xwqRFsJdv2ivmcdsIqELu+2XW4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1605084273608774.7281269878008; Wed, 11 Nov 2020 00:44:33 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-539-er6U-BsTP-OQv-EGb1cd6w-1; Wed, 11 Nov 2020 03:44:30 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 461C4802B73; Wed, 11 Nov 2020 08:44:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1281927BBF; Wed, 11 Nov 2020 08:44:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C980B9981; Wed, 11 Nov 2020 08:44:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AB8cXJS027169 for ; Wed, 11 Nov 2020 03:38:34 -0500 Received: by smtp.corp.redhat.com (Postfix) id ED09168431; Wed, 11 Nov 2020 08:38:33 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A5CA6115F for ; Wed, 11 Nov 2020 08:38:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605084272; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=XLyCXJK9gaLnm9sw1bJrqyenPrE0B29TDyUCjpTSJds=; b=Wuie0g2FUcuXlY6f0z6xH12YQFCZdKUQxgLfsXNN39GOxwyAs74SHCwVZxIxT6sOSXJkqi W2eO3CEHiV5Qa1Pbvhj1LpPUjUwNE2wqZ+101wFla329RK8r9sZIpCjLa+4cPnAKAeLYQb 6Cq6CPmuq6c99F6UcwgcrLwG0lQtlx8= X-MC-Unique: er6U-BsTP-OQv-EGb1cd6w-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/2] virnetdevopenvswitch: Get names for dpdkvhostuserclient too Date: Wed, 11 Nov 2020 09:38:26 +0100 Message-Id: <576ae366440e3943f05a1f9f8aa7cb2d71af6dae.1605083854.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There are two type of vhostuser ports: dpdkvhostuser - OVS creates the socket and QEMU connects to it dpdkvhostuserclient - QEMU creates the socket and OVS connects to it But of course ovs-vsctl syntax for fetching ifname is different. So far, we've implemented the former. The lack of implementation for the latter means that we are not detecting the interface name and thus not reporting it in domain XML, or failing to get interface statistics. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1767013 Signed-off-by: Michal Privoznik Reviewed-by: Daniel Henrique Barboza --- src/qemu/qemu_command.c | 1 + src/qemu/qemu_hotplug.c | 1 + src/util/virnetdevopenvswitch.c | 60 +++++++++++++++++++++++---------- src/util/virnetdevopenvswitch.h | 1 + tests/qemuxml2argvmock.c | 1 + 5 files changed, 46 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b0c2a5efb5..0e803145d1 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8004,6 +8004,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, goto cleanup; =20 if (virNetDevOpenvswitchGetVhostuserIfname(net->data.vhostuser->da= ta.nix.path, + net->data.vhostuser->da= ta.nix.listen, &net->ifname) < 0) goto cleanup; =20 diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 81bbe178a9..8c22075be1 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1305,6 +1305,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, goto cleanup; =20 if (virNetDevOpenvswitchGetVhostuserIfname(net->data.vhostuser->da= ta.nix.path, + net->data.vhostuser->da= ta.nix.listen, &net->ifname) < 0) goto cleanup; =20 diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitc= h.c index a7b6af594d..d809152f33 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -471,9 +471,20 @@ virNetDevOpenvswitchInterfaceGetMaster(const char *ifn= ame, char **master) /** * virNetDevOpenvswitchVhostuserGetIfname: * @path: the path of the unix socket + * @server: true if OVS creates the @path * @ifname: the retrieved name of the interface * - * Retrieves the ovs ifname from vhostuser unix socket path. + * Retrieves the OVS ifname from vhostuser UNIX socket path. + * There are two types of vhostuser ports which differ in client/server + * role: + * + * dpdkvhostuser - OVS creates the socket and QEMU connects to it + * (@server =3D true) + * dpdkvhostuserclient - QEMU creates the socket and OVS connects to it + * (@server =3D false) + * + * Since the way of retrieving ifname is different in these two cases, + * caller must set @server according to the interface definition. * * Returns: 1 if interface is an openvswitch interface, * 0 if it is not, but no other error occurred, @@ -481,33 +492,46 @@ virNetDevOpenvswitchInterfaceGetMaster(const char *if= name, char **master) */ int virNetDevOpenvswitchGetVhostuserIfname(const char *path, + bool server, char **ifname) { - const char *tmpIfname =3D NULL; + g_autoptr(virCommand) cmd =3D NULL; int status; - g_autoptr(virCommand) cmd =3D NULL; =20 - /* Openvswitch vhostuser path are hardcoded to - * //openvswitch/ - * for example: /var/run/openvswitch/dpdkvhostuser0 - * - * so we pick the filename and check it's a openvswitch interface - */ - if (!path || - !(tmpIfname =3D strrchr(path, '/'))) - return 0; - - tmpIfname++; cmd =3D virCommandNew(OVS_VSCTL); virNetDevOpenvswitchAddTimeout(cmd); - virCommandAddArgList(cmd, "get", "Interface", tmpIfname, "name", NULL); - if (virCommandRun(cmd, &status) < 0 || - status) { + + if (server) { + virCommandAddArgList(cmd, "--no-headings", "--columns=3Dname", "fi= nd", + "Interface", NULL); + virCommandAddArgPair(cmd, "options:vhost-server-path", "path"); + } else { + const char *tmpIfname =3D NULL; + + /* Openvswitch vhostuser path are hardcoded to + * //openvswitch/ + * for example: /var/run/openvswitch/dpdkvhostuser0 + * + * so we pick the filename and check it's a openvswitch interface + */ + if (!path || + !(tmpIfname =3D strrchr(path, '/'))) { + return 0; + } + + tmpIfname++; + virCommandAddArgList(cmd, "get", "Interface", tmpIfname, "name", N= ULL); + } + + virCommandSetOutputBuffer(cmd, ifname); + if (virCommandRun(cmd, &status) < 0) + return -1; + + if (status !=3D 0) { /* it's not a openvswitch vhostuser interface. */ return 0; } =20 - *ifname =3D g_strdup(tmpIfname); return 1; } =20 diff --git a/src/util/virnetdevopenvswitch.h b/src/util/virnetdevopenvswitc= h.h index c9ea592058..5cd1d22ae3 100644 --- a/src/util/virnetdevopenvswitch.h +++ b/src/util/virnetdevopenvswitch.h @@ -61,6 +61,7 @@ int virNetDevOpenvswitchInterfaceGetMaster(const char *if= name, char **master) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; =20 int virNetDevOpenvswitchGetVhostuserIfname(const char *path, + bool server, char **ifname) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT G_GNUC_NO_INLINE; =20 diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c index 2cdbe7e356..6900232b33 100644 --- a/tests/qemuxml2argvmock.c +++ b/tests/qemuxml2argvmock.c @@ -217,6 +217,7 @@ virCommandPassFD(virCommandPtr cmd, =20 int virNetDevOpenvswitchGetVhostuserIfname(const char *path G_GNUC_UNUSED, + bool server G_GNUC_UNUSED, char **ifname) { *ifname =3D g_strdup("vhost-user0"); --=20 2.26.2 From nobody Mon May 6 12:42:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605083942; cv=none; d=zohomail.com; s=zohoarc; b=nQo2EftVvT71UxsWI+NecAMumGJL9GZuhFTO1/6JgLlAH97twaymR8nAOWcOpIu8CuO5wZQ6w33pyw8Fqprz0Vh2/VF3EdjtLgNp59Lud0/WHRXw3AKeg7mdpQcmEQXwOpXCXP/DYYJiMUVxYtbDUKf4XkXv1vVFBqyQycpo9R8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605083942; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hx6XUbAvbHqFa7m2L3FD8fIhhodWX6H2j/J/pN1wbgM=; b=B/F9cJ5pFUHDUxZ+iv/VYUB8c6knGKmJLnrpEMuZZqzVF6NTxNE6gVHFHDjlkhlHlC9l45FU7HelppYfSMlvmaMg4osKM1UAv8gSTkiEpvO/PqkWMOphGdbLzvt0YNgQjmtcIvfmdfPVfei/BogbY5FMP+r/hxOLPwSudy0H2vg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1605083942582191.7083738017335; Wed, 11 Nov 2020 00:39:02 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-517-qpXqF9xUO8CXMGmQELr9hA-1; Wed, 11 Nov 2020 03:38:58 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A585879538; Wed, 11 Nov 2020 08:38:47 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7F6AC19C71; Wed, 11 Nov 2020 08:38:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 53FCE5810C; Wed, 11 Nov 2020 08:38:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AB8cZk6027180 for ; Wed, 11 Nov 2020 03:38:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2CFE76198C; Wed, 11 Nov 2020 08:38:35 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AF766115F for ; Wed, 11 Nov 2020 08:38:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605083940; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hx6XUbAvbHqFa7m2L3FD8fIhhodWX6H2j/J/pN1wbgM=; b=Cbr8rLiMlS5WpRzXxW/HJckgzDHhNDV+cC6EoDtSVGNlMTUYGpTlqjMr2sukuL6x3mFTB8 ZEvskXzXW9E0CVm56aAb1nfjAw93tHYIg9PMUPvImbHytxO4AQTCzXAVFyYFtw4iHrOgP5 i2Uo4JYQjoKib24ZIYwNE4k8HEisV6s= X-MC-Unique: qpXqF9xUO8CXMGmQELr9hA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/2] virnetdevopenvswitch: Simplify OVS_VSCTL cmd creation Date: Wed, 11 Nov 2020 09:38:27 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Every time we create new virCommand of OVS_VSCTL it must be followed by virNetDevOpenvswitchAddTimeout() call which adds the --timeout=3DX argument to freshly created cmd. Instead of having this as two separate function calls it can be just one. Signed-off-by: Michal Privoznik Reviewed-by: Daniel Henrique Barboza --- src/util/virnetdevopenvswitch.c | 36 +++++++++++---------------------- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitc= h.c index d809152f33..45554012ea 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -51,10 +51,12 @@ virNetDevOpenvswitchSetTimeout(unsigned int timeout) virNetDevOpenvswitchTimeout =3D timeout; } =20 -static void -virNetDevOpenvswitchAddTimeout(virCommandPtr cmd) +static virCommandPtr +virNetDevOpenvswitchCreateCmd(void) { + virCommandPtr cmd =3D virCommandNew(OVS_VSCTL); virCommandAddArgFormat(cmd, "--timeout=3D%u", virNetDevOpenvswitchTime= out); + return cmd; } =20 /** @@ -151,8 +153,7 @@ int virNetDevOpenvswitchAddPort(const char *brname, con= st char *ifname, ovsport->profileID); } =20 - cmd =3D virCommandNew(OVS_VSCTL); - virNetDevOpenvswitchAddTimeout(cmd); + cmd =3D virNetDevOpenvswitchCreateCmd(); virCommandAddArgList(cmd, "--", "--if-exists", "del-port", ifname, "--", "add-port", brname, ifname, NULL); =20 @@ -197,10 +198,8 @@ int virNetDevOpenvswitchAddPort(const char *brname, co= nst char *ifname, */ int virNetDevOpenvswitchRemovePort(const char *brname G_GNUC_UNUSED, const= char *ifname) { - g_autoptr(virCommand) cmd =3D NULL; + g_autoptr(virCommand) cmd =3D virNetDevOpenvswitchCreateCmd(); =20 - cmd =3D virCommandNew(OVS_VSCTL); - virNetDevOpenvswitchAddTimeout(cmd); virCommandAddArgList(cmd, "--", "--if-exists", "del-port", ifname, NUL= L); =20 if (virCommandRun(cmd, NULL) < 0) { @@ -224,10 +223,8 @@ int virNetDevOpenvswitchRemovePort(const char *brname = G_GNUC_UNUSED, const char int virNetDevOpenvswitchGetMigrateData(char **migrate, const char *ifname) { size_t len; - g_autoptr(virCommand) cmd =3D NULL; + g_autoptr(virCommand) cmd =3D virNetDevOpenvswitchCreateCmd(); =20 - cmd =3D virCommandNew(OVS_VSCTL); - virNetDevOpenvswitchAddTimeout(cmd); virCommandAddArgList(cmd, "--if-exists", "get", "Interface", ifname, "external_ids:PortData", NULL); =20 @@ -267,8 +264,7 @@ int virNetDevOpenvswitchSetMigrateData(char *migrate, c= onst char *ifname) return 0; } =20 - cmd =3D virCommandNew(OVS_VSCTL); - virNetDevOpenvswitchAddTimeout(cmd); + cmd =3D virNetDevOpenvswitchCreateCmd(); virCommandAddArgList(cmd, "set", "Interface", ifname, NULL); virCommandAddArgFormat(cmd, "external_ids:PortData=3D%s", migrate); =20 @@ -370,11 +366,9 @@ int virNetDevOpenvswitchInterfaceStats(const char *ifname, virDomainInterfaceStatsPtr stats) { - g_autoptr(virCommand) cmd =3D NULL; + g_autoptr(virCommand) cmd =3D virNetDevOpenvswitchCreateCmd(); g_autofree char *output =3D NULL; =20 - cmd =3D virCommandNew(OVS_VSCTL); - virNetDevOpenvswitchAddTimeout(cmd); virCommandAddArgList(cmd, "--if-exists", "--format=3Dlist", "--data=3D= json", "--no-headings", "--columns=3Dstatistics", "list", "Interface", ifname, NULL); @@ -434,13 +428,11 @@ virNetDevOpenvswitchInterfaceStats(const char *ifname, int virNetDevOpenvswitchInterfaceGetMaster(const char *ifname, char **master) { - virCommandPtr cmd =3D NULL; + virCommandPtr cmd =3D virNetDevOpenvswitchCreateCmd(); int exitstatus; =20 *master =3D NULL; =20 - cmd =3D virCommandNew(OVS_VSCTL); - virNetDevOpenvswitchAddTimeout(cmd); virCommandAddArgList(cmd, "iface-to-br", ifname, NULL); virCommandSetOutputBuffer(cmd, master); =20 @@ -495,11 +487,9 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *pat= h, bool server, char **ifname) { - g_autoptr(virCommand) cmd =3D NULL; + g_autoptr(virCommand) cmd =3D virNetDevOpenvswitchCreateCmd(); int status; =20 - cmd =3D virCommandNew(OVS_VSCTL); - virNetDevOpenvswitchAddTimeout(cmd); =20 if (server) { virCommandAddArgList(cmd, "--no-headings", "--columns=3Dname", "fi= nd", @@ -547,10 +537,8 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *pat= h, int virNetDevOpenvswitchUpdateVlan(const char *ifname, const virNetDevVlan *virtVlan) { - g_autoptr(virCommand) cmd =3D NULL; + g_autoptr(virCommand) cmd =3D virNetDevOpenvswitchCreateCmd(); =20 - cmd =3D virCommandNew(OVS_VSCTL); - virNetDevOpenvswitchAddTimeout(cmd); virCommandAddArgList(cmd, "--", "--if-exists", "clear", "Port", ifname, "ta= g", "--", "--if-exists", "clear", "Port", ifname, "tr= unk", --=20 2.26.2