diff mbox

[2/2] pseries: set boot-device property only if boot order specified

Message ID 1350986975-21786-3-git-send-email-aviksil@linux.vnet.ibm.com
State New
Headers show

Commit Message

Avik Sil Oct. 23, 2012, 10:09 a.m. UTC
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
---
 hw/spapr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

David Gibson Oct. 23, 2012, 10:45 p.m. UTC | #1
On Tue, Oct 23, 2012 at 03:39:35PM +0530, Avik Sil wrote:
> Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>

As Anthony suggests, it would be better to explicitly remove the
normal default boot order in this patch, after adding it for
absolutely everything in the first patch.

This also needs a better patch comment, explaining the significance of
the presence/absence of the property on firmware behaviour.

> ---
>  hw/spapr.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/spapr.c b/hw/spapr.c
> index 637b3fb..1b2340c 100644
> --- a/hw/spapr.c
> +++ b/hw/spapr.c
> @@ -283,7 +283,9 @@ static void *spapr_create_fdt_skel(const char *cpu_model,
>  
>          _FDT((fdt_property(fdt, "qemu,boot-kernel", &kprop, sizeof(kprop))));
>      }
> -    _FDT((fdt_property_string(fdt, "qemu,boot-device", boot_device)));
> +    if (boot_device) {
> +        _FDT((fdt_property_string(fdt, "qemu,boot-device", boot_device)));
> +    }
>      _FDT((fdt_property_cell(fdt, "qemu,graphic-width", graphic_width)));
>      _FDT((fdt_property_cell(fdt, "qemu,graphic-height", graphic_height)));
>      _FDT((fdt_property_cell(fdt, "qemu,graphic-depth", graphic_depth)));
Avik Sil Oct. 24, 2012, 2:01 a.m. UTC | #2
On 10/24/2012 04:15 AM, David Gibson wrote:
> On Tue, Oct 23, 2012 at 03:39:35PM +0530, Avik Sil wrote:
>> Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
> 
> As Anthony suggests, it would be better to explicitly remove the
> normal default boot order in this patch, after adding it for
> absolutely everything in the first patch.
> 
> This also needs a better patch comment, explaining the significance of
> the presence/absence of the property on firmware behaviour.
> 
Sure. Shall I make the boot order for pseries as NULL string or empty
string? Current patch handles NULL string.

Regards,
Avik

>> ---
>>  hw/spapr.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/spapr.c b/hw/spapr.c
>> index 637b3fb..1b2340c 100644
>> --- a/hw/spapr.c
>> +++ b/hw/spapr.c
>> @@ -283,7 +283,9 @@ static void *spapr_create_fdt_skel(const char *cpu_model,
>>  
>>          _FDT((fdt_property(fdt, "qemu,boot-kernel", &kprop, sizeof(kprop))));
>>      }
>> -    _FDT((fdt_property_string(fdt, "qemu,boot-device", boot_device)));
>> +    if (boot_device) {
>> +        _FDT((fdt_property_string(fdt, "qemu,boot-device", boot_device)));
>> +    }
>>      _FDT((fdt_property_cell(fdt, "qemu,graphic-width", graphic_width)));
>>      _FDT((fdt_property_cell(fdt, "qemu,graphic-height", graphic_height)));
>>      _FDT((fdt_property_cell(fdt, "qemu,graphic-depth", graphic_depth)));
>
David Gibson Oct. 24, 2012, 3:54 a.m. UTC | #3
On Wed, Oct 24, 2012 at 07:31:19AM +0530, Avik Sil wrote:
> On 10/24/2012 04:15 AM, David Gibson wrote:
> > On Tue, Oct 23, 2012 at 03:39:35PM +0530, Avik Sil wrote:
> >> Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
> > 
> > As Anthony suggests, it would be better to explicitly remove the
> > normal default boot order in this patch, after adding it for
> > absolutely everything in the first patch.
> > 
> > This also needs a better patch comment, explaining the significance of
> > the presence/absence of the property on firmware behaviour.
> > 
> Sure. Shall I make the boot order for pseries as NULL string or empty
> string? Current patch handles NULL string.

NULL is better, I think.
diff mbox

Patch

diff --git a/hw/spapr.c b/hw/spapr.c
index 637b3fb..1b2340c 100644
--- a/hw/spapr.c
+++ b/hw/spapr.c
@@ -283,7 +283,9 @@  static void *spapr_create_fdt_skel(const char *cpu_model,
 
         _FDT((fdt_property(fdt, "qemu,boot-kernel", &kprop, sizeof(kprop))));
     }
-    _FDT((fdt_property_string(fdt, "qemu,boot-device", boot_device)));
+    if (boot_device) {
+        _FDT((fdt_property_string(fdt, "qemu,boot-device", boot_device)));
+    }
     _FDT((fdt_property_cell(fdt, "qemu,graphic-width", graphic_width)));
     _FDT((fdt_property_cell(fdt, "qemu,graphic-height", graphic_height)));
     _FDT((fdt_property_cell(fdt, "qemu,graphic-depth", graphic_depth)));