From nobody Sun Feb 8 21:33:45 2026 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 1507025411425104.96138870245181; Tue, 3 Oct 2017 03:10:11 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 6AC04C059B64; Tue, 3 Oct 2017 10:10: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 4519361F3D; Tue, 3 Oct 2017 10:10:10 +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 BAC0A18355C4; Tue, 3 Oct 2017 10:10:09 +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 v93957Yg011553 for ; Tue, 3 Oct 2017 05:05:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 47FBF60487; Tue, 3 Oct 2017 09:05:07 +0000 (UTC) Received: from dhcp-1-107.brq.redhat.com (ovpn-204-56.brq.redhat.com [10.40.204.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id B5A816046F for ; Tue, 3 Oct 2017 09:05:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6AC04C059B64 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Ladi Prosek To: libvir-list@redhat.com Date: Tue, 3 Oct 2017 11:04:56 +0200 Message-Id: <20171003090458.31130-2-lprosek@redhat.com> In-Reply-To: <20171003090458.31130-1-lprosek@redhat.com> References: <20171003090458.31130-1-lprosek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Tue, 03 Oct 2017 05:41:37 -0400 Subject: [libvirt] [PATCH 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 03 Oct 2017 10:10:10 +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 fixes hypervEnumAndPull to set a meaningful internal error on a= ll error paths and removes the general virReportError. 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 --- src/hyperv/hyperv_driver.c | 2 -- src/hyperv/hyperv_wmi.c | 1 + 2 files changed, 1 insertion(+), 2 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..6a51eff20 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -985,6 +985,7 @@ hypervEnumAndPull(hypervPrivate *priv, hypervWqlQueryPt= r wqlQuery, hypervObject *object; =20 if (virBufferCheckError(wqlQuery->query) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid query")); virBufferFreeAndReset(wqlQuery->query); return -1; } --=20 2.13.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list