Skip to contentSkip to conversation

hw/i386: Deprecate the machine types pc-0.10 and pc-0.11

PATCH Superseded Thomas Huth 3 participants 5 messages Jun 11, 2018 – Jun 21, 2018

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/i386: Deprecate the machine types pc-0.10 and pc-0.11

The oldest machine type which is still used in a maintained distribution is a pc-0.12 based machine type in RHEL6, so everything that is older than pc-0.12 should not be used anymore. Thus let's deprecate pc-0.10 and pc-0.11 so that we can finally remove them in a future release.

---
This is based on a patch that I already sent in 2017. But back then, we were still in progress of discussing our deprecation policies (e.g. auto- matic deprecation for old machine types), and there was no clear consensus whether we should deprecate 0.10 - 0.11, all 0.x or even up to version 1.2. After some iterations and too much discussion, I've forgotten about this patch. Anyway, I think we agreed that at least 0.10 and 0.11 can certainly be removed nowadays, so let's finally get at least those two machine types marked as deprecated! If that works fine and we will finally have removed these two types in v3.2, we can resume the discussion about newer machine types afterwards.

 hw/i386/pc_piix.c   | 2 ++
 include/hw/boards.h | 1 +
 qemu-doc.texi       | 5 +++++
 vl.c                | 9 +++++++--
 4 files changed, 15 insertions(+), 2 deletions(-)
hw/i386/pc_piix.c +2 -0
index 3d81136..fa61dc3 100644
@@ -955,6 +955,8 @@ static void pc_i440fx_0_11_machine_options(MachineClass *m)
 {
     pc_i440fx_0_12_machine_options(m);
     m->hw_version = "0.11";
+    m->deprecation_msg = "Old and unsupported machine version, "
+                         "use a newer machine type instead.";
     SET_MACHINE_COMPAT(m, PC_COMPAT_0_11);
 }
 
include/hw/boards.h +1 -0
index ef7457f..e1bd25f 100644
@@ -166,6 +166,7 @@ struct MachineClass {
     char *name;
     const char *alias;
     const char *desc;
+    const char *deprecation_msg;
 
     void (*init)(MachineState *state);
     void (*reset)(void);
qemu-doc.texi +5 -0
index 2effe66..2a597d6 100644
@@ -2965,6 +2965,11 @@ support page sizes < 4096 any longer.
 
 @section System emulator machines
 
+@subsection pc-0.10 and pc-0.11 (since 3.0)
+
+These machine types are very old and likely can not be used for life-migration
+from old QEMU versions anymore. A newer machine type should be used instead.
+
 @section Block device options
 
 @subsection "backing": "" (since 2.12.0)
vl.c +7 -2
index 0603171..096814c 100644
@@ -2560,8 +2560,9 @@ static gint machine_class_cmp(gconstpointer a, gconstpointer b)
             if (mc->alias) {
                 printf("%-20s %s (alias of %s)\n", mc->alias, mc->desc, mc->name);
             }
-            printf("%-20s %s%s\n", mc->name, mc->desc,
-                   mc->is_default ? " (default)" : "");
+            printf("%-20s %s%s%s\n", mc->name, mc->desc,
+                   mc->is_default ? " (default)" : "",
+                   mc->deprecation_msg ? " (deprecated)" : "");
         }
     }
 
@@ -3952,6 +3953,10 @@ int main(int argc, char **argv, char **envp)
     }
 
     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
#1 lore raw
Quoted 6 lines · Thomas Huth

The oldest machine type which is still used in a maintained distribution is a pc-0.12 based machine type in RHEL6, so everything that is older than pc-0.12 should not be used anymore. Thus let's deprecate pc-0.10 and pc-0.11 so that we can finally remove them in a future release.

Quoted 11 lines

---
This is based on a patch that I already sent in 2017. But back then, we were still in progress of discussing our deprecation policies (e.g. auto- matic deprecation for old machine types), and there was no clear consensus whether we should deprecate 0.10 - 0.11, all 0.x or even up to version 1.2. After some iterations and too much discussion, I've forgotten about this patch. Anyway, I think we agreed that at least 0.10 and 0.11 can certainly be removed nowadays, so let's finally get at least those two machine types marked as deprecated! If that works fine and we will finally have removed these two types in v3.2, we can resume the discussion about newer machine types afterwards.

Thanks!

Quoted 12 lines
 
 hw/i386/pc_piix.c   | 2 ++
 include/hw/boards.h | 1 +
 qemu-doc.texi       | 5 +++++
 vl.c                | 9 +++++++--
 4 files changed, 15 insertions(+), 2 deletions(-)
hw/i386/pc_piix.c +0 -0
index 3d81136..fa61dc3 100644

hw/i386/pc_piix.c static void pc_i440fx_0_11_machine_options(MachineClass *m) · line 959

Quoted 5 lines
hw/i386/pc_piix.c +2 -0
@@ -955,6 +955,8 @@ static void pc_i440fx_0_11_machine_options(MachineClass *m)
 {
     pc_i440fx_0_12_machine_options(m);
     m->hw_version = "0.11";
+    m->deprecation_msg = "Old and unsupported machine version, "
+                         "use a newer machine type instead.";

Sounds simple enough to me, but see comment about QMP below.

include/hw/boards.h struct MachineClass { · line 169

Quoted 12 lines
hw/i386/pc_piix.c +0 -0
     SET_MACHINE_COMPAT(m, PC_COMPAT_0_11);
 }
 
include/hw/boards.h +1 -0
index ef7457f..e1bd25f 100644
@@ -166,6 +166,7 @@ struct MachineClass {
     char *name;
     const char *alias;
     const char *desc;
+    const char *deprecation_msg;

Let's document guidelines for deprecation_msg to avoid the inconsistencies we saw in previous proposals?

Quoted 8 lines
include/hw/boards.h +0 -0
     void (*init)(MachineState *state);
     void (*reset)(void);
qemu-doc.texi +0 -0
index 2effe66..2a597d6 100644

qemu-doc.texi support page sizes < 4096 any longer. · line 2970

Quoted 6 lines
qemu-doc.texi +3 -0
@@ -2965,6 +2965,11 @@ support page sizes < 4096 any longer.
 
 @section System emulator machines
 
+@subsection pc-0.10 and pc-0.11 (since 3.0)
+
+These machine types are very old and likely can not be used for life-migration
                                                                   ^^^^

"live"

I never know if the right way to spell it is "live-migration" or "live migration".

Quoted 22 lines
qemu-doc.texi +2 -0
+from old QEMU versions anymore. A newer machine type should be used instead.
+
 @section Block device options
 
 @subsection "backing": "" (since 2.12.0)
vl.c +3 -2
index 0603171..096814c 100644
@@ -2560,8 +2560,9 @@ static gint machine_class_cmp(gconstpointer a, gconstpointer b)
             if (mc->alias) {
                 printf("%-20s %s (alias of %s)\n", mc->alias, mc->desc, mc->name);
             }
-            printf("%-20s %s%s\n", mc->name, mc->desc,
-                   mc->is_default ? " (default)" : "");
+            printf("%-20s %s%s%s\n", mc->name, mc->desc,
+                   mc->is_default ? " (default)" : "",
+                   mc->deprecation_msg ? " (deprecated)" : "");
         }
     }
 

vl.c int main(int argc, char **argv, char **envp) · line 3959

Quoted 7 lines
vl.c +4 -0
@@ -3952,6 +3953,10 @@ int main(int argc, char **argv, char **envp)
     }
 
     machine_class = select_machine();
+    if (machine_class->deprecation_msg) {
+        error_report("Machine type '%s' is deprecated: %s",
+                     machine_class->name, machine_class->deprecation_msg);
+    }

Do you plan to add this info to 'query-machines' QMP command?

If we do that, maybe we should represent the common "this machine type is too old, but there's a new version" case in a more machine-friendly way? Maybe a 'deprecation_reason' enum would be better than a 'deprecation_msg' field?

(Note that I don't think any discussions about the QMP interface should block this patch from being merged. We can deprecate the machines first, and decide about QMP later.)

Quoted 6 lines
vl.c +0 -0
     set_memory_options(&ram_slots, &maxram_size, machine_class);
 
Signature · 1 line
1.8.3.1
Signature · 1 line
Eduardo
#2 lore raw
Quoted 5 lines · Eduardo Habkost
Quoted 4 lines · Thomas Huth

The oldest machine type which is still used in a maintained distribution is a pc-0.12 based machine type in RHEL6, so everything that is older than pc-0.12 should not be used anymore. Thus let's deprecate pc-0.10 and pc-0.11 so that we can finally remove them in a future release.

[...]

Quoted 10 lines

vl.c int main(int argc, char **argv, char **envp) · line 3959

Quoted 8 lines
vl.c +4 -0
@@ -3952,6 +3953,10 @@ int main(int argc, char **argv, char **envp)
     }
 
     machine_class = select_machine();
+    if (machine_class->deprecation_msg) {
+        error_report("Machine type '%s' is deprecated: %s",
+                     machine_class->name, machine_class->deprecation_msg);
+    }

Do you plan to add this info to 'query-machines' QMP command?

No, I'm not planning to add this. We'd need a request from upper layers (i.e. libvirt) for this first, otherwise it's just a dead interface that nobody is using.

Thomas

#3 lore raw

(CCing Markus and libvir-list)

Quoted 18 lines · Thomas Huth
Quoted 5 lines · Eduardo Habkost
Quoted 4 lines · Thomas Huth

The oldest machine type which is still used in a maintained distribution is a pc-0.12 based machine type in RHEL6, so everything that is older than pc-0.12 should not be used anymore. Thus let's deprecate pc-0.10 and pc-0.11 so that we can finally remove them in a future release.

[...]

Quoted 10 lines

vl.c int main(int argc, char **argv, char **envp) · line 3959

Quoted 8 lines
vl.c +4 -0
@@ -3952,6 +3953,10 @@ int main(int argc, char **argv, char **envp)
     }
 
     machine_class = select_machine();
+    if (machine_class->deprecation_msg) {
+        error_report("Machine type '%s' is deprecated: %s",
+                     machine_class->name, machine_class->deprecation_msg);
+    }

Do you plan to add this info to 'query-machines' QMP command?

Quoted 3 lines

No, I'm not planning to add this. We'd need a request from upper layers (i.e. libvirt) for this first, otherwise it's just a dead interface that nobody is using.

I believe that useful information being available only through stderr is at least as bad as being available only through HMP. Should we extend QMP more proactively in cases like this, too?

(In either case, I don't think this should block your series)

Signature · 1 line
Eduardo
#4 lore raw
In reply to Eduardo Habkost
Quoted 46 lines · Eduardo Habkost
Quoted 6 lines · Thomas Huth

The oldest machine type which is still used in a maintained distribution is a pc-0.12 based machine type in RHEL6, so everything that is older than pc-0.12 should not be used anymore. Thus let's deprecate pc-0.10 and pc-0.11 so that we can finally remove them in a future release.

Quoted 11 lines

---
This is based on a patch that I already sent in 2017. But back then, we were still in progress of discussing our deprecation policies (e.g. auto- matic deprecation for old machine types), and there was no clear consensus whether we should deprecate 0.10 - 0.11, all 0.x or even up to version 1.2. After some iterations and too much discussion, I've forgotten about this patch. Anyway, I think we agreed that at least 0.10 and 0.11 can certainly be removed nowadays, so let's finally get at least those two machine types marked as deprecated! If that works fine and we will finally have removed these two types in v3.2, we can resume the discussion about newer machine types afterwards.

Thanks!

Quoted 12 lines
 
 hw/i386/pc_piix.c   | 2 ++
 include/hw/boards.h | 1 +
 qemu-doc.texi       | 5 +++++
 vl.c                | 9 +++++++--
 4 files changed, 15 insertions(+), 2 deletions(-)
hw/i386/pc_piix.c +0 -0
index 3d81136..fa61dc3 100644

hw/i386/pc_piix.c static void pc_i440fx_0_11_machine_options(MachineClass *m) · line 959

Quoted 5 lines
hw/i386/pc_piix.c +2 -0
@@ -955,6 +955,8 @@ static void pc_i440fx_0_11_machine_options(MachineClass *m)
 {
     pc_i440fx_0_12_machine_options(m);
     m->hw_version = "0.11";
+    m->deprecation_msg = "Old and unsupported machine version, "
+                         "use a newer machine type instead.";

Sounds simple enough to me, but see comment about QMP below.

Quoted 3 lines
hw/i386/pc_piix.c +0 -0
     SET_MACHINE_COMPAT(m, PC_COMPAT_0_11);
 }
 

[...]

Quoted 27 lines
Quoted 17 lines
vl.c +3 -2
index 0603171..096814c 100644
@@ -2560,8 +2560,9 @@ static gint machine_class_cmp(gconstpointer a, gconstpointer b)
             if (mc->alias) {
                 printf("%-20s %s (alias of %s)\n", mc->alias, mc->desc, mc->name);
             }
-            printf("%-20s %s%s\n", mc->name, mc->desc,
-                   mc->is_default ? " (default)" : "");
+            printf("%-20s %s%s%s\n", mc->name, mc->desc,
+                   mc->is_default ? " (default)" : "",
+                   mc->deprecation_msg ? " (deprecated)" : "");
         }
     }
 

vl.c int main(int argc, char **argv, char **envp) · line 3959

Quoted 7 lines
vl.c +4 -0
@@ -3952,6 +3953,10 @@ int main(int argc, char **argv, char **envp)
     }
 
     machine_class = select_machine();
+    if (machine_class->deprecation_msg) {
+        error_report("Machine type '%s' is deprecated: %s",
+                     machine_class->name, machine_class->deprecation_msg);
+    }

Do you plan to add this info to 'query-machines' QMP command?

Quoted 4 lines

If we do that, maybe we should represent the common "this machine type is too old, but there's a new version" case in a more machine-friendly way? Maybe a 'deprecation_reason' enum would be better than a 'deprecation_msg' field?

QMP needs a generic mechanism to communicate "FOO is deprecated, use BAR instead".

Quoted 3 lines

(Note that I don't think any discussions about the QMP interface should block this patch from being merged. We can deprecate the machines first, and decide about QMP later.)

Yes.

Quoted 6 lines
Quoted 6 lines
vl.c +0 -0
     set_memory_options(&ram_slots, &maxram_size, machine_class);
 
Signature · 1 line
1.8.3.1