Skip to contentSkip to conversation

s390x: protvirt: Fix stray error_report_err in s390_machine_protect

PATCH Applied Janosch Frank 3 participants 3 messages Mar 26, 2020 – Mar 27, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390x: protvirt: Fix stray error_report_err in s390_machine_protect

In case the protection of the machine fails at s390_pv_vm_enable(), we'll currently report the local_error variable. Problem is that there's no migration blocker error that we can report at this point so the pointer is always NULL which leads to a SEGFAULT.

Let's remove the error report.

Fixes 520935eedf941da3 ("s390x: protvirt: Add migration blocker")
---
 hw/s390x/s390-virtio-ccw.c | 1 -
 1 file changed, 1 deletion(-)
hw/s390x/s390-virtio-ccw.c +0 -1
index 3cf19c99f3468b7d..855ecf370d6e82fa 100644
@@ -358,7 +358,6 @@ static int s390_machine_protect(S390CcwMachineState *ms)
     rc = s390_pv_vm_enable();
     if (rc) {
         qemu_balloon_inhibit(false);
-        error_report_err(local_err);
         migrate_del_blocker(pv_mig_blocker);
         error_free_or_abort(&pv_mig_blocker);
         return rc;
Signature · 1 line
2.25.1
#1 lore raw
Quoted 6 lines · On Thu, 26 Mar 2020 10:05:05 -0400 Janosch Frank <[email protected]> wrote:

In case the protection of the machine fails at s390_pv_vm_enable(), we'll currently report the local_error variable. Problem is that there's no migration blocker error that we can report at this point so the pointer is always NULL which leads to a SEGFAULT.

Let's remove the error report.

Yes, s390_pvm_vm_enable() will already moan on error.

Quoted 4 lines
Fixes 520935eedf941da3 ("s390x: protvirt: Add migration blocker")

Note to self: update commit ID before I send a pull request (I will at least need to rebase for a headers update...)

Quoted 9 lines
---
 hw/s390x/s390-virtio-ccw.c | 1 -
 1 file changed, 1 deletion(-)
hw/s390x/s390-virtio-ccw.c +0 -0
index 3cf19c99f3468b7d..855ecf370d6e82fa 100644

hw/s390x/s390-virtio-ccw.c static int s390_machine_protect(S390CcwMachineState *ms) · line 363

Quoted 7 lines
hw/s390x/s390-virtio-ccw.c +0 -1
@@ -358,7 +358,6 @@ static int s390_machine_protect(S390CcwMachineState *ms)
     rc = s390_pv_vm_enable();
     if (rc) {
         qemu_balloon_inhibit(false);
-        error_report_err(local_err);
         migrate_del_blocker(pv_mig_blocker);
         error_free_or_abort(&pv_mig_blocker);
         return rc;

Thanks, applied.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Janosch Frank
Quoted 20 lines · Janosch Frank

In case the protection of the machine fails at s390_pv_vm_enable(), we'll currently report the local_error variable. Problem is that there's no migration blocker error that we can report at this point so the pointer is always NULL which leads to a SEGFAULT.

Let's remove the error report.

Fixes 520935eedf941da3 ("s390x: protvirt: Add migration blocker")
---
 hw/s390x/s390-virtio-ccw.c | 1 -
 1 file changed, 1 deletion(-)
hw/s390x/s390-virtio-ccw.c +0 -0
index 3cf19c99f3468b7d..855ecf370d6e82fa 100644

hw/s390x/s390-virtio-ccw.c static int s390_machine_protect(S390CcwMachineState *ms) · line 363

Quoted 7 lines
hw/s390x/s390-virtio-ccw.c +0 -1
@@ -358,7 +358,6 @@ static int s390_machine_protect(S390CcwMachineState *ms)
     rc = s390_pv_vm_enable();
     if (rc) {
         qemu_balloon_inhibit(false);
-        error_report_err(local_err);
         migrate_del_blocker(pv_mig_blocker);
         error_free_or_abort(&pv_mig_blocker);
         return rc;
Signature · 3 lines
Thanks,

David / dhildenb