From nobody Thu May 15 11:43:34 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507273598451964.2738380856846; Fri, 6 Oct 2017 00:06:38 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 270D77EA8D; Fri, 6 Oct 2017 07:06:37 +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 C14EA5E261; Fri, 6 Oct 2017 07:06:36 +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 16B7418355C5; Fri, 6 Oct 2017 07:06:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v966lnME020247 for ; Fri, 6 Oct 2017 02:47:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id 86FE261359; Fri, 6 Oct 2017 06:47:49 +0000 (UTC) Received: from dhcp-1-107.brq.redhat.com (ovpn-204-170.brq.redhat.com [10.40.204.170]) by smtp.corp.redhat.com (Postfix) with ESMTP id A76AB6135F; Fri, 6 Oct 2017 06:47:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 270D77EA8D Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Ladi Prosek To: libvir-list@redhat.com Date: Fri, 6 Oct 2017 08:47:33 +0200 Message-Id: <20171006064735.29638-2-lprosek@redhat.com> In-Reply-To: <20171006064735.29638-1-lprosek@redhat.com> References: <20171006064735.29638-1-lprosek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 1/3] hyperv: Fix hypervInitConnection error reporting 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 06 Oct 2017 07:06:37 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" "%s is not a Hyper-V server" is not a correct generalization of all possible error conditions of hypervEnumAndPull. For example: $ virsh --connect hyperv://localhost/?transport=3Dhttp Enter username for localhost [administrator]: Enter administrator's password for localhost: error: failed to connect to the hypervisor error: internal error: localhost is not a Hyper-V server This commit removes the general virReportError from hypervInitConnection and also the "Invalid query" virReportError from hypervSerializeEprParam, which does not correctly describe the error either (virBufferCheckError has already set a meaningful error message at that point). The same scenario with the fix: $ virsh --connect hyperv://localhost/?transport=3Dhttp Enter username for localhost [administrator]: Enter administrator's password for localhost: error: failed to connect to the hypervisor error: internal error: Transport error during enumeration: User, password= or similar was not accepted (26) Signed-off-by: Ladi Prosek Reviewed-by: John Ferlan --- src/hyperv/hyperv_driver.c | 2 -- src/hyperv/hyperv_wmi.c | 1 - 2 files changed, 3 deletions(-) diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 09912610c..52274239c 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -105,8 +105,6 @@ hypervInitConnection(virConnectPtr conn, hypervPrivate = *priv, priv->wmiVersion =3D HYPERV_WMI_VERSION_V1; =20 if (hypervEnumAndPull(priv, &wqlQuery, &computerSystem) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("%s is not a Hyper-V server"), conn->uri->ser= ver); goto cleanup; } } diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index 980a00e28..0b9431bfa 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -514,7 +514,6 @@ hypervSerializeEprParam(hypervParamPtr p, hypervPrivate= *priv, /* Get query and create filter based on it */ if (virBufferCheckError(p->epr.query) < 0) { virBufferFreeAndReset(p->epr.query); - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid query")); goto cleanup; } query_string =3D virBufferContentAndReset(p->epr.query); --=20 2.13.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list