Skip to contentSkip to conversation

hw/i386: Deprecate the machines pc-0.10 to pc-1.2

PATCH In review Thomas Huth 9 participants 37 messages Jul 12, 2017 – Jul 14, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 hw/i386: Deprecate the machines pc-0.10 to pc-1.2

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

---
Note: Even if we mark all these old machines as deprecated, this ofcourse doesn't mean that we also have to remove them all at once later when we decide to finally really remove some. We could then also start by removing 0.10 and 0.11 only, for example (since there should really be no users left for these), or only up to 0.13 (to be able to kill rombar=0).

v3:
- Use a more generic approach by introducing a "deprecation_msg" in the MachineClass instead.

v2:
- Deprecate machines up to pc-1.2

 hw/i386/pc_piix.c   | 1 +
 include/hw/boards.h | 1 +
 vl.c                | 4 ++++
 3 files changed, 6 insertions(+)
hw/i386/pc_piix.c +1 -0
index 22dbef6..8e70308 100644
@@ -707,6 +707,7 @@ static void pc_i440fx_1_2_machine_options(MachineClass *m)
 {
     pc_i440fx_1_3_machine_options(m);
     m->hw_version = "1.2.0";
+    m->deprecation_msg = "Please use a newer machine type instead.";
     SET_MACHINE_COMPAT(m, PC_COMPAT_1_2);
 }
 
include/hw/boards.h +1 -0
index 76ce021..42a0264 100644
@@ -112,6 +112,7 @@ struct MachineClass {
     char *name;
     const char *alias;
     const char *desc;
+    const char *deprecation_msg;
 
     void (*init)(MachineState *state);
     void (*reset)(void);
vl.c +4 -0
index f7560de..0058d41 100644
@@ -4115,6 +4115,10 @@ int main(int argc, char **argv, char **envp)
     replay_configure(icount_opts);
 
     machine_class = select_machine();
+    if (machine_class->deprecation_msg) {
+        error_report("Machine type '%s' is deprecated. %s",
+                     machine_class->name, machine_class->deprecation_msg);
+    }
 
     set_memory_options(&ram_slots, &maxram_size, machine_class);
 
Signature · 1 line
1.8.3.1
Reviewed-by on v3 1/1
#1 lore raw
Quoted 5 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to
remove the pc machines up to 0.13 one day for example, this would allow
us to eventually kill the code for rombar=0 (i.e. where QEMU copies

Quoted 8 lines

ROM
BARs directly to low memory). Everything up to pc-1.2 is also known to
have issues with migration.  So let's start with a deprecation message
for the old machine types so that the (hopefully) few users of these old
systems start switching over to newer machine types instead.

Reviewed-by on v3 1/1
#2 lore raw
In reply to Thomas Huth
Quoted 9 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I suggest changing "-machine help" too. Today it looks like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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)
  pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine

It could be changed to something like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine

Deprecated machines: pc-1.2, pc-1.1, pc-1.0, pc-0.15, pc-0.14, pc-0.13,

                       pc-0.12, pc-0.11, pc-0.10.
Signature · 1 line
Eduardo
#3 lore raw
Quoted 44 lines · Eduardo Habkost
Quoted 9 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I suggest changing "-machine help" too. Today it looks like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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)
  pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
Quoted 8 lines
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine

Any chance we can sort them reasonably too?

Quoted 37 lines

It could be changed to something like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine

Deprecated machines: pc-1.2, pc-1.1, pc-1.0, pc-0.15, pc-0.14, pc-0.13,

                       pc-0.12, pc-0.11, pc-0.10.
Signature · 1 line
Eduardo
#4 lore raw
Quoted 54 lines · Michael S. Tsirkin
Quoted 44 lines · Eduardo Habkost
Quoted 9 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I suggest changing "-machine help" too. Today it looks like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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)
  pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
Quoted 8 lines
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine
Quoted 1 line

Any chance we can sort them reasonably too?

If we use strverscmp(), it will be sorted in a more reasonable way. We could copy the gnulib version on systems without glibc. Life is too short for writing configure checks by hand, though; I will add this to the end of my wish-todo list. If somebody wants to volunteer, be my guest.

I'm CCing Eric in case he has suggestions that would help import the gnulib module in an easy way.

Signature · 1 line
Eduardo
#5 lore raw
Quoted 57 lines · Eduardo Habkost
Quoted 54 lines · Michael S. Tsirkin
Quoted 44 lines · Eduardo Habkost
Quoted 9 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I suggest changing "-machine help" too. Today it looks like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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)
  pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
Quoted 8 lines
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine
Quoted 1 line

Any chance we can sort them reasonably too?

Quoted 11 lines

If we use strverscmp(), it will be sorted in a more reasonable way. We could copy the gnulib version on systems without glibc. Life is too short for writing configure checks by hand, though; I will add this to the end of my wish-todo list. If somebody wants to volunteer, be my guest.

I'm CCing Eric in case he has suggestions that would help import the gnulib module in an easy way.

Signature · 1 line
Eduardo

As we never have leading zeroes, and input comes from QEMU so it's safe, it's probably easier to just open-code it:

/* compare string numerically: shorter strings give smaller numbers */ int mstcmp(const char *s1, const char *s2)

{
	int l1, l2;

	l1 = strlen(s1);
	l2 = strlen(s2);
	return l1 == l2 ? strcmp(s1, s2) : l1 - l2;
}

feel free to rename and include.

Signature · 1 line
MST
#6 lore raw
Quoted 75 lines · Michael S. Tsirkin
Quoted 57 lines · Eduardo Habkost
Quoted 54 lines · Michael S. Tsirkin
Quoted 44 lines · Eduardo Habkost
Quoted 9 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I suggest changing "-machine help" too. Today it looks like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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)
  pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
Quoted 8 lines
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine
Quoted 1 line

Any chance we can sort them reasonably too?

Quoted 11 lines

If we use strverscmp(), it will be sorted in a more reasonable way. We could copy the gnulib version on systems without glibc. Life is too short for writing configure checks by hand, though; I will add this to the end of my wish-todo list. If somebody wants to volunteer, be my guest.

I'm CCing Eric in case he has suggestions that would help import the gnulib module in an easy way.

Signature · 1 line
Eduardo

As we never have leading zeroes, and input comes from QEMU so it's safe, it's probably easier to just open-code it:

/* compare string numerically: shorter strings give smaller numbers */ int mstcmp(const char *s1, const char *s2)

Quoted 8 lines
{
	int l1, l2;

	l1 = strlen(s1);
	l2 = strlen(s2);
	return l1 == l2 ? strcmp(s1, s2) : l1 - l2;
}

This doesn't work because strlen("pc-0.10") > strlen("pc-1.0").

Signature · 1 line
Eduardo
#7 lore raw
Quoted 79 lines · Eduardo Habkost
Quoted 78 lines · Michael S. Tsirkin
Quoted 57 lines · Eduardo Habkost
Quoted 54 lines · Michael S. Tsirkin
Quoted 44 lines · Eduardo Habkost
Quoted 9 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I suggest changing "-machine help" too. Today it looks like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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)
  pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
Quoted 8 lines
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine
Quoted 1 line

Any chance we can sort them reasonably too?

Quoted 11 lines

If we use strverscmp(), it will be sorted in a more reasonable way. We could copy the gnulib version on systems without glibc. Life is too short for writing configure checks by hand, though; I will add this to the end of my wish-todo list. If somebody wants to volunteer, be my guest.

I'm CCing Eric in case he has suggestions that would help import the gnulib module in an easy way.

Signature · 1 line
Eduardo

As we never have leading zeroes, and input comes from QEMU so it's safe, it's probably easier to just open-code it:

/* compare string numerically: shorter strings give smaller numbers */ int mstcmp(const char *s1, const char *s2)

{
	int l1, l2;
Quoted 7 lines
Quoted 5 lines
	l1 = strlen(s1);
	l2 = strlen(s2);
	return l1 == l2 ? strcmp(s1, s2) : l1 - l2;
}

This doesn't work because strlen("pc-0.10") > strlen("pc-1.0").

Oh right. So you need to find dots and split at these points. Something like the below? Completely untested.

int mstcmp(const char *s1, const char *s2)

{
	const char *e1, *e2;

int l1, l2, c;

	do {
		e1 = strchr(s1, '.');
		e2 = strchr(s2, '.');

		l1 = e1 ? e1 - s1 + 1 : strlen(s1);
		l2 = e2 ? e2 - s2 + 1 : strlen(s2);

		/* compare numerically: shorter strings give smaller numbers */
		if (l1 != l2) {
			break;
		}
		c = strncmp(s1, s2, l1);
		if (c) {
			return c;
		}
		s1 += l1;
		s2 += l1;
	} while (l1);

	return l1 - l2;
}
Quoted 2 lines
Signature · 1 line
Eduardo
#8 lore raw
Quoted 109 lines · Michael S. Tsirkin
Quoted 79 lines · Eduardo Habkost
Quoted 78 lines · Michael S. Tsirkin
Quoted 57 lines · Eduardo Habkost
Quoted 54 lines · Michael S. Tsirkin
Quoted 44 lines · Eduardo Habkost
Quoted 9 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I suggest changing "-machine help" too. Today it looks like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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)
  pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
Quoted 8 lines
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine
Quoted 1 line

Any chance we can sort them reasonably too?

Quoted 11 lines

If we use strverscmp(), it will be sorted in a more reasonable way. We could copy the gnulib version on systems without glibc. Life is too short for writing configure checks by hand, though; I will add this to the end of my wish-todo list. If somebody wants to volunteer, be my guest.

I'm CCing Eric in case he has suggestions that would help import the gnulib module in an easy way.

Signature · 1 line
Eduardo

As we never have leading zeroes, and input comes from QEMU so it's safe, it's probably easier to just open-code it:

/* compare string numerically: shorter strings give smaller numbers */ int mstcmp(const char *s1, const char *s2)

{
	int l1, l2;
Quoted 7 lines
Quoted 5 lines
	l1 = strlen(s1);
	l2 = strlen(s2);
	return l1 == l2 ? strcmp(s1, s2) : l1 - l2;
}

This doesn't work because strlen("pc-0.10") > strlen("pc-1.0").

Oh right. So you need to find dots and split at these points. Something like the below? Completely untested.

int mstcmp(const char *s1, const char *s2)

{
	const char *e1, *e2;

int l1, l2, c;

	do {
		e1 = strchr(s1, '.');
		e2 = strchr(s2, '.');

		l1 = e1 ? e1 - s1 + 1 : strlen(s1);
		l2 = e2 ? e2 - s2 + 1 : strlen(s2);

		/* compare numerically: shorter strings give smaller numbers */
		if (l1 != l2) {
			break;
		}
		c = strncmp(s1, s2, l1);
		if (c) {
Quoted 8 lines
			return c;
		}
		s1 += l1;
		s2 += l1;
	} while (l1);

	return l1 - l2;
}

QEMU already has machine type sorting code:

1 2709f263952b well-defined listing order for machine types 2 562542b6aee2 i386/pc: add piix and q35 machtypes to sorting
families for -M \?

I guess it should be possible to refine machine_class_cmp() in "vl.c", so that some numeric sorting is applied to machine types in the same "family".

Thanks
Laszlo

#9 lore raw
Quoted 125 lines · Laszlo Ersek
Quoted 109 lines · Michael S. Tsirkin
Quoted 79 lines · Eduardo Habkost
Quoted 78 lines · Michael S. Tsirkin
Quoted 57 lines · Eduardo Habkost
Quoted 54 lines · Michael S. Tsirkin
Quoted 44 lines · Eduardo Habkost
Quoted 9 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I suggest changing "-machine help" too. Today it looks like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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)
  pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
Quoted 8 lines
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine
Quoted 1 line

Any chance we can sort them reasonably too?

Quoted 11 lines

If we use strverscmp(), it will be sorted in a more reasonable way. We could copy the gnulib version on systems without glibc. Life is too short for writing configure checks by hand, though; I will add this to the end of my wish-todo list. If somebody wants to volunteer, be my guest.

I'm CCing Eric in case he has suggestions that would help import the gnulib module in an easy way.

Signature · 1 line
Eduardo

As we never have leading zeroes, and input comes from QEMU so it's safe, it's probably easier to just open-code it:

/* compare string numerically: shorter strings give smaller numbers */ int mstcmp(const char *s1, const char *s2)

{
	int l1, l2;
Quoted 7 lines
Quoted 5 lines
	l1 = strlen(s1);
	l2 = strlen(s2);
	return l1 == l2 ? strcmp(s1, s2) : l1 - l2;
}

This doesn't work because strlen("pc-0.10") > strlen("pc-1.0").

Oh right. So you need to find dots and split at these points. Something like the below? Completely untested.

int mstcmp(const char *s1, const char *s2)

{
	const char *e1, *e2;

int l1, l2, c;

	do {
		e1 = strchr(s1, '.');
		e2 = strchr(s2, '.');

		l1 = e1 ? e1 - s1 + 1 : strlen(s1);
		l2 = e2 ? e2 - s2 + 1 : strlen(s2);

		/* compare numerically: shorter strings give smaller numbers */
		if (l1 != l2) {
			break;
		}
		c = strncmp(s1, s2, l1);
		if (c) {
Quoted 8 lines
			return c;
		}
		s1 += l1;
		s2 += l1;
	} while (l1);

	return l1 - l2;
}

QEMU already has machine type sorting code:

1 2709f263952b well-defined listing order for machine types 2 562542b6aee2 i386/pc: add piix and q35 machtypes to sorting
families for -M \?

Quoted 6 lines

I guess it should be possible to refine machine_class_cmp() in "vl.c", so that some numeric sorting is applied to machine types in the same "family".

Thanks
Laszlo

Exactly.

#10 lore raw
In reply to Laszlo Ersek
Quoted 125 lines · Laszlo Ersek
Quoted 109 lines · Michael S. Tsirkin
Quoted 79 lines · Eduardo Habkost
Quoted 78 lines · Michael S. Tsirkin
Quoted 57 lines · Eduardo Habkost
Quoted 54 lines · Michael S. Tsirkin
Quoted 44 lines · Eduardo Habkost
Quoted 9 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I suggest changing "-machine help" too. Today it looks like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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)
  pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
Quoted 8 lines
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine
Quoted 1 line

Any chance we can sort them reasonably too?

Quoted 11 lines

If we use strverscmp(), it will be sorted in a more reasonable way. We could copy the gnulib version on systems without glibc. Life is too short for writing configure checks by hand, though; I will add this to the end of my wish-todo list. If somebody wants to volunteer, be my guest.

I'm CCing Eric in case he has suggestions that would help import the gnulib module in an easy way.

Signature · 1 line
Eduardo

As we never have leading zeroes, and input comes from QEMU so it's safe, it's probably easier to just open-code it:

/* compare string numerically: shorter strings give smaller numbers */ int mstcmp(const char *s1, const char *s2)

{
	int l1, l2;
Quoted 7 lines
Quoted 5 lines
	l1 = strlen(s1);
	l2 = strlen(s2);
	return l1 == l2 ? strcmp(s1, s2) : l1 - l2;
}

This doesn't work because strlen("pc-0.10") > strlen("pc-1.0").

Oh right. So you need to find dots and split at these points. Something like the below? Completely untested.

int mstcmp(const char *s1, const char *s2)

{
	const char *e1, *e2;

int l1, l2, c;

	do {
		e1 = strchr(s1, '.');
		e2 = strchr(s2, '.');

		l1 = e1 ? e1 - s1 + 1 : strlen(s1);
		l2 = e2 ? e2 - s2 + 1 : strlen(s2);

		/* compare numerically: shorter strings give smaller numbers */
		if (l1 != l2) {
			break;
		}
		c = strncmp(s1, s2, l1);
		if (c) {
Quoted 8 lines
			return c;
		}
		s1 += l1;
		s2 += l1;
	} while (l1);

	return l1 - l2;
}

QEMU already has machine type sorting code:

1 2709f263952b well-defined listing order for machine types 2 562542b6aee2 i386/pc: add piix and q35 machtypes to sorting
families for -M \?

Quoted 6 lines

I guess it should be possible to refine machine_class_cmp() in "vl.c", so that some numeric sorting is applied to machine types in the same "family".

Thanks
Laszlo

Exactly.

#11 lore raw
In reply to Laszlo Ersek
Quoted 116 lines · Laszlo Ersek
Quoted 115 lines · Michael S. Tsirkin
Quoted 79 lines · Eduardo Habkost
Quoted 78 lines · Michael S. Tsirkin
Quoted 57 lines · Eduardo Habkost
Quoted 54 lines · Michael S. Tsirkin
Quoted 44 lines · Eduardo Habkost
Quoted 9 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I suggest changing "-machine help" too. Today it looks like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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)
  pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
Quoted 8 lines
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine
Quoted 1 line

Any chance we can sort them reasonably too?

Quoted 11 lines

If we use strverscmp(), it will be sorted in a more reasonable way. We could copy the gnulib version on systems without glibc. Life is too short for writing configure checks by hand, though; I will add this to the end of my wish-todo list. If somebody wants to volunteer, be my guest.

I'm CCing Eric in case he has suggestions that would help import the gnulib module in an easy way.

Signature · 1 line
Eduardo

As we never have leading zeroes, and input comes from QEMU so it's safe, it's probably easier to just open-code it:

/* compare string numerically: shorter strings give smaller numbers */ int mstcmp(const char *s1, const char *s2)

{
	int l1, l2;
Quoted 7 lines
Quoted 5 lines
	l1 = strlen(s1);
	l2 = strlen(s2);
	return l1 == l2 ? strcmp(s1, s2) : l1 - l2;
}

This doesn't work because strlen("pc-0.10") > strlen("pc-1.0").

Oh right. So you need to find dots and split at these points. Something like the below? Completely untested.

int mstcmp(const char *s1, const char *s2)

{
	const char *e1, *e2;

int l1, l2, c;

	do {
		e1 = strchr(s1, '.');
		e2 = strchr(s2, '.');

		l1 = e1 ? e1 - s1 + 1 : strlen(s1);
		l2 = e2 ? e2 - s2 + 1 : strlen(s2);

		/* compare numerically: shorter strings give smaller numbers */
		if (l1 != l2) {
			break;
		}
		c = strncmp(s1, s2, l1);
		if (c) {
			return c;
		}
		s1 += l1;
		s2 += l1;
	} while (l1);
Quoted 2 lines
Quoted 2 lines
	return l1 - l2;
}

I believe copying strverscmp() from gnulib as-is is better than reimplementing a subset of it.

Quoted 10 lines

QEMU already has machine type sorting code:

1 2709f263952b well-defined listing order for machine types 2 562542b6aee2 i386/pc: add piix and q35 machtypes to sorting
families for -M \?

I guess it should be possible to refine machine_class_cmp() in "vl.c", so that some numeric sorting is applied to machine types in the same "family".

Yes. My suggestion is to use strverscmp() inside
machine_class_cmp().

Signature · 1 line
Eduardo
#12 lore raw
Quoted 130 lines · Eduardo Habkost
Quoted 116 lines · Laszlo Ersek
Quoted 115 lines · Michael S. Tsirkin
Quoted 79 lines · Eduardo Habkost
Quoted 78 lines · Michael S. Tsirkin
Quoted 57 lines · Eduardo Habkost
Quoted 54 lines · Michael S. Tsirkin
Quoted 44 lines · Eduardo Habkost
Quoted 9 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I suggest changing "-machine help" too. Today it looks like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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)
  pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
Quoted 8 lines
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine
Quoted 1 line

Any chance we can sort them reasonably too?

Quoted 11 lines

If we use strverscmp(), it will be sorted in a more reasonable way. We could copy the gnulib version on systems without glibc. Life is too short for writing configure checks by hand, though; I will add this to the end of my wish-todo list. If somebody wants to volunteer, be my guest.

I'm CCing Eric in case he has suggestions that would help import the gnulib module in an easy way.

Signature · 1 line
Eduardo

As we never have leading zeroes, and input comes from QEMU so it's safe, it's probably easier to just open-code it:

/* compare string numerically: shorter strings give smaller numbers */ int mstcmp(const char *s1, const char *s2)

{
	int l1, l2;
Quoted 7 lines
Quoted 5 lines
	l1 = strlen(s1);
	l2 = strlen(s2);
	return l1 == l2 ? strcmp(s1, s2) : l1 - l2;
}

This doesn't work because strlen("pc-0.10") > strlen("pc-1.0").

Oh right. So you need to find dots and split at these points. Something like the below? Completely untested.

int mstcmp(const char *s1, const char *s2)

{
	const char *e1, *e2;

int l1, l2, c;

	do {
		e1 = strchr(s1, '.');
		e2 = strchr(s2, '.');

		l1 = e1 ? e1 - s1 + 1 : strlen(s1);
		l2 = e2 ? e2 - s2 + 1 : strlen(s2);

		/* compare numerically: shorter strings give smaller numbers */
		if (l1 != l2) {
			break;
		}
		c = strncmp(s1, s2, l1);
		if (c) {
			return c;
		}
		s1 += l1;
		s2 += l1;
	} while (l1);
Quoted 2 lines
Quoted 2 lines
	return l1 - l2;
}

I believe copying strverscmp() from gnulib as-is is better than reimplementing a subset of it.

Quoted 7 lines

QEMU already has machine type sorting code:

1 2709f263952b well-defined listing order for machine types 2 562542b6aee2 i386/pc: add piix and q35 machtypes to sorting
families for -M \?

Quoted 7 lines
Quoted 3 lines

I guess it should be possible to refine machine_class_cmp() in "vl.c", so that some numeric sorting is applied to machine types in the same "family".

Yes. My suggestion is to use strverscmp() inside
machine_class_cmp().

Works for me!
Thanks
Laszlo

#13 lore raw
In reply to Eduardo Habkost
Quoted 27 lines · Eduardo Habkost
Quoted 27 lines
Quoted 27 lines

Oh right. So you need to find dots and split at these points. Something like the below? Completely untested.

int mstcmp(const char *s1, const char *s2)

{
	const char *e1, *e2;

int l1, l2, c;

	do {
		e1 = strchr(s1, '.');
		e2 = strchr(s2, '.');

		l1 = e1 ? e1 - s1 + 1 : strlen(s1);
		l2 = e2 ? e2 - s2 + 1 : strlen(s2);

		/* compare numerically: shorter strings give smaller numbers */
		if (l1 != l2) {
			break;
		}
		c = strncmp(s1, s2, l1);
		if (c) {
			return c;
		}
		s1 += l1;
		s2 += l1;
	} while (l1);
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
	return l1 - l2;
}

I believe copying strverscmp() from gnulib as-is is better than reimplementing a subset of it.

I would then probably copy it unconditionally.

Quoted 3 lines
Signature · 2 lines
-- 
Eduardo
#14 lore raw
Quoted 28 lines · Michael S. Tsirkin
Quoted 27 lines · Eduardo Habkost
Quoted 27 lines
Quoted 27 lines

Oh right. So you need to find dots and split at these points. Something like the below? Completely untested.

int mstcmp(const char *s1, const char *s2)

{
	const char *e1, *e2;

int l1, l2, c;

	do {
		e1 = strchr(s1, '.');
		e2 = strchr(s2, '.');

		l1 = e1 ? e1 - s1 + 1 : strlen(s1);
		l2 = e2 ? e2 - s2 + 1 : strlen(s2);

		/* compare numerically: shorter strings give smaller numbers */
		if (l1 != l2) {
			break;
		}
		c = strncmp(s1, s2, l1);
		if (c) {
			return c;
		}
		s1 += l1;
		s2 += l1;
	} while (l1);
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
	return l1 - l2;
}

I believe copying strverscmp() from gnulib as-is is better than reimplementing a subset of it.

I would then probably copy it unconditionally.

That's probably what I will do. Saving a few bytes in the QEMU binary is probably not worth the extra ./configure cruft.

Signature · 1 line
Eduardo
#15 lore raw
In reply to Eduardo Habkost
Quoted 9 lines · Eduardo Habkost

If we use strverscmp(), it will be sorted in a more reasonable way. We could copy the gnulib version on systems without glibc. Life is too short for writing configure checks by hand, though; I will add this to the end of my wish-todo list. If somebody wants to volunteer, be my guest.

I'm CCing Eric in case he has suggestions that would help import the gnulib module in an easy way.

We don't use autoconf, so we can't directly use gnulib. Copying the files and making sure we provide the configure tests those files depend on (or tweaking the files to simplify to our build system, where we don't have to be quite as portable as gnulib tries to be) is going to be a manual process. But at least the license is compatible (LGPLv2+), and I'll willingly review patches attempted along those lines.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#16 lore raw
In reply to Eduardo Habkost
Quoted 85 lines · Eduardo Habkost
Quoted 9 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I suggest changing "-machine help" too. Today it looks like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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)
  pc-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine

It could be changed to something like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine
Quoted 2 lines

Deprecated machines: pc-1.2, pc-1.1, pc-1.0, pc-0.15, pc-0.14, pc-0.13,

                       pc-0.12, pc-0.11, pc-0.10.

I'd add "(deprecated)" to the existing lines instead. Probably simpler to code, because it's consistent with the existing format.

#17 lore raw
Quoted 1 line · Markus Armbruster

Eduardo Habkost <[email protected]> writes:

[...]

Quoted 31 lines
Quoted 31 lines

It could be changed to something like this:

Supported machines are:

  pc-i440fx-2.9        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.8        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.7        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.6        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.5        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.4        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.3        Standard PC (i440FX + PIIX, 1996)
  pc-i440fx-2.2        Standard PC (i440FX + PIIX, 1996)
  pc                   Standard PC (i440FX + PIIX, 1996) (alias of pc-i440fx-2.10)
  pc-i440fx-2.10       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-q35-2.9           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.8           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.7           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.6           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.5           Standard PC (Q35 + ICH9, 2009)
  pc-q35-2.4           Standard PC (Q35 + ICH9, 2009)
  q35                  Standard PC (Q35 + ICH9, 2009) (alias of pc-q35-2.10)
  pc-q35-2.10          Standard PC (Q35 + ICH9, 2009)
  isapc                ISA-only PC
  none                 empty machine
Quoted 5 lines
Quoted 2 lines

Deprecated machines: pc-1.2, pc-1.1, pc-1.0, pc-0.15, pc-0.14, pc-0.13,

                       pc-0.12, pc-0.11, pc-0.10.

I'd add "(deprecated)" to the existing lines instead. Probably simpler to code, because it's consistent with the existing format.

That would be good enough to me, and probably a one-line patch. My intention was to hide the deprecated machines in a corner, separated from the "Supported machines" list.

Signature · 1 line
Eduardo
#18 lore raw
In reply to Thomas Huth
Quoted 7 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I think we must document & agree on our support policy for machine types, before we start marking them as deprecated. eg please consider the following document before accepting this deprecation patch:

https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg00652.html

Note in that proposal there, I say we do *not* go through trouble of explicitly marking machines as deprecated. We just document upfront the intended lifecycle and then delete them when it is done.

Just use deprecation warnings for things where there is no predictable lifecycle upfront.

Quoted 13 lines

---
Note: Even if we mark all these old machines as deprecated, this ofcourse doesn't mean that we also have to remove them all at once later when we decide to finally really remove some. We could then also start by removing 0.10 and 0.11 only, for example (since there should really be no users left for these), or only up to 0.13 (to be able to kill rombar=0).

v3:
- Use a more generic approach by introducing a "deprecation_msg" in the MachineClass instead.

Quoted 7 lines

v2:
- Deprecate machines up to pc-1.2

 hw/i386/pc_piix.c   | 1 +
 include/hw/boards.h | 1 +
 vl.c                | 4 ++++
 3 files changed, 6 insertions(+)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#19 lore raw
Quoted 13 lines · Daniel P. Berrange
Quoted 7 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I think we must document & agree on our support policy for machine types, before we start marking them as deprecated. eg please consider the following document before accepting this deprecation patch:

Quoted 8 lines

https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg00652.html

Note in that proposal there, I say we do *not* go through trouble of explicitly marking machines as deprecated. We just document upfront the intended lifecycle and then delete them when it is done.

Just use deprecation warnings for things where there is no predictable lifecycle upfront.

I'm still not 100% sure whether that auto-deprecation of machine types is such a good idea ... since we might need to maintain machines in downstream a little bit longer than specified there, it might be better to rather deprecate them manually from time to time.

Anyway, concerning my patch - I'll stop here and won't send another version. There is too much bikeshed painting going on in this area for my taste, and since I'm rather a powerpc / s390x guy, I'm also fine if the pc-0.x machines stay around forever. If somebody else wants to push this topic instead, feel free to do so.

Thomas

#20 lore raw
Quoted 20 lines · Thomas Huth
Quoted 19 lines · Daniel P. Berrange
Quoted 7 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I think we must document & agree on our support policy for machine types, before we start marking them as deprecated. eg please consider the following document before accepting this deprecation patch:

https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg00652.html

Note in that proposal there, I say we do *not* go through trouble of explicitly marking machines as deprecated. We just document upfront the intended lifecycle and then delete them when it is done.

Quoted 7 lines
Quoted 2 lines

Just use deprecation warnings for things where there is no predictable lifecycle upfront.

I'm still not 100% sure whether that auto-deprecation of machine types is such a good idea ... since we might need to maintain machines in downstream a little bit longer than specified there, it might be better to rather deprecate them manually from time to time.

Downstreams usually maintain custom machine types, so fact that the upstream machine types get deleted is not a problem in itself. The problem comes if followup internal code removal then prevents downstream from creating their custom machine type. I don't think we need tie these issues together. We can remove old machine types, without immediately removing features that our harm creation of downstream machine types.

Quoted 5 lines

Anyway, concerning my patch - I'll stop here and won't send another version. There is too much bikeshed painting going on in this area for my taste, and since I'm rather a powerpc / s390x guy, I'm also fine if the pc-0.x machines stay around forever. If somebody else wants to push this topic instead, feel free to do so.

FWIW, I think your proposals have been very useful in general. It has been way overdue to have this kind of discussion. I just want us to focus on defining a policy, rather than making adhoc decisions each time around, as the later is rather unpredictable for users of qemu.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#21 lore raw
Quoted 2 lines · Daniel P. Berrange
Quoted 1 line · Thomas Huth

On 12.07.2017 17:04, Daniel P. Berrange wrote:

[...]

Quoted 18 lines
Quoted 10 lines
Quoted 10 lines

I think we must document & agree on our support policy for machine types, before we start marking them as deprecated. eg please consider the following document before accepting this deprecation patch:

https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg00652.html

Note in that proposal there, I say we do *not* go through trouble of explicitly marking machines as deprecated. We just document upfront the intended lifecycle and then delete them when it is done.

Quoted 7 lines
Quoted 2 lines

Just use deprecation warnings for things where there is no predictable lifecycle upfront.

I'm still not 100% sure whether that auto-deprecation of machine types is such a good idea ... since we might need to maintain machines in downstream a little bit longer than specified there, it might be better to rather deprecate them manually from time to time.

Quoted 4 lines

Downstreams usually maintain custom machine types, so fact that the upstream machine types get deleted is not a problem in itself. The problem comes if followup internal code removal then prevents downstream from creating their custom machine type.

Right, that's what I had in mind.

Quoted 3 lines

I don't think we need tie these
issues together. We can remove old machine types, without immediately removing features that our harm creation of downstream machine types.

I think that won't work. Either the required code gets removed by accident, or if not, we forget to remove it later, once downstream does not require it anymore. I think it is better to remove machine types and the related features code in the upstream code base in one shot. So manually deprecating machine types and carefully removing them later sounds like the better approach to me.

Quoted 4 lines

FWIW, I think your proposals have been very useful in general. It has been way overdue to have this kind of discussion. I just want us to focus on defining a policy, rather than making adhoc decisions each time around, as the later is rather unpredictable for users of qemu.

Well, I think your doc updates are also a very good idea, but we could simply state that we keep the old machine types around for *at least* x releases or y years. That should give users the same safety as when we're declaring that old machine types will definitely be removed after x releases or y years.

Thomas

#22 lore raw
Quoted 45 lines · Thomas Huth
Quoted 2 lines · Daniel P. Berrange
Quoted 1 line · Thomas Huth

On 12.07.2017 17:04, Daniel P. Berrange wrote:

[...]

Quoted 18 lines
Quoted 10 lines
Quoted 10 lines

I think we must document & agree on our support policy for machine types, before we start marking them as deprecated. eg please consider the following document before accepting this deprecation patch:

https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg00652.html

Note in that proposal there, I say we do *not* go through trouble of explicitly marking machines as deprecated. We just document upfront the intended lifecycle and then delete them when it is done.

Quoted 7 lines
Quoted 2 lines

Just use deprecation warnings for things where there is no predictable lifecycle upfront.

I'm still not 100% sure whether that auto-deprecation of machine types is such a good idea ... since we might need to maintain machines in downstream a little bit longer than specified there, it might be better to rather deprecate them manually from time to time.

Quoted 4 lines

Downstreams usually maintain custom machine types, so fact that the upstream machine types get deleted is not a problem in itself. The problem comes if followup internal code removal then prevents downstream from creating their custom machine type.

Right, that's what I had in mind.

Quoted 3 lines

I don't think we need tie these
issues together. We can remove old machine types, without immediately removing features that our harm creation of downstream machine types.

I think that won't work. Either the required code gets removed by accident, or if not, we forget to remove it later, once downstream does not require it anymore. I think it is better to remove machine types and the related features code in the upstream code base in one shot. So manually deprecating machine types and carefully removing them later sounds like the better approach to me.

Quoted 4 lines

FWIW, I think your proposals have been very useful in general. It has been way overdue to have this kind of discussion. I just want us to focus on defining a policy, rather than making adhoc decisions each time around, as the later is rather unpredictable for users of qemu.

Quoted 5 lines

Well, I think your doc updates are also a very good idea, but we could simply state that we keep the old machine types around for *at least* x releases or y years. That should give users the same safety as when we're declaring that old machine types will definitely be removed after x releases or y years.

I really don't like saying "at least", as it means every time we want to actually delete something that we have previously deprecated, we have to have a debate about whether it can actually go and make an arbitrary decision about whether to accept someone's objection to the deletion. Giving a clear finite timeframe sets expectations right from the start, and avoids us playing favourites to particular people who want stuff kept around

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#23 lore raw
In reply to Daniel P. Berrange
Quoted 11 lines · Daniel P. Berrange
Quoted 4 lines

I'm still not 100% sure whether that auto-deprecation of machine types is such a good idea ... since we might need to maintain machines in downstream a little bit longer than specified there, it might be better to rather deprecate them manually from time to time.

Downstreams usually maintain custom machine types, so fact that the upstream machine types get deleted is not a problem in itself. The problem comes if followup internal code removal then prevents downstream from creating their custom machine type. I don't think we need tie these issues together. We can remove old machine types, without immediately removing features that our harm creation of downstream machine types.

I think machine type and feature removal should be tied together.

Doing the opposite leaves around code that is more or less dead from an upstream point of view, and looks like an ad hoc rule for Red Hat. It harms downstreams that do not participate in upstream development (though perhaps this is an intended side effect?).

Paolo

#24 lore raw
Quoted 13 lines · Paolo Bonzini
Quoted 11 lines · Daniel P. Berrange
Quoted 4 lines

I'm still not 100% sure whether that auto-deprecation of machine types is such a good idea ... since we might need to maintain machines in downstream a little bit longer than specified there, it might be better to rather deprecate them manually from time to time.

Downstreams usually maintain custom machine types, so fact that the upstream machine types get deleted is not a problem in itself. The problem comes if followup internal code removal then prevents downstream from creating their custom machine type. I don't think we need tie these issues together. We can remove old machine types, without immediately removing features that our harm creation of downstream machine types.

Quoted 6 lines

I think machine type and feature removal should be tied together.

Doing the opposite leaves around code that is more or less dead from an upstream point of view, and looks like an ad hoc rule for Red Hat. It harms downstreams that do not participate in upstream development (though perhaps this is an intended side effect?).

Yep, I'm amenable to that POV too. It is entirely valid to say that if downstream distros need to care about such ancient back-compat, then they will just have to do the extra work to use git history to undelete any bits they need that upstream has discarded.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#25 lore raw
Quoted 21 lines · Daniel P. Berrange
Quoted 13 lines · Paolo Bonzini
Quoted 11 lines · Daniel P. Berrange
Quoted 4 lines

I'm still not 100% sure whether that auto-deprecation of machine types is such a good idea ... since we might need to maintain machines in downstream a little bit longer than specified there, it might be better to rather deprecate them manually from time to time.

Downstreams usually maintain custom machine types, so fact that the upstream machine types get deleted is not a problem in itself. The problem comes if followup internal code removal then prevents downstream from creating their custom machine type. I don't think we need tie these issues together. We can remove old machine types, without immediately removing features that our harm creation of downstream machine types.

Quoted 6 lines

I think machine type and feature removal should be tied together.

Doing the opposite leaves around code that is more or less dead from an upstream point of view, and looks like an ad hoc rule for Red Hat. It harms downstreams that do not participate in upstream development (though perhaps this is an intended side effect?).

Quoted 4 lines

Yep, I'm amenable to that POV too. It is entirely valid to say that if downstream distros need to care about such ancient back-compat, then they will just have to do the extra work to use git history to undelete any bits they need that upstream has discarded.

If they do this, won't it be better to cooperate and let those bits to be maintained in the upstream tree (as long as somebody is willing to maintain them), instead of being kept in their own downstream fork?

(That doesn't mean we shouldn't have a deprecation policy, but that I would prefer to have the deprecation policy amended if necessary than having a diverging fork maintained by a downstream distro).

Signature · 1 line
Eduardo
#26 lore raw
In reply to Daniel P. Berrange
Quoted 4 lines · Daniel P. Berrange

Yep, I'm amenable to that POV too. It is entirely valid to say that if downstream distros need to care about such ancient back-compat, then they will just have to do the extra work to use git history to undelete any bits they need that upstream has discarded.

Unfortunately people seem to conflate compatibility question of live migration and of booting images.

Live migration is a complex topic, and you always have a work around of restarting the VM to upgrade if it does not work.

But I don't think we can stop supporting booting old images, ever, for all versions that have a decent number of users, until someone develops a tool to upgrade machine type in XML painlessly and safely.

If we can guarantee that changing pc-0.10 to pc-1.13 will keep booting, then we should just alias one to another so people can stil start their VMs. If we can't then we really can't drop old machine types from booting point of view.

Signature · 1 line
MST
#27 lore raw
Quoted 9 lines · Michael S. Tsirkin
Quoted 4 lines · Daniel P. Berrange

Yep, I'm amenable to that POV too. It is entirely valid to say that if downstream distros need to care about such ancient back-compat, then they will just have to do the extra work to use git history to undelete any bits they need that upstream has discarded.

Unfortunately people seem to conflate compatibility question of live migration and of booting images.

Quoted 7 lines

Live migration is a complex topic, and you always have a work around of restarting the VM to upgrade if it does not work.

But I don't think we can stop supporting booting old images, ever, for all versions that have a decent number of users, until someone develops a tool to upgrade machine type in XML painlessly and safely.

I don't agree with this part. It's perfectly valid to remove a feature from a software component if nobody is willing to maintain it.

Quoted 4 lines

If we can guarantee that changing pc-0.10 to pc-1.13 will keep booting, then we should just alias one to another so people can stil start their VMs. If we can't then we really can't drop old machine types from booting point of view.

I don't think we can't guarantee that changing "pc-0.10" to "pc-0.13" will keep working, just like we can't guarantee that "pc-0.10" is still working in QEMU 2.9 the way it did in QEMU 0.10.

We try to not break stuff, but we can't really guarantee anything on either case (keeping the old machine-types; making the old machine-type names aliases; or deleting the old machine-types), if we are not spending efforts testing that. Keeping the old machine-type names (either as real machines or as aliases) just gives us the illusion that we didn't break anything.

Signature · 1 line
Eduardo
#28 lore raw
In reply to Daniel P. Berrange
Quoted 13 lines · Daniel P. Berrange
Quoted 7 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

I think we must document & agree on our support policy for machine types, before we start marking them as deprecated. eg please consider the following document before accepting this deprecation patch:

Quoted 8 lines

https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg00652.html

Note in that proposal there, I say we do *not* go through trouble of explicitly marking machines as deprecated. We just document upfront the intended lifecycle and then delete them when it is done.

Just use deprecation warnings for things where there is no predictable lifecycle upfront.

I'd bet most people won't read the deprecation policy documentation, and a deprecation warning for 1 or 2 releases would be still useful before we finally remove a machine-type.

Signature · 1 line
Eduardo
#29 lore raw
In reply to Thomas Huth
Quoted 8 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

Quoted 7 lines

---
Note: Even if we mark all these old machines as deprecated, this ofcourse doesn't mean that we also have to remove them all at once later when we decide to finally really remove some. We could then also start by removing 0.10 and 0.11 only, for example (since there should really be no users left for these), or only up to 0.13 (to be able to kill rombar=0).

On a tangent: "rombar=0" shouldn't be killed before the libvirt domain XML regains the ability to say, "don't load any oprom for this device". Please see <https://bugzilla.redhat.com/show_bug.cgi?id=1425058>.

(Please note that it is not lost on me that rombar=0 is a poor substitute for romfile='', but currently rombar=0 is the only fallback through libvirt. See the BZ pls.)

Thanks
Laszlo

#30 lore raw
Quoted 21 lines · Laszlo Ersek
Quoted 8 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

Quoted 7 lines

---
Note: Even if we mark all these old machines as deprecated, this ofcourse doesn't mean that we also have to remove them all at once later when we decide to finally really remove some. We could then also start by removing 0.10 and 0.11 only, for example (since there should really be no users left for these), or only up to 0.13 (to be able to kill rombar=0).

On a tangent: "rombar=0" shouldn't be killed before the libvirt domain XML regains the ability to say, "don't load any oprom for this device". Please see <https://bugzilla.redhat.com/show_bug.cgi?id=1425058>.

Quoted 6 lines

(Please note that it is not lost on me that rombar=0 is a poor substitute for romfile='', but currently rombar=0 is the only fallback through libvirt. See the BZ pls.)

Thanks
Laszlo

rombar=0 would start meaning "no ROM", not "no BAR but still add a rom".

#31 lore raw
Quoted 26 lines · Michael S. Tsirkin
Quoted 25 lines · Laszlo Ersek
Quoted 8 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

Quoted 7 lines

---
Note: Even if we mark all these old machines as deprecated, this ofcourse doesn't mean that we also have to remove them all at once later when we decide to finally really remove some. We could then also start by removing 0.10 and 0.11 only, for example (since there should really be no users left for these), or only up to 0.13 (to be able to kill rombar=0).

On a tangent: "rombar=0" shouldn't be killed before the libvirt domain XML regains the ability to say, "don't load any oprom for this device". Please see <https://bugzilla.redhat.com/show_bug.cgi?id=1425058>.

(Please note that it is not lost on me that rombar=0 is a poor substitute for romfile='', but currently rombar=0 is the only fallback through libvirt. See the BZ pls.)

Quoted 6 lines
Quoted 2 lines

Thanks
Laszlo

rombar=0 would start meaning "no ROM", not "no BAR but still add a rom".

Ah! In that case, it would actually obviate RHBZ#1425058.

Thanks,
Laszlo

#32 lore raw
In reply to Thomas Huth
Quoted 8 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

Quoted 7 lines

---
Note: Even if we mark all these old machines as deprecated, this ofcourse doesn't mean that we also have to remove them all at once later when we decide to finally really remove some. We could then also start by removing 0.10 and 0.11 only, for example (since there should really be no users left for these), or only up to 0.13 (to be able to kill rombar=0).

So I generally think the main issue is that machine types are conflating two things. One is saying "I want to be able to migrate from/to QEMU X". Another is saying "I want to look to guests as if I am QEMU X but I restart gurst on the new QEMU".

First is generally a superset of the second, but only a subset of users needs the first. And while there's a very good chance we are actually pretty close to supporting the second even for very old machine types, I doubt we are actually able to migrate to/from these old QEMU versions since it is so hard to test.

So IMHO, a more significant step with a long term impact would be to support splitting these things up.

Quoted 53 lines

v3:
- Use a more generic approach by introducing a "deprecation_msg" in the MachineClass instead.

v2:
- Deprecate machines up to pc-1.2

 hw/i386/pc_piix.c   | 1 +
 include/hw/boards.h | 1 +
 vl.c                | 4 ++++
 3 files changed, 6 insertions(+)
hw/i386/pc_piix.c +1 -0
index 22dbef6..8e70308 100644
@@ -707,6 +707,7 @@ static void pc_i440fx_1_2_machine_options(MachineClass *m)
 {
     pc_i440fx_1_3_machine_options(m);
     m->hw_version = "1.2.0";
+    m->deprecation_msg = "Please use a newer machine type instead.";
     SET_MACHINE_COMPAT(m, PC_COMPAT_1_2);
 }
 
include/hw/boards.h +1 -0
index 76ce021..42a0264 100644
@@ -112,6 +112,7 @@ struct MachineClass {
     char *name;
     const char *alias;
     const char *desc;
+    const char *deprecation_msg;
 
     void (*init)(MachineState *state);
     void (*reset)(void);
vl.c +4 -0
index f7560de..0058d41 100644
@@ -4115,6 +4115,10 @@ int main(int argc, char **argv, char **envp)
     replay_configure(icount_opts);
 
     machine_class = select_machine();
+    if (machine_class->deprecation_msg) {
+        error_report("Machine type '%s' is deprecated. %s",
+                     machine_class->name, machine_class->deprecation_msg);
+    }
 
     set_memory_options(&ram_slots, &maxram_size, machine_class);
 
Signature · 1 line
1.8.3.1
#33 lore raw
Quoted 22 lines · Michael S. Tsirkin
Quoted 8 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

Quoted 7 lines

---
Note: Even if we mark all these old machines as deprecated, this ofcourse doesn't mean that we also have to remove them all at once later when we decide to finally really remove some. We could then also start by removing 0.10 and 0.11 only, for example (since there should really be no users left for these), or only up to 0.13 (to be able to kill rombar=0).

So I generally think the main issue is that machine types are conflating two things. One is saying "I want to be able to migrate from/to QEMU X". Another is saying "I want to look to guests as if I am QEMU X but I restart gurst on the new QEMU".

Quoted 8 lines

First is generally a superset of the second, but only a subset of users needs the first. And while there's a very good chance we are actually pretty close to supporting the second even for very old machine types, I doubt we are actually able to migrate to/from these old QEMU versions since it is so hard to test.

So IMHO, a more significant step with a long term impact would be to support splitting these things up.

I agree they are different things, but do we really have volunteers willing to maintain a machine-type just because of the latter? Setting the same deprecation policy for the two features sounds simpler to me.

Signature · 1 line
Eduardo
#34 lore raw
Quoted 29 lines · Eduardo Habkost
Quoted 28 lines · Michael S. Tsirkin
Quoted 8 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

Quoted 7 lines

---
Note: Even if we mark all these old machines as deprecated, this ofcourse doesn't mean that we also have to remove them all at once later when we decide to finally really remove some. We could then also start by removing 0.10 and 0.11 only, for example (since there should really be no users left for these), or only up to 0.13 (to be able to kill rombar=0).

So I generally think the main issue is that machine types are conflating two things. One is saying "I want to be able to migrate from/to QEMU X". Another is saying "I want to look to guests as if I am QEMU X but I restart gurst on the new QEMU".

First is generally a superset of the second, but only a subset of users needs the first. And while there's a very good chance we are actually pretty close to supporting the second even for very old machine types, I doubt we are actually able to migrate to/from these old QEMU versions since it is so hard to test.

Quoted 7 lines
Quoted 2 lines

So IMHO, a more significant step with a long term impact would be to support splitting these things up.

I agree they are different things, but do we really have volunteers willing to maintain a machine-type just because of the latter? Setting the same deprecation policy for the two features sounds simpler to me.

Removing the former might kind of work just this once on the assumption that we did not have real users back then, but fundamentally users have no safe way to upgrade machine types right now. It's stored in the machine XML at install time and that's it, and reinstalling guests is very painful.

So starting with version X when we did have real users, we really have to maintain the latter literally forever, volunteers or not. Former is another question, it's a simpler work-around to restart guest, so we can limit what we support.

Quoted 2 lines
Signature · 1 line
Eduardo
#35 lore raw
Quoted 38 lines · Michael S. Tsirkin
Quoted 29 lines · Eduardo Habkost
Quoted 28 lines · Michael S. Tsirkin
Quoted 8 lines · Thomas Huth

We don't want to carry along old machine types forever. If we are able to remove the pc machines up to 0.13 one day for example, this would allow us to eventually kill the code for rombar=0 (i.e. where QEMU copies ROM BARs directly to low memory). Everything up to pc-1.2 is also known to have issues with migration. So let's start with a deprecation message for the old machine types so that the (hopefully) few users of these old systems start switching over to newer machine types instead.

Quoted 7 lines

---
Note: Even if we mark all these old machines as deprecated, this ofcourse doesn't mean that we also have to remove them all at once later when we decide to finally really remove some. We could then also start by removing 0.10 and 0.11 only, for example (since there should really be no users left for these), or only up to 0.13 (to be able to kill rombar=0).

So I generally think the main issue is that machine types are conflating two things. One is saying "I want to be able to migrate from/to QEMU X". Another is saying "I want to look to guests as if I am QEMU X but I restart gurst on the new QEMU".

First is generally a superset of the second, but only a subset of users needs the first. And while there's a very good chance we are actually pretty close to supporting the second even for very old machine types, I doubt we are actually able to migrate to/from these old QEMU versions since it is so hard to test.

Quoted 7 lines
Quoted 2 lines

So IMHO, a more significant step with a long term impact would be to support splitting these things up.

I agree they are different things, but do we really have volunteers willing to maintain a machine-type just because of the latter? Setting the same deprecation policy for the two features sounds simpler to me.

Quoted 8 lines

Removing the former might kind of work just this once on the assumption that we did not have real users back then, but fundamentally users have no safe way to upgrade machine types right now. It's stored in the machine XML at install time and that's it, and reinstalling guests is very painful.

So starting with version X when we did have real users, we really have to maintain the latter literally forever, volunteers or not.

Do we? If someone has a VM that depends on a veeery old machine type (and it can not be started with a newer machine type - which is quite unlikely since they are normally very similar), I guess they could also simply use older versions of QEMU for that VM instead.

Thomas

#36 lore raw
In reply to Michael S. Tsirkin

Hi,

Quoted 7 lines

Removing the former might kind of work just this once on the assumption
that we did not have real users back then, but fundamentally users have
no safe way to upgrade machine types right now. It's stored in the machine XML at install time and that's it, and reinstalling guests is very painful.

You can easily change it using "virsh edit $domain", and improving virt-manager to offer some UI for that should be possible too.

cheers,
Gerd