From nobody Tue May 13 18:56:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534266513208664.6748552539449; Tue, 14 Aug 2018 10:08:33 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 82F1FC047B72; Tue, 14 Aug 2018 17:08:30 +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 445C46FDBB; Tue, 14 Aug 2018 17:08:30 +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 D4E6D18037F5; Tue, 14 Aug 2018 17:08:29 +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 w7EH813R003313 for ; Tue, 14 Aug 2018 13:08:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5062318A51; Tue, 14 Aug 2018 17:08:01 +0000 (UTC) Received: from unknown4CEB42C824F4.redhat.com (ovpn-116-168.phx2.redhat.com [10.3.116.168]) by smtp.corp.redhat.com (Postfix) with ESMTP id 09CA75D9C5 for ; Tue, 14 Aug 2018 17:08:00 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 14 Aug 2018 13:07:52 -0400 Message-Id: <20180814170756.19205-8-jferlan@redhat.com> In-Reply-To: <20180814170756.19205-1-jferlan@redhat.com> References: <20180814170756.19205-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/11] hyperv: Don't overwrite virAuthGet{Username|Password} errors 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 14 Aug 2018 17:08:31 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Now that the virAuthGet*Path API's generate all the error messages we can remove them from the callers. This means that we will no longer overwrite the error from the API. Signed-off-by: John Ferlan --- src/hyperv/hyperv_driver.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 7ca145aef5..f41cd1c939 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -152,21 +152,15 @@ hypervConnectOpen(virConnectPtr conn, virConnectAuthP= tr auth, if (VIR_STRDUP(username, conn->uri->user) < 0) goto cleanup; } else { - username =3D virAuthGetUsername(conn, auth, "hyperv", "administrat= or", conn->uri->server); - - if (username =3D=3D NULL) { - virReportError(VIR_ERR_AUTH_FAILED, "%s", _("Username request = failed")); + if (!(username =3D virAuthGetUsername(conn, auth, "hyperv", + "administrator", + conn->uri->server))) goto cleanup; - } } =20 - password =3D virAuthGetPassword(conn, auth, "hyperv", username, conn->= uri->server); - - if (password =3D=3D NULL) { - virReportError(VIR_ERR_AUTH_FAILED, "%s", _("Password request fail= ed")); + if (!(password =3D virAuthGetPassword(conn, auth, "hyperv", username, + conn->uri->server))) goto cleanup; - } - =20 if (hypervInitConnection(conn, priv, username, password) < 0) goto cleanup; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list