Patchwork [v3,3/2] smbios: Decouple system product from QEMUMachine

login
register
mail settings
Submitter Markus Armbruster
Date Oct. 31, 2013, 5:51 a.m.
Message ID <87zjpqyoll.fsf@blackfin.pond.sub.org>
Download mbox | patch
Permalink /patch/287399/
State New
Headers show

Comments

Markus Armbruster - Oct. 31, 2013, 5:51 a.m.
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.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/i386/pc_piix.c | 3 ++-
 hw/i386/pc_q35.c  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
Michael S. Tsirkin - Oct. 31, 2013, 6:16 a.m.
On Thu, Oct 31, 2013 at 06:51:50AM +0100, Markus Armbruster wrote:
> 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.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Nice and clean. Thanks!

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

> ---
>  hw/i386/pc_piix.c | 3 ++-
>  hw/i386/pc_q35.c  | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 417ad33..1ffa1ac 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -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);
>      }
>  
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index 9e3213f..0dc75c1 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -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);
>      }
>  
> -- 
> 1.8.1.4
>
Eduardo Habkost - Oct. 31, 2013, 8:20 a.m.
On Thu, Oct 31, 2013 at 06:51:50AM +0100, Markus Armbruster wrote:
> 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.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>

Patch

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 417ad33..1ffa1ac 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -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);
     }
 
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 9e3213f..0dc75c1 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -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);
     }