From nobody Sun May 5 17:37:56 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=1629465425; cv=none; d=zohomail.com; s=zohoarc; b=ESouwD3mEeNqH7z9m8L6DOHz2EKstisEZmeIGmRwSJJuZKQWbRmw+cimCp/10Xi9ROU6UFpf3sDo1czKcIbW2HBTX/KCNxtkTAdIKmIScp4rSGMjKtRhpH/PtOhLAvDh6FwX/u4bx3nCdeT81jPZG8TTQOhL124CYAH7/ekve34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629465425; 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=bk2422JEITZ4QaghkzNUioaBXaseDTGXwzQiw7TnV2c=; b=NKPYeHCLgdchkWuVEqZBvWvqaQ9y2xfdA/5xo8xubLbminMrtsmcw8B0ZqPtKoKWFHCylfsVzioLZD1Z1OJmUtYh0SSYtqLM8FJbYF6ptVKJR30VgVXDssZGj9PeyqE3PtYXcxNmFvvqYT0/3ljOMEpGCZ83A94krVynPf2qju0= 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) 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 1629465425833270.9324879051703; Fri, 20 Aug 2021 06:17:05 -0700 (PDT) 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-523-NZ2KImo6N9aOJ4Fg61xaXw-1; Fri, 20 Aug 2021 09:17:03 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A0686DF8A5; Fri, 20 Aug 2021 13:16:54 +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 7CFCF369A; Fri, 20 Aug 2021 13:16:54 +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 26A384A7C9; Fri, 20 Aug 2021 13:16: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 17KDFfJt016600 for ; Fri, 20 Aug 2021 09:15:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4EBF810013C1; Fri, 20 Aug 2021 13:15:41 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBDE01017CE6 for ; Fri, 20 Aug 2021 13:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629465424; 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=bk2422JEITZ4QaghkzNUioaBXaseDTGXwzQiw7TnV2c=; b=HHgMjbgBLJ/YeoPlPX3yLuXh1PY0/qhFW6gm0R33KAp/GzH8Ccc3J8Sg7QRfQWSfe6JpeI Iw4atRHvpbJjkM0GkotsAuorf/ftgRT5S/vG4vHn8IlwrWNHRvXfVk4yKudjD9gzv1rX0n azYg1Sl1mhSJfMcLxoWoD5UPfdk/kAs= X-MC-Unique: NZ2KImo6N9aOJ4Fg61xaXw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/5] build: only build virnetdevopenvswitchtest on Linux Date: Fri, 20 Aug 2021 15:15:28 +0200 Message-Id: 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.11 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: 1629465427248100001 Now that it uses virnetdevbandwidthmock which we only build on Linux. Fixes: eb55e8a897a8c9d68664daa213b1a76b0cb3c05d Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- tests/meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/meson.build b/tests/meson.build index 3c73cbe3b5..dfbc2c01e2 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -350,6 +350,11 @@ if host_machine.system() =3D=3D 'linux' { 'name': 'virscsitest' }, { 'name': 'virusbtest' }, ] + if conf.has('WITH_YAJL') + tests +=3D [ + { 'name': 'virnetdevopenvswitchtest' }, + ] + endif endif =20 if conf.has('WITH_BHYVE') @@ -543,7 +548,6 @@ if conf.has('WITH_YAJL') tests +=3D [ { 'name': 'virjsontest' }, { 'name': 'virmacmaptest' }, - { 'name': 'virnetdevopenvswitchtest' }, ] endif =20 --=20 2.31.1 From nobody Sun May 5 17:37:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1629465563; cv=none; d=zohomail.com; s=zohoarc; b=JUPxow5KqKoVRAC+RAZE3tATBTuHTApas8nxQNEHbkRZhQmQ4Yvr5egGpV/680JiIk1cggQrDP0YKcECQasZ+gxB9B4gZVw/OQsI9L2QmTdN/8b6Speewqwyuz2YPW7tuTuJYsP5OA91ZLpFKjyAcNgW7ET7Q4p9AglN2BCQqm0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629465563; 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=GVj8XlffxDCofsNpjDeHqF87fwM/FdW8j2l52c3nQ0c=; b=Mbma8muEZrSkWoa9l3bV12/VmmZAyWjmjVWJtduvQVK8vVSGeM2tWOOA3ThfiU+EFTIPUAddO8d6S1jjIm86jydHWSWhxAEVP/20UMW2edA41SQJZLfMi3ins8iLKbIDQ+m5emj9aI89TnqFjOqSi/gJTn2hKSDD8uXFM7abKK0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 16294655639132.4910939527710525; Fri, 20 Aug 2021 06:19:23 -0700 (PDT) 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-576--qo13EuNO6iE9W4TkpS7nw-1; Fri, 20 Aug 2021 09:19:20 -0400 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 A1163192AB8C; Fri, 20 Aug 2021 13:19:15 +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 7BB091A26A; Fri, 20 Aug 2021 13:19:15 +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 1A3F34A7C8; Fri, 20 Aug 2021 13:19:15 +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 17KDFgi4016610 for ; Fri, 20 Aug 2021 09:15:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1FED31002D71; Fri, 20 Aug 2021 13:15:42 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C68310013C1 for ; Fri, 20 Aug 2021 13:15:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629465562; 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=GVj8XlffxDCofsNpjDeHqF87fwM/FdW8j2l52c3nQ0c=; b=EaLq3nKzFIHtzGWmTVGHhjganw6kxbFV9Pp8Mf66k4YPCCjZUQ5fLto4B87XXl5YDdq6My DyKdg5RmzwNWyqD2mIlyka1mjrZ4U/t5tRWm6h4q7qpq+NI+1Imm9oR74YwmwA5WxYYkeb KHpwNwMb0QBns11sWSsgAZZTGAUX/cw= X-MC-Unique: -qo13EuNO6iE9W4TkpS7nw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/5] tests: virnetdevopenvswitch: use g_auto Date: Fri, 20 Aug 2021 15:15:29 +0200 Message-Id: <1da90da86214ff62ecf6d0c482568aa168a9d1bc.1629465240.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.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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629465565970100001 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- tests/virnetdevopenvswitchtest.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/virnetdevopenvswitchtest.c b/tests/virnetdevopenvswitcht= est.c index 8c5034a5c6..89ffc1e4b5 100644 --- a/tests/virnetdevopenvswitchtest.c +++ b/tests/virnetdevopenvswitchtest.c @@ -48,8 +48,8 @@ struct testClearQosStruct { #define PARSE(xml, var) \ do { \ int rc; \ - xmlDocPtr doc; \ - xmlXPathContextPtr ctxt =3D NULL; \ + g_autoptr(xmlDoc) doc =3D NULL; \ + g_autoptr(xmlXPathContext) ctxt =3D NULL; \ \ if (!xml) \ break; \ @@ -63,8 +63,6 @@ struct testClearQosStruct { NULL, \ ctxt->node, \ true); \ - xmlFreeDoc(doc); \ - xmlXPathFreeContext(ctxt); \ if (rc < 0) \ goto cleanup; \ } while (0) @@ -160,7 +158,7 @@ testVirNetDevOpenvswitchInterfaceSetQos(const void *dat= a) const char *iface =3D info->iface; g_autoptr(virNetDevBandwidth) band =3D NULL; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - char *actual_cmd =3D NULL; + g_autofree char *actual_cmd =3D NULL; g_autoptr(virCommandDryRunToken) dryRunToken =3D virCommandDryRunToken= New(); =20 PARSE(info->band, band); @@ -187,7 +185,6 @@ testVirNetDevOpenvswitchInterfaceSetQos(const void *dat= a) =20 ret =3D 0; cleanup: - VIR_FREE(actual_cmd); return ret; } =20 @@ -198,7 +195,7 @@ testVirNetDevOpenvswitchInterfaceClearQos(const void *d= ata) int ret =3D -1; const struct testClearQosStruct *info =3D data; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - char *actual_cmd =3D NULL; + g_autofree char *actual_cmd =3D NULL; const char *iface =3D info->iface; const unsigned char *vmid =3D info->vmid; g_autoptr(virCommandDryRunToken) dryRunToken =3D virCommandDryRunToken= New(); @@ -222,7 +219,6 @@ testVirNetDevOpenvswitchInterfaceClearQos(const void *d= ata) =20 ret =3D 0; cleanup: - VIR_FREE(actual_cmd); return ret; } =20 --=20 2.31.1 From nobody Sun May 5 17:37:56 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=1629465429; cv=none; d=zohomail.com; s=zohoarc; b=JvnqtTezB+DcnAvKxO5y6E6DunAlwzfCO549ammxkmm2WrHzE7/JnmYt1h//V5WDg0zuqu6f/A7eITbe4kQ7dSq2VJ/ep9Yo3GBr+gqq+3moyCYwl0DBwr4NMQRw+r8DTEQ7FAcDEmNscYK5oHimqMuoEgaGMcVH66+s83SegFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629465429; 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=GSumpVkgny4yxFIlC7nDuKK0Z88HJ3Ekq15WH5a+UIs=; b=THy7uPY2VRRk33wcvByi5Ig8iqKEQEb/cyC92QDmL+7vHfi/iOBhgqFYZJVU0Zg07kLDXdFO6wL+KtslSajlAjCXsK/abnBo4r7egWuc3pvCmy0559hsYbxVFYyaC6WpWSqAc3DS7bePhdo1n1YDfpQgZvTPD8xtA7ja/u6fT2Y= 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) 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 1629465429364534.5310317432976; Fri, 20 Aug 2021 06:17:09 -0700 (PDT) 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-339-3MJfoj2kNMmngP9W6rgrUQ-1; Fri, 20 Aug 2021 09:17:05 -0400 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 F107D1015EA6; Fri, 20 Aug 2021 13:16:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C06A6A8F7; Fri, 20 Aug 2021 13:16:59 +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 03B44181A0F7; Fri, 20 Aug 2021 13:16:59 +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 17KDFgx5016615 for ; Fri, 20 Aug 2021 09:15:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id E5F7C10013C1; Fri, 20 Aug 2021 13:15:42 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C5701017CE6 for ; Fri, 20 Aug 2021 13:15:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629465428; 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=GSumpVkgny4yxFIlC7nDuKK0Z88HJ3Ekq15WH5a+UIs=; b=UQM1WDPYScpiltGvqMeuQsA22Crtg91uRi+vRGRlfQqjqDfLvoA+KB0CyYoKgZm5DlC7VA H31i/ck2GNLL28zOzW9EfNK5V1uZoVo+UqMxbc0UJycxL+hF/8cMuz3Bd5YgQFTb0zv2q9 Te5XioX1X3rdpPvK+KFOXJoe7MQGywA= X-MC-Unique: 3MJfoj2kNMmngP9W6rgrUQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/5] tests: virnetdevbandwidthtest: use g_auto Date: Fri, 20 Aug 2021 15:15:30 +0200 Message-Id: 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: 1629465431472100001 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- tests/virnetdevbandwidthtest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c index 83e7b2089f..197d936479 100644 --- a/tests/virnetdevbandwidthtest.c +++ b/tests/virnetdevbandwidthtest.c @@ -69,7 +69,7 @@ testVirNetDevBandwidthSet(const void *data) const char *iface =3D info->iface; g_autoptr(virNetDevBandwidth) band =3D NULL; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - char *actual_cmd =3D NULL; + g_autofree char *actual_cmd =3D NULL; g_autoptr(virCommandDryRunToken) dryRunToken =3D virCommandDryRunToken= New(); =20 PARSE(info->band, band); @@ -96,7 +96,6 @@ testVirNetDevBandwidthSet(const void *data) =20 ret =3D 0; cleanup: - VIR_FREE(actual_cmd); return ret; } =20 --=20 2.31.1 From nobody Sun May 5 17:37:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1629465494; cv=none; d=zohomail.com; s=zohoarc; b=XX6LkNN0dS400vkHt2RRHe5rFVEUv7Nk+TXgVb+je3xZf4n5Cw9Rv8jvCbJlv7qyKw0CtgrvvRS06v9cW7iSjodS3qYJlpiKA15lHJXJZAPFWHRrg1FDogZev6apCB79gk6Tj3r0deu1UDDiR1Li5svAhzUpT0jf/f/sVcM0Euw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629465494; 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=nJUwr7pl3JMFNcOhb+lPY7zHBhwuPZVEhX6ZuOCK370=; b=MyTeP/toAC5m8yfGq0RRdvG5WDxAepWw2xQJUaQuPk8bAOeecLrK2gTazrrA8BOTjuf6spxKHHQOd9ecfWj6bzI3LA1Y09hZ+Eg94AmvxPzEC/YQJSwUmgJ3v7LiQvcsvu16zR9wcPPRq18imKFbTOl5sMcu3pd5lYa4TeT0E0M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1629465494944182.3331907850852; Fri, 20 Aug 2021 06:18:14 -0700 (PDT) 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-390-vBQ0buFXMryYLRtX6GcLGw-1; Fri, 20 Aug 2021 09:18:12 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C3CAA1026203; Fri, 20 Aug 2021 13:18:06 +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 A28A95DD68; Fri, 20 Aug 2021 13:18:06 +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 62F244A7CA; Fri, 20 Aug 2021 13:18:06 +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 17KDFh5V016625 for ; Fri, 20 Aug 2021 09:15:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id B519A1002D71; Fri, 20 Aug 2021 13:15:43 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CD0C10013C1 for ; Fri, 20 Aug 2021 13:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629465493; 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=nJUwr7pl3JMFNcOhb+lPY7zHBhwuPZVEhX6ZuOCK370=; b=CMPN2Q3L4rHdnKS1P+i4Zo5N2njEWa74HHm8Id/Bkis0WLZ+vi8mYFDnGRMeBjx17KlPKl hjQJHA6MEpZ4DRcEW9+4wkw0y4g+YxYR/DbH4JsARanzW/O5kNEM3BtckE7HFbi+frGAsg D4UNd20dwIJUpPISbg6J7AtkY0KGymc= X-MC-Unique: vBQ0buFXMryYLRtX6GcLGw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/5] tests: introduce testVirNetDevBandwidthParse Date: Fri, 20 Aug 2021 15:15:31 +0200 Message-Id: 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.14 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: 1629465495364100001 The 'PARSE' macro does not use '#' or '##' directives, or anything from outside of the macro other than the cleanup label. Turn it into a function. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- tests/virnetdevbandwidthtest.c | 44 ++++++++++++++++---------------- tests/virnetdevopenvswitchtest.c | 44 ++++++++++++++++---------------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c index 197d936479..a17737ec40 100644 --- a/tests/virnetdevbandwidthtest.c +++ b/tests/virnetdevbandwidthtest.c @@ -39,27 +39,26 @@ struct testSetStruct { const bool hierarchical_class; }; =20 -#define PARSE(xml, var) \ - do { \ - int rc; \ - g_autoptr(xmlDoc) doc =3D NULL; \ - g_autoptr(xmlXPathContext) ctxt =3D NULL; \ - \ - if (!xml) \ - break; \ - \ - if (!(doc =3D virXMLParseStringCtxt((xml), \ - "bandwidth definition", \ - &ctxt))) \ - goto cleanup; \ - \ - rc =3D virNetDevBandwidthParse(&(var), \ - NULL, \ - ctxt->node, \ - true); \ - if (rc < 0) \ - goto cleanup; \ - } while (0) +static int +testVirNetDevBandwidthParse(virNetDevBandwidth **var, + const char *xml) +{ + g_autoptr(xmlDoc) doc =3D NULL; + g_autoptr(xmlXPathContext) ctxt =3D NULL; + + if (!xml) + return 0; + + if (!(doc =3D virXMLParseStringCtxt((xml), + "bandwidth definition", + &ctxt))) + return -1; + + return virNetDevBandwidthParse(var, + NULL, + ctxt->node, + true); +} =20 static int testVirNetDevBandwidthSet(const void *data) @@ -72,7 +71,8 @@ testVirNetDevBandwidthSet(const void *data) g_autofree char *actual_cmd =3D NULL; g_autoptr(virCommandDryRunToken) dryRunToken =3D virCommandDryRunToken= New(); =20 - PARSE(info->band, band); + if (testVirNetDevBandwidthParse(&band, info->band) < 0) + return -1; =20 if (!iface) iface =3D "eth0"; diff --git a/tests/virnetdevopenvswitchtest.c b/tests/virnetdevopenvswitcht= est.c index 89ffc1e4b5..1026c890cd 100644 --- a/tests/virnetdevopenvswitchtest.c +++ b/tests/virnetdevopenvswitchtest.c @@ -45,27 +45,26 @@ struct testClearQosStruct { const unsigned char *vmid; }; =20 -#define PARSE(xml, var) \ - do { \ - int rc; \ - g_autoptr(xmlDoc) doc =3D NULL; \ - g_autoptr(xmlXPathContext) ctxt =3D NULL; \ - \ - if (!xml) \ - break; \ - \ - if (!(doc =3D virXMLParseStringCtxt((xml), \ - "bandwidth definition", \ - &ctxt))) \ - goto cleanup; \ - \ - rc =3D virNetDevBandwidthParse(&(var), \ - NULL, \ - ctxt->node, \ - true); \ - if (rc < 0) \ - goto cleanup; \ - } while (0) +static int +testVirNetDevBandwidthParse(virNetDevBandwidth **var, + const char *xml) +{ + g_autoptr(xmlDoc) doc =3D NULL; + g_autoptr(xmlXPathContext) ctxt =3D NULL; + + if (!xml) + return 0; + + if (!(doc =3D virXMLParseStringCtxt((xml), + "bandwidth definition", + &ctxt))) + return -1; + + return virNetDevBandwidthParse(var, + NULL, + ctxt->node, + true); +} =20 static const unsigned char vm_id[VIR_UUID_BUFLEN] =3D "fakeuuid"; =20 @@ -161,7 +160,8 @@ testVirNetDevOpenvswitchInterfaceSetQos(const void *dat= a) g_autofree char *actual_cmd =3D NULL; g_autoptr(virCommandDryRunToken) dryRunToken =3D virCommandDryRunToken= New(); =20 - PARSE(info->band, band); + if (testVirNetDevBandwidthParse(&band, info->band) < 0) + return -1; =20 if (!iface) iface =3D "tap-fake"; --=20 2.31.1 From nobody Sun May 5 17:37:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1629465431; cv=none; d=zohomail.com; s=zohoarc; b=apvKwb8S7nbv7TamzpsaaVZnIxBY8PJtYBWzXSOuOviiqBMSUs/nZUsQf9X6D8mfSw2NCS2nmTBMZImAyTc6+mfmSLR/wWzqtD2E42wTmZng6FY+CFOokU0hJdHov9FBNZe6VigZ+0XlVPufbzbaSAnjOgscn37YkMlL8plf0iA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629465431; 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=o3t+AUOq14cL9jLUajifNyiJQhRq1btpJBbMfsggeYQ=; b=Ewp+wBUV/LpVZKnx+o/pKoft2ETmi0DSKrWd/Yvd7BFkNFbe9601pBtLFs5kl0Ro0W0QQZGN5CfqM1UcYnn6WbBEKFX5ahkExF0RRNMwitfCDfShqR6Zh/D+JoPFfuX1OIrcMBLtzqtMFPGlRk3Ui4wnM2xvyEiJbL9XZ8mRqAk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 162946543129698.18316228784795; Fri, 20 Aug 2021 06:17:11 -0700 (PDT) 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-516-ki8EJITZMOSS3dV1tZb_Pw-1; Fri, 20 Aug 2021 09:17:08 -0400 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 4A97B87D56C; Fri, 20 Aug 2021 13:17:02 +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 EE231E2FA; Fri, 20 Aug 2021 13:17:01 +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 B93AC4BB7C; Fri, 20 Aug 2021 13:17:01 +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 17KDFmTx016649 for ; Fri, 20 Aug 2021 09:15:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 44F221017CE5; Fri, 20 Aug 2021 13:15:48 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFA221002D71 for ; Fri, 20 Aug 2021 13:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629465430; 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=o3t+AUOq14cL9jLUajifNyiJQhRq1btpJBbMfsggeYQ=; b=KPg3+bbtVPMHgPB/9KfQ+DOSSRsU0EtQKcC0OfYWPCyuXKbg4bdc3Ik/XtWu3V0E8w6fC0 LSNR9CM23aizAGG1DXGyxe5u1iD+3bZ2nM5hhx/jE9WIJxgL42rS9w346pKOrTOMOGjKa6 CwYEcTcvA61alwtzbU2SahD/tZYsRE0= X-MC-Unique: ki8EJITZMOSS3dV1tZb_Pw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 5/5] tests: virnetdev*: remove unnecessary labels Date: Fri, 20 Aug 2021 15:15:32 +0200 Message-Id: <239db02d8901d42cc0dd96595ab6b9e352d2861a.1629465240.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.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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629465431795100003 Signed-off-by: J=C3=A1n Tomko Reviewed-by: Michal Privoznik --- tests/virnetdevbandwidthtest.c | 9 +++------ tests/virnetdevopenvswitchtest.c | 18 ++++++------------ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c index a17737ec40..eb4f47dfce 100644 --- a/tests/virnetdevbandwidthtest.c +++ b/tests/virnetdevbandwidthtest.c @@ -63,7 +63,6 @@ testVirNetDevBandwidthParse(virNetDevBandwidth **var, static int testVirNetDevBandwidthSet(const void *data) { - int ret =3D -1; const struct testSetStruct *info =3D data; const char *iface =3D info->iface; g_autoptr(virNetDevBandwidth) band =3D NULL; @@ -80,7 +79,7 @@ testVirNetDevBandwidthSet(const void *data) virCommandSetDryRun(dryRunToken, &buf, false, false, NULL, NULL); =20 if (virNetDevBandwidthSet(iface, band, info->hierarchical_class, true)= < 0) - goto cleanup; + return -1; =20 if (!(actual_cmd =3D virBufferContentAndReset(&buf))) { /* This is interesting, no command has been executed. @@ -91,12 +90,10 @@ testVirNetDevBandwidthSet(const void *data) virTestDifference(stderr, NULLSTR(info->exp_cmd), NULLSTR(actual_cmd)); - goto cleanup; + return -1; } =20 - ret =3D 0; - cleanup: - return ret; + return 0; } =20 static int diff --git a/tests/virnetdevopenvswitchtest.c b/tests/virnetdevopenvswitcht= est.c index 1026c890cd..2a20ba82d0 100644 --- a/tests/virnetdevopenvswitchtest.c +++ b/tests/virnetdevopenvswitchtest.c @@ -152,7 +152,6 @@ testNameEscape(const void *opaque) static int testVirNetDevOpenvswitchInterfaceSetQos(const void *data) { - int ret =3D -1; const struct testSetQosStruct *info =3D data; const char *iface =3D info->iface; g_autoptr(virNetDevBandwidth) band =3D NULL; @@ -169,7 +168,7 @@ testVirNetDevOpenvswitchInterfaceSetQos(const void *dat= a) virCommandSetDryRun(dryRunToken, &buf, false, false, NULL, NULL); =20 if (virNetDevOpenvswitchInterfaceSetQos(iface, band, vm_id, true) < 0) - goto cleanup; + return -1; =20 if (!(actual_cmd =3D virBufferContentAndReset(&buf))) { /* This is interesting, no command has been executed. @@ -180,19 +179,16 @@ testVirNetDevOpenvswitchInterfaceSetQos(const void *d= ata) virTestDifference(stderr, NULLSTR(info->exp_cmd), NULLSTR(actual_cmd)); - goto cleanup; + return -1; } =20 - ret =3D 0; - cleanup: - return ret; + return 0; } =20 =20 static int testVirNetDevOpenvswitchInterfaceClearQos(const void *data) { - int ret =3D -1; const struct testClearQosStruct *info =3D data; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; g_autofree char *actual_cmd =3D NULL; @@ -203,7 +199,7 @@ testVirNetDevOpenvswitchInterfaceClearQos(const void *d= ata) virCommandSetDryRun(dryRunToken, &buf, false, false, NULL, NULL); =20 if (virNetDevOpenvswitchInterfaceClearQos(iface, vmid) < 0) - goto cleanup; + return -1; =20 if (!(actual_cmd =3D virBufferContentAndReset(&buf))) { /* This is interesting, no command has been executed. @@ -214,12 +210,10 @@ testVirNetDevOpenvswitchInterfaceClearQos(const void = *data) virTestDifference(stderr, NULLSTR(info->exp_cmd), NULLSTR(actual_cmd)); - goto cleanup; + return -1; } =20 - ret =3D 0; - cleanup: - return ret; + return 0; } =20 static int --=20 2.31.1