]> git.proxmox.com Git - mirror_qemu.git/commitdiff
kvm: don't use perror() without useful errno
authorCornelia Huck <cohuck@redhat.com>
Thu, 28 Jul 2022 14:24:46 +0000 (16:24 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 28 Jul 2022 22:15:02 +0000 (00:15 +0200)
perror() is designed to append the decoded errno value to a
string. This, however, only makes sense if we called something that
actually sets errno prior to that.

For the callers that check for split irqchip support that is not the
case, and we end up with confusing error messages that end in
"success". Use error_report() instead.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20220728142446.438177-1-cohuck@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
accel/kvm/kvm-all.c
target/arm/kvm.c

index f165074e99156bf1f7ee6b19f5e295a68900e276..645f0a249ace7c95bf3665d76b51bb898993e171 100644 (file)
@@ -2265,7 +2265,7 @@ static void kvm_irqchip_create(KVMState *s)
     ret = kvm_arch_irqchip_create(s);
     if (ret == 0) {
         if (s->kernel_irqchip_split == ON_OFF_AUTO_ON) {
-            perror("Split IRQ chip mode not supported.");
+            error_report("Split IRQ chip mode not supported.");
             exit(1);
         } else {
             ret = kvm_vm_ioctl(s, KVM_CREATE_IRQCHIP);
index 4339e1cd6e08a9dd372f587ec79808875a0cb056..e5c1bd50d29baf1795ae38b93ac13eac53965f46 100644 (file)
@@ -959,7 +959,7 @@ void kvm_arch_init_irq_routing(KVMState *s)
 int kvm_arch_irqchip_create(KVMState *s)
 {
     if (kvm_kernel_irqchip_split()) {
-        perror("-machine kernel_irqchip=split is not supported on ARM.");
+        error_report("-machine kernel_irqchip=split is not supported on ARM.");
         exit(1);
     }