diff mbox series

[kvmtool,5/6] arm: pmu: Improve PMU error reporting

Message ID 20190125180801.209910-6-andre.przywara@arm.com (mailing list archive)
State New, archived
Headers show
Series Various convenience fixes | expand

Commit Message

Andre Przywara Jan. 25, 2019, 6:08 p.m. UTC
The KVM ioctls mostly just return -1 in the error case, leaving the
actual error code in errno.

Change the output of the PMU error message to actually print this error
code instead of the generic -1.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arm/pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arm/pmu.c b/arm/pmu.c
index 69c37fae..ffd152e2 100644
--- a/arm/pmu.c
+++ b/arm/pmu.c
@@ -18,7 +18,7 @@  static int set_pmu_attr(struct kvm *kvm, int vcpu_idx,
 	if (!ret) {
 		ret = ioctl(fd, KVM_SET_DEVICE_ATTR, attr);
 		if (ret)
-			pr_err("PMU KVM_SET_DEVICE_ATTR failed (%d)\n", ret);
+			perror("PMU KVM_SET_DEVICE_ATTR failed");
 	} else {
 		pr_err("Unsupported PMU on vcpu%d\n", vcpu_idx);
 	}