]> git.ipfire.org Git - thirdparty/libvirt.git/commit
hyperv: Fix hypervInitConnection error reporting
authorLadi Prosek <lprosek@redhat.com>
Fri, 6 Oct 2017 06:47:33 +0000 (08:47 +0200)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 16 Oct 2017 14:29:32 +0000 (10:29 -0400)
commitbb8c2a76ca2c5e88042ed073baa91a97512223f6
tree9b7e9513b5091d349e1fef44dc97aec1ceafa330
parent441d3eb6d1be940a67ce45a286602a967601b157
hyperv: Fix hypervInitConnection error reporting

"%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=http
  Enter username for localhost [administrator]:
  Enter administrator's password for localhost: <enters incorrect password>
  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=http
  Enter username for localhost [administrator]:
  Enter administrator's password for localhost: <enters incorrect password>
  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 <lprosek@redhat.com>
src/hyperv/hyperv_driver.c
src/hyperv/hyperv_wmi.c