summary refs log tree commit diff stats
path: root/hw/acpi/vmgenid.c
diff options
context:
space:
mode:
authorBen Warren <ben@skyportsystems.com>2017-03-02 13:36:50 -0800
committerMichael S. Tsirkin <mst@redhat.com>2017-03-15 19:37:19 +0200
commit72d9196f1ef588c19821d0a4fb563836fdb2a0b7 (patch)
treedaaf24fe3ebdadc506c2f22caf1f66714ea2a964 /hw/acpi/vmgenid.c
parentd84f714eafedd8bb9d4aaec8b76417bef8e3535e (diff)
downloadfocaccia-qemu-72d9196f1ef588c19821d0a4fb563836fdb2a0b7.tar.gz
focaccia-qemu-72d9196f1ef588c19821d0a4fb563836fdb2a0b7.zip
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 'hw/acpi/vmgenid.c')
-rw-r--r--hw/acpi/vmgenid.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
index 744f2847da..7a3ad17d66 100644
--- a/hw/acpi/vmgenid.c
+++ b/hw/acpi/vmgenid.c
@@ -248,6 +248,7 @@ GuidInfo *qmp_query_vm_generation_id(Error **errp)
     Object *obj = find_vmgenid_dev();
 
     if (!obj) {
+        error_setg(errp, "VM Generation ID device not found");
         return NULL;
     }
     vms = VMGENID(obj);