diff mbox

[v3,3/4] xlnx-zynqmp.c: Convert some of the error_propagate() calls to error_abort

Message ID a01d5ad2468378f45f3c6621fb4ee2786d86c267.1440705929.git.alistair.francis@xilinx.com
State New
Headers show

Commit Message

Alistair Francis Aug. 27, 2015, 8:47 p.m. UTC
Convert all of the non-realize error_propagate() calls into error_abort
calls as they shouldn't be user visible failure cases.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
---

 hw/arm/xlnx-zynqmp.c |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

Comments

Peter Crosthwaite Aug. 27, 2015, 9:32 p.m. UTC | #1
On Thu, Aug 27, 2015 at 1:47 PM, Alistair Francis
<alistair.francis@xilinx.com> wrote:
> Convert all of the non-realize error_propagate() calls into error_abort
> calls as they shouldn't be user visible failure cases.
>
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>

So normally these are needed to catch bad usages of -cpu to CPUs that
don't have these props, but since ZynqMP doesn't allow -cpu these are
promotable to fatal error.

Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>

> ---
>
>  hw/arm/xlnx-zynqmp.c |   14 ++------------
>  1 files changed, 2 insertions(+), 12 deletions(-)
>
> diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
> index 388baef..6756c74 100644
> --- a/hw/arm/xlnx-zynqmp.c
> +++ b/hw/arm/xlnx-zynqmp.c
> @@ -162,12 +162,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
>          g_free(name);
>
>          object_property_set_int(OBJECT(&s->apu_cpu[i]), GIC_BASE_ADDR,
> -                                "reset-cbar", &err);
> -        if (err) {
> -            error_propagate((errp), (err));
> -            return;
> -        }
> -
> +                                "reset-cbar", &error_abort);
>          object_property_set_bool(OBJECT(&s->apu_cpu[i]), true, "realized",
>                                   &err);
>          if (err) {
> @@ -200,12 +195,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
>          g_free(name);
>
>          object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "reset-hivecs",
> -                                 &err);
> -        if (err != NULL) {
> -            error_propagate(errp, err);
> -            return;
> -        }
> -
> +                                 &error_abort);
>          object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "realized",
>                                   &err);
>          if (err) {
> --
> 1.7.1
>
Alistair Francis Aug. 27, 2015, 9:50 p.m. UTC | #2
On Thu, Aug 27, 2015 at 2:32 PM, Peter Crosthwaite
<crosthwaitepeter@gmail.com> wrote:
> On Thu, Aug 27, 2015 at 1:47 PM, Alistair Francis
> <alistair.francis@xilinx.com> wrote:
>> Convert all of the non-realize error_propagate() calls into error_abort
>> calls as they shouldn't be user visible failure cases.
>>
>> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
>
> So normally these are needed to catch bad usages of -cpu to CPUs that
> don't have these props, but since ZynqMP doesn't allow -cpu these are
> promotable to fatal error.
>
> Reviewed-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>

Thanks Peter

Alistair

>
>> ---
>>
>>  hw/arm/xlnx-zynqmp.c |   14 ++------------
>>  1 files changed, 2 insertions(+), 12 deletions(-)
>>
>> diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
>> index 388baef..6756c74 100644
>> --- a/hw/arm/xlnx-zynqmp.c
>> +++ b/hw/arm/xlnx-zynqmp.c
>> @@ -162,12 +162,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
>>          g_free(name);
>>
>>          object_property_set_int(OBJECT(&s->apu_cpu[i]), GIC_BASE_ADDR,
>> -                                "reset-cbar", &err);
>> -        if (err) {
>> -            error_propagate((errp), (err));
>> -            return;
>> -        }
>> -
>> +                                "reset-cbar", &error_abort);
>>          object_property_set_bool(OBJECT(&s->apu_cpu[i]), true, "realized",
>>                                   &err);
>>          if (err) {
>> @@ -200,12 +195,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
>>          g_free(name);
>>
>>          object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "reset-hivecs",
>> -                                 &err);
>> -        if (err != NULL) {
>> -            error_propagate(errp, err);
>> -            return;
>> -        }
>> -
>> +                                 &error_abort);
>>          object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "realized",
>>                                   &err);
>>          if (err) {
>> --
>> 1.7.1
>>
>
diff mbox

Patch

diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 388baef..6756c74 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -162,12 +162,7 @@  static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
         g_free(name);
 
         object_property_set_int(OBJECT(&s->apu_cpu[i]), GIC_BASE_ADDR,
-                                "reset-cbar", &err);
-        if (err) {
-            error_propagate((errp), (err));
-            return;
-        }
-
+                                "reset-cbar", &error_abort);
         object_property_set_bool(OBJECT(&s->apu_cpu[i]), true, "realized",
                                  &err);
         if (err) {
@@ -200,12 +195,7 @@  static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
         g_free(name);
 
         object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "reset-hivecs",
-                                 &err);
-        if (err != NULL) {
-            error_propagate(errp, err);
-            return;
-        }
-
+                                 &error_abort);
         object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "realized",
                                  &err);
         if (err) {