On Sat, Nov 21, 2020 at 2:11 AM <marcandre.lureau@redhat.com> wrote:
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Hi,

The following series extends virDomainGetGuestInfo to report disk informations
provided by the new QGA "guest-get-disks" command in QEMU 5.2.

Please review,

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=1899527

Marc-André Lureau (9):
  qemu_agent: rename qemuAgentDiskInfo->qemuAgentDiskAddress
  qemu_agent: export qemuAgentDiskAddressFree & add g_auto
  qemu_agent: factor out qemuAgentGetDiskAddress
  util: json: add virJSONValueObjectGetStringArray convenience
  qemu: use virJSONValueObjectGetStringArray
  qemu_agent: add qemuAgentGetDisks
  domain: add disk informations to virDomainGetGuestInfo
  qemu_driver: report guest disk informations
  virsh: add --disk informations to guestinfo command

 include/libvirt/libvirt-domain.h |   1 +
 src/libvirt-domain.c             |  17 +++
 src/libvirt_private.syms         |   1 +
 src/qemu/qemu_agent.c            | 182 +++++++++++++++++++++++--------
 src/qemu/qemu_agent.h            |  25 ++++-
 src/qemu/qemu_driver.c           | 103 ++++++++++++++++-
 src/qemu/qemu_monitor_json.c     |  34 +-----
 src/util/virjson.c               |  30 +++++
 src/util/virjson.h               |   1 +
 tests/qemuagenttest.c            | 111 +++++++++++++++++++
 tools/virsh-domain.c             |   6 +
 11 files changed, 430 insertions(+), 81 deletions(-)

--
2.29.0


Works for me on qemu-5.2.0-0.7.rc2.fc34.x86_64:
For the guest with qemu-guest-agent-5.2.0-0.7.rc2.fc34.x86_64:
➜  ~ virsh guestinfo pc --disks                                      
disks.count         : 2
disks.0.name        : /dev/vda1
disks.0.partition   : yes
disks.0.dependencies.count: 1
disks.0.dependencies.0.name: /dev/vda
disks.1.name        : /dev/vda
disks.1.partition   : no
disks.1.alias       : vda

For the guest with qemu-guest-agent-4.1.1-1.fc31.x86_64:
➜  ~ virsh guestinfo new --disks
error: internal error: unable to execute QEMU agent command 'guest-get-disks': The command guest-get-disks has not been found
 


--
Tested-by: Han Han <hhan@redhat.com>