qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ppc/pnv: check for firmware file presence
@ 2017-09-25  8:33 Cédric Le Goater
  2017-09-25  8:46 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
  0 siblings, 1 reply; 5+ messages in thread
From: Cédric Le Goater @ 2017-09-25  8:33 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel, David Gibson, Greg Kurz; +Cc: Cédric Le Goater

and exit before uslessly trying to load it if the file does
not exists.

Issue dicovered by Coverity Scan.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 hw/ppc/pnv.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 47221158d415..7728eece2eec 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -570,6 +570,10 @@ static void ppc_powernv_init(MachineState *machine)
     }
 
     fw_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
+    if (!fw_filename) {
+        error_report("Could not find OPAL '%s'", bios_name);
+        exit(1);
+    }
 
     fw_size = load_image_targphys(fw_filename, FW_LOAD_ADDR, FW_MAX_SIZE);
     if (fw_size < 0) {
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc/pnv: check for firmware file presence
  2017-09-25  8:33 [Qemu-devel] [PATCH] ppc/pnv: check for firmware file presence Cédric Le Goater
@ 2017-09-25  8:46 ` Thomas Huth
  2017-09-25  8:52   ` Cédric Le Goater
  2017-09-25  8:52   ` Greg Kurz
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Huth @ 2017-09-25  8:46 UTC (permalink / raw)
  To: Cédric Le Goater, qemu-ppc, qemu-devel, David Gibson,
	Greg Kurz

On 25.09.2017 10:33, Cédric Le Goater wrote:
> and exit before uslessly trying to load it if the file does

s/uslessly/uselessly/

> not exists.
> 
> Issue dicovered by Coverity Scan.

/dicovered/discovered/

> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>  hw/ppc/pnv.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 47221158d415..7728eece2eec 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -570,6 +570,10 @@ static void ppc_powernv_init(MachineState *machine)
>      }
>  
>      fw_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
> +    if (!fw_filename) {
> +        error_report("Could not find OPAL '%s'", bios_name);

I'd suggest to say "OPAL firmware" instead of just "OPAL". Not every
user knows what OPAL is.

> +        exit(1);
> +    }
>  
>      fw_size = load_image_targphys(fw_filename, FW_LOAD_ADDR, FW_MAX_SIZE);
>      if (fw_size < 0) {
> 

 Thomas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc/pnv: check for firmware file presence
  2017-09-25  8:46 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
@ 2017-09-25  8:52   ` Cédric Le Goater
  2017-09-25  8:52   ` Greg Kurz
  1 sibling, 0 replies; 5+ messages in thread
From: Cédric Le Goater @ 2017-09-25  8:52 UTC (permalink / raw)
  To: Thomas Huth, qemu-ppc, qemu-devel, David Gibson, Greg Kurz

On 09/25/2017 10:46 AM, Thomas Huth wrote:
> On 25.09.2017 10:33, Cédric Le Goater wrote:
>> and exit before uslessly trying to load it if the file does
> 
> s/uslessly/uselessly/
> 
>> not exists.
>>
>> Issue dicovered by Coverity Scan.
> 
> /dicovered/discovered/

arg. Sorry about that.

>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>> ---
>>  hw/ppc/pnv.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
>> index 47221158d415..7728eece2eec 100644
>> --- a/hw/ppc/pnv.c
>> +++ b/hw/ppc/pnv.c
>> @@ -570,6 +570,10 @@ static void ppc_powernv_init(MachineState *machine)
>>      }
>>  
>>      fw_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
>> +    if (!fw_filename) {
>> +        error_report("Could not find OPAL '%s'", bios_name);
> 
> I'd suggest to say "OPAL firmware" instead of just "OPAL". Not every
> user knows what OPAL is.

Yes it deserves a resend anyhow.

thanks,

C. 

>> +        exit(1);
>> +    }
>>  
>>      fw_size = load_image_targphys(fw_filename, FW_LOAD_ADDR, FW_MAX_SIZE);
>>      if (fw_size < 0) {
>>
> 
>  Thomas
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc/pnv: check for firmware file presence
  2017-09-25  8:46 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
  2017-09-25  8:52   ` Cédric Le Goater
@ 2017-09-25  8:52   ` Greg Kurz
  2017-09-25  9:00     ` Cédric Le Goater
  1 sibling, 1 reply; 5+ messages in thread
From: Greg Kurz @ 2017-09-25  8:52 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Cédric Le Goater, qemu-ppc, qemu-devel, David Gibson

On Mon, 25 Sep 2017 10:46:13 +0200
Thomas Huth <thuth@redhat.com> wrote:

> On 25.09.2017 10:33, Cédric Le Goater wrote:
> > and exit before uslessly trying to load it if the file does  
> 
> s/uslessly/uselessly/
> 
> > not exists.
> > 
> > Issue dicovered by Coverity Scan.  
> 
> /dicovered/discovered/
> 

Mentioning the Coverity Id (ie, CID 1381410) is also a usual practice.

> > Signed-off-by: Cédric Le Goater <clg@kaod.org>
> > ---
> >  hw/ppc/pnv.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> > index 47221158d415..7728eece2eec 100644
> > --- a/hw/ppc/pnv.c
> > +++ b/hw/ppc/pnv.c
> > @@ -570,6 +570,10 @@ static void ppc_powernv_init(MachineState *machine)
> >      }
> >  
> >      fw_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
> > +    if (!fw_filename) {
> > +        error_report("Could not find OPAL '%s'", bios_name);  
> 
> I'd suggest to say "OPAL firmware" instead of just "OPAL". Not every
> user knows what OPAL is.
> 

With all the suggested changes:

Reviewed-by: Greg Kurz <groug@kaod.org>

> > +        exit(1);
> > +    }
> >  
> >      fw_size = load_image_targphys(fw_filename, FW_LOAD_ADDR, FW_MAX_SIZE);
> >      if (fw_size < 0) {
> >   
> 
>  Thomas



-- 
Gregory Kurz                                     kurzgreg@fr.ibm.com
                                                 gkurz@linux.vnet.ibm.com
Software Engineer @ IBM/LTC                      http://www.ibm.com
Tel 33-5-6218-1607

"Anarchy is about taking complete responsibility for yourself."
        Alan Moore.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc/pnv: check for firmware file presence
  2017-09-25  8:52   ` Greg Kurz
@ 2017-09-25  9:00     ` Cédric Le Goater
  0 siblings, 0 replies; 5+ messages in thread
From: Cédric Le Goater @ 2017-09-25  9:00 UTC (permalink / raw)
  To: Greg Kurz, Thomas Huth; +Cc: qemu-ppc, qemu-devel, David Gibson

On 09/25/2017 10:52 AM, Greg Kurz wrote:
> On Mon, 25 Sep 2017 10:46:13 +0200
> Thomas Huth <thuth@redhat.com> wrote:
> 
>> On 25.09.2017 10:33, Cédric Le Goater wrote:
>>> and exit before uslessly trying to load it if the file does  
>>
>> s/uslessly/uselessly/
>>
>>> not exists.
>>>
>>> Issue dicovered by Coverity Scan.  
>>
>> /dicovered/discovered/
>>
> 
> Mentioning the Coverity Id (ie, CID 1381410) is also a usual practice.


ah. too late :/

C. 

>>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>>> ---
>>>  hw/ppc/pnv.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
>>> index 47221158d415..7728eece2eec 100644
>>> --- a/hw/ppc/pnv.c
>>> +++ b/hw/ppc/pnv.c
>>> @@ -570,6 +570,10 @@ static void ppc_powernv_init(MachineState *machine)
>>>      }
>>>  
>>>      fw_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
>>> +    if (!fw_filename) {
>>> +        error_report("Could not find OPAL '%s'", bios_name);  
>>
>> I'd suggest to say "OPAL firmware" instead of just "OPAL". Not every
>> user knows what OPAL is.
>>
> 
> With all the suggested changes:
> 
> Reviewed-by: Greg Kurz <groug@kaod.org>
> 
>>> +        exit(1);
>>> +    }
>>>  
>>>      fw_size = load_image_targphys(fw_filename, FW_LOAD_ADDR, FW_MAX_SIZE);
>>>      if (fw_size < 0) {
>>>   
>>
>>  Thomas
> 
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-25  9:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-25  8:33 [Qemu-devel] [PATCH] ppc/pnv: check for firmware file presence Cédric Le Goater
2017-09-25  8:46 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
2017-09-25  8:52   ` Cédric Le Goater
2017-09-25  8:52   ` Greg Kurz
2017-09-25  9:00     ` Cédric Le Goater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).