summaryrefslogtreecommitdiffstats
path: root/hw/acpi/vmgenid.c
diff options
context:
space:
mode:
authorIgor Mammedov2017-02-17 00:15:37 +0100
committerMichael S. Tsirkin2017-03-02 06:14:27 +0100
commit39164c136cbab57385e15297423fe85ef386c76f (patch)
tree2d52a76ea6c341d17964a07cdf00e2e5d33ca40e /hw/acpi/vmgenid.c
parentACPI: Add Virtual Machine Generation ID support (diff)
downloadqemu-39164c136cbab57385e15297423fe85ef386c76f.tar.gz
qemu-39164c136cbab57385e15297423fe85ef386c76f.tar.xz
qemu-39164c136cbab57385e15297423fe85ef386c76f.zip
qmp/hmp: add query-vm-generation-id and 'info vm-generation-id' commands
Add commands to query Virtual Machine Generation ID counter. QMP command example: { "execute": "query-vm-generation-id" } HMP command example: info vm-generation-id Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Ben Warren <ben@skyportsystems.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/acpi/vmgenid.c')
-rw-r--r--hw/acpi/vmgenid.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
index c8465df790..744f2847da 100644
--- a/hw/acpi/vmgenid.c
+++ b/hw/acpi/vmgenid.c
@@ -240,3 +240,19 @@ static void vmgenid_register_types(void)
}
type_init(vmgenid_register_types)
+
+GuidInfo *qmp_query_vm_generation_id(Error **errp)
+{
+ GuidInfo *info;
+ VmGenIdState *vms;
+ Object *obj = find_vmgenid_dev();
+
+ if (!obj) {
+ return NULL;
+ }
+ vms = VMGENID(obj);
+
+ info = g_malloc0(sizeof(*info));
+ info->guid = qemu_uuid_unparse_strdup(&vms->guid);
+ return info;
+}