From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347902; cv=none; d=zohomail.com; s=zohoarc; b=fpQfLFum1K1MFSQ/CBVdFC09Vn3vQam2jbUuyZmY4+nUgxXqvPGsB7GFkJ7WGU5sxxQPAnQtFGoD4/95abSRqaqxcxPJWb2ogNXuurAtmcHbrwcBNMd/KcF67F8ekfzOBtQFGhDFhb1DOiYm+8KGWZw2atptqVJZGovQC3jNYYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347902; h=Content-Type:Content-Transfer-Encoding:Cc: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=qkNo0T/XQv5EL5Q2oXUkI7P6+WeX1qWdYPaZmPuwISY=; b=dKAq6kPF3pebCX57YjOKiGlsiq9OtHhrq2smky0NPgmgeKqbVD23A+ff3/xfzFgbrRBeD+uYyccpXvcPsJkhOr52+uiXbjE7/SQ5GLYXltWeqk1MdskLd4Jn5S0YJdwlFC4m3WOLQGlegDPM2nKJ8GWBCED0076V9TAbTDMNUoA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 157834790250642.88538856737398; Mon, 6 Jan 2020 13:58:22 -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-77-E3y3qF1zNsSfSk_QS3aTPg-1; Mon, 06 Jan 2020 16:58:18 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2EC44801E77; Mon, 6 Jan 2020 21:58:12 +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 88E3360E1C; Mon, 6 Jan 2020 21:58:11 +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 03DAA18089C8; Mon, 6 Jan 2020 21:58:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006Lw4se007147 for ; Mon, 6 Jan 2020 16:58:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id 31AB42166B2E; Mon, 6 Jan 2020 21:58:04 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2CE2D2166B2B for ; Mon, 6 Jan 2020 21:58:01 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE58D80208A for ; Mon, 6 Jan 2020 21:58:01 +0000 (UTC) Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-28-hkMFy1nFP6SBoOlK7XFFog-1; Mon, 06 Jan 2020 16:58:00 -0500 Received: by mail-qt1-f195.google.com with SMTP id e6so43720765qtq.7 for ; Mon, 06 Jan 2020 13:57:59 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:57:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347901; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=qkNo0T/XQv5EL5Q2oXUkI7P6+WeX1qWdYPaZmPuwISY=; b=i5LJA8G8lwHVvyv3W+tK+ZE630SxcSk8XRwaXuVpvM35Ry416vW/ngPnjjwb0Ft6gG6vs1 +h0Wml9kPQY1d5BkQU/7aPHQLv+K84R3VVCa6ZNnrtlMrSTBV7qFcUFJgXnSLFTM2JEKKU lQeKWpxJrE872/tp0q0vsp+V1wAriwA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=K2AXH0WX680Ilo0A5yJ/bfCE9dPwgpq8GaUC39Iy5qY=; b=Y/pBULRrius2X0dr2pMlcCZZdU923TkOi1naxne/Ad5ZBNfr5gc3qSLGzV9BdYYAe8 clrlPltXAYzadkqkKI6ipVRZHuwPY1a8QZGXxk44G/SfqtsMgh8LApd+S12RRx5XafJF K3DW8UFgoHi0KmMFOq01chAzHVgdnywcstL5dEx1s9ay0b0vDRTPz3MqOTKj8q6WTFAd Tu+W8jP/0yH1v5YzveOaLL9SfRlIbWb0S1yh7KlbwHAK6O6CJjT9KAHKlK+oWBQfLoAH Dop1vA6NPELgHnMYCUDUHENCXYSW9xjNDbYQOa7LYKn2eSbJJbIW0A38ViQoVUGutia6 N2iA== X-Gm-Message-State: APjAAAVyPHnFlPOZhRk0je3apI1/X+G1EGMvLF13WFyac9UdpzPbd7A1 LKIFOE0ttXQw4BFy+HuXgHzAMzou X-Google-Smtp-Source: APXvYqyK2gbA8438QqGpuhyf5fPJWNhHGfDRoLSXQ2+7Ax+Xp+R4dnNo31d813cRxazCtXhOugzI0g== X-Received: by 2002:ac8:7201:: with SMTP id a1mr76445253qtp.51.1578347879383; Mon, 06 Jan 2020 13:57:59 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:25 -0300 Message-Id: <20200106215750.361615-2-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: hkMFy1nFP6SBoOlK7XFFog-1 X-MC-Unique: E3y3qF1zNsSfSk_QS3aTPg-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006Lw4se007147 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 01/26] bhyve: remove unneeded labels 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.12 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Labels that are simply a jump to a 'return' call are unneeded and can be replaced by the return value instead. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/bhyve/bhyve_device.c | 13 ++++----- src/bhyve/bhyve_parse_command.c | 47 +++++++++++++-------------------- 2 files changed, 23 insertions(+), 37 deletions(-) diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c index ddbe20d31d..13261e9935 100644 --- a/src/bhyve/bhyve_device.c +++ b/src/bhyve/bhyve_device.c @@ -97,7 +97,7 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def, =20 if (virDomainPCIAddressReserveAddr(addrs, &lpc_addr, VIR_PCI_CONNECT_TYPE_PCI_DEVICE, 0)= < 0) { - goto error; + return -1; } =20 for (i =3D 0; i < def->ncontrollers; i++) { @@ -113,7 +113,7 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def, &def->controllers[i]->i= nfo, VIR_PCI_CONNECT_TYPE_PC= I_DEVICE, -1) < 0) - goto error; + return -1; } } =20 @@ -124,7 +124,7 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def, &def->nets[i]->info, VIR_PCI_CONNECT_TYPE_PCI_DE= VICE, -1) < 0) - goto error; + return -1; } =20 for (i =3D 0; i < def->ndisks; i++) { @@ -140,7 +140,7 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def, if (virDomainPCIAddressReserveNextAddr(addrs, &def->disks[i]->info, VIR_PCI_CONNECT_TYPE_PCI_DE= VICE, -1) < 0) - goto error; + return -1; } =20 for (i =3D 0; i < def->nvideos; i++) { @@ -150,14 +150,11 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def, &def->videos[i]->info, VIR_PCI_CONNECT_TYPE_PCI_DE= VICE, -1) < 0) - goto error; + return -1; } =20 =20 return 0; - - error: - return -1; } =20 int bhyveDomainAssignPCIAddresses(virDomainDefPtr def, diff --git a/src/bhyve/bhyve_parse_command.c b/src/bhyve/bhyve_parse_comman= d.c index e74c4c2d0c..f7cedf5c65 100644 --- a/src/bhyve/bhyve_parse_command.c +++ b/src/bhyve/bhyve_parse_command.c @@ -374,7 +374,7 @@ bhyveParsePCISlot(const char *slotdef, val =3D g_strdup(curr); =20 if (virStrToLong_ui(val, NULL, 10, &values[i]) < 0) - goto error; + return -1; =20 VIR_FREE(val); =20 @@ -404,8 +404,6 @@ bhyveParsePCISlot(const char *slotdef, } =20 return 0; - error: - return -1; } =20 static int @@ -426,7 +424,7 @@ bhyveParsePCIDisk(virDomainDefPtr def, virDomainDiskDefPtr disk =3D NULL; =20 if (!(disk =3D virDomainDiskDefNew(NULL))) - goto cleanup; + return 0; =20 disk->bus =3D bus; disk->device =3D device; @@ -471,7 +469,6 @@ bhyveParsePCIDisk(virDomainDefPtr def, if (VIR_APPEND_ELEMENT(def->disks, def->ndisks, disk) < 0) goto error; =20 - cleanup: return 0; =20 error: @@ -664,17 +661,17 @@ bhyveParseBhyveCommandLine(virDomainDefPtr def, if (virStrToLong_i(arg, NULL, 10, &vcpus) < 0) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("Failed to parse number of vCPUs")); - goto error; + return -1; } if (virDomainDefSetVcpusMax(def, vcpus, xmlopt) < 0) - goto error; + return -1; if (virDomainDefSetVcpus(def, vcpus) < 0) - goto error; + return -1; break; case 'l': CONSUME_ARG(arg); if (bhyveParseBhyveLPCArg(def, caps, arg)) - goto error; + return -1; break; case 's': CONSUME_ARG(arg); @@ -684,19 +681,19 @@ bhyveParseBhyveCommandLine(virDomainDefPtr def, &nahcidisks, &nvirtiodisks, arg)) - goto error; + return -1; break; case 'm': CONSUME_ARG(arg); if (bhyveParseMemsize(arg, &memory)) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("Failed to parse memory")); - goto error; + return -1; } if (def->mem.cur_balloon !=3D 0 && def->mem.cur_balloon !=3D m= emory) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("Failed to parse memory: size mismatch")); - goto error; + return -1; } def->mem.cur_balloon =3D memory; virDomainDefSetMemoryTotal(def, memory); @@ -714,7 +711,7 @@ bhyveParseBhyveCommandLine(virDomainDefPtr def, if (virUUIDParse(arg, def->uuid) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Cannot parse UUID '%s'"), arg); - goto error; + return -1; } break; case 'S': @@ -729,7 +726,7 @@ bhyveParseBhyveCommandLine(virDomainDefPtr def, if (argc !=3D opti) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("Failed to parse arguments for bhyve command")); - goto error; + return -1; } =20 if (def->name =3D=3D NULL) { @@ -739,13 +736,10 @@ bhyveParseBhyveCommandLine(virDomainDefPtr def, * error here */ virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("Failed to parse arguments: VM name mismatch")); - goto error; + return -1; } =20 return 0; - - error: - return -1; } =20 /* @@ -761,7 +755,6 @@ bhyveParseBhyveLoadCommandLine(virDomainDefPtr def, unsigned arguments =3D 0; size_t memory =3D 0; size_t i =3D 0; - int ret =3D -1; size_t opti; const char *arg; =20 @@ -789,12 +782,12 @@ bhyveParseBhyveLoadCommandLine(virDomainDefPtr def, if (bhyveParseMemsize(arg, &memory)) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("Failed to parse memory")); - goto error; + return -1; } if (def->mem.cur_balloon !=3D 0 && def->mem.cur_balloon !=3D m= emory) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("Failed to parse memory: size mismatch")); - goto error; + return -1; } def->mem.cur_balloon =3D memory; virDomainDefSetMemoryTotal(def, memory); @@ -807,7 +800,7 @@ bhyveParseBhyveLoadCommandLine(virDomainDefPtr def, if (argc !=3D opti) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("Failed to parse arguments for bhyve command")); - goto error; + return -1; } =20 if (arguments !=3D 3) { @@ -824,12 +817,10 @@ bhyveParseBhyveLoadCommandLine(virDomainDefPtr def, * error here */ virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("Failed to parse arguments: VM name mismatch")); - goto error; + return -1; } =20 - ret =3D 0; - error: - return ret; + return 0; } =20 static int @@ -838,14 +829,12 @@ bhyveParseCustomLoaderCommandLine(virDomainDefPtr def, char **argv) { if (!argv) - goto error; + return -1; =20 def->os.bootloader =3D g_strdup(argv[0]); def->os.bootloaderArgs =3D virStringListJoin((const char**) &argv[1], = " "); =20 return 0; - error: - return -1; } =20 virDomainDefPtr --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347916; cv=none; d=zohomail.com; s=zohoarc; b=AqgGKU1ZlmtxCWGTUGDvDKraTTUtFnpgyV0OcarQq/R+6PuzxXTtJixhv+2/2qxmT+0d4K+liDGIyHGGGKOon3GotehyP4FB0lAxqedMB/eozJltwAV71HFPBHvnBTktn3LXHHpnuWyi8nSu/T/d25jxDHrk+KnCSoQSxINq6ao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347916; h=Content-Type:Content-Transfer-Encoding:Cc: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=dE5P8joPf5QkdNDjZqa6HN4pgimPrZe8zB5FdfZ2Mjw=; b=g2JFfehaykak54qVUmC/d5rA+HsBOEKajEceJuyr4GOemePz0DrRWazlLyY3NKVCA3C5Ur4rdmnefy4MT0gh2uX/383ADsN63cjh44nR2WHod5+r8BGEgDuj2UUQmuA2kNBQok6vsEpKBJPVwyY3UFds2LMJuXqg6o0l7vX9FUs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1578347916052368.1440011733374; Mon, 6 Jan 2020 13:58:36 -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-429-jtF2vm_DPWiTlE03rbK5Ag-1; Mon, 06 Jan 2020 16:58:33 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A09E2185432F; Mon, 6 Jan 2020 21:58:27 +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 79BE15C21B; Mon, 6 Jan 2020 21:58:27 +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 35D5281C7D; Mon, 6 Jan 2020 21:58:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006Lw4dh007148 for ; Mon, 6 Jan 2020 16:58:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id 320042166B2F; Mon, 6 Jan 2020 21:58:04 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2DDC32166B2C for ; Mon, 6 Jan 2020 21:58:03 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 459FD80208E for ; Mon, 6 Jan 2020 21:58:03 +0000 (UTC) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-302-PxOYJZ2yMUWdV67u3jT5Vg-1; Mon, 06 Jan 2020 16:58:01 -0500 Received: by mail-qk1-f169.google.com with SMTP id w127so40877584qkb.11 for ; Mon, 06 Jan 2020 13:58:01 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347914; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=dE5P8joPf5QkdNDjZqa6HN4pgimPrZe8zB5FdfZ2Mjw=; b=DSugQ501Jz1EeFOXlTPN5mb0TbmKapM3/P91CAngKCBn3IRSio7NXUC/ISJYaLjrq/BIg4 CrXb1A21TE9nwxoe7cDMTonhGOBX29qvO8jHENasI8vtQQC0/GimdM9Ui+fcWrO3hpzBzm nc+meq72xZSmvOe3MQZfJMRH+f91CrE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HfqbfwS2ROHFiZ60rJ/W1AvUrpUCLII6QUxZ3RWU9F0=; b=Acc/PuSBSoFrr+iyjkwQ+NX1+aYwO1B7kwTa/2LM/G0biQcU8DU4IH5V4GBsvSGQx9 g5t4dVGkOqQ8mIC/IQyQBfQvtp15uh5Smd+zKx+GQ+gyZRRE/sfOIW1BvPfJSJ5lw+/n RFSDMPgKkJssDvy2r0q7kRRaD300VxRTaBZ9A2W7VdGyT2fbHsOjCgSok2QsucqE7n5G uhaWHpFXwFvA+UGBF30WuAsb9+u6UN1dFIdSblguFx2sX3j2HtsKdjAG+m0QXvDnZz5u MXNPWBee/LJqca7thvJ7Gpk04NkK8jgun+1+1o7NzAq+u31etqP/Vlax83dvEsrqHB3O U+Ow== X-Gm-Message-State: APjAAAX3nvN8aYE8wQ27RUbmUTbm0Xt1K4heS7Ros6Jf/bmUiuQhtOa4 eo0XLHeD+YygaW3CWm9PThKob87p X-Google-Smtp-Source: APXvYqzk+ie49sminZhoZSaPguJHc3qXW6K/OgRGJbjUbIypEBvaL/U60uOZFAsMsWWoYINRixGpfQ== X-Received: by 2002:a05:620a:5ae:: with SMTP id q14mr87153610qkq.437.1578347880886; Mon, 06 Jan 2020 13:58:00 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:26 -0300 Message-Id: <20200106215750.361615-3-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: PxOYJZ2yMUWdV67u3jT5Vg-1 X-MC-Unique: jtF2vm_DPWiTlE03rbK5Ag-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006Lw4dh007148 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 02/26] conf: remove unneeded labels 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.16 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Remove unneeded labels from the following src/conf files: capabilities.c network_conf.c networkcommon_conf.c nwfilter_conf.c virnetworkobj.c Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/conf/capabilities.c | 14 ++++------- src/conf/network_conf.c | 45 +++++++++++++++-------------------- src/conf/networkcommon_conf.c | 11 ++++----- src/conf/nwfilter_conf.c | 3 +-- src/conf/virnetworkobj.c | 7 +++--- 5 files changed, 32 insertions(+), 48 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 82129feaac..9a39858280 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -747,11 +747,11 @@ virCapabilitiesDomainDataLookupInternal(virCapsPtr ca= ps, _("could not find capabilities for %s"), virBufferCurrentContent(&buf)); virBufferFreeAndReset(&buf); - goto error; + return ret; } =20 if (VIR_ALLOC(ret) < 0) - goto error; + return ret; =20 ret->ostype =3D foundguest->ostype; ret->arch =3D foundguest->arch.id; @@ -764,7 +764,6 @@ virCapabilitiesDomainDataLookupInternal(virCapsPtr caps, if (foundmachine) ret->machinetype =3D foundmachine->name; =20 - error: return ret; } =20 @@ -1179,13 +1178,13 @@ virCapabilitiesFormatHostXML(virCapsHostPtr host, =20 if (host->numa && virCapabilitiesHostNUMAFormat(host->numa, buf) < 0) - goto error; + return -1; =20 if (virCapabilitiesFormatCaches(buf, &host->cache) < 0) - goto error; + return -1; =20 if (virCapabilitiesFormatMemoryBandwidth(buf, &host->memBW) < 0) - goto error; + return -1; =20 for (i =3D 0; i < host->nsecModels; i++) { virBufferAddLit(buf, "\n"); @@ -1207,9 +1206,6 @@ virCapabilitiesFormatHostXML(virCapsHostPtr host, virBufferAddLit(buf, "\n\n"); =20 return 0; - - error: - return -1; } =20 =20 diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 5551b5b4d5..27e83b7d85 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -2240,8 +2240,6 @@ static int virNetworkIPDefFormat(virBufferPtr buf, const virNetworkIPDef *def) { - int result =3D -1; - virBufferAddLit(buf, "family) @@ -2249,14 +2247,14 @@ virNetworkIPDefFormat(virBufferPtr buf, if (VIR_SOCKET_ADDR_VALID(&def->address)) { char *addr =3D virSocketAddrFormat(&def->address); if (!addr) - goto error; + return -1; virBufferAsprintf(buf, " address=3D'%s'", addr); VIR_FREE(addr); } if (VIR_SOCKET_ADDR_VALID(&def->netmask)) { char *addr =3D virSocketAddrFormat(&def->netmask); if (!addr) - goto error; + return -1; virBufferAsprintf(buf, " netmask=3D'%s'", addr); VIR_FREE(addr); } @@ -2283,11 +2281,11 @@ virNetworkIPDefFormat(virBufferPtr buf, for (i =3D 0; i < def->nranges; i++) { char *saddr =3D virSocketAddrFormat(&def->ranges[i].start); if (!saddr) - goto error; + return -1; char *eaddr =3D virSocketAddrFormat(&def->ranges[i].end); if (!eaddr) { VIR_FREE(saddr); - goto error; + return -1; } virBufferAsprintf(buf, "\n", saddr, eaddr); @@ -2305,7 +2303,7 @@ virNetworkIPDefFormat(virBufferPtr buf, if (VIR_SOCKET_ADDR_VALID(&def->hosts[i].ip)) { char *ipaddr =3D virSocketAddrFormat(&def->hosts[i].ip); if (!ipaddr) - goto error; + return -1; virBufferAsprintf(buf, " ip=3D'%s'", ipaddr); VIR_FREE(ipaddr); } @@ -2317,7 +2315,7 @@ virNetworkIPDefFormat(virBufferPtr buf, if (VIR_SOCKET_ADDR_VALID(&def->bootserver)) { char *ipaddr =3D virSocketAddrFormat(&def->bootserver); if (!ipaddr) - goto error; + return -1; virBufferEscapeString(buf, " server=3D'%s'", ipaddr); VIR_FREE(ipaddr); } @@ -2332,9 +2330,7 @@ virNetworkIPDefFormat(virBufferPtr buf, virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); =20 - result =3D 0; - error: - return result; + return 0; } =20 =20 @@ -2458,7 +2454,7 @@ virNetworkDefFormatBuf(virBufferPtr buf, virBufferGetIndent(buf) / 2, 1) < 0) { xmlBufferFree(xmlbuf); xmlIndentTreeOutput =3D oldIndentTreeOutput; - goto error; + return -1; } virBufferAsprintf(buf, "%s\n", (char *) xmlBufferContent(xmlbuf)); xmlBufferFree(xmlbuf); @@ -2475,7 +2471,7 @@ virNetworkDefFormatBuf(virBufferPtr buf, virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown forward type %d in network '%s'"), def->forward.type, def->name); - goto error; + return -1; } virBufferAddLit(buf, "forward.driverName); - goto error; + return -1; } virBufferAsprintf(buf, "\n", driverName); } if (def->forward.type =3D=3D VIR_NETWORK_FORWARD_NAT) { if (virNetworkForwardNatDefFormat(buf, &def->forward) < 0) - goto error; + return -1; } =20 /* For now, hard-coded to at most 1 forward.pfs */ @@ -2562,7 +2558,7 @@ virNetworkDefFormatBuf(virBufferPtr buf, case VIR_NETWORK_FORWARD_LAST: default: virReportEnumRangeError(virNetworkForwardType, def->forward.type); - goto error; + return -1; } =20 if (hasbridge || def->bridge || def->macTableManager) { @@ -2608,29 +2604,29 @@ virNetworkDefFormatBuf(virBufferPtr buf, } =20 if (virNetworkDNSDefFormat(buf, &def->dns) < 0) - goto error; + return -1; =20 if (virNetDevVlanFormat(&def->vlan, buf) < 0) - goto error; + return -1; if (virNetDevBandwidthFormat(def->bandwidth, 0, buf) < 0) - goto error; + return -1; =20 for (i =3D 0; i < def->nips; i++) { if (virNetworkIPDefFormat(buf, &def->ips[i]) < 0) - goto error; + return -1; } =20 for (i =3D 0; i < def->nroutes; i++) { if (virNetDevIPRouteFormat(buf, def->routes[i]) < 0) - goto error; + return -1; } =20 if (virNetDevVPortProfileFormat(def->virtPortProfile, buf) < 0) - goto error; + return -1; =20 for (i =3D 0; i < def->nPortGroups; i++) if (virPortGroupDefFormat(buf, &def->portGroups[i]) < 0) - goto error; + return -1; =20 if (def->namespaceData && def->ns.format) { if ((def->ns.format)(buf, def->namespaceData) < 0) @@ -2641,9 +2637,6 @@ virNetworkDefFormatBuf(virBufferPtr buf, virBufferAddLit(buf, "\n"); =20 return 0; - - error: - return -1; } =20 =20 diff --git a/src/conf/networkcommon_conf.c b/src/conf/networkcommon_conf.c index de807e2a54..e90cfcbef5 100644 --- a/src/conf/networkcommon_conf.c +++ b/src/conf/networkcommon_conf.c @@ -290,7 +290,6 @@ int virNetDevIPRouteFormat(virBufferPtr buf, const virNetDevIPRoute *def) { - int result =3D -1; char *addr =3D NULL; =20 virBufferAddLit(buf, "family); =20 if (!(addr =3D virSocketAddrFormat(&def->address))) - goto cleanup; + return -1; virBufferAsprintf(buf, " address=3D'%s'", addr); VIR_FREE(addr); =20 if (VIR_SOCKET_ADDR_VALID(&def->netmask)) { if (!(addr =3D virSocketAddrFormat(&def->netmask))) - goto cleanup; + return -1; virBufferAsprintf(buf, " netmask=3D'%s'", addr); VIR_FREE(addr); } @@ -313,7 +312,7 @@ virNetDevIPRouteFormat(virBufferPtr buf, virBufferAsprintf(buf, " prefix=3D'%u'", def->prefix); =20 if (!(addr =3D virSocketAddrFormat(&def->gateway))) - goto cleanup; + return -1; virBufferAsprintf(buf, " gateway=3D'%s'", addr); VIR_FREE(addr); =20 @@ -321,7 +320,5 @@ virNetDevIPRouteFormat(virBufferPtr buf, virBufferAsprintf(buf, " metric=3D'%u'", def->metric); virBufferAddLit(buf, "/>\n"); =20 - result =3D 0; - cleanup: - return result; + return 0; } diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index d071c398bc..680f4184c3 100644 --- a/src/conf/nwfilter_conf.c +++ b/src/conf/nwfilter_conf.c @@ -2903,7 +2903,7 @@ virNWFilterRuleDefDetailsFormat(virBufferPtr buf, _("formatter for %s %s reported error"), type, att[i].name); - goto err_exit; + return; } } else if ((flags & NWFILTER_ENTRY_ITEM_FLAG_HAS_VAR)) { virBufferAddChar(buf, '$'); @@ -2986,7 +2986,6 @@ virNWFilterRuleDefDetailsFormat(virBufferPtr buf, virBufferAsprintf(buf, "<%s/>\n", type); =20 - err_exit: return; } =20 diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c index 5daf4a8cb1..299cdba52d 100644 --- a/src/conf/virnetworkobj.c +++ b/src/conf/virnetworkobj.c @@ -1774,21 +1774,20 @@ virNetworkObjPortListExportCallback(void *payload, =20 if (data->filter && !data->filter(data->net->conn, data->def, def)) - goto cleanup; + return 0; =20 if (!data->ports) { data->nports++; - goto cleanup; + return 0; } =20 if (!(port =3D virGetNetworkPort(data->net, def->uuid))) { data->error =3D true; - goto cleanup; + return 0; } =20 data->ports[data->nports++] =3D port; =20 - cleanup: return 0; } =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347915; cv=none; d=zohomail.com; s=zohoarc; b=aZZy66jvFREosK3AZmy6n4FdIDZWXTGKySulnK/O8n74ddHnSmo9WOtyYrrSGGXNTe551LnbmcW1ZkubM+8vebxyzEIpKnkmTxn0A1CBPvz9djbulaTrgT9v4CVddWzmMg0hfUjOIPSf2vtX/25PlbdZUoCcyesmFZWOBPEHrUY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347915; h=Content-Type:Content-Transfer-Encoding:Cc: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=46FBae7tPEfjig7y/RjMbiL2aADmUr+bFIXeJfEmjiI=; b=IMsHAy3DqBTRAI4CzLACyT3D8n/8dra09dVCaiCj8ubcdSr9MiykliiOVk7d0n8qqBcqx8C+0uX2vSMsdczZdQLtagO/+EGZJYw8hWeRscjkU0OgN8hUTbQSIi3s7nbGwpDMfH9CU+5mqTG2xmql6X0E6//lP8KRkSh8FqTxjvI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1578347915927289.42192054892087; Mon, 6 Jan 2020 13:58:35 -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-245-lK5Mw_QcMCqV2eXr5FTUtw-1; Mon, 06 Jan 2020 16:58:33 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 78A8FDBE5; Mon, 6 Jan 2020 21:58:27 +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 553CA5C1B2; Mon, 6 Jan 2020 21:58:27 +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 1667181C66; Mon, 6 Jan 2020 21:58:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006Lw7QT007178 for ; Mon, 6 Jan 2020 16:58:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id D2E69101B568; Mon, 6 Jan 2020 21:58:07 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD9E0101B565 for ; Mon, 6 Jan 2020 21:58:05 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 57C088119DB for ; Mon, 6 Jan 2020 21:58:05 +0000 (UTC) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-293-Q8rotzk1MvSLxBkaeuuBfQ-1; Mon, 06 Jan 2020 16:58:03 -0500 Received: by mail-qt1-f176.google.com with SMTP id g1so3352472qtr.13 for ; Mon, 06 Jan 2020 13:58:03 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347914; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=46FBae7tPEfjig7y/RjMbiL2aADmUr+bFIXeJfEmjiI=; b=JSElM2NxcvjmtHi65opkp5MKQBiG+vDIOLrS8BRybVuWs8bMT/rohTtlWuIifvX85rciVl LM3OMMmPYhzJDCq1exhqnWmy9rguTgQa+kpZKyn6OT/qIa/y2cFzaqjSUGv8od1WruNpGD Tw57axV0wbDKEM9WvKSZAGDVWNheG3E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Bc+uiyC9SzaBUsf38zuR/KerVHLEg1uAPc37/tcytwc=; b=MVoWCaCb+IqlId/VlcpDwaSHWV9R6ESflUhIzhLI9MuBk1Ok5hj/H8QT3JbaSIHtqk 0ohpsaxX/fZ+/jBIfPPEN7d5oLppvMzf61A+mYHi3gOaCF+ooRyxCrnMMk3QcoXPkVYn AxPDE18mM3kU3F3tJWPh/3s0HFGgdlAG30YS1mGmd0x5YCkjdchQJF8wAfZvagfp90bl NuyM6PRuOoRrMticZ8tOSNeEDg1VxAjDVRhIjfO/70IV6QWZeCy2XBXff6220mxcweE4 Ve4YsyUfjGMDS6LYMl8c/4xevL+SWmcoy/mxSlPthhZy45YVO/eFA4EX0SfXY6f8OW+Y N5+g== X-Gm-Message-State: APjAAAVGUcGhPuCElOVpGztsrbQdPINmTlJpd8ZluGHxXxbpc+e9/87n 0UvscJpCPN5iEuc7bQhSxSpsnefO X-Google-Smtp-Source: APXvYqwI90b5ai57wE7McbZwDCva2GsZmgJbgmBQuJdOPbQDMs5p6yJcCjxQqT493cHRrBBIGIT/GQ== X-Received: by 2002:ac8:1184:: with SMTP id d4mr77514243qtj.104.1578347882478; Mon, 06 Jan 2020 13:58:02 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:27 -0300 Message-Id: <20200106215750.361615-4-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: Q8rotzk1MvSLxBkaeuuBfQ-1 X-MC-Unique: lK5Mw_QcMCqV2eXr5FTUtw-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006Lw7QT007178 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 03/26] conf: remove more unneeded labels 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.16 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Remove unneeded labels from the following conf files: cpu_conf.c domain_addr.c interface_conf.c nwfilter_params.c Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/conf/cpu_conf.c | 36 ++++++++++++++++-------------------- src/conf/domain_addr.c | 9 ++++----- src/conf/interface_conf.c | 9 +++------ src/conf/nwfilter_params.c | 5 +---- 4 files changed, 24 insertions(+), 35 deletions(-) diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index 7490d6bf73..b463981de0 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -992,7 +992,6 @@ virCPUDefIsEqual(virCPUDefPtr src, virCPUDefPtr dst, bool reportError) { - bool identical =3D false; size_t i; =20 if (!src && !dst) @@ -1004,91 +1003,91 @@ virCPUDefIsEqual(virCPUDefPtr src, =20 if ((src && !dst) || (!src && dst)) { MISMATCH("%s", _("Target CPU does not match source")); - goto cleanup; + return false; } =20 if (src->type !=3D dst->type) { MISMATCH(_("Target CPU type %s does not match source %s"), virCPUTypeToString(dst->type), virCPUTypeToString(src->type)); - goto cleanup; + return false; } =20 if (src->mode !=3D dst->mode) { MISMATCH(_("Target CPU mode %s does not match source %s"), virCPUModeTypeToString(dst->mode), virCPUModeTypeToString(src->mode)); - goto cleanup; + return false; } =20 if (src->check !=3D dst->check) { MISMATCH(_("Target CPU check %s does not match source %s"), virCPUCheckTypeToString(dst->check), virCPUCheckTypeToString(src->check)); - goto cleanup; + return false; } =20 if (src->arch !=3D dst->arch) { MISMATCH(_("Target CPU arch %s does not match source %s"), virArchToString(dst->arch), virArchToString(src->arch)); - goto cleanup; + return false; } =20 if (STRNEQ_NULLABLE(src->model, dst->model)) { MISMATCH(_("Target CPU model %s does not match source %s"), NULLSTR(dst->model), NULLSTR(src->model)); - goto cleanup; + return false; } =20 if (STRNEQ_NULLABLE(src->vendor, dst->vendor)) { MISMATCH(_("Target CPU vendor %s does not match source %s"), NULLSTR(dst->vendor), NULLSTR(src->vendor)); - goto cleanup; + return false; } =20 if (STRNEQ_NULLABLE(src->vendor_id, dst->vendor_id)) { MISMATCH(_("Target CPU vendor id %s does not match source %s"), NULLSTR(dst->vendor_id), NULLSTR(src->vendor_id)); - goto cleanup; + return false; } =20 if (src->sockets !=3D dst->sockets) { MISMATCH(_("Target CPU sockets %d does not match source %d"), dst->sockets, src->sockets); - goto cleanup; + return false; } =20 if (src->cores !=3D dst->cores) { MISMATCH(_("Target CPU cores %d does not match source %d"), dst->cores, src->cores); - goto cleanup; + return false; } =20 if (src->threads !=3D dst->threads) { MISMATCH(_("Target CPU threads %d does not match source %d"), dst->threads, src->threads); - goto cleanup; + return false; } =20 if (src->nfeatures !=3D dst->nfeatures) { MISMATCH(_("Target CPU feature count %zu does not match source %zu= "), dst->nfeatures, src->nfeatures); - goto cleanup; + return false; } =20 for (i =3D 0; i < src->nfeatures; i++) { if (STRNEQ(src->features[i].name, dst->features[i].name)) { MISMATCH(_("Target CPU feature %s does not match source %s"), dst->features[i].name, src->features[i].name); - goto cleanup; + return false; } =20 if (src->features[i].policy !=3D dst->features[i].policy) { MISMATCH(_("Target CPU feature policy %s does not match source= %s"), virCPUFeaturePolicyTypeToString(dst->features[i].poli= cy), virCPUFeaturePolicyTypeToString(src->features[i].poli= cy)); - goto cleanup; + return false; } } =20 @@ -1098,15 +1097,12 @@ virCPUDefIsEqual(virCPUDefPtr src, (src->cache->level !=3D dst->cache->level || src->cache->mode !=3D dst->cache->mode))) { MISMATCH("%s", _("Target CPU cache does not match source")); - goto cleanup; + return false; } =20 #undef MISMATCH =20 - identical =3D true; - - cleanup: - return identical; + return true; } =20 =20 diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 165bd70f2b..ef7ee80e6a 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -1175,7 +1175,7 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSet= Ptr addrs, =20 if (addrs->nbuses =3D=3D 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("No PCI buses available"= )); - goto error; + return -1; } =20 /* if the caller asks for "any function", give them function 0 */ @@ -1199,7 +1199,7 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSet= Ptr addrs, =20 if (virDomainPCIAddressFindUnusedFunctionOnBus(bus, &a, function, flags, &found) < 0)= { - goto error; + return -1; } =20 if (found) @@ -1223,7 +1223,7 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSet= Ptr addrs, =20 if (virDomainPCIAddressFindUnusedFunctionOnBus(bus, &a, function, flags, &found) < 0)= { - goto error; + return -1; } =20 /* The isolation group for the bus will actually be changed @@ -1236,7 +1236,7 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSet= Ptr addrs, if (addrs->dryRun) { /* a is already set to the first new bus */ if (virDomainPCIAddressSetGrow(addrs, &a, flags) < 0) - goto error; + return -1; /* this device will use the first slot of the new bus */ a.slot =3D addrs->buses[a.bus].minSlot; goto success; @@ -1244,7 +1244,6 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSet= Ptr addrs, =20 virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("No more available PCI slots")); - error: return -1; =20 success: diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index fbfd855395..7a41b19ed0 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -1070,19 +1070,19 @@ virInterfaceDefDevFormat(virBufferPtr buf, if (def =3D=3D NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("virInterfaceDefFormat NULL def")); - goto cleanup; + return -1; } =20 if ((def->name =3D=3D NULL) && (def->type !=3D VIR_INTERFACE_TYPE_VLAN= )) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("virInterfaceDefFormat missing interface na= me")); - goto cleanup; + return -1; } =20 if (!(type =3D virInterfaceTypeToString(def->type))) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected interface type %d"), def->type); - goto cleanup; + return -1; } =20 virBufferAsprintf(buf, "\n"); =20 return 0; - - cleanup: - return -1; } =20 =20 diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c index 4110169135..b0d60abdd0 100644 --- a/src/conf/nwfilter_params.c +++ b/src/conf/nwfilter_params.c @@ -672,12 +672,9 @@ virNWFilterHashTablePutAll(virHashTablePtr src, =20 virHashForEach(src, addToTable, &atts); if (atts.errOccurred) - goto err_exit; + return -1; =20 return 0; - - err_exit: - return -1; } =20 /* The general purpose function virNWFilterVarValueEqual returns a --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347901; cv=none; d=zohomail.com; s=zohoarc; b=F9RpzrDpw50MdYDSRKcYBgZaNR2ZJ529SudbA8fWN5HKw3bubKYoAdpPTkx0IkNiLPveHSC2l/fzE/QmfyTH8tEY9QnDoklXtdbP0thdvF5RLHhoDwOKXefi5U6yyRB0Ux/qKgdChcFjw99Qwz87rfb6552jLWC08UTPgvYPN+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347901; h=Content-Type:Content-Transfer-Encoding:Cc: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=UaGeYIn9UN2+neUDo6+9y2yZ8cWOnAgKeLcgrjbPBls=; b=I551DKzQgbxNsno9jUYUNF4CgnJXimAWbir/8K75jlJMUAh8YYUcdzyFMoinLAFqYbE/vevp8SBmqL3WoadIzAdMd1Ugop6GDtisvPAkPllLNHYLueLk6xmK90JlmYCdxHYnakZyNhXUJt14GPim9fmqKFY2JuW5YX4I1XuSR/s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1578347901966467.52759178920985; Mon, 6 Jan 2020 13:58:21 -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-31-2W_JT65uOLGG8QxUvHPWgA-1; Mon, 06 Jan 2020 16:58:18 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D5B9D1005516; Mon, 6 Jan 2020 21:58:12 +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 AC30310840F5; Mon, 6 Jan 2020 21:58:12 +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 DE54681C7C; Mon, 6 Jan 2020 21:58:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006Lw7VC007173 for ; Mon, 6 Jan 2020 16:58:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id E6530F84E6; Mon, 6 Jan 2020 21:58:06 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E072CF9AB6 for ; Mon, 6 Jan 2020 21:58:06 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B4476800147 for ; Mon, 6 Jan 2020 21:58:06 +0000 (UTC) Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-345-_71bq9yvNwyqKHaGv_CCCw-1; Mon, 06 Jan 2020 16:58:04 -0500 Received: by mail-qk1-f180.google.com with SMTP id z76so41254710qka.2 for ; Mon, 06 Jan 2020 13:58:04 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347900; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=UaGeYIn9UN2+neUDo6+9y2yZ8cWOnAgKeLcgrjbPBls=; b=BQPDmtPHSkqthl+7fg13foO4P6NY1H+0vQZncXBX1iGfos6xhcNGtTItc5anRiIpBra6FK XVGPJQWgoagkVdeCp6WD86RhoVv4M4iTV6QMWKCApKqAquyAvwGHUqyLDXItFffKz5pQP4 pD3KgxcaBqTBcN2dJ43YFFWMLOYLtxU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+DDhVzmYYANDNmGgWmUxj3cJMWbiEHBrpmiR10vuB0M=; b=qi2f0Hwh9BauoKMwolfosUtz2McoRlmj6jNiA6ZlP4BsAiZeE4KtXtn7sM0xCMR4QP N0zn+YwcAKFC40VilnvxP0RkCCRklV1MA6bR8dqULzXBgVz38R3+76oo48ZXZKJ4XXjh W6AMpir0dgFpzzS1bKBLoBqTxfPxw5pw7ToNENbpGrryGSsKDmZB60ye0Soc7NNWYqPX qALBnpXHVvUHHuZWYI69YO64ji0xSOmFrro6uY4xrt6/IR5OU7XIHSVww+BuiMHjlDcG iKwuj+aZXn/bZfzzEbGJLAnraiStrugSBXSLAaHOL/2STjfUNv+2KgyqyDp6anDd05zh XB9Q== X-Gm-Message-State: APjAAAXomKp2KSW3NJV4LCdu495B10HDgFq+yozaQIzCbZ4oLWdN/CgN p6wwDAis9la8OAe28OBBEBshmvEl X-Google-Smtp-Source: APXvYqxJOkp94Y0RzR/ZdSSxrudTcPOoVbw/0Fc2Nemmbe1Sz9ogf5JIs5P18X8gaV5oKiRgIG9DkA== X-Received: by 2002:a37:88c2:: with SMTP id k185mr86677684qkd.317.1578347884002; Mon, 06 Jan 2020 13:58:04 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:28 -0300 Message-Id: <20200106215750.361615-5-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: _71bq9yvNwyqKHaGv_CCCw-1 X-MC-Unique: 2W_JT65uOLGG8QxUvHPWgA-1 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006Lw7VC007173 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 04/26] conf/domain_conf.c: remove unneeded labels 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.22 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/conf/domain_conf.c | 192 ++++++++++++++--------------------------- 1 file changed, 65 insertions(+), 127 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index ee33b7caf0..c026fdf45c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3682,8 +3682,6 @@ virDomainObjSetDefTransient(virDomainXMLOptionPtr xml= opt, virDomainObjPtr domain, void *parseOpaque) { - int ret =3D -1; - if (!domain->persistent) return 0; =20 @@ -3692,11 +3690,9 @@ virDomainObjSetDefTransient(virDomainXMLOptionPtr xm= lopt, =20 if (!(domain->newDef =3D virDomainDefCopy(domain->def, xmlopt, parseOpaque, false))) - goto out; + return -1; =20 - ret =3D 0; - out: - return ret; + return 0; } =20 =20 @@ -7701,7 +7697,6 @@ static int virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr node, virDomainHostdevDefPtr def) { - int ret =3D -1; bool got_product, got_vendor; xmlNodePtr cur; virDomainHostdevSubsysUSBPtr usbsrc =3D &def->source.subsys.u.usb; @@ -7715,7 +7710,7 @@ virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr node, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unknown startup policy '%s'"), startupPolicy); - goto out; + return -1; } } =20 @@ -7738,12 +7733,12 @@ virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr nod= e, if (virStrToLong_ui(vendor, NULL, 0, &usbsrc->vendor) = < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("cannot parse vendor id %s"), ven= dor); - goto out; + return -1; } } else { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("usb vendor needs id")); - goto out; + return -1; } } else if (virXMLNodeNameEqual(cur, "product")) { g_autofree char *product =3D virXMLPropString(cur, "id"); @@ -7755,12 +7750,12 @@ virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr nod= e, virReportError(VIR_ERR_INTERNAL_ERROR, _("cannot parse product %s"), product); - goto out; + return -1; } } else { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("usb product needs id")); - goto out; + return -1; } } else if (virXMLNodeNameEqual(cur, "address")) { g_autofree char *bus =3D NULL; @@ -7771,12 +7766,12 @@ virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr nod= e, if (virStrToLong_ui(bus, NULL, 0, &usbsrc->bus) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("cannot parse bus %s"), bus); - goto out; + return -1; } } else { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("usb address needs bus id")); - goto out; + return -1; } =20 device =3D virXMLPropString(cur, "device"); @@ -7785,18 +7780,18 @@ virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr nod= e, virReportError(VIR_ERR_INTERNAL_ERROR, _("cannot parse device %s"), device); - goto out; + return -1; } } else { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("usb address needs device id")); - goto out; + return -1; } } else { virReportError(VIR_ERR_INTERNAL_ERROR, _("unknown usb source type '%s'"), cur->name); - goto out; + return -1; } } cur =3D cur->next; @@ -7805,23 +7800,21 @@ virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr nod= e, if (got_vendor && usbsrc->vendor =3D=3D 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("vendor cannot be 0.")); - goto out; + return -1; } =20 if (!got_vendor && got_product) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing vendor")); - goto out; + return -1; } if (got_vendor && !got_product) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing product")); - goto out; + return -1; } =20 - ret =3D 0; - out: - return ret; + return 0; } =20 /* The internal XML for host PCI device's original states: @@ -7865,7 +7858,6 @@ virDomainHostdevSubsysPCIDefParseXML(xmlNodePtr node, virDomainHostdevDefPtr def, unsigned int flags) { - int ret =3D -1; xmlNodePtr cur; =20 cur =3D node->children; @@ -7876,25 +7868,23 @@ virDomainHostdevSubsysPCIDefParseXML(xmlNodePtr nod= e, &def->source.subsys.u.pci.addr; =20 if (virPCIDeviceAddressParseXML(cur, addr) < 0) - goto out; + return -1; } else if ((flags & VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES) && virXMLNodeNameEqual(cur, "origstates")) { virDomainHostdevOrigStatesPtr states =3D &def->origstates; if (virDomainHostdevSubsysPCIOrigStatesDefParseXML(cur, st= ates) < 0) - goto out; + return -1; } else { virReportError(VIR_ERR_INTERNAL_ERROR, _("unknown pci source type '%s'"), cur->name); - goto out; + return -1; } } cur =3D cur->next; } =20 - ret =3D 0; - out: - return ret; + return 0; } =20 =20 @@ -8622,7 +8612,6 @@ virDomainHostdevDefParseXMLCaps(xmlNodePtr node G_GNU= C_UNUSED, virDomainHostdevDefPtr def) { xmlNodePtr sourcenode; - int ret =3D -1; =20 /* @type is passed in from the caller rather than read from the * xml document, because it is specified in different places for @@ -8638,18 +8627,18 @@ virDomainHostdevDefParseXMLCaps(xmlNodePtr node G_G= NUC_UNUSED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown host device source address type '%s'= "), type); - goto error; + return -1; } } else { virReportError(VIR_ERR_XML_ERROR, "%s", _("missing source address type")); - goto error; + return -1; } =20 if (!(sourcenode =3D virXPathNode("./source", ctxt))) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Missing element in hostdev device")); - goto error; + return -1; } =20 switch (def->source.caps.type) { @@ -8658,7 +8647,7 @@ virDomainHostdevDefParseXMLCaps(xmlNodePtr node G_GNU= C_UNUSED, virXPathString("string(./source/block[1])", ctxt))) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Missing element in hostdev storage d= evice")); - goto error; + return -1; } break; case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_MISC: @@ -8666,7 +8655,7 @@ virDomainHostdevDefParseXMLCaps(xmlNodePtr node G_GNU= C_UNUSED, virXPathString("string(./source/char[1])", ctxt))) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Missing element in hostdev character = device")); - goto error; + return -1; } break; case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_NET: @@ -8674,21 +8663,20 @@ virDomainHostdevDefParseXMLCaps(xmlNodePtr node G_G= NUC_UNUSED, virXPathString("string(./source/interface[1])", ctxt))) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Missing element in hostdev net d= evice")); - goto error; + return -1; } if (virDomainNetIPInfoParseXML(_("Domain hostdev device"), ctxt, &def->source.caps.u.net.ip) <= 0) - goto error; + return -1; break; default: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("address type=3D'%s' not supported in hostdev int= erfaces"), virDomainHostdevCapsTypeToString(def->source.caps.t= ype)); - goto error; + return -1; } - ret =3D 0; - error: - return ret; + + return 0; } =20 =20 @@ -9166,13 +9154,11 @@ virDomainLeaseDefParseXML(xmlNodePtr node) def->lockspace =3D g_steal_pointer(&lockspace); def->path =3D g_steal_pointer(&path); =20 - cleanup: return def; =20 error: virDomainLeaseDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 static int @@ -11084,13 +11070,11 @@ virDomainControllerDefParseXML(virDomainXMLOption= Ptr xmlopt, break; } =20 - cleanup: return def; =20 error: virDomainControllerDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 =20 @@ -11277,13 +11261,11 @@ virDomainFSDefParseXML(virDomainXMLOptionPtr xmlo= pt, if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0) goto error; =20 - cleanup: return def; =20 error: virDomainFSDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 static int @@ -13037,13 +13019,11 @@ virDomainChrDefParseXML(virDomainXMLOptionPtr xml= opt, goto error; } =20 - cleanup: return def; =20 error: virDomainChrDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 static virDomainSmartcardDefPtr @@ -13167,13 +13147,11 @@ virDomainSmartcardDefParseXML(virDomainXMLOptionP= tr xmlopt, goto error; } =20 - cleanup: return def; =20 error: virDomainSmartcardDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 /* Parse the XML definition for a TPM device @@ -13295,13 +13273,11 @@ virDomainTPMDefParseXML(virDomainXMLOptionPtr xml= opt, if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0) goto error; =20 - cleanup: return def; =20 error: virDomainTPMDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 static virDomainPanicDefPtr @@ -13327,13 +13303,11 @@ virDomainPanicDefParseXML(virDomainXMLOptionPtr x= mlopt, goto error; } =20 - cleanup: return panic; =20 error: virDomainPanicDefFree(panic); - panic =3D NULL; - goto cleanup; + return NULL; } =20 /* Parse the XML definition for an input device */ @@ -13485,13 +13459,11 @@ virDomainInputDefParseXML(virDomainXMLOptionPtr x= mlopt, &def->virtio) < 0) goto error; =20 - cleanup: return def; =20 error: virDomainInputDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 =20 @@ -13524,13 +13496,11 @@ virDomainHubDefParseXML(virDomainXMLOptionPtr xml= opt, if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0) goto error; =20 - cleanup: return def; =20 error: virDomainHubDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 =20 @@ -13649,12 +13619,11 @@ virDomainTimerDefParseXML(xmlNodePtr node, } } =20 - cleanup: return def; =20 error: VIR_FREE(def); - goto cleanup; + return def; } =20 =20 @@ -14525,13 +14494,12 @@ virDomainGraphicsDefParseXML(virDomainXMLOptionPt= r xmlopt, break; } =20 - cleanup: return def; =20 error: virDomainGraphicsDefFree(def); def =3D NULL; - goto cleanup; + return NULL; } =20 =20 @@ -14551,13 +14519,11 @@ virDomainSoundCodecDefParseXML(xmlNodePtr node) goto error; } =20 - cleanup: return def; =20 error: virDomainSoundCodecDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 =20 @@ -14613,13 +14579,11 @@ virDomainSoundDefParseXML(virDomainXMLOptionPtr x= mlopt, if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0) goto error; =20 - cleanup: return def; =20 error: virDomainSoundDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 =20 @@ -14703,13 +14667,11 @@ virDomainWatchdogDefParseXML(virDomainXMLOptionPt= r xmlopt, if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0) goto error; =20 - cleanup: return def; =20 error: virDomainWatchdogDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 =20 @@ -14816,13 +14778,12 @@ virDomainRNGDefParseXML(virDomainXMLOptionPtr xml= opt, &def->virtio) < 0) goto error; =20 - cleanup: return def; =20 error: virDomainRNGDefFree(def); def =3D NULL; - goto cleanup; + return NULL; } =20 =20 @@ -14882,13 +14843,11 @@ virDomainMemballoonDefParseXML(virDomainXMLOption= Ptr xmlopt, &def->virtio) < 0) goto error; =20 - cleanup: return def; =20 error: virDomainMemballoonDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 static virDomainNVRAMDefPtr @@ -15334,13 +15293,11 @@ virSysinfoParseXML(xmlNodePtr node, goto error; } =20 - cleanup: return def; =20 error: virSysinfoDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 unsigned int @@ -15528,16 +15485,15 @@ virDomainVideoDriverDefParseXML(xmlNodePtr node) return NULL; =20 if (VIR_ALLOC(def) < 0) - goto cleanup; + return def; =20 if ((val =3D virDomainVideoVGAConfTypeFromString(vgaconf)) <=3D 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unknown vgaconf value '%s'"), vgaconf); - goto cleanup; + return def; } def->vgaconf =3D val; =20 - cleanup: return def; } =20 @@ -15691,13 +15647,11 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr x= mlopt, =20 def->driver =3D virDomainVideoDriverDefParseXML(node); =20 - cleanup: return def; =20 error: virDomainVideoDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 static virDomainHostdevDefPtr @@ -15767,13 +15721,11 @@ virDomainHostdevDefParseXML(virDomainXMLOptionPtr= xmlopt, } } =20 - cleanup: return def; =20 error: virDomainHostdevDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 =20 @@ -15840,14 +15792,11 @@ virDomainRedirdevDefParseXML(virDomainXMLOptionPt= r xmlopt, goto error; } =20 - - cleanup: return def; =20 error: virDomainRedirdevDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 /* @@ -15963,13 +15912,11 @@ virDomainRedirFilterUSBDevDefParseXML(xmlNodePtr = node) goto error; } =20 - cleanup: return def; =20 error: VIR_FREE(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 static virDomainRedirFilterDefPtr @@ -16268,13 +16215,11 @@ virDomainSEVDefParseXML(xmlNodePtr sevNode, def->dh_cert =3D virXPathString("string(./dhCert)", ctxt); def->session =3D virXPathString("string(./session)", ctxt); =20 - cleanup: return def; =20 error: virDomainSEVDefFree(def); - def =3D NULL; - goto cleanup; + return NULL; } =20 static virDomainMemoryDefPtr @@ -18222,7 +18167,7 @@ virDomainIdmapDefParseXML(xmlXPathContextPtr ctxt, VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 if (VIR_ALLOC_N(idmap, num) < 0) - goto cleanup; + return idmap; =20 for (i =3D 0; i < num; i++) { ctxt->node =3D node[i]; @@ -18232,7 +18177,7 @@ virDomainIdmapDefParseXML(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_XML_ERROR, "%s", _("invalid idmap start/target/count settings")); VIR_FREE(idmap); - goto cleanup; + return NULL; } } =20 @@ -18244,10 +18189,9 @@ virDomainIdmapDefParseXML(xmlXPathContextPtr ctxt, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("You must map the root user of container")); VIR_FREE(idmap); - goto cleanup; + return NULL; } =20 - cleanup: return idmap; } =20 @@ -18284,13 +18228,12 @@ virDomainIOThreadIDDefParseXML(xmlNodePtr node) goto error; } =20 - cleanup: return iothrid; =20 error: virDomainIOThreadIDDefFree(iothrid); iothrid =3D NULL; - goto cleanup; + return iothrid; } =20 =20 @@ -28984,18 +28927,15 @@ virDomainObjFormat(virDomainObjPtr obj, =20 if (xmlopt->privateData.format && xmlopt->privateData.format(&buf, obj) < 0) - goto error; + return NULL; =20 if (virDomainDefFormatInternal(obj->def, xmlopt, &buf, flags) < 0) - goto error; + return NULL; =20 virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "\n"); =20 return virBufferContentAndReset(&buf); - - error: - return NULL; } =20 static bool @@ -29302,7 +29242,7 @@ virDomainChrDefForeach(virDomainDefPtr def, rc =3D -1; =20 if (abortOnError && rc !=3D 0) - goto done; + return rc; } =20 for (i =3D 0; i < def->nparallels; i++) { @@ -29312,7 +29252,7 @@ virDomainChrDefForeach(virDomainDefPtr def, rc =3D -1; =20 if (abortOnError && rc !=3D 0) - goto done; + return rc; } =20 for (i =3D 0; i < def->nchannels; i++) { @@ -29322,7 +29262,7 @@ virDomainChrDefForeach(virDomainDefPtr def, rc =3D -1; =20 if (abortOnError && rc !=3D 0) - goto done; + return rc; } for (i =3D 0; i < def->nconsoles; i++) { if (virDomainSkipBackcompatConsole(def, i, false)) @@ -29333,10 +29273,9 @@ virDomainChrDefForeach(virDomainDefPtr def, rc =3D -1; =20 if (abortOnError && rc !=3D 0) - goto done; + return rc; } =20 - done: return rc; } =20 @@ -29357,10 +29296,9 @@ virDomainSmartcardDefForeach(virDomainDefPtr def, rc =3D -1; =20 if (abortOnError && rc !=3D 0) - goto done; + return rc; } =20 - done: return rc; } =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347922; cv=none; d=zohomail.com; s=zohoarc; b=FEa7SHCmTiErZjpNmDCcVR2dymE0ZAcykj05ud/deOqfVMj9Jo0L2ojh9+0aXluD+pEwnw8CiWyIeAPVJMnmgboLtsgo3reT+sDeqQdzWy/T2T5aRF4hD/tqNo1dPj7PjXo8XHAZNm7+TYJzxQ1h2pOOxb9KmWluX1rvJvO3ick= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347922; h=Content-Type:Content-Transfer-Encoding:Cc: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=aJdhhLb4Gsdo7hZGUwJFWjDIs96hQ/en14hZzROeVdc=; b=fvuDEJkdwcYRphiqukvvPhT35iCyAatl0jLcCLmCNhOwsQiSD0zgUBh5wCGYQjU5UtN1tcu7cy9L/NDBKzFYUsxFgw+izRCLA53aPEOuY/bESu+xi3s72/8ayDhe2uwywoc0uEcj3x+D2JS6BPhsGFLX86wH+NNpwaJzuhtweaE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1578347922619181.50598705711184; Mon, 6 Jan 2020 13:58:42 -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-384-_hmnYaC4M7yCde4F7C8ecA-1; Mon, 06 Jan 2020 16:58:38 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 56AD6107ACE6; Mon, 6 Jan 2020 21:58:31 +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 2F0BC1084199; Mon, 6 Jan 2020 21:58:31 +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 E3AD118089CE; Mon, 6 Jan 2020 21:58:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006Lw8O8007179 for ; Mon, 6 Jan 2020 16:58:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2B85A2166B2A; Mon, 6 Jan 2020 21:58:08 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 26F6A2166B29 for ; Mon, 6 Jan 2020 21:58:08 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 08E2C802085 for ; Mon, 6 Jan 2020 21:58:08 +0000 (UTC) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-242-POA1CUGVOpKPzFnt9Z23EQ-1; Mon, 06 Jan 2020 16:58:05 -0500 Received: by mail-qt1-f175.google.com with SMTP id t3so43694310qtr.11 for ; Mon, 06 Jan 2020 13:58:05 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347921; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=aJdhhLb4Gsdo7hZGUwJFWjDIs96hQ/en14hZzROeVdc=; b=Nqtke9ONfM+3xbJo8FdZdnDHDAj0QLLeT5Y1IvblvWwg/8/7hcqlmFsaq1Vc8OQp7ruAVI XY+IoelG12KeRPBjRH5gUopKvjqnqbsg1sjPxSGhPRS+ONpN/cVg6N/p522wtBpZdf8SDd OCfArflZaCoxxCFq+GneQl3ZtIwg7nU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l1w84g05g55WhLgLf2fRyWlJJtTfhJbwM1YuPrb9Ll4=; b=EHoWLsHO/2cjU2mdyqcAYWH9ncbv9ljOe4tLMd2CBQnjZesLf0fbCQTzVrKJrTzT5H gPF3x2+wbCp7y9OThmtTuD1RIUeP8cSrxqv3jRvftmPHZ1CXb0qxWGLCAWXE2+mIeRyi FXlaBpzus9a2zxqyRUeN9kDvQXBGSlV3w9AeGwUFJmSfp/JZaS+4IeMyQzd+DlZe+Ic4 xSIjEFVqoC0gL5N6IUyqLmGfpRNV9NNLRaCl0UmiGcY+9TGGmvRWOAzTKuMXACsV2OoX wb/cCl24zvC+vvx31XQmmhYW2E4hXQNvMqv3Oh1IsNn5Voxu0hw8pW0BB+mpz/5A0qUN uqWQ== X-Gm-Message-State: APjAAAWyn99i5Y/4bnYlAxF39HrBm/QDcGO7VKpXz5GJRmM+ceLloeTU zdY221fGseP6ZigtiB2IBihfXE/M X-Google-Smtp-Source: APXvYqyFkO0D2q/A+mU8BshlVu8/P2+/LvDx6gjvCztOCiKamDkXOxfRq+vbC+KBHiEb2rdoo+HoRg== X-Received: by 2002:ac8:2bf8:: with SMTP id n53mr57855097qtn.1.1578347885271; Mon, 06 Jan 2020 13:58:05 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:29 -0300 Message-Id: <20200106215750.361615-6-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: POA1CUGVOpKPzFnt9Z23EQ-1 X-MC-Unique: _hmnYaC4M7yCde4F7C8ecA-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006Lw8O8007179 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 05/26] test/test_driver.c: remove unneeded labels 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.22 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/test/test_driver.c | 51 ++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index f8e08dcf07..1908185743 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -791,7 +791,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathCont= extPtr ctxt) } else if (ret =3D=3D -2) { virReportError(VIR_ERR_XML_ERROR, "%s", _("invalid node cpu nodes value")); - goto error; + return -1; } =20 ret =3D virXPathLong("string(/node/cpu/sockets[1])", ctxt, &l); @@ -800,7 +800,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathCont= extPtr ctxt) } else if (ret =3D=3D -2) { virReportError(VIR_ERR_XML_ERROR, "%s", _("invalid node cpu sockets value")); - goto error; + return -1; } =20 ret =3D virXPathLong("string(/node/cpu/cores[1])", ctxt, &l); @@ -809,7 +809,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathCont= extPtr ctxt) } else if (ret =3D=3D -2) { virReportError(VIR_ERR_XML_ERROR, "%s", _("invalid node cpu cores value")); - goto error; + return -1; } =20 ret =3D virXPathLong("string(/node/cpu/threads[1])", ctxt, &l); @@ -818,7 +818,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathCont= extPtr ctxt) } else if (ret =3D=3D -2) { virReportError(VIR_ERR_XML_ERROR, "%s", _("invalid node cpu threads value")); - goto error; + return -1; } =20 nodeInfo->cpus =3D (nodeInfo->cores * nodeInfo->threads * @@ -830,7 +830,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathCont= extPtr ctxt) } else if (ret =3D=3D -2) { virReportError(VIR_ERR_XML_ERROR, "%s", _("invalid node cpu active value")); - goto error; + return -1; } ret =3D virXPathLong("string(/node/cpu/mhz[1])", ctxt, &l); if (ret =3D=3D 0) { @@ -838,7 +838,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathCont= extPtr ctxt) } else if (ret =3D=3D -2) { virReportError(VIR_ERR_XML_ERROR, "%s", _("invalid node cpu mhz value")); - goto error; + return -1; } =20 str =3D virXPathString("string(/node/cpu/model[1])", ctxt); @@ -846,7 +846,7 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathCont= extPtr ctxt) if (virStrcpyStatic(nodeInfo->model, str) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Model %s too big for destination"), str); - goto error; + return -1; } } =20 @@ -856,12 +856,10 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathCo= ntextPtr ctxt) } else if (ret =3D=3D -2) { virReportError(VIR_ERR_XML_ERROR, "%s", _("invalid node memory value")); - goto error; + return -1; } =20 return 0; - error: - return -1; } =20 static int @@ -871,7 +869,6 @@ testParseDomainSnapshots(testDriverPtr privconn, xmlXPathContextPtr ctxt) { size_t i; - int ret =3D -1; testDomainNamespaceDefPtr nsdata =3D domobj->def->namespaceData; xmlNodePtr *nodes =3D nsdata->snap_nodes; bool cur; @@ -882,7 +879,7 @@ testParseDomainSnapshots(testDriverPtr privconn, xmlNodePtr node =3D testParseXMLDocFromFile(nodes[i], file, "domainsnapshot"); if (!node) - goto error; + return -1; =20 def =3D virDomainSnapshotDefParseNode(ctxt->doc, node, privconn->xmlopt, @@ -892,18 +889,18 @@ testParseDomainSnapshots(testDriverPtr privconn, VIR_DOMAIN_SNAPSHOT_PARSE_INTE= RNAL | VIR_DOMAIN_SNAPSHOT_PARSE_REDE= FINE); if (!def) - goto error; + return -1; =20 if (!(snap =3D virDomainSnapshotAssignDef(domobj->snapshots, def))= ) { virObjectUnref(def); - goto error; + return -1; } =20 if (cur) { if (virDomainSnapshotGetCurrent(domobj->snapshots)) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("more than one snapshot claims to be acti= ve")); - goto error; + return -1; } =20 virDomainSnapshotSetCurrent(domobj->snapshots, snap); @@ -914,12 +911,10 @@ testParseDomainSnapshots(testDriverPtr privconn, virReportError(VIR_ERR_INTERNAL_ERROR, _("Snapshots have inconsistent relations for " "domain %s"), domobj->def->name); - goto error; + return -1; } =20 - ret =3D 0; - error: - return ret; + return 0; } =20 static int @@ -1236,27 +1231,25 @@ testOpenParse(testDriverPtr privconn, if (!virXMLNodeNameEqual(ctxt->node, "node")) { virReportError(VIR_ERR_XML_ERROR, "%s", _("Root element is not 'node'")); - goto error; + return -1; } =20 if (testParseNodeInfo(&privconn->nodeInfo, ctxt) < 0) - goto error; + return -1; if (testParseDomains(privconn, file, ctxt) < 0) - goto error; + return -1; if (testParseNetworks(privconn, file, ctxt) < 0) - goto error; + return -1; if (testParseInterfaces(privconn, file, ctxt) < 0) - goto error; + return -1; if (testParseStorage(privconn, file, ctxt) < 0) - goto error; + return -1; if (testParseNodedevs(privconn, file, ctxt) < 0) - goto error; + return -1; if (testParseAuthUsers(privconn, ctxt) < 0) - goto error; + return -1; =20 return 0; - error: - return -1; } =20 /* No shared state between simultaneous test connections initialized --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347927; cv=none; d=zohomail.com; s=zohoarc; b=D+PxHLAddEfBusmhygNv75LiWzdsxDC2XcPjq3hsPeoEiLa9/GuQhiSFaZciMp6uoemqZW+qFh7aOD06EdYtSxISAQTgJP6fHYHvVrblQgvjF2FyCxsYZzNY+0aTtjcAMZm0arx+WMsasg6H5b5W3E5nfq1CmAEXpdnhgtQpjKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347927; h=Content-Type:Content-Transfer-Encoding:Cc: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=shB/l8kI7PfP00zhApRbIKTy/5+UdFpu9rxsR+Hw85s=; b=aSG8dvPM+/Rws7PsJ03INq0DIzccHVSIUcEGhlQyDTXYbO4j5lh8naSpYRkaxSpBEUDKMhg8D4yYGGKm3YLnlMsxbo8QnSFMLybA97hiK3pU/Igcp7QTSbz5EcUUmMT0Sm1zsp9peFZF1fI3xXOIUWMttWDk4hlvRqydq8WdC4A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1578347927076961.5973994578397; Mon, 6 Jan 2020 13:58:47 -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-20-JGP4V_nmOKGdh_tevPceBQ-1; Mon, 06 Jan 2020 16:58:44 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 01C8E8024DE; Mon, 6 Jan 2020 21:58:35 +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 CD69785F0D; Mon, 6 Jan 2020 21:58:34 +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 8220681C84; Mon, 6 Jan 2020 21:58:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006Lw8h8007193 for ; Mon, 6 Jan 2020 16:58:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id C8E722166B2C; Mon, 6 Jan 2020 21:58:08 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C4E3A2166B2A for ; Mon, 6 Jan 2020 21:58:08 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A704218AE950 for ; Mon, 6 Jan 2020 21:58:08 +0000 (UTC) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-198-6oQ6KhodMTiWvn2cs7oPFw-1; Mon, 06 Jan 2020 16:58:07 -0500 Received: by mail-qt1-f175.google.com with SMTP id t3so43694343qtr.11 for ; Mon, 06 Jan 2020 13:58:06 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347926; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=shB/l8kI7PfP00zhApRbIKTy/5+UdFpu9rxsR+Hw85s=; b=f2VEotaV98y7TKr3myKfJC7Rg2CVMrCtM0sdArGy4Io0RBfxWCqusSGrvyr4ZxddY8cLVh pnyCp1v2Zg5/41SFG5W1lz9BDnws6RI/BQ12UjeMLKTvlP91+cMAPmqK1bFJoUHdvze/4I VkVlfvVj3kEkJELxaYf8BZGvEJ/c+hU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l743tE+n+Sg+ETvbin4Gwjo6zFqnRsyv4M3e+r+y25c=; b=SIxuG0fe58tW5VbAX1S0mUc6QE0kRLjCbk3N5yMTzdVVNQp30uxZzfMLnp5xaLEpSn FmT57RsnZeLxbH+IB6ceI6DJV1NxiXFOAt+IYJK+o2f0KNuVgB574ycLdmPYUjQPZxq2 WFhPNZDeRf5JUxTYqZrRBUskBJUUoZTSgMa1AsZ7343HlHzBW8JCPY+oXZYij+F08sfg eRpqhvD2N1Aapo8jpzDuVOUBfhpEsZRnKPj7WjWNwTKHxGaJjvWt58GghXJNYLng+Oj9 NIo2IYIsEuwEWJlqU7juoiDVpgQ4Dwdf0ExosbESsV8CcuyOdJyXhmRmJy1mhviA47Lw c3eg== X-Gm-Message-State: APjAAAWdthwKL3t9relnL/kpdN/vtjLCDDlg5KvgaCV2jQFECn1Hgzth Ps/5SMYiq6DbT5Cb4ZdLqBxyHFGR X-Google-Smtp-Source: APXvYqxQekXOGblr66as6b+Sdd8B1xswZ78yqAyWVAu2rHJ8ogYCQLyRWCTHb2WHUVGGWd7NOw4r/A== X-Received: by 2002:ac8:7297:: with SMTP id v23mr76030284qto.135.1578347886491; Mon, 06 Jan 2020 13:58:06 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:30 -0300 Message-Id: <20200106215750.361615-7-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: 6oQ6KhodMTiWvn2cs7oPFw-1 X-MC-Unique: JGP4V_nmOKGdh_tevPceBQ-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006Lw8h8007193 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 06/26] storage: remove unneeded labels 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.13 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/storage/storage_backend_iscsi_direct.c | 4 +--- src/storage/storage_driver.c | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/storage/storage_backend_iscsi_direct.c b/src/storage/stora= ge_backend_iscsi_direct.c index 2afa617cc1..3a5e2bb9f0 100644 --- a/src/storage/storage_backend_iscsi_direct.c +++ b/src/storage/storage_backend_iscsi_direct.c @@ -572,13 +572,11 @@ virStorageBackendISCSIDirectSetConnection(virStorageP= oolObjPtr pool, if (portalRet) *portalRet =3D g_steal_pointer(&portal); =20 - cleanup: return iscsi; =20 error: iscsi_destroy_context(iscsi); - iscsi =3D NULL; - goto cleanup; + return NULL; } =20 static int diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 6bbf52f729..0bb116cf08 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -2771,13 +2771,13 @@ storageConnectStoragePoolEventRegisterAny(virConnec= tPtr conn, int callbackID =3D -1; =20 if (virConnectStoragePoolEventRegisterAnyEnsureACL(conn) < 0) - goto cleanup; + return -1; =20 if (virStoragePoolEventStateRegisterID(conn, driver->storageEventState, pool, eventID, callback, opaque, freecb, &callbackID) < = 0) callbackID =3D -1; - cleanup: + return callbackID; } =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347927; cv=none; d=zohomail.com; s=zohoarc; b=AO98z2I6EEEcrJ4TepDivh6hziosgifyHo1YwBXAN3OJToX/puJdrN73nf5by6DbHlA71u+4PhPv6Z1uWT1FEECn6b7caidObDOSUWNrxZfRdNlrInxQ91ddQm0U7XMVgZeZtZ7T50GqctrLjkaOIUgeHJZl380d84hzqjiOjGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347927; h=Content-Type:Content-Transfer-Encoding:Cc: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=+V88OAbNgL+MaFW0+E6BxSghaMWkWosdDdrAC76Jnpo=; b=c9e0FbcxjQ5bt2Hn9QF3bpIbkQRzeDyX5d/fnlO1MLela3zLJ1Qx8guCUy7r25vuPvCWHoMmEfyon8jXdxSrk6wvZG9nkiiemu2wMRaY42qDWA5vV7ODVFaDBC/TDKqwpyJ2M+TmTRe/c6KDggaUxdGrfRFwQ733+uyQrA6QV+k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1578347927603436.02118089331475; Mon, 6 Jan 2020 13:58:47 -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-47-oHstOfe6PK6y3IGC0Aw1pw-1; Mon, 06 Jan 2020 16:58:44 -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 A5AA2800D4E; Mon, 6 Jan 2020 21:58:38 +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 7A8337C001; Mon, 6 Jan 2020 21:58:38 +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 29D7581C8B; Mon, 6 Jan 2020 21:58:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwA2F007215 for ; Mon, 6 Jan 2020 16:58:10 -0500 Received: by smtp.corp.redhat.com (Postfix) id A6B892166B2A; Mon, 6 Jan 2020 21:58:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A240C2166B29 for ; Mon, 6 Jan 2020 21:58:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 827E5801E9C for ; Mon, 6 Jan 2020 21:58:10 +0000 (UTC) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-229-yJdmS55KNRS6KM6_YGpd2Q-1; Mon, 06 Jan 2020 16:58:08 -0500 Received: by mail-qt1-f178.google.com with SMTP id n15so43725956qtp.5 for ; Mon, 06 Jan 2020 13:58:08 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347926; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=+V88OAbNgL+MaFW0+E6BxSghaMWkWosdDdrAC76Jnpo=; b=W96Kj/QOFiswEjV1Haw7DHNB76J6QRBNF5fWDdAh3Mp/UO45KnOLHCZehMPXrVFzP3RgPl nfnHX2wLOXXx7X3Jih/9X0EYItZhpGvZXNiqqFHMB7MsRUM/1zZM02O32PHEzg69KyFYn9 dQHymQnKjn5v3lO8T7JGwgZ44AVLr+4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ah3KWjuJH4Iv3bg2kDENH+sYqPqj7L89IRihpGQhBv0=; b=hic5+hGK03/2jPc4LlVwphLbvQ3QLffq8MRCofHBFCMCnEwAKpQAkn5h4fmYmER6X+ oatNRjwo/2eNuUaoNkBRnqZWZJ3EdFSxugv5BjgpOBP2Prm3VUR4h0NtsYUY9oN9mRZp /SYS1DliiBLXQlfFHjIEO13OyL3JUBVqkXK8yWOr5kB0YhKJ7QGoKNzj7FkQTjA9UM5Y V2SXOsU8Yn5NN1MNAEcTbke+bfwc/m96qohb7CNXcGQU4sGiu6DHr4FZo5actQWbZrli wHOFuHWHXi3xHNPPPd65O8GdLcKmV3TUsWMOOrrhP6ql7Nol5rWXjJoejRUDHq/OYhe0 acFw== X-Gm-Message-State: APjAAAUDR/3hm1wNcAKE+sQxtwuiW0GiZaWG2EdOAotEvb97kMfP5Z6Y xEmIlefulIIKWkVGTisM8iJwwEo7 X-Google-Smtp-Source: APXvYqyeyFW7ySSPY4JxQivbmNLQKCSLQF4/jyPOuqz1nnglJFp+/L9z9szS3HshdEVuRuo9wk/ULQ== X-Received: by 2002:ac8:490f:: with SMTP id e15mr73530446qtq.32.1578347887679; Mon, 06 Jan 2020 13:58:07 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:31 -0300 Message-Id: <20200106215750.361615-8-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: yJdmS55KNRS6KM6_YGpd2Q-1 X-MC-Unique: oHstOfe6PK6y3IGC0Aw1pw-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwA2F007215 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 07/26] nwfilter: remove unneeded labels 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 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/nwfilter/nwfilter_ebiptables_driver.c | 11 ++++------- src/nwfilter/nwfilter_learnipaddr.c | 3 +-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfil= ter_ebiptables_driver.c index 0cf8149193..eec1414023 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -1046,7 +1046,7 @@ iptablesHandlePortData(virFirewallPtr fw, if (printDataType(vars, portstr, sizeof(portstr), &portData->dataSrcPortStart) < 0) - goto err_exit; + return -1; =20 if (ENTRY_WANT_NEG_SIGN(&portData->dataSrcPortStart)) virFirewallRuleAddArg(fw, fwrule, "!"); @@ -1056,7 +1056,7 @@ iptablesHandlePortData(virFirewallPtr fw, if (printDataType(vars, portstralt, sizeof(portstralt), &portData->dataSrcPortEnd) < 0) - goto err_exit; + return -1; =20 virFirewallRuleAddArgFormat(fw, fwrule, "%s:%s", portstr, portstralt); @@ -1069,7 +1069,7 @@ iptablesHandlePortData(virFirewallPtr fw, if (printDataType(vars, portstr, sizeof(portstr), &portData->dataDstPortStart) < 0) - goto err_exit; + return -1; =20 if (ENTRY_WANT_NEG_SIGN(&portData->dataDstPortStart)) virFirewallRuleAddArg(fw, fwrule, "!"); @@ -1079,7 +1079,7 @@ iptablesHandlePortData(virFirewallPtr fw, if (printDataType(vars, portstralt, sizeof(portstralt), &portData->dataDstPortEnd) < 0) - goto err_exit; + return -1; =20 virFirewallRuleAddArgFormat(fw, fwrule, "%s:%s", portstr, portstralt); @@ -1089,9 +1089,6 @@ iptablesHandlePortData(virFirewallPtr fw, } =20 return 0; - - err_exit: - return -1; } =20 =20 diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_le= arnipaddr.c index 9b4fab7ffb..46ef65401c 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -725,7 +725,7 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr tech= driver, } =20 if (VIR_ALLOC(req) < 0) - goto err_no_req; + return -1; =20 if (!(req->binding =3D virNWFilterBindingDefCopy(binding))) goto err_free_req; @@ -752,7 +752,6 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr tech= driver, virNWFilterDeregisterLearnReq(ifindex); err_free_req: virNWFilterIPAddrLearnReqFree(req); - err_no_req: return -1; } =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347932; cv=none; d=zohomail.com; s=zohoarc; b=IzrHTg8jO4qpzYTguaQOgh/E6R/GK++zNDIHeBcHe8UBMNNYgP2KFickYrlOJDQyq/Xex2RMu1TNPGiaEGLBKGIK6Lfl9ebPcn2MgyK0lfQjIuWr2NEL7xfmTnriZrbkylh7o/pvFZFHdJjm0OzhLi997qauas1wpKafhoFeuZQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347932; h=Content-Type:Content-Transfer-Encoding:Cc: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=ZfXDzDG4oisFJdAgHCOAvXBSrmz+7UUamE/ba4t8P80=; b=f40mCjx7J+w7r74d+XFf0rgh9HK2JA7Pw5ofcfdDRLulfWJPPbeDKIe0yE41CFvG3HGrNRm7TigErMfBm8M3V/itX/ncZj/GMRHN6ovm5UGxyEFux6JNW2sMBsUzj+fd2hF1yu4yyoPY5XF/OmUvaIvHBnPjVUDfQE4ycfcEIcc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1578347932668575.6243172594886; Mon, 6 Jan 2020 13:58:52 -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-322-anMcCA62NYmL7Bku2UbwZw-1; Mon, 06 Jan 2020 16:58:48 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 422C0107BA9B; Mon, 6 Jan 2020 21:58:42 +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 1195860E1C; Mon, 6 Jan 2020 21:58:42 +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 C4D1D81C8C; Mon, 6 Jan 2020 21:58:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwEG2007234 for ; Mon, 6 Jan 2020 16:58:14 -0500 Received: by smtp.corp.redhat.com (Postfix) id 73F0B2022AA8; Mon, 6 Jan 2020 21:58:14 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6F65D2022AC6 for ; Mon, 6 Jan 2020 21:58:12 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 069D4101D223 for ; Mon, 6 Jan 2020 21:58:12 +0000 (UTC) Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-193-7zSasOCrMBCN577B4u9TWQ-1; Mon, 06 Jan 2020 16:58:10 -0500 Received: by mail-qk1-f173.google.com with SMTP id c16so40890389qko.6 for ; Mon, 06 Jan 2020 13:58:09 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347931; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=ZfXDzDG4oisFJdAgHCOAvXBSrmz+7UUamE/ba4t8P80=; b=VtNjjCqQ/P2hC3sr7/TRdNZZpenxaifelfeTJJNpE87dThi86Ei0hV5jlrs8nb+auFFbQW zTCFjoAoHWr8UQ5T9NygCKcmpkLYBv9uVICvTrBc1WsNtomm9VyIl/HBfiahuF1Cvmfw2X tWteuIYFoC2RY09uMxRVSLut3ciGC9s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M6mFsmOtYu8wGuLYnAT5M9MJ9HbxWJEmKX2ZJ5rEf+E=; b=jIR1MC0HRz88y3cJ3xdbkZUxt1bZhSpK2ieuoA9W6bWejfNhTIsb9GJ4kbd47O/dY6 NQ54fltVnG5ttcfgpvpi76EajnHvNCJO894BIEXkXcFlqn7LObhLXJGRDrQaCkd+NGZD 979bTo2+yhnVKi0voPR611rsbJpE+EQhI73oAirEEGokCemaZYq3Ua826hZQZi29EPkc y3kVR+I60AhCNXQbNFoY9TVdmuOpFSaAd0c+P7pPAuNIOki112Oa7mwsgfbbd0tiNrkm W+tfRVk+A7uqEPszxRzOygaEDmWuxQ2c7b+4p3ye4JrwHSzOz5qjhU4qMCrEjJlLaJQe ca2A== X-Gm-Message-State: APjAAAV9+OE8fBk5jfmcWeLMBZdivzkNseOyMTwjIC+YVmsW/hdTAxdN ZKd5hC+EX1BaMPDT3KLlyeubfWuJ X-Google-Smtp-Source: APXvYqznOHQEEMYmi474biWijXrSMgHX5Pm1n0YjZkq5Bowue2BuBNbB6hWnEvUtxEd5nIwVzVFZfw== X-Received: by 2002:a37:ad17:: with SMTP id f23mr83667842qkm.24.1578347889395; Mon, 06 Jan 2020 13:58:09 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:32 -0300 Message-Id: <20200106215750.361615-9-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: 7zSasOCrMBCN577B4u9TWQ-1 X-MC-Unique: anMcCA62NYmL7Bku2UbwZw-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwEG2007234 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 08/26] remote/remote_daemon_config.c: remove unneeded label 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.12 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/remote/remote_daemon_config.c | 101 +++++++++++++++--------------- 1 file changed, 49 insertions(+), 52 deletions(-) diff --git a/src/remote/remote_daemon_config.c b/src/remote/remote_daemon_c= onfig.c index 1d739caabf..0ecc49f179 100644 --- a/src/remote/remote_daemon_config.c +++ b/src/remote/remote_daemon_config.c @@ -230,19 +230,19 @@ daemonConfigLoadOptions(struct daemonConfig *data, { #ifdef WITH_IP if (virConfGetValueBool(conf, "listen_tcp", &data->listen_tcp) < 0) - goto error; + return -1; if (virConfGetValueBool(conf, "listen_tls", &data->listen_tls) < 0) - goto error; + return -1; if (virConfGetValueString(conf, "tls_port", &data->tls_port) < 0) - goto error; + return -1; if (virConfGetValueString(conf, "tcp_port", &data->tcp_port) < 0) - goto error; + return -1; if (virConfGetValueString(conf, "listen_addr", &data->listen_addr) < 0) - goto error; + return -1; #endif /* !WITH_IP */ =20 if (remoteConfigGetAuth(conf, filename, "auth_unix_rw", &data->auth_un= ix_rw) < 0) - goto error; + return -1; #if WITH_POLKIT /* Change default perms to be wide-open if PolicyKit is enabled. * Admin can always override in config file @@ -253,125 +253,122 @@ daemonConfigLoadOptions(struct daemonConfig *data, } #endif if (remoteConfigGetAuth(conf, filename, "auth_unix_ro", &data->auth_un= ix_ro) < 0) - goto error; + return -1; =20 #ifdef WITH_IP if (remoteConfigGetAuth(conf, filename, "auth_tcp", &data->auth_tcp) <= 0) - goto error; + return -1; if (remoteConfigGetAuth(conf, filename, "auth_tls", &data->auth_tls) <= 0) - goto error; + return -1; #endif /* ! WITH_IP */ =20 if (virConfGetValueStringList(conf, "access_drivers", false, &data->access_drivers) < 0) - goto error; + return -1; =20 if (virConfGetValueString(conf, "unix_sock_group", &data->unix_sock_gr= oup) < 0) - goto error; + return -1; if (virConfGetValueString(conf, "unix_sock_admin_perms", &data->unix_s= ock_admin_perms) < 0) - goto error; + return -1; if (virConfGetValueString(conf, "unix_sock_ro_perms", &data->unix_sock= _ro_perms) < 0) - goto error; + return -1; if (virConfGetValueString(conf, "unix_sock_rw_perms", &data->unix_sock= _rw_perms) < 0) - goto error; + return -1; =20 if (virConfGetValueString(conf, "unix_sock_dir", &data->unix_sock_dir)= < 0) - goto error; + return -1; =20 #ifdef WITH_IP if (virConfGetValueBool(conf, "tls_no_sanity_certificate", &data->tls_= no_sanity_certificate) < 0) - goto error; + return -1; if (virConfGetValueBool(conf, "tls_no_verify_certificate", &data->tls_= no_verify_certificate) < 0) - goto error; + return -1; =20 if (virConfGetValueString(conf, "key_file", &data->key_file) < 0) - goto error; + return -1; if (virConfGetValueString(conf, "cert_file", &data->cert_file) < 0) - goto error; + return -1; if (virConfGetValueString(conf, "ca_file", &data->ca_file) < 0) - goto error; + return -1; if (virConfGetValueString(conf, "crl_file", &data->crl_file) < 0) - goto error; + return -1; =20 if (virConfGetValueStringList(conf, "tls_allowed_dn_list", false, &data->tls_allowed_dn_list) < 0) - goto error; + return -1; =20 if (virConfGetValueString(conf, "tls_priority", &data->tls_priority) <= 0) - goto error; + return -1; #endif /* ! WITH_IP */ =20 if (virConfGetValueStringList(conf, "sasl_allowed_username_list", fals= e, &data->sasl_allowed_username_list) < 0) - goto error; + return -1; =20 if (virConfGetValueUInt(conf, "min_workers", &data->min_workers) < 0) - goto error; + return -1; if (virConfGetValueUInt(conf, "max_workers", &data->max_workers) < 0) - goto error; + return -1; if (data->max_workers < 1) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("'max_workers' must be greater than 0")); - goto error; + return -1; } if (virConfGetValueUInt(conf, "max_clients", &data->max_clients) < 0) - goto error; + return -1; if (virConfGetValueUInt(conf, "max_queued_clients", &data->max_queued_= clients) < 0) - goto error; + return -1; if (virConfGetValueUInt(conf, "max_anonymous_clients", &data->max_anon= ymous_clients) < 0) - goto error; + return -1; =20 if (virConfGetValueUInt(conf, "prio_workers", &data->prio_workers) < 0) - goto error; + return -1; =20 if (virConfGetValueUInt(conf, "max_client_requests", &data->max_client= _requests) < 0) - goto error; + return -1; =20 if (virConfGetValueUInt(conf, "admin_min_workers", &data->admin_min_wo= rkers) < 0) - goto error; + return -1; if (virConfGetValueUInt(conf, "admin_max_workers", &data->admin_max_wo= rkers) < 0) - goto error; + return -1; if (virConfGetValueUInt(conf, "admin_max_clients", &data->admin_max_cl= ients) < 0) - goto error; + return -1; if (virConfGetValueUInt(conf, "admin_max_queued_clients", &data->admin= _max_queued_clients) < 0) - goto error; + return -1; if (virConfGetValueUInt(conf, "admin_max_client_requests", &data->admi= n_max_client_requests) < 0) - goto error; + return -1; =20 if (virConfGetValueUInt(conf, "audit_level", &data->audit_level) < 0) - goto error; + return -1; if (virConfGetValueBool(conf, "audit_logging", &data->audit_logging) <= 0) - goto error; + return -1; =20 if (virConfGetValueString(conf, "host_uuid", &data->host_uuid) < 0) - goto error; + return -1; if (virConfGetValueString(conf, "host_uuid_source", &data->host_uuid_s= ource) < 0) - goto error; + return -1; =20 if (virConfGetValueUInt(conf, "log_level", &data->log_level) < 0) - goto error; + return -1; if (virConfGetValueString(conf, "log_filters", &data->log_filters) < 0) - goto error; + return -1; if (virConfGetValueString(conf, "log_outputs", &data->log_outputs) < 0) - goto error; + return -1; =20 if (virConfGetValueInt(conf, "keepalive_interval", &data->keepalive_in= terval) < 0) - goto error; + return -1; if (virConfGetValueUInt(conf, "keepalive_count", &data->keepalive_coun= t) < 0) - goto error; + return -1; =20 if (virConfGetValueInt(conf, "admin_keepalive_interval", &data->admin_= keepalive_interval) < 0) - goto error; + return -1; if (virConfGetValueUInt(conf, "admin_keepalive_count", &data->admin_ke= epalive_count) < 0) - goto error; + return -1; =20 if (virConfGetValueUInt(conf, "ovs_timeout", &data->ovs_timeout) < 0) - goto error; + return -1; =20 return 0; - - error: - return -1; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347916; cv=none; d=zohomail.com; s=zohoarc; b=bZ/A14H5GV6L//5kBrR/FNlsW87CL4DJxfy8V1lpL/wSpJoDZkHraw4qJuN9lv8DJK2HG+b0qXJVg3stO8sZthTNh49x7Frn2niYfL/tyokjLyli02FPGqjEHQXqck5yf+FHkpTBVL4AeLGHwgwHaZZOwyjBkx1w5CM08MKTx94= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347916; h=Content-Type:Content-Transfer-Encoding:Cc: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=TAyh2+EnBd1+CsJs3EVZ31qYyXseiK7/srStupXTWXE=; b=O7UvAamY0Z78I6pphZF2O6FKx+l0CDCfPFwyq5Au56EQH9FrykbdM+1dJJdnfXFjl2FHCuNYSReJf5mjJFPEC1AKFDVlWg9Z0rdrXnypTeOOvhdpDyJIyQPr9IVBPZJJI/v+OUHTVE/anXuCTng4PJcTtUcF6FSTHBwIoZ/5fJE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1578347916750444.95403696197445; Mon, 6 Jan 2020 13:58:36 -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-278-CnbtAjX5MWqMukZY7F9ZGQ-1; Mon, 06 Jan 2020 16:58:33 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 84CB4100551A; Mon, 6 Jan 2020 21:58:28 +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 0F4EF86C4C; Mon, 6 Jan 2020 21:58:28 +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 BBAB281C7D; Mon, 6 Jan 2020 21:58:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwDWU007227 for ; Mon, 6 Jan 2020 16:58:13 -0500 Received: by smtp.corp.redhat.com (Postfix) id 71F67F9ACB; Mon, 6 Jan 2020 21:58:13 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6CA36F9AB6 for ; Mon, 6 Jan 2020 21:58:13 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4922A811AAC for ; Mon, 6 Jan 2020 21:58:13 +0000 (UTC) Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-223-ZtiB6YdBMm6fuV-jytjsmQ-1; Mon, 06 Jan 2020 16:58:11 -0500 Received: by mail-qt1-f196.google.com with SMTP id 5so43710484qtz.1 for ; Mon, 06 Jan 2020 13:58:11 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347915; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=TAyh2+EnBd1+CsJs3EVZ31qYyXseiK7/srStupXTWXE=; b=I5I6FpK+UYiRIx4yVMMh7L+X2ObUrq+MV6rXkSpS9dLEYaUC50k32oUVCUhxF9vLmmUUJY lKLQzxKmhT7wfGBtrgawbNEWU6Jb23Cq7s9th+YFG4Wf4XUHbVFML3x3SZG/gUrE8y/Aok 9XOt6+0IAQ+q2bJBYfbScy/wD3nhtOQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wCFg+TGK6HAhr5M70Gj1qaTjThAqrLQl/vFqp7Y0+EE=; b=oaav4P0IjhjdEUgmLP/LtCVbqFyH6OTQHHRTWXA8GJr5WaNThxUnAJpuoCca+WYP58 2g77vGHBObYKAQL2rRTxs/Uqs5spjbGuVh20KHQq1EQJnWsQa5HqAdUkcyd3fdkxmwCT p40ESuMFFKWKwYAuEmMm0Y7//8n5nzXLL4+a2FS5CiK1gLuuUrHHUUUZh8OftZB0Nqo3 VcQ+GsykVil6jgScnL+ijE+b1Mkc/CJh8bBLrezerOrLCKXop6k+7wleZPqD2ZrEbfMx du5GHiPI+5ypDNcd6KqR4KMrUk3pTjzxfkxU9pGIerUOL3EHHTxWWiAg4G/rSjP8GX+L ggtw== X-Gm-Message-State: APjAAAVWDrJtwiYShnIGj2p6zajgIqns4ldhNJy3rfbMILv7wpjxGgPt roiBiFvmzMpzAKbuHddYvh5HmvyE X-Google-Smtp-Source: APXvYqx7Q6FcO/LfBEG0An0LbNf+Kx0st6n+hI9xzteElUT3kmyo/FMiS8Nt5QyxtHPLAOiBQGmxyw== X-Received: by 2002:aed:3344:: with SMTP id u62mr76232275qtd.73.1578347890716; Mon, 06 Jan 2020 13:58:10 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:33 -0300 Message-Id: <20200106215750.361615-10-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: ZtiB6YdBMm6fuV-jytjsmQ-1 X-MC-Unique: CnbtAjX5MWqMukZY7F9ZGQ-1 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwDWU007227 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 09/26] hyperv/hyperv_wmi.c: remove unneeded labels 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.13 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/hyperv/hyperv_wmi.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index 7d56677588..ca2d29733e 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -173,15 +173,15 @@ hypervCreateInvokeParamsList(hypervPrivate *priv, con= st char *method, hypervWmiClassInfoPtr info =3D NULL; =20 if (hypervGetWmiClassInfo(priv, obj, &info) < 0) - goto cleanup; + return NULL; =20 if (VIR_ALLOC(params) < 0) - goto cleanup; + return NULL; =20 if (VIR_ALLOC_N(params->params, HYPERV_DEFAULT_PARAM_COUNT) < 0) { VIR_FREE(params); - goto cleanup; + return NULL; } =20 params->method =3D method; @@ -191,7 +191,6 @@ hypervCreateInvokeParamsList(hypervPrivate *priv, const= char *method, params->nbParams =3D 0; params->nbAvailParams =3D HYPERV_DEFAULT_PARAM_COUNT; =20 - cleanup: return params; } =20 @@ -257,11 +256,10 @@ int hypervAddSimpleParam(hypervInvokeParamsListPtr params, const char *name, const char *value) { - int result =3D -1; hypervParamPtr p =3D NULL; =20 if (hypervCheckParams(params) < 0) - goto cleanup; + return -1; =20 p =3D ¶ms->params[params->nbParams]; p->type =3D HYPERV_SIMPLE_PARAM; @@ -271,10 +269,7 @@ hypervAddSimpleParam(hypervInvokeParamsListPtr params,= const char *name, =20 params->nbParams++; =20 - result =3D 0; - - cleanup: - return result; + return 0; } =20 /* --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347921; cv=none; d=zohomail.com; s=zohoarc; b=ia19fuh9n4iReZxqIVpwLsefZRg1FYQJ1f2xC6rnlPxHLo2eTv75Ow3muh9oDGkCgNVPSqfZxX1jMrED9OMxdg2u9VGlEnStg8gfIJ+nYlWx2LpyA4zJ/MN1EyX/gEVizGLVn7FtHs9uF6ZcQOe+jJKpedpV+vJvK/g6JOJjLKI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347921; h=Content-Type:Content-Transfer-Encoding:Cc: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=wz31r8/oSHDUaGB9DjTmK74JarHB/xBs+OSrs2KbeVw=; b=NSYjLySDRjHmpWe0u68Klprz6SZ8Of5Kb8D636oH9PLEGyuh01uw4TVQQKPz8xy83955SG3bW0/enmb+dN809LmIU+nRHE4CtQOSpfG3/5AY10UhI2DiT+L+QL2KM0LuIjkujIAKtMfKV7OPcAU29o3TXh0A4TwGZ92m7XemGvI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1578347921139362.7630381781298; Mon, 6 Jan 2020 13:58:41 -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-283-Lw2zCJd9OlixhQ1CG1C4nQ-1; Mon, 06 Jan 2020 16:58:38 -0500 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 D5DDCDBF1; Mon, 6 Jan 2020 21:58:31 +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 AF1BB7DB5B; Mon, 6 Jan 2020 21:58:31 +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 25FCA18089CF; Mon, 6 Jan 2020 21:58:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwFEI007241 for ; Mon, 6 Jan 2020 16:58:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 19790108BDA; Mon, 6 Jan 2020 21:58:15 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 14676108BDD for ; Mon, 6 Jan 2020 21:58:15 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EB4D6802A51 for ; Mon, 6 Jan 2020 21:58:14 +0000 (UTC) Received: from mail-qv1-f67.google.com (mail-qv1-f67.google.com [209.85.219.67]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-376-ylZjOsnsO1ahw8NkvdbeMA-1; Mon, 06 Jan 2020 16:58:13 -0500 Received: by mail-qv1-f67.google.com with SMTP id l14so19692476qvu.12 for ; Mon, 06 Jan 2020 13:58:13 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347920; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=wz31r8/oSHDUaGB9DjTmK74JarHB/xBs+OSrs2KbeVw=; b=UNV58CzIIBIKX1GdCLtKhXOf9TeRWNNHXbzLK+cHaIbnb8s55xAPzM/fx17iEaQsUouNpS 1pM06UidGogVn2F0LbHrZrO5IpQXrTZRKQU6LYKbRGCLocLJJhlY14u8YOYh08HxNOCYi+ JuK8U+GS5m20xTiHyzIn+fxxgbtgSwk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ui1qx6+hxkCm/f1A/W57QgpuUxYSX/3hUCVBBU5t+yw=; b=mQuHdjqh8feP1FtxtgQ361Ho0Detql2U84rScow7zU9AAO/I6C+ZGUeBF4unjEq99m fgdrofjG3RME8XKiLHBDvkSzO3hOfIIHTQoSvxUKSwvi6mD0SrQ6uYgSPeXp+zMvSEuR K+fvvPnoJXzj7Swwj9F1xkMYwJqAUv8UEZhzxW2Ek8MKAtrKpJvMVNS3g3Eax7FbLRnK ASHlhvjPIBeoTUEaEKZDYLBV5cywYePeFy0w6TianYEXJ/dtjoTReALhmLtet/8ow995 lYcoNlf9I7a0u7iJIvUcQGu6zNrw4Vo2/hA1rEv5mkX+S+d8Uf3/SUerdyfdkjheY6n1 wjHg== X-Gm-Message-State: APjAAAX2AzHIK5mmBpOxdPQHSM7zoE3HaB3zwtpDnmdGT7Qzu3nZrSEH gPv23/1yjYMWPjIdtyWh3ks8Rqai X-Google-Smtp-Source: APXvYqyy/JflYFagCR7NFrzfxS/nJ5IYO8l/2jrXWege8uCOFZA3GNfp/kJhG2wegGkH1lYVaccR5Q== X-Received: by 2002:a0c:c542:: with SMTP id y2mr6791627qvi.225.1578347892459; Mon, 06 Jan 2020 13:58:12 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:34 -0300 Message-Id: <20200106215750.361615-11-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: ylZjOsnsO1ahw8NkvdbeMA-1 X-MC-Unique: Lw2zCJd9OlixhQ1CG1C4nQ-1 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwFEI007241 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 10/26] locking/lock_driver_lockd.c: remove unneeded labels 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 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/locking/lock_driver_lockd.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lock= d.c index 339e2f6949..393154bb3c 100644 --- a/src/locking/lock_driver_lockd.c +++ b/src/locking/lock_driver_lockd.c @@ -140,7 +140,6 @@ virLockManagerLockDaemonConnectionRegister(virLockManag= erPtr lock, { virLockManagerLockDaemonPrivatePtr priv =3D lock->privateData; virLockSpaceProtocolRegisterArgs args; - int rv =3D -1; =20 memset(&args, 0, sizeof(args)); =20 @@ -157,12 +156,9 @@ virLockManagerLockDaemonConnectionRegister(virLockMana= gerPtr lock, 0, NULL, NULL, NULL, (xdrproc_t)xdr_virLockSpaceProtocolRegiste= rArgs, (char*)&args, (xdrproc_t)xdr_void, NULL) < 0) - goto cleanup; - - rv =3D 0; + return -1; =20 - cleanup: - return rv; + return 0; } =20 =20 @@ -173,7 +169,6 @@ virLockManagerLockDaemonConnectionRestrict(virLockManag= erPtr lock G_GNUC_UNUSED, int *counter) { virLockSpaceProtocolRestrictArgs args; - int rv =3D -1; =20 memset(&args, 0, sizeof(args)); =20 @@ -186,12 +181,9 @@ virLockManagerLockDaemonConnectionRestrict(virLockMana= gerPtr lock G_GNUC_UNUSED, 0, NULL, NULL, NULL, (xdrproc_t)xdr_virLockSpaceProtocolRestric= tArgs, (char*)&args, (xdrproc_t)xdr_void, NULL) < 0) - goto cleanup; - - rv =3D 0; + return -1; =20 - cleanup: - return rv; + return 0; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347923; cv=none; d=zohomail.com; s=zohoarc; b=G8XroEEV9pvAn1fOvwYcH9GXLtpzLjppH/DfSpCk78vb32nQPrMAPXEa+xSUL6cXQ08vPddXRWY32zWtADtsj815GzVZFIfKCtXHJflzQR53WH6glk0O6L5l0+EzPw4lJuO44Ef9AKfIKjOotTYg+jiQVpe9AniZj/R+WCZHynI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347923; h=Content-Type:Content-Transfer-Encoding:Cc: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=L3f+PpWu6Ldt/hanMrMUErYnzkW/VOuvjsM6FyUwcwM=; b=Dzy8GM247DiJJXJRPiyTMxkXTFmZ2HPtSmt1WvR+80hV+Sev/8aT2FxOQsuwEnALe2N6atQ+eaAGNeMajU34sXqPbd/bLGQtmFWROwK9ZPKiyhvyxpBoQUXS70VqkMwg8o4FikETG24DYllyFp+0Zd2JiusLcXi7jMsnnHpXTZ0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1578347923341310.54289063817214; Mon, 6 Jan 2020 13:58:43 -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-264-Da79Wbx0PjS1thqrFUFtDg-1; Mon, 06 Jan 2020 16:58:40 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A9578100550E; Mon, 6 Jan 2020 21:58:31 +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 8161560CD1; Mon, 6 Jan 2020 21:58:31 +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 3E6E481C81; Mon, 6 Jan 2020 21:58:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwG6X007250 for ; Mon, 6 Jan 2020 16:58:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2373E2166B2A; Mon, 6 Jan 2020 21:58:16 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1F61E2166B29 for ; Mon, 6 Jan 2020 21:58:16 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F2C3180D959 for ; Mon, 6 Jan 2020 21:58:15 +0000 (UTC) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-67-4EE5BG-7PC-nyVOqob0HYw-1; Mon, 06 Jan 2020 16:58:14 -0500 Received: by mail-qk1-f193.google.com with SMTP id x1so40855956qkl.12 for ; Mon, 06 Jan 2020 13:58:14 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347922; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=L3f+PpWu6Ldt/hanMrMUErYnzkW/VOuvjsM6FyUwcwM=; b=Q5UkLFyvzOEg37MNQC8rhQpHcMSmCE7MZb/ugc99tH1+a+IBCbH0Nl44ZUB5BjzwzTw80J yawkiuMmlkkZk3oUqzpMapOnsJDPBkIwi+DAtiOjMcpjijDvjZ+hRoOWxNuoTGrIYX9Aap UIuqDgorAl6GrlVS44oeQRcKj5vpsnw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oJwlQwT/RUoJkAzop5AIOGZrl4x8lUr3EpkLl+kdm1Y=; b=Hl+ev5Hmba4YcYciisOJO9fZEk78gq5Ie1oJCRZzMEia8Io5elaD4AloGoOxAydlYX +UAv220LlVPnxUlGMlhCuOg3qejROYp7qsuVMxJo4FEHEjP7s0qmN9I63AJ1TP6CHIH5 5IKATRXFOEIih5U8QOn+cjUO+M5n+mIEAqWHTdw78uVX+qHufx3gs3Edd3YKPJ2n3zYB HYtc7Ri/IhedNYmt8kCYdxQeM3rzTyZUvaQt39J5J6DLnYUcFSssiio9rv+RMVhgn3ld sgXO92vDdwJq+YHn6gnUh26wf+5mOu3HoLG089wefm00ykEcCTtzjWAcpdWTMiIKSOrz Z5XQ== X-Gm-Message-State: APjAAAVhS0vJXD7US+ZN7+CUGCwmJjILm9QQ8pWd4IjNCpx+62W/9qD7 tDc68e/eTFyKTWv2kgLh7/qC8IVF X-Google-Smtp-Source: APXvYqzbpLCbSmEerRuEeUbArhbbd32l9E1/Ox2QVTB+IargdDsYi637+1/JA27yBBmpUBPrwkubKQ== X-Received: by 2002:a05:620a:2013:: with SMTP id c19mr40216187qka.496.1578347893705; Mon, 06 Jan 2020 13:58:13 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:35 -0300 Message-Id: <20200106215750.361615-12-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: 4EE5BG-7PC-nyVOqob0HYw-1 X-MC-Unique: Da79Wbx0PjS1thqrFUFtDg-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwG6X007250 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 11/26] cpu/cpu_ppc64.c: remove unneeded label 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.12 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/cpu/cpu_ppc64.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 818f1ec699..6b3590ab6a 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -81,7 +81,6 @@ ppc64CheckCompatibilityMode(const char *host_model, int host; int compat; char *tmp; - virCPUCompareResult ret =3D VIR_CPU_COMPARE_ERROR; =20 if (!compat_mode) return VIR_CPU_COMPARE_IDENTICAL; @@ -94,7 +93,7 @@ ppc64CheckCompatibilityMode(const char *host_model, virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Host CPU does not support compatibility modes")); - goto out; + return VIR_CPU_COMPARE_ERROR; } =20 /* Valid compatibility modes: power6, power7, power8, power9 */ @@ -105,17 +104,14 @@ ppc64CheckCompatibilityMode(const char *host_model, virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown compatibility mode %s"), compat_mode); - goto out; + return VIR_CPU_COMPARE_ERROR; } =20 /* Version check */ if (compat > host) - ret =3D VIR_CPU_COMPARE_INCOMPATIBLE; - else - ret =3D VIR_CPU_COMPARE_IDENTICAL; + return VIR_CPU_COMPARE_INCOMPATIBLE; =20 - out: - return ret; + return VIR_CPU_COMPARE_IDENTICAL; } =20 static void --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347931; cv=none; d=zohomail.com; s=zohoarc; b=fZHXP7qGLx8nRWUYqv95LbITS6WJ5320A5yL7hGzGyd160fjKuMjsw1TzOUAfyIA8x8WvBdrgj+yQKhpLf1CiKMpJCQneqYEsHysi+lLA2hZks2Qk2/Wvh4q4fwmZEvdEufeg6+H4TWt1Bd8EmsFucFxJyd90TTqmzpPJikTP/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347931; h=Content-Type:Content-Transfer-Encoding:Cc: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=J1UFzhq2pXCuB/GxdlowEQXxfPw5Rm1NWSlh3Y3sRSc=; b=iieIg95T+12kWLNuEWp6MUxvvxFFqw7oEzGHC+F11ygBtyCTmU84AMcs8uouYiRB+AvjEBvAG1bk8JGI69B0AvxSG03+glKd/t3P+4T7Qku3KVFOHwLRYtwpa4KAXT8mllUU+Dw9Xav+esBdc0WD+qTzBWXv+Pfn0W2F6m3opPY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1578347931329256.7248810552385; Mon, 6 Jan 2020 13:58:51 -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-413-aWh_UdYINw-15fJhr_7ERQ-1; Mon, 06 Jan 2020 16:58:47 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1A63BDC04; Mon, 6 Jan 2020 21:58:39 +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 E0B4D101F942; Mon, 6 Jan 2020 21:58:38 +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 A06561800FCB; Mon, 6 Jan 2020 21:58:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwOtH007313 for ; Mon, 6 Jan 2020 16:58:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id 97C1AF84E6; Mon, 6 Jan 2020 21:58:24 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 92EDF108BD7 for ; Mon, 6 Jan 2020 21:58:21 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A995F800147 for ; Mon, 6 Jan 2020 21:58:21 +0000 (UTC) Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-100-clK4XVSbPPmJW7WoXYEF-Q-1; Mon, 06 Jan 2020 16:58:16 -0500 Received: by mail-qk1-f181.google.com with SMTP id x1so40856041qkl.12 for ; Mon, 06 Jan 2020 13:58:16 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347930; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=J1UFzhq2pXCuB/GxdlowEQXxfPw5Rm1NWSlh3Y3sRSc=; b=PWTfsEZPoc/vSkyY2odxQU2KeLIiWOZIQAQHvmrIsZtai4D5xMDOHYud9wfZ0NxkGYbEZ0 KAWFhd3/9+LHbeHPH6t+fgUH6oIiQtpwPSO6zUepWFkzA0WltexDiqkUHVn9ip0i5Tcdf8 RKDmDCdwIh2mbxUw2O448xIwoQHvXkM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2G/Rj1CDI/KLScFIcyidLIi2XZQDlT5Te5lC4M7YOj4=; b=bX1aIozt+7G6pGHpYqe+n3+g5717lPh+1P+QvCRmGdRiLFPjB441C5y13WeIGcKYAg rKSC8YZ1iihKPPKInXfMGL/OfZG0iLTzEC8HiHUfCVDq5ijB7HMfBjuuHTdspSbe4OQl Y7AYGkkITZscnW/zaEklSSOnznItPxsvUn6kGvHkinN4t3DRff31g8Nsc/M8ftOpGHoc buRXRLuWn6wRIDrNle2CukgkRndvJY+YrIHD5iqflHQHUdnRCyRDJj9JCzQGbofC9lu8 mroPR3Ii6kuPQIWd4FZZowzfnrEIZ9uwSemNXvTjmgN1TDXErVciTstMS9Znv8lBMdBT ufLA== X-Gm-Message-State: APjAAAVngZjZPPUZC9VJOCBXNq3ov61v5Vso4EnQWHOVwP8vW5evUn48 18DJVWyH8V6/egb5ZQKMe7YNbRJe X-Google-Smtp-Source: APXvYqzi30DQBGrUn9/aU8zqXWXgpEPt5xH8utJXMqe30gjZ2pXUCajYTndAdF7nNS2sMfU5izN7Rg== X-Received: by 2002:a37:ef07:: with SMTP id j7mr85669560qkk.354.1578347895618; Mon, 06 Jan 2020 13:58:15 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:36 -0300 Message-Id: <20200106215750.361615-13-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: clK4XVSbPPmJW7WoXYEF-Q-1 X-MC-Unique: aWh_UdYINw-15fJhr_7ERQ-1 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwOtH007313 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 12/26] lxc: remove unneeded labels 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.22 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/lxc/lxc_container.c | 7 ++----- src/lxc/lxc_controller.c | 10 ++++------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 42ed08ede6..b44cc68e67 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -380,18 +380,15 @@ static int lxcContainerSetupFDs(int *ttyfd, */ int lxcContainerSendContinue(int control) { - int rc =3D -1; lxc_message_t msg =3D LXC_CONTINUE_MSG; int writeCount =3D 0; =20 VIR_DEBUG("Send continue on fd %d", control); writeCount =3D safewrite(control, &msg, sizeof(msg)); if (writeCount !=3D sizeof(msg)) - goto error_out; + return -1; =20 - rc =3D 0; - error_out: - return rc; + return 0; } =20 /** diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index e572c3f5fd..42c631ed0b 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -1115,7 +1115,7 @@ static void virLXCControllerConsoleUpdateWatch(virLXC= ControllerConsolePtr consol virReportSystemError(errno, "%s", _("Unable to add epoll fd")); virNetDaemonQuit(console->daemon); - goto cleanup; + return; } console->hostEpoll =3D events; VIR_DEBUG("newHostEvents=3D%x oldHostEvents=3D%x", events, con= sole->hostEpoll); @@ -1127,7 +1127,7 @@ static void virLXCControllerConsoleUpdateWatch(virLXC= ControllerConsolePtr consol _("Unable to remove epoll fd")); VIR_DEBUG(":fail"); virNetDaemonQuit(console->daemon); - goto cleanup; + return; } console->hostEpoll =3D 0; } @@ -1153,7 +1153,7 @@ static void virLXCControllerConsoleUpdateWatch(virLXC= ControllerConsolePtr consol _("Unable to add epoll fd")); VIR_DEBUG(":fail"); virNetDaemonQuit(console->daemon); - goto cleanup; + return; } console->contEpoll =3D events; VIR_DEBUG("newHostEvents=3D%x oldHostEvents=3D%x", events, con= sole->contEpoll); @@ -1165,12 +1165,10 @@ static void virLXCControllerConsoleUpdateWatch(virL= XCControllerConsolePtr consol _("Unable to remove epoll fd")); VIR_DEBUG(":fail"); virNetDaemonQuit(console->daemon); - goto cleanup; + return; } console->contEpoll =3D 0; } - cleanup: - return; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347935; cv=none; d=zohomail.com; s=zohoarc; b=LdmDbvgDaE818z8hMP3AQW7H9sz5lKhXn4U6rhL80BdEfdM5Igkp25XVr7um0iUvMWcti9IXVVK/gPz+jr/D0c+h5Q7Et8kSRKZvbTIyxXBl0VkNrbzSOqH+n1VcX8sk976qvbs5aITSY1HyK2dQ6AN/r4xyurZ16bNjiMFfYyg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347935; h=Content-Type:Content-Transfer-Encoding:Cc: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=GZp4YzSPE+KzSfo1STPqMA+1F2XKSTQ8uBdgQ28VtfY=; b=jHb3Jc3gHlmPHPw20jGN1L8GtdICPvMQRa+BVOi0iX87rP7S8ayOu6hftjuLSknGzBDpCue+ZDmXwgkcYM2MAJbcK1Jw3JY26x57ebIW3USTrdovJuhbmys2hjUQ5lapSdvaDuymVFCjMba974XTD6S9uAYKQ8zw5oBNeOenl6Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1578347935973550.8238691225782; Mon, 6 Jan 2020 13:58:55 -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-206-xQXzatb_M0qUU_FyM0nxlw-1; Mon, 06 Jan 2020 16:58:52 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 11B74107ACC5; Mon, 6 Jan 2020 21:58:46 +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 E4A7185F0D; Mon, 6 Jan 2020 21:58:45 +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 A4EE41803C42; Mon, 6 Jan 2020 21:58:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwJC7007273 for ; Mon, 6 Jan 2020 16:58:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id 914EE2022AC6; Mon, 6 Jan 2020 21:58:19 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C2DC2022AA8 for ; Mon, 6 Jan 2020 21:58:19 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6D5C218AE94C for ; Mon, 6 Jan 2020 21:58:19 +0000 (UTC) Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-64-WqOmdJt8M3C6qCEkKQ8nlA-1; Mon, 06 Jan 2020 16:58:17 -0500 Received: by mail-qv1-f68.google.com with SMTP id x1so19697839qvr.8 for ; Mon, 06 Jan 2020 13:58:17 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347934; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=GZp4YzSPE+KzSfo1STPqMA+1F2XKSTQ8uBdgQ28VtfY=; b=IhbnRZ2kQujHs2wqA14Az0lzRxNyk7KG07dGDSOak8pfFvgMRczosV3oe9Wi6FrJdbiKVY D2DsQd/Rxw1dzRcbxr3D9MgElcZBTlc2qOwT4g2Z/wK5RH3xXCsny1SCo007RgLEY/6gKU kLbHSdXRPpxIfmEnxUY98Ajto9SjWdY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FLx6zgF1BVwcMBZqIp8IK8Kb1a7tUew2j2+f8abPmic=; b=bqgH227FrqqptrsxQBhY+Skk1zrKTjSAXc/nNbHbDMsdFWix4RWfUd61Q3BD8N6Emd bxKfgAd7jZ8i8Ytv0nczQDTTOEnnmbqKmz5Fydfc5YKTDv+T1/BYAseJz9eIeLpfj9Cg 5obRdnTNKsSrTqtq8QOEWbviFVSp+S0AcaRrOql15uMFTWW5mBCDXgpolHTvvVPKXgkz CAl7qXgmpIAwzqgJnjipL2onPPHFAYvPM6fLxA/IRUVxRNtRNHII4LkzIa7JPze0q2xx FG8UqFPghBkAtUJW1m1X9PN2fVqJSr0SSySfbA9QxJulKSsE7uIsHzqdVf8q0xX1ZXbp PUfw== X-Gm-Message-State: APjAAAWcneJxKWkw3LCc1KY8vdEIK0EwlSOgA3BF3gDqyZZ9q7uOVeqb n4/Ql9c5SzXaZJbtKipVKV47JRPy X-Google-Smtp-Source: APXvYqxWC10ClySws59NCcGBB47SDXtGt9TlXzA6D38oBa5AzaMScc/b4oacm04QtIxaSwG7aMPrYw== X-Received: by 2002:ad4:50d2:: with SMTP id e18mr81790982qvq.9.1578347897003; Mon, 06 Jan 2020 13:58:17 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:37 -0300 Message-Id: <20200106215750.361615-14-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: WqOmdJt8M3C6qCEkKQ8nlA-1 X-MC-Unique: xQXzatb_M0qUU_FyM0nxlw-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwJC7007273 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 13/26] node_device: remove unneeded labels 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.13 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" gather_scsi_host_cap() in node_device_hal.c can be greatly simplified, given that the 'out' label is always getting hit regardless of 'retval', which can also be eliminated. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/node_device/node_device_driver.c | 4 ++-- src/node_device/node_device_hal.c | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index ebcc9696af..b630be4399 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -572,13 +572,13 @@ nodeConnectNodeDeviceEventRegisterAny(virConnectPtr c= onn, int callbackID =3D -1; =20 if (virConnectNodeDeviceEventRegisterAnyEnsureACL(conn) < 0) - goto cleanup; + return -1; =20 if (virNodeDeviceEventStateRegisterID(conn, driver->nodeDeviceEventSta= te, device, eventID, callback, opaque, freecb, &callbackID) < 0) callbackID =3D -1; - cleanup: + return callbackID; } =20 diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_devic= e_hal.c index cf12854fe9..4cef7c2c12 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -232,17 +232,9 @@ static int gather_scsi_host_cap(LibHalContext *ctx, const char *udi, virNodeDevCapDataPtr d) { - int retval =3D 0; - (void)get_int_prop(ctx, udi, "scsi_host.host", (int *)&d->scsi_host.ho= st); =20 - retval =3D virNodeDeviceGetSCSIHostCaps(&d->scsi_host); - - if (retval =3D=3D -1) - goto out; - - out: - return retval; + return virNodeDeviceGetSCSIHostCaps(&d->scsi_host); } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347925; cv=none; d=zohomail.com; s=zohoarc; b=Frv+DUY/mm/re5z6WbLPTIfuI14LWXLCPsyvVA+IW67PeIoRDpfSRjIDfW2KrpZ2o11jPc1bpSnkb3PqxdminKTdpzcjSP2nkjrfALdaUt72msgV8xT/TuRK8kFHdiJ33j+WsLfdjrmleTSjeD1zEVIsplTbJJJCXRTPNYARCy0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347925; h=Content-Type:Content-Transfer-Encoding:Cc: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=fa6VOjNcc2guWZ3X4n0ADFUvXkJXY4g2xDgePZkiHpI=; b=RHl+1BJEpudGpEsp8IwG/qXA1C1N//fGrq26ZUAQCU5a9vZVf6XzwKt1JcjsQ88yGslcI35lz6YIb71LlhTkptBI+UunT7SdSeW83o6NP+6tuRBMg+NIlfjqIHgQu7O6VbUbnuBuOAOTB3Q0XqFvODEecGl7W4T2o9z2r95sjjU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1578347925065865.9181427043361; Mon, 6 Jan 2020 13:58:45 -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-136-FMQRBQCEMROou2DURcl5Sw-1; Mon, 06 Jan 2020 16:58:42 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6D458DBE8; Mon, 6 Jan 2020 21:58:35 +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 44ACD1084194; Mon, 6 Jan 2020 21:58:35 +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 05E1F180887A; Mon, 6 Jan 2020 21:58:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwMHc007290 for ; Mon, 6 Jan 2020 16:58:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id B56E22166B2A; Mon, 6 Jan 2020 21:58:22 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B11C12166B29 for ; Mon, 6 Jan 2020 21:58:20 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 90807801E9D for ; Mon, 6 Jan 2020 21:58:20 +0000 (UTC) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-225-vD8kryCwPgSuwdV9AQvgKA-1; Mon, 06 Jan 2020 16:58:18 -0500 Received: by mail-qt1-f178.google.com with SMTP id e12so43746057qto.2 for ; Mon, 06 Jan 2020 13:58:18 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347924; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=fa6VOjNcc2guWZ3X4n0ADFUvXkJXY4g2xDgePZkiHpI=; b=TDAdJ5rG2sd+roOFCl06Z4h3FNMay663s/y+0s2yiH0yFM2049nFXGMsNJhTg9lD8sS5jB DAXE9ya9a4flJEbDG24EVTmjIqTwjEt0YOBz0R5ZIOS/iQO7LU70JN13q4tfFBBNy6qm38 cw/zMv0zL0oSjL/fHs76pJ05b9k4dEs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QjGP6omqH6dtQL/UcEfdFwZm6+7u7PM/CSLbuI4GW9s=; b=QGUiEo3QbQ5tuuqr1I78L6/oLNJVoz8dI9cXKrvEHa1c/gOLroTIbNaOZmD+bTNxTS zwqI1LL1JtlRisPkSpWZ3+1cELvHHN2fNMQNvZ1RW0ZEzcI5trLgiyLB2yPgc7mTfcNb eEsQ5hACxKft+q8QE7WPmOw2pzw3yQpQoWtwm2j/c0/to1PO/MP2I/Po9uR25v1o5/Iu j/s4lhUl5Ed1/YwA0oETY7EQod6IRYmRAUfIOwcESDy8JgWWUR8n53pb2jtQ0GHtuUiQ 0IluZKQo1TYmFQMJhaH3RQ5z5zZyVMRZ1rzuTpnUL2P2d7BL6sLIof4Zc7iTOGNAT42A XxQg== X-Gm-Message-State: APjAAAWox+Ma4udeC2jQlnJQkQZpVZjOj6J1psuGF8qWe4q8dKfwcE/k NRgiKuiwAs9Luqx99VASuMDTQmuD X-Google-Smtp-Source: APXvYqwn2IeFHZnfYkC/ORUM4AQcul3+2eqmPMkjdFSQy5Tp1m8yq5uiE1aLNppQfkhvDtCZ3xVgYA== X-Received: by 2002:ac8:958:: with SMTP id z24mr77889144qth.40.1578347898292; Mon, 06 Jan 2020 13:58:18 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:38 -0300 Message-Id: <20200106215750.361615-15-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: vD8kryCwPgSuwdV9AQvgKA-1 X-MC-Unique: FMQRBQCEMROou2DURcl5Sw-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwMHc007290 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 14/26] secret/secret_driver.c: remove unneeded label 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.22 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/secret/secret_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index 096672f114..5a93c3af82 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -591,13 +591,13 @@ secretConnectSecretEventRegisterAny(virConnectPtr con= n, int callbackID =3D -1; =20 if (virConnectSecretEventRegisterAnyEnsureACL(conn) < 0) - goto cleanup; + return -1; =20 if (virSecretEventStateRegisterID(conn, driver->secretEventState, secret, eventID, callback, opaque, freecb, &callbackID) < 0) - callbackID =3D -1; - cleanup: + return -1; + return callbackID; } =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347939; cv=none; d=zohomail.com; s=zohoarc; b=KuNsXwQXetSvzcPcRlPRj5TOiu4Qg5eF1EvkeGOhvPAAgYplVseXkMMaUiitwjQ8KluQmgMIy2OSDuj6s6SD54az0Qgu/4Y7z9vP39fqY5T3itbV1oC4svdyhmKgzUCaNoO1uwVDs6Bay3qYvYm7ZUquUEXxj0cECtmYQ5c9oYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347939; h=Content-Type:Content-Transfer-Encoding:Cc: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=GVTcY6GaH9Sdon/+KqDXYxglpfXMhIF4gJA3hvikYDc=; b=OdsIetjEzl9AD1JcKSaxNLX0vuKDxV6EXcEarG/KpZoVEGaitQ/YcdFG1znnNFpJl92yETlWGCCOeraQw0cX0362XbRD7sRU+HfecyLXxYtxUXBP3SXI4GtNL0/8NtXPf8U83FlOUZQkhmV3NAEcCUKu158ybvjJ8o1YnWoXvHs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1578347939882505.46569456528687; Mon, 6 Jan 2020 13:58:59 -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-342-iBpxxJRvM8-qXbYj-f5sjA-1; Mon, 06 Jan 2020 16:58:55 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 80F6E1854339; Mon, 6 Jan 2020 21:58:49 +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 574F21084197; Mon, 6 Jan 2020 21:58:49 +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 1661081C91; Mon, 6 Jan 2020 21:58:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwMnt007285 for ; Mon, 6 Jan 2020 16:58:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7A4A82022AC6; Mon, 6 Jan 2020 21:58:22 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7509D2022AA8 for ; Mon, 6 Jan 2020 21:58:22 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5081D8D772C for ; Mon, 6 Jan 2020 21:58:22 +0000 (UTC) Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-140-aCLVlHozOg-xV9J82YzR4Q-1; Mon, 06 Jan 2020 16:58:20 -0500 Received: by mail-qk1-f171.google.com with SMTP id w127so40878346qkb.11 for ; Mon, 06 Jan 2020 13:58:20 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347938; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=GVTcY6GaH9Sdon/+KqDXYxglpfXMhIF4gJA3hvikYDc=; b=ZNrwSwK2iV+XYF0DLNwyXvGsL4uIuPcidvGlDfZey6jTzjHMujbrhb6H9J4GF0e7nCfsD4 q0jozXrisoAjNRp6pE/8SUfOXaxmZp8IrE84pGId5Ng7h3R2Ei6+tnt05JTWIXeAThT8z9 bp4q9lSgM0yHOaoUCNpdPIf6vntBUec= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=taVKre7GjHSyoIJDrYwmR/DHNXUNuspx5D8htlVvDfs=; b=LAaIS2dkCZG5AjJpqTskT4zn+U2SbuhDMUtSaQf+w6YigrXlXTJXifag0fdfchsL0V lplkryq4i0DJlZw10eZMTkPT1d4o7h9Ta/wfs9Wbl+RlIwo34ueRqn7GwVegDvT7ZnzX EJ+G0Hs5MhKj8T7gY+47K3RXBYsMXX2Yx4/oUC7735KN/xmvsP75rqJKZ0pIZ/lFa4K7 +InqmdREzt6ZoerLCJNMdRktJDdsZCqfk/2AuhP5DeYRkqou6NW/ALvl1ad0n1PnHv3e aGTKrTAzP9qxNYsnf0b1ePUAHUoDtXhRY8HUzmvo2E9KagvxBg/dYepSkRA30gmWBVcU 7JHA== X-Gm-Message-State: APjAAAVjKRAKOFi65sqPjMQBJSqUSziWKdfNAzW9EOJ6iqqoF27mZjS5 USlTKVukCbvWCn38TwRKddNpwawU X-Google-Smtp-Source: APXvYqzeFapxDW96e+BSNeNA73/i7I1anOoc0bWuo+o92re2sL3A8m/IU6Y/KVzzTslHv3Ek+rj5OQ== X-Received: by 2002:a37:6346:: with SMTP id x67mr84499837qkb.476.1578347899834; Mon, 06 Jan 2020 13:58:19 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:39 -0300 Message-Id: <20200106215750.361615-16-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: aCLVlHozOg-xV9J82YzR4Q-1 X-MC-Unique: iBpxxJRvM8-qXbYj-f5sjA-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwMnt007285 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 15/26] openvz: remove unneeded labels 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.22 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/openvz/openvz_conf.c | 11 ++++------ src/openvz/openvz_driver.c | 42 +++++++++++++++----------------------- 2 files changed, 21 insertions(+), 32 deletions(-) diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index c4c6dec2f7..40a748351d 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -858,18 +858,15 @@ openvzLocateConfDir(void) { const char *conf_dir_list[] =3D {"/etc/vz/conf", "/usr/local/etc/conf"= , NULL}; size_t i =3D 0; - char *ret =3D NULL; =20 while (conf_dir_list[i]) { - if (virFileExists(conf_dir_list[i])) { - ret =3D g_strdup(conf_dir_list[i]); - goto cleanup; - } + if (virFileExists(conf_dir_list[i])) + return g_strdup(conf_dir_list[i]); + i++; } =20 - cleanup: - return ret; + return NULL; } =20 /* Richard Steven's classic readline() function */ diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 0c472601d3..62644f3129 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -1554,12 +1554,9 @@ openvzDomainSetMemoryInternal(virDomainObjPtr vm, =20 openvzSetProgramSentinal(prog, vm->def->name); if (virRun(prog, NULL) < 0) - goto cleanup; + return -1; =20 return 0; - - cleanup: - return -1; } =20 =20 @@ -1641,7 +1638,6 @@ openvzDomainGetMemoryParameters(virDomainPtr domain, unsigned int flags) { size_t i; - int result =3D -1; const char *name; long kb_per_pages; unsigned long long barrier, limit, val; @@ -1650,7 +1646,7 @@ openvzDomainGetMemoryParameters(virDomainPtr domain, =20 kb_per_pages =3D openvzKBPerPages(); if (kb_per_pages < 0) - goto cleanup; + return -1; =20 if (*nparams =3D=3D 0) { *nparams =3D OPENVZ_NB_MEM_PARAM; @@ -1664,44 +1660,42 @@ openvzDomainGetMemoryParameters(virDomainPtr domain, case 0: name =3D "privvmpages"; if (openvzDomainGetBarrierLimit(domain, name, &barrier, &limit= ) < 0) - goto cleanup; + return -1; =20 val =3D (limit =3D=3D LONG_MAX) ? VIR_DOMAIN_MEMORY_PARAM_UNLI= MITED : limit * kb_per_pages; if (virTypedParameterAssign(param, VIR_DOMAIN_MEMORY_HARD_LIMI= T, VIR_TYPED_PARAM_ULLONG, val) < 0) - goto cleanup; + return -1; break; =20 case 1: name =3D "privvmpages"; if (openvzDomainGetBarrierLimit(domain, name, &barrier, &limit= ) < 0) - goto cleanup; + return -1; =20 val =3D (barrier =3D=3D LONG_MAX) ? VIR_DOMAIN_MEMORY_PARAM_UN= LIMITED : barrier * kb_per_pages; if (virTypedParameterAssign(param, VIR_DOMAIN_MEMORY_SOFT_LIMI= T, VIR_TYPED_PARAM_ULLONG, val) < 0) - goto cleanup; + return -1; break; =20 case 2: name =3D "vmguarpages"; if (openvzDomainGetBarrierLimit(domain, name, &barrier, &limit= ) < 0) - goto cleanup; + return -1; =20 val =3D (barrier =3D=3D LONG_MAX) ? 0ull : barrier * kb_per_pa= ges; if (virTypedParameterAssign(param, VIR_DOMAIN_MEMORY_MIN_GUARA= NTEE, VIR_TYPED_PARAM_ULLONG, val) < 0) - goto cleanup; + return -1; break; } } =20 if (*nparams > OPENVZ_NB_MEM_PARAM) *nparams =3D OPENVZ_NB_MEM_PARAM; - result =3D 0; =20 - cleanup: - return result; + return 0; } =20 =20 @@ -1712,12 +1706,11 @@ openvzDomainSetMemoryParameters(virDomainPtr domain, unsigned int flags) { size_t i; - int result =3D -1; long kb_per_pages; =20 kb_per_pages =3D openvzKBPerPages(); if (kb_per_pages < 0) - goto cleanup; + return -1; =20 virCheckFlags(0, -1); if (virTypedParamsValidate(params, nparams, @@ -1737,29 +1730,28 @@ openvzDomainSetMemoryParameters(virDomainPtr domain, if (STREQ(param->field, VIR_DOMAIN_MEMORY_HARD_LIMIT)) { if (openvzDomainGetBarrierLimit(domain, "privvmpages", &barrier, &limit) < 0) - goto cleanup; + return -1; limit =3D params[i].value.ul / kb_per_pages; if (openvzDomainSetBarrierLimit(domain, "privvmpages", barrier, limit) < 0) - goto cleanup; + return -1; } else if (STREQ(param->field, VIR_DOMAIN_MEMORY_SOFT_LIMIT)) { if (openvzDomainGetBarrierLimit(domain, "privvmpages", &barrier, &limit) < 0) - goto cleanup; + return -1; barrier =3D params[i].value.ul / kb_per_pages; if (openvzDomainSetBarrierLimit(domain, "privvmpages", barrier, limit) < 0) - goto cleanup; + return -1; } else if (STREQ(param->field, VIR_DOMAIN_MEMORY_MIN_GUARANTEE)) { barrier =3D params[i].value.ul / kb_per_pages; if (openvzDomainSetBarrierLimit(domain, "vmguarpages", barrier, LONG_MAX) < 0) - goto cleanup; + return -1; } } - result =3D 0; - cleanup: - return result; + + return 0; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347943; cv=none; d=zohomail.com; s=zohoarc; b=f2xSG4Lqly83KkWgnBGd+suFK46vHGs2RnD40Pd9n1S6ilgxGj/M/b52rzb6kk+iYSS4FtqzUmY/sn83LtFRYq5myhnb5wqpfQjOyuRZDyb4+JM39i5PTutYlRYehq69IuEm/6HlfoQp6D8R89G2O1toloi0RTMsG89nfNoX6SM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347943; h=Content-Type:Content-Transfer-Encoding:Cc: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=G+7Ko2ymc+4OtQtrEfdbi2XVRwtd+RAT49BDCWSzIlw=; b=VrLGMLB/ToiO47dpS7Ic+8u4tUlmpLoGNu4KIkJpVOX4daI+rue7+JlzOEnm4GJgeVRD1XwoQEdJSk1/8NV1uRn4DNRSDl6ZqbQ0cZ4C+koRisAIxX/OUtX4x4Lk/hvMRoDQF00mDmst+do5UxqAM9opEJfZY0SZvSSCcJ5WT3Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 157834794324723.19420472452873; Mon, 6 Jan 2020 13:59:03 -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-322-DMkwSrK7MA2TL93nOQjxrg-1; Mon, 06 Jan 2020 16:59:00 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F022D800D5A; Mon, 6 Jan 2020 21:58:52 +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 C05B35C557; Mon, 6 Jan 2020 21:58:52 +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 7A39881C96; Mon, 6 Jan 2020 21:58:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwNVx007299 for ; Mon, 6 Jan 2020 16:58:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id CF4EF2166B2A; Mon, 6 Jan 2020 21:58:23 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CAA8D2166B29 for ; Mon, 6 Jan 2020 21:58:23 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A65B4801E7B for ; Mon, 6 Jan 2020 21:58:23 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-262-fSZ9gD6ROICVavDf8H8KTA-1; Mon, 06 Jan 2020 16:58:21 -0500 Received: by mail-qk1-f196.google.com with SMTP id d71so33058046qkc.0 for ; Mon, 06 Jan 2020 13:58:21 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347942; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=G+7Ko2ymc+4OtQtrEfdbi2XVRwtd+RAT49BDCWSzIlw=; b=D83cmAIcSX3lF5oa4zkMWXn+oyWKy3duOTrW1kTmSGh++4mxINe7KckSOG4HE6HG2SdIJW 4emsdcNJpilta+BiyH5qNytO6NAvP+DE7QA+60qDPuFLBJzYt7seIV9t01ogUS399oTJT+ YZeFKEu02KlPsroFsicQyDqvuMLqSXE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MzoR0unflTylpcP9ME+EwzsPipWr3Ke97h2HVepvqC0=; b=gNSptSHpbxGfLT08SR0Y+vRcgc5MKeShx7Abe1uyo0kqoNtgdF6ORJhb9aHc4VwpWx P33c97pLQAZLlFROnn503jO0ctZTk3Mdaeh5AHs5J+lTPJD0wl2wMhh5ORSZlMolEYPG kQ+GFrEuOUq4QKqDp7ZajyF/4+s1w3aqz90jam8+IGWo57exVx7sbFu6wBTBJwhsXa/4 KZNwkBHX0uTa67Wsy8AGw0mukUeKi0Wockt1lmShoYXZNFC7HIn1PJAqMhC+/bf/mfjt EzfW6lcf1xlxvVz9aX9RY4xjjAwjqzVJy4etKmCo4HyRkBDgkw6iYDkrJ36nzM0P++eL H2Uw== X-Gm-Message-State: APjAAAX348Hw/vdPZtUu7UV55Jcg3M9aJc1pzHB/zhsNvx94T0KeE5jr 5OXJcJz0/4sBRg4Qx5OiiJhihE8w X-Google-Smtp-Source: APXvYqxI0OOBjVjjEglOVuIXt6m9Mh3Bu+bs1oxycg7VJutYLhNTDsh1yIE8Uc4E78vbXRbEHjWgOA== X-Received: by 2002:a37:4a0d:: with SMTP id x13mr85765520qka.332.1578347901178; Mon, 06 Jan 2020 13:58:21 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:40 -0300 Message-Id: <20200106215750.361615-17-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: fSZ9gD6ROICVavDf8H8KTA-1 X-MC-Unique: DMkwSrK7MA2TL93nOQjxrg-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwNVx007299 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 16/26] qemu: remove unneeded labels 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.16 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This patch remove unneeded labels for the following files: qemu_capabilities.c qemu_domain_address.c qemu_hostdev.c qemu_hotplug.c qemu_migration_cookie.c qemu_migration_params.c Next patch will handle the remaining QEMU files that can be cleaned up. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/qemu/qemu_capabilities.c | 15 +++------ src/qemu/qemu_domain_address.c | 52 +++++++++++++++----------------- src/qemu/qemu_hostdev.c | 11 +++---- src/qemu/qemu_hotplug.c | 15 ++++----- src/qemu/qemu_migration_cookie.c | 10 +++--- src/qemu/qemu_migration_params.c | 11 +++---- 6 files changed, 47 insertions(+), 67 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 0929fd3e28..da0c7a257f 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -781,23 +781,22 @@ virQEMUCapsFindBinaryForArch(virArch hostarch, if (hostarch =3D=3D VIR_ARCH_AARCH64 && guestarch =3D=3D VIR_ARCH_ARMV= 7L) { archstr =3D virQEMUCapsArchToString(hostarch); if ((ret =3D virQEMUCapsFindBinary("qemu-system-%s", archstr)) != =3D NULL) - goto out; + return ret; } =20 /* First attempt: try the guest architecture as it is */ archstr =3D virQEMUCapsArchToString(guestarch); if ((ret =3D virQEMUCapsFindBinary("qemu-system-%s", archstr)) !=3D NU= LL) - goto out; + return ret; =20 /* Second attempt: try looking up by target instead */ target =3D virQEMUCapsFindTarget(hostarch, guestarch); if (target !=3D guestarch) { archstr =3D virQEMUCapsArchToString(target); if ((ret =3D virQEMUCapsFindBinary("qemu-system-%s", archstr)) != =3D NULL) - goto out; + return ret; } =20 - out: return ret; } =20 @@ -5013,13 +5012,11 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, qemuCaps->kvmSupportsNesting =3D virQEMUCapsKVMSupportsNesting(); } =20 - cleanup: return qemuCaps; =20 error: virObjectUnref(qemuCaps); - qemuCaps =3D NULL; - goto cleanup; + return NULL; } =20 static void * @@ -5052,13 +5049,11 @@ virQEMUCapsLoadFile(const char *filename, if (virQEMUCapsLoadCache(priv->hostArch, qemuCaps, filename) < 0) goto error; =20 - cleanup: return qemuCaps; =20 error: virObjectUnref(qemuCaps); - qemuCaps =3D NULL; - goto cleanup; + return NULL; } =20 =20 diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index b077240899..0e28ecf1d5 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -1257,7 +1257,7 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr de= f, /* Only PCI host devices are subject to isolation */ if (hostdev->mode !=3D VIR_DOMAIN_HOSTDEV_MODE_SUBSYS || hostdev->source.subsys.type !=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYP= E_PCI) { - goto skip; + return 0; } =20 hostAddr =3D &hostdev->source.subsys.u.pci.addr; @@ -1265,7 +1265,7 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr de= f, /* If a non-default isolation has already been assigned to the * device, we can avoid looking up the information again */ if (info->isolationGroup > 0) - goto skip; + return 0; =20 /* The isolation group depends on the IOMMU group assigned by the = host */ tmp =3D virPCIDeviceAddressGetIOMMUGroupNum(hostAddr); @@ -1275,7 +1275,7 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr de= f, "%04x:%02x:%02x.%x, device won't be isolated", hostAddr->domain, hostAddr->bus, hostAddr->slot, hostAddr->function); - goto skip; + return 0; } =20 /* The isolation group for a host device is its IOMMU group, @@ -1301,13 +1301,13 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr = def, * require us to isolate the guest device, so we can skip them */ if (iface->type !=3D VIR_DOMAIN_NET_TYPE_NETWORK || virDomainNetResolveActualType(iface) !=3D VIR_DOMAIN_NET_TYPE_= HOSTDEV) { - goto skip; + return 0; } =20 /* If a non-default isolation has already been assigned to the * device, we can avoid looking up the information again */ if (info->isolationGroup > 0) - goto skip; + return 0; =20 /* Obtain a synthetic isolation group for the device, since at this * point in time we don't have access to the IOMMU group of the ho= st @@ -1319,7 +1319,7 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr de= f, "configured to use hostdev-backed network '%s', " "device won't be isolated", iface->data.network.name); - goto skip; + return 0; } =20 info->isolationGroup =3D tmp; @@ -1329,7 +1329,6 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr de= f, iface->data.network.name, info->isolationGroup); } =20 - skip: return 0; } =20 @@ -2131,7 +2130,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, continue; =20 if (qemuDomainPCIAddressReserveNextAddr(addrs, &cont->info) < = 0) - goto error; + return -1; } } =20 @@ -2142,7 +2141,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, /* Only support VirtIO-9p-pci so far. If that changes, * we might need to skip devices here */ if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->fss[i]->info)= < 0) - goto error; + return -1; } =20 /* Network interfaces */ @@ -2159,7 +2158,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, } =20 if (qemuDomainPCIAddressReserveNextAddr(addrs, &net->info) < 0) - goto error; + return -1; } =20 /* Sound cards */ @@ -2177,7 +2176,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, } =20 if (qemuDomainPCIAddressReserveNextAddr(addrs, &sound->info) < 0) - goto error; + return -1; } =20 /* Device controllers (SCSI, USB, but not IDE, FDC or CCID) */ @@ -2246,7 +2245,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, if (virDomainPCIAddressReserveAddr(addrs, &addr, cont->info.pciConnectFl= ags, cont->info.isolationGro= up) < 0) { - goto error; + return -1; } =20 cont->info.type =3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI; @@ -2257,14 +2256,14 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, if (virDomainPCIAddressReserveNextAddr(addrs, &cont->info, cont->info.pciConne= ctFlags, addr.function) < 0)= { - goto error; + return -1; } =20 cont->info.addr.pci.multi =3D addr.multi; } } else { if (qemuDomainPCIAddressReserveNextAddr(addrs, &cont->info) < = 0) - goto error; + return -1; } } =20 @@ -2292,11 +2291,11 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("virtio disk cannot have an address of type '= %s'"), virDomainDeviceAddressTypeToString(def->disks[i= ]->info.type)); - goto error; + return -1; } =20 if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->disks[i]->inf= o) < 0) - goto error; + return -1; } =20 /* Host PCI devices */ @@ -2320,7 +2319,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, =20 if (qemuDomainPCIAddressReserveNextAddr(addrs, def->hostdevs[i]->info) < = 0) - goto error; + return -1; } =20 /* memballoon. the qemu driver only accepts virtio memballoon devices = */ @@ -2328,7 +2327,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, virDeviceInfoPCIAddressIsWanted(&def->memballoon->info)) { if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->memballoon->info) < = 0) - goto error; + return -1; } =20 /* the qemu driver only accepts virtio rng devices */ @@ -2337,7 +2336,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, continue; =20 if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->rngs[i]->info= ) < 0) - goto error; + return -1; } =20 /* A watchdog - check if it is a PCI device */ @@ -2345,7 +2344,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, def->watchdog->model =3D=3D VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB && virDeviceInfoPCIAddressIsWanted(&def->watchdog->info)) { if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->watchdog->inf= o) < 0) - goto error; + return -1; } =20 /* Video devices */ @@ -2358,7 +2357,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, continue; =20 if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->videos[i]->in= fo) < 0) - goto error; + return -1; } =20 /* Shared Memory */ @@ -2367,7 +2366,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, continue; =20 if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->shmems[i]->in= fo) < 0) - goto error; + return -1; } for (i =3D 0; i < def->ninputs; i++) { if (def->inputs[i]->bus !=3D VIR_DOMAIN_INPUT_BUS_VIRTIO || @@ -2375,7 +2374,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, continue; =20 if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->inputs[i]->in= fo) < 0) - goto error; + return -1; } for (i =3D 0; i < def->nparallels; i++) { /* Nada - none are PCI based (yet) */ @@ -2388,7 +2387,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, continue; =20 if (qemuDomainPCIAddressReserveNextAddr(addrs, &chr->info) < 0) - goto error; + return -1; } for (i =3D 0; i < def->nchannels; i++) { /* Nada - none are PCI based (yet) */ @@ -2402,13 +2401,10 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, =20 if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->vsock->info) < 0) - goto error; + return -1; } =20 return 0; - - error: - return -1; } =20 =20 diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c index 6ab052724a..1774850640 100644 --- a/src/qemu/qemu_hostdev.c +++ b/src/qemu/qemu_hostdev.c @@ -243,17 +243,14 @@ qemuHostdevPreparePCIDevices(virQEMUDriverPtr driver, virQEMUCapsPtr qemuCaps, unsigned int flags) { - int ret =3D -1; virHostdevManagerPtr hostdev_mgr =3D driver->hostdevMgr; =20 if (!qemuHostdevPreparePCIDevicesCheckSupport(hostdevs, nhostdevs, qem= uCaps)) - goto out; + return -1; =20 - ret =3D virHostdevPreparePCIDevices(hostdev_mgr, QEMU_DRIVER_NAME, - name, uuid, hostdevs, - nhostdevs, flags); - out: - return ret; + return virHostdevPreparePCIDevices(hostdev_mgr, QEMU_DRIVER_NAME, + name, uuid, hostdevs, + nhostdevs, flags); } =20 int diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index f2a9386433..31d455505b 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2894,41 +2894,38 @@ qemuDomainAttachHostDevice(virQEMUDriverPtr driver, case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: if (qemuDomainAttachHostPCIDevice(driver, vm, hostdev) < 0) - goto error; + return -1; break; =20 case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: if (qemuDomainAttachHostUSBDevice(driver, vm, hostdev) < 0) - goto error; + return -1; break; =20 case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: if (qemuDomainAttachHostSCSIDevice(driver, vm, hostdev) < 0) - goto error; + return -1; break; =20 case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST: if (qemuDomainAttachSCSIVHostDevice(driver, vm, hostdev) < 0) - goto error; + return -1; break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: if (qemuDomainAttachMediatedDevice(driver, vm, hostdev) < 0) - goto error; + return -1; break; =20 default: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("hotplug is not supported for hostdev subsys type= '%s'"), virDomainHostdevSubsysTypeToString(hostdev->source.= subsys.type)); - goto error; + return -1; } =20 return 0; - - error: - return -1; } =20 =20 diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_coo= kie.c index 9cfb08951c..299bf17c9e 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -971,14 +971,12 @@ qemuMigrationCookieNetworkXMLParse(xmlXPathContextPtr= ctxt) =20 VIR_FREE(interfaces); =20 - cleanup: return optr; =20 error: VIR_FREE(interfaces); qemuMigrationCookieNetworkFree(optr); - optr =3D NULL; - goto cleanup; + return NULL; } =20 =20 @@ -1053,10 +1051,10 @@ qemuMigrationCookieStatisticsXMLParse(xmlXPathConte= xtPtr ctxt) VIR_XPATH_NODE_AUTORESTORE(ctxt); =20 if (!(ctxt->node =3D virXPathNode("./statistics", ctxt))) - goto cleanup; + return NULL; =20 if (VIR_ALLOC(jobInfo) < 0) - goto cleanup; + return NULL; =20 stats =3D &jobInfo->stats.mig; jobInfo->status =3D QEMU_DOMAIN_JOB_STATUS_COMPLETED; @@ -1127,7 +1125,7 @@ qemuMigrationCookieStatisticsXMLParse(xmlXPathContext= Ptr ctxt) =20 virXPathInt("string(./" VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE "[1])", ctxt, &stats->cpu_throttle_percentage); - cleanup: + return jobInfo; } =20 diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index e6cf6b4b0b..9430ce1d00 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -480,14 +480,14 @@ qemuMigrationParamsSetCompression(virTypedParameterPt= r params, virReportError(VIR_ERR_INVALID_ARG, _("Unsupported compression method '%s'"), params[i].value.s); - goto error; + return -1; } =20 if (migParams->compMethods & (1ULL << method)) { virReportError(VIR_ERR_INVALID_ARG, _("Compression method '%s' is specified twice"), params[i].value.s); - goto error; + return -1; } =20 migParams->compMethods |=3D 1ULL << method; @@ -514,14 +514,14 @@ qemuMigrationParamsSetCompression(virTypedParameterPt= r params, !(migParams->compMethods & (1ULL << QEMU_MIGRATION_COMPRESS_MT))) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("Turn multithread compression on to tune it")); - goto error; + return -1; } =20 if (migParams->params[QEMU_MIGRATION_PARAM_XBZRLE_CACHE_SIZE].set && !(migParams->compMethods & (1ULL << QEMU_MIGRATION_COMPRESS_XBZRLE= ))) { virReportError(VIR_ERR_INVALID_ARG, "%s", _("Turn xbzrle compression on to tune it")); - goto error; + return -1; } =20 if (!migParams->compMethods && (flags & VIR_MIGRATE_COMPRESSED)) { @@ -531,9 +531,6 @@ qemuMigrationParamsSetCompression(virTypedParameterPtr = params, } =20 return 0; - - error: - return -1; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347950; cv=none; d=zohomail.com; s=zohoarc; b=V8buQD0nbAR4UrSmVuber9SSC73zktDw74U76i+35SPVz2RPiaaGNtmbOUcJSoYYX8MdhyyNZQGeMvAGF1Z0tujy740eBOM7TbWn68YLYwqKgExh3cMEVo7x7SPDqL//3of09RVUlR3DgjfwMmlkOlkCHmr6LiFRf8jEEM1b2b4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347950; h=Content-Type:Content-Transfer-Encoding:Cc: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=H+9B44xnJxsyxaxckThsRdloMGu8od4Szf/pGfLhBxc=; b=HtNtf3cTm3LKfIDhGITQM2zmp9HniBldwnOeBYOylqip/XgRMd/IrX5j0Jjh4HCczhpH3UCMShfjCbqr4MJo9541+j7aODuYgTjk7jVhkAfGygbL4Zo7O+N5MAoRnYyGg8nAfywUQwf3ERg27zZEbwuConWKyFPD9y3/8r8uBQE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1578347950174597.5418370381145; Mon, 6 Jan 2020 13:59:10 -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-353-ovpCDiHDOs-EL2O0JcMwhg-1; Mon, 06 Jan 2020 16:59:07 -0500 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 C7DBD80058F; Mon, 6 Jan 2020 21:59:00 +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 A03AA5D9E1; Mon, 6 Jan 2020 21:59:00 +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 5B18581C9B; Mon, 6 Jan 2020 21:59:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwSjq007331 for ; Mon, 6 Jan 2020 16:58:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6418410166FF; Mon, 6 Jan 2020 21:58:28 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5CB0910EE799 for ; Mon, 6 Jan 2020 21:58:26 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 161C680207A for ; Mon, 6 Jan 2020 21:58:26 +0000 (UTC) Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-409-Jkt_KQU0MRCXJVEpZj2gSA-1; Mon, 06 Jan 2020 16:58:23 -0500 Received: by mail-qk1-f177.google.com with SMTP id k6so40909360qki.5 for ; Mon, 06 Jan 2020 13:58:23 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347949; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=H+9B44xnJxsyxaxckThsRdloMGu8od4Szf/pGfLhBxc=; b=dHVnVdU+SXYZa64ULYa5mTbaJGZH7RQvHmqMhoe/gkMFvLPRCeUVH+QksduIY86hhlWLWk lac2ykpLfAEbHBrdtyZOnE6mmaswAFjkptMHMXedZZ0R1TwiWHK93RlxZXrWtcm1KgDjf8 M2tQQHU1sa6RfrGXsRP6yay4xu2gba4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6lKzcnADsRVo5R8/AmBgx+HsdKI2G4SdTehiLt+ZeAg=; b=gt8zEUXfdJyOKTTJ5H3Z2qZodWXV6uCQAf0MJcHoGlheB8GBdpUkY6kEA+FflQq0WZ SW0b1Mo2Yjkrgi2+bupTSyvnaaL6pk1zdav3wZlMKHMaQgDyvD+fVmvy0zP7Wjnu/0lC VOemzfKQHt1oeox+OVedYRoMj8JwkQBRAF8SLNMADO3b9ARDyzfogvQTjdzUClAAkAgr +C/b283g9p7CgvdtDdCYmNUp+6MdKWBRwsHZ0Up62uOmPOMIYxM4NkmV0TBOw+MT+Hyh GFZ7HXYsYEOzRqt4ohF8l8SH7bC0ERW3A/EDIdbDxdY8rdQ00Z0iha+xbIihgE8BERaR YEHg== X-Gm-Message-State: APjAAAUeUIyMZWxa+t0cFPCKpBO2LDRqz51dWf6QemnyscaUNIxAaciZ n2qqadH1WDOXA4XbLKT9KGG0fm2n X-Google-Smtp-Source: APXvYqze5VoUqJI3dHKLQmsF1u2kQgV8jUNY9X/zY7az9meacz3dRmPXoNTUfNhOHmhumWRcGgLPSQ== X-Received: by 2002:a37:aa11:: with SMTP id t17mr81627648qke.69.1578347902713; Mon, 06 Jan 2020 13:58:22 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:41 -0300 Message-Id: <20200106215750.361615-18-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: Jkt_KQU0MRCXJVEpZj2gSA-1 X-MC-Unique: ovpCDiHDOs-EL2O0JcMwhg-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwSjq007331 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 17/26] qemu: remove remaining unneeded labels 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 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This patch finishes cleaning up unneeded labels on the QEMU files. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/qemu/qemu_command.c | 93 +++++++++++++++++++---------------------- src/qemu/qemu_domain.c | 11 ++--- src/qemu/qemu_driver.c | 32 +++++--------- 3 files changed, 55 insertions(+), 81 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 11d3c29297..d0b1f34058 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1776,12 +1776,12 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk, disk->detect_zero= es); =20 if (qemuBuildDriveSourceStr(disk, qemuCaps, &opt) < 0) - goto error; + return NULL; =20 if (!qemuDiskBusNeedsDriveArg(disk->bus)) { g_autofree char *drivealias =3D qemuAliasDiskDriveFromDisk(disk); if (!drivealias) - goto error; + return NULL; =20 virBufferAddLit(&opt, "if=3Dnone"); virBufferAsprintf(&opt, ",id=3D%s", drivealias); @@ -1791,12 +1791,12 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk, if (idx < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unsupported disk type '%s'"), disk->dst); - goto error; + return NULL; } =20 /* if we are using -device this will be checked elsewhere */ if (qemuCheckDiskConfig(disk, qemuCaps) < 0) - goto error; + return NULL; =20 virBufferAsprintf(&opt, "if=3D%s", virDomainDiskQEMUBusTypeToString(disk->bus)); @@ -1849,9 +1849,6 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk, qemuBuildDiskThrottling(disk, &opt); =20 return virBufferContentAndReset(&opt); - - error: - return NULL; } =20 =20 @@ -1941,20 +1938,20 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, int controllerModel; =20 if (qemuCheckDiskConfig(disk, qemuCaps) < 0) - goto error; + return NULL; =20 if (!qemuDomainCheckCCWS390AddressSupport(def, &disk->info, qemuCaps, = disk->dst)) - goto error; + return NULL; =20 if (disk->iothread && !qemuCheckIOThreads(def, disk)) - goto error; + return NULL; =20 switch ((virDomainDiskBus) disk->bus) { case VIR_DOMAIN_DISK_BUS_IDE: if (disk->info.addr.drive.target !=3D 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("target must be 0 for ide controller")); - goto error; + return NULL; } =20 if (disk->wwn && @@ -1962,7 +1959,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Setting wwn for ide disk is not supported " "by this QEMU")); - goto error; + return NULL; } =20 if (disk->device =3D=3D VIR_DOMAIN_DISK_DEVICE_CDROM) @@ -1979,7 +1976,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, if (!(contAlias =3D virDomainControllerAliasFind(def, VIR_DOMAIN_CONT= ROLLER_TYPE_IDE, disk->info.addr= .drive.controller))) - goto error; + return NULL; } virBufferAsprintf(&opt, ",bus=3D%s.%d,unit=3D%d", contAlias, @@ -1993,7 +1990,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("This QEMU doesn't support scsi-block for= " "lun passthrough")); - goto error; + return NULL; } } =20 @@ -2002,7 +1999,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Setting wwn for scsi disk is not supported " "by this QEMU")); - goto error; + return NULL; } =20 /* Properties wwn, vendor and product were introduced in the @@ -2013,12 +2010,12 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Setting vendor or product for scsi disk is n= ot " "supported by this QEMU")); - goto error; + return NULL; } =20 controllerModel =3D qemuDomainFindSCSIControllerModel(def, &disk->= info); if (controllerModel < 0) - goto error; + return NULL; =20 if (disk->device =3D=3D VIR_DOMAIN_DISK_DEVICE_LUN) { virBufferAddLit(&opt, "scsi-block"); @@ -2038,21 +2035,21 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, scsiVPDDeviceId =3D g_strdup(disk->serial); } else { if (!(scsiVPDDeviceId =3D qemuAliasDiskDriveFromDisk(d= isk))) - goto error; + return NULL; } } } =20 if (!(contAlias =3D virDomainControllerAliasFind(def, VIR_DOMAIN_C= ONTROLLER_TYPE_SCSI, disk->info.addr.dri= ve.controller))) - goto error; + return NULL; =20 if (controllerModel =3D=3D VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOG= IC) { if (disk->info.addr.drive.target !=3D 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("target must be 0 for controller " "model 'lsilogic'")); - goto error; + return NULL; } =20 virBufferAsprintf(&opt, ",bus=3D%s.%d,scsi-id=3D%d", @@ -2065,7 +2062,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("This QEMU doesn't support target " "greater than 7")); - goto error; + return NULL; } =20 if (disk->info.addr.drive.bus !=3D 0 && @@ -2073,7 +2070,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("This QEMU only supports both bus and= " "unit equal to 0")); - goto error; + return NULL; } } =20 @@ -2093,12 +2090,12 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, if (disk->info.addr.drive.bus !=3D 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("bus must be 0 for ide controller")); - goto error; + return NULL; } if (disk->info.addr.drive.target !=3D 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("target must be 0 for ide controller")); - goto error; + return NULL; } =20 if (disk->device =3D=3D VIR_DOMAIN_DISK_DEVICE_CDROM) @@ -2116,7 +2113,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, if (!(contAlias =3D virDomainControllerAliasFind(def, VIR_DOMAIN_CONT= ROLLER_TYPE_SATA, disk->info.addr= .drive.controller))) - goto error; + return NULL; } virBufferAsprintf(&opt, ",bus=3D%s.%d", contAlias, @@ -2126,7 +2123,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, case VIR_DOMAIN_DISK_BUS_VIRTIO: if (qemuBuildVirtioDevStr(&opt, "virtio-blk", qemuCaps, VIR_DOMAIN_DEVICE_DISK, disk) < 0) { - goto error; + return NULL; } =20 if (disk->iothread) @@ -2152,17 +2149,17 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("num-queues property isn't supported by t= his " "QEMU binary")); - goto error; + return NULL; } =20 virBufferAsprintf(&opt, ",num-queues=3D%u", disk->queues); } =20 if (qemuBuildVirtioOptionsStr(&opt, disk->virtio, qemuCaps) < 0) - goto error; + return NULL; =20 if (qemuBuildDeviceAddressStr(&opt, def, &disk->info, qemuCaps) < = 0) - goto error; + return NULL; break; =20 case VIR_DOMAIN_DISK_BUS_USB: @@ -2170,19 +2167,19 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, disk->info.type !=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("unexpected address type for usb disk")); - goto error; + return NULL; } if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("This QEMU doesn't support '-device " "usb-storage'")); - goto error; + return NULL; =20 } virBufferAddLit(&opt, "usb-storage"); =20 if (qemuBuildDeviceAddressStr(&opt, def, &disk->info, qemuCaps) < = 0) - goto error; + return NULL; break; =20 case VIR_DOMAIN_DISK_BUS_FDC: @@ -2196,7 +2193,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, default: virReportError(VIR_ERR_INTERNAL_ERROR, _("unsupported disk bus '%s' with device setup"), b= us); - goto error; + return NULL; } =20 if (disk->src->shared && @@ -2204,7 +2201,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, virBufferAddLit(&opt, ",share-rw=3Don"); =20 if (qemuDomainDiskGetBackendAlias(disk, qemuCaps, &backendAlias) < 0) - goto error; + return NULL; =20 if (backendAlias) virBufferAsprintf(&opt, ",drive=3D%s", backendAlias); @@ -2249,13 +2246,13 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("This QEMU doesn't support setting the " "removable flag of USB storage devices")); - goto error; + return NULL; } } } =20 if (qemuBuildDriveDevCacheStr(disk, &opt, qemuCaps) < 0) - goto error; + return NULL; =20 qemuBuildDiskFrontendAttributes(disk, &opt); =20 @@ -2263,9 +2260,6 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, qemuBuildDiskFrontendAttributeErrorPolicy(disk, &opt); =20 return virBufferContentAndReset(&opt); - - error: - return NULL; } =20 char * @@ -3693,7 +3687,7 @@ qemuBuildNicDevStr(virDomainDefPtr def, if (virDomainNetIsVirtioModel(net)) { if (qemuBuildVirtioDevStr(&buf, "virtio-net", qemuCaps, VIR_DOMAIN_DEVICE_NET, net) < 0) { - goto error; + return NULL; } =20 usingVirtio =3D true; @@ -3723,12 +3717,12 @@ qemuBuildNicDevStr(virDomainDefPtr def, */ virReportEnumRangeError(virDomainNetVirtioTxModeType, net->driver.virtio.txmode); - goto error; + return NULL; } } else { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("virtio-net-pci 'tx' option not supported in = this QEMU binary")); - goto error; + return NULL; } } if (usingVirtio) { @@ -3804,7 +3798,7 @@ qemuBuildNicDevStr(virDomainDefPtr def, if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE))= { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("virtio rx_queue_size option is not supported= with this QEMU binary")); - goto error; + return NULL; } virBufferAsprintf(&buf, ",rx_queue_size=3D%u", net->driver.virtio.= rx_queue_size); } @@ -3812,7 +3806,7 @@ qemuBuildNicDevStr(virDomainDefPtr def, if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_NET_TX_QUEUE_SIZE))= { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("virtio tx_queue_size option is not supported= with this QEMU binary")); - goto error; + return NULL; } virBufferAsprintf(&buf, ",tx_queue_size=3D%u", net->driver.virtio.= tx_queue_size); } @@ -3821,7 +3815,7 @@ qemuBuildNicDevStr(virDomainDefPtr def, if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_NET_HOST_MTU)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("setting MTU is not supported with this QEMU = binary")); - goto error; + return NULL; } virBufferAsprintf(&buf, ",host_mtu=3D%u", net->mtu); } @@ -3832,19 +3826,16 @@ qemuBuildNicDevStr(virDomainDefPtr def, virMacAddrFormat(&net->mac, macaddr)); =20 if (qemuBuildDeviceAddressStr(&buf, def, &net->info, qemuCaps) < 0) - goto error; + return NULL; if (qemuBuildRomStr(&buf, &net->info) < 0) - goto error; + return NULL; if (bootindex) virBufferAsprintf(&buf, ",bootindex=3D%u", bootindex); if (usingVirtio && qemuBuildVirtioOptionsStr(&buf, net->virtio, qemuCaps) < 0) - goto error; + return NULL; =20 return virBufferContentAndReset(&buf); - - error: - return NULL; } =20 =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 065c9e97a9..a4793ea51a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -13113,7 +13113,7 @@ qemuDomainGetMemLockLimitBytes(virDomainDefPtr def, /* prefer the hard limit */ if (virMemoryLimitIsSet(def->mem.hard_limit)) { memKB =3D def->mem.hard_limit; - goto done; + return memKB << 10; } =20 /* If the guest wants its memory to be locked, we need to raise the me= mory @@ -13161,7 +13161,6 @@ qemuDomainGetMemLockLimitBytes(virDomainDefPtr def, if (usesVFIO || forceVFIO) memKB =3D virDomainDefGetMemoryTotal(def) + 1024 * 1024; =20 - done: return memKB << 10; } =20 @@ -13188,7 +13187,6 @@ qemuDomainAdjustMaxMemLock(virDomainObjPtr vm, bool forceVFIO) { unsigned long long bytes =3D 0; - int ret =3D -1; =20 bytes =3D qemuDomainGetMemLockLimitBytes(vm->def, forceVFIO); =20 @@ -13210,12 +13208,9 @@ qemuDomainAdjustMaxMemLock(virDomainObjPtr vm, =20 /* Trying to set the memory locking limit to zero is a no-op */ if (virProcessSetMaxMemLock(vm->pid, bytes) < 0) - goto out; - - ret =3D 0; + return -1; =20 - out: - return ret; + return 0; } =20 =20 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ae54c00239..398258fe0c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1916,7 +1916,7 @@ qemuDomainShutdownFlagsAgent(virQEMUDriverPtr driver, =20 if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_MODIFY) < 0) - goto cleanup; + return -1; =20 if (virDomainObjGetState(vm, NULL) !=3D VIR_DOMAIN_RUNNING) { virReportError(VIR_ERR_OPERATION_INVALID, @@ -1934,8 +1934,6 @@ qemuDomainShutdownFlagsAgent(virQEMUDriverPtr driver, =20 endjob: qemuDomainObjEndAgentJob(vm); - - cleanup: return ret; } =20 @@ -1951,7 +1949,7 @@ qemuDomainShutdownFlagsMonitor(virQEMUDriverPtr drive= r, priv =3D vm->privateData; =20 if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) - goto cleanup; + return -1; =20 if (virDomainObjGetState(vm, NULL) !=3D VIR_DOMAIN_RUNNING) { virReportError(VIR_ERR_OPERATION_INVALID, @@ -1967,8 +1965,6 @@ qemuDomainShutdownFlagsMonitor(virQEMUDriverPtr drive= r, =20 endjob: qemuDomainObjEndJob(driver, vm); - - cleanup: return ret; } =20 @@ -6784,14 +6780,13 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, *ret_def =3D def; *ret_data =3D data; =20 - cleanup: return fd; =20 error: virDomainDefFree(def); virQEMUSaveDataFree(data); VIR_FORCE_CLOSE(fd); - goto cleanup; + return -1; } =20 static int ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6) @@ -12620,7 +12615,6 @@ qemuDomainMigrateFinish2(virConnectPtr dconn, { virQEMUDriverPtr driver =3D dconn->privateData; virDomainObjPtr vm; - virDomainPtr dom =3D NULL; =20 virCheckFlags(QEMU_MIGRATION_FLAGS, NULL); =20 @@ -12629,24 +12623,21 @@ qemuDomainMigrateFinish2(virConnectPtr dconn, virReportError(VIR_ERR_NO_DOMAIN, _("no domain with matching name '%s'"), dname); qemuMigrationDstErrorReport(driver, dname); - goto cleanup; + return NULL; } =20 if (virDomainMigrateFinish2EnsureACL(dconn, vm->def) < 0) { virDomainObjEndAPI(&vm); - goto cleanup; + return NULL; } =20 /* Do not use cookies in v2 protocol, since the cookie * length was not sufficiently large, causing failures * migrating between old & new libvirtd */ - dom =3D qemuMigrationDstFinish(driver, dconn, vm, - NULL, 0, NULL, NULL, /* No cookies */ - flags, retcode, false); - - cleanup: - return dom; + return qemuMigrationDstFinish(driver, dconn, vm, + NULL, 0, NULL, NULL, /* No cookies */ + flags, retcode, false); } =20 =20 @@ -13260,7 +13251,6 @@ qemuNodeDeviceGetPCIInfo(virNodeDeviceDefPtr def, unsigned *function) { virNodeDevCapsDefPtr cap; - int ret =3D -1; =20 cap =3D def->caps; while (cap) { @@ -13278,12 +13268,10 @@ qemuNodeDeviceGetPCIInfo(virNodeDeviceDefPtr def, if (!cap) { virReportError(VIR_ERR_INVALID_ARG, _("device %s is not a PCI device"), def->name); - goto out; + return -1; } =20 - ret =3D 0; - out: - return ret; + return 0; } =20 static int --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347947; cv=none; d=zohomail.com; s=zohoarc; b=g4tIRk3uhsbnzeO+65P8ov8k9wRnCcmNItoFMkRMKJx4TZdKnLJP6W05R5ZkAHguQMsPz4L1HF+EaAWb6FVFFks6obqwrzcan5QOx7Ej5rVoFFFANS+HpePwwNfYZqAzu1RcivhnLJ6ljiBYZslEvDvFhbhPywoeLLsmeNa3wJo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347947; h=Content-Type:Content-Transfer-Encoding:Cc: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=GT5JKqe2cPQoCx3VWaArhdkL8W2h8YGVFHcKH5EW1Ak=; b=Sozs6s0rDqdxXlk2h4ap7xwCGzTf/KgcqWirR93nvHloY8fBYfaB5M16k3vp0OmYHHTzRiOg9YEYD4Gcy5JL0yc8Iu9KZ1emu+iUSYEjuQ13X+/311PwDwjIkXCrWblNPNTHlyYS7gAcz91BPOs+SW70Xz69z+BGEahiLT6HAPs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 157834794770447.74496017217746; Mon, 6 Jan 2020 13:59:07 -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-133-ePeR9ne_P36DZzaob1kvww-1; Mon, 06 Jan 2020 16:59:02 -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 3DC30100551B; Mon, 6 Jan 2020 21:58:57 +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 139357BFFA; Mon, 6 Jan 2020 21:58:57 +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 C8CD618034F0; Mon, 6 Jan 2020 21:58:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwS13007332 for ; Mon, 6 Jan 2020 16:58:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id 64340101B561; Mon, 6 Jan 2020 21:58:28 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5C60E101B566 for ; Mon, 6 Jan 2020 21:58:26 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9E041101D225 for ; Mon, 6 Jan 2020 21:58:26 +0000 (UTC) Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-178-d1hqxPyGOwCs0RL_eqYFAg-1; Mon, 06 Jan 2020 16:58:24 -0500 Received: by mail-qk1-f182.google.com with SMTP id a203so41256393qkc.3 for ; Mon, 06 Jan 2020 13:58:24 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347944; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=GT5JKqe2cPQoCx3VWaArhdkL8W2h8YGVFHcKH5EW1Ak=; b=TVPumj2vhPZimZaWu1MQ7A0az1ULxOUmW1s1hymO74lKJObYt5JTSa2W2/tYkQ6fYubIx4 G8AvXBITwnFZ7GHzCsoBlESLf4SunhjUizUqEIv6bvYJ+RIP08dKetX2G/g+ggrZxwy+DN jSzSXMFXOb4t8xiTUiejFSvr6qrOiY8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=c8ciDcr2klM1lq1ky6fE1wWAPg1l2JbQ+FjuSxrA7JE=; b=P2txdiSPeq1iN36uwLY2O2ak2Zx63qwnvFLai6MtH1PY1yBp4/faPb+sm7ROcqxD/0 qpPn5N47e/F9Ed+xRmKN8IxDsn+8r7+U//zWcGDToaOEy+onakVGjLKG2Jm5XL8yLHTl iZN89porW8HmaF8PR/eeguW9ITUFsh0AQlecxwnNLZEJNPh+mvZ5VydZUsE3W8VT0SUu 2G58TSW9ghsWWj581VopJ1yi7a/LsfUsJ3IVP78EkqD5Y1H5H4hgTFteO5vMCIAFdwXy u1RuydywA48BaORex9fMWxD7JzGeA6rUlDrHm8QWsEtoiOtZsVzcTK86thhpaxRC0VND eskQ== X-Gm-Message-State: APjAAAUI8czgvBwJUvQGQnwpmxiU2CoLhr7SvA7w0w4ttjueultriJIU yeJIysJNsRastMe7alSGSHMTFkne X-Google-Smtp-Source: APXvYqyl4i8cqGL3qUNJMEvL7mcnI4Ju/SuwE79274BY7vx57QjLSPyK48wzozpLLcy0hSD7gSHEog== X-Received: by 2002:ae9:e407:: with SMTP id q7mr75147628qkc.160.1578347904177; Mon, 06 Jan 2020 13:58:24 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:42 -0300 Message-Id: <20200106215750.361615-19-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: d1hqxPyGOwCs0RL_eqYFAg-1 X-MC-Unique: ePeR9ne_P36DZzaob1kvww-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwS13007332 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 18/26] vz/vz_sdk.c: remove unneeded labels 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 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/vz/vz_sdk.c | 102 ++++++++++++++++++------------------------------ 1 file changed, 37 insertions(+), 65 deletions(-) diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index c98542c244..b8ac055574 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -1036,16 +1036,15 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNe= tDefPtr net, bool isCt) PRL_UINT32 emulatedType; PRL_RESULT pret; PRL_BOOL isConnected, isMacFilter; - int ret =3D -1; =20 /* use device name, shown by prlctl as target device * for identifying network adapter in virDomainDefineXML */ if (!(net->ifname =3D prlsdkGetStringParamVar(PrlVmDevNet_GetHostInter= faceName, netAdapter))) - goto cleanup; + return -1; =20 pret =3D PrlVmDev_GetIndex(netAdapter, &netAdapterIndex); - prlsdkCheckRetGoto(pret, cleanup); + prlsdkCheckRetExit(pret, -1); =20 if (isCt && netAdapterIndex =3D=3D (PRL_UINT32) -1) { /* venet devices don't have mac address and @@ -1058,19 +1057,19 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNe= tDefPtr net, bool isCt) =20 pret =3D prlsdkGetStringParamBuf(PrlVmDevNet_GetMacAddressCanonical, netAdapter, macstr, sizeof(macstr)); - prlsdkCheckRetGoto(pret, cleanup); + prlsdkCheckRetExit(pret, -1); =20 if (virMacAddrParse(macstr, &net->mac) < 0) - goto cleanup; + return -1; =20 if (prlsdkGetNetAddresses(netAdapter, net) < 0) - goto cleanup; + return -1; =20 if (prlsdkGetRoutes(netAdapter, net) < 0) - goto cleanup; + return -1; =20 pret =3D PrlVmDev_GetEmulatedType(netAdapter, &emulatedType); - prlsdkCheckRetGoto(pret, cleanup); + prlsdkCheckRetExit(pret, -1); =20 if (emulatedType =3D=3D PNA_ROUTED) { net->type =3D VIR_DOMAIN_NET_TYPE_NETWORK; @@ -1094,7 +1093,7 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNetD= efPtr net, bool isCt) if (!isCt) { PRL_VM_NET_ADAPTER_TYPE type; pret =3D PrlVmDevNet_GetAdapterType(netAdapter, &type); - prlsdkCheckRetGoto(pret, cleanup); + prlsdkCheckRetExit(pret, -1); =20 switch ((int)type) { case PNT_RTL: @@ -1109,12 +1108,12 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNe= tDefPtr net, bool isCt) default: virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown adapter type: %X"), type); - goto cleanup; + return -1; } } =20 pret =3D PrlVmDev_IsConnected(netAdapter, &isConnected); - prlsdkCheckRetGoto(pret, cleanup); + prlsdkCheckRetExit(pret, -1); =20 if (isConnected) net->linkstate =3D VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP; @@ -1122,14 +1121,12 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNe= tDefPtr net, bool isCt) net->linkstate =3D VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN; =20 pret =3D PrlVmDevNet_IsPktFilterPreventMacSpoof(netAdapter, &isMacFilt= er); - prlsdkCheckRetGoto(pret, cleanup); + prlsdkCheckRetExit(pret, -1); =20 net->trustGuestRxFilters =3D isMacFilter ? VIR_TRISTATE_BOOL_YES : VIR_TRISTATE_BOOL_NO; =20 - ret =3D 0; - cleanup: - return ret; + return 0; } =20 static int @@ -1296,29 +1293,27 @@ prlsdkAddDomainHardware(vzDriverPtr driver, { if (IS_CT(def)) { if (prlsdkAddDomainVideoInfoCt(def, xmlopt) < 0) - goto error; + return -1; } else { if (prlsdkAddDomainVideoInfoVm(sdkdom, def) < 0) - goto error; + return -1; } =20 if (prlsdkAddDomainHardDisksInfo(driver, sdkdom, def) < 0) - goto error; + return -1; =20 if (prlsdkAddDomainOpticalDisksInfo(driver, sdkdom, def) < 0) - goto error; + return -1; =20 if (prlsdkAddDomainNetInfo(sdkdom, def) < 0) - goto error; + return -1; =20 if (prlsdkAddSerialInfo(sdkdom, &def->serials, &def->nserials) < 0) - goto error; + return -1; =20 return 0; - error: - return -1; } =20 =20 @@ -1507,7 +1502,7 @@ prlsdkConvertDomainType(PRL_HANDLE sdkdom, virDomainD= efPtr def) PRL_RESULT pret; =20 pret =3D PrlVmCfg_GetVmType(sdkdom, &domainType); - prlsdkCheckRetGoto(pret, error); + prlsdkCheckRetExit(pret, -1); =20 switch (domainType) { case PVT_VM: @@ -1524,9 +1519,6 @@ prlsdkConvertDomainType(PRL_HANDLE sdkdom, virDomainD= efPtr def) } =20 return 0; - - error: - return -1; } =20 static int @@ -1536,7 +1528,7 @@ prlsdkConvertCpuMode(PRL_HANDLE sdkdom, virDomainDefP= tr def) PRL_CPU_MODE cpuMode; =20 pret =3D PrlVmCfg_GetCpuMode(sdkdom, &cpuMode); - prlsdkCheckRetGoto(pret, error); + prlsdkCheckRetExit(pret, -1); =20 switch (cpuMode) { case PCM_CPU_MODE_32: @@ -1552,8 +1544,6 @@ prlsdkConvertCpuMode(PRL_HANDLE sdkdom, virDomainDefP= tr def) } =20 return 0; - error: - return -1; } =20 static PRL_HANDLE @@ -2741,19 +2731,16 @@ prlsdkRemoveBootDevices(PRL_HANDLE sdkdom) =20 /* always get device by index 0, because device list resort after = delete */ pret =3D PrlVmCfg_GetBootDev(sdkdom, 0, &dev); - prlsdkCheckRetGoto(pret, error); + prlsdkCheckRetExit(pret, -1); =20 pret =3D PrlBootDev_GetType(dev, &devType); - prlsdkCheckRetGoto(pret, error); + prlsdkCheckRetExit(pret, -1); =20 pret =3D PrlBootDev_Remove(dev); - prlsdkCheckRetGoto(pret, error); + prlsdkCheckRetExit(pret, -1); } =20 return 0; - - error: - return -1; } =20 static int @@ -3039,7 +3026,6 @@ static int prlsdkApplyGraphicsParams(PRL_HANDLE sdkdo= m, { virDomainGraphicsListenDefPtr glisten; PRL_RESULT pret; - int ret =3D -1; =20 if (!gr) { pret =3D PrlVmCfg_SetVNCMode(sdkdom, PRD_DISABLED); @@ -3052,23 +3038,21 @@ static int prlsdkApplyGraphicsParams(PRL_HANDLE sdk= dom, =20 if (gr->data.vnc.autoport) { pret =3D PrlVmCfg_SetVNCMode(sdkdom, PRD_AUTO); - prlsdkCheckRetGoto(pret, cleanup); + prlsdkCheckRetExit(pret, -1); } else { pret =3D PrlVmCfg_SetVNCMode(sdkdom, PRD_MANUAL); - prlsdkCheckRetGoto(pret, cleanup); + prlsdkCheckRetExit(pret, -1); =20 pret =3D PrlVmCfg_SetVNCPort(sdkdom, gr->data.vnc.port); - prlsdkCheckRetGoto(pret, cleanup); + prlsdkCheckRetExit(pret, -1); } =20 glisten =3D virDomainGraphicsGetListen(gr, 0); pret =3D PrlVmCfg_SetVNCHostName(sdkdom, glisten && glisten->address ? glisten->address : VIR_LOOPBACK= _IPV4_ADDR); - prlsdkCheckRetGoto(pret, cleanup); + prlsdkCheckRetExit(pret, -1); =20 - ret =3D 0; - cleanup: - return ret; + return 0; } =20 static int prlsdkApplyVideoParams(PRL_HANDLE sdkdom G_GNUC_UNUSED, virDoma= inDefPtr def) @@ -3087,11 +3071,9 @@ static int prlsdkApplyVideoParams(PRL_HANDLE sdkdom = G_GNUC_UNUSED, virDomainDefP return -1; =20 pret =3D PrlVmCfg_SetVideoRamSize(sdkdom, def->videos[0]->vram >> 10); - prlsdkCheckRetGoto(pret, error); + prlsdkCheckRetExit(pret, -1); =20 return 0; - error: - return -1; } =20 static int prlsdkAddSerial(PRL_HANDLE sdkdom, virDomainChrDefPtr chr) @@ -4524,13 +4506,12 @@ prlsdkGetMemoryStats(PRL_HANDLE sdkstats, virDomainMemoryStatPtr stats, unsigned int nr_stats) { - int ret =3D -1; long long v =3D 0, t =3D 0, u =3D 0; size_t i =3D 0; =20 #define PRLSDK_GET_COUNTER(NAME, VALUE) \ if (prlsdkExtractStatsParam(sdkstats, NAME, &VALUE) < 0) \ - goto cleanup; \ + return -1; \ =20 #define PRLSDK_MEMORY_STAT_SET(TAG, VALUE) \ if (i < nr_stats) { \ @@ -4574,10 +4555,7 @@ prlsdkGetMemoryStats(PRL_HANDLE sdkstats, #undef PRLSDK_GET_COUNTER #undef PRLSDK_MEMORY_STAT_SET =20 - ret =3D i; - cleanup: - - return ret; + return i; } =20 /* memsize is in MiB */ @@ -4589,19 +4567,16 @@ int prlsdkSetMemsize(virDomainObjPtr dom, unsigned = int memsize) =20 job =3D PrlVm_BeginEdit(privdom->sdkdom); if (PRL_FAILED(waitDomainJob(job, dom))) - goto error; + return -1; =20 pret =3D PrlVmCfg_SetRamSize(privdom->sdkdom, memsize); - prlsdkCheckRetGoto(pret, error); + prlsdkCheckRetExit(pret, -1); =20 job =3D PrlVm_CommitEx(privdom->sdkdom, 0); if (PRL_FAILED(waitDomainJob(job, dom))) - goto error; + return -1; =20 return 0; - - error: - return -1; } =20 static long long @@ -4861,19 +4836,16 @@ int prlsdkSetCpuCount(virDomainObjPtr dom, unsigned= int count) =20 job =3D PrlVm_BeginEdit(privdom->sdkdom); if (PRL_FAILED(waitDomainJob(job, dom))) - goto error; + return -1; =20 pret =3D PrlVmCfg_SetCpuCount(privdom->sdkdom, count); - prlsdkCheckRetGoto(pret, error); + prlsdkCheckRetExit(pret, -1); =20 job =3D PrlVm_CommitEx(privdom->sdkdom, 0); if (PRL_FAILED(waitDomainJob(job, dom))) - goto error; + return -1; =20 return 0; - - error: - return -1; } =20 int prlsdkResizeImage(virDomainObjPtr dom, virDomainDiskDefPtr disk, --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347926; cv=none; d=zohomail.com; s=zohoarc; b=B8/XKhdIUGqIqKHQgeKGDExUttAzGzj0I2RdAhZWELf6fey8tRGgbOHKb4UIJZFmsoEq4Ir09+HxQ4TcdgNOwZr8n/qkVPKQfepStgpj+e9bFTWmU3wGDm59RgHeJPohptEyPrFuRFts69DwnzRMRESz/7wPOHkkiXNTvJW/lHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347926; h=Content-Type:Content-Transfer-Encoding:Cc: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=g7lmZ+YzjaSLkGv8u2HWewedK8thHhpk95P4J+zL8yY=; b=cMfWMykBJ2MYSB7K82U9eH4Q2JgsGSrd0thbgS9SxeTyQ8g/zmh46Gnor3ViaIMERrcOG22QdcoJLHqv1afEGXeAiMD2RLJKk5tmAR8kfNLzaSqVH5Qc4eqaKQGgtAouCYKpFfSBgdJDL0AQ3//iLcyGBMYuMNPQlJaRkMC6zU8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1578347926505813.7173253566827; Mon, 6 Jan 2020 13:58:46 -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-231-BurnZ5pPNdKlIO23WJV-yA-1; Mon, 06 Jan 2020 16:58:44 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C70B11854339; Mon, 6 Jan 2020 21:58:35 +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 A284D5C1B2; Mon, 6 Jan 2020 21:58:35 +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 56DE981C87; Mon, 6 Jan 2020 21:58:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwSJ0007333 for ; Mon, 6 Jan 2020 16:58:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id 66A9510EE799; Mon, 6 Jan 2020 21:58:28 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5DA5D101B56E for ; Mon, 6 Jan 2020 21:58:28 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 23141101D237 for ; Mon, 6 Jan 2020 21:58:28 +0000 (UTC) Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-245-4juzqsyROJeMilHq5D6Mfg-1; Mon, 06 Jan 2020 16:58:26 -0500 Received: by mail-qk1-f175.google.com with SMTP id z76so41255635qka.2 for ; Mon, 06 Jan 2020 13:58:25 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347925; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=g7lmZ+YzjaSLkGv8u2HWewedK8thHhpk95P4J+zL8yY=; b=X9zxJARYUPPNzD+7zGKbWAN0zaPCiv09Ud8/0Wu4FDnURqUzLtSJOvHIFkNmfzfcwCEgNH 1mWIoyQtcp81fPRM4dA1Txc1mLbkFlekw4BawRSfsQMUxlYNPSXs6hZjP6m8z3eLxjVVoW 6Y+fp7hsPzrp8KN7ji4EILHG8DJo6mY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oT+1i+3a7bf6wRQTG/XOgxC03bliJ/BEHXz93NgtXaY=; b=Ysg13QgXV1cq8NtGzaLMUZqsQsT0WnmZE7YeJVLtdzgIU1CJKeV1vf1ANWkX3xGere mSM6QrKGrDhKYpC90EkmHBcIeZPE6puvbh+zeBD4csVHTqM3E9w8NmLuhlrcm0DKxHw9 PZG3WOD6NmPB+fqGjL1DAQHmVuN1d/8+JDpaaZpg2fboGFUMaDqpWTGygo9fJNoIIRpf lAKJ7eUdaKFmmT1hBbJiINYDEMPf6heQv3AEax/fVI0IeBGjGt96Kmri7oi1UsSEWe6G DwsXsY+8yM7epYuwg4oQcE4mQsnqwVr9Z3LEhn4yaQXCFXb5+XUbU8XqAa9jpGF6+dPW jPbQ== X-Gm-Message-State: APjAAAWwEr9g6VIpWFp7H8hkijpQ7Osb3e9f+Ce3QDM5oBBheX2dGMoV 1XbANlRs+jE29Kr8xiRHgequ4srL X-Google-Smtp-Source: APXvYqxRDEMgKUrjrF9eadQAMTUTmkVAagXl9QPstFGY4xK2DFBhFAeQEHJSXcqTJ/hC/PlKpD7BWQ== X-Received: by 2002:a37:a086:: with SMTP id j128mr82202854qke.459.1578347905439; Mon, 06 Jan 2020 13:58:25 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:43 -0300 Message-Id: <20200106215750.361615-20-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: 4juzqsyROJeMilHq5D6Mfg-1 X-MC-Unique: BurnZ5pPNdKlIO23WJV-yA-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwSJ0007333 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 19/26] vbox: remove unneeded labels 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.16 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/vbox/vbox_MSCOMGlue.c | 11 +++++------ src/vbox/vbox_snapshot_conf.c | 9 +++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/vbox/vbox_MSCOMGlue.c b/src/vbox/vbox_MSCOMGlue.c index 18a291a0d8..5cc3f5c7c8 100644 --- a/src/vbox/vbox_MSCOMGlue.c +++ b/src/vbox/vbox_MSCOMGlue.c @@ -357,24 +357,24 @@ vboxLookupRegistryValue(HKEY key, const char *keyName= , const char *valueName) if (status !=3D ERROR_SUCCESS) { VIR_ERROR(_("Could not query registry value '%s\\%s'"), keyName, valueName); - goto cleanup; + return NULL; } =20 if (type !=3D REG_SZ) { VIR_ERROR(_("Registry value '%s\\%s' has unexpected type"), keyName, valueName); - goto cleanup; + return NULL; } =20 if (length < 2) { VIR_ERROR(_("Registry value '%s\\%s' is too short"), keyName, valueName); - goto cleanup; + return NULL; } =20 /* +1 for the null-terminator if it's missing */ if (VIR_ALLOC_N(value, length + 1) < 0) - goto cleanup; + return NULL; =20 status =3D RegQueryValueEx(key, valueName, NULL, NULL, (LPBYTE)value, = &length); =20 @@ -382,13 +382,12 @@ vboxLookupRegistryValue(HKEY key, const char *keyName= , const char *valueName) VIR_FREE(value); VIR_ERROR(_("Could not query registry value '%s\\%s'"), keyName, valueName); - goto cleanup; + return NULL; } =20 if (value[length - 1] !=3D '\0') value[length] =3D '\0'; =20 - cleanup: return value; } =20 diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c index db6c389a64..4cd4e3a983 100644 --- a/src/vbox/vbox_snapshot_conf.c +++ b/src/vbox/vbox_snapshot_conf.c @@ -1228,23 +1228,20 @@ virVBoxSnapshotConfIsCurrentSnapshot(virVBoxSnapsho= tConfMachinePtr machine, if (machine =3D=3D NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Machine is null")); - goto cleanup; + return 0; } if (snapshotName =3D=3D NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("snapshotName is null")); - goto cleanup; + return 0; } snapshot =3D virVBoxSnapshotConfSnapshotByName(machine->snapshot, snap= shotName); if (snapshot =3D=3D NULL) { virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, _("Unable to find the snapshot %s"), snapshotName); - goto cleanup; + return 0; } return STREQ(snapshot->uuid, machine->currentSnapshot); - - cleanup: - return 0; } =20 /* --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347955; cv=none; d=zohomail.com; s=zohoarc; b=ACdzSFo5SZMIwhQJIMaEpLpFB/zvSuNfHGhFiEZ+9SzuUWd0F946BWAZR+B3UvIMuy1bAfmoAzn6SJXPM3rEKQYn/o+hAlj8efh7jSpsCBv2SuZzWzXK/hmIL/u6eaS5766OnzLMk1n/g8sdYgFhbFlTJc+PPQ4eVYuH409vgjU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347955; h=Content-Type:Content-Transfer-Encoding:Cc: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=RWtIxtnemoUCdL5fJjgJALaohGygibMWGWzc7EIR+BI=; b=BfzvHBWkqCXD50xUyTQEhEURJGMMgwBYQGKNlm6nkQyLtv6uq3epVlwVoH8y2gn7ibBJRuQG8nhiaUxWatA0m2u/R71xGUEH5zmbLc0kziHog6sxI93EKH/SBFIAmTFyD0fKc5j9jIPz7051kVzLY4AW16a683j/G0Yvdf66fHI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1578347955362629.4239529349308; Mon, 6 Jan 2020 13:59:15 -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-217-wGC8lzXYM6us9RRbQ2kbyA-1; Mon, 06 Jan 2020 16:59:11 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 59F69107ACCA; Mon, 6 Jan 2020 21:59:05 +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 325B0108419B; Mon, 6 Jan 2020 21:59:05 +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 DD7F518034FD; Mon, 6 Jan 2020 21:59:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwVN5007371 for ; Mon, 6 Jan 2020 16:58:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4B9972166B2A; Mon, 6 Jan 2020 21:58:31 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 468C62166B29 for ; Mon, 6 Jan 2020 21:58:31 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1F63D800FEA for ; Mon, 6 Jan 2020 21:58:31 +0000 (UTC) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-381-yyYczqhRMKGyJFWDG73pPA-1; Mon, 06 Jan 2020 16:58:29 -0500 Received: by mail-qk1-f193.google.com with SMTP id a203so41256569qkc.3 for ; Mon, 06 Jan 2020 13:58:29 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347954; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=RWtIxtnemoUCdL5fJjgJALaohGygibMWGWzc7EIR+BI=; b=LUIBRxUwUz/ugN+LCbGF3CfvfIDlQjZEXUV3n0egCvqU2yEsX/gmFHDY3/1XHi2S7Dx58B A2gSrrzpe2hGQ+pPtgZOj+EN6hPftpQSkLpH0vNXwsy6STXNzr8ka82AA6zjXgtzLcAMtn b03cO/2qkzS6wX1z7yk18QkrdSCMHbU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yfjuel9LYn/c7E7P9VEMENal2iYlIPK3jUoFXjr7n7g=; b=YxLBcvZdK0kvLpiOis3oaX275mkONzfbzz5QbdXXNE0u54pLHBM5soT3ggGdTkbTqz gXVThrCUpDq6HV0TF4fpbwQIgBJyDA2pFYWag85Ltt0yO2GT+FFn2Pnky9qu5JlLGS4o jrMMKpEmJWCeiD7Ws0nlLn+cBVpbqEPGCQ5qWpZS+U/7qUUjP3YYHSDh3AejAw/DsY5C epNcj2I7s5ceio2NZP2di9GShgNgNSr1Hi0BiMHrF9X++KkLDSni3J3mIsuaAsE8jXtm Y0S4hPCpfBjm+adExHKJ0ipGTZ+k4vOjmzoG9dfKkrH9SJYBfhhwrtyfRvjOEkc/kXaX cNFQ== X-Gm-Message-State: APjAAAWt9LtrqLqCbn9MtE3tTSgyMmheQ2ztLzssSvUWkhkloAwgy0lR QMOAmQhavreFWVxhRC7b4MB2Qk2H X-Google-Smtp-Source: APXvYqxQoZQSoOUb0UfsBUym3JVKvyeDdAG1d5evEd9C+1K5mU8GoD2tU6WQQv5v1Kvh7k2ZDL736w== X-Received: by 2002:a37:77c5:: with SMTP id s188mr86919247qkc.369.1578347907015; Mon, 06 Jan 2020 13:58:27 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:44 -0300 Message-Id: <20200106215750.361615-21-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: yyYczqhRMKGyJFWDG73pPA-1 X-MC-Unique: wGC8lzXYM6us9RRbQ2kbyA-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwVN5007371 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 20/26] security: remove unneeded labels 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.22 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/security/security_dac.c | 26 ++++++++++----------- src/security/security_selinux.c | 26 ++++++++++----------- src/security/virt-aa-helper.c | 41 ++++++++++++++------------------- 3 files changed, 41 insertions(+), 52 deletions(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index ccd3874897..2561ee440e 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -1238,7 +1238,7 @@ virSecurityDACSetHostdevLabel(virSecurityManagerPtr m= gr, return 0; =20 if (!(usb =3D virUSBDeviceNew(usbsrc->bus, usbsrc->device, vroot))) - goto done; + return -1; =20 ret =3D virUSBDeviceFileIterate(usb, virSecurityDACSetUSBLabel, @@ -1253,14 +1253,14 @@ virSecurityDACSetHostdevLabel(virSecurityManagerPtr= mgr, pcisrc->addr.slot, pcisrc->addr.function); =20 if (!pci) - goto done; + return -1; =20 if (pcisrc->backend =3D=3D VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) { char *vfioGroupDev =3D virPCIDeviceGetIOMMUGroupDev(pci); =20 if (!vfioGroupDev) { virPCIDeviceFree(pci); - goto done; + return -1; } ret =3D virSecurityDACSetPCILabel(pci, vfioGroupDev, &cbdata); VIR_FREE(vfioGroupDev); @@ -1283,7 +1283,7 @@ virSecurityDACSetHostdevLabel(virSecurityManagerPtr m= gr, dev->readonly, dev->shareable); =20 if (!scsi) - goto done; + return -1; =20 ret =3D virSCSIDeviceFileIterate(scsi, virSecurityDACSetSCSILabel, @@ -1297,7 +1297,7 @@ virSecurityDACSetHostdevLabel(virSecurityManagerPtr m= gr, virSCSIVHostDevicePtr host =3D virSCSIVHostDeviceNew(hostsrc->wwpn= ); =20 if (!host) - goto done; + return -1; =20 ret =3D virSCSIVHostDeviceFileIterate(host, virSecurityDACSetHostLabel, @@ -1310,7 +1310,7 @@ virSecurityDACSetHostdevLabel(virSecurityManagerPtr m= gr, char *vfiodev =3D NULL; =20 if (!(vfiodev =3D virMediatedDeviceGetIOMMUGroupDev(mdevsrc->uuids= tr))) - goto done; + return -1; =20 ret =3D virSecurityDACSetHostdevLabelHelper(vfiodev, &cbdata); =20 @@ -1323,7 +1323,6 @@ virSecurityDACSetHostdevLabel(virSecurityManagerPtr m= gr, break; } =20 - done: return ret; } =20 @@ -1407,7 +1406,7 @@ virSecurityDACRestoreHostdevLabel(virSecurityManagerP= tr mgr, return 0; =20 if (!(usb =3D virUSBDeviceNew(usbsrc->bus, usbsrc->device, vroot))) - goto done; + return -1; =20 ret =3D virUSBDeviceFileIterate(usb, virSecurityDACRestoreUSBLabel= , mgr); virUSBDeviceFree(usb); @@ -1421,14 +1420,14 @@ virSecurityDACRestoreHostdevLabel(virSecurityManage= rPtr mgr, pcisrc->addr.slot, pcisrc->addr.function); =20 if (!pci) - goto done; + return -1; =20 if (pcisrc->backend =3D=3D VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) { char *vfioGroupDev =3D virPCIDeviceGetIOMMUGroupDev(pci); =20 if (!vfioGroupDev) { virPCIDeviceFree(pci); - goto done; + return -1; } ret =3D virSecurityDACRestorePCILabel(pci, vfioGroupDev, mgr); VIR_FREE(vfioGroupDev); @@ -1448,7 +1447,7 @@ virSecurityDACRestoreHostdevLabel(virSecurityManagerP= tr mgr, dev->readonly, dev->shareable); =20 if (!scsi) - goto done; + return -1; =20 ret =3D virSCSIDeviceFileIterate(scsi, virSecurityDACRestoreSCSILa= bel, mgr); virSCSIDeviceFree(scsi); @@ -1460,7 +1459,7 @@ virSecurityDACRestoreHostdevLabel(virSecurityManagerP= tr mgr, virSCSIVHostDevicePtr host =3D virSCSIVHostDeviceNew(hostsrc->wwpn= ); =20 if (!host) - goto done; + return -1; =20 ret =3D virSCSIVHostDeviceFileIterate(host, virSecurityDACRestoreHostLabel, @@ -1474,7 +1473,7 @@ virSecurityDACRestoreHostdevLabel(virSecurityManagerP= tr mgr, char *vfiodev =3D NULL; =20 if (!(vfiodev =3D virMediatedDeviceGetIOMMUGroupDev(mdevsrc->uuids= tr))) - goto done; + return -1; =20 ret =3D virSecurityDACRestoreFileLabel(mgr, vfiodev); VIR_FREE(vfiodev); @@ -1486,7 +1485,6 @@ virSecurityDACRestoreHostdevLabel(virSecurityManagerP= tr mgr, break; } =20 - done: return ret; } =20 diff --git a/src/security/security_selinux.c b/src/security/security_selinu= x.c index 32dc78d777..3a43c4ca7d 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -2094,7 +2094,7 @@ virSecuritySELinuxSetHostdevSubsysLabel(virSecurityMa= nagerPtr mgr, usbsrc->device, vroot); if (!usb) - goto done; + return -1; =20 ret =3D virUSBDeviceFileIterate(usb, virSecuritySELinuxSetUSBLabel= , &data); virUSBDeviceFree(usb); @@ -2107,14 +2107,14 @@ virSecuritySELinuxSetHostdevSubsysLabel(virSecurity= ManagerPtr mgr, pcisrc->addr.slot, pcisrc->addr.function); =20 if (!pci) - goto done; + return -1; =20 if (pcisrc->backend =3D=3D VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) { char *vfioGroupDev =3D virPCIDeviceGetIOMMUGroupDev(pci); =20 if (!vfioGroupDev) { virPCIDeviceFree(pci); - goto done; + return -1; } ret =3D virSecuritySELinuxSetPCILabel(pci, vfioGroupDev, &data= ); VIR_FREE(vfioGroupDev); @@ -2135,7 +2135,7 @@ virSecuritySELinuxSetHostdevSubsysLabel(virSecurityMa= nagerPtr mgr, dev->readonly, dev->shareable); =20 if (!scsi) - goto done; + return -1; =20 ret =3D virSCSIDeviceFileIterate(scsi, virSecuritySELinuxSetSCSILabel, @@ -2149,7 +2149,7 @@ virSecuritySELinuxSetHostdevSubsysLabel(virSecurityMa= nagerPtr mgr, virSCSIVHostDevicePtr host =3D virSCSIVHostDeviceNew(hostsrc->wwpn= ); =20 if (!host) - goto done; + return -1; =20 ret =3D virSCSIVHostDeviceFileIterate(host, virSecuritySELinuxSetHostLabel, @@ -2162,7 +2162,7 @@ virSecuritySELinuxSetHostdevSubsysLabel(virSecurityMa= nagerPtr mgr, char *vfiodev =3D NULL; =20 if (!(vfiodev =3D virMediatedDeviceGetIOMMUGroupDev(mdevsrc->uuids= tr))) - goto done; + return ret; =20 ret =3D virSecuritySELinuxSetHostdevLabelHelper(vfiodev, &data); =20 @@ -2175,7 +2175,6 @@ virSecuritySELinuxSetHostdevSubsysLabel(virSecurityMa= nagerPtr mgr, break; } =20 - done: return ret; } =20 @@ -2332,7 +2331,7 @@ virSecuritySELinuxRestoreHostdevSubsysLabel(virSecuri= tyManagerPtr mgr, usbsrc->device, vroot); if (!usb) - goto done; + return -1; =20 ret =3D virUSBDeviceFileIterate(usb, virSecuritySELinuxRestoreUSBL= abel, mgr); virUSBDeviceFree(usb); @@ -2346,14 +2345,14 @@ virSecuritySELinuxRestoreHostdevSubsysLabel(virSecu= rityManagerPtr mgr, pcisrc->addr.slot, pcisrc->addr.function); =20 if (!pci) - goto done; + return -1; =20 if (pcisrc->backend =3D=3D VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) { char *vfioGroupDev =3D virPCIDeviceGetIOMMUGroupDev(pci); =20 if (!vfioGroupDev) { virPCIDeviceFree(pci); - goto done; + return -1; } ret =3D virSecuritySELinuxRestorePCILabel(pci, vfioGroupDev, m= gr); VIR_FREE(vfioGroupDev); @@ -2373,7 +2372,7 @@ virSecuritySELinuxRestoreHostdevSubsysLabel(virSecuri= tyManagerPtr mgr, dev->readonly, dev->shareable); =20 if (!scsi) - goto done; + return -1; =20 ret =3D virSCSIDeviceFileIterate(scsi, virSecuritySELinuxRestoreSC= SILabel, mgr); virSCSIDeviceFree(scsi); @@ -2385,7 +2384,7 @@ virSecuritySELinuxRestoreHostdevSubsysLabel(virSecuri= tyManagerPtr mgr, virSCSIVHostDevicePtr host =3D virSCSIVHostDeviceNew(hostsrc->wwpn= ); =20 if (!host) - goto done; + return -1; =20 ret =3D virSCSIVHostDeviceFileIterate(host, virSecuritySELinuxRestoreHostL= abel, @@ -2399,7 +2398,7 @@ virSecuritySELinuxRestoreHostdevSubsysLabel(virSecuri= tyManagerPtr mgr, char *vfiodev =3D NULL; =20 if (!(vfiodev =3D virMediatedDeviceGetIOMMUGroupDev(mdevsrc->uuids= tr))) - goto done; + return -1; =20 ret =3D virSecuritySELinuxRestoreFileLabel(mgr, vfiodev, true); =20 @@ -2412,7 +2411,6 @@ virSecuritySELinuxRestoreHostdevSubsysLabel(virSecuri= tyManagerPtr mgr, break; } =20 - done: return ret; } =20 diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 2b1d199458..e01ec12d09 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -546,27 +546,24 @@ verify_xpath_context(xmlXPathContextPtr ctxt) =20 if (!ctxt) { vah_warning(_("Invalid context")); - goto error; + return -1; } =20 /* check if have */ if (!(tmp =3D virXPathString("string(./name[1])", ctxt))) { vah_warning(_("Could not find ")); - goto error; + return -1; } VIR_FREE(tmp); =20 /* check if have */ if (!(tmp =3D virXPathString("string(./uuid[1])", ctxt))) { vah_warning(_("Could not find ")); - goto error; + return -1; } VIR_FREE(tmp); =20 - rc =3D 0; - - error: - return rc; + return 0; } =20 /* @@ -636,7 +633,7 @@ virDomainDefParserConfig virAAHelperDomainDefParserConf= ig =3D { static int get_definition(vahControl * ctl, const char *xmlStr) { - int rc =3D -1, ostype, virtType; + int ostype, virtType; virCapsGuestPtr guest; /* this is freed when caps is freed */ =20 /* @@ -644,22 +641,22 @@ get_definition(vahControl * ctl, const char *xmlStr) * but need them for virDomainDefParseString(). */ if (caps_mockup(ctl, xmlStr) !=3D 0) - goto exit; + return -1; =20 if ((ctl->caps =3D virCapabilitiesNew(ctl->arch, true, true)) =3D=3D N= ULL) { vah_error(ctl, 0, _("could not allocate memory")); - goto exit; + return -1; } =20 if (!(ctl->xmlopt =3D virDomainXMLOptionNew(&virAAHelperDomainDefParse= rConfig, NULL, NULL, NULL, NULL))) { vah_error(ctl, 0, _("Failed to create XML config object")); - goto exit; + return -1; } =20 if ((ostype =3D virDomainOSTypeFromString(ctl->os)) < 0) { vah_error(ctl, 0, _("unknown OS type")); - goto exit; + return -1; } =20 if ((guest =3D virCapabilitiesAddGuest(ctl->caps, @@ -670,12 +667,12 @@ get_definition(vahControl * ctl, const char *xmlStr) 0, NULL)) =3D=3D NULL) { vah_error(ctl, 0, _("could not allocate memory")); - goto exit; + return -1; } =20 if ((virtType =3D virDomainVirtTypeFromString(ctl->virtType)) < 0) { vah_error(ctl, 0, _("unknown virtualization type")); - goto exit; + return -1; } =20 if (virCapabilitiesAddGuestDomain(guest, @@ -685,7 +682,7 @@ get_definition(vahControl * ctl, const char *xmlStr) 0, NULL) =3D=3D NULL) { vah_error(ctl, 0, _("could not allocate memory")); - goto exit; + return -1; } =20 ctl->def =3D virDomainDefParseString(xmlStr, @@ -695,23 +692,20 @@ get_definition(vahControl * ctl, const char *xmlStr) =20 if (ctl->def =3D=3D NULL) { vah_error(ctl, 0, _("could not parse XML")); - goto exit; + return -1; } =20 if (!ctl->def->name) { vah_error(ctl, 0, _("could not find name in XML")); - goto exit; + return -1; } =20 if (valid_name(ctl->def->name) !=3D 0) { vah_error(ctl, 0, _("bad name")); - goto exit; + return -1; } =20 - rc =3D 0; - - exit: - return rc; + return 0; } =20 /** @@ -854,11 +848,10 @@ vah_add_file_chardev(virBufferPtr buf, } else { /* add the file */ if (vah_add_file(buf, path, perms) !=3D 0) - goto cleanup; + return -1; rc =3D 0; } =20 - cleanup: return rc; } =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347937; cv=none; d=zohomail.com; s=zohoarc; b=VyjsK1JXR7snXSdJfkvXAp9QEpvs0LqF/V6uTty8NF0+ef9QhgqXoMLgM6JEHIx81aW5rS6igYwpFoJUewkTlW8vCGHC0VBh3ylfF2ysDfXrumX7Zm4xV8Uxkfcn+l6YfqzxiiuR2i5YdynZBLEqM/jldQFsCbewFxVnRRA7F8o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347937; h=Content-Type:Content-Transfer-Encoding:Cc: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=ZjvWBkVJpOzxW+ZD27fp9XnLjTsxfnr1VtxHEhd6fDg=; b=WF+sT69dw8Ar+tbqXfXkqJLGisbDPyZ5p4+/eeyenACEduM9inzFJ4qF1ySjat/9GYWyR7U6L6F/GyowT9wzPN0C3IdeNntpEOwwmsaGh044uiSFV8lsr9GYzeU5bYIyzH24RSv5CVXUDhDa2eiqm27Q8x6oRfLEF4bSrcOrIcc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1578347937850823.0694999729343; Mon, 6 Jan 2020 13:58:57 -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-241-09Dez4QFPI-JtIjeGbkusQ-1; Mon, 06 Jan 2020 16:58:55 -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 8F0A2800D5B; Mon, 6 Jan 2020 21:58:46 +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 68E4E7C017; Mon, 6 Jan 2020 21:58:46 +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 2D90618034E9; Mon, 6 Jan 2020 21:58:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006Lwbso007410 for ; Mon, 6 Jan 2020 16:58:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 794342022AC6; Mon, 6 Jan 2020 21:58:37 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 741A52022AA8 for ; Mon, 6 Jan 2020 21:58:33 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6A5ED801E7B for ; Mon, 6 Jan 2020 21:58:33 +0000 (UTC) Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-332-vgpp9O-rO5SUwdE4kodV0A-1; Mon, 06 Jan 2020 16:58:30 -0500 Received: by mail-qk1-f175.google.com with SMTP id z14so39627453qkg.9 for ; Mon, 06 Jan 2020 13:58:30 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347936; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=ZjvWBkVJpOzxW+ZD27fp9XnLjTsxfnr1VtxHEhd6fDg=; b=YOsI7xsdJ/cac/TfiEAqGKw2u+6jCWIHiLWNq1ycZaula+GUSxFofn/jq74aIYsRQEQkf8 TQxN2uS7GQWt0IsA/MPSiK9R0WqltH52o/4rTmC1OGC0xqix1erUwbE1iWsEWkWfOzdiQH TE4CNfkZgivEvlPij9+VEzdSVXXfj+g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B3PRruXNC8WDFdkd1m0Kbkq3e6cBpKYLq7kb9ZvG3TM=; b=DuVQffNsTf4jBEYFW2kx/gwnQ/SbPp/w36mvOCUAtd+KobUQa3DR6MknVJxJnpcX0b NA+hF5B2VUCxDtspMq4mUSsf9t5EUGKmvm1LBNRNREqQLvvzOHwSTkTPORAntv6V8ztn 0BcVEDXKoGth7vQf9qMlTCgtDcRLmv5kmcfHNMmSrv6skpaOFAIVPp+KQ85I3duElLuU 9qlo3Iey1gdL52qc8AU1BWA9QjKQyyUP6OYEHqNr7wihT0E74iyYzyufKqhkMg1cD3Gq XHuMKXa2rULolIRHKRcweLExJQROIoLhyJrlE3QdcrmhkbeIQqiaca/dEHJqK1+lwy+Z DUNA== X-Gm-Message-State: APjAAAXXTFD0+s2qzuGr5SgUphalzb32aw1ytd7veWHaFz8Ct56jc5K3 9vfbd5Lh+gZJHz4wxcZY8mkJYG6x X-Google-Smtp-Source: APXvYqxyyTkJUYYLQdIL1FZFmQ0sFOv+nmrpNT//rEQb/EhsQzMH4WM4F/qXuC+1eU6p15M8dBpi1A== X-Received: by 2002:a05:620a:16ad:: with SMTP id s13mr85125807qkj.388.1578347910033; Mon, 06 Jan 2020 13:58:30 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:45 -0300 Message-Id: <20200106215750.361615-22-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: vgpp9O-rO5SUwdE4kodV0A-1 X-MC-Unique: 09Dez4QFPI-JtIjeGbkusQ-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006Lwbso007410 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 21/26] util/virsysinfo.c: remove unneeded labels 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 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/util/virsysinfo.c | 54 ++++++++++++++----------------------------- 1 file changed, 17 insertions(+), 37 deletions(-) diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index e5af4f25e0..c526c0322f 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -1478,7 +1478,7 @@ virSysinfoFormat(virBufferPtr buf, virSysinfoDefPtr d= ef) virReportError(VIR_ERR_CONFIG_UNSUPPORTED, \ _("Target sysinfo %s %s does not match source %= s"), \ desc, NULLSTR(dst->name), NULLSTR(src->name)); \ - goto cleanup; \ + return false; \ } \ } while (0) =20 @@ -1486,15 +1486,13 @@ static bool virSysinfoBIOSIsEqual(virSysinfoBIOSDefPtr src, virSysinfoBIOSDefPtr dst) { - bool identical =3D false; - if (!src && !dst) return true; =20 if ((src && !dst) || (!src && dst)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Target sysinfo does not match source")); - goto cleanup; + return false; } =20 CHECK_FIELD(vendor, "BIOS vendor"); @@ -1502,24 +1500,20 @@ virSysinfoBIOSIsEqual(virSysinfoBIOSDefPtr src, CHECK_FIELD(date, "BIOS date"); CHECK_FIELD(release, "BIOS release"); =20 - identical =3D true; - cleanup: - return identical; + return true; } =20 static bool virSysinfoSystemIsEqual(virSysinfoSystemDefPtr src, virSysinfoSystemDefPtr dst) { - bool identical =3D false; - if (!src && !dst) return true; =20 if ((src && !dst) || (!src && dst)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Target sysinfo does not match source")); - goto cleanup; + return false; } =20 CHECK_FIELD(manufacturer, "system vendor"); @@ -1530,24 +1524,20 @@ virSysinfoSystemIsEqual(virSysinfoSystemDefPtr src, CHECK_FIELD(sku, "system sku"); CHECK_FIELD(family, "system family"); =20 - identical =3D true; - cleanup: - return identical; + return true; } =20 static bool virSysinfoBaseBoardIsEqual(virSysinfoBaseBoardDefPtr src, virSysinfoBaseBoardDefPtr dst) { - bool identical =3D false; - if (!src && !dst) return true; =20 if ((src && !dst) || (!src && dst)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Target base board does not match source")); - goto cleanup; + return false; } =20 CHECK_FIELD(manufacturer, "base board vendor"); @@ -1557,9 +1547,7 @@ virSysinfoBaseBoardIsEqual(virSysinfoBaseBoardDefPtr = src, CHECK_FIELD(asset, "base board asset"); CHECK_FIELD(location, "base board location"); =20 - identical =3D true; - cleanup: - return identical; + return true; } =20 =20 @@ -1567,15 +1555,13 @@ static bool virSysinfoChassisIsEqual(virSysinfoChassisDefPtr src, virSysinfoChassisDefPtr dst) { - bool identical =3D false; - if (!src && !dst) return true; =20 if ((src && !dst) || (!src && dst)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Target chassis does not match source")); - goto cleanup; + return false; } =20 CHECK_FIELD(manufacturer, "chassis vendor"); @@ -1584,9 +1570,7 @@ virSysinfoChassisIsEqual(virSysinfoChassisDefPtr src, CHECK_FIELD(asset, "chassis asset"); CHECK_FIELD(sku, "chassis sku"); =20 - identical =3D true; - cleanup: - return identical; + return true; } =20 =20 @@ -1595,7 +1579,6 @@ virSysinfoChassisIsEqual(virSysinfoChassisDefPtr src, bool virSysinfoIsEqual(virSysinfoDefPtr src, virSysinfoDefPtr dst) { - bool identical =3D false; size_t i; =20 if (!src && !dst) @@ -1604,7 +1587,7 @@ bool virSysinfoIsEqual(virSysinfoDefPtr src, if ((src && !dst) || (!src && dst)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Target sysinfo does not match source")); - goto cleanup; + return false; } =20 if (src->type !=3D dst->type) { @@ -1612,32 +1595,29 @@ bool virSysinfoIsEqual(virSysinfoDefPtr src, _("Target sysinfo %s does not match source %s"), virSysinfoTypeToString(dst->type), virSysinfoTypeToString(src->type)); - goto cleanup; + return false; } =20 if (!virSysinfoBIOSIsEqual(src->bios, dst->bios)) - goto cleanup; + return false; =20 if (!virSysinfoSystemIsEqual(src->system, dst->system)) - goto cleanup; + return false; =20 if (src->nbaseBoard !=3D dst->nbaseBoard) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Target sysinfo base board count '%zu' does not m= atch source '%zu'"), dst->nbaseBoard, src->nbaseBoard); - goto cleanup; + return false; } =20 for (i =3D 0; i < src->nbaseBoard; i++) if (!virSysinfoBaseBoardIsEqual(src->baseBoard + i, dst->baseBoard + i)) - goto cleanup; + return false; =20 if (!virSysinfoChassisIsEqual(src->chassis, dst->chassis)) - goto cleanup; + return false; =20 - identical =3D true; - - cleanup: - return identical; + return true; } --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347928; cv=none; d=zohomail.com; s=zohoarc; b=OS47IK8OiiNAlxQqRYFJzgFFfIGdl7Uy0WNzE62fAw84qYYnXOmuwo5EY6uuFU1eYoUW6YvYjGJR9GubcDZSKL0QklRkQevDKN8Pn9BF2F2I8WQBv+v6t6GskrZnCXj/mvUp6yU7bIWwKps3676NS1zTP/vw5M8lQpbwmNeMYhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347928; h=Content-Type:Content-Transfer-Encoding:Cc: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=GyWhj9W59tx6GuG8u9BzwLnVtVFKmIzoX0aLMFo5mHQ=; b=CKCK+6xi1BRd6SsuI1ZXSICeow/IgVI/b1piesEgNTJQf/2SXIiBhNyRfh0yfHJOfblZZh9bjxVjYLXhXFyuVg4dOWkQwKfUH8xgXmv9cFvvTl2Wm7wzKmnNVvu8tafPDuqQkqx08dRa0h1brEvoZvpcr9HwknVrMgZlpAzPyHQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1578347928297915.0250326726739; Mon, 6 Jan 2020 13:58:48 -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-235-978y230BPJKqhyml9YHNzQ-1; Mon, 06 Jan 2020 16:58:45 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5BCF41005514; Mon, 6 Jan 2020 21:58:39 +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 311D460BEC; Mon, 6 Jan 2020 21:58:39 +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 E7738180CB3B; Mon, 6 Jan 2020 21:58:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwYB2007387 for ; Mon, 6 Jan 2020 16:58:34 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3C9F210166FF; Mon, 6 Jan 2020 21:58:34 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3643E101B564 for ; Mon, 6 Jan 2020 21:58:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 12C87101D231 for ; Mon, 6 Jan 2020 21:58:34 +0000 (UTC) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-228-0d6r-OhmO_67faNKcAmGyQ-1; Mon, 06 Jan 2020 16:58:32 -0500 Received: by mail-qk1-f176.google.com with SMTP id r14so40868329qke.13 for ; Mon, 06 Jan 2020 13:58:32 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347927; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=GyWhj9W59tx6GuG8u9BzwLnVtVFKmIzoX0aLMFo5mHQ=; b=A2zdTURjZyGmE6WZnODl+Og1ktvanKYxEYLVtL4oHpxvWL3dHMOL+gZaAcjuKpu2v775tL ddXf9RG+yLZ3ebVW1rjdAc2TLNzi+4B6lSfrj7nj+IzfAeRr+TA3u/dZjx1edND4Nfuq1p 1SRdPZr+3JBrAVoLAVkFvp7n0Jisv4s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CN67Wrclw0PNAqwvl3tsT+UppMuXhM3wgGT+AYegS6Y=; b=TfhLS+ke51lkcKkxCjO/Y2TqMr6Qs5Jeg0hUccbof5RJYa1pplZsO35jH6nLxaq+7A 7cWpfjNzRUBCcBnKbMV/uObOoK1AW1Eup8zgqasubKW/Qs1Z9fdU5p6JZmGX9RktsTLJ vO5WmrWbj0Eqrc67i31vkNXFDmmOJklY7AOkS1f9h3irp4vqbTYV6qKUEpJuvT+D8c1d yXTztStRVsWXjW+P/tq8NqY38M3oGbYdIz443PNstlNH3Fhlm5JxV3n2kOT6qk0oxk1W F3AVvuM9vSWcWQUYw3NEvU1wD+5cqVke05c053YDKdZIRecEDRPhQeiYf3I4GIv8rFp9 YRmg== X-Gm-Message-State: APjAAAVsgXMq8C/tRx1P3Ix0CMnfAOBLOvPnMNUJuM3ogZc5neRkKLWr D9iFc428rcjfpsVvvx1/NEhYbtj/ X-Google-Smtp-Source: APXvYqzpE/MaLUowq4okCqcMjROOy5z7haDnrcChFchN7I/GmyHHiGnj60/z7lSLoGOl20IMpAZ+KQ== X-Received: by 2002:a37:5d1:: with SMTP id 200mr83146499qkf.492.1578347911609; Mon, 06 Jan 2020 13:58:31 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:46 -0300 Message-Id: <20200106215750.361615-23-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: 0d6r-OhmO_67faNKcAmGyQ-1 X-MC-Unique: 978y230BPJKqhyml9YHNzQ-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwYB2007387 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 22/26] util: remove unneeded labels 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.12 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Remove unneeded labels of the following util files: virhostcpu.c virnetdevvportprofile.c virnetlink.c virpci.c virsocketaddr.c virstoragefile.c Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/util/virhostcpu.c | 6 ++-- src/util/virnetdevvportprofile.c | 52 ++++++++++++++------------------ src/util/virnetlink.c | 4 +-- src/util/virpci.c | 14 +++------ src/util/virsocketaddr.c | 11 ++----- src/util/virstoragefile.c | 4 +-- 6 files changed, 35 insertions(+), 56 deletions(-) diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index 22102f2c75..7f14340f49 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -1119,7 +1119,7 @@ virHostCPUGetThreadsPerSubcore(virArch arch) * In either case, falling back to the subcore-unaware thread * counting logic is the right thing to do */ if (!virFileExists(KVM_DEVICE)) - goto out; + return 0; =20 if ((kvmfd =3D open(KVM_DEVICE, O_RDONLY)) < 0) { /* This can happen when running as a regular user if @@ -1129,8 +1129,7 @@ virHostCPUGetThreadsPerSubcore(virArch arch) virReportSystemError(errno, _("Failed to open '%s'"), KVM_DEVICE); - threads_per_subcore =3D -1; - goto out; + return -1; } =20 /* For Phyp and KVM based guests the ioctl for KVM_CAP_PPC_SMT @@ -1143,7 +1142,6 @@ virHostCPUGetThreadsPerSubcore(virArch arch) VIR_FORCE_CLOSE(kvmfd); } =20 - out: return threads_per_subcore; } =20 diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprof= ile.c index c5db49b932..5ca96132c4 100644 --- a/src/util/virnetdevvportprofile.c +++ b/src/util/virnetdevvportprofile.c @@ -518,7 +518,6 @@ virNetDevVPortProfileGetStatus(struct nlattr **tb, int3= 2_t vf, bool is8021Qbg, uint16_t *status) { - int rc =3D -1; struct nlattr *tb_port[IFLA_PORT_MAX + 1] =3D { NULL, }; =20 if (vf =3D=3D PORT_SELF_VF && nltarget_kernel) { @@ -527,12 +526,12 @@ virNetDevVPortProfileGetStatus(struct nlattr **tb, in= t32_t vf, ifla_port_policy)) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("error parsing IFLA_PORT_SELF part")); - goto cleanup; + return -1; } } else { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("IFLA_PORT_SELF is missing")); - goto cleanup; + return -1; } } else { if (tb[IFLA_VF_PORTS]) { @@ -546,14 +545,14 @@ virNetDevVPortProfileGetStatus(struct nlattr **tb, in= t32_t vf, virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("error while iterating over " "IFLA_VF_PORTS part")); - goto cleanup; + return -1; } =20 if (nla_parse_nested(tb_port, IFLA_PORT_MAX, tb_vf_ports, ifla_port_policy)) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("error parsing IFLA_VF_PORT part")); - goto cleanup; + return -1; } =20 /* This ensures that the given VF is present in the @@ -601,7 +600,7 @@ virNetDevVPortProfileGetStatus(struct nlattr **tb, int3= 2_t vf, virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("error parsing IFLA_VF_PORT " "during error reporting")); - goto cleanup; + return -1; } if (tb_port[IFLA_PORT_INSTANCE_UUID]) { virUUIDFormat((unsigned char *) @@ -613,31 +612,29 @@ virNetDevVPortProfileGetStatus(struct nlattr **tb, in= t32_t vf, *(uint32_t *)RTA_DATA(tb_port[IFLA_PORT_VF]) = : -1, uuidstr); } - goto cleanup; + return -1; } } else { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("IFLA_VF_PORTS is missing")); - goto cleanup; + return -1; } } =20 if (tb_port[IFLA_PORT_RESPONSE]) { *status =3D *(uint16_t *)RTA_DATA(tb_port[IFLA_PORT_RESPONSE]); - rc =3D 0; } else { if (is8021Qbg) { /* no in-progress here; may be missing */ *status =3D PORT_PROFILE_RESPONSE_INPROGRESS; - rc =3D 0; } else { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("no IFLA_PORT_RESPONSE found in netlink messa= ge")); - goto cleanup; + return -1; } } - cleanup: - return rc; + + return 0; } =20 =20 @@ -1051,7 +1048,6 @@ virNetDevVPortProfileOp8021Qbg(const char *ifname, enum virNetDevVPortProfileLinkOp virtPortOp, bool setlink_only) { - int rc =3D -1; int op =3D PORT_REQUEST_ASSOCIATE; struct ifla_port_vsi portVsi =3D { .vsi_mgr_id =3D virtPort->managerID, @@ -1069,7 +1065,7 @@ virNetDevVPortProfileOp8021Qbg(const char *ifname, =20 if (virNetDevVPortProfileGetPhysdevAndVlan(ifname, &physdev_ifindex, physdev_ifname, &vlanid) < = 0) { - goto cleanup; + return -1; } =20 if (vlanid < 0) @@ -1095,22 +1091,20 @@ virNetDevVPortProfileOp8021Qbg(const char *ifname, default: virReportError(VIR_ERR_INTERNAL_ERROR, _("operation type %d not supported"), virtPortOp); - goto cleanup; + return -1; } =20 - rc =3D virNetDevVPortProfileOpCommon(physdev_ifname, physdev_ifindex, - nltarget_kernel, - macaddr, - vlanid, - NULL, - &portVsi, - virtPort->instanceID, - NULL, - vf, - op, - setlink_only); - cleanup: - return rc; + return virNetDevVPortProfileOpCommon(physdev_ifname, physdev_ifindex, + nltarget_kernel, + macaddr, + vlanid, + NULL, + &portVsi, + virtPort->instanceID, + NULL, + vf, + op, + setlink_only); } =20 /* Returns 0 on success, -1 on general failure, and -2 on timeout */ diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index 2542703092..710b4f5f51 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -184,16 +184,14 @@ virNetlinkCreateSocket(int protocol) } nl_socket_enable_msg_peek(nlhandle); =20 - cleanup: return nlhandle; =20 error: if (nlhandle) { nl_close(nlhandle); virNetlinkFree(nlhandle); - nlhandle =3D NULL; } - goto cleanup; + return NULL; } =20 static virNetlinkHandle * diff --git a/src/util/virpci.c b/src/util/virpci.c index 06d855a95b..0b1222373e 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -2146,32 +2146,28 @@ virPCIDeviceAddressParse(char *address, virPCIDeviceAddressPtr bdf) { char *p =3D NULL; - int ret =3D -1; =20 if ((address =3D=3D NULL) || (logStrToLong_ui(address, &p, 16, &bdf->domain) =3D=3D -1)) { - goto out; + return -1; } =20 if ((p =3D=3D NULL) || (logStrToLong_ui(p+1, &p, 16, &bdf->bus) =3D=3D -1)) { - goto out; + return -1; } =20 if ((p =3D=3D NULL) || (logStrToLong_ui(p+1, &p, 16, &bdf->slot) =3D=3D -1)) { - goto out; + return -1; } =20 if ((p =3D=3D NULL) || (logStrToLong_ui(p+1, &p, 16, &bdf->function) =3D=3D -1)) { - goto out; + return -1; } =20 - ret =3D 0; - - out: - return ret; + return 0; } =20 =20 diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c index ef51d3fa7d..f90022827e 100644 --- a/src/util/virsocketaddr.c +++ b/src/util/virsocketaddr.c @@ -1102,27 +1102,24 @@ virSocketAddrPrefixToNetmask(unsigned int prefix, virSocketAddrPtr netmask, int family) { - int result =3D -1; - netmask->data.stor.ss_family =3D AF_UNSPEC; /* assume failure */ =20 if (family =3D=3D AF_INET) { int ip; =20 if (prefix > 32) - goto error; + return -1; =20 ip =3D prefix ? ~((1 << (32 - prefix)) - 1) : 0; netmask->data.inet4.sin_addr.s_addr =3D htonl(ip); netmask->data.stor.ss_family =3D AF_INET; netmask->len =3D sizeof(struct sockaddr_in); - result =3D 0; =20 } else if (family =3D=3D AF_INET6) { size_t i =3D 0; =20 if (prefix > 128) - goto error; + return -1; =20 while (prefix >=3D 8) { /* do as much as possible an entire byte at a time */ @@ -1140,11 +1137,9 @@ virSocketAddrPrefixToNetmask(unsigned int prefix, } netmask->data.stor.ss_family =3D AF_INET6; netmask->len =3D sizeof(struct sockaddr_in6); - result =3D 0; } =20 - error: - return result; + return 0; } =20 /** diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index c9f3e5f865..e46ac99219 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -533,14 +533,12 @@ qcow2GetExtensions(const char *buf, } =20 case QCOW2_HDR_EXTENSION_END: - goto done; + return 0; } =20 offset +=3D len; } =20 - done: - return 0; } =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347934; cv=none; d=zohomail.com; s=zohoarc; b=YKNpU/QMC4QHH1T3oaAvK0ZX1KtAJQasEnq+RK+oA5FNlA2mDC7+rf0A777gUoC+Xx1YaZaAXqV6lgBefY3jt//z0EaV+74Nq+xEYrd/IjSFucl1Tdazl98w2KVVZ3HkCtouyBy7GsbTPL/vNWpdnRMm1v3cagwtpLN7lJWEy1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347934; h=Content-Type:Content-Transfer-Encoding:Cc: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=ePiKxYTzAmLQd3mZHg/m3cd+vW3ISexcBHKT59cS1Xs=; b=aw987f4vF/xS8nZQgDjIwp1HB+KxicJSGXXpyRAdbmisbp68RPtn4g4gH/k/4XWoLS9B8Xy8cXDd7BvHtEFQ8DqK3cI4IBoBGO/53+eFweH6McH2xYrWrxIYHbJHhGMZB6l20z6JgLoKsxdw63qMTEshpwFOAhz2rPyCJqbisKE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1578347934676666.683607463849; Mon, 6 Jan 2020 13:58:54 -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-98-2Rp5caymOailUZoesH7pwg-1; Mon, 06 Jan 2020 16:58:50 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 73A568024DB; Mon, 6 Jan 2020 21:58:42 +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 4F23E858BE; Mon, 6 Jan 2020 21:58:42 +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 0AF7C1803C40; Mon, 6 Jan 2020 21:58:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwauL007397 for ; Mon, 6 Jan 2020 16:58:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id B10F1F9ACB; Mon, 6 Jan 2020 21:58:36 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ABB5AF84E6 for ; Mon, 6 Jan 2020 21:58:36 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8CCF3802FF3 for ; Mon, 6 Jan 2020 21:58:36 +0000 (UTC) Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-182-m96vH4EdOTWDZqvdERk4ZQ-1; Mon, 06 Jan 2020 16:58:34 -0500 Received: by mail-qk1-f177.google.com with SMTP id z76so41255985qka.2 for ; Mon, 06 Jan 2020 13:58:34 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347933; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=ePiKxYTzAmLQd3mZHg/m3cd+vW3ISexcBHKT59cS1Xs=; b=Sg5ZxtvYIDMa6kIaKb8TlbYF3MYq7khkpxQh12MDIMC8PUShrjGOaPMRpLoA58Yjg9AXjr lcb3Q55CrySpTIcdSutPtFpUZ1M/1HAhvzy5VbqT+GASYyvGrg4vlpJiqF1KYoqO9syPcJ +U0WeXi0NzbNG/qBJ3AC537qrmN3abA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cJmFqN1ik/ScGTjDxzsiDTPW9aXvQiwukizJtN8GkD4=; b=WaMFr+xCDG4+xRsDGSvlmd1Yt7LJ701DNo6YKlwW/aX+Uh8fr1hhFYCALgjMsA5Wyi x1NDSM8pm/lIz5pog/eqPh5xQdEqqou691C1bUj/rIXUvmEIYZaVtPnlAizkOW8lXKUt w9suIn3B8thY0fIs2DkpTCxDjRnUhuKdpww1eHhekvxECZS5q+WF1PVw9lEJGnZdou5G 9fkaUAfQoSdDet8Kjxi9ExYRP/fNbcy1GVdxZ0JZ1I6q3eq1rr7pIBCHkL5AECkAHKOZ Tlo1WzMgmJPKyOwcNtyH6RgqNE11GuFWL/a/m9vmQj7xZ2t6qX1NqPWiP8oNJYqA/4d+ mWMA== X-Gm-Message-State: APjAAAX/3SLxXIhoukaJRFfRR5YdwO0bekW8cb/xIZLk2k7MkN/mqczS Iq/yXapmEp9MmYc0JETW2js83Tv7 X-Google-Smtp-Source: APXvYqwuo14Hinm1qLEAWIGc7Uhu3+7ZVr2sWWAKnY/wGqrRhBapNm3d5e+hFLW4f6hLcT2GMpk5aA== X-Received: by 2002:a37:f518:: with SMTP id l24mr81217264qkk.441.1578347913336; Mon, 06 Jan 2020 13:58:33 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:47 -0300 Message-Id: <20200106215750.361615-24-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: m96vH4EdOTWDZqvdERk4ZQ-1 X-MC-Unique: 2Rp5caymOailUZoesH7pwg-1 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwauL007397 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 23/26] util: remove remaining unneeded labels 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.13 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This patch remove the remaining unneeded labels in 'util' files: virnetdev.c virnetdevmacvlan.c virnetdevtap.c virtpm.c virtypedparam.c viruuid.c Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/util/virnetdev.c | 13 ++++--------- src/util/virnetdevmacvlan.c | 3 +-- src/util/virnetdevtap.c | 15 ++++++--------- src/util/virtpm.c | 5 ++--- src/util/virtypedparam.c | 14 ++++---------- src/util/viruuid.c | 13 +++++-------- 6 files changed, 22 insertions(+), 41 deletions(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 03e276a972..e2aad07c24 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -823,7 +823,6 @@ virNetDevGetRcvAllMulti(const char *ifname, char *virNetDevGetName(int ifindex) { char name[IFNAMSIZ]; - char *ifname =3D NULL; =20 memset(&name, 0, sizeof(name)); =20 @@ -831,13 +830,10 @@ char *virNetDevGetName(int ifindex) virReportSystemError(errno, _("Failed to convert interface index %d to a = name"), ifindex); - goto cleanup; + return NULL; } =20 - ifname =3D g_strdup(name); - - cleanup: - return ifname; + return g_strdup(name); } #else char *virNetDevGetName(int ifindex) @@ -1702,7 +1698,7 @@ virNetDevParseVfConfig(struct nlattr **tb, int32_t vf= , virMacAddrPtr mac, if (!tb[IFLA_VFINFO_LIST]) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing IFLA_VF_INFO in netlink response")); - goto cleanup; + return rc; } =20 nla_for_each_nested(tb_vf_info, tb[IFLA_VFINFO_LIST], rem) { @@ -1713,7 +1709,7 @@ virNetDevParseVfConfig(struct nlattr **tb, int32_t vf= , virMacAddrPtr mac, ifla_vf_policy)) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("error parsing IFLA_VF_INFO")); - goto cleanup; + return rc; } =20 if (mac && tb[IFLA_VF_MAC]) { @@ -1739,7 +1735,6 @@ virNetDevParseVfConfig(struct nlattr **tb, int32_t vf= , virMacAddrPtr mac, virReportError(VIR_ERR_INTERNAL_ERROR, _("couldn't find IFLA_VF_INFO for VF %d " "in netlink response"), vf); - cleanup: return rc; } =20 diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index 09efa04df1..3ca568fb44 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -1156,7 +1156,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const cha= r *cr_ifname, linkdev, vmuuid, virtPortProfile, vmO= p); if (rc < 0) - goto error; + return rc; =20 ignore_value(virNetDevVPortProfileAssociate(cr_ifname, virtPortProfile, @@ -1166,7 +1166,6 @@ int virNetDevMacVLanRestartWithVPortProfile(const cha= r *cr_ifname, vmuuid, vmOp, true)); =20 - error: return rc; =20 } diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index e3cf44c5cb..6a16b58d60 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -514,16 +514,16 @@ virNetDevTapAttachBridge(const char *tapname, */ if (mtu > 0) { if (virNetDevSetMTU(tapname, mtu) < 0) - goto error; + return -1; } else { if (virNetDevSetMTUFromDevice(tapname, brname) < 0) - goto error; + return -1; } if (actualMTU) { int retMTU =3D virNetDevGetMTU(tapname); =20 if (retMTU < 0) - goto error; + return -1; =20 *actualMTU =3D retMTU; } @@ -532,21 +532,18 @@ virNetDevTapAttachBridge(const char *tapname, if (virtPortProfile) { if (virtPortProfile->virtPortType =3D=3D VIR_NETDEV_VPORT_PROFILE_= MIDONET) { if (virNetDevMidonetBindPort(tapname, virtPortProfile) < 0) - goto error; + return -1; } else if (virtPortProfile->virtPortType =3D=3D VIR_NETDEV_VPORT_P= ROFILE_OPENVSWITCH) { if (virNetDevOpenvswitchAddPort(brname, tapname, macaddr, vmuu= id, virtPortProfile, virtVlan) < 0) - goto error; + return -1; } } else { if (virNetDevBridgeAddPort(brname, tapname) < 0) - goto error; + return -1; } =20 return 0; - - error: - return -1; } =20 =20 diff --git a/src/util/virtpm.c b/src/util/virtpm.c index 97013f6a7d..505a4230dd 100644 --- a/src/util/virtpm.c +++ b/src/util/virtpm.c @@ -216,16 +216,15 @@ virTPMExecGetCaps(virCommandPtr cmd, continue; =20 if (virBitmapSetBitExpand(bitmap, typ) < 0) - goto cleanup; + return bitmap; } =20 - cleanup: return bitmap; =20 error_bad_json: virReportError(VIR_ERR_INTERNAL_ERROR, _("Unexpected JSON format: %s"), outbuf); - goto cleanup; + return bitmap; } =20 static virBitmapPtr diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c index be3dac1571..d6103bdcb6 100644 --- a/src/util/virtypedparam.c +++ b/src/util/virtypedparam.c @@ -327,12 +327,12 @@ virTypedParamsReplaceString(virTypedParameterPtr *par= ams, virReportError(VIR_ERR_INVALID_ARG, _("Parameter '%s' is not a string"), param->field); - goto error; + return -1; } old =3D param->value.s; } else { if (VIR_EXPAND_N(*params, n, 1) < 0) - goto error; + return -1; param =3D *params + n - 1; } =20 @@ -342,15 +342,12 @@ virTypedParamsReplaceString(virTypedParameterPtr *par= ams, VIR_TYPED_PARAM_STRING, str) < 0) { param->value.s =3D old; VIR_FREE(str); - goto error; + return -1; } VIR_FREE(old); =20 *nparams =3D n; return 0; - - error: - return -1; } =20 =20 @@ -404,7 +401,7 @@ virTypedParamsFilter(virTypedParameterPtr params, size_t i, n =3D 0; =20 if (VIR_ALLOC_N(*ret, nparams) < 0) - goto error; + return -1; =20 for (i =3D 0; i < nparams; i++) { if (STREQ(params[i].field, name)) { @@ -414,9 +411,6 @@ virTypedParamsFilter(virTypedParameterPtr params, } =20 return n; - - error: - return -1; } =20 =20 diff --git a/src/util/viruuid.c b/src/util/viruuid.c index 0745189aa9..c8ee59beee 100644 --- a/src/util/viruuid.c +++ b/src/util/viruuid.c @@ -107,20 +107,20 @@ virUUIDParse(const char *uuidstr, unsigned char *uuid) for (i =3D 0; i < VIR_UUID_BUFLEN;) { uuid[i] =3D 0; if (*cur =3D=3D 0) - goto error; + return -1; if ((*cur =3D=3D '-') || (*cur =3D=3D ' ')) { cur++; continue; } if (!g_ascii_isxdigit(*cur)) - goto error; + return -1; uuid[i] =3D virHexToBin(*cur); uuid[i] *=3D 16; cur++; if (*cur =3D=3D 0) - goto error; + return -1; if (!g_ascii_isxdigit(*cur)) - goto error; + return -1; uuid[i] +=3D virHexToBin(*cur); i++; cur++; @@ -128,14 +128,11 @@ virUUIDParse(const char *uuidstr, unsigned char *uuid) =20 while (*cur) { if (!g_ascii_isspace(*cur)) - goto error; + return -1; cur++; } =20 return 0; - - error: - return -1; } =20 /** --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347932; cv=none; d=zohomail.com; s=zohoarc; b=km5YbJDf8+q/fqUHhZy9hSOl+APLv3DE65ULLZPnE84IlavH/J/pC/4/yqHHIT+AvvUYdkOVEI1Obr34zTBsgXvuPW1fTpufaUyPocLigR+BDrlztlE+NO0W9CJqyjyLw4zThOPE6wPhv6GN/aGri2x/iK2AnDrRIVyowcnJn1E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347932; h=Content-Type:Content-Transfer-Encoding:Cc: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=zoKaHkKQl6tFRgCV0bUOM/hgXTQ7/nAm3N5JTcQFb8Y=; b=nGj8LQ0btnG867qTKUeO10JVUbPD8QYrIawEHJNE1lyNrXDqyRMd3u4UL07SuiQzwMglBTyiene+Pe/r4un4J7m7ugNGAwhcBMayqe6Cwin52PyfnhNoScAhqaFXRNNsz2AaYZRwTN/Uo6j1tWax2+KFK+Z6ClZZTcnwGUgPTjw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1578347932991196.4631104466638; Mon, 6 Jan 2020 13:58:52 -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-92-2-N1VblkOBe9Sd9aKq98Pg-1; Mon, 06 Jan 2020 16:58:49 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3ADD8107ACE5; Mon, 6 Jan 2020 21:58:43 +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 B4A81101F942; Mon, 6 Jan 2020 21:58:42 +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 6A66181C8E; Mon, 6 Jan 2020 21:58:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006Lwbco007404 for ; Mon, 6 Jan 2020 16:58:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 193732166B2A; Mon, 6 Jan 2020 21:58:37 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 142C82166B29 for ; Mon, 6 Jan 2020 21:58:37 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E8428101D223 for ; Mon, 6 Jan 2020 21:58:36 +0000 (UTC) Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-359-G9bBUKKYPHO0ZgJmz7xVXg-1; Mon, 06 Jan 2020 16:58:35 -0500 Received: by mail-qk1-f169.google.com with SMTP id c16so40891411qko.6 for ; Mon, 06 Jan 2020 13:58:35 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347931; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=zoKaHkKQl6tFRgCV0bUOM/hgXTQ7/nAm3N5JTcQFb8Y=; b=UPxPgnsK+uEVXRoS+ug8IblThmMm+U+KOzuTNod926FSFozKW1czH2/F4IkmkBG5L4KX7g 1WuU2CtSIt512g1HUDNQW+ZcV3ebKDQbiSH2TSIacY65wWtXgn3drLPd/A+I59fyEgZYeC UfbokVA25jrOERNwYmS8NGJ1BFM65t0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z3SUBXfSYfZbmCKpOADRYUDZ0Rjf4hngy1Cn/NDF364=; b=IJVtBX/4K98D4YQISsrkAtmvQnd1ZZnhiClMBDSeFFfvn3EdnlMSbX0+LW5C3HvGjJ uty/gupSIYyk8R1BY14l7COreJCDDZ9tnV6fqS5EcpHEyEh1POKUkYR6fnV86UmAzUVY W3zJwvz1iIvxcFmqabBxB6T3MWzARu09gB1z3wwkC/7QrkfhLZzTuoSvTLYDKMCip3OJ 9xTP9a+dKehkCz5KYWDSFgKhA9iqc2RXxjAj/1Qwp/ZdYIq530LxKHafK7GWxoqsOV16 7z11X+fbDSwIzm5Rp08RV/3/rIhQexso/xkUGH2caAvh7VlMUv8xbbml5o8X44h7qOCk faVg== X-Gm-Message-State: APjAAAXHkYS3IJZnZ3nLF6760uUE+YmwbpMmt9OLIUCwAt/zuhEGjEVG /LZJ9j1vaaixGIe56l0GQRRuYxkC X-Google-Smtp-Source: APXvYqxABUCE7YURjLhkJxB0Nf6pRQyJbYnlmcfDS4I5dL2NqgSn5g6nFQtrgJJva9ZhFE2p9UnbGw== X-Received: by 2002:a37:66c2:: with SMTP id a185mr83428661qkc.211.1578347914602; Mon, 06 Jan 2020 13:58:34 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:48 -0300 Message-Id: <20200106215750.361615-25-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: G9bBUKKYPHO0ZgJmz7xVXg-1 X-MC-Unique: 2-N1VblkOBe9Sd9aKq98Pg-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006Lwbco007404 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 24/26] logging: remove unneeded labels 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.22 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- src/logging/log_handler.c | 7 ++----- src/logging/log_manager.c | 14 ++++---------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c index 29ea3011b9..030c9d66e3 100644 --- a/src/logging/log_handler.c +++ b/src/logging/log_handler.c @@ -196,10 +196,10 @@ virLogHandlerNew(bool privileged, virLogHandlerPtr handler; =20 if (virLogHandlerInitialize() < 0) - goto error; + return NULL; =20 if (!(handler =3D virObjectLockableNew(virLogHandlerClass))) - goto error; + return NULL; =20 handler->privileged =3D privileged; handler->max_size =3D max_size; @@ -208,9 +208,6 @@ virLogHandlerNew(bool privileged, handler->opaque =3D opaque; =20 return handler; - - error: - return NULL; } =20 =20 diff --git a/src/logging/log_manager.c b/src/logging/log_manager.c index 6b66218116..fd7c2922b3 100644 --- a/src/logging/log_manager.c +++ b/src/logging/log_manager.c @@ -213,7 +213,6 @@ virLogManagerDomainGetLogFilePosition(virLogManagerPtr = mgr, { struct virLogManagerProtocolDomainGetLogFilePositionArgs args; struct virLogManagerProtocolDomainGetLogFilePositionRet ret; - int rv =3D -1; =20 memset(&args, 0, sizeof(args)); memset(&ret, 0, sizeof(ret)); @@ -228,14 +227,12 @@ virLogManagerDomainGetLogFilePosition(virLogManagerPt= r mgr, 0, NULL, NULL, NULL, (xdrproc_t)xdr_virLogManagerProtocolDomain= GetLogFilePositionArgs, &args, (xdrproc_t)xdr_virLogManagerProtocolDomain= GetLogFilePositionRet, &ret) < 0) - goto cleanup; + return -1; =20 *inode =3D ret.pos.inode; *offset =3D ret.pos.offset; =20 - rv =3D 0; - cleanup: - return rv; + return 0; } =20 =20 @@ -249,7 +246,6 @@ virLogManagerDomainReadLogFile(virLogManagerPtr mgr, { struct virLogManagerProtocolDomainReadLogFileArgs args; struct virLogManagerProtocolDomainReadLogFileRet ret; - char *rv =3D NULL; =20 memset(&args, 0, sizeof(args)); memset(&ret, 0, sizeof(ret)); @@ -267,11 +263,9 @@ virLogManagerDomainReadLogFile(virLogManagerPtr mgr, 0, NULL, NULL, NULL, (xdrproc_t)xdr_virLogManagerProtocolDomain= ReadLogFileArgs, &args, (xdrproc_t)xdr_virLogManagerProtocolDomain= ReadLogFileRet, &ret) < 0) - goto cleanup; + return NULL; =20 - rv =3D ret.data; - cleanup: - return rv; + return ret.data; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578347936; cv=none; d=zohomail.com; s=zohoarc; b=lb7wXZBVzMxMr7Jlwbu1udi8OdcDamVjdfvCuJBTbFujtkOapY9x3f9j8WWTDj3II/lBIQyz2lOzUURYqaI885s84oPv2aTn0nONT+0lR1U1aIXMYoQq3Ooc8NnRB8cUVLN9YpHCrK/e0fR4A9ypLwNYZla//vByAV0kducmZmc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578347936; h=Content-Type:Content-Transfer-Encoding:Cc: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=00EawpByYNnGi1mKF0FSJgZahsBUgFt4S88P/sInmGk=; b=FsTLQ5EWQXA8lfvQEATiJj0ydJMJTUnhHBbsabV7gJa94rLARq+YzDY0SBUUGiZcu/MWRQan5fyfzi0Bh50cMNteGYzR3rJ0zqy7WS3hVZvAbbq2CnfDL8zqWQ9OR1fVmhmJQLRV93ogrWFgeDLLjTS/1YdfsXsN/aD3WVWk/0k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1578347936585488.28537249118654; Mon, 6 Jan 2020 13:58:56 -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-14-N3oeh065PR6DXLylfxBn6g-1; Mon, 06 Jan 2020 16:58:53 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8B122185432D; Mon, 6 Jan 2020 21:58:46 +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 642B55C557; Mon, 6 Jan 2020 21:58:46 +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 267E81803B48; Mon, 6 Jan 2020 21:58:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006LwenU007440 for ; Mon, 6 Jan 2020 16:58:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 93F102166B2B; Mon, 6 Jan 2020 21:58:40 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F7C02166B2A for ; Mon, 6 Jan 2020 21:58:38 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 695A318AE951 for ; Mon, 6 Jan 2020 21:58:38 +0000 (UTC) Received: from mail-qv1-f66.google.com (mail-qv1-f66.google.com [209.85.219.66]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-189-jEJM1srKNfGYX_e-22DDrw-1; Mon, 06 Jan 2020 16:58:36 -0500 Received: by mail-qv1-f66.google.com with SMTP id f16so19707999qvi.4 for ; Mon, 06 Jan 2020 13:58:36 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578347935; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=00EawpByYNnGi1mKF0FSJgZahsBUgFt4S88P/sInmGk=; b=Q2EFMUkttEJX5rL2SVUes7UEe0dTcoRLSJNxRLwAkgSA2fj2N3LnhkC1dDQVY9gPzTkRXo K9/bWjMikUmzPr4Emc/EkSS4nG7Nwv4XQrRw/MSec+ZJE8eilvg1WtPnwU+H9Jo0l4ENOz ioD9qoVMe0hfMZC9JufjFwUJmnxzXHM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+jPI4owhdr1fp2EoIL/998vjrEtafZrXv2eA1udH3qI=; b=lDWdzQYIGSx2/lDEKwQoFGdAUNzSK51eeIAEfBXlZp6UIwnF0OroOwy6Hf4HAoilMu XS+RIW2p3zQKso9HXgD/I31UBqZk+suO154fk8cy2o1vqAOVCb5nEV+bok+lvXntKhA3 UG06rMwlhoQD17QcpC5Gatk3nTkL8xDputzoKSEiIxokvl8pxxO+rsouGzJt+JLXWVNW 9D79ieeEKXo0T3GfJFg7B/zlpozi5djc0h5LLfio2qbrqiK1qFpwPhLqMR9vEPeoG/0o xlHGBpmNWfgylus9TcAvoHOEeilYJic12DjwRmLhwpknnMuTkGd/Pyan3j3G1ock5Tms jBOA== X-Gm-Message-State: APjAAAU6LWQXtWKZsmGXMtblVwbqJJbMRuOa97jOshLt36E8iuXBbm/B AeKWZGaSdrnpJK8V7B7fn1FXz8tD X-Google-Smtp-Source: APXvYqwPpDg3RkovN+kN0HVO4qKbz77heJfk+ncTOuAEGk3SCvpZYgaBbhFSut/P2GXqc6PrNbNMog== X-Received: by 2002:a0c:e28e:: with SMTP id r14mr71839802qvl.234.1578347916068; Mon, 06 Jan 2020 13:58:36 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:49 -0300 Message-Id: <20200106215750.361615-26-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: jEJM1srKNfGYX_e-22DDrw-1 X-MC-Unique: N3oeh065PR6DXLylfxBn6g-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006LwenU007440 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 25/26] tests: remove unneeded labels 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.16 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- tests/qemumonitortestutils.c | 15 +++++---------- tests/testutilsqemu.c | 8 ++------ tests/virhostdevtest.c | 14 +++++--------- 3 files changed, 12 insertions(+), 25 deletions(-) diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 617a2997d1..b29e5d8cd2 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -1078,15 +1078,13 @@ qemuMonitorCommonTestNew(virDomainXMLOptionPtr xmlo= pt, if (virNetSocketListen(test->server, 1) < 0) goto error; =20 - cleanup: return test; =20 error: VIR_FREE(path); VIR_FREE(tmpdir_template); qemuMonitorTestFree(test); - test =3D NULL; - goto cleanup; + return NULL; =20 } =20 @@ -1100,10 +1098,10 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test) return -1; =20 if (virNetSocketAccept(test->server, &test->client) < 0) - goto error; + return -1; =20 if (!test->client) - goto error; + return -1; =20 if (test->outgoingLength > 0) events =3D VIR_EVENT_HANDLE_WRITABLE; @@ -1113,7 +1111,7 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test) qemuMonitorTestIO, test, NULL) < 0) - goto error; + return -1; =20 virMutexLock(&test->lock); if (virThreadCreate(&test->thread, @@ -1121,15 +1119,12 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test) qemuMonitorTestWorker, test) < 0) { virMutexUnlock(&test->lock); - goto error; + return -1; } test->started =3D test->running =3D true; virMutexUnlock(&test->lock); =20 return 0; - - error: - return -1; } =20 =20 diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 8a4fdb1949..9db0cb44c6 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -449,10 +449,9 @@ testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps, { virGICCapability *gicCapabilities =3D NULL; size_t ngicCapabilities =3D 0; - int ret =3D -1; =20 if (VIR_ALLOC_N(gicCapabilities, 2) < 0) - goto out; + return -1; =20 # define IMPL_BOTH \ VIR_GIC_IMPLEMENTATION_KERNEL|VIR_GIC_IMPLEMENTATION_EMULATED @@ -473,10 +472,7 @@ testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps, virQEMUCapsSetGICCapabilities(qemuCaps, gicCapabilities, ngicCapabilities); =20 - ret =3D 0; - - out: - return ret; + return 0; } =20 #endif diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c index b76b78eb56..b6260bd9c1 100644 --- a/tests/virhostdevtest.c +++ b/tests/virhostdevtest.c @@ -539,8 +539,6 @@ testVirHostdevOther(const void *opaque G_GNUC_UNUSED) static int testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSED) { - int ret =3D -1; - /* Don't rely on a state that previous test cases might have * left the manager in. Start with a clean slate. */ virHostdevReAttachPCIDevices(mgr, drv_name, dom_name, @@ -552,7 +550,7 @@ testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSED) =20 /* Firstly, attach all NVMe disks */ if (virHostdevPrepareNVMeDevices(mgr, drv_name, dom_name, disks, ndisk= s) < 0) - goto cleanup; + return -1; =20 CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 3); CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 2); @@ -560,7 +558,7 @@ testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSED) =20 /* Now, try to detach the first one. */ if (virHostdevReAttachNVMeDevices(mgr, drv_name, dom_name, disks, 1) <= 0) - goto cleanup; + return -1; =20 CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 2); CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 2); @@ -568,7 +566,7 @@ testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSED) =20 /* And the last one */ if (virHostdevReAttachNVMeDevices(mgr, drv_name, dom_name, &disks[2], = 1) < 0) - goto cleanup; + return -1; =20 CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 1); CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 1); @@ -576,15 +574,13 @@ testNVMeDiskRoundtrip(const void *opaque G_GNUC_UNUSE= D) =20 /* Finally, detach the middle one */ if (virHostdevReAttachNVMeDevices(mgr, drv_name, dom_name, &disks[1], = 1) < 0) - goto cleanup; + return -1; =20 CHECK_NVME_LIST_COUNT(mgr->activeNVMeHostdevs, 0); CHECK_PCI_LIST_COUNT(mgr->activePCIHostdevs, 0); CHECK_PCI_LIST_COUNT(mgr->inactivePCIHostdevs, 0); =20 - ret =3D 0; - cleanup: - return ret; + return 0; } =20 =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:50:48 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1578348003; cv=none; d=zohomail.com; s=zohoarc; b=jNTOhQPi6bb/ULSzp7rzxnMjETsrvQ8vyaDg+knTLD9QGN/euv808z+xWpD9auKE28a305PO25vqOKKP3+HCsWPkE1uMvjA+a2bYcmySWLpjyzbSnmms4L60K5VqM848T4AfqRCgKAsxXXmy1j9njcb3b4B4EjqqY9avYodHSu0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578348003; h=Content-Type:Content-Transfer-Encoding:Cc: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=yaPORczuOGqWnt0sUeoLAgxxlSxGCbBhCIHobVpS3eA=; b=bIjP/xeEbEMbQK39OhYY1ZpyOE5rVqPfoCjkGhHsfQKui1DfOcckF9z63dONScPbhRbOLNPJGKVDJuGn6S+oekLRIdu3JYMCe6LJkvfkCEGLNY7JeTXSD1zp0TmZLoEVSg+R1gj0HOiuXdPVFQslAtWCBMJptdFkte5p2Vyt5ig= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1578348003293481.7464792689467; Mon, 6 Jan 2020 14:00:03 -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-192-32bqgAA5OV-AgLUN4i0oNQ-1; Mon, 06 Jan 2020 16:59:24 -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 11CD8801E7E; Mon, 6 Jan 2020 21:59:10 +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 D8C0F1A8E2; Mon, 6 Jan 2020 21:59:09 +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 94F0A18034FF; Mon, 6 Jan 2020 21:59:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 006Lwepu007434 for ; Mon, 6 Jan 2020 16:58:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id F0A48F9AB6; Mon, 6 Jan 2020 21:58:39 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EB66B108BDA for ; Mon, 6 Jan 2020 21:58:39 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C6B3580D959 for ; Mon, 6 Jan 2020 21:58:39 +0000 (UTC) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-209-IfSvcJrEMjGAuQKrlBQmpw-1; Mon, 06 Jan 2020 16:58:38 -0500 Received: by mail-qk1-f178.google.com with SMTP id w127so40878966qkb.11 for ; Mon, 06 Jan 2020 13:58:37 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id x34sm23898440qtd.20.2020.01.06.13.58.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 13:58:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578348002; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=yaPORczuOGqWnt0sUeoLAgxxlSxGCbBhCIHobVpS3eA=; b=MF/ZY1q+MK/q7ciPl2MXPy6rUsPl6FcHpIrerBHROcYuqHhFY+9uK9cU2IsUIAc0zR6EEV VyMqwOrO0NKisIafYYhwXjzrnQ6+fS0uZgK45tM3ilHGKP6Hm1Vud8EfVS69AMnxhFmm+K 2J6wTrU5Ev60qU/u3xykdzyAID47/w4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0M/ZAh/r+EGl6Hz2TJ1+qsh+NnQtkPaz4uXcMjkLy54=; b=SKzyfCOd5LdprrheBt1ZVrbgzedo5oR9wQlgRNW505+SV6hyjsQbe1zjejYDOcVSik OACsOCSOIR4P+lgPTeTuLu5yc71KvukNkBl5gJsb3DdgN5VstTNz/k7GeXUv+27D+ETg /3c0646LbN0WnFJdRahptXKrORF0Wey2reGW6tMThmfzIptKvnWMJABg+a8v4Yj0uThL 1UQAYDuGmiN+tF7jF3TiKmRQFDJrTKpskVbFD3TsG/+WXo+SPtX3N2o8GbQsLfiIT6TE XLTLawMXwdpjQz4Bu5Fpq1Xq0y/O/lx2WUEa26PBjYpbzLz+p46dUiD3IedeL5GC9uTh ehOQ== X-Gm-Message-State: APjAAAUO/BE2HSfLXUW8so1JecRALQvyd/vl9CCZEOeuh4w6Dhw8mDUe qFFgYO3ksdadLeWqTDf2h0KKsII/ X-Google-Smtp-Source: APXvYqy5QCTM1ygDpB3pEkRSU0e7R3xQ4TNl1JlUFqweqyTniakpf/qQFtm1ofnUoNqCjgTWrpN/fw== X-Received: by 2002:a05:620a:5ae:: with SMTP id q14mr87155512qkq.437.1578347917395; Mon, 06 Jan 2020 13:58:37 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 6 Jan 2020 18:57:50 -0300 Message-Id: <20200106215750.361615-27-danielhb413@gmail.com> In-Reply-To: <20200106215750.361615-1-danielhb413@gmail.com> References: <20200106215750.361615-1-danielhb413@gmail.com> MIME-Version: 1.0 X-MC-Unique: IfSvcJrEMjGAuQKrlBQmpw-1 X-MC-Unique: 32bqgAA5OV-AgLUN4i0oNQ-1 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 006Lwepu007434 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 26/26] examples: remove unneeded labels 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 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Daniel Henrique Barboza Reviewed-by: Erik Skultety --- examples/c/misc/hellolibvirt.c | 28 +++++++++------------------- examples/c/misc/openauth.c | 22 ++++++---------------- 2 files changed, 15 insertions(+), 35 deletions(-) diff --git a/examples/c/misc/hellolibvirt.c b/examples/c/misc/hellolibvirt.c index bfb12846e6..a598e01be2 100644 --- a/examples/c/misc/hellolibvirt.c +++ b/examples/c/misc/hellolibvirt.c @@ -10,7 +10,6 @@ static int showHypervisorInfo(virConnectPtr conn) { - int ret =3D 0; unsigned long hvVer, major, minor, release; const char *hvType; =20 @@ -20,17 +19,15 @@ showHypervisorInfo(virConnectPtr conn) * hypervisor, so check what it returns. */ hvType =3D virConnectGetType(conn); if (!hvType) { - ret =3D 1; printf("Failed to get hypervisor type: %s\n", virGetLastErrorMessage()); - goto out; + return 1; } =20 if (0 !=3D virConnectGetVersion(conn, &hvVer)) { - ret =3D 1; printf("Failed to get hypervisor version: %s\n", virGetLastErrorMessage()); - goto out; + return 1; } =20 major =3D hvVer / 1000000; @@ -44,15 +41,14 @@ showHypervisorInfo(virConnectPtr conn) minor, release); =20 - out: - return ret; + return 0; } =20 =20 static int showDomains(virConnectPtr conn) { - int ret =3D 0, numNames, numInactiveDomains, numActiveDomains; + int numNames, numInactiveDomains, numActiveDomains; ssize_t i; int flags =3D VIR_CONNECT_LIST_DOMAINS_ACTIVE | VIR_CONNECT_LIST_DOMAINS_INACTIVE; @@ -64,18 +60,16 @@ showDomains(virConnectPtr conn) * unexpected results */ numActiveDomains =3D virConnectNumOfDomains(conn); if (numActiveDomains =3D=3D -1) { - ret =3D 1; printf("Failed to get number of active domains: %s\n", virGetLastErrorMessage()); - goto out; + return 1; } =20 numInactiveDomains =3D virConnectNumOfDefinedDomains(conn); if (numInactiveDomains =3D=3D -1) { - ret =3D 1; printf("Failed to get number of inactive domains: %s\n", virGetLastErrorMessage()); - goto out; + return 1; } =20 printf("There are %d active and %d inactive domains\n", @@ -89,10 +83,9 @@ showDomains(virConnectPtr conn) &nameList, flags); if (numNames =3D=3D -1) { - ret =3D 1; printf("Failed to get a list of all domains: %s\n", virGetLastErrorMessage()); - goto out; + return 1; } =20 for (i =3D 0; i < numNames; i++) { @@ -105,8 +98,7 @@ showDomains(virConnectPtr conn) } free(nameList); =20 - out: - return ret; + return 0; } =20 =20 @@ -126,10 +118,9 @@ main(int argc, char *argv[]) conn =3D virConnectOpenAuth(uri, virConnectAuthPtrDefault, 0); =20 if (!conn) { - ret =3D 1; printf("No connection to hypervisor: %s\n", virGetLastErrorMessage()); - goto out; + return 1; } =20 uri =3D virConnectGetURI(conn); @@ -162,6 +153,5 @@ main(int argc, char *argv[]) printf("Disconnected from hypervisor\n"); } =20 - out: return ret; } diff --git a/examples/c/misc/openauth.c b/examples/c/misc/openauth.c index efd21c374f..4c9dd34be3 100644 --- a/examples/c/misc/openauth.c +++ b/examples/c/misc/openauth.c @@ -16,7 +16,7 @@ showError(virConnectPtr conn) err =3D malloc(sizeof(*err)); if (err =3D=3D NULL) { printf("Could not allocate memory for error data\n"); - goto out; + return; } =20 ret =3D virConnCopyLastError(conn, err); @@ -37,16 +37,12 @@ showError(virConnectPtr conn) =20 virResetError(err); free(err); - - out: - return; } =20 =20 static int showHypervisorInfo(virConnectPtr conn) { - int ret =3D 0; unsigned long hvVer, major, minor, release; const char *hvType; =20 @@ -56,17 +52,15 @@ showHypervisorInfo(virConnectPtr conn) * hypervisor, so check what it returns. */ hvType =3D virConnectGetType(conn); if (hvType =3D=3D NULL) { - ret =3D 1; printf("Failed to get hypervisor type\n"); showError(conn); - goto out; + return 1; } =20 if (virConnectGetVersion(conn, &hvVer) !=3D 0) { - ret =3D 1; printf("Failed to get hypervisor version\n"); showError(conn); - goto out; + return 1; } =20 major =3D hvVer / 1000000; @@ -80,8 +74,7 @@ showHypervisorInfo(virConnectPtr conn) minor, release); =20 - out: - return ret; + return 0; } =20 =20 @@ -227,9 +220,8 @@ main(int argc, char *argv[]) AuthData authData; =20 if (argc !=3D 4) { - ret =3D 1; printf("Usage: %s \n", argv[0]); - goto out; + return 1; } =20 uri =3D argv[1]; @@ -242,10 +234,9 @@ main(int argc, char *argv[]) conn =3D virConnectOpenAuth(uri, &auth, 0); =20 if (NULL =3D=3D conn) { - ret =3D 1; printf("No connection to hypervisor\n"); showError(conn); - goto out; + return 1; } =20 uri =3D virConnectGetURI(conn); @@ -278,6 +269,5 @@ main(int argc, char *argv[]) printf("Disconnected from hypervisor\n"); } =20 - out: return ret; } --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list