diff mbox

[v5,08/10] PC: Support dynamic sysbus on pc_i440fx

Message ID a0d502ddafd0bb57633d863c8b2d89693ad5b06f.1486285434.git.ben@skyportsystems.com
State New
Headers show

Commit Message

ben@skyportsystems.com Feb. 5, 2017, 9:12 a.m. UTC
From: Ben Warren <ben@skyportsystems.com>

This allows pc_i440fx-based machines to add new devices such as
VM Generation ID directly to the sysbus.

Signed-off-by: Ben Warren <ben@skyportsystems.com>
---
 hw/i386/pc_piix.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Michael S. Tsirkin Feb. 6, 2017, 4:31 p.m. UTC | #1
On Sun, Feb 05, 2017 at 01:12:03AM -0800, ben@skyportsystems.com wrote:
> From: Ben Warren <ben@skyportsystems.com>
> 
> This allows pc_i440fx-based machines to add new devices such as
> VM Generation ID directly to the sysbus.
> 
> Signed-off-by: Ben Warren <ben@skyportsystems.com>

Only point is, we might have to add more flags like
cannot_instantiate_with_device_add_yet
to a bunch of devices.

Marcel, you did a similar thing for q35, can you
take a look here as well pls?

> ---
>  hw/i386/pc_piix.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 9f102aa..c8ad99c 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -435,6 +435,7 @@ static void pc_i440fx_machine_options(MachineClass *m)
>      m->hot_add_cpu = pc_hot_add_cpu;
>      m->default_machine_opts = "firmware=bios-256k.bin";
>      m->default_display = "std";
> +    m->has_dynamic_sysbus = true;
>  }
>  
>  static void pc_i440fx_2_9_machine_options(MachineClass *m)
> -- 
> 2.7.4
Igor Mammedov Feb. 7, 2017, 2:05 p.m. UTC | #2
On Sun,  5 Feb 2017 01:12:03 -0800
ben@skyportsystems.com wrote:

> From: Ben Warren <ben@skyportsystems.com>
> 
> This allows pc_i440fx-based machines to add new devices such as
> VM Generation ID directly to the sysbus.
> 
> Signed-off-by: Ben Warren <ben@skyportsystems.com>
> ---
>  hw/i386/pc_piix.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 9f102aa..c8ad99c 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -435,6 +435,7 @@ static void pc_i440fx_machine_options(MachineClass *m)
>      m->hot_add_cpu = pc_hot_add_cpu;
>      m->default_machine_opts = "firmware=bios-256k.bin";
>      m->default_display = "std";
> +    m->has_dynamic_sysbus = true;
>  }
>  
>  static void pc_i440fx_2_9_machine_options(MachineClass *m)
since vmgenid device doesn't need any external wiring by board
-device probably would also work if it's inherited from plain Device
Marcel Apfelbaum Feb. 12, 2017, 7:55 p.m. UTC | #3
On 02/06/2017 06:31 PM, Michael S. Tsirkin wrote:
> On Sun, Feb 05, 2017 at 01:12:03AM -0800, ben@skyportsystems.com wrote:
>> From: Ben Warren <ben@skyportsystems.com>
>>
>> This allows pc_i440fx-based machines to add new devices such as
>> VM Generation ID directly to the sysbus.
>>
>> Signed-off-by: Ben Warren <ben@skyportsystems.com>
>

Hi,

> Only point is, we might have to add more flags like
> cannot_instantiate_with_device_add_yet
> to a bunch of devices.
>
> Marcel, you did a similar thing for q35, can you
> take a look here as well pls?
>

The change is a must because the new vmgenid device
is a sysbus device and QEMU will not allow it without
marking explicitly that i440fx supports sysbus device.

As you already mentioned, we need to make sure that
all sysbus devices that can be added to the PC machines
are marked with "cannot_instantiate_with_device_add_yet".

Sadly I see no easy way, but going manually over each one...

Thanks,
Marcel

>> ---
>>  hw/i386/pc_piix.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
>> index 9f102aa..c8ad99c 100644
>> --- a/hw/i386/pc_piix.c
>> +++ b/hw/i386/pc_piix.c
>> @@ -435,6 +435,7 @@ static void pc_i440fx_machine_options(MachineClass *m)
>>      m->hot_add_cpu = pc_hot_add_cpu;
>>      m->default_machine_opts = "firmware=bios-256k.bin";
>>      m->default_display = "std";
>> +    m->has_dynamic_sysbus = true;
>>  }
>>
>>  static void pc_i440fx_2_9_machine_options(MachineClass *m)
>> --
>> 2.7.4
>
ben@skyportsystems.com Feb. 13, 2017, 12:32 a.m. UTC | #4
Hi
> On Feb 12, 2017, at 11:55 AM, Marcel Apfelbaum <marcel.apfelbaum@gmail.com> wrote:
> 
> On 02/06/2017 06:31 PM, Michael S. Tsirkin wrote:
>> On Sun, Feb 05, 2017 at 01:12:03AM -0800, ben@skyportsystems.com wrote:
>>> From: Ben Warren <ben@skyportsystems.com>
>>> 
>>> This allows pc_i440fx-based machines to add new devices such as
>>> VM Generation ID directly to the sysbus.
>>> 
>>> Signed-off-by: Ben Warren <ben@skyportsystems.com>
>> 
> 
> Hi,
> 
>> Only point is, we might have to add more flags like
>> cannot_instantiate_with_device_add_yet
>> to a bunch of devices.
>> 
>> Marcel, you did a similar thing for q35, can you
>> take a look here as well pls?
>> 
> 
> The change is a must because the new vmgenid device
> is a sysbus device and QEMU will not allow it without
> marking explicitly that i440fx supports sysbus device.
> 
As recommended by Igor, I was able to make the vmgenid work with DeviceClass as parent (i.e. not on sysbus), so this work can be deferred until it’s really needed.  The next patch set (hopefully posted tonight) will drop this patch.
> As you already mentioned, we need to make sure that
> all sysbus devices that can be added to the PC machines
> are marked with "cannot_instantiate_with_device_add_yet".
> 
> Sadly I see no easy way, but going manually over each one...
> 
> Thanks,
> Marcel
> 
—Ben
>>> ---
>>> hw/i386/pc_piix.c | 1 +
>>> 1 file changed, 1 insertion(+)
>>> 
>>> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
>>> index 9f102aa..c8ad99c 100644
>>> --- a/hw/i386/pc_piix.c
>>> +++ b/hw/i386/pc_piix.c
>>> @@ -435,6 +435,7 @@ static void pc_i440fx_machine_options(MachineClass *m)
>>>     m->hot_add_cpu = pc_hot_add_cpu;
>>>     m->default_machine_opts = "firmware=bios-256k.bin";
>>>     m->default_display = "std";
>>> +    m->has_dynamic_sysbus = true;
>>> }
>>> 
>>> static void pc_i440fx_2_9_machine_options(MachineClass *m)
>>> --
>>> 2.7.4
>> 
>
diff mbox

Patch

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 9f102aa..c8ad99c 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -435,6 +435,7 @@  static void pc_i440fx_machine_options(MachineClass *m)
     m->hot_add_cpu = pc_hot_add_cpu;
     m->default_machine_opts = "firmware=bios-256k.bin";
     m->default_display = "std";
+    m->has_dynamic_sysbus = true;
 }
 
 static void pc_i440fx_2_9_machine_options(MachineClass *m)