From nobody Sat Feb 7 17:48:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1642437663; cv=none; d=zohomail.com; s=zohoarc; b=JpFiZwQ3W/Tc6hgsW5pm0zErjx/Kc0gRtVlN7Wb6bEEWQ/6TJHDFbJg2m5sCAwIO4tPvRo1SJRmR9ob6+D1ngxMeoqwtuW9AUCwmeeNfB5tN13Gpr2eNvQhv5tvnfuxhHlPb8+tJ9LuXC1UAuGTls5rrgk1rGmMv93beQQ2/w40= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642437663; 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=fF/XZacGkwPWX4BLk/NmxXebonvalxUq2HF20Ph9shE=; b=GT+KDlaPGesNp4N1pzhmabNhAMeYCPgRzaruLmEMDfDwtn6NTTHppJk48TlQBwA8MnFixDfJmrUnIEgB9C6QTN42EQhMoapQT8zLcy2p1bJGlixGLBH06Z2TuHAm/7V+cs8Qfomet63tQFTfVvpcqq9S9Xf1ojAOrarSBf6vikQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1642437663578458.17870013591426; Mon, 17 Jan 2022 08:41:03 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-173-ZgrA5POeNjOSWJ1dlouU7Q-1; Mon, 17 Jan 2022 11:41:00 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 72A82190A7D1; Mon, 17 Jan 2022 16:40:55 +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 076934DC02; Mon, 17 Jan 2022 16:40:55 +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 C7CD44A706; Mon, 17 Jan 2022 16:40:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20HGentV006725 for ; Mon, 17 Jan 2022 11:40:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id E5F0F10A48CB; Mon, 17 Jan 2022 16:40:49 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 708B710A48CA for ; Mon, 17 Jan 2022 16:40:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642437662; 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=fF/XZacGkwPWX4BLk/NmxXebonvalxUq2HF20Ph9shE=; b=SxBph9T9PhFdIwmNA76J/0u4zpF5O/ngMnqkY2lNaCRm25ou0rSgUaiJf6GIQisdYnToqr XYLunjzp8E9DdxO6U9yRV7wC43unVSOwrwcHwgThI8XvAStwnfjxKgN8OIJvD5XoqusqcG SPd2ff1no4+IoYaIk1vWWPkm06KCgeA= X-MC-Unique: ZgrA5POeNjOSWJ1dlouU7Q-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 6/6] util: openvswitch: do not reuse cmd in InterfaceClearTxQos Date: Mon, 17 Jan 2022 17:40:24 +0100 Message-Id: <7e6f5feef8e43ee2faceda2c0ea707e228f7eb7e.1642437534.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.79 on 10.5.11.15 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642437664082100001 Signed-off-by: J=C3=A1n Tomko --- src/util/virnetdevopenvswitch.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitc= h.c index a5180e5843..bcdb7c4180 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -643,7 +643,6 @@ virNetDevOpenvswitchInterfaceClearTxQos(const char *ifn= ame, { int ret =3D 0; char vmuuidstr[VIR_UUID_STRING_BUFLEN]; - g_autoptr(virCommand) cmd =3D NULL; g_autofree char *ifname_ex_id =3D NULL; g_autofree char *vmid_ex_id =3D NULL; g_autofree char *qos_uuid =3D NULL; @@ -666,29 +665,29 @@ virNetDevOpenvswitchInterfaceClearTxQos(const char *i= fname, /* destroy qos */ for (i =3D 0; lines[i] !=3D NULL; i++) { const char *line =3D lines[i]; + g_autoptr(virCommand) listcmd =3D NULL; + g_autoptr(virCommand) destroycmd =3D NULL; + if (!*line) { continue; } - virCommandFree(cmd); - cmd =3D virNetDevOpenvswitchCreateCmd(); - virCommandAddArgList(cmd, "--no-heading", "--columns=3D_uuid",= "--if-exists", + listcmd =3D virNetDevOpenvswitchCreateCmd(); + virCommandAddArgList(listcmd, "--no-heading", "--columns=3D_uu= id", "--if-exists", "list", "port", ifname, "qos", NULL); - virCommandSetOutputBuffer(cmd, &port_qos); - if (virCommandRun(cmd, NULL) < 0) { + virCommandSetOutputBuffer(listcmd, &port_qos); + if (virCommandRun(listcmd, NULL) < 0) { VIR_WARN("Unable to remove port qos on port %s", ifname); } if (port_qos && *port_qos) { - virCommandFree(cmd); - cmd =3D virNetDevOpenvswitchCreateCmd(); + g_autoptr(virCommand) cmd =3D virNetDevOpenvswitchCreateCm= d(); virCommandAddArgList(cmd, "remove", "port", ifname, "qos",= line, NULL); if (virCommandRun(cmd, NULL) < 0) { VIR_WARN("Unable to remove port qos on port %s", ifnam= e); } } - virCommandFree(cmd); - cmd =3D virNetDevOpenvswitchCreateCmd(); - virCommandAddArgList(cmd, "destroy", "qos", line, NULL); - if (virCommandRun(cmd, NULL) < 0) { + destroycmd =3D virNetDevOpenvswitchCreateCmd(); + virCommandAddArgList(destroycmd, "destroy", "qos", line, NULL); + if (virCommandRun(destroycmd, NULL) < 0) { VIR_WARN("Unable to destroy qos on port %s", ifname); ret =3D -1; } @@ -699,11 +698,12 @@ virNetDevOpenvswitchInterfaceClearTxQos(const char *i= fname, g_auto(GStrv) lines =3D g_strsplit(queue_uuid, "\n", 0); =20 for (i =3D 0; lines[i] !=3D NULL; i++) { + g_autoptr(virCommand) cmd =3D NULL; const char *line =3D lines[i]; if (!*line) { continue; } - virCommandFree(cmd); + cmd =3D virNetDevOpenvswitchCreateCmd(); virCommandAddArgList(cmd, "destroy", "queue", line, NULL); if (virCommandRun(cmd, NULL) < 0) { --=20 2.31.1