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 <da...@gibson.dropbear.id.au> > ---
> @@ -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(). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature