[PATCH 02/55] qdev: Drop redundant bus realization

Markus Armbruster posted 55 patches 5 years, 5 months ago
There is a newer version of this series
[PATCH 02/55] qdev: Drop redundant bus realization
Posted by Markus Armbruster 5 years, 5 months ago
Realizing a device automatically realizes its buses, in
device_set_realized().  Realizing them in realize methods is
redundant, unless the methods themselves require them to be realized
early.  None do.  Drop the redundant bus realiziations.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/pci-host/prep.c      | 1 -
 hw/pci-host/versatile.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c
index 1a02e9a670..c821ef889d 100644
--- a/hw/pci-host/prep.c
+++ b/hw/pci-host/prep.c
@@ -268,7 +268,6 @@ static void raven_pcihost_realizefn(DeviceState *d, Error **errp)
     memory_region_add_subregion(address_space_mem, 0xbffffff0, &s->pci_intack);
 
     /* TODO Remove once realize propagates to child devices. */
-    object_property_set_bool(OBJECT(&s->pci_bus), true, "realized", errp);
     object_property_set_bool(OBJECT(&s->pci_dev), true, "realized", errp);
 }
 
diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c
index cfb9a78ea6..28817dbeec 100644
--- a/hw/pci-host/versatile.c
+++ b/hw/pci-host/versatile.c
@@ -458,7 +458,6 @@ static void pci_vpb_realize(DeviceState *dev, Error **errp)
     }
 
     /* TODO Remove once realize propagates to child devices. */
-    object_property_set_bool(OBJECT(&s->pci_bus), true, "realized", errp);
     object_property_set_bool(OBJECT(&s->pci_dev), true, "realized", errp);
 }
 
-- 
2.21.1


Re: [PATCH 02/55] qdev: Drop redundant bus realization
Posted by Philippe Mathieu-Daudé 5 years, 5 months ago
+Marcel

On 5/19/20 4:54 PM, Markus Armbruster wrote:
> Realizing a device automatically realizes its buses, in
> device_set_realized().  Realizing them in realize methods is
> redundant, unless the methods themselves require them to be realized
> early.  None do.  Drop the redundant bus realiziations.

Typo realiziations-> realizations.

So you are reverting commits 685f9a3428f & b1af7959a66...
I don't understand them, Marcel can you review this patch?

> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   hw/pci-host/prep.c      | 1 -
>   hw/pci-host/versatile.c | 1 -
>   2 files changed, 2 deletions(-)
> 
> diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c
> index 1a02e9a670..c821ef889d 100644
> --- a/hw/pci-host/prep.c
> +++ b/hw/pci-host/prep.c
> @@ -268,7 +268,6 @@ static void raven_pcihost_realizefn(DeviceState *d, Error **errp)
>       memory_region_add_subregion(address_space_mem, 0xbffffff0, &s->pci_intack);
>   
>       /* TODO Remove once realize propagates to child devices. */
> -    object_property_set_bool(OBJECT(&s->pci_bus), true, "realized", errp);
>       object_property_set_bool(OBJECT(&s->pci_dev), true, "realized", errp);
>   }
>   
> diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c
> index cfb9a78ea6..28817dbeec 100644
> --- a/hw/pci-host/versatile.c
> +++ b/hw/pci-host/versatile.c
> @@ -458,7 +458,6 @@ static void pci_vpb_realize(DeviceState *dev, Error **errp)
>       }
>   
>       /* TODO Remove once realize propagates to child devices. */
> -    object_property_set_bool(OBJECT(&s->pci_bus), true, "realized", errp);
>       object_property_set_bool(OBJECT(&s->pci_dev), true, "realized", errp);
>   }
>   
> 


Re: [PATCH 02/55] qdev: Drop redundant bus realization
Posted by Markus Armbruster 5 years, 5 months ago
Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> +Marcel
>
> On 5/19/20 4:54 PM, Markus Armbruster wrote:
>> Realizing a device automatically realizes its buses, in
>> device_set_realized().  Realizing them in realize methods is
>> redundant, unless the methods themselves require them to be realized
>> early.  None do.  Drop the redundant bus realiziations.
>
> Typo realiziations-> realizations.

Will fix, thanks!

> So you are reverting commits 685f9a3428f & b1af7959a66...

I should've checked where these lines come from.

> I don't understand them, Marcel can you review this patch?
>
>>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>   hw/pci-host/prep.c      | 1 -
>>   hw/pci-host/versatile.c | 1 -
>>   2 files changed, 2 deletions(-)
>>
>> diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c
>> index 1a02e9a670..c821ef889d 100644
>> --- a/hw/pci-host/prep.c
>> +++ b/hw/pci-host/prep.c
>> @@ -268,7 +268,6 @@ static void raven_pcihost_realizefn(DeviceState *d, Error **errp)
>>       memory_region_add_subregion(address_space_mem, 0xbffffff0, &s->pci_intack);
>>         /* TODO Remove once realize propagates to child devices. */
>> -    object_property_set_bool(OBJECT(&s->pci_bus), true, "realized", errp);
>>       object_property_set_bool(OBJECT(&s->pci_dev), true, "realized", errp);
>>   }
>>   diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c
>> index cfb9a78ea6..28817dbeec 100644
>> --- a/hw/pci-host/versatile.c
>> +++ b/hw/pci-host/versatile.c
>> @@ -458,7 +458,6 @@ static void pci_vpb_realize(DeviceState *dev, Error **errp)
>>       }
>>         /* TODO Remove once realize propagates to child devices. */
>> -    object_property_set_bool(OBJECT(&s->pci_bus), true, "realized", errp);
>>       object_property_set_bool(OBJECT(&s->pci_dev), true, "realized", errp);
>>   }
>>   
>>