Skip to content

Commit

Permalink
hmp: add virtio commands
Browse files Browse the repository at this point in the history
This patch implements the HMP versions of the virtio QMP commands.

Signed-off-by: Jonah Palmer <jonah.palmer@oracle.com>
Message-Id: <1642678168-20447-9-git-send-email-jonah.palmer@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
vivier authored and mstsirkin committed Feb 5, 2022
1 parent d901bdb commit ecc2add
Show file tree
Hide file tree
Showing 3 changed files with 386 additions and 0 deletions.
70 changes: 70 additions & 0 deletions hmp-commands-info.hx
Expand Up @@ -879,3 +879,73 @@ SRST
``info sgx``
Show intel SGX information.
ERST

{
.name = "virtio",
.args_type = "",
.params = "",
.help = "List all available virtio devices",
.cmd = hmp_virtio_query,
.flags = "p",
},

SRST
``info virtio``
List all available virtio devices
ERST

{
.name = "virtio-status",
.args_type = "path:s",
.params = "path",
.help = "Display status of a given virtio device",
.cmd = hmp_virtio_status,
.flags = "p",
},

SRST
``info virtio-status`` *path*
Display status of a given virtio device
ERST

{
.name = "virtio-queue-status",
.args_type = "path:s,queue:i",
.params = "path queue",
.help = "Display status of a given virtio queue",
.cmd = hmp_virtio_queue_status,
.flags = "p",
},

SRST
``info virtio-queue-status`` *path* *queue*
Display status of a given virtio queue
ERST

{
.name = "virtio-vhost-queue-status",
.args_type = "path:s,queue:i",
.params = "path queue",
.help = "Display status of a given vhost queue",
.cmd = hmp_vhost_queue_status,
.flags = "p",
},

SRST
``info virtio-vhost-queue-status`` *path* *queue*
Display status of a given vhost queue
ERST

{
.name = "virtio-queue-element",
.args_type = "path:s,queue:i,index:i?",
.params = "path queue [index]",
.help = "Display element of a given virtio queue",
.cmd = hmp_virtio_queue_element,
.flags = "p",
},

SRST
``info virtio-queue-element`` *path* *queue* [*index*]
Display element of a given virtio queue
ERST
5 changes: 5 additions & 0 deletions include/monitor/hmp.h
Expand Up @@ -95,6 +95,11 @@ void hmp_qom_list(Monitor *mon, const QDict *qdict);
void hmp_qom_get(Monitor *mon, const QDict *qdict);
void hmp_qom_set(Monitor *mon, const QDict *qdict);
void hmp_info_qom_tree(Monitor *mon, const QDict *dict);
void hmp_virtio_query(Monitor *mon, const QDict *qdict);
void hmp_virtio_status(Monitor *mon, const QDict *qdict);
void hmp_virtio_queue_status(Monitor *mon, const QDict *qdict);
void hmp_vhost_queue_status(Monitor *mon, const QDict *qdict);
void hmp_virtio_queue_element(Monitor *mon, const QDict *qdict);
void object_add_completion(ReadLineState *rs, int nb_args, const char *str);
void object_del_completion(ReadLineState *rs, int nb_args, const char *str);
void device_add_completion(ReadLineState *rs, int nb_args, const char *str);
Expand Down

0 comments on commit ecc2add

Please sign in to comment.