Skip to contentSkip to conversation

smbios nicer defaults for DMI type 1 (System)

PATCH In review [email protected] 4 participants 25 messages Oct 30, 2013 – Nov 4, 2013

lore
Share & tools
lore
#0 lore raw

v3 cover smbios nicer defaults for DMI type 1 (System)

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

This series used to be called "[PATCH v2 0/7] smbios cleanup & nicer defaults for type 1", but its cleanup parts [0-5/7] already went in.

Andreas didn't like "[PATCH v2 6/7] vl: Set current_machine early", and suggested to put he machine into QEMUMachineInitArgs. PATCH 1/2 does exactly that, replacing v2's PATCH 6/7. PATCH 2/2 is v2's PATCH 7/7 rebased on top.

Michael didn't like the way I suppress the nicer defaults for old machine types via static bool smbios_type1_defaults, and thought it would be nicer to have it in QEMUMachine or some device. I considered this, but decided to stick to smbios_type1_defaults, because

1. There is no suitable device.
2. I'd rather not extend QEMUMachine with target-specific stuff.
3. A static bool whose default value gets flipped by some QEMUMachine init() methods is what we commonly do in such cases, so let's stick to that.

v3: Do it the way Andreas suggested
v2: Rebase, only last patch had conflicts

Markus Armbruster (2):
hw: Pass QEMUMachine to its init() method
smbios: Set system manufacturer, product & version by default

 hw/i386/pc_piix.c        |  9 +++++++++
 hw/i386/pc_q35.c         |  7 +++++++
 hw/i386/smbios.c         | 14 ++++++++++++++
 include/hw/boards.h      |  7 +++++--
 include/hw/i386/smbios.h |  2 ++
 vl.c                     |  3 ++-
 6 files changed, 39 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.1.4
#5 lore raw

PATCH v3 2/2 smbios: Set system manufacturer, product & version by default

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Take care to do this only for new machine types, of course.

---
 hw/i386/pc_piix.c        |  9 +++++++++
 hw/i386/pc_q35.c         |  7 +++++++
 hw/i386/smbios.c         | 14 ++++++++++++++
 include/hw/i386/smbios.h |  2 ++
 4 files changed, 32 insertions(+)
hw/i386/pc_piix.c +9 -0
index c6042c7..417ad33 100644
@@ -28,6 +28,7 @@
 #include "hw/loader.h"
 #include "hw/i386/pc.h"
 #include "hw/i386/apic.h"
+#include "hw/i386/smbios.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_ids.h"
 #include "hw/usb.h"
@@ -59,6 +60,7 @@ static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
 
 static bool has_pvpanic;
 static bool has_pci_info = true;
+static bool smbios_type1_defaults = true;
 
 /* PC hardware initialisation */
 static void pc_init1(QEMUMachineInitArgs *args,
@@ -124,6 +126,10 @@ static void pc_init1(QEMUMachineInitArgs *args,
     guest_info = pc_guest_info_init(below_4g_mem_size, above_4g_mem_size);
     guest_info->has_pci_info = has_pci_info;
     guest_info->isapc_ram_fw = !pci_enabled;
+    if (smbios_type1_defaults) {
+        smbios_set_type1_defaults("QEMU", args->machine->desc,
+                                  args->machine->name);
+    }
 
     /* allocate ram and load rom/bios */
     if (!xen_enabled()) {
@@ -240,6 +246,7 @@ static void pc_compat_1_6(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
     rom_file_in_ram = false;
+    smbios_type1_defaults = false;
 }
 
 static void pc_compat_1_5(QEMUMachineInitArgs *args)
@@ -304,6 +311,7 @@ static void pc_init_pci_1_2(QEMUMachineInitArgs *args)
 static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
+    smbios_type1_defaults = false;
     disable_kvm_pv_eoi();
     enable_compat_apic_id_mode();
     pc_init1(args, 1, 0);
@@ -312,6 +320,7 @@ static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
 static void pc_init_isa(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
+    smbios_type1_defaults = false;
     if (!args->cpu_model) {
         args->cpu_model = "486";
     }
hw/i386/pc_q35.c +7 -0
index ca84e1c..9e3213f 100644
@@ -39,6 +39,7 @@
 #include "hw/pci-host/q35.h"
 #include "exec/address-spaces.h"
 #include "hw/i386/ich9.h"
+#include "hw/i386/smbios.h"
 #include "hw/ide/pci.h"
 #include "hw/ide/ahci.h"
 #include "hw/usb.h"
@@ -49,6 +50,7 @@
 
 static bool has_pvpanic;
 static bool has_pci_info = true;
+static bool smbios_type1_defaults = true;
 
 /* PC hardware initialisation */
 static void pc_q35_init(QEMUMachineInitArgs *args)
@@ -111,6 +113,10 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
     guest_info = pc_guest_info_init(below_4g_mem_size, above_4g_mem_size);
     guest_info->has_pci_info = has_pci_info;
     guest_info->isapc_ram_fw = false;
+    if (smbios_type1_defaults) {
+        smbios_set_type1_defaults("QEMU", args->machine->desc,
+                                  args->machine->name);
+    }
 
     /* allocate ram and load rom/bios */
     if (!xen_enabled()) {
@@ -224,6 +230,7 @@ static void pc_compat_1_6(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
     rom_file_in_ram = false;
+    smbios_type1_defaults = false;
 }
 
 static void pc_compat_1_5(QEMUMachineInitArgs *args)
hw/i386/smbios.c +14 -0
index d3f1ee6..e8f41ad 100644
@@ -256,6 +256,20 @@ static void smbios_build_type_1_fields(void)
     }
 }
 
+void smbios_set_type1_defaults(const char *manufacturer,
+                               const char *product, const char *version)
+{
+    if (!type1.manufacturer) {
+        type1.manufacturer = manufacturer;
+    }
+    if (!type1.product) {
+        type1.product = product;
+    }
+    if (!type1.version) {
+        type1.version = version;
+    }
+}
+
 uint8_t *smbios_get_table(size_t *length)
 {
     if (!smbios_immutable) {
include/hw/i386/smbios.h +2 -0
index b08ec71..18fb970 100644
@@ -16,6 +16,8 @@
 #include "qemu/option.h"
 
 void smbios_entry_add(QemuOpts *opts);
+void smbios_set_type1_defaults(const char *manufacturer,
+                               const char *product, const char *version);
 uint8_t *smbios_get_table(size_t *length);
 
 /*
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH v3 1/2 hw: Pass QEMUMachine to its init() method

In reply to [email protected]

From: Markus Armbruster <[email protected]>

Put it in QEMUMachineInitArgs, so I don't have to touch every board.

---
 include/hw/boards.h | 7 +++++--
 vl.c                | 3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)
include/hw/boards.h +5 -2
index 5a7ae9f..2151460 100644
@@ -6,7 +6,10 @@
 #include "sysemu/blockdev.h"
 #include "hw/qdev.h"
 
+typedef struct QEMUMachine QEMUMachine;
+
 typedef struct QEMUMachineInitArgs {
+    const QEMUMachine *machine;
     ram_addr_t ram_size;
     const char *boot_order;
     const char *kernel_filename;
@@ -21,7 +24,7 @@ typedef void QEMUMachineResetFunc(void);
 
 typedef void QEMUMachineHotAddCPUFunc(const int64_t id, Error **errp);
 
-typedef struct QEMUMachine {
+struct QEMUMachine {
     const char *name;
     const char *alias;
     const char *desc;
@@ -43,7 +46,7 @@ typedef struct QEMUMachine {
     GlobalProperty *compat_props;
     struct QEMUMachine *next;
     const char *hw_version;
-} QEMUMachine;
+};
 
 int qemu_register_machine(QEMUMachine *m);
 QEMUMachine *find_default_machine(void);
vl.c +2 -1
index b42ac67..63338e4 100644
@@ -4236,7 +4236,8 @@ int main(int argc, char **argv, char **envp)
 
     qdev_machine_init();
 
-    QEMUMachineInitArgs args = { .ram_size = ram_size,
+    QEMUMachineInitArgs args = { .machine = machine,
+                                 .ram_size = ram_size,
                                  .boot_order = boot_order,
                                  .kernel_filename = kernel_filename,
                                  .kernel_cmdline = kernel_cmdline,
Signature · 1 line
1.8.1.4
Reviewed-by on v3 2/2
#6 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] smbios: Set system manufacturer, product & version by default

In reply to [email protected]
Quoted 10 lines · On Wed, Oct 30, 2013 at 01:56:40PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Take care to do this only for new machine types, of course.

Signature · 1 line
Eduardo
Reviewed-by on v3 1/2
#3 lore raw

Re: [Qemu-devel] [PATCH v3 1/2] hw: Pass QEMUMachine to its init() method

In reply to [email protected]

Am 30.10.2013 13:56, schrieb [email protected]:

Quoted 5 lines

From: Markus Armbruster <[email protected]>

Put it in QEMUMachineInitArgs, so I don't have to touch every board.

Andreas

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#7 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] smbios: Set system manufacturer, product & version by default

In reply to [email protected]
Quoted 10 lines · On Wed, Oct 30, 2013 at 01:56:40PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Take care to do this only for new machine types, of course.

I feel applying this one would be a mistake.

Machine desc is for human readers.
For example, it currently says "Standard PC (Q35 + ICH9, 2009)" but if we add a variant with IDE compatibility mode we will likely want to tweak it to say "Standard PC (Q35 + ICH9/AHCI mode, 2009)"
and add another one saying ""Standard PC (Q35 + ICH9/compat mode, 2009)".

In other words we want the ability to tweak description retroactively, and exposing it to guest will break this ability.

So we really need a new field not tied to the human description.

Quoted 141 lines
---
 hw/i386/pc_piix.c        |  9 +++++++++
 hw/i386/pc_q35.c         |  7 +++++++
 hw/i386/smbios.c         | 14 ++++++++++++++
 include/hw/i386/smbios.h |  2 ++
 4 files changed, 32 insertions(+)
hw/i386/pc_piix.c +9 -0
index c6042c7..417ad33 100644
@@ -28,6 +28,7 @@
 #include "hw/loader.h"
 #include "hw/i386/pc.h"
 #include "hw/i386/apic.h"
+#include "hw/i386/smbios.h"
 #include "hw/pci/pci.h"
 #include "hw/pci/pci_ids.h"
 #include "hw/usb.h"
@@ -59,6 +60,7 @@ static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
 
 static bool has_pvpanic;
 static bool has_pci_info = true;
+static bool smbios_type1_defaults = true;
 
 /* PC hardware initialisation */
 static void pc_init1(QEMUMachineInitArgs *args,
@@ -124,6 +126,10 @@ static void pc_init1(QEMUMachineInitArgs *args,
     guest_info = pc_guest_info_init(below_4g_mem_size, above_4g_mem_size);
     guest_info->has_pci_info = has_pci_info;
     guest_info->isapc_ram_fw = !pci_enabled;
+    if (smbios_type1_defaults) {
+        smbios_set_type1_defaults("QEMU", args->machine->desc,
+                                  args->machine->name);
+    }
 
     /* allocate ram and load rom/bios */
     if (!xen_enabled()) {
@@ -240,6 +246,7 @@ static void pc_compat_1_6(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
     rom_file_in_ram = false;
+    smbios_type1_defaults = false;
 }
 
 static void pc_compat_1_5(QEMUMachineInitArgs *args)
@@ -304,6 +311,7 @@ static void pc_init_pci_1_2(QEMUMachineInitArgs *args)
 static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
+    smbios_type1_defaults = false;
     disable_kvm_pv_eoi();
     enable_compat_apic_id_mode();
     pc_init1(args, 1, 0);
@@ -312,6 +320,7 @@ static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
 static void pc_init_isa(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
+    smbios_type1_defaults = false;
     if (!args->cpu_model) {
         args->cpu_model = "486";
     }
hw/i386/pc_q35.c +7 -0
index ca84e1c..9e3213f 100644
@@ -39,6 +39,7 @@
 #include "hw/pci-host/q35.h"
 #include "exec/address-spaces.h"
 #include "hw/i386/ich9.h"
+#include "hw/i386/smbios.h"
 #include "hw/ide/pci.h"
 #include "hw/ide/ahci.h"
 #include "hw/usb.h"
@@ -49,6 +50,7 @@
 
 static bool has_pvpanic;
 static bool has_pci_info = true;
+static bool smbios_type1_defaults = true;
 
 /* PC hardware initialisation */
 static void pc_q35_init(QEMUMachineInitArgs *args)
@@ -111,6 +113,10 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
     guest_info = pc_guest_info_init(below_4g_mem_size, above_4g_mem_size);
     guest_info->has_pci_info = has_pci_info;
     guest_info->isapc_ram_fw = false;
+    if (smbios_type1_defaults) {
+        smbios_set_type1_defaults("QEMU", args->machine->desc,
+                                  args->machine->name);
+    }
 
     /* allocate ram and load rom/bios */
     if (!xen_enabled()) {
@@ -224,6 +230,7 @@ static void pc_compat_1_6(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
     rom_file_in_ram = false;
+    smbios_type1_defaults = false;
 }
 
 static void pc_compat_1_5(QEMUMachineInitArgs *args)
hw/i386/smbios.c +14 -0
index d3f1ee6..e8f41ad 100644
@@ -256,6 +256,20 @@ static void smbios_build_type_1_fields(void)
     }
 }
 
+void smbios_set_type1_defaults(const char *manufacturer,
+                               const char *product, const char *version)
+{
+    if (!type1.manufacturer) {
+        type1.manufacturer = manufacturer;
+    }
+    if (!type1.product) {
+        type1.product = product;
+    }
+    if (!type1.version) {
+        type1.version = version;
+    }
+}
+
 uint8_t *smbios_get_table(size_t *length)
 {
     if (!smbios_immutable) {
include/hw/i386/smbios.h +2 -0
index b08ec71..18fb970 100644
@@ -16,6 +16,8 @@
 #include "qemu/option.h"
 
 void smbios_entry_add(QemuOpts *opts);
+void smbios_set_type1_defaults(const char *manufacturer,
+                               const char *product, const char *version);
 uint8_t *smbios_get_table(size_t *length);
 
 /*
Signature · 1 line
1.8.1.4
#20 lore raw
In reply to [email protected]
Quoted 20 lines · On Wed, Oct 30, 2013 at 01:56:38PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

This series used to be called "[PATCH v2 0/7] smbios cleanup & nicer defaults for type 1", but its cleanup parts [0-5/7] already went in.

Andreas didn't like "[PATCH v2 6/7] vl: Set current_machine early", and suggested to put he machine into QEMUMachineInitArgs. PATCH 1/2 does exactly that, replacing v2's PATCH 6/7. PATCH 2/2 is v2's PATCH 7/7 rebased on top.

Michael didn't like the way I suppress the nicer defaults for old machine types via static bool smbios_type1_defaults, and thought it would be nicer to have it in QEMUMachine or some device. I considered this, but decided to stick to smbios_type1_defaults, because

Quoted 5 lines

1. There is no suitable device.
2. I'd rather not extend QEMUMachine with target-specific stuff.
3. A static bool whose default value gets flipped by some QEMUMachine init() methods is what we commonly do in such cases, so let's stick to that.

Sorry, it seems I wasn't clear. What worries me is not how we supply the defaults, it's the fact that we expose human interface to guests. I tried to explain this better responding to the correct thread.

Quoted 17 lines

v3: Do it the way Andreas suggested
v2: Rebase, only last patch had conflicts

Markus Armbruster (2):
hw: Pass QEMUMachine to its init() method
smbios: Set system manufacturer, product & version by default

 hw/i386/pc_piix.c        |  9 +++++++++
 hw/i386/pc_q35.c         |  7 +++++++
 hw/i386/smbios.c         | 14 ++++++++++++++
 include/hw/boards.h      |  7 +++++--
 include/hw/i386/smbios.h |  2 ++
 vl.c                     |  3 ++-
 6 files changed, 39 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.1.4
#8 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] smbios: Set system manufacturer, product & version by default

In reply to Michael S. Tsirkin
Quoted 21 lines · Michael S. Tsirkin
Quoted 10 lines · On Wed, Oct 30, 2013 at 01:56:40PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Take care to do this only for new machine types, of course.

I feel applying this one would be a mistake.

Machine desc is for human readers.
For example, it currently says "Standard PC (Q35 + ICH9, 2009)" but if we add a variant with IDE compatibility mode we will likely want to tweak it to say "Standard PC (Q35 + ICH9/AHCI mode, 2009)"
and add another one saying ""Standard PC (Q35 + ICH9/compat mode, 2009)".

Quoted 6 lines

In other words we want the ability to tweak description retroactively, and exposing it to guest will break this ability.

So we really need a new field not tied to the human description.

You have a point, but if we do that one day, then we can add a new smbios-specific field and set it for each of the existing machine-types so they keep the same ABI. This patch doesn't make us unable to do that in the future.

As we are past hard freeze, I think this simple patch is better than a more complex solution for a problem we still don't have (that can still be implemented in 1.8).

Signature · 1 line
Eduardo
#9 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] smbios: Set system manufacturer, product & version by default

Quoted 26 lines · Eduardo Habkost
Quoted 25 lines · Michael S. Tsirkin
Quoted 10 lines · On Wed, Oct 30, 2013 at 01:56:40PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Take care to do this only for new machine types, of course.

I feel applying this one would be a mistake.

Machine desc is for human readers.
For example, it currently says "Standard PC (Q35 + ICH9, 2009)" but if we add a variant with IDE compatibility mode we will likely want to tweak it to say "Standard PC (Q35 + ICH9/AHCI mode, 2009)"
and add another one saying ""Standard PC (Q35 + ICH9/compat mode, 2009)".

In other words we want the ability to tweak description retroactively, and exposing it to guest will break this ability.

Quoted 7 lines
Quoted 2 lines

So we really need a new field not tied to the human description.

You have a point, but if we do that one day, then we can add a new smbios-specific field and set it for each of the existing machine-types so they keep the same ABI. This patch doesn't make us unable to do that in the future.

We'll likely forget and just break guest ABI.
So we really need a unit test for this, too.

Quoted 3 lines

As we are past hard freeze, I think this simple patch is better than a more complex solution for a problem we still don't have (that can still be implemented in 1.8).

I don't see why we need to rush this into 1.7. Downstreams want their info in smbios for support, branding etc, but I don't see a burning need for this in upstream QEMU. It's kind of nice to have it say "QEMU", but we can afford to delay and do it properly for 1.8.

Quoted 2 lines
Signature · 1 line
Eduardo
#16 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] smbios: Set system manufacturer, product & version by default

In reply to Michael S. Tsirkin
Quoted 21 lines · Michael S. Tsirkin
Quoted 10 lines · On Wed, Oct 30, 2013 at 01:56:40PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Take care to do this only for new machine types, of course.

I feel applying this one would be a mistake.

Machine desc is for human readers.
For example, it currently says "Standard PC (Q35 + ICH9, 2009)" but if we add a variant with IDE compatibility mode we will likely want to tweak it to say "Standard PC (Q35 + ICH9/AHCI mode, 2009)"
and add another one saying ""Standard PC (Q35 + ICH9/compat mode, 2009)".

Quoted 3 lines

In other words we want the ability to tweak description retroactively, and exposing it to guest will break this ability.

These will be new machine types, won't they?

Quoted 1 line

So we really need a new field not tied to the human description.

The SMBIOS string is *also* for human readers.

I can't see why we should jump through hoops *now* to separate the two. The values are the same. I don't expect us to change them for old machine types. But if we ever feel the need to change them in one place but not the other, nothing will prevent us from splitting them up then.

Pay as you go, not pay as you fear you might have to go some day.

#10 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] smbios: Set system manufacturer, product & version by default

In reply to Michael S. Tsirkin
Quoted 30 lines · Michael S. Tsirkin
Quoted 29 lines · Eduardo Habkost
Quoted 27 lines · Michael S. Tsirkin
Quoted 10 lines · On Wed, Oct 30, 2013 at 01:56:40PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Take care to do this only for new machine types, of course.

I feel applying this one would be a mistake.

Machine desc is for human readers.
For example, it currently says "Standard PC (Q35 + ICH9, 2009)" but if we add a variant with IDE compatibility mode we will likely want to tweak it to say "Standard PC (Q35 + ICH9/AHCI mode, 2009)"
and add another one saying ""Standard PC (Q35 + ICH9/compat mode, 2009)".

In other words we want the ability to tweak description retroactively, and exposing it to guest will break this ability.

So we really need a new field not tied to the human description.

Quoted 7 lines
Quoted 4 lines

You have a point, but if we do that one day, then we can add a new smbios-specific field and set it for each of the existing machine-types so they keep the same ABI. This patch doesn't make us unable to do that in the future.

We'll likely forget and just break guest ABI.
So we really need a unit test for this, too.

More tests are good, but we I think we got bigger fish to fry than writing tests to catch changes that are so obviously foolish as messing with old machine type's QEMUMachine.

Quoted 9 lines
Quoted 3 lines

As we are past hard freeze, I think this simple patch is better than a more complex solution for a problem we still don't have (that can still be implemented in 1.8).

I don't see why we need to rush this into 1.7. Downstreams want their info in smbios for support, branding etc, but I don't see a burning need for this in upstream QEMU. It's kind of nice to have it say "QEMU", but we can afford to delay and do it properly for 1.8.

Define "properly". I don't see what I'd like to do differently for 1.8.

#17 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] smbios: Set system manufacturer, product & version by default

In reply to Markus Armbruster
Quoted 23 lines · Markus Armbruster
Quoted 21 lines · Michael S. Tsirkin
Quoted 10 lines · On Wed, Oct 30, 2013 at 01:56:40PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Take care to do this only for new machine types, of course.

I feel applying this one would be a mistake.

Machine desc is for human readers.
For example, it currently says "Standard PC (Q35 + ICH9, 2009)" but if we add a variant with IDE compatibility mode we will likely want to tweak it to say "Standard PC (Q35 + ICH9/AHCI mode, 2009)"
and add another one saying ""Standard PC (Q35 + ICH9/compat mode, 2009)".

Quoted 5 lines
Quoted 3 lines

In other words we want the ability to tweak description retroactively, and exposing it to guest will break this ability.

These will be new machine types, won't they?

Description is there for humans, so we should be free to change it to make it more readable for old types, too.

Quoted 10 lines
Quoted 1 line

So we really need a new field not tied to the human description.

The SMBIOS string is *also* for human readers.

I can't see why we should jump through hoops *now* to separate the two. The values are the same. I don't expect us to change them for old machine types. But if we ever feel the need to change them in one place but not the other, nothing will prevent us from splitting them up then.

Pay as you go, not pay as you fear you might have to go some day.

#11 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] smbios: Set system manufacturer, product & version by default

In reply to Markus Armbruster
Quoted 37 lines · Markus Armbruster
Quoted 35 lines · Michael S. Tsirkin
Quoted 33 lines · Eduardo Habkost
Quoted 21 lines · Michael S. Tsirkin
Quoted 10 lines · On Wed, Oct 30, 2013 at 01:56:40PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Take care to do this only for new machine types, of course.

I feel applying this one would be a mistake.

Machine desc is for human readers.
For example, it currently says "Standard PC (Q35 + ICH9, 2009)" but if we add a variant with IDE compatibility mode we will likely want to tweak it to say "Standard PC (Q35 + ICH9/AHCI mode, 2009)"
and add another one saying ""Standard PC (Q35 + ICH9/compat mode, 2009)".

Quoted 6 lines

In other words we want the ability to tweak description retroactively, and exposing it to guest will break this ability.

So we really need a new field not tied to the human description.

You have a point, but if we do that one day, then we can add a new smbios-specific field and set it for each of the existing machine-types so they keep the same ABI. This patch doesn't make us unable to do that in the future.

Quoted 6 lines
Quoted 2 lines

We'll likely forget and just break guest ABI.
So we really need a unit test for this, too.

More tests are good, but we I think we got bigger fish to fry than writing tests to catch changes that are so obviously foolish as messing with old machine type's QEMUMachine.

You "messed with" old machine type's QEMUMachine in your cleanup patches too, didn't you?

Quoted 11 lines
Quoted 9 lines
Quoted 3 lines

As we are past hard freeze, I think this simple patch is better than a more complex solution for a problem we still don't have (that can still be implemented in 1.8).

I don't see why we need to rush this into 1.7. Downstreams want their info in smbios for support, branding etc, but I don't see a burning need for this in upstream QEMU. It's kind of nice to have it say "QEMU", but we can afford to delay and do it properly for 1.8.

Define "properly". I don't see what I'd like to do differently for 1.8.

With proper tests going in first before we start changing things. Ideally with better separation between user visible and guest visible interfaces - though if there was a test to catch guest visible changes, I would be less worried about this lack of separation.

Signature · 1 line
MST
#12 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] smbios: Set system manufacturer, product & version by default

Quoted 42 lines · Michael S. Tsirkin
Quoted 41 lines · Markus Armbruster
Quoted 38 lines · Michael S. Tsirkin
Quoted 27 lines · Eduardo Habkost
Quoted 26 lines · Michael S. Tsirkin
Quoted 10 lines · On Wed, Oct 30, 2013 at 01:56:40PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Take care to do this only for new machine types, of course.

I feel applying this one would be a mistake.

Machine desc is for human readers.
For example, it currently says "Standard PC (Q35 + ICH9, 2009)" but if we add a variant with IDE compatibility mode we will likely want to
tweak it to say "Standard PC (Q35 + ICH9/AHCI mode, 2009)" and add another one saying ""Standard PC (Q35 + ICH9/compat mode, 2009)".

In other words we want the ability to tweak description retroactively, and exposing it to guest will break this ability.

Quoted 7 lines
Quoted 2 lines

So we really need a new field not tied to the human description.

You have a point, but if we do that one day, then we can add a new smbios-specific field and set it for each of the existing machine-types so they keep the same ABI. This patch doesn't make us unable to do that in the future.

We'll likely forget and just break guest ABI.
So we really need a unit test for this, too.

Quoted 6 lines
Quoted 3 lines

More tests are good, but we I think we got bigger fish to fry than writing tests to catch changes that are so obviously foolish as messing with old machine type's QEMUMachine.

You "messed with" old machine type's QEMUMachine in your cleanup patches too, didn't you?

I've occasionally touched QEMUMachine initializers in cleanup series, but nothing as frivolous as changing strings. And I can't find anything as frivolous as that in git. We *are* careful and conservative there.

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 3 lines

As we are past hard freeze, I think this simple patch is better than a more complex solution for a problem we still don't have (that can still be implemented in 1.8).

I don't see why we need to rush this into 1.7. Downstreams want their info in smbios for support, branding etc, but I don't see a burning need for this in upstream QEMU. It's kind of nice to have it say "QEMU", but we can afford to delay and do it properly for 1.8.

Quoted 6 lines
Quoted 1 line

Define "properly". I don't see what I'd like to do differently for 1.8.

With proper tests going in first before we start changing things. Ideally with better separation between user visible and guest visible interfaces - though if there was a test to catch guest visible changes, I would be less worried about this lack of separation.

You want me to test for unlikely developer mistakes that are far easier to catch in review than most other guest ABI changes, and far less harmful than pretty much any other guest ABI change. This would multiply the size of this mini-series by a significant factor. I can't justify this in good conscience to my (and your) employer. So this isn't going to happen.

If the maintainers agree with you, then I wasted my time. Sad, but I'd rather write off the work I've already done than do much more work of no particular value just to save it.

#13 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] smbios: Set system manufacturer, product & version by default

Quoted 79 lines · Markus Armbruster
Quoted 42 lines · Michael S. Tsirkin
Quoted 41 lines · Markus Armbruster
Quoted 38 lines · Michael S. Tsirkin
Quoted 27 lines · Eduardo Habkost
Quoted 26 lines · Michael S. Tsirkin
Quoted 10 lines · On Wed, Oct 30, 2013 at 01:56:40PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Take care to do this only for new machine types, of course.

I feel applying this one would be a mistake.

Machine desc is for human readers.
For example, it currently says "Standard PC (Q35 + ICH9, 2009)" but if we add a variant with IDE compatibility mode we will likely want to
tweak it to say "Standard PC (Q35 + ICH9/AHCI mode, 2009)" and add another one saying ""Standard PC (Q35 + ICH9/compat mode, 2009)".

In other words we want the ability to tweak description retroactively, and exposing it to guest will break this ability.

Quoted 7 lines
Quoted 2 lines

So we really need a new field not tied to the human description.

You have a point, but if we do that one day, then we can add a new smbios-specific field and set it for each of the existing machine-types so they keep the same ABI. This patch doesn't make us unable to do that in the future.

We'll likely forget and just break guest ABI.
So we really need a unit test for this, too.

Quoted 6 lines
Quoted 3 lines

More tests are good, but we I think we got bigger fish to fry than writing tests to catch changes that are so obviously foolish as messing with old machine type's QEMUMachine.

You "messed with" old machine type's QEMUMachine in your cleanup patches too, didn't you?

I've occasionally touched QEMUMachine initializers in cleanup series, but nothing as frivolous as changing strings. And I can't find anything as frivolous as that in git. We *are* careful and conservative there.

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 3 lines

As we are past hard freeze, I think this simple patch is better than a more complex solution for a problem we still don't have (that can still be implemented in 1.8).

I don't see why we need to rush this into 1.7. Downstreams want their info in smbios for support, branding etc, but I don't see a burning need for this in upstream QEMU. It's kind of nice to have it say "QEMU", but we can afford to delay and do it properly for 1.8.

Quoted 6 lines
Quoted 1 line

Define "properly". I don't see what I'd like to do differently for 1.8.

With proper tests going in first before we start changing things. Ideally with better separation between user visible and guest visible interfaces - though if there was a test to catch guest visible changes, I would be less worried about this lack of separation.

You want me to test for unlikely developer mistakes that are far easier to catch in review than most other guest ABI changes, and far less harmful than pretty much any other guest ABI change. This would multiply the size of this mini-series by a significant factor. I can't justify this in good conscience to my (and your) employer. So this isn't going to happen.

Quoted 3 lines

If the maintainers agree with you, then I wasted my time. Sad, but I'd rather write off the work I've already done than do much more work of no particular value just to save it.

It would be of no particular value *if we only test these strings*. But testing smbios generally has a lot of value IMHO.

Signature · 1 line
MST
#14 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] smbios: Set system manufacturer, product & version by default

Quoted 82 lines · Michael S. Tsirkin
Quoted 81 lines · Markus Armbruster
Quoted 44 lines · Michael S. Tsirkin
Quoted 43 lines · Markus Armbruster
Quoted 40 lines · Michael S. Tsirkin
Quoted 29 lines · Eduardo Habkost
Quoted 28 lines · Michael S. Tsirkin
Quoted 9 lines · On Wed, Oct 30, 2013 at 01:56:40PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs,
no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Quoted 3 lines

Take care to do this only for new machine types, of course.

I feel applying this one would be a mistake.

Machine desc is for human readers.
For example, it currently says "Standard PC (Q35 + ICH9, 2009)" but if we add a variant with IDE compatibility mode we will likely want to
tweak it to say "Standard PC (Q35 + ICH9/AHCI mode, 2009)" and add another one saying ""Standard PC (Q35 + ICH9/compat mode, 2009)".

In other words we want the ability to tweak description retroactively, and exposing it to guest will break this ability.

Quoted 7 lines
Quoted 2 lines

So we really need a new field not tied to the human description.

You have a point, but if we do that one day, then we can add a new smbios-specific field and set it for each of the existing machine-types so they keep the same ABI. This patch doesn't make us unable to do that in the future.

We'll likely forget and just break guest ABI.
So we really need a unit test for this, too.

Quoted 6 lines
Quoted 3 lines

More tests are good, but we I think we got bigger fish to fry than writing tests to catch changes that are so obviously foolish as messing with old machine type's QEMUMachine.

You "messed with" old machine type's QEMUMachine in your cleanup patches too, didn't you?

I've occasionally touched QEMUMachine initializers in cleanup series, but nothing as frivolous as changing strings. And I can't find anything as frivolous as that in git. We *are* careful and conservative there.

Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Quoted 3 lines

As we are past hard freeze, I think this simple patch is better than a more complex solution for a problem we still don't have (that can still be implemented in 1.8).

I don't see why we need to rush this into 1.7. Downstreams want their info in smbios for support, branding etc, but I don't see a burning need for this in upstream QEMU. It's kind of nice to have it say "QEMU", but we can afford to delay and do it properly for 1.8.

Quoted 6 lines
Quoted 1 line

Define "properly". I don't see what I'd like to do differently for 1.8.

With proper tests going in first before we start changing things. Ideally with better separation between user visible and guest visible interfaces - though if there was a test to catch guest visible changes, I would be less worried about this lack of separation.

You want me to test for unlikely developer mistakes that are far easier to catch in review than most other guest ABI changes, and far less harmful than pretty much any other guest ABI change. This would multiply the size of this mini-series by a significant factor. I can't justify this in good conscience to my (and your) employer. So this isn't going to happen.

Quoted 6 lines
Quoted 3 lines

If the maintainers agree with you, then I wasted my time. Sad, but I'd rather write off the work I've already done than do much more work of no particular value just to save it.

It would be of no particular value *if we only test these strings*. But testing smbios generally has a lot of value IMHO.

Yes, it has value, but you're not going to succeed into blackmailing me to do that work now.

#21 lore raw

[Qemu-devel] [PATCH v3 3/2] smbios: Decouple system product from QEMUMachine

In reply to [email protected]

Michael Tsirkin doesn't trust us to keep values of QEMUMachine member product stable in the future. Use copies instead, and in a way that makes it obvious that they're guest ABI.

Note that we can be trusted to keep values of member name, because that has always been ABI.

---
 hw/i386/pc_piix.c | 3 ++-
 hw/i386/pc_q35.c  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
hw/i386/pc_piix.c +2 -1
index 417ad33..1ffa1ac 100644
@@ -127,7 +127,8 @@ static void pc_init1(QEMUMachineInitArgs *args,
     guest_info->has_pci_info = has_pci_info;
     guest_info->isapc_ram_fw = !pci_enabled;
     if (smbios_type1_defaults) {
-        smbios_set_type1_defaults("QEMU", args->machine->desc,
+        /* These values are guest ABI, do not change */
+        smbios_set_type1_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
                                   args->machine->name);
     }
 
hw/i386/pc_q35.c +2 -1
index 9e3213f..0dc75c1 100644
@@ -114,7 +114,8 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
     guest_info->has_pci_info = has_pci_info;
     guest_info->isapc_ram_fw = false;
     if (smbios_type1_defaults) {
-        smbios_set_type1_defaults("QEMU", args->machine->desc,
+        /* These values are guest ABI, do not change */
+        smbios_set_type1_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
                                   args->machine->name);
     }
 
Signature · 1 line
1.8.1.4
#18 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] smbios: Set system manufacturer, product & version by default

In reply to Michael S. Tsirkin
Quoted 21 lines · Michael S. Tsirkin
Quoted 10 lines · On Wed, Oct 30, 2013 at 01:56:40PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Take care to do this only for new machine types, of course.

I feel applying this one would be a mistake.

Machine desc is for human readers.
For example, it currently says "Standard PC (Q35 + ICH9, 2009)" but if we add a variant with IDE compatibility mode we will likely want to tweak it to say "Standard PC (Q35 + ICH9/AHCI mode, 2009)"
and add another one saying ""Standard PC (Q35 + ICH9/compat mode, 2009)".

Quoted 5 lines

In other words we want the ability to tweak description retroactively, and exposing it to guest will break this ability.

So we really need a new field not tied to the human description.

Can you live with the separation I just posted as PATCH 3/2?

Reviewed-by
#22 lore raw

Re: [Qemu-devel] [PATCH v3 3/2] smbios: Decouple system product from QEMUMachine

In reply to Markus Armbruster
Quoted 8 lines · Markus Armbruster

Michael Tsirkin doesn't trust us to keep values of QEMUMachine member product stable in the future. Use copies instead, and in a way that makes it obvious that they're guest ABI.

Note that we can be trusted to keep values of member name, because that has always been ABI.

Nice and clean. Thanks!

Quoted 36 lines
---
 hw/i386/pc_piix.c | 3 ++-
 hw/i386/pc_q35.c  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
hw/i386/pc_piix.c +2 -1
index 417ad33..1ffa1ac 100644
@@ -127,7 +127,8 @@ static void pc_init1(QEMUMachineInitArgs *args,
     guest_info->has_pci_info = has_pci_info;
     guest_info->isapc_ram_fw = !pci_enabled;
     if (smbios_type1_defaults) {
-        smbios_set_type1_defaults("QEMU", args->machine->desc,
+        /* These values are guest ABI, do not change */
+        smbios_set_type1_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
                                   args->machine->name);
     }
 
hw/i386/pc_q35.c +2 -1
index 9e3213f..0dc75c1 100644
@@ -114,7 +114,8 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
     guest_info->has_pci_info = has_pci_info;
     guest_info->isapc_ram_fw = false;
     if (smbios_type1_defaults) {
-        smbios_set_type1_defaults("QEMU", args->machine->desc,
+        /* These values are guest ABI, do not change */
+        smbios_set_type1_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)",
                                   args->machine->name);
     }
 
Signature · 1 line
1.8.1.4
Reviewed-by on v3 1/2
#4 lore raw

Re: [Qemu-devel] [PATCH v3 1/2] hw: Pass QEMUMachine to its init() method

In reply to [email protected]
Quoted 5 lines · On Wed, Oct 30, 2013 at 01:56:39PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Put it in QEMUMachineInitArgs, so I don't have to touch every board.

Quoted 55 lines
---
 include/hw/boards.h | 7 +++++--
 vl.c                | 3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)
include/hw/boards.h +5 -2
index 5a7ae9f..2151460 100644
@@ -6,7 +6,10 @@
 #include "sysemu/blockdev.h"
 #include "hw/qdev.h"
 
+typedef struct QEMUMachine QEMUMachine;
+
 typedef struct QEMUMachineInitArgs {
+    const QEMUMachine *machine;
     ram_addr_t ram_size;
     const char *boot_order;
     const char *kernel_filename;
@@ -21,7 +24,7 @@ typedef void QEMUMachineResetFunc(void);
 
 typedef void QEMUMachineHotAddCPUFunc(const int64_t id, Error **errp);
 
-typedef struct QEMUMachine {
+struct QEMUMachine {
     const char *name;
     const char *alias;
     const char *desc;
@@ -43,7 +46,7 @@ typedef struct QEMUMachine {
     GlobalProperty *compat_props;
     struct QEMUMachine *next;
     const char *hw_version;
-} QEMUMachine;
+};
 
 int qemu_register_machine(QEMUMachine *m);
 QEMUMachine *find_default_machine(void);
vl.c +2 -1
index b42ac67..63338e4 100644
@@ -4236,7 +4236,8 @@ int main(int argc, char **argv, char **envp)
 
     qdev_machine_init();
 
-    QEMUMachineInitArgs args = { .ram_size = ram_size,
+    QEMUMachineInitArgs args = { .machine = machine,
+                                 .ram_size = ram_size,
                                  .boot_order = boot_order,
                                  .kernel_filename = kernel_filename,
                                  .kernel_cmdline = kernel_cmdline,
Signature · 1 line
1.8.1.4
#19 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] smbios: Set system manufacturer, product & version by default

In reply to Markus Armbruster
Quoted 23 lines · Markus Armbruster
Quoted 21 lines · Michael S. Tsirkin
Quoted 10 lines · On Wed, Oct 30, 2013 at 01:56:40PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Take care to do this only for new machine types, of course.

I feel applying this one would be a mistake.

Machine desc is for human readers.
For example, it currently says "Standard PC (Q35 + ICH9, 2009)" but if we add a variant with IDE compatibility mode we will likely want to tweak it to say "Standard PC (Q35 + ICH9/AHCI mode, 2009)"
and add another one saying ""Standard PC (Q35 + ICH9/compat mode, 2009)".

Quoted 7 lines
Quoted 5 lines

In other words we want the ability to tweak description retroactively, and exposing it to guest will break this ability.

So we really need a new field not tied to the human description.

Can you live with the separation I just posted as PATCH 3/2?

Yes, I think that's a good way to do this.

#15 lore raw

Re: [Qemu-devel] [PATCH v3 2/2] smbios: Set system manufacturer, product & version by default

In reply to Markus Armbruster
Quoted 48 lines · Markus Armbruster
Quoted 46 lines · Michael S. Tsirkin
Quoted 44 lines · Markus Armbruster
Quoted 31 lines · Michael S. Tsirkin
Quoted 30 lines · Eduardo Habkost
Quoted 28 lines · Michael S. Tsirkin
Quoted 10 lines · On Wed, Oct 30, 2013 at 01:56:40PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

Take care to do this only for new machine types, of course.

I feel applying this one would be a mistake.

Machine desc is for human readers.
For example, it currently says "Standard PC (Q35 + ICH9, 2009)" but if we add a variant with IDE compatibility mode we will likely want to
tweak it to say "Standard PC (Q35 + ICH9/AHCI mode, 2009)" and add another one saying ""Standard PC (Q35 + ICH9/compat mode, 2009)".

In other words we want the ability to tweak description retroactively, and exposing it to guest will break this ability.

So we really need a new field not tied to the human description.

Quoted 7 lines
Quoted 4 lines

You have a point, but if we do that one day, then we can add a new smbios-specific field and set it for each of the existing machine-types so they keep the same ABI. This patch doesn't make us unable to do that in the future.

We'll likely forget and just break guest ABI.
So we really need a unit test for this, too.

More tests are good, but we I think we got bigger fish to fry than writing tests to catch changes that are so obviously foolish as messing with old machine type's QEMUMachine.

Quoted 6 lines
Quoted 2 lines

You "messed with" old machine type's QEMUMachine in your cleanup patches too, didn't you?

I've occasionally touched QEMUMachine initializers in cleanup series, but nothing as frivolous as changing strings. And I can't find anything as frivolous as that in git. We *are* careful and conservative there.

Actually, we changed .desc for old machine types before. See commit a0dba644c139907ccf6735c505fbd254010d6938.

Signature · 1 line
Eduardo
Reviewed-by
#23 lore raw

Re: [Qemu-devel] [PATCH v3 3/2] smbios: Decouple system product from QEMUMachine

In reply to Markus Armbruster
Quoted 8 lines · Markus Armbruster

Michael Tsirkin doesn't trust us to keep values of QEMUMachine member product stable in the future. Use copies instead, and in a way that makes it obvious that they're guest ABI.

Note that we can be trusted to keep values of member name, because that has always been ABI.

Signature · 1 line
Eduardo
#24 lore raw
In reply to [email protected]
Quoted 20 lines · On Wed, Oct 30, 2013 at 01:56:38PM +0100, [email protected] wrote:

From: Markus Armbruster <[email protected]>

Currently, we get SeaBIOS defaults: manufacturer Bochs, product Bochs, no version. Best SeaBIOS can do, but we can provide better defaults:
manufacturer QEMU, product & version taken from QEMUMachine desc and name.

This series used to be called "[PATCH v2 0/7] smbios cleanup & nicer defaults for type 1", but its cleanup parts [0-5/7] already went in.

Andreas didn't like "[PATCH v2 6/7] vl: Set current_machine early", and suggested to put he machine into QEMUMachineInitArgs. PATCH 1/2 does exactly that, replacing v2's PATCH 6/7. PATCH 2/2 is v2's PATCH 7/7 rebased on top.

Michael didn't like the way I suppress the nicer defaults for old machine types via static bool smbios_type1_defaults, and thought it would be nicer to have it in QEMUMachine or some device. I considered this, but decided to stick to smbios_type1_defaults, because

Quoted 8 lines

1. There is no suitable device.
2. I'd rather not extend QEMUMachine with target-specific stuff.
3. A static bool whose default value gets flipped by some QEMUMachine init() methods is what we commonly do in such cases, so let's stick to that.

v3: Do it the way Andreas suggested
v2: Rebase, only last patch had conflicts

I picked this up merging 2/2 and 3/2. Unfortunately it';s too late for 1.7 but I'll try to merge it as soon as 1.8 opens.

Quoted 14 lines

Markus Armbruster (2):
hw: Pass QEMUMachine to its init() method
smbios: Set system manufacturer, product & version by default

 hw/i386/pc_piix.c        |  9 +++++++++
 hw/i386/pc_q35.c         |  7 +++++++
 hw/i386/smbios.c         | 14 ++++++++++++++
 include/hw/boards.h      |  7 +++++--
 include/hw/i386/smbios.h |  2 ++
 vl.c                     |  3 ++-
 6 files changed, 39 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.1.4