From nobody Sun Feb 8 18:49:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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=1571737208; cv=none; d=zoho.com; s=zohoarc; b=g4Jw77FCpBs1SDK0CNxl5KVZozdH30Oc09oTTlG6ZAcosnCC+UQs7pLDo0GFEmtHCMSqg98sTAf7UjTnEnZM7RvwiobN4vHvmgM7HybM41BOKsJcJikVcQr2fNOc1Kg/mK+T8ci5UDHQ7DqDh4tJJI1FdvhrhMk5Nnhf5KRI0IQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571737208; 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=Y3aGvWr+A/Mtd31HGT0H3gszqwJ+24e4m0as7IPhlxE=; b=Ao5XVJ3uhPPSF9dLPt/TJECRVW6Q726ATWMmGeTGLAsx+NSz47FZS72WTq8Kv/yy12tJsoiUpyY1irI4M7khe/bVFdezfbSekmp4M5v8SRpKLnJWRcbbg/EaXQcH3srUkQLLcDAfrEbf+VzHE6s0yCZuKdf3yWGC+TxCs+ACS68= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.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 1571737208706273.14164358795756; Tue, 22 Oct 2019 02:40:08 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-162-37icQlULMhqfS6ypLisv9Q-1; Tue, 22 Oct 2019 05:40:06 -0400 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 2D70E107AD34; Tue, 22 Oct 2019 09:40:01 +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 EFF7E5C3FD; Tue, 22 Oct 2019 09:40: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 B299E8354D; Tue, 22 Oct 2019 09:40:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9LIJY8q000543 for ; Mon, 21 Oct 2019 14:19:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id EC3EF5DE5C; Mon, 21 Oct 2019 18:19:34 +0000 (UTC) Received: from mx1.redhat.com (ext-mx30.extmail.prod.ext.phx2.redhat.com [10.5.110.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB78D5DE5B for ; Mon, 21 Oct 2019 18:19:30 +0000 (UTC) Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7ACDF2B91 for ; Mon, 21 Oct 2019 18:19:29 +0000 (UTC) Received: by mail-qt1-f172.google.com with SMTP id o49so14637136qta.7 for ; Mon, 21 Oct 2019 11:19:29 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:7979:d16f:4e5e:8e8d:1141]) by smtp.gmail.com with ESMTPSA id d205sm9248741qke.96.2019.10.21.11.19.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 11:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571737207; 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=Y3aGvWr+A/Mtd31HGT0H3gszqwJ+24e4m0as7IPhlxE=; b=KRVKMbm2oBiGL6V3eQMm7uHccX1JbWTRo6/1bjgSYpaInToOzVWIQjF7+8t+xAVbijdEP7 eMuBAoUApY6voIfWtbMuQCSZHFx1nkKBRJA/r7lU8yP/syr6Ud8tG7ANwC1bcYuoZbc3No YAq4inS49Scjz5EXPU/Yfo/vnOkPG2I= 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=FAN8U7JVe8RpxFhSWkACnAn/pKCa4NG9CNREweSE/5k=; b=j8hQwUYBD+f9MRuEg8bCCdblmdfh1716qZgPiKhD2bbTDAkhGrW8/2i9vmC7Ug9CNr NOuI8Ki6Tq93C+PwNnYdfJ8yYMKvSLYcwx7NOdw1llylG2HwLJifgo9h8uP6dBUxyBxp 7kRuCz/Wac4WE4/8lNTnPj1HyPGvRUaAPs9r2uK0v7SRm1uUJFxRtIl1p6Yfc/uz8QT2 cEEsleefMbodKaGHpLYAXgbvI06Q2GvScJ1bU3qNJiDhmbXxtP0Cb75MIZDDvoHfrzMS 5jDrnGpc+39bjSgfjEi7GmIphdFWfH5C7lXcF0zAD9tAViRaZVw17fu5+cgt0ntAHM8B TIxg== X-Gm-Message-State: APjAAAVJq8mlnF1CiQcEW6sxJsTr/8lyIazdfOiLcz6PymUjpPoln8JS YJvKZLM0A9FiECe4uJvdT5MUWg6iB6Y= X-Google-Smtp-Source: APXvYqzZSqK/KufdE5GjQKSEep0O+eH+tBBz06jTvA0JqtJtanqd7aA0GOjo/JhsyMQkV5fNU0BPAA== X-Received: by 2002:ac8:730c:: with SMTP id x12mr14095822qto.193.1571681968275; Mon, 21 Oct 2019 11:19:28 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Mon, 21 Oct 2019 15:18:54 -0300 Message-Id: <20191021181911.14986-5-danielhb413@gmail.com> In-Reply-To: <20191021181911.14986-1-danielhb413@gmail.com> References: <20191021181911.14986-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Mon, 21 Oct 2019 18:19:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Mon, 21 Oct 2019 18:19:29 +0000 (UTC) for IP:'209.85.160.172' DOMAIN:'mail-qt1-f172.google.com' HELO:'mail-qt1-f172.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.15 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS) 209.85.160.172 mail-qt1-f172.google.com 209.85.160.172 mail-qt1-f172.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.71 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 04/21] remote: remove unneeded cleanup 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-MC-Unique: 37icQlULMhqfS6ypLisv9Q-1 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: J=C3=A1n Tomko --- src/remote/remote_daemon.c | 38 +++++++++++++++++--------------------- src/remote/remote_driver.c | 15 +++++---------- 2 files changed, 22 insertions(+), 31 deletions(-) diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index 7e63e18034..346415e96b 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -399,7 +399,6 @@ daemonSetupNetworking(virNetServerPtr srv, int unix_sock_ro_mask =3D 0; int unix_sock_rw_mask =3D 0; int unix_sock_adm_mask =3D 0; - int ret =3D -1; g_autoptr(virSystemdActivation) act =3D NULL; virSystemdActivationMap actmap[] =3D { { .name =3D DAEMON_NAME ".socket", .family =3D AF_UNIX, .path =3D = sock_path }, @@ -453,22 +452,22 @@ daemonSetupNetworking(virNetServerPtr srv, =20 if (config->unix_sock_group) { if (virGetGroupID(config->unix_sock_group, &unix_sock_gid) < 0) - return ret; + return -1; } =20 if (virStrToLong_i(config->unix_sock_ro_perms, NULL, 8, &unix_sock_ro_= mask) !=3D 0) { VIR_ERROR(_("Failed to parse mode '%s'"), config->unix_sock_ro_per= ms); - goto cleanup; + return -1; } =20 if (virStrToLong_i(config->unix_sock_admin_perms, NULL, 8, &unix_sock_= adm_mask) !=3D 0) { VIR_ERROR(_("Failed to parse mode '%s'"), config->unix_sock_admin_= perms); - goto cleanup; + return -1; } =20 if (virStrToLong_i(config->unix_sock_rw_perms, NULL, 8, &unix_sock_rw_= mask) !=3D 0) { VIR_ERROR(_("Failed to parse mode '%s'"), config->unix_sock_rw_per= ms); - goto cleanup; + return -1; } =20 if (virNetServerAddServiceUNIX(srv, @@ -482,7 +481,7 @@ daemonSetupNetworking(virNetServerPtr srv, false, config->max_queued_clients, config->max_client_requests) < 0) - goto cleanup; + return -1; if (sock_path_ro && virNetServerAddServiceUNIX(srv, act, @@ -495,7 +494,7 @@ daemonSetupNetworking(virNetServerPtr srv, true, config->max_queued_clients, config->max_client_requests) < 0) - goto cleanup; + return -1; =20 if (sock_path_adm && virNetServerAddServiceUNIX(srvAdm, @@ -509,7 +508,7 @@ daemonSetupNetworking(virNetServerPtr srv, false, config->admin_max_queued_clients, config->admin_max_client_requests) < 0) - goto cleanup; + return -1; =20 #ifdef WITH_IP if (((ipsock && config->listen_tcp) || act) && @@ -524,7 +523,7 @@ daemonSetupNetworking(virNetServerPtr srv, false, config->max_queued_clients, config->max_client_requests) < 0) - goto cleanup; + return -1; =20 if (((ipsock && config->listen_tls) || (act && virSystemdActivationHas= Name(act, DAEMON_NAME "-tls.socket")))) { virNetTLSContextPtr ctxt =3D NULL; @@ -535,17 +534,17 @@ daemonSetupNetworking(virNetServerPtr srv, if (!config->ca_file) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("No CA certificate path set to match serv= er key/cert")); - goto cleanup; + return -1; } if (!config->cert_file) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("No server certificate path set to match = server key")); - goto cleanup; + return -1; } if (!config->key_file) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("No server key path set to match server c= ert")); - goto cleanup; + return -1; } VIR_DEBUG("Using CA=3D'%s' cert=3D'%s' key=3D'%s'", config->ca_file, config->cert_file, config->key_file= ); @@ -557,7 +556,7 @@ daemonSetupNetworking(virNetServerPtr srv, config->tls_priority, config->tls_no_sanity_c= ertificate ? false : true, config->tls_no_verify_c= ertificate ? false : true))) - goto cleanup; + return -1; } else { if (!(ctxt =3D virNetTLSContextNewServerPath(NULL, !privileged, @@ -565,7 +564,7 @@ daemonSetupNetworking(virNetServerPtr srv, config->tls_priorit= y, config->tls_no_sani= ty_certificate ? false : true, config->tls_no_veri= fy_certificate ? false : true))) - goto cleanup; + return -1; } =20 VIR_DEBUG("Registering TLS socket %s:%s", @@ -582,7 +581,7 @@ daemonSetupNetworking(virNetServerPtr srv, config->max_queued_clients, config->max_client_requests) < 0) { virObjectUnref(ctxt); - goto cleanup; + return -1; } virObjectUnref(ctxt); } @@ -590,19 +589,16 @@ daemonSetupNetworking(virNetServerPtr srv, =20 if (act && virSystemdActivationComplete(act) < 0) - goto cleanup; + return -1; =20 #if WITH_SASL if (virNetServerNeedsAuth(srv, REMOTE_AUTH_SASL) && !(saslCtxt =3D virNetSASLContextNewServer( (const char *const*)config->sasl_allowed_username_list))) - goto cleanup; + return -1; #endif =20 - ret =3D 0; - - cleanup: - return ret; + return 0; } =20 =20 diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 83477243fc..67ae0fe286 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -4182,20 +4182,18 @@ static int remoteAuthInteract(virConnectPtr conn, struct remoteAuthInteractState *state, virConnectAuthPtr auth) { - int ret =3D -1; - VIR_DEBUG("Starting SASL interaction"); remoteAuthInteractStateClear(state, false); =20 /* Fills state->interact with any values from the auth config file */ if (remoteAuthFillFromConfig(conn, state) < 0) - goto cleanup; + return -1; =20 /* Populates state->cred for anything not found in the auth config */ if (remoteAuthMakeCredentials(state->interact, &state->cred, &state->n= cred) < 0) { virReportError(VIR_ERR_AUTH_FAILED, "%s", _("Failed to make auth credentials")); - goto cleanup; + return -1; } =20 /* If there was anything not in the auth config, we need to @@ -4206,13 +4204,13 @@ static int remoteAuthInteract(virConnectPtr conn, if (!auth || !auth->cb) { virReportError(VIR_ERR_AUTH_FAILED, "%s", _("No authentication callback available")); - goto cleanup; + return -1; } =20 if ((*(auth->cb))(state->cred, state->ncred, auth->cbdata) < 0) { virReportError(VIR_ERR_AUTH_FAILED, "%s", _("Failed to collect auth credentials")); - goto cleanup; + return -1; } =20 /* Copy user's responses from cred into interact */ @@ -4227,10 +4225,7 @@ static int remoteAuthInteract(virConnectPtr conn, * of this method, rather than the end. */ =20 - ret =3D 0; - - cleanup: - return ret; + return 0; } =20 =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list