qemu-kvm/kvm-kvm-don-t-use-perror-without-useful-errno.patch
Miroslav Rezanina 23d471091d * Mon Aug 08 2022 Miroslav Rezanina <mrezanin@redhat.com> - 7.0.0-10
- kvm-vhost-Track-descriptor-chain-in-private-at-SVQ.patch [bz#1939363]
- kvm-vhost-Fix-device-s-used-descriptor-dequeue.patch [bz#1939363]
- kvm-hw-virtio-Replace-g_memdup-by-g_memdup2.patch [bz#1939363]
- kvm-vhost-Fix-element-in-vhost_svq_add-failure.patch [bz#1939363]
- kvm-meson-create-have_vhost_-variables.patch [bz#1939363]
- kvm-meson-use-have_vhost_-variables-to-pick-sources.patch [bz#1939363]
- kvm-vhost-move-descriptor-translation-to-vhost_svq_vring.patch [bz#1939363]
- kvm-virtio-net-Expose-MAC_TABLE_ENTRIES.patch [bz#1939363]
- kvm-virtio-net-Expose-ctrl-virtqueue-logic.patch [bz#1939363]
- kvm-vdpa-Avoid-compiler-to-squash-reads-to-used-idx.patch [bz#1939363]
- kvm-vhost-Reorder-vhost_svq_kick.patch [bz#1939363]
- kvm-vhost-Move-vhost_svq_kick-call-to-vhost_svq_add.patch [bz#1939363]
- kvm-vhost-Check-for-queue-full-at-vhost_svq_add.patch [bz#1939363]
- kvm-vhost-Decouple-vhost_svq_add-from-VirtQueueElement.patch [bz#1939363]
- kvm-vhost-Add-SVQDescState.patch [bz#1939363]
- kvm-vhost-Track-number-of-descs-in-SVQDescState.patch [bz#1939363]
- kvm-vhost-add-vhost_svq_push_elem.patch [bz#1939363]
- kvm-vhost-Expose-vhost_svq_add.patch [bz#1939363]
- kvm-vhost-add-vhost_svq_poll.patch [bz#1939363]
- kvm-vhost-Add-svq-avail_handler-callback.patch [bz#1939363]
- kvm-vdpa-Export-vhost_vdpa_dma_map-and-unmap-calls.patch [bz#1939363]
- kvm-vhost-net-vdpa-add-stubs-for-when-no-virtio-net-devi.patch [bz#1939363]
- kvm-vdpa-manual-forward-CVQ-buffers.patch [bz#1939363]
- kvm-vdpa-Buffer-CVQ-support-on-shadow-virtqueue.patch [bz#1939363]
- kvm-vdpa-Extract-get-features-part-from-vhost_vdpa_get_m.patch [bz#1939363]
- kvm-vdpa-Add-device-migration-blocker.patch [bz#1939363]
- kvm-vdpa-Add-x-svq-to-NetdevVhostVDPAOptions.patch [bz#1939363]
- kvm-redhat-Update-linux-headers-linux-kvm.h-to-v5.18-rc6.patch [bz#2111994]
- kvm-target-s390x-kvm-Honor-storage-keys-during-emulation.patch [bz#2111994]
- kvm-kvm-don-t-use-perror-without-useful-errno.patch [bz#2095608]
- kvm-multifd-Copy-pages-before-compressing-them-with-zlib.patch [bz#2099934]
- kvm-Revert-migration-Simplify-unqueue_page.patch [bz#2099934]
- Resolves: bz#1939363
  (vDPA control virtqueue support in Qemu)
- Resolves: bz#2111994
  (RHEL9: skey test in kvm_unit_test got failed)
- Resolves: bz#2095608
  (Please correct the error message when try to start qemu with "-M kernel-irqchip=split")
- Resolves: bz#2099934
  (Guest reboot on destination host after postcopy migration completed)
2022-08-08 04:22:43 -04:00

63 lines
2.3 KiB
Diff

From 9ddefaedf423ec03eadaf17496c14e0d7b2381c8 Mon Sep 17 00:00:00 2001
From: Cornelia Huck <cohuck@redhat.com>
Date: Thu, 28 Jul 2022 16:24:46 +0200
Subject: [PATCH 30/32] kvm: don't use perror() without useful errno
RH-Author: Cornelia Huck <cohuck@redhat.com>
RH-MergeRequest: 110: kvm: don't use perror() without useful errno
RH-Commit: [1/1] 20e51aac6767c1f89f74c7d692d1fb7689eff5f0 (cohuck/qemu-kvm-c9s)
RH-Bugzilla: 2095608
RH-Acked-by: Eric Auger <eric.auger@redhat.com>
RH-Acked-by: Thomas Huth <thuth@redhat.com>
RH-Acked-by: Gavin Shan <gshan@redhat.com>
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>
https://bugzilla.redhat.com/show_bug.cgi?id=2095608
(cherry picked from commit 47c182fe8b03c0c40059fb95840923e65c9bdb4f)
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
accel/kvm/kvm-all.c | 2 +-
target/arm/kvm.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 5f1377ca04..e9c7947640 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2254,7 +2254,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);
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index bbf1ce7ba3..0a2ba1f8e3 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -960,7 +960,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);
}
--
2.31.1