]> git.ipfire.org Git - thirdparty/libvirt.git/commit
hyperv: make Msvm_ComputerSystem WQL queries locale agnostic
authorMatt Coleman <mcoleman@datto.com>
Mon, 5 Oct 2020 16:20:06 +0000 (12:20 -0400)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 9 Oct 2020 07:19:19 +0000 (09:19 +0200)
commitc1cfbaab25b769aff081a0f7d31842d0df9c1cbc
tree5ebd96ebde87ef79c1ade7151bc35c6ddd12adfd
parent25fc56ed7706b95335e9cd4eb0337cd3711f91f9
hyperv: make Msvm_ComputerSystem WQL queries locale agnostic

There are two specific WQL queries we're using to get either a list of
virtual machines or the hypervisor host itself from Msvm_ComputerSystem.
Those queries rely on filtering results based on the "Description"
field. Since the "Description" field is locale sensitive, the queries
will fail if the Windows host is using a language pack. While the WSMAN
spec allows the client to set the requested locale (and it is supported
since openwsman 2.6.x), the Windows WinRM service does not respect this
setting: it returns non-English strings despite the WSMAN request
properly setting the locale to 'en-US'. Therefore, this patch changes
the WQL query to make use of the "__SERVER" field to stop relying on
English strings in queries and side step the issue.

Co-authored-by: Dawid Zamirski <dzamirski@datto.com>
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/hyperv/hyperv_wmi_classes.h