Skip to contentSkip to conversation

s390x/event-facility: fix error propagation

PATCH Applied Cornelia Huck 5 participants 6 messages Jan 21, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390x/event-facility: fix error propagation

We currently check (by error) if the passed-in Error pointer errp is non-null and return after realizing the first child of the event facility in that case. Symptom is that 'virsh shutdown' does not work, as the sclpquiesce device is not realized.

Fix this by (correctly) checking the local Error err.

Fixes 3d508334dd2c ("s390x/event-facility: Fix realize() error API violations")
---
 hw/s390x/event-facility.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/event-facility.c +1 -1
index 8a93b8a1da97..9d6972afa8b3 100644
@@ -338,7 +338,7 @@ static void sclp_events_bus_realize(BusState *bus, Error **errp)
         DeviceState *dev = kid->child;
 
         object_property_set_bool(OBJECT(dev), true, "realized", &err);
-        if (errp) {
+        if (err) {
             error_propagate(errp, err);
             return;
         }
Signature · 1 line
2.21.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 20 lines · Cornelia Huck

We currently check (by error) if the passed-in Error pointer errp is non-null and return after realizing the first child of the event facility in that case. Symptom is that 'virsh shutdown' does not work, as the sclpquiesce device is not realized.

Fix this by (correctly) checking the local Error err.

Fixes 3d508334dd2c ("s390x/event-facility: Fix realize() error API violations")
---
 hw/s390x/event-facility.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/event-facility.c +0 -0
index 8a93b8a1da97..9d6972afa8b3 100644

hw/s390x/event-facility.c static void sclp_events_bus_realize(BusState *bus, Error **errp) · line 344

Quoted 8 lines
hw/s390x/event-facility.c +1 -1
@@ -338,7 +338,7 @@ static void sclp_events_bus_realize(BusState *bus, Error **errp)
         DeviceState *dev = kid->child;
 
         object_property_set_bool(OBJECT(dev), true, "realized", &err);
-        if (errp) {
+        if (err) {
             error_propagate(errp, err);
             return;
         }
Signature · 3 lines
Thanks,

David / dhildenb
Tested-by on v1 1/1
#2 lore raw
In reply to Cornelia Huck
Quoted 10 lines · Cornelia Huck

We currently check (by error) if the passed-in Error pointer errp is non-null and return after realizing the first child of the event facility in that case. Symptom is that 'virsh shutdown' does not work, as the sclpquiesce device is not realized.

Fix this by (correctly) checking the local Error err.

Fixes 3d508334dd2c ("s390x/event-facility: Fix realize() error API violations")
Quoted 18 lines
---
 hw/s390x/event-facility.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/event-facility.c +1 -1
index 8a93b8a1da97..9d6972afa8b3 100644
@@ -338,7 +338,7 @@ static void sclp_events_bus_realize(BusState *bus, Error **errp)
         DeviceState *dev = kid->child;
 
         object_property_set_bool(OBJECT(dev), true, "realized", &err);
-        if (errp) {
+        if (err) {
             error_propagate(errp, err);
             return;
         }
Reviewed-by on v1 1/1
#3 lore raw
In reply to Cornelia Huck
Quoted 20 lines · Cornelia Huck

We currently check (by error) if the passed-in Error pointer errp is non-null and return after realizing the first child of the event facility in that case. Symptom is that 'virsh shutdown' does not work, as the sclpquiesce device is not realized.

Fix this by (correctly) checking the local Error err.

Fixes 3d508334dd2c ("s390x/event-facility: Fix realize() error API violations")
---
 hw/s390x/event-facility.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/event-facility.c +0 -0
index 8a93b8a1da97..9d6972afa8b3 100644

hw/s390x/event-facility.c static void sclp_events_bus_realize(BusState *bus, Error **errp) · line 344

Quoted 8 lines
hw/s390x/event-facility.c +1 -1
@@ -338,7 +338,7 @@ static void sclp_events_bus_realize(BusState *bus, Error **errp)
         DeviceState *dev = kid->child;
 
         object_property_set_bool(OBJECT(dev), true, "realized", &err);
-        if (errp) {
+        if (err) {
             error_propagate(errp, err);
             return;
         }
Reviewed-by on v1 1/1
#4 lore raw
In reply to Cornelia Huck
Quoted 19 lines · Cornelia Huck

We currently check (by error) if the passed-in Error pointer errp is non-null and return after realizing the first child of the event facility in that case. Symptom is that 'virsh shutdown' does not work, as the sclpquiesce device is not realized.

Fix this by (correctly) checking the local Error err.

Fixes 3d508334dd2c ("s390x/event-facility: Fix realize() error API violations")
---
 hw/s390x/event-facility.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/event-facility.c +0 -0
index 8a93b8a1da97..9d6972afa8b3 100644

hw/s390x/event-facility.c static void sclp_events_bus_realize(BusState *bus, Error **errp) · line 344

Quoted 8 lines
hw/s390x/event-facility.c +1 -1
@@ -338,7 +338,7 @@ static void sclp_events_bus_realize(BusState *bus, Error **errp)
         DeviceState *dev = kid->child;
 
         object_property_set_bool(OBJECT(dev), true, "realized", &err);
-        if (errp) {
+        if (err) {
             error_propagate(errp, err);
             return;
         }

Thanks for cleaning the mess I made!

author Applied
#5 lore raw
In reply to Cornelia Huck
Quoted 19 lines · On Tue, 21 Jan 2020 10:55:06 +0100 Cornelia Huck <[email protected]> wrote:

We currently check (by error) if the passed-in Error pointer errp is non-null and return after realizing the first child of the event facility in that case. Symptom is that 'virsh shutdown' does not work, as the sclpquiesce device is not realized.

Fix this by (correctly) checking the local Error err.

Fixes 3d508334dd2c ("s390x/event-facility: Fix realize() error API violations")
---
 hw/s390x/event-facility.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/event-facility.c +0 -0
index 8a93b8a1da97..9d6972afa8b3 100644

hw/s390x/event-facility.c static void sclp_events_bus_realize(BusState *bus, Error **errp) · line 344

Quoted 8 lines
hw/s390x/event-facility.c +1 -1
@@ -338,7 +338,7 @@ static void sclp_events_bus_realize(BusState *bus, Error **errp)
         DeviceState *dev = kid->child;
 
         object_property_set_bool(OBJECT(dev), true, "realized", &err);
-        if (errp) {
+        if (err) {
             error_propagate(errp, err);
             return;
         }

Queued to s390-next.