thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
29b115
From 9ddefaedf423ec03eadaf17496c14e0d7b2381c8 Mon Sep 17 00:00:00 2001
29b115
From: Cornelia Huck <cohuck@redhat.com>
29b115
Date: Thu, 28 Jul 2022 16:24:46 +0200
29b115
Subject: [PATCH 30/32] kvm: don't use perror() without useful errno
29b115
29b115
RH-Author: Cornelia Huck <cohuck@redhat.com>
29b115
RH-MergeRequest: 110: kvm: don't use perror() without useful errno
29b115
RH-Commit: [1/1] 20e51aac6767c1f89f74c7d692d1fb7689eff5f0 (cohuck/qemu-kvm-c9s)
29b115
RH-Bugzilla: 2095608
29b115
RH-Acked-by: Eric Auger <eric.auger@redhat.com>
29b115
RH-Acked-by: Thomas Huth <thuth@redhat.com>
29b115
RH-Acked-by: Gavin Shan <gshan@redhat.com>
29b115
29b115
perror() is designed to append the decoded errno value to a
29b115
string. This, however, only makes sense if we called something that
29b115
actually sets errno prior to that.
29b115
29b115
For the callers that check for split irqchip support that is not the
29b115
case, and we end up with confusing error messages that end in
29b115
"success". Use error_report() instead.
29b115
29b115
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
29b115
Message-Id: <20220728142446.438177-1-cohuck@redhat.com>
29b115
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
29b115
29b115
https://bugzilla.redhat.com/show_bug.cgi?id=2095608
29b115
(cherry picked from commit 47c182fe8b03c0c40059fb95840923e65c9bdb4f)
29b115
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
29b115
---
29b115
 accel/kvm/kvm-all.c | 2 +-
29b115
 target/arm/kvm.c    | 2 +-
29b115
 2 files changed, 2 insertions(+), 2 deletions(-)
29b115
29b115
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
29b115
index 5f1377ca04..e9c7947640 100644
29b115
--- a/accel/kvm/kvm-all.c
29b115
+++ b/accel/kvm/kvm-all.c
29b115
@@ -2254,7 +2254,7 @@ static void kvm_irqchip_create(KVMState *s)
29b115
     ret = kvm_arch_irqchip_create(s);
29b115
     if (ret == 0) {
29b115
         if (s->kernel_irqchip_split == ON_OFF_AUTO_ON) {
29b115
-            perror("Split IRQ chip mode not supported.");
29b115
+            error_report("Split IRQ chip mode not supported.");
29b115
             exit(1);
29b115
         } else {
29b115
             ret = kvm_vm_ioctl(s, KVM_CREATE_IRQCHIP);
29b115
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
29b115
index bbf1ce7ba3..0a2ba1f8e3 100644
29b115
--- a/target/arm/kvm.c
29b115
+++ b/target/arm/kvm.c
29b115
@@ -960,7 +960,7 @@ void kvm_arch_init_irq_routing(KVMState *s)
29b115
 int kvm_arch_irqchip_create(KVMState *s)
29b115
 {
29b115
     if (kvm_kernel_irqchip_split()) {
29b115
-        perror("-machine kernel_irqchip=split is not supported on ARM.");
29b115
+        error_report("-machine kernel_irqchip=split is not supported on ARM.");
29b115
         exit(1);
29b115
     }
29b115
 
29b115
-- 
29b115
2.31.1
29b115