[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 02/11] hw/boards: Introduce machine_class_valid_for_accele
From: |
Cornelia Huck |
Subject: |
Re: [PATCH v2 02/11] hw/boards: Introduce machine_class_valid_for_accelerator() |
Date: |
Mon, 22 Feb 2021 18:59:30 +0100 |
On Mon, 22 Feb 2021 18:46:15 +0100
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
> On 2/22/21 6:34 PM, Cornelia Huck wrote:
> > On Fri, 19 Feb 2021 18:38:38 +0100
> > Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
> >
> >> Introduce the valid_accelerators[] field to express the list
> >> of valid accelators a machine can use, and add the
> >> machine_class_valid_for_current_accelerator() and
> >> machine_class_valid_for_accelerator() methods.
> >>
> >> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> >> ---
> >> include/hw/boards.h | 24 ++++++++++++++++++++++++
> >> hw/core/machine.c | 26 ++++++++++++++++++++++++++
> >> 2 files changed, 50 insertions(+)
> >>
> >> diff --git a/include/hw/boards.h b/include/hw/boards.h
> >> index 68d3d10f6b0..4d08bc12093 100644
> >> --- a/include/hw/boards.h
> >> +++ b/include/hw/boards.h
> >> @@ -36,6 +36,24 @@ void machine_set_cpu_numa_node(MachineState *machine,
> >> const CpuInstanceProperties *props,
> >> Error **errp);
> >>
> >> +/**
> >> + * machine_class_valid_for_accelerator:
> >> + * @mc: the machine class
> >> + * @acc_name: accelerator name
> >> + *
> >> + * Returns %true if the accelerator is valid for the machine, %false
> >> + * otherwise. See #MachineClass.valid_accelerators.
> >
> > Naming confusion: is the machine class valid for the accelerator, or
> > the accelerator valid for the machine class? Or either? :)
>
> "the accelerator valid for the machine class".
>
> Is this clearer?
>
> "Returns %true if the current accelerator is valid for the
> selected machine, %false otherwise.
>
> Or...
>
> "Returns %true if the selected accelerator is valid for the
> current machine, %false otherwise.
Maybe that one, given how it ends up being called? Or "specified
machine"?
>
> How would look "either"?
>
> The machine is already selected, and the accelerator too...
Yes, so this is basically testing the (machine,accelerator) tuple,
which is what I meant with 'either'.
>
> >
> >> + */
> >> +bool machine_class_valid_for_accelerator(MachineClass *mc, const char
> >> *acc_name);
> >> +/**
> >> + * machine_class_valid_for_current_accelerator:
> >> + * @mc: the machine class
> >> + *
> >> + * Returns %true if the accelerator is valid for the current machine,
> >> + * %false otherwise. See #MachineClass.valid_accelerators.
> >
> > Same here: current accelerator vs. current machine.
So maybe
"Returns %true if the current accelerator is valid for the specified
machine class..." ?
> >
> >> + */
> >> +bool machine_class_valid_for_current_accelerator(MachineClass *mc);
- Re: [PATCH v2 01/11] accel/kvm: Check MachineClass kvm_type() return value, (continued)
- Re: [PATCH v2 01/11] accel/kvm: Check MachineClass kvm_type() return value, Philippe Mathieu-Daudé, 2021/02/22
- Re: [PATCH v2 01/11] accel/kvm: Check MachineClass kvm_type() return value, Cornelia Huck, 2021/02/22
- Re: [PATCH v2 01/11] accel/kvm: Check MachineClass kvm_type() return value, Philippe Mathieu-Daudé, 2021/02/22
- Re: [PATCH v2 01/11] accel/kvm: Check MachineClass kvm_type() return value, David Gibson, 2021/02/22
- Re: [PATCH v2 01/11] accel/kvm: Check MachineClass kvm_type() return value, David Gibson, 2021/02/22
- Re: [PATCH v2 01/11] accel/kvm: Check MachineClass kvm_type() return value, Cornelia Huck, 2021/02/23
- Re: [PATCH v2 01/11] accel/kvm: Check MachineClass kvm_type() return value, Philippe Mathieu-Daudé, 2021/02/23
[PATCH v2 02/11] hw/boards: Introduce machine_class_valid_for_accelerator(), Philippe Mathieu-Daudé, 2021/02/19
[PATCH v2 03/11] hw/core: Restrict 'query-machines' to those supported by current accel, Philippe Mathieu-Daudé, 2021/02/19
[PATCH v2 04/11] hw/arm: Restrit KVM to the virt & versal machines, Philippe Mathieu-Daudé, 2021/02/19
[PATCH v2 05/11] hw/mips: Restrict KVM to the malta & virt machines, Philippe Mathieu-Daudé, 2021/02/19
[RFC PATCH v2 08/11] hw/i386: Explicit x86 machines support all current accelerators, Philippe Mathieu-Daudé, 2021/02/19
[RFC PATCH v2 06/11] hw/ppc: Restrict KVM to various PPC machines, Philippe Mathieu-Daudé, 2021/02/19