On 06/22/2018 12:42 AM, Chris Venteicher wrote: > Wrap QMP query-cpu-model-baseline command transaction with QEMU. > --- > src/qemu/qemu_monitor.c | 13 ++++++++ > src/qemu/qemu_monitor.h | 5 +++ > src/qemu/qemu_monitor_json.c | 65 ++++++++++++++++++++++++++++++++++++ > src/qemu/qemu_monitor_json.h | 7 ++++ > 4 files changed, 90 insertions(+) > > diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c > index 16de54dac7..c5c640b0d8 100644 > --- a/src/qemu/qemu_monitor.c > +++ b/src/qemu/qemu_monitor.c > @@ -3738,6 +3738,19 @@ qemuMonitorCPUModelInfoCopy(const qemuMonitorCPUModelInfo *orig) > return NULL; > } > > +int > +qemuMonitorGetCPUModelBaseline(qemuMonitorPtr mon, > + qemuMonitorCPUModelInfoPtr model_a, > + qemuMonitorCPUModelInfoPtr model_b, > + qemuMonitorCPUModelInfoPtr *model_baseline) > +{ > + VIR_DEBUG("model_a->name=%s", model_a->name); > + VIR_DEBUG("model_b->name=%s", model_b->name); It might be useful to also print out nprops here too, so debuggers can at least see that the features are at least present in the object. > + > + QEMU_CHECK_MONITOR(mon); > + > + return qemuMonitorJSONGetCPUModelBaseline(mon, model_a, model_b, model_baseline); > +} > > int > qemuMonitorGetCommands(qemuMonitorPtr mon, [...] > diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c > index afbf000fa2..729578414b 100644 > --- a/src/qemu/qemu_monitor_json.c > +++ b/src/qemu/qemu_monitor_json.c > @@ -5553,6 +5553,71 @@ qemuMonitorJSONGetCPUModelExpansion(qemuMonitorPtr mon, > } > > > +/* Note: *model_baseline == NULL && return == 0 if command not supported by QEMU > + */ > +int > +qemuMonitorJSONGetCPUModelBaseline(qemuMonitorPtr mon, > + qemuMonitorCPUModelInfoPtr model_a, > + qemuMonitorCPUModelInfoPtr model_b, > + qemuMonitorCPUModelInfoPtr *model_baseline) > +{ > + int ret = -1; > + virJSONValuePtr cmd = NULL; > + virJSONValuePtr reply = NULL; > + virJSONValuePtr data = NULL; > + virJSONValuePtr modela = NULL; > + virJSONValuePtr modelb = NULL; > + virJSONValuePtr cpu_model = NULL; > + > + *model_baseline = NULL; > + > + if (!(modela = qemuMonitorJSONBuildCPUModelInfoToJSON(model_a))) > + goto cleanup; > + > + if (!(modelb = qemuMonitorJSONBuildCPUModelInfoToJSON(model_b))) > + goto cleanup; Small nit: maybe combine the above two into one if-statement? Other than that, this patch looks good to me. [...] -- Respectfully, - Collin Walling -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list