diff mbox

kvm-all: trace: strerror fixup

Message ID 1454355464-14999-1-git-send-email-drjones@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrew Jones Feb. 1, 2016, 7:37 p.m. UTC
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 kvm-all.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Paolo Bonzini Feb. 4, 2016, 12:14 p.m. UTC | #1
On 01/02/2016 20:37, Andrew Jones wrote:
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
>  kvm-all.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kvm-all.c b/kvm-all.c
> index 9148889921197..330f509a0da84 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -2362,7 +2362,7 @@ int kvm_set_one_reg(CPUState *cs, uint64_t id, void *source)
>      reg.addr = (uintptr_t) source;
>      r = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
>      if (r) {
> -        trace_kvm_failed_reg_set(id, strerror(r));
> +        trace_kvm_failed_reg_set(id, strerror(-r));
>      }
>      return r;
>  }
> @@ -2376,7 +2376,7 @@ int kvm_get_one_reg(CPUState *cs, uint64_t id, void *target)
>      reg.addr = (uintptr_t) target;
>      r = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
>      if (r) {
> -        trace_kvm_failed_reg_get(id, strerror(r));
> +        trace_kvm_failed_reg_get(id, strerror(-r));
>      }
>      return r;
>  }
> 

Applied, thanks!

Paolo
diff mbox

Patch

diff --git a/kvm-all.c b/kvm-all.c
index 9148889921197..330f509a0da84 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -2362,7 +2362,7 @@  int kvm_set_one_reg(CPUState *cs, uint64_t id, void *source)
     reg.addr = (uintptr_t) source;
     r = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
     if (r) {
-        trace_kvm_failed_reg_set(id, strerror(r));
+        trace_kvm_failed_reg_set(id, strerror(-r));
     }
     return r;
 }
@@ -2376,7 +2376,7 @@  int kvm_get_one_reg(CPUState *cs, uint64_t id, void *target)
     reg.addr = (uintptr_t) target;
     r = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
     if (r) {
-        trace_kvm_failed_reg_get(id, strerror(r));
+        trace_kvm_failed_reg_get(id, strerror(-r));
     }
     return r;
 }