Re: [libvirt] [PATCH v5 06/15] qemu_monitor: make qemuMonitorJSONParseCPUModelData command-agnostic

2019-10-02 Thread Jiri Denemark
On Thu, Sep 19, 2019 at 16:24:57 -0400, Collin Walling wrote:
> Modify the error messages in qemuMonitorJSONParseCPUModelData to print
> the command name provided to the function.
> 
> Signed-off-by: Collin Walling 
> ---
>  src/qemu/qemu_monitor_json.c | 15 ---
>  1 file changed, 8 insertions(+), 7 deletions(-)

Reviewed-by: Jiri Denemark 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH v5 06/15] qemu_monitor: make qemuMonitorJSONParseCPUModelData command-agnostic

2019-09-19 Thread Collin Walling
Modify the error messages in qemuMonitorJSONParseCPUModelData to print
the command name provided to the function.

Signed-off-by: Collin Walling 
---
 src/qemu/qemu_monitor_json.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index ddcf425..13ee323 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -5833,27 +5833,28 @@ qemuMonitorJSONMakeCPUModel(virCPUDefPtr cpu,
 
 static int
 qemuMonitorJSONParseCPUModelData(virJSONValuePtr data,
+ const char *cmd_name,
  bool fail_no_props,
  virJSONValuePtr *cpu_model,
  virJSONValuePtr *cpu_props,
  const char **cpu_name)
 {
 if (!(*cpu_model = virJSONValueObjectGetObject(data, "model"))) {
-virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-   _("query-cpu-model-expansion reply data was missing 
'model'"));
+virReportError(VIR_ERR_INTERNAL_ERROR,
+   _("%s reply data was missing 'model'"), cmd_name);
 return -1;
 }
 
 if (!(*cpu_name = virJSONValueObjectGetString(*cpu_model, "name"))) {
-virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-   _("query-cpu-model-expansion reply data was missing 
'name'"));
+virReportError(VIR_ERR_INTERNAL_ERROR,
+   _("%s reply data was missing 'name'"), cmd_name);
 return -1;
 }
 
 if (!(*cpu_props = virJSONValueObjectGetObject(*cpu_model, "props")) &&
 fail_no_props) {
-virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-   _("query-cpu-model-expansion reply data was missing 
'props'"));
+virReportError(VIR_ERR_INTERNAL_ERROR,
+   _("%s reply data was missing 'props'"), cmd_name);
 return -1;
 }
 
@@ -5951,7 +5952,7 @@ qemuMonitorJSONGetCPUModelExpansion(qemuMonitorPtr mon,
 
 data = virJSONValueObjectGetObject(reply, "return");
 
-if (qemuMonitorJSONParseCPUModelData(data,
+if (qemuMonitorJSONParseCPUModelData(data, "query-cpu-model-expansion",
  fail_no_props, _model, _props,
  _name) < 0)
 return -1;
-- 
2.7.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list