[libvirt] [PATCHv2 03/11] qemu_monitor: Indicate when CPUModelInfo props report migratablity
Collin Walling
walling at linux.ibm.com
Wed Jul 11 23:25:00 UTC 2018
Not sure if I agree with the renaming here.
>From what I understand, "if a cpu property is not migratable, then the
cpu model is also not migratable".
So I think the original naming scheme is fine.
On 07/09/2018 11:56 PM, Chris Venteicher wrote:
> Renamed variable in CPUModelInfo such that
> props_migratable_valid is true when properties in CPUModelInfo
> have been updated to accurately indicate if property is / isn't
> migratable.
>
> Property migratability is not returned directly in QMP messages but
> rather is sometimes calculated within Libvirt by other means and then
> stored in CPUModelInfo properties by Libvirt. props_migratable_valid is
> set to true when this calculation has been done by Libvirt.
> ---
> src/qemu/qemu_capabilities.c | 10 +++++-----
> src/qemu/qemu_monitor.c | 2 +-
> src/qemu/qemu_monitor.h | 2 +-
> 3 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index c7da916f9a..3d78e2e29b 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -2410,7 +2410,7 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps,
> }
> }
>
> - modelInfo->migratability = true;
> + modelInfo->props_migratable_valid = true;
> }
>
> VIR_STEAL_PTR(cpuData->info, modelInfo);
> @@ -2465,7 +2465,7 @@ virQEMUCapsGetCPUFeatures(virQEMUCapsPtr qemuCaps,
> }
>
> VIR_STEAL_PTR(*features, list);
> - if (migratable && !data->info->migratability)
> + if (migratable && !data->info->props_migratable_valid)
> ret = 1;
> else
> ret = 0;
> @@ -2864,7 +2864,7 @@ virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps,
> virQEMUCapsHostCPUDataPtr cpuData = virQEMUCapsGetHostCPUData(qemuCaps, type);
> int ret = 1;
>
> - if (migratable && cpuData->info && !cpuData->info->migratability)
> + if (migratable && cpuData->info && !cpuData->info->props_migratable_valid)
> return 1;
>
> if (ARCH_IS_S390(qemuCaps->arch)) {
> @@ -3047,7 +3047,7 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsPtr qemuCaps,
> _("invalid migratability value for host CPU model"));
> goto cleanup;
> }
> - hostCPU->migratability = val == VIR_TRISTATE_BOOL_YES;
> + hostCPU->props_migratable_valid = val == VIR_TRISTATE_BOOL_YES;
> VIR_FREE(str);
>
> ctxt->node = hostCPUNode;
> @@ -3540,7 +3540,7 @@ virQEMUCapsFormatHostCPUModelInfo(virQEMUCapsPtr qemuCaps,
> virBufferAsprintf(buf,
> "<hostCPU type='%s' model='%s' migratability='%s'>\n",
> typeStr, model->name,
> - model->migratability ? "yes" : "no");
> + model->props_migratable_valid ? "yes" : "no");
> virBufferAdjustIndent(buf, 2);
>
> for (i = 0; i < model->nprops; i++) {
> diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
> index a3278c018e..371aaa15da 100644
> --- a/src/qemu/qemu_monitor.c
> +++ b/src/qemu/qemu_monitor.c
> @@ -3671,7 +3671,7 @@ qemuMonitorCPUModelInfoCopy(const qemuMonitorCPUModelInfo *orig)
> if (VIR_STRDUP(copy->name, orig->name) < 0)
> goto error;
>
> - copy->migratability = orig->migratability;
> + copy->props_migratable_valid = orig->props_migratable_valid;
> copy->nprops = orig->nprops;
>
> for (i = 0; i < orig->nprops; i++) {
> diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
> index 18b59be985..208a7f5d21 100644
> --- a/src/qemu/qemu_monitor.h
> +++ b/src/qemu/qemu_monitor.h
> @@ -1005,7 +1005,7 @@ struct _qemuMonitorCPUModelInfo {
> char *name;
> size_t nprops;
> qemuMonitorCPUPropertyPtr props;
> - bool migratability;
> + bool props_migratable_valid;
> };
>
> typedef enum {
>
--
Respectfully,
- Collin Walling
More information about the libvir-list
mailing list