diff options
author | Ben Warren <ben@skyportsystems.com> | 2017-03-02 13:36:50 -0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2017-03-15 19:37:19 +0200 |
commit | 72d9196f1ef588c19821d0a4fb563836fdb2a0b7 (patch) | |
tree | daaf24fe3ebdadc506c2f22caf1f66714ea2a964 /hmp.c | |
parent | d84f714eafedd8bb9d4aaec8b76417bef8e3535e (diff) |
Bugfix: Handle error if VM Generation ID device not present
This was crashing due to NULL-pointer dereference
QMP Test case:
==============
(QEMU) query-vm-generation-id
{"error": {"class": "GenericError", "desc": "VM Generation ID device not
found"}}
HMP Test case:
==============
virsh # qemu-monitor-command --hmp 3 info vm-generation-id
VM Generation ID device not found
Signed-off-by: Ben Warren <ben@skyportsystems.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'hmp.c')
-rw-r--r-- | hmp.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2608,9 +2608,11 @@ void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict) void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict) { - GuidInfo *info = qmp_query_vm_generation_id(NULL); + Error *err = NULL; + GuidInfo *info = qmp_query_vm_generation_id(&err); if (info) { monitor_printf(mon, "%s\n", info->guid); } + hmp_handle_error(mon, &err); qapi_free_GuidInfo(info); } |