Bug 2150455
| Summary: | qemuAgentGetDisks cannot parse response from a guest agent running in Windows VM | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Lili Zhu <lizhu> | |
| Component: | libvirt | Assignee: | Peter Krempa <pkrempa> | |
| libvirt sub component: | CLI & API | QA Contact: | Lili Zhu <lizhu> | |
| Status: | CLOSED ERRATA | Docs Contact: | ||
| Severity: | medium | |||
| Priority: | unspecified | CC: | chhu, jdenemar, jspanko, lmen, pkrempa, virt-maint, yalzhang, ymankad | |
| Version: | 9.2 | Keywords: | Triaged, ZStream | |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
|
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | libvirt-9.0.0-1.el9 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | 2149752 | |||
| : | 2154410 2154411 (view as bug list) | Environment: | ||
| Last Closed: | 2023-05-09 07:27:43 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | 9.0.0 | |
| Embargoed: | ||||
| Bug Depends On: | 2149752 | |||
| Bug Blocks: | 2154410, 2154411 | |||
|
Description
Lili Zhu
2022-12-03 05:50:00 UTC
Fixed upstream by:
commit 3b576601dfb924bb518870a01de5d1a421cbb467
Author: Peter Krempa <pkrempa>
Date: Thu Dec 1 17:02:42 2022 +0100
qemuAgentGetDisks: Don't use virJSONValueObjectGetStringArray for optional data
The 'dependencies' field in the return data may be missing in some
cases. Historically 'virJSONValueObjectGetStringArray' didn't report
error in such case, but later refactor (commit 043b50b948ef3c2 ) added
an error in order to use it in other places too.
Unfortunately this results in the error log being spammed with an
irrelevant error in case when qemuAgentGetDisks is invoked on a VM
running windows.
Replace the use of virJSONValueObjectGetStringArray by fetching the
array first and calling virJSONValueArrayToStringList only when we have
an array.
Fixes: 043b50b948ef3c2a4adf5fa32a93ec2589851ac6
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2149752
Signed-off-by: Peter Krempa <pkrempa>
Reviewed-by: Michal Privoznik <mprivozn>
commit 6765bdeaf7e9cbdb4c39d47f3b77fb28a498408a
Author: Peter Krempa <pkrempa>
Date: Thu Dec 1 13:32:07 2022 +0100
util: json: Split out array->strinlist conversion from virJSONValueObjectGetStringArray
Introduce virJSONValueArrayToStringList which does only the conversion
from an array to a stringlist.
This will allow refactoring the callers to be more careful in case when
they want to handle the existance of the member in the parent object
differently.
Signed-off-by: Peter Krempa <pkrempa>
Reviewed-by: Michal Privoznik <mprivozn>
v8.10.0-32-g3b576601df
Test this bug with:
libvirt-9.0.0-1.el9.x86_64
1. prepare a win guest with guest agent device
# virsh domtime win2k19
Time: 1669923955
2. config the virtqemud conf file
# grep -v ^# /etc/libvirt/virtqemud.conf
log_outputs = "3:file:/var/log/libvirt/libvirtd.log"
3. restart virtqemud
4. Get guest disk info
# virsh qemu-agent-command win2k19 '{ "execute": "guest-get-disks" }'
{"return":[{"name":"\\\\.\\PhysicalDrive0","partition":false,"address":{"serial":"QM00001","bus-type":"sata","bus":0,"unit":0,"pci-controller":{"bus":-1,"slot":-1,"domain":-1,"function":-1},"dev":"\\\\.\\PhysicalDrive0","target":0}}]}
5. monitor the log
# tail -f /var/log/libvirt/libvirtd.log
(no output)
According to Comment #5, mark the bug as verified. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (libvirt bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2023:2171 |