[PATCH v2 04/11] hw/ppc/spapr: Inline spapr_dtb_needed()

Philippe Mathieu-Daudé posted 11 patches 3 weeks, 3 days ago
Maintainers: Nicholas Piggin <npiggin@gmail.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Chinmay Rath <rathc@linux.ibm.com>, Paolo Bonzini <pbonzini@redhat.com>
[PATCH v2 04/11] hw/ppc/spapr: Inline spapr_dtb_needed()
Posted by Philippe Mathieu-Daudé 3 weeks, 3 days ago
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/ppc/spapr.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 458d1c29b4d..ad9fc61c299 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2053,11 +2053,6 @@ static const VMStateDescription vmstate_spapr_irq_map = {
     },
 };
 
-static bool spapr_dtb_needed(void *opaque)
-{
-    return true; /* backward migration compat */
-}
-
 static int spapr_dtb_pre_load(void *opaque)
 {
     SpaprMachineState *spapr = (SpaprMachineState *)opaque;
@@ -2073,7 +2068,6 @@ static const VMStateDescription vmstate_spapr_dtb = {
     .name = "spapr_dtb",
     .version_id = 1,
     .minimum_version_id = 1,
-    .needed = spapr_dtb_needed,
     .pre_load = spapr_dtb_pre_load,
     .fields = (const VMStateField[]) {
         VMSTATE_UINT32(fdt_initial_size, SpaprMachineState),
-- 
2.51.0


Re: [PATCH v2 04/11] hw/ppc/spapr: Inline spapr_dtb_needed()
Posted by Chinmay Rath 3 weeks, 3 days ago
Hey Philippe,
The commit message says that this commit is inline-ing 
spapr_dtb_needed(), but it is actually removing it. I think it's better 
to convey that in the commit message.
Or did I miss something ?

On 10/21/25 14:13, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/ppc/spapr.c | 6 ------
>   1 file changed, 6 deletions(-)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 458d1c29b4d..ad9fc61c299 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2053,11 +2053,6 @@ static const VMStateDescription vmstate_spapr_irq_map = {
>       },
>   };
>   
> -static bool spapr_dtb_needed(void *opaque)
> -{
> -    return true; /* backward migration compat */
> -}
> -
>   static int spapr_dtb_pre_load(void *opaque)
>   {
>       SpaprMachineState *spapr = (SpaprMachineState *)opaque;
> @@ -2073,7 +2068,6 @@ static const VMStateDescription vmstate_spapr_dtb = {
>       .name = "spapr_dtb",
>       .version_id = 1,

Does this version number need to be incremented ?

Regards,
Chinmay

>       .minimum_version_id = 1,
> -    .needed = spapr_dtb_needed,
>       .pre_load = spapr_dtb_pre_load,
>       .fields = (const VMStateField[]) {
>           VMSTATE_UINT32(fdt_initial_size, SpaprMachineState),

Re: [PATCH v2 04/11] hw/ppc/spapr: Inline spapr_dtb_needed()
Posted by Philippe Mathieu-Daudé 3 weeks, 3 days ago
On 21/10/25 15:25, Chinmay Rath wrote:
> Hey Philippe,
> The commit message says that this commit is inline-ing 
> spapr_dtb_needed(), but it is actually removing it. I think it's better 
> to convey that in the commit message.
> Or did I miss something ?
> 
> On 10/21/25 14:13, Philippe Mathieu-Daudé wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   hw/ppc/spapr.c | 6 ------
>>   1 file changed, 6 deletions(-)
>>
>> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
>> index 458d1c29b4d..ad9fc61c299 100644
>> --- a/hw/ppc/spapr.c
>> +++ b/hw/ppc/spapr.c
>> @@ -2053,11 +2053,6 @@ static const VMStateDescription 
>> vmstate_spapr_irq_map = {
>>       },
>>   };
>> -static bool spapr_dtb_needed(void *opaque)
>> -{
>> -    return true; /* backward migration compat */
>> -}
>> -
>>   static int spapr_dtb_pre_load(void *opaque)
>>   {
>>       SpaprMachineState *spapr = (SpaprMachineState *)opaque;
>> @@ -2073,7 +2068,6 @@ static const VMStateDescription 
>> vmstate_spapr_dtb = {
>>       .name = "spapr_dtb",
>>       .version_id = 1,
> 
> Does this version number need to be incremented ?

No, this is a no-op.

> 
> Regards,
> Chinmay
> 
>>       .minimum_version_id = 1,
>> -    .needed = spapr_dtb_needed,

Here is the inlining, as '.needed = true' is the default.

Would "Inline and remove spapr_dtb_needed()" be clearer?

>>       .pre_load = spapr_dtb_pre_load,
>>       .fields = (const VMStateField[]) {
>>           VMSTATE_UINT32(fdt_initial_size, SpaprMachineState),


Re: [PATCH v2 04/11] hw/ppc/spapr: Inline spapr_dtb_needed()
Posted by Chinmay Rath 3 weeks, 2 days ago
On 10/21/25 19:51, Philippe Mathieu-Daudé wrote:
> On 21/10/25 15:25, Chinmay Rath wrote:
>> Hey Philippe,
>> The commit message says that this commit is inline-ing 
>> spapr_dtb_needed(), but it is actually removing it. I think it's 
>> better to convey that in the commit message.
>> Or did I miss something ?
>>
>> On 10/21/25 14:13, Philippe Mathieu-Daudé wrote:
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>> ---
>>>   hw/ppc/spapr.c | 6 ------
>>>   1 file changed, 6 deletions(-)
>>>
>>> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
>>> index 458d1c29b4d..ad9fc61c299 100644
>>> --- a/hw/ppc/spapr.c
>>> +++ b/hw/ppc/spapr.c
>>> @@ -2053,11 +2053,6 @@ static const VMStateDescription 
>>> vmstate_spapr_irq_map = {
>>>       },
>>>   };
>>> -static bool spapr_dtb_needed(void *opaque)
>>> -{
>>> -    return true; /* backward migration compat */
>>> -}
>>> -
>>>   static int spapr_dtb_pre_load(void *opaque)
>>>   {
>>>       SpaprMachineState *spapr = (SpaprMachineState *)opaque;
>>> @@ -2073,7 +2068,6 @@ static const VMStateDescription 
>>> vmstate_spapr_dtb = {
>>>       .name = "spapr_dtb",
>>>       .version_id = 1,
>>
>> Does this version number need to be incremented ?
>
> No, this is a no-op.
>
>>
>> Regards,
>> Chinmay
>>
>>>       .minimum_version_id = 1,
>>> -    .needed = spapr_dtb_needed,
>
> Here is the inlining, as '.needed = true' is the default.
Ahh I see.
> Would "Inline and remove spapr_dtb_needed()" be clearer?
Yeah that'd be nice.

Thanks,
Chinmay
>
>>>       .pre_load = spapr_dtb_pre_load,
>>>       .fields = (const VMStateField[]) {
>>>           VMSTATE_UINT32(fdt_initial_size, SpaprMachineState),
>
>