[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Patch v1 27/29] s390x/cpumodel: implement QMP interfac
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [Patch v1 27/29] s390x/cpumodel: implement QMP interface "query-cpu-model-expansion" |
Date: |
Tue, 2 Aug 2016 11:22:50 -0300 |
User-agent: |
Mutt/1.6.1 (2016-04-27) |
On Tue, Aug 02, 2016 at 01:59:13PM +0200, David Hildenbrand wrote:
[...]
> +CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType
> type,
> + CpuModelInfo *model,
> + Error **errp)
> +{
> + CpuModelExpansionInfo *expansion_info = NULL;
> + S390CPUModel s390_model;
> + bool delta_changes = false;
> +
> + /* convert it to our internal representation */
> + cpu_model_from_info(&s390_model, model, errp);
> + if (*errp) {
> + return NULL;
> + }
> +
> + if (type == CPU_MODEL_EXPANSION_TYPE_STATIC) {
> + delta_changes = true;
> + }
This assumes the only valid values for type will always be
"static" and "full". I would check explicitly for
CPU_MODEL_EXPANSION_TYPE_STATIC and CPU_MODEL_EXPANSION_TYPE_FULL
and return an error otherwise, just in case CpuModelExpansionType
is extended to include other expansion modes in the future.
> +
> + /* convert it back to a static representation */
> + expansion_info = g_malloc0(sizeof(*expansion_info));
> + expansion_info->model = g_malloc0(sizeof(*expansion_info->model));
> + cpu_info_from_model(expansion_info->model, &s390_model, delta_changes);
> + return expansion_info;
> +}
> #endif
>
> static void check_consistency(const S390CPUModel *model)
> --
> 2.6.6
>
--
Eduardo
- Re: [Qemu-devel] [Patch v1 25/29] qmp: add QMP interface "query-cpu-model-comparison", (continued)
Re: [Qemu-devel] [Patch v1 25/29] qmp: add QMP interface "query-cpu-model-comparison", David Hildenbrand, 2016/08/04
[Qemu-devel] [Patch v1 29/29] s390x/cpumodel: implement QMP interface "query-cpu-model-baseline", David Hildenbrand, 2016/08/02
[Qemu-devel] [Patch v1 06/29] s390x/cpumodel: generate CPU feature group lists, David Hildenbrand, 2016/08/02
[Qemu-devel] [Patch v1 27/29] s390x/cpumodel: implement QMP interface "query-cpu-model-expansion", David Hildenbrand, 2016/08/02
- Re: [Qemu-devel] [Patch v1 27/29] s390x/cpumodel: implement QMP interface "query-cpu-model-expansion",
Eduardo Habkost <=
[Qemu-devel] [Patch v1 08/29] s390x/cpumodel: register defined CPU models as subclasses, David Hildenbrand, 2016/08/02
[Qemu-devel] [Patch v1 10/29] s390x/cpumodel: expose features and feature groups as properties, David Hildenbrand, 2016/08/02
[Qemu-devel] [Patch v1 13/29] s390x/sclp: factor out preparation of cpu entries, David Hildenbrand, 2016/08/02
[Qemu-devel] [Patch v1 04/29] s390x/cpumodel: introduce CPU features, David Hildenbrand, 2016/08/02
[Qemu-devel] [Patch v1 23/29] s390x/kvm: let the CPU model control CMM(A), David Hildenbrand, 2016/08/02
[Qemu-devel] [Patch v1 28/29] s390x/cpumodel: implement QMP interface "query-cpu-model-comparison", David Hildenbrand, 2016/08/02
[Qemu-devel] [Patch v1 26/29] qmp: add QMP interface "query-cpu-model-baseline", David Hildenbrand, 2016/08/02