[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 6/9] qmp/hmp: add set-vm-generation-id commands
From: |
ben |
Subject: |
[Qemu-devel] [PATCH v4 6/9] qmp/hmp: add set-vm-generation-id commands |
Date: |
Tue, 24 Jan 2017 17:43:25 -0800 |
From: Igor Mammedov <address@hidden>
Add set-vm-generation-id command to set Virtual Machine
Generation ID counter.
QMP command example:
{ "execute": "set-vm-generation-id",
"arguments": {
"guid": "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"
}
}
HMP command example:
set-vm-generation-id guid=324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Ben Warren <address@hidden>
---
hmp-commands.hx | 13 +++++++++++++
hmp.c | 12 ++++++++++++
hmp.h | 1 +
qapi-schema.json | 11 +++++++++++
stubs/vmgenid.c | 6 ++++++
5 files changed, 43 insertions(+)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 8819281..56744aa 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1775,5 +1775,18 @@ ETEXI
},
STEXI
address@hidden set-vm-generation-id @var{uuid}
+Set Virtual Machine Generation ID counter to @var{guid}
+ETEXI
+
+ {
+ .name = "set-vm-generation-id",
+ .args_type = "guid:s",
+ .params = "guid",
+ .help = "Set Virtual Machine Generation ID counter",
+ .cmd = hmp_set_vm_generation_id,
+ },
+
+STEXI
@end table
ETEXI
diff --git a/hmp.c b/hmp.c
index c2280e0..3a4db8b 100644
--- a/hmp.c
+++ b/hmp.c
@@ -2573,3 +2573,15 @@ void hmp_info_vm_generation_id(Monitor *mon, const QDict
*qdict)
}
qapi_free_GuidInfo(info);
}
+
+void hmp_set_vm_generation_id(Monitor *mon, const QDict *qdict)
+{
+ Error *errp = NULL;
+ const char *guid = qdict_get_str(qdict, "guid");
+
+ qmp_set_vm_generation_id(guid, &errp);
+ if (errp) {
+ hmp_handle_error(mon, &errp);
+ return;
+ }
+}
diff --git a/hmp.h b/hmp.h
index 799fd37..e0ac1e8 100644
--- a/hmp.h
+++ b/hmp.h
@@ -138,5 +138,6 @@ void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict
*qdict);
void hmp_info_dump(Monitor *mon, const QDict *qdict);
void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict);
void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict);
+void hmp_set_vm_generation_id(Monitor *mon, const QDict *qdict);
#endif
diff --git a/qapi-schema.json b/qapi-schema.json
index 413ac52..e2ed75c 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -6046,3 +6046,14 @@
# Since 2.9
##
{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
+
+##
+# @set-vm-generation-id:
+#
+# Set Virtual Machine Generation ID
+#
+# @guid: new GUID to set as Virtual Machine Generation ID
+#
+# Since 2.9
+##
+{ 'command': 'set-vm-generation-id', 'data': {'guid': 'str'} }
diff --git a/stubs/vmgenid.c b/stubs/vmgenid.c
index 8c448ac..d25d41b 100644
--- a/stubs/vmgenid.c
+++ b/stubs/vmgenid.c
@@ -6,3 +6,9 @@ GuidInfo *qmp_query_vm_generation_id(Error **errp)
error_setg(errp, "this command is not currently supported");
return NULL;
}
+
+void qmp_set_vm_generation_id(const char *guid, Error **errp)
+{
+ error_setg(errp, "this command is not currently supported");
+ return;
+}
--
2.7.4
- [Qemu-devel] [PATCH v4 0/9] Add support for VM Generation ID, ben, 2017/01/24
- [Qemu-devel] [PATCH v4 1/9] ACPI: Add a function for building named qword entries, ben, 2017/01/24
- [Qemu-devel] [PATCH v4 3/9] docs: VM Generation ID device description, ben, 2017/01/24
- [Qemu-devel] [PATCH v4 5/9] qmp/hmp: add query-vm-generation-id and 'info vm-generation-id' commands, ben, 2017/01/24
- [Qemu-devel] [PATCH v4 6/9] qmp/hmp: add set-vm-generation-id commands,
ben <=
- [Qemu-devel] [PATCH v4 2/9] linker-loader: Add new 'allocate and return address' cmd, ben, 2017/01/24
- [Qemu-devel] [PATCH v4 7/9] PC: Support dynamic sysbus on pc_i440fx, ben, 2017/01/24
- [Qemu-devel] [PATCH v4 8/9] tests: Move reusable ACPI macros into a new header file, ben, 2017/01/24
- [Qemu-devel] [PATCH v4 4/9] ACPI: Add Virtual Machine Generation ID support, ben, 2017/01/24
- [Qemu-devel] [PATCH v4 9/9] tests: Add unit tests for the VM Generation ID feature, ben, 2017/01/24