[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH 01/11] ppc: Cleanup error handling in
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH 01/11] ppc: Cleanup error handling in ppc_set_compat() |
Date: |
Mon, 14 Dec 2015 11:54:34 +1100 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Fri, Dec 11, 2015 at 06:58:12AM -0700, Eric Blake wrote:
> On 12/10/2015 05:11 PM, David Gibson wrote:
> > Current ppc_set_compat() returns -1 for errors, and also (unconditionally)
> > reports an error message. The caller in h_client_architecture_support()
> > may then report it again using an outdated fprintf().
> >
> > Clean this up by using the modern error reporting mechanisms.
> >
> > Signed-off-by: David Gibson <address@hidden>
> > ---
>
> > @@ -9208,12 +9208,13 @@ int ppc_set_compat(PowerPCCPU *cpu, uint32_t
> > cpu_version)
> > break;
> > }
> >
> > - if (kvm_enabled() && kvmppc_set_compat(cpu, cpu->cpu_version) < 0) {
> > - error_report("Unable to set compatibility mode in KVM");
> > - ret = -1;
> > + if (kvm_enabled()) {
> > + ret = kvmppc_set_compat(cpu, cpu->cpu_version);
> > + if (ret < 0) {
> > + error_setg(errp, "Unable to set CPU compatibility mode in KVM:
> > %s",
> > + strerror(-ret));
> > + }
>
> Could use error_setg_errno() here instead of manually calling strerror().
Ah, thanks, I hadn't spotted that function before.
--
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
signature.asc
Description: PGP signature
- Re: [Qemu-ppc] [Qemu-devel] [PATCH 02/11] pseries: Cleanup error handling of spapr_cpu_init(), (continued)
- [Qemu-ppc] [PATCH 06/11] pseries: Improve error handling in find_unknown_sysbus_device(), David Gibson, 2015/12/10
- [Qemu-ppc] [PATCH 01/11] ppc: Cleanup error handling in ppc_set_compat(), David Gibson, 2015/12/10
- [Qemu-ppc] [PATCH 09/11] pseries: Clean up error handling in xics_system_init(), David Gibson, 2015/12/10
- [Qemu-ppc] [PATCH 05/11] pseries: Cleanup error handling in spapr_vga_init(), David Gibson, 2015/12/10
- [Qemu-ppc] [PATCH 10/11] pseries: Clean up error handling in ppc_spapr_init(), David Gibson, 2015/12/10
- [Qemu-ppc] [PATCH 07/11] pseries: Cleanup error handling in spapr_kvm_type(), David Gibson, 2015/12/10