]> git.proxmox.com Git - mirror_qemu.git/commit - qapi/qapi-schema.json
qmp: add QMP command x-query-virtio
authorLaurent Vivier <lvivier@redhat.com>
Thu, 11 Aug 2022 12:24:39 +0000 (08:24 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 9 Oct 2022 20:38:45 +0000 (16:38 -0400)
commita5ebce385763447d2ab7cb572914713eedea764a
tree2af86e60ab5a04cd8841f34d6e369f004871bdd2
parent20ca47429e96df84e7b2e741f740bfce8a813fb2
qmp: add QMP command x-query-virtio

This new command lists all the instances of VirtIODevices with
their canonical QOM path and name.

[Jonah: @virtio_list duplicates information that already exists in
 the QOM composition tree. However, extracting necessary information
 from this tree seems to be a bit convoluted.

 Instead, we still create our own list of realized virtio devices
 but use @qmp_qom_get with the device's canonical QOM path to confirm
 that the device exists and is realized. If the device exists but
 is actually not realized, then we remove it from our list (for
 synchronicity to the QOM composition tree).

 Also, the QMP command @x-query-virtio is redundant as @qom-list
 and @qom-get are sufficient to search '/machine/' for realized
 virtio devices. However, @x-query-virtio is much more convenient
 in listing realized virtio devices.]

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Jonah Palmer <jonah.palmer@oracle.com>
Message-Id: <1660220684-24909-2-git-send-email-jonah.palmer@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/meson.build
hw/virtio/virtio-stub.c [new file with mode: 0644]
hw/virtio/virtio.c
include/hw/virtio/virtio.h
qapi/meson.build
qapi/qapi-schema.json
qapi/virtio.json [new file with mode: 0644]
tests/qtest/qmp-cmd-test.c