From nobody Thu Nov 13 20:42:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582923988; cv=none; d=zohomail.com; s=zohoarc; b=I8+UUcnILKUGSQz+9fxgjOUGCyjL79gMSW5fWk75B217ghZKqSjreOT32SClrjOdUu5Vr0p8zArZ83FYPyNOa/Uao5ginBIu1jusks6yf8FLkLo7sQagNu5xWMtsgMyaJcRZ/c0QZcUbDjakY06Pjr30qFw2FOkqzQzKgozmiJM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582923988; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=q5SbYjgtI2uGgWzkFXzp2xmZLMIvWFJ0c3sXX+8zipE=; b=VWGgbMw6OvT0+cBQQC6lo5jMaZHEV6JIW3P3Zk0dK6/ibqmGk6e2W3q6ja+Ewn28F4QP8Tfr08vaU7NAPVITnHNsmWFesN7r+ZUpgm0oGHmwO8mtb6CWyPfRzhxhqgbTpjnxz3trg3Agy1YKsb/QU5KQmStRlACw3HpiC10JUAM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582923988976854.019375514521; Fri, 28 Feb 2020 13:06:28 -0800 (PST) Received: from localhost ([::1]:53924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7mpz-0003Ey-GX for importer@patchew.org; Fri, 28 Feb 2020 16:06:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60087) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7moE-0000xU-1R for qemu-devel@nongnu.org; Fri, 28 Feb 2020 16:04:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7moD-0005EV-3Z for qemu-devel@nongnu.org; Fri, 28 Feb 2020 16:04:33 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:25336 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7moC-0005EE-W7 for qemu-devel@nongnu.org; Fri, 28 Feb 2020 16:04:33 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-40-kr05VG7eM6mYPeVSbe6EFg-1; Fri, 28 Feb 2020 16:04:30 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 91C19800D5B; Fri, 28 Feb 2020 21:04:29 +0000 (UTC) Received: from localhost (unused-10-15-17-6.yyz.redhat.com [10.15.17.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 604DC101D4A5; Fri, 28 Feb 2020 21:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582923872; 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=q5SbYjgtI2uGgWzkFXzp2xmZLMIvWFJ0c3sXX+8zipE=; b=Wm14D99/Q0t/cMuzIHSBxvVz80lYLXhOV3ybtwem+KfRVMvM1f18SfXVclot4E3ncHUt9x T5Dy/j8gDdj6LqnEgYnkBkBdV8qpx2Z6+V+Z4QSKjyg2Jj0lxQeFvku3PkUQfc//+qmj3y gr7FSqox79ih+4ysOF1FQEo1VdHNu7M= X-MC-Unique: kr05VG7eM6mYPeVSbe6EFg-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 1/4] hw/nmi: Fix the NMI() macro, based on INTERFACE_CHECK() Date: Fri, 28 Feb 2020 16:04:24 -0500 Message-Id: <20200228210427.474606-2-ehabkost@redhat.com> In-Reply-To: <20200228210427.474606-1-ehabkost@redhat.com> References: <20200228210427.474606-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gavin Shan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 There is no declaration of the 'NMI' type. INTERFACE_CHECK() returns an abstract type (see commit aa1b35b975d8). The abstract type corresponding to the TYPE_NMI interface is 'NMIState'. Fixes: 9cb805fd267 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20191207094823.20707-1-philmd@redhat.com> Reviewed-by: Gavin Shan Signed-off-by: Eduardo Habkost --- include/hw/nmi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/nmi.h b/include/hw/nmi.h index a1e128724e..fe37ce3ad8 100644 --- a/include/hw/nmi.h +++ b/include/hw/nmi.h @@ -31,7 +31,7 @@ #define NMI_GET_CLASS(obj) \ OBJECT_GET_CLASS(NMIClass, (obj), TYPE_NMI) #define NMI(obj) \ - INTERFACE_CHECK(NMI, (obj), TYPE_NMI) + INTERFACE_CHECK(NMIState, (obj), TYPE_NMI) =20 typedef struct NMIState NMIState; =20 --=20 2.24.1 From nobody Thu Nov 13 20:42:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582924057; cv=none; d=zohomail.com; s=zohoarc; b=RGpDk5rVpZ9qGdH7QOgPh2S3IWWpn+/TNGEjH85jotbNYlR73f0Z7THzae2PkiOchZ8lhziYU3JISgb1p+TOTkiYaNJqjU4HwFjmMK6Ddod7nYUoubDuDrnQsxJVUzPbbpb/00nmtf9Pc370NrXy3S9wluWpIgZ+FThp7hUdzFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582924057; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TXxfExf+lVdC2qgbicTIvqg48J4ev5XvT/7Wk+sWAAI=; b=eBzomzHRWaPJIE6234yVmHKI9ISbOTCUx06zWssmvd4UR6xTzNYR1M4q0IdHVzEMx7hXKhKgad82snuCtpbtkLs285JyiVSIQs1mXDgJrzSCW8KcnAb+gg+fPb04vkw1GhfeyT7hoWuPb8Dk1fXSu3ft40KM76iHd1FjPC28WQk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582924057166487.7181260741263; Fri, 28 Feb 2020 13:07:37 -0800 (PST) Received: from localhost ([::1]:53938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7mrA-0005G3-1p for importer@patchew.org; Fri, 28 Feb 2020 16:07:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60130) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7moH-00013M-Vu for qemu-devel@nongnu.org; Fri, 28 Feb 2020 16:04:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7moG-0005GM-Qo for qemu-devel@nongnu.org; Fri, 28 Feb 2020 16:04:37 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:31436 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7moG-0005Fy-Mo for qemu-devel@nongnu.org; Fri, 28 Feb 2020 16:04:36 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-137-TG4uwSiJNAqsJ-47NRqKLg-1; Fri, 28 Feb 2020 16:04:32 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 94E88800D50; Fri, 28 Feb 2020 21:04:30 +0000 (UTC) Received: from localhost (unused-10-15-17-6.yyz.redhat.com [10.15.17.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A8C35C57E; Fri, 28 Feb 2020 21:04:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582923876; 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=TXxfExf+lVdC2qgbicTIvqg48J4ev5XvT/7Wk+sWAAI=; b=RSsU0j1sDBPVuvijJkusqB4q6ZDWU3T7rXauFMQ4v/ZHT8380LUKUtLuPR0pfRJb98Vnw0 cQHIjhz2xTfx7yJxTqKgsexOrhkbmCNMysbBtXlmRaJrrC2/QxUMqv5O/ofYD88q+1pqOs dhH5s/ok5zW4I3+9Vq+Do1DNaNvnY/Y= X-MC-Unique: TG4uwSiJNAqsJ-47NRqKLg-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 2/4] hw: Do not initialize MachineClass::is_default to 0 Date: Fri, 28 Feb 2020 16:04:25 -0500 Message-Id: <20200228210427.474606-3-ehabkost@redhat.com> In-Reply-To: <20200228210427.474606-1-ehabkost@redhat.com> References: <20200228210427.474606-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 The MachineClass is already zeroed on creation. Note: The code setting is_default=3D0 in hw/i386/pc_piix.c is different (related to compat options). When adding a new versioned machine, we want it to be the new default, so we have to mark the previous one as not default. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200207161948.15972-2-philmd@redhat.com> Reviewed-by: Laurent Vivier Signed-off-by: Eduardo Habkost --- hw/lm32/lm32_boards.c | 1 - hw/lm32/milkymist.c | 1 - hw/m68k/q800.c | 1 - hw/microblaze/petalogix_ml605_mmu.c | 1 - hw/tricore/tricore_testboard.c | 1 - 5 files changed, 5 deletions(-) diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c index 4e0a98c117..747a175b55 100644 --- a/hw/lm32/lm32_boards.c +++ b/hw/lm32/lm32_boards.c @@ -313,7 +313,6 @@ static void lm32_uclinux_class_init(ObjectClass *oc, vo= id *data) =20 mc->desc =3D "lm32 platform for uClinux and u-boot by Theobroma System= s"; mc->init =3D lm32_uclinux_init; - mc->is_default =3D 0; mc->default_cpu_type =3D LM32_CPU_TYPE_NAME("lm32-full"); mc->default_ram_size =3D 64 * MiB; mc->default_ram_id =3D "lm32_uclinux.sdram"; diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c index 5c72266e58..85913bb68b 100644 --- a/hw/lm32/milkymist.c +++ b/hw/lm32/milkymist.c @@ -219,7 +219,6 @@ static void milkymist_machine_init(MachineClass *mc) { mc->desc =3D "Milkymist One"; mc->init =3D milkymist_init; - mc->is_default =3D 0; mc->default_cpu_type =3D LM32_CPU_TYPE_NAME("lm32-full"); mc->default_ram_size =3D 128 * MiB; mc->default_ram_id =3D "milkymist.sdram"; diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index a4c4bc14cb..c5699f6f3e 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -438,7 +438,6 @@ static void q800_machine_class_init(ObjectClass *oc, vo= id *data) mc->init =3D q800_init; mc->default_cpu_type =3D M68K_CPU_TYPE_NAME("m68040"); mc->max_cpus =3D 1; - mc->is_default =3D 0; mc->block_default_type =3D IF_SCSI; mc->default_ram_id =3D "m68k_mac.ram"; } diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_= ml605_mmu.c index 09486bc8bf..0a2640c40b 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -216,7 +216,6 @@ static void petalogix_ml605_machine_init(MachineClass *= mc) { mc->desc =3D "PetaLogix linux refdesign for xilinx ml605 little endian= "; mc->init =3D petalogix_ml605_init; - mc->is_default =3D 0; } =20 DEFINE_MACHINE("petalogix-ml605", petalogix_ml605_machine_init) diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c index 20c9ccb3ce..8ec2b5bddd 100644 --- a/hw/tricore/tricore_testboard.c +++ b/hw/tricore/tricore_testboard.c @@ -105,7 +105,6 @@ static void ttb_machine_init(MachineClass *mc) { mc->desc =3D "a minimal TriCore board"; mc->init =3D tricoreboard_init; - mc->is_default =3D 0; mc->default_cpu_type =3D TRICORE_CPU_TYPE_NAME("tc1796"); } =20 --=20 2.24.1 From nobody Thu Nov 13 20:42:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582924122; cv=none; d=zohomail.com; s=zohoarc; b=S5Ibe5xpg6UKqVO4xtRO+Kyvd6B3DZYaf+bUcbpLw1vClK3JEpBfLN3EMpqJurTAgL967zn/dS2Jxn54+motrbYymDlsFeBwzkeVvM06NgV2OC96KufuHAjQ2GH1f3WW9jYaCD3h7kWW8loIFKa3hq1che8ej+n76zcN30mvVIo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582924122; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=St3cayQAW0bdVqNKb6bs8G0hhiz08VTckDguPtXPnrQ=; b=OA+D+8gEEcB0onC0IfgD2DHLV67n/3PHEVkebZJrgNYKFmNMRwg8B+iRtCqGO0oxepSx/T5oAoKwr2cqXxmywUag3O8UpDe6Dg+Lkg/WW4+PB/fMMK7aIwzUmvPO7HW2TWqZ+m57m7N2CP0j6A8hM491eH5CHVhutzYulvt4VTw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158292412238981.15867747174013; Fri, 28 Feb 2020 13:08:42 -0800 (PST) Received: from localhost ([::1]:53956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7msD-0006D4-4F for importer@patchew.org; Fri, 28 Feb 2020 16:08:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60170) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7moQ-0001ED-Di for qemu-devel@nongnu.org; Fri, 28 Feb 2020 16:04:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7moO-0005Lo-GU for qemu-devel@nongnu.org; Fri, 28 Feb 2020 16:04:46 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:27105 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7moO-0005Li-C0 for qemu-devel@nongnu.org; Fri, 28 Feb 2020 16:04:44 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-58-suGCtmTWP76rjFx-5OCJkg-1; Fri, 28 Feb 2020 16:04:38 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1A0EFDB65; Fri, 28 Feb 2020 21:04:37 +0000 (UTC) Received: from localhost (unused-10-15-17-6.yyz.redhat.com [10.15.17.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4399F1036D01; Fri, 28 Feb 2020 21:04:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582923884; 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=St3cayQAW0bdVqNKb6bs8G0hhiz08VTckDguPtXPnrQ=; b=PTQPcmXenZT2ELQ+rpVTzmTzYUE0LTHwMyqOICPbH8xEB7LGzwX1o2NMuk4NnEWXVJmw/V /+6JUN4YoitA1Mp+hULQSnamNL7PtfeWZPRFtfJidNGLoh2PFD7mZ3aiGA2lhNC5CuN4V4 4tk3pSBJnHbxsNsHGpRNWM2vfWi+aXg= X-MC-Unique: suGCtmTWP76rjFx-5OCJkg-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 3/4] hw: Make MachineClass::is_default a boolean type Date: Fri, 28 Feb 2020 16:04:26 -0500 Message-Id: <20200228210427.474606-4-ehabkost@redhat.com> In-Reply-To: <20200228210427.474606-1-ehabkost@redhat.com> References: <20200228210427.474606-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Michael S . Tsirkin" , Richard Henderson , Laurent Vivier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 There's no good reason for it to be type int, change it to bool. Suggested-by: Richard Henderson Reviewed-by: Michael S. Tsirkin Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200207161948.15972-3-philmd@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Laurent Vivier Signed-off-by: Eduardo Habkost --- hw/alpha/dp264.c | 2 +- hw/cris/axis_dev88.c | 2 +- hw/hppa/machine.c | 2 +- hw/i386/pc_piix.c | 10 +++++----- hw/lm32/lm32_boards.c | 2 +- hw/m68k/mcf5208.c | 2 +- hw/microblaze/petalogix_s3adsp1800_mmu.c | 2 +- hw/mips/mips_malta.c | 2 +- hw/moxie/moxiesim.c | 2 +- hw/nios2/10m50_devboard.c | 2 +- hw/openrisc/openrisc_sim.c | 2 +- hw/ppc/mac_oldworld.c | 2 +- hw/ppc/spapr.c | 2 +- hw/riscv/spike.c | 2 +- hw/s390x/s390-virtio-ccw.c | 2 +- hw/sh4/shix.c | 2 +- hw/sparc/sun4m.c | 2 +- hw/sparc64/sun4u.c | 2 +- hw/unicore32/puv3.c | 2 +- include/hw/boards.h | 4 +++- 20 files changed, 26 insertions(+), 24 deletions(-) diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 8d71a30617..d28f57199f 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -181,7 +181,7 @@ static void clipper_machine_init(MachineClass *mc) mc->init =3D clipper_init; mc->block_default_type =3D IF_IDE; mc->max_cpus =3D 4; - mc->is_default =3D 1; + mc->is_default =3D true; mc->default_cpu_type =3D ALPHA_CPU_TYPE_NAME("ev67"); mc->default_ram_id =3D "ram"; } diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c index cf6790fd6f..75e5c993b5 100644 --- a/hw/cris/axis_dev88.c +++ b/hw/cris/axis_dev88.c @@ -344,7 +344,7 @@ static void axisdev88_machine_init(MachineClass *mc) { mc->desc =3D "AXIS devboard 88"; mc->init =3D axisdev88_init; - mc->is_default =3D 1; + mc->is_default =3D true; mc->default_cpu_type =3D CRIS_CPU_TYPE_NAME("crisv32"); mc->default_ram_id =3D "axisdev88.ram"; } diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 67181e75ba..bf18767e24 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -290,7 +290,7 @@ static void machine_hppa_machine_init(MachineClass *mc) mc->block_default_type =3D IF_SCSI; mc->max_cpus =3D HPPA_MAX_CPUS; mc->default_cpus =3D 1; - mc->is_default =3D 1; + mc->is_default =3D true; mc->default_ram_size =3D 512 * MiB; mc->default_boot_order =3D "cd"; mc->default_ram_id =3D "ram"; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index fa12203079..9088db8fb6 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -423,7 +423,7 @@ static void pc_i440fx_5_0_machine_options(MachineClass = *m) PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); pc_i440fx_machine_options(m); m->alias =3D "pc"; - m->is_default =3D 1; + m->is_default =3D true; pcmc->default_cpu_version =3D 1; } =20 @@ -434,7 +434,7 @@ static void pc_i440fx_4_2_machine_options(MachineClass = *m) { pc_i440fx_5_0_machine_options(m); m->alias =3D NULL; - m->is_default =3D 0; + m->is_default =3D false; compat_props_add(m->compat_props, hw_compat_4_2, hw_compat_4_2_len); compat_props_add(m->compat_props, pc_compat_4_2, pc_compat_4_2_len); } @@ -446,7 +446,7 @@ static void pc_i440fx_4_1_machine_options(MachineClass = *m) { pc_i440fx_4_2_machine_options(m); m->alias =3D NULL; - m->is_default =3D 0; + m->is_default =3D false; compat_props_add(m->compat_props, hw_compat_4_1, hw_compat_4_1_len); compat_props_add(m->compat_props, pc_compat_4_1, pc_compat_4_1_len); } @@ -459,7 +459,7 @@ static void pc_i440fx_4_0_machine_options(MachineClass = *m) PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); pc_i440fx_4_1_machine_options(m); m->alias =3D NULL; - m->is_default =3D 0; + m->is_default =3D false; pcmc->default_cpu_version =3D CPU_VERSION_LEGACY; compat_props_add(m->compat_props, hw_compat_4_0, hw_compat_4_0_len); compat_props_add(m->compat_props, pc_compat_4_0, pc_compat_4_0_len); @@ -473,7 +473,7 @@ static void pc_i440fx_3_1_machine_options(MachineClass = *m) PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 pc_i440fx_4_0_machine_options(m); - m->is_default =3D 0; + m->is_default =3D false; pcmc->do_not_add_smb_acpi =3D true; m->smbus_no_migration_support =3D true; m->alias =3D NULL; diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c index 747a175b55..b842f74344 100644 --- a/hw/lm32/lm32_boards.c +++ b/hw/lm32/lm32_boards.c @@ -295,7 +295,7 @@ static void lm32_evr_class_init(ObjectClass *oc, void *= data) =20 mc->desc =3D "LatticeMico32 EVR32 eval system"; mc->init =3D lm32_evr_init; - mc->is_default =3D 1; + mc->is_default =3D true; mc->default_cpu_type =3D LM32_CPU_TYPE_NAME("lm32-full"); mc->default_ram_size =3D 64 * MiB; mc->default_ram_id =3D "lm32_evr.sdram"; diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index 31622c71cb..b84c152ce3 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -350,7 +350,7 @@ static void mcf5208evb_machine_init(MachineClass *mc) { mc->desc =3D "MCF5208EVB"; mc->init =3D mcf5208evb_init; - mc->is_default =3D 1; + mc->is_default =3D true; mc->default_cpu_type =3D M68K_CPU_TYPE_NAME("m5208"); mc->default_ram_id =3D "mcf5208.ram"; } diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petal= ogix_s3adsp1800_mmu.c index 849bafc186..0bb6cdea8d 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -132,7 +132,7 @@ static void petalogix_s3adsp1800_machine_init(MachineCl= ass *mc) { mc->desc =3D "PetaLogix linux refdesign for xilinx Spartan 3ADSP1800"; mc->init =3D petalogix_s3adsp1800_init; - mc->is_default =3D 1; + mc->is_default =3D true; } =20 DEFINE_MACHINE("petalogix-s3adsp1800", petalogix_s3adsp1800_machine_init) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 6e7ba9235d..d380f73d7b 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1439,7 +1439,7 @@ static void mips_malta_machine_init(MachineClass *mc) mc->init =3D mips_malta_init; mc->block_default_type =3D IF_IDE; mc->max_cpus =3D 16; - mc->is_default =3D 1; + mc->is_default =3D true; #ifdef TARGET_MIPS64 mc->default_cpu_type =3D MIPS_CPU_TYPE_NAME("20Kc"); #else diff --git a/hw/moxie/moxiesim.c b/hw/moxie/moxiesim.c index 1d06e39fcb..51a98287b5 100644 --- a/hw/moxie/moxiesim.c +++ b/hw/moxie/moxiesim.c @@ -150,7 +150,7 @@ static void moxiesim_machine_init(MachineClass *mc) { mc->desc =3D "Moxie simulator platform"; mc->init =3D moxiesim_init; - mc->is_default =3D 1; + mc->is_default =3D true; mc->default_cpu_type =3D MOXIE_CPU_TYPE_NAME("MoxieLite"); } =20 diff --git a/hw/nios2/10m50_devboard.c b/hw/nios2/10m50_devboard.c index ad8b2fc670..33dc2bf511 100644 --- a/hw/nios2/10m50_devboard.c +++ b/hw/nios2/10m50_devboard.c @@ -120,7 +120,7 @@ static void nios2_10m50_ghrd_machine_init(struct Machin= eClass *mc) { mc->desc =3D "Altera 10M50 GHRD Nios II design"; mc->init =3D nios2_10m50_ghrd_init; - mc->is_default =3D 1; + mc->is_default =3D true; } =20 DEFINE_MACHINE("10m50-ghrd", nios2_10m50_ghrd_machine_init); diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c index ad5371250f..d08ce61811 100644 --- a/hw/openrisc/openrisc_sim.c +++ b/hw/openrisc/openrisc_sim.c @@ -176,7 +176,7 @@ static void openrisc_sim_machine_init(MachineClass *mc) mc->desc =3D "or1k simulation"; mc->init =3D openrisc_sim_init; mc->max_cpus =3D 2; - mc->is_default =3D 1; + mc->is_default =3D true; mc->default_cpu_type =3D OPENRISC_CPU_TYPE_NAME("or1200"); } =20 diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 66e434bba3..440c406eb4 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -435,7 +435,7 @@ static void heathrow_class_init(ObjectClass *oc, void *= data) mc->block_default_type =3D IF_IDE; mc->max_cpus =3D MAX_CPUS; #ifndef TARGET_PPC64 - mc->is_default =3D 1; + mc->is_default =3D true; #endif /* TOFIX "cad" when Mac floppy is implemented */ mc->default_boot_order =3D "cd"; diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index c03ce6afb9..cc10798be4 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4560,7 +4560,7 @@ static const TypeInfo spapr_machine_info =3D { static void spapr_machine_latest_class_options(MachineClass *mc) { mc->alias =3D "pseries"; - mc->is_default =3D 1; + mc->is_default =3D true; } =20 #define DEFINE_SPAPR_MACHINE(suffix, verstr, latest) \ diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c index 8823681783..6f03857660 100644 --- a/hw/riscv/spike.c +++ b/hw/riscv/spike.c @@ -448,7 +448,7 @@ static void spike_machine_init(MachineClass *mc) mc->desc =3D "RISC-V Spike Board"; mc->init =3D spike_board_init; mc->max_cpus =3D 1; - mc->is_default =3D 1; + mc->is_default =3D true; mc->default_cpu_type =3D SPIKE_V1_10_0_CPU; } =20 diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index a89cf4c129..895498cca6 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -630,7 +630,7 @@ bool css_migration_enabled(void) mc->desc =3D "VirtIO-ccw based S390 machine v" verstr; = \ if (latest) { = \ mc->alias =3D "s390-ccw-virtio"; = \ - mc->is_default =3D 1; = \ + mc->is_default =3D true; = \ } = \ } = \ static void ccw_machine_##suffix##_instance_init(Object *obj) = \ diff --git a/hw/sh4/shix.c b/hw/sh4/shix.c index 2fc2915428..68b14ee5e7 100644 --- a/hw/sh4/shix.c +++ b/hw/sh4/shix.c @@ -82,7 +82,7 @@ static void shix_machine_init(MachineClass *mc) { mc->desc =3D "shix card"; mc->init =3D shix_init; - mc->is_default =3D 1; + mc->is_default =3D true; mc->default_cpu_type =3D TYPE_SH7750R_CPU; } =20 diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index f5bf95fc9f..36ee1a0a3d 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -1402,7 +1402,7 @@ static void ss5_class_init(ObjectClass *oc, void *dat= a) mc->desc =3D "Sun4m platform, SPARCstation 5"; mc->init =3D ss5_init; mc->block_default_type =3D IF_SCSI; - mc->is_default =3D 1; + mc->is_default =3D true; mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("Fujitsu-MB86904"); mc->default_display =3D "tcx"; diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index b7ac42f7a5..d33e84f831 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -816,7 +816,7 @@ static void sun4u_class_init(ObjectClass *oc, void *dat= a) mc->init =3D sun4u_init; mc->block_default_type =3D IF_IDE; mc->max_cpus =3D 1; /* XXX for now */ - mc->is_default =3D 1; + mc->is_default =3D true; mc->default_boot_order =3D "c"; mc->default_cpu_type =3D SPARC_CPU_TYPE_NAME("TI-UltraSparc-IIi"); mc->ignore_boot_device_suffixes =3D true; diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c index 7e933de228..7f9c0238fe 100644 --- a/hw/unicore32/puv3.c +++ b/hw/unicore32/puv3.c @@ -140,7 +140,7 @@ static void puv3_machine_init(MachineClass *mc) { mc->desc =3D "PKUnity Version-3 based on UniCore32"; mc->init =3D puv3_init; - mc->is_default =3D 1; + mc->is_default =3D true; mc->default_cpu_type =3D UNICORE32_CPU_TYPE_NAME("UniCore-II"); } =20 diff --git a/include/hw/boards.h b/include/hw/boards.h index 142b86d0ae..9bc42dfb22 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -81,6 +81,8 @@ typedef struct { * @max_cpus: maximum number of CPUs supported. Default: 1 * @min_cpus: minimum number of CPUs supported. Default: 1 * @default_cpus: number of CPUs instantiated if none are specified. Defau= lt: 1 + * @is_default: + * If true QEMU will use this machine by default if no '-M' option is g= iven. * @get_hotplug_handler: this function is called during bus-less * device hotplug. If defined it returns pointer to an instance * of HotplugHandler object, which handles hotplug operation @@ -181,7 +183,7 @@ struct MachineClass { no_sdcard:1, pci_allow_0_address:1, legacy_fw_cfg_order:1; - int is_default; + bool is_default; const char *default_machine_opts; const char *default_boot_order; const char *default_display; --=20 2.24.1 From nobody Thu Nov 13 20:42:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582923959; cv=none; d=zohomail.com; s=zohoarc; b=cfQqHkTtHh+toBC5pG+uo7md+jAjA14qa4WsKimmPpOkAHAaG5HzZrQGHFxTgOUuTLtlDSpG8hpTIR2foYAHmwpet+7bu7EWqETHF2+/6DUodlShEF4OV4VUXAAmv9rVxPRyVjM+fkIoz05OZqItV/sdfRPoSKhunnG2Iao+XZM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582923959; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IoIxPFqCfBCDJiA8MKkIVdnI0zwyrcJ48E1TknAl5qg=; b=iqN3cM4Y9qy27uvf23WSxwxHKw+u4PbRbZ3WHiV9VQE32n2IddbUbUXnTv/F6Sl/nrK8fToAGNAkoqDYspk99uAnGw/oNqzbcVB+3Egq1ugcntUO7gjI+QwG4TX/K8NP7yc2CK8IH2IqCzdoAMoW4z5SmytJWg6Sd2zrn+s/GDk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582923959560820.4135351737863; Fri, 28 Feb 2020 13:05:59 -0800 (PST) Received: from localhost ([::1]:53922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7mpa-0002m4-Bv for importer@patchew.org; Fri, 28 Feb 2020 16:05:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60168) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7moQ-0001Dv-7h for qemu-devel@nongnu.org; Fri, 28 Feb 2020 16:04:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7moP-0005M9-6i for qemu-devel@nongnu.org; Fri, 28 Feb 2020 16:04:46 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:32719 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7moP-0005Lx-3E for qemu-devel@nongnu.org; Fri, 28 Feb 2020 16:04:45 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-151-wZJJyrxoNhSk4PZkNvMQwA-1; Fri, 28 Feb 2020 16:04:41 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6E6C21005510; Fri, 28 Feb 2020 21:04:40 +0000 (UTC) Received: from localhost (unused-10-15-17-6.yyz.redhat.com [10.15.17.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id AED2C92D01; Fri, 28 Feb 2020 21:04:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582923884; 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=IoIxPFqCfBCDJiA8MKkIVdnI0zwyrcJ48E1TknAl5qg=; b=gDlnRH3ZaBBq+vi3nNDSok281x9dT6yjzgouebhsJ2JJ15gU4/rxD6RgSP+IoIMkbnoqp6 Qb4PnfFrIaQLHzY8k+/CR1HKsQBE+zjJncZOMKyCtCwjIj8XkbxmNzIMg9q6ydwtpQ/y4s 3DqJ+AuwHhFNPdJnNDQxavuBR2DiOkk= X-MC-Unique: wZJJyrxoNhSk4PZkNvMQwA-1 From: Eduardo Habkost To: Peter Maydell , qemu-devel@nongnu.org Subject: [PULL 4/4] vl: Abort if multiple machines are registered as default Date: Fri, 28 Feb 2020 16:04:27 -0500 Message-Id: <20200228210427.474606-5-ehabkost@redhat.com> In-Reply-To: <20200228210427.474606-1-ehabkost@redhat.com> References: <20200228210427.474606-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 It would be confusing to have multiple default machines. Abort if this ever occurs. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200207161948.15972-4-philmd@redhat.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Eduardo Habkost Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier --- softmmu/vl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 705ee6f841..5549f4b619 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1163,16 +1163,18 @@ static MachineClass *find_machine(const char *name,= GSList *machines) static MachineClass *find_default_machine(GSList *machines) { GSList *el; + MachineClass *default_machineclass =3D NULL; =20 for (el =3D machines; el; el =3D el->next) { MachineClass *mc =3D el->data; =20 if (mc->is_default) { - return mc; + assert(default_machineclass =3D=3D NULL && "Multiple default m= achines"); + default_machineclass =3D mc; } } =20 - return NULL; + return default_machineclass; } =20 static int machine_help_func(QemuOpts *opts, MachineState *machine) --=20 2.24.1