On Mon, Apr 16, 2018 at 01:06:56AM -0500, Chris Venteicher wrote:
New function qemuMonitorJSONBuildCPUModelInfo created by extracting code from existing function qemuMonitorJSONGetCPUModelExpansion to create a reusable function for extracting cpu model info from json. --- src/qemu/qemu_monitor_json.c | 82 ++++++++++++++++++++++++++++++-------------- 1 file changed, 56 insertions(+), 26 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 57c2c4de0..cf31c16a0 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5337,6 +5337,61 @@ qemuMonitorJSONParseCPUModelProperty(const char *key, return 0; } +// model_json: {"model": {"name": "IvyBridge", "props": {}}}
/* comment */ and /* * comment */ are the preferred comment styles in libvirt. https://libvirt.org/hacking.html#formatting
+static int
This function either returns -1 when model is NULL or 0 when it's not. You can return qemuMonitorCPUModelInfoPtr directly.
+qemuMonitorJSONBuildCPUModelInfo(virJSONValuePtr model_json,
Put 'FromJSON' at the end of the function name, e.g.: qemuMonitorJSONGetCPUModelInfoFromJSON
+ qemuMonitorCPUModelInfoPtr *model) +{ + virJSONValuePtr cpu_model; + virJSONValuePtr cpu_props; + qemuMonitorCPUModelInfoPtr machine_model = NULL; + int ret = -1; + char const *cpu_name; + + *model = NULL; +
Jano
Attachment:
signature.asc
Description: Digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list