From patchwork Mon Sep 22 11:26:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 37675 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f72.google.com (mail-ee0-f72.google.com [74.125.83.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 79A4120C03 for ; Mon, 22 Sep 2014 11:28:13 +0000 (UTC) Received: by mail-ee0-f72.google.com with SMTP id c13sf1756472eek.3 for ; Mon, 22 Sep 2014 04:28:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=C969VoTgwlxffFwRLe4jGTB+f5/g0GuQhk9KAzdtBR0=; b=SXDKEO+vJMGYHMAR+HDwFFY4dVRV3zWaTk+KO34rYODhThCMEjPGUqGIXrOPRbxrTz KMU9jyW6eG1iqBcsw9DVIdSeyvA1BH6R4+I5UQk3hDN1qEhKyEWZg2x50IlI57a1ogjP ET3iV/2CioN+upk3T0dBgATs64Dwyl+wLYHnLAAW1deKNxDzan41E+Ba4c6aEzxLAGBd /H9KjMc8X2o0LpIpulkdGGQ2O+1gYVu8DG6csfpOWKqhDJYVYCHo556wwChn7rPXqFyE t7lICaYke0Lsd5CVPN1zfTONLsICokpUIZJ0jWpOdUECUepH23WkuRzRTkFDfSA2V9eE HU/Q== X-Gm-Message-State: ALoCoQk0xLrt8SJ3fX1Dkh09uSeZRJRC0xbcB/D/TcHh2NSmK0CkUtMf/dvoqkgQtd3eEyOV1dCQ X-Received: by 10.112.89.8 with SMTP id bk8mr4414272lbb.6.1411385292584; Mon, 22 Sep 2014 04:28:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.225 with SMTP id w1ls569602lag.2.gmail; Mon, 22 Sep 2014 04:28:12 -0700 (PDT) X-Received: by 10.152.115.195 with SMTP id jq3mr2026606lab.90.1411385292210; Mon, 22 Sep 2014 04:28:12 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by mx.google.com with ESMTPS id og9si14026344lbc.114.2014.09.22.04.28.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Sep 2014 04:28:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id b12so6590312lbj.28 for ; Mon, 22 Sep 2014 04:28:12 -0700 (PDT) X-Received: by 10.152.179.226 with SMTP id dj2mr25271794lac.40.1411385292041; Mon, 22 Sep 2014 04:28:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp217569lbb; Mon, 22 Sep 2014 04:28:11 -0700 (PDT) X-Received: by 10.224.63.140 with SMTP id b12mr19727027qai.22.1411385290785; Mon, 22 Sep 2014 04:28:10 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 39si8688491qgi.117.2014.09.22.04.28.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 22 Sep 2014 04:28:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:44992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW1mr-000725-R1 for patch@linaro.org; Mon, 22 Sep 2014 07:28:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW1lp-0005t7-NU for qemu-devel@nongnu.org; Mon, 22 Sep 2014 07:27:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XW1lj-0003dD-7M for qemu-devel@nongnu.org; Mon, 22 Sep 2014 07:27:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW1li-0003Q5-VZ for qemu-devel@nongnu.org; Mon, 22 Sep 2014 07:26:59 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8MBQpOD007413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 22 Sep 2014 07:26:52 -0400 Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-96.ams2.redhat.com [10.36.116.96]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8MBQeoV008311; Mon, 22 Sep 2014 07:26:48 -0400 From: Laszlo Ersek To: qemu-devel@nongnu.org, marcel.a@redhat.com, afaerber@suse.de, mst@redhat.com, peter.maydell@linaro.org, lersek@redhat.com Date: Mon, 22 Sep 2014 13:26:35 +0200 Message-Id: <1411385195-13495-3-git-send-email-lersek@redhat.com> In-Reply-To: <1411385195-13495-1-git-send-email-lersek@redhat.com> References: <1411385195-13495-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/2] machine_parse(): list supported machine types in their registration order X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lersek@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Based on the registration order captured in the previous patch, we sort the ad-hoc list printed for qemu-system-XXXX -M \? The GLib documentation is not overly clear if g_slist_sort() allocates a new list or reorders the input list in place, but: - it slightly suggests the latter, - and there is prior use in qemu that is consistent with the latter: g_slist_sort() in qdev_print_devinfos() [qdev-monitor.c] sorts the return value of object_class_get_list() the same as we do here in machine_parse(). The patch has the following effect on the x86_64 output: Before: > Supported machines are: > pc-0.13 Standard PC (i440FX + PIIX, 1996) > pc-i440fx-2.0 Standard PC (i440FX + PIIX, 1996) > pc-1.0 Standard PC (i440FX + PIIX, 1996) > pc-i440fx-2.1 Standard PC (i440FX + PIIX, 1996) > pc-q35-1.7 Standard PC (Q35 + ICH9, 2009) > pc-1.1 Standard PC (i440FX + PIIX, 1996) > pc-0.14 Standard PC (i440FX + PIIX, 1996) > pc-q35-2.0 Standard PC (Q35 + ICH9, 2009) > pc-i440fx-1.4 Standard PC (i440FX + PIIX, 1996) > pc-i440fx-1.5 Standard PC (i440FX + PIIX, 1996) > pc-0.15 Standard PC (i440FX + PIIX, 1996) > pc-q35-1.4 Standard PC (Q35 + ICH9, 2009) > isapc ISA-only PC > pc Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.2) > pc-i440fx-2.2 Standard PC (i440FX + PIIX, 1996) (default) > pc-1.2 Standard PC (i440FX + PIIX, 1996) > pc-0.10 Standard PC (i440FX + PIIX, 1996) > pc-0.11 Standard PC (i440FX + PIIX, 1996) > pc-q35-2.1 Standard PC (Q35 + ICH9, 2009) > q35 Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.2) > pc-q35-2.2 Standard PC (Q35 + ICH9, 2009) > pc-i440fx-1.6 Standard PC (i440FX + PIIX, 1996) > pc-i440fx-1.7 Standard PC (i440FX + PIIX, 1996) > none empty machine > pc-q35-1.5 Standard PC (Q35 + ICH9, 2009) > pc-q35-1.6 Standard PC (Q35 + ICH9, 2009) > pc-0.12 Standard PC (i440FX + PIIX, 1996) > pc-1.3 Standard PC (i440FX + PIIX, 1996) After: > Supported machines are: > pc Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.2) > pc-i440fx-2.2 Standard PC (i440FX + PIIX, 1996) (default) > pc-i440fx-2.1 Standard PC (i440FX + PIIX, 1996) > pc-i440fx-2.0 Standard PC (i440FX + PIIX, 1996) > pc-i440fx-1.7 Standard PC (i440FX + PIIX, 1996) > pc-i440fx-1.6 Standard PC (i440FX + PIIX, 1996) > pc-i440fx-1.5 Standard PC (i440FX + PIIX, 1996) > pc-i440fx-1.4 Standard PC (i440FX + PIIX, 1996) > pc-1.3 Standard PC (i440FX + PIIX, 1996) > pc-1.2 Standard PC (i440FX + PIIX, 1996) > pc-1.1 Standard PC (i440FX + PIIX, 1996) > pc-1.0 Standard PC (i440FX + PIIX, 1996) > pc-0.15 Standard PC (i440FX + PIIX, 1996) > pc-0.14 Standard PC (i440FX + PIIX, 1996) > pc-0.13 Standard PC (i440FX + PIIX, 1996) > pc-0.12 Standard PC (i440FX + PIIX, 1996) > pc-0.11 Standard PC (i440FX + PIIX, 1996) > pc-0.10 Standard PC (i440FX + PIIX, 1996) > isapc ISA-only PC > q35 Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.2) > pc-q35-2.2 Standard PC (Q35 + ICH9, 2009) > pc-q35-2.1 Standard PC (Q35 + ICH9, 2009) > pc-q35-2.0 Standard PC (Q35 + ICH9, 2009) > pc-q35-1.7 Standard PC (Q35 + ICH9, 2009) > pc-q35-1.6 Standard PC (Q35 + ICH9, 2009) > pc-q35-1.5 Standard PC (Q35 + ICH9, 2009) > pc-q35-1.4 Standard PC (Q35 + ICH9, 2009) > none empty machine On the aarch64 output: Before: > Supported machines are: > lm3s811evb Stellaris LM3S811EVB > canon-a1100 Canon PowerShot A1100 IS > vexpress-a15 ARM Versatile Express for Cortex-A15 > vexpress-a9 ARM Versatile Express for Cortex-A9 > xilinx-zynq-a9 Xilinx Zynq Platform Baseboard for Cortex-A9 > connex Gumstix Connex (PXA255) > n800 Nokia N800 tablet aka. RX-34 (OMAP2420) > lm3s6965evb Stellaris LM3S6965EVB > versatileab ARM Versatile/AB (ARM926EJ-S) > borzoi Borzoi PDA (PXA270) > tosa Tosa PDA (PXA255) > cheetah Palm Tungsten|E aka. Cheetah PDA (OMAP310) > midway Calxeda Midway (ECX-2000) > mainstone Mainstone II (PXA27x) > n810 Nokia N810 tablet aka. RX-44 (OMAP2420) > terrier Terrier PDA (PXA270) > highbank Calxeda Highbank (ECX-1000) > cubieboard cubietech cubieboard > sx1-v1 Siemens SX1 (OMAP310) V1 > sx1 Siemens SX1 (OMAP310) V2 > realview-eb-mpcore ARM RealView Emulation Baseboard (ARM11MPCore) > kzm ARM KZM Emulation Baseboard (ARM1136) > akita Akita PDA (PXA270) > z2 Zipit Z2 (PXA27x) > musicpal Marvell 88w8618 / MusicPal (ARM926EJ-S) > realview-pb-a8 ARM RealView Platform Baseboard for Cortex-A8 > versatilepb ARM Versatile/PB (ARM926EJ-S) > realview-eb ARM RealView Emulation Baseboard (ARM926EJ-S) > realview-pbx-a9 ARM RealView Platform Baseboard Explore for Cortex-A9 > spitz Spitz PDA (PXA270) > none empty machine > virt ARM Virtual Machine > collie Collie PDA (SA-1110) > smdkc210 Samsung SMDKC210 board (Exynos4210) > verdex Gumstix Verdex (PXA270) > nuri Samsung NURI board (Exynos4210) > integratorcp ARM Integrator/CP (ARM926EJ-S) After: > Supported machines are: > collie Collie PDA (SA-1110) > nuri Samsung NURI board (Exynos4210) > smdkc210 Samsung SMDKC210 board (Exynos4210) > connex Gumstix Connex (PXA255) > verdex Gumstix Verdex (PXA270) > highbank Calxeda Highbank (ECX-1000) > midway Calxeda Midway (ECX-2000) > canon-a1100 Canon PowerShot A1100 IS > integratorcp ARM Integrator/CP (ARM926EJ-S) > kzm ARM KZM Emulation Baseboard (ARM1136) > mainstone Mainstone II (PXA27x) > musicpal Marvell 88w8618 / MusicPal (ARM926EJ-S) > n800 Nokia N800 tablet aka. RX-34 (OMAP2420) > n810 Nokia N810 tablet aka. RX-44 (OMAP2420) > sx1 Siemens SX1 (OMAP310) V2 > sx1-v1 Siemens SX1 (OMAP310) V1 > cheetah Palm Tungsten|E aka. Cheetah PDA (OMAP310) > realview-eb ARM RealView Emulation Baseboard (ARM926EJ-S) > realview-eb-mpcore ARM RealView Emulation Baseboard (ARM11MPCore) > realview-pb-a8 ARM RealView Platform Baseboard for Cortex-A8 > realview-pbx-a9 ARM RealView Platform Baseboard Explore for Cortex-A9 > akita Akita PDA (PXA270) > spitz Spitz PDA (PXA270) > borzoi Borzoi PDA (PXA270) > terrier Terrier PDA (PXA270) > lm3s811evb Stellaris LM3S811EVB > lm3s6965evb Stellaris LM3S6965EVB > tosa Tosa PDA (PXA255) > versatilepb ARM Versatile/PB (ARM926EJ-S) > versatileab ARM Versatile/AB (ARM926EJ-S) > vexpress-a9 ARM Versatile Express for Cortex-A9 > vexpress-a15 ARM Versatile Express for Cortex-A15 > virt ARM Virtual Machine > xilinx-zynq-a9 Xilinx Zynq Platform Baseboard for Cortex-A9 > z2 Zipit Z2 (PXA27x) > cubieboard cubietech cubieboard > none empty machine RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1145042 Signed-off-by: Laszlo Ersek --- vl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vl.c b/vl.c index b62d9b2..00c7dab 100644 --- a/vl.c +++ b/vl.c @@ -2652,6 +2652,15 @@ static int debugcon_parse(const char *devname) return 0; } +static gint machine_class_cmp(gconstpointer a, gconstpointer b) +{ + const MachineClass *mc1 = a, *mc2 = b; + + return mc1->registration_order < mc2->registration_order ? -1 : + mc1->registration_order > mc2->registration_order ? 1 : + 0; +} + static MachineClass *machine_parse(const char *name) { MachineClass *mc = NULL; @@ -2668,6 +2677,7 @@ static MachineClass *machine_parse(const char *name) error_printf("Use -machine help to list supported machines!\n"); } else { printf("Supported machines are:\n"); + machines = g_slist_sort(machines, machine_class_cmp); for (el = machines; el; el = el->next) { MachineClass *mc = el->data; if (mc->alias) {