[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 03/11] hw/core: Restrict 'query-machines' to those supported by current accel
- To: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
- From: Cornelia Huck <cohuck@xxxxxxxxxx>
- Date: Mon, 22 Feb 2021 18:42:45 +0100
- Cc: qemu-devel@xxxxxxxxxx, Aurelien Jarno <aurelien@xxxxxxxxxxx>, Peter Maydell <peter.maydell@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, qemu-ppc@xxxxxxxxxx, qemu-s390x@xxxxxxxxxx, Halil Pasic <pasic@xxxxxxxxxxxxx>, Huacai Chen <chenhuacai@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>, qemu-arm@xxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, kvm@xxxxxxxxxxxxxxx, BALATON Zoltan <balaton@xxxxxxxxxx>, Leif Lindholm <leif@xxxxxxxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, Radoslaw Biernacki <rad@xxxxxxxxxxxx>, Alistair Francis <alistair@xxxxxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Thomas Huth <thuth@xxxxxxxxxx>, Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx>, Hervé Poussineau <hpoussin@xxxxxxxxxxx>, Greg Kurz <groug@xxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxx>, "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Mark Cave-Ayland <mark.cave-ayland@xxxxxxxxxxxx>, Aleksandar Rikalo <aleksandar.rikalo@xxxxxxxxxx>, Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>, Daniel Berrangé <berrange@xxxxxxxxxx>
- Delivery-date: Mon, 22 Feb 2021 17:43:10 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Fri, 19 Feb 2021 18:38:39 +0100
Philippe Mathieu-Daudé <philmd@xxxxxxxxxx> wrote:
> Do not let 'query-machines' return machines not valid with
> the current accelerator.
>
> Suggested-by: Daniel Berrangé <berrange@xxxxxxxxxx>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
> ---
> hw/core/machine-qmp-cmds.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
> index 44e979e503b..c8630bc2ddc 100644
> --- a/hw/core/machine-qmp-cmds.c
> +++ b/hw/core/machine-qmp-cmds.c
> @@ -204,6 +204,10 @@ MachineInfoList *qmp_query_machines(Error **errp)
> MachineClass *mc = el->data;
> MachineInfo *info;
>
> + if (!machine_class_valid_for_current_accelerator(mc)) {
> + continue;
> + }
> +
> info = g_malloc0(sizeof(*info));
> if (mc->is_default) {
> info->has_is_default = true;
Reviewed-by: Cornelia Huck <cohuck@xxxxxxxxxx>
|