[PATCH 00/15] spapr: Error handling fixes and cleanups (round 2)

Greg Kurz posted 15 patches 3 years, 7 months ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora failed
Test checkpatch failed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200914123505.612812-1-groug@kaod.org
Maintainers: David Gibson <david@gibson.dropbear.id.au>
include/hw/ppc/spapr.h        |  4 +-
include/hw/ppc/spapr_drc.h    |  2 +-
include/hw/ppc/spapr_nvdimm.h |  4 +-
target/ppc/cpu.h              |  4 +-
hw/ppc/spapr.c                | 76 ++++++++++++-----------------------
hw/ppc/spapr_caps.c           |  7 +++-
hw/ppc/spapr_cpu_core.c       | 24 +++++------
hw/ppc/spapr_drc.c            | 17 ++++----
hw/ppc/spapr_hcall.c          | 34 +++++++---------
hw/ppc/spapr_nvdimm.c         | 24 +++++------
hw/ppc/spapr_pci.c            |  5 +--
hw/ppc/spapr_vio.c            | 12 +++---
target/ppc/compat.c           | 26 +++++++-----
target/ppc/machine.c          |  9 +++--
14 files changed, 108 insertions(+), 140 deletions(-)
[PATCH 00/15] spapr: Error handling fixes and cleanups (round 2)
Posted by Greg Kurz 3 years, 7 months ago
Yet another round of sanitizing the error handling in spapr. I've
identified locations that needed fixing with the errp-guard.cocci
coccinelle script. It turns out that a better result is achieved
by fixing manually, especially by converting some void functions
to indicate success/failure with a return value.

Greg Kurz (15):
  spapr: Fix error leak in spapr_realize_vcpu()
  ppc: Add a return value to ppc_set_compat() and ppc_set_compat_all()
  ppc: Fix return value in cpu_post_load() error path
  spapr: Simplify error handling in callers of ppc_set_compat()
  spapr: Get rid of cas_check_pvr() error reporting
  spapr: Simplify error handling in do_client_architecture_support()
  spapr: Simplify error handling in spapr_vio_busdev_realize()
  spapr: Add a return value to spapr_drc_attach()
  spapr: Simplify error handling in prop_get_fdt()
  spapr: Add a return value to spapr_set_vcpu_id()
  spapr: Simplify error handling in spapr_cpu_core_realize()
  spapr: Add a return value to spapr_nvdimm_validate()
  spapr: Add a return value to spapr_check_pagesize()
  spapr: Simplify error handling in spapr_memory_plug()
  spapr: Simplify error handling in spapr_memory_unplug_request()

 include/hw/ppc/spapr.h        |  4 +-
 include/hw/ppc/spapr_drc.h    |  2 +-
 include/hw/ppc/spapr_nvdimm.h |  4 +-
 target/ppc/cpu.h              |  4 +-
 hw/ppc/spapr.c                | 76 ++++++++++++-----------------------
 hw/ppc/spapr_caps.c           |  7 +++-
 hw/ppc/spapr_cpu_core.c       | 24 +++++------
 hw/ppc/spapr_drc.c            | 17 ++++----
 hw/ppc/spapr_hcall.c          | 34 +++++++---------
 hw/ppc/spapr_nvdimm.c         | 24 +++++------
 hw/ppc/spapr_pci.c            |  5 +--
 hw/ppc/spapr_vio.c            | 12 +++---
 target/ppc/compat.c           | 26 +++++++-----
 target/ppc/machine.c          |  9 +++--
 14 files changed, 108 insertions(+), 140 deletions(-)

-- 
2.26.2



Re: [PATCH 00/15] spapr: Error handling fixes and cleanups (round 2)
Posted by David Gibson 3 years, 7 months ago
On Mon, Sep 14, 2020 at 02:34:50PM +0200, Greg Kurz wrote:
> Yet another round of sanitizing the error handling in spapr. I've
> identified locations that needed fixing with the errp-guard.cocci
> coccinelle script. It turns out that a better result is achieved
> by fixing manually, especially by converting some void functions
> to indicate success/failure with a return value.

1..4 applied to ppc-for-5.2, I'll look at the rest in due course.

> 
> Greg Kurz (15):
>   spapr: Fix error leak in spapr_realize_vcpu()
>   ppc: Add a return value to ppc_set_compat() and ppc_set_compat_all()
>   ppc: Fix return value in cpu_post_load() error path
>   spapr: Simplify error handling in callers of ppc_set_compat()
>   spapr: Get rid of cas_check_pvr() error reporting
>   spapr: Simplify error handling in do_client_architecture_support()
>   spapr: Simplify error handling in spapr_vio_busdev_realize()
>   spapr: Add a return value to spapr_drc_attach()
>   spapr: Simplify error handling in prop_get_fdt()
>   spapr: Add a return value to spapr_set_vcpu_id()
>   spapr: Simplify error handling in spapr_cpu_core_realize()
>   spapr: Add a return value to spapr_nvdimm_validate()
>   spapr: Add a return value to spapr_check_pagesize()
>   spapr: Simplify error handling in spapr_memory_plug()
>   spapr: Simplify error handling in spapr_memory_unplug_request()
> 
>  include/hw/ppc/spapr.h        |  4 +-
>  include/hw/ppc/spapr_drc.h    |  2 +-
>  include/hw/ppc/spapr_nvdimm.h |  4 +-
>  target/ppc/cpu.h              |  4 +-
>  hw/ppc/spapr.c                | 76 ++++++++++++-----------------------
>  hw/ppc/spapr_caps.c           |  7 +++-
>  hw/ppc/spapr_cpu_core.c       | 24 +++++------
>  hw/ppc/spapr_drc.c            | 17 ++++----
>  hw/ppc/spapr_hcall.c          | 34 +++++++---------
>  hw/ppc/spapr_nvdimm.c         | 24 +++++------
>  hw/ppc/spapr_pci.c            |  5 +--
>  hw/ppc/spapr_vio.c            | 12 +++---
>  target/ppc/compat.c           | 26 +++++++-----
>  target/ppc/machine.c          |  9 +++--
>  14 files changed, 108 insertions(+), 140 deletions(-)
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Re: [PATCH 00/15] spapr: Error handling fixes and cleanups (round 2)
Posted by David Gibson 3 years, 7 months ago
On Wed, Sep 16, 2020 at 12:49:38PM +1000, David Gibson wrote:
> On Mon, Sep 14, 2020 at 02:34:50PM +0200, Greg Kurz wrote:
> > Yet another round of sanitizing the error handling in spapr. I've
> > identified locations that needed fixing with the errp-guard.cocci
> > coccinelle script. It turns out that a better result is achieved
> > by fixing manually, especially by converting some void functions
> > to indicate success/failure with a return value.
> 
> 1..4 applied to ppc-for-5.2, I'll look at the rest in due course.

5..13 now applied as well.

> 
> > 
> > Greg Kurz (15):
> >   spapr: Fix error leak in spapr_realize_vcpu()
> >   ppc: Add a return value to ppc_set_compat() and ppc_set_compat_all()
> >   ppc: Fix return value in cpu_post_load() error path
> >   spapr: Simplify error handling in callers of ppc_set_compat()
> >   spapr: Get rid of cas_check_pvr() error reporting
> >   spapr: Simplify error handling in do_client_architecture_support()
> >   spapr: Simplify error handling in spapr_vio_busdev_realize()
> >   spapr: Add a return value to spapr_drc_attach()
> >   spapr: Simplify error handling in prop_get_fdt()
> >   spapr: Add a return value to spapr_set_vcpu_id()
> >   spapr: Simplify error handling in spapr_cpu_core_realize()
> >   spapr: Add a return value to spapr_nvdimm_validate()
> >   spapr: Add a return value to spapr_check_pagesize()
> >   spapr: Simplify error handling in spapr_memory_plug()
> >   spapr: Simplify error handling in spapr_memory_unplug_request()
> > 
> >  include/hw/ppc/spapr.h        |  4 +-
> >  include/hw/ppc/spapr_drc.h    |  2 +-
> >  include/hw/ppc/spapr_nvdimm.h |  4 +-
> >  target/ppc/cpu.h              |  4 +-
> >  hw/ppc/spapr.c                | 76 ++++++++++++-----------------------
> >  hw/ppc/spapr_caps.c           |  7 +++-
> >  hw/ppc/spapr_cpu_core.c       | 24 +++++------
> >  hw/ppc/spapr_drc.c            | 17 ++++----
> >  hw/ppc/spapr_hcall.c          | 34 +++++++---------
> >  hw/ppc/spapr_nvdimm.c         | 24 +++++------
> >  hw/ppc/spapr_pci.c            |  5 +--
> >  hw/ppc/spapr_vio.c            | 12 +++---
> >  target/ppc/compat.c           | 26 +++++++-----
> >  target/ppc/machine.c          |  9 +++--
> >  14 files changed, 108 insertions(+), 140 deletions(-)
> > 
> 



-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson