From nobody Mon Feb 9 18:44:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1613756352549252.2139332633908; Fri, 19 Feb 2021 09:39:12 -0800 (PST) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-328-oY8H8F-AND-PEezhrKDFCA-1; Fri, 19 Feb 2021 12:39:09 -0500 Received: by mail-wr1-f72.google.com with SMTP id w11so2793731wrp.6 for ; Fri, 19 Feb 2021 09:39:08 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id y62sm15299048wmy.9.2021.02.19.09.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Feb 2021 09:39:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613756351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HQ6bR9q2nTx8UZfcCwDp8YyWJ5IdPylW4EMLv5ePnSc=; b=aiIBXvVyVz8UZbKJ1VRMWUICNBGe/Ged0aq2gyJIxKbrGg/y/4qW6C+GOeGtIqz8jtKocz 5JzrOWvPQ7Ac/lyOQZIzNKA0PophRMhi2pvyfybwaAlU4CSSoR35XxHQdA1Qhusxog216A 8gIlUEBGhNHKT/IFLkIGd8rknRMOg3c= X-MC-Unique: oY8H8F-AND-PEezhrKDFCA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HQ6bR9q2nTx8UZfcCwDp8YyWJ5IdPylW4EMLv5ePnSc=; b=t6LtV2s1z8lt1wTLZMnDZWcNP0tBhMNTuXJcH3dZTzWJHF15B/jhWTxlTDNci8NBOH G1LaZZrsN2RZvlRcV3hK9qCS7cp8q9F5GNAwXwqkB9mcsfgyUmt7AzI7jGJtxEJZNqqv 2Z8QKt0MzROUNnGSK/HwZubqcwHgfhSlutIcgkFgOFjWJeIjAQubQ59aoSN1+DWI2fpI bvGkaUP4ZJShinDAlEN4VlV4dFQnuHbIZU4wnUJp/hyBN937m6US22nM2oUlFyRfYQ/s tjniHs9F1KlzD+ZZCkU2GoGcLoyvrqbKik+f0pMdEMCJyjl6ITIeaQL3xwLNKtvTcKst tgjQ== X-Gm-Message-State: AOAM533SA9pBNQjQQlPVlkAYUtURtR4xMh9tbnoLZ+bcCKU1eTMxqBDS zJYVjbNzafGfCIjUuPpdgRRYSQMhMkXl5BKT69uD5fg86xyNfHWHnENNVPKx0NNH6HThfA8S2ci GHi1ESxu45ypmXA== X-Received: by 2002:adf:b342:: with SMTP id k2mr10246414wrd.264.1613756347940; Fri, 19 Feb 2021 09:39:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRIsqLMFpNjZYF3WUU2UHyYdzuctCSQdLydicZwE25C3zYE3MQJaOoIUNZctaN8YvHWyznKA== X-Received: by 2002:adf:b342:: with SMTP id k2mr10246368wrd.264.1613756347790; Fri, 19 Feb 2021 09:39:07 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Aurelien Jarno , Peter Maydell , Anthony Perard , qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Halil Pasic , Huacai Chen , xen-devel@lists.xenproject.org, Marcel Apfelbaum , David Gibson , qemu-arm@nongnu.org, Stefano Stabellini , Paolo Bonzini , kvm@vger.kernel.org, BALATON Zoltan , Leif Lindholm , Richard Henderson , Radoslaw Biernacki , Alistair Francis , Paul Durrant , Eduardo Habkost , "Michael S. Tsirkin" , Thomas Huth , Jiaxun Yang , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Greg Kurz , Christian Borntraeger , Cornelia Huck , "Edgar E. Iglesias" , David Hildenbrand , Mark Cave-Ayland , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20Berrang=C3=A9?= Subject: [PATCH v2 03/11] hw/core: Restrict 'query-machines' to those supported by current accel Date: Fri, 19 Feb 2021 18:38:39 +0100 Message-Id: <20210219173847.2054123-4-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210219173847.2054123-1-philmd@redhat.com> References: <20210219173847.2054123-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Do not let 'query-machines' return machines not valid with the current accelerator. Suggested-by: Daniel Berrang=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Cornelia Huck --- 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 =3D el->data; MachineInfo *info; =20 + if (!machine_class_valid_for_current_accelerator(mc)) { + continue; + } + info =3D g_malloc0(sizeof(*info)); if (mc->is_default) { info->has_is_default =3D true; --=20 2.26.2