All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order
@ 2014-09-22 20:38 Laszlo Ersek
  2014-09-22 20:38 ` [Qemu-devel] [PATCH v2 1/2] well-defined listing order for machine types Laszlo Ersek
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Laszlo Ersek @ 2014-09-22 20:38 UTC (permalink / raw)
  To: qemu-devel, marcel.a, afaerber, mst, peter.maydell, pbonzini, lersek

The first patch introduces a generic comparator. This comparator should
cover all machine types at once that don't belong to machine type
"families". Hence, for example, the output it produces for

  qemu-system-aarch64 -M \?

is meant to be final. (See examples in the patches.)

The second patch files piix and q35 machine types into their respective
families.

Paolo said we needed to care about "pseries, pc, q35", but I got no clue
about "pseries", so I didn't touch that. It shouldn't be hard for
someone who knows "pseries" to post a followup patch that covers it.
Until then, "pseries" machine types are listed in alphabetical order (no
families).

Laszlo Ersek (2):
  well-defined listing order for machine types
  i386/pc: add piix and q35 machtypes to sorting families for -M \?

 include/hw/boards.h |  2 ++
 hw/i386/pc.c        |  1 +
 hw/i386/pc_piix.c   |  1 +
 hw/i386/pc_q35.c    |  1 +
 vl.c                | 38 +++++++++++++++++++++++++++++++++++++-
 5 files changed, 42 insertions(+), 1 deletion(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH v2 1/2] well-defined listing order for machine types
  2014-09-22 20:38 [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order Laszlo Ersek
@ 2014-09-22 20:38 ` Laszlo Ersek
  2014-09-22 20:38 ` [Qemu-devel] [PATCH v2 2/2] i386/pc: add piix and q35 machtypes to sorting families for -M \? Laszlo Ersek
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Laszlo Ersek @ 2014-09-22 20:38 UTC (permalink / raw)
  To: qemu-devel, marcel.a, afaerber, mst, peter.maydell, pbonzini, lersek

Commit 261747f1 ("vl: Use MachineClass instead of global QEMUMachine
list") broke the ordering of the machine types in the user-visible output
of

  qemu-system-XXXX -M \?

This occurred because registration was rebased from a manually maintained
linked list to GLib hash tables:

  qemu_register_machine()
    type_register()
      type_register_internal()
        type_table_add()
          g_hash_table_insert()

and because the listing was rebased accordingly, from the traversal of the
list to the traversal of the hash table (rendered as an ad-hoc list):

  machine_parse()
    object_class_get_list(TYPE_MACHINE)
      object_class_foreach()
        g_hash_table_foreach()

The current order is a "random" one, for practical purposes, which is
annoying for users.

Introduce new members QEMUMachine.family and MachineClass.family, allowing
machine types to be "clustered". Introduce a comparator function that
establishes a total ordering between machine types, ordering machine types
in the same family next to each other. In machine_parse(), list the
supported machine types sorted with the comparator function.

The comparator function:
- sorts whole families before standalone machine types,
- sorts whole families between each other in alphabetically increasing
  order,
- sorts machine types inside the same family in alphabetically decreasing
  order,
- sorts standalone machine types between each other in alphabetically
  increasing order.

After this patch, all machine types are considered standalone, and
accordingly, the output is alphabetically ascending. This will be refined
in the following patches.

Effects 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:
> isapc                ISA-only PC
> none                 empty machine
> pc-0.10              Standard PC (i440FX + PIIX, 1996)
> pc-0.11              Standard PC (i440FX + PIIX, 1996)
> pc-0.12              Standard PC (i440FX + PIIX, 1996)
> pc-0.13              Standard PC (i440FX + PIIX, 1996)
> pc-0.14              Standard PC (i440FX + PIIX, 1996)
> pc-0.15              Standard PC (i440FX + PIIX, 1996)
> pc-1.0               Standard PC (i440FX + PIIX, 1996)
> pc-1.1               Standard PC (i440FX + PIIX, 1996)
> pc-1.2               Standard PC (i440FX + PIIX, 1996)
> pc-1.3               Standard PC (i440FX + PIIX, 1996)
> pc-i440fx-1.4        Standard PC (i440FX + PIIX, 1996)
> pc-i440fx-1.5        Standard PC (i440FX + PIIX, 1996)
> pc-i440fx-1.6        Standard PC (i440FX + PIIX, 1996)
> pc-i440fx-1.7        Standard PC (i440FX + PIIX, 1996)
> pc-i440fx-2.0        Standard PC (i440FX + PIIX, 1996)
> pc-i440fx-2.1        Standard PC (i440FX + PIIX, 1996)
> pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.2)
> pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996) (default)
> pc-q35-1.4           Standard PC (Q35 + ICH9, 2009)
> pc-q35-1.5           Standard PC (Q35 + ICH9, 2009)
> pc-q35-1.6           Standard PC (Q35 + ICH9, 2009)
> pc-q35-1.7           Standard PC (Q35 + ICH9, 2009)
> pc-q35-2.0           Standard PC (Q35 + ICH9, 2009)
> 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)

Effects 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:
> akita                Akita PDA (PXA270)
> borzoi               Borzoi PDA (PXA270)
> canon-a1100          Canon PowerShot A1100 IS
> cheetah              Palm Tungsten|E aka. Cheetah PDA (OMAP310)
> collie               Collie PDA (SA-1110)
> connex               Gumstix Connex (PXA255)
> cubieboard           cubietech cubieboard
> highbank             Calxeda Highbank (ECX-1000)
> integratorcp         ARM Integrator/CP (ARM926EJ-S)
> kzm                  ARM KZM Emulation Baseboard (ARM1136)
> lm3s6965evb          Stellaris LM3S6965EVB
> lm3s811evb           Stellaris LM3S811EVB
> mainstone            Mainstone II (PXA27x)
> midway               Calxeda Midway (ECX-2000)
> musicpal             Marvell 88w8618 / MusicPal (ARM926EJ-S)
> n800                 Nokia N800 tablet aka. RX-34 (OMAP2420)
> n810                 Nokia N810 tablet aka. RX-44 (OMAP2420)
> none                 empty machine
> nuri                 Samsung NURI board (Exynos4210)
> 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
> smdkc210             Samsung SMDKC210 board (Exynos4210)
> spitz                Spitz PDA (PXA270)
> sx1                  Siemens SX1 (OMAP310) V2
> sx1-v1               Siemens SX1 (OMAP310) V1
> terrier              Terrier PDA (PXA270)
> tosa                 Tosa PDA (PXA255)
> verdex               Gumstix Verdex (PXA270)
> versatileab          ARM Versatile/AB (ARM926EJ-S)
> versatilepb          ARM Versatile/PB (ARM926EJ-S)
> vexpress-a15         ARM Versatile Express for Cortex-A15
> vexpress-a9          ARM Versatile Express for Cortex-A9
> virt                 ARM Virtual Machine
> xilinx-zynq-a9       Xilinx Zynq Platform Baseboard for Cortex-A9
> z2                   Zipit Z2 (PXA27x)

RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1145042
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 include/hw/boards.h |  2 ++
 hw/i386/pc.c        |  1 +
 vl.c                | 38 +++++++++++++++++++++++++++++++++++++-
 3 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/include/hw/boards.h b/include/hw/boards.h
index dfb6718..e378ad5 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -20,6 +20,7 @@ typedef void QEMUMachineHotAddCPUFunc(const int64_t id, Error **errp);
 typedef int QEMUMachineGetKvmtypeFunc(const char *arg);
 
 struct QEMUMachine {
+    const char *family; /* NULL iff @name identifies a standalone machtype */
     const char *name;
     const char *alias;
     const char *desc;
@@ -76,6 +77,7 @@ struct MachineClass {
     ObjectClass parent_class;
     /*< public >*/
 
+    const char *family; /* NULL iff @name identifies a standalone machtype */
     const char *name;
     const char *alias;
     const char *desc;
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 2c2e9dc..1e67e7b 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1516,6 +1516,7 @@ static void pc_generic_machine_class_init(ObjectClass *oc, void *data)
     MachineClass *mc = MACHINE_CLASS(oc);
     QEMUMachine *qm = data;
 
+    mc->family = qm->family;
     mc->name = qm->name;
     mc->alias = qm->alias;
     mc->desc = qm->desc;
diff --git a/vl.c b/vl.c
index dc792fe..f431e4a 100644
--- a/vl.c
+++ b/vl.c
@@ -1575,6 +1575,7 @@ static void machine_class_init(ObjectClass *oc, void *data)
     MachineClass *mc = MACHINE_CLASS(oc);
     QEMUMachine *qm = data;
 
+    mc->family = qm->family;
     mc->name = qm->name;
     mc->alias = qm->alias;
     mc->desc = qm->desc;
@@ -2648,7 +2649,41 @@ static int debugcon_parse(const char *devname)
     return 0;
 }
 
-static MachineClass *machine_parse(const char *name)
+static gint machine_class_cmp(gconstpointer a, gconstpointer b)
+{
+    const MachineClass *mc1 = a, *mc2 = b;
+    int res;
+
+    if (mc1->family == NULL) {
+        if (mc2->family == NULL) {
+            /* Compare standalone machine types against each other; they sort
+             * in increasing order.
+             */
+            return strcmp(object_class_get_name(OBJECT_CLASS(mc1)),
+                          object_class_get_name(OBJECT_CLASS(mc2)));
+        }
+
+        /* Standalone machine types sort after families. */
+        return 1;
+    }
+
+    if (mc2->family == NULL) {
+        /* Families sort before standalone machine types. */
+        return -1;
+    }
+
+    /* Families sort between each other alphabetically increasingly. */
+    res = strcmp(mc1->family, mc2->family);
+    if (res != 0) {
+        return res;
+    }
+
+    /* Within the same family, machine types sort in decreasing order. */
+    return strcmp(object_class_get_name(OBJECT_CLASS(mc2)),
+                  object_class_get_name(OBJECT_CLASS(mc1)));
+}
+
+ static MachineClass *machine_parse(const char *name)
 {
     MachineClass *mc = NULL;
     GSList *el, *machines = object_class_get_list(TYPE_MACHINE, false);
@@ -2664,6 +2699,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) {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH v2 2/2] i386/pc: add piix and q35 machtypes to sorting families for -M \?
  2014-09-22 20:38 [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order Laszlo Ersek
  2014-09-22 20:38 ` [Qemu-devel] [PATCH v2 1/2] well-defined listing order for machine types Laszlo Ersek
@ 2014-09-22 20:38 ` Laszlo Ersek
  2014-09-22 21:31 ` [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order Paolo Bonzini
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Laszlo Ersek @ 2014-09-22 20:38 UTC (permalink / raw)
  To: qemu-devel, marcel.a, afaerber, mst, peter.maydell, pbonzini, lersek

With this patch applied, the output of -M \? is

> 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)
> 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)
> isapc                ISA-only PC
> none                 empty machine

RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1145042
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 hw/i386/pc_piix.c | 1 +
 hw/i386/pc_q35.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 103d756..4c27827 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -451,6 +451,7 @@ static void pc_xen_hvm_init(MachineState *machine)
 
 #define PC_I440FX_MACHINE_OPTIONS \
     PC_DEFAULT_MACHINE_OPTIONS, \
+    .family = "pc_piix", \
     .desc = "Standard PC (i440FX + PIIX, 1996)", \
     .hot_add_cpu = pc_hot_add_cpu
 
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index d4a907c..a199043 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -343,6 +343,7 @@ static void pc_q35_init_1_4(MachineState *machine)
 
 #define PC_Q35_MACHINE_OPTIONS \
     PC_DEFAULT_MACHINE_OPTIONS, \
+    .family = "pc_q35", \
     .desc = "Standard PC (Q35 + ICH9, 2009)", \
     .hot_add_cpu = pc_hot_add_cpu
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order
  2014-09-22 20:38 [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order Laszlo Ersek
  2014-09-22 20:38 ` [Qemu-devel] [PATCH v2 1/2] well-defined listing order for machine types Laszlo Ersek
  2014-09-22 20:38 ` [Qemu-devel] [PATCH v2 2/2] i386/pc: add piix and q35 machtypes to sorting families for -M \? Laszlo Ersek
@ 2014-09-22 21:31 ` Paolo Bonzini
  2014-09-23  4:43 ` Marcel Apfelbaum
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2014-09-22 21:31 UTC (permalink / raw)
  To: Laszlo Ersek, qemu-devel, marcel.a, afaerber, mst, peter.maydell

Il 22/09/2014 22:38, Laszlo Ersek ha scritto:
> The first patch introduces a generic comparator. This comparator should
> cover all machine types at once that don't belong to machine type
> "families". Hence, for example, the output it produces for
> 
>   qemu-system-aarch64 -M \?
> 
> is meant to be final. (See examples in the patches.)
> 
> The second patch files piix and q35 machine types into their respective
> families.
> 
> Paolo said we needed to care about "pseries, pc, q35", but I got no clue
> about "pseries", so I didn't touch that. It shouldn't be hard for
> someone who knows "pseries" to post a followup patch that covers it.
> Until then, "pseries" machine types are listed in alphabetical order (no
> families).
> 
> Laszlo Ersek (2):
>   well-defined listing order for machine types
>   i386/pc: add piix and q35 machtypes to sorting families for -M \?
> 
>  include/hw/boards.h |  2 ++
>  hw/i386/pc.c        |  1 +
>  hw/i386/pc_piix.c   |  1 +
>  hw/i386/pc_q35.c    |  1 +
>  vl.c                | 38 +++++++++++++++++++++++++++++++++++++-
>  5 files changed, 42 insertions(+), 1 deletion(-)
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order
  2014-09-22 20:38 [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order Laszlo Ersek
                   ` (2 preceding siblings ...)
  2014-09-22 21:31 ` [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order Paolo Bonzini
@ 2014-09-23  4:43 ` Marcel Apfelbaum
  2014-09-23  8:54 ` Michael S. Tsirkin
  2014-09-24  0:51 ` David Gibson
  5 siblings, 0 replies; 7+ messages in thread
From: Marcel Apfelbaum @ 2014-09-23  4:43 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: peter.maydell, mst, qemu-devel, pbonzini, afaerber

On Mon, 2014-09-22 at 22:38 +0200, Laszlo Ersek wrote:
> The first patch introduces a generic comparator. This comparator should
> cover all machine types at once that don't belong to machine type
> "families". Hence, for example, the output it produces for
> 
>   qemu-system-aarch64 -M \?
> 
> is meant to be final. (See examples in the patches.)
> 
> The second patch files piix and q35 machine types into their respective
> families.
> 
> Paolo said we needed to care about "pseries, pc, q35", but I got no clue
> about "pseries", so I didn't touch that. It shouldn't be hard for
> someone who knows "pseries" to post a followup patch that covers it.
> Until then, "pseries" machine types are listed in alphabetical order (no
> families).
> 
> Laszlo Ersek (2):
>   well-defined listing order for machine types
>   i386/pc: add piix and q35 machtypes to sorting families for -M \?
> 
>  include/hw/boards.h |  2 ++
>  hw/i386/pc.c        |  1 +
>  hw/i386/pc_piix.c   |  1 +
>  hw/i386/pc_q35.c    |  1 +
>  vl.c                | 38 +++++++++++++++++++++++++++++++++++++-
>  5 files changed, 42 insertions(+), 1 deletion(-)
> 

Looks good to me. 
Reviewed-by: Marcel Apfelbaum <marcel.a@redhat.com>

Discussion only:
1. Adding the family field to machine options mechanism does
leverage the machines hierarchy, but in another way and not through QOM.
2. The compare function looks exactly as I thought it would, my only difference
was to take it a little further by let the family itself to sort its
machines, but *is completely unnecessary* for this purpose.  

Your solution has a small footprint and I like it.

Thanks,
Marcel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order
  2014-09-22 20:38 [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order Laszlo Ersek
                   ` (3 preceding siblings ...)
  2014-09-23  4:43 ` Marcel Apfelbaum
@ 2014-09-23  8:54 ` Michael S. Tsirkin
  2014-09-24  0:51 ` David Gibson
  5 siblings, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2014-09-23  8:54 UTC (permalink / raw)
  To: Laszlo Ersek; +Cc: peter.maydell, pbonzini, qemu-devel, afaerber, marcel.a

On Mon, Sep 22, 2014 at 10:38:34PM +0200, Laszlo Ersek wrote:
> The first patch introduces a generic comparator. This comparator should
> cover all machine types at once that don't belong to machine type
> "families". Hence, for example, the output it produces for
> 
>   qemu-system-aarch64 -M \?
> 
> is meant to be final. (See examples in the patches.)
> 
> The second patch files piix and q35 machine types into their respective
> families.
> 
> Paolo said we needed to care about "pseries, pc, q35", but I got no clue
> about "pseries", so I didn't touch that. It shouldn't be hard for
> someone who knows "pseries" to post a followup patch that covers it.
> Until then, "pseries" machine types are listed in alphabetical order (no
> families).
> 
> Laszlo Ersek (2):
>   well-defined listing order for machine types
>   i386/pc: add piix and q35 machtypes to sorting families for -M \?
> 
>  include/hw/boards.h |  2 ++
>  hw/i386/pc.c        |  1 +
>  hw/i386/pc_piix.c   |  1 +
>  hw/i386/pc_q35.c    |  1 +
>  vl.c                | 38 +++++++++++++++++++++++++++++++++++++-
>  5 files changed, 42 insertions(+), 1 deletion(-)

Acked-by: Michael S. Tsirkin <mst@redhat.com>


> -- 
> 1.8.3.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order
  2014-09-22 20:38 [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order Laszlo Ersek
                   ` (4 preceding siblings ...)
  2014-09-23  8:54 ` Michael S. Tsirkin
@ 2014-09-24  0:51 ` David Gibson
  5 siblings, 0 replies; 7+ messages in thread
From: David Gibson @ 2014-09-24  0:51 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: peter.maydell, mst, marcel.a, qemu-devel, agraf, pbonzini, afaerber

[-- Attachment #1: Type: text/plain, Size: 1697 bytes --]

On Mon, Sep 22, 2014 at 10:38:34PM +0200, Laszlo Ersek wrote:
> The first patch introduces a generic comparator. This comparator should
> cover all machine types at once that don't belong to machine type
> "families". Hence, for example, the output it produces for
> 
>   qemu-system-aarch64 -M \?
> 
> is meant to be final. (See examples in the patches.)
> 
> The second patch files piix and q35 machine types into their respective
> families.
> 
> Paolo said we needed to care about "pseries, pc, q35", but I got no clue
> about "pseries", so I didn't touch that. It shouldn't be hard for
> someone who knows "pseries" to post a followup patch that covers it.
> Until then, "pseries" machine types are listed in alphabetical order (no
> families).

Acked-by: David Gibson <david@gibson.dropbear.id.au>

pseries is fairly simple; there are two pseries machine types, plain
"pseries" and "pseries-2.1".  These should both be in the same family.

Implementation needs to be a little different than for PC, because the
pseries machines are fully QOM-ized so there are no QEMUMachine
structures any more.  We'll need to set family from the *_class_init()
functions instead.

This is then complicated a little, because there's a pending patch in
agraf's tree which re-organizes the pseries machine types a ltitle.
After that there are still two pseries machine types, "pseries-2.1"
and "pseries-2.2" (aliased to "pseries").  Again, both should be in
the "pseries" family.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-09-24  1:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-22 20:38 [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order Laszlo Ersek
2014-09-22 20:38 ` [Qemu-devel] [PATCH v2 1/2] well-defined listing order for machine types Laszlo Ersek
2014-09-22 20:38 ` [Qemu-devel] [PATCH v2 2/2] i386/pc: add piix and q35 machtypes to sorting families for -M \? Laszlo Ersek
2014-09-22 21:31 ` [Qemu-devel] [PATCH v2 0/2] list supported machine types in well-defined order Paolo Bonzini
2014-09-23  4:43 ` Marcel Apfelbaum
2014-09-23  8:54 ` Michael S. Tsirkin
2014-09-24  0:51 ` David Gibson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.