qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/8] Error reporting patches for 2025-03-21
@ 2025-03-21 14:51 Markus Armbruster
  2025-03-21 14:51 ` [PULL 1/8] cryptodev: Fix error handling in cryptodev_lkcf_execute_task() Markus Armbruster
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Markus Armbruster @ 2025-03-21 14:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha

The following changes since commit 1dae461a913f9da88df05de6e2020d3134356f2e:

  Update version for v10.0.0-rc0 release (2025-03-18 10:18:14 -0400)

are available in the Git repository at:

  https://repo.or.cz/qemu/armbru.git tags/pull-error-2025-03-21

for you to fetch changes up to a725bc970e3091499be8be52798c21259f91b2cd:

  target/loongarch: Clean up virt_cpu_irq_init() error handling (2025-03-20 07:58:19 +0100)

----------------------------------------------------------------
Error reporting patches for 2025-03-21

----------------------------------------------------------------
Bibo Mao (4):
      target/loongarch: Fix error handling of KVM feature checks
      hw/loongarch/virt: Eliminate error_propagate()
      target/loongarch: Remove unnecessary temporary variable assignment
      target/loongarch: Clean up virt_cpu_irq_init() error handling

Markus Armbruster (4):
      cryptodev: Fix error handling in cryptodev_lkcf_execute_task()
      error: Strip trailing '\n' from an error string argument
      hw/xen: Fix xen_bus_realize() error handling
      hw/xen: Downgrade a xen_bus_realize() non-error to warning

 backends/cryptodev-lkcf.c         |  3 +++
 hw/loongarch/virt.c               | 39 +++++++++++++++------------------------
 hw/xen/xen-bus.c                  |  8 ++++----
 target/loongarch/kvm/kvm.c        |  8 ++++++--
 target/loongarch/tcg/tlb_helper.c |  5 ++---
 net/vmnet-common.m                |  2 +-
 6 files changed, 31 insertions(+), 34 deletions(-)

-- 
2.48.1



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PULL 1/8] cryptodev: Fix error handling in cryptodev_lkcf_execute_task()
  2025-03-21 14:51 [PULL 0/8] Error reporting patches for 2025-03-21 Markus Armbruster
@ 2025-03-21 14:51 ` Markus Armbruster
  2025-03-21 14:51 ` [PULL 2/8] error: Strip trailing '\n' from an error string argument Markus Armbruster
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Markus Armbruster @ 2025-03-21 14:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, zhenwei pi

When cryptodev_lkcf_set_op_desc() fails, we report an error, but
continue anyway.  This is wrong.  We then pass a non-null @local_error
to various functions, which could easily fail error_setv()'s assertion
on failure.

Fail the function instead.

When qcrypto_akcipher_new() fails, we fail the function without
reporting the error.  This leaks the Error object.

Add the missing error reporting.  This also frees the Error object.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250312101131.1615777-1-armbru@redhat.com>
Reviewed-by: zhenwei pi <pizhenwei@bytedance.com>
---
 backends/cryptodev-lkcf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/backends/cryptodev-lkcf.c b/backends/cryptodev-lkcf.c
index 41cf24b737..352c3e8958 100644
--- a/backends/cryptodev-lkcf.c
+++ b/backends/cryptodev-lkcf.c
@@ -330,6 +330,8 @@ static void cryptodev_lkcf_execute_task(CryptoDevLKCFTask *task)
             cryptodev_lkcf_set_op_desc(&session->akcipher_opts, op_desc,
                                        sizeof(op_desc), &local_error) != 0) {
             error_report_err(local_error);
+            status = -VIRTIO_CRYPTO_ERR;
+            goto out;
         } else {
             key_id = add_key(KCTL_KEY_TYPE_PKEY, "lkcf-backend-priv-key",
                              p8info, p8info_len, KCTL_KEY_RING);
@@ -346,6 +348,7 @@ static void cryptodev_lkcf_execute_task(CryptoDevLKCFTask *task)
                                         session->key, session->keylen,
                                         &local_error);
         if (!akcipher) {
+            error_report_err(local_error);
             status = -VIRTIO_CRYPTO_ERR;
             goto out;
         }
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PULL 2/8] error: Strip trailing '\n' from an error string argument
  2025-03-21 14:51 [PULL 0/8] Error reporting patches for 2025-03-21 Markus Armbruster
  2025-03-21 14:51 ` [PULL 1/8] cryptodev: Fix error handling in cryptodev_lkcf_execute_task() Markus Armbruster
@ 2025-03-21 14:51 ` Markus Armbruster
  2025-03-21 14:51 ` [PULL 3/8] hw/xen: Fix xen_bus_realize() error handling Markus Armbruster
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Markus Armbruster @ 2025-03-21 14:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, Peter Maydell, Philippe Mathieu-Daudé, Song Gao

Tracked down with scripts/coccinelle/err-bad-newline.cocci.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250312143504.1659061-1-armbru@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Song Gao <gaosong@loongson.cn>
---
 net/vmnet-common.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/vmnet-common.m b/net/vmnet-common.m
index 54d900ba67..ab33ce2b0c 100644
--- a/net/vmnet-common.m
+++ b/net/vmnet-common.m
@@ -94,7 +94,7 @@ ssize_t vmnet_receive_common(NetClientState *nc,
 
     if_status = vmnet_write(s->vmnet_if, &packet, &pkt_cnt);
     if (if_status != VMNET_SUCCESS) {
-        error_report("vmnet: write error: %s\n",
+        error_report("vmnet: write error: %s",
                      vmnet_status_map_str(if_status));
         return -1;
     }
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PULL 3/8] hw/xen: Fix xen_bus_realize() error handling
  2025-03-21 14:51 [PULL 0/8] Error reporting patches for 2025-03-21 Markus Armbruster
  2025-03-21 14:51 ` [PULL 1/8] cryptodev: Fix error handling in cryptodev_lkcf_execute_task() Markus Armbruster
  2025-03-21 14:51 ` [PULL 2/8] error: Strip trailing '\n' from an error string argument Markus Armbruster
@ 2025-03-21 14:51 ` Markus Armbruster
  2025-03-21 14:51 ` [PULL 4/8] hw/xen: Downgrade a xen_bus_realize() non-error to warning Markus Armbruster
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Markus Armbruster @ 2025-03-21 14:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, Stefano Stabellini

The Error ** argument must be NULL, &error_abort, &error_fatal, or a
pointer to a variable containing NULL.  Passing an argument of the
latter kind twice without clearing it in between is wrong: if the
first call sets an error, it no longer points to NULL for the second
call.

xen_bus_realize() is wrong that way: it passes &local_err to
xs_node_watch() in a loop.  If this fails in more than one iteration,
it can trip error_setv()'s assertion.

Fix by clearing @local_err.

Fixes: c4583c8c394e (xen-bus: reduce scope of backend watch)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250314143500.2449658-2-armbru@redhat.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 hw/xen/xen-bus.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c
index 8260f1e1bb..2aacc1436f 100644
--- a/hw/xen/xen-bus.c
+++ b/hw/xen/xen-bus.c
@@ -357,6 +357,7 @@ static void xen_bus_realize(BusState *bus, Error **errp)
             error_reportf_err(local_err,
                               "failed to set up '%s' enumeration watch: ",
                               type[i]);
+            local_err = NULL;
         }
 
         g_free(node);
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PULL 4/8] hw/xen: Downgrade a xen_bus_realize() non-error to warning
  2025-03-21 14:51 [PULL 0/8] Error reporting patches for 2025-03-21 Markus Armbruster
                   ` (2 preceding siblings ...)
  2025-03-21 14:51 ` [PULL 3/8] hw/xen: Fix xen_bus_realize() error handling Markus Armbruster
@ 2025-03-21 14:51 ` Markus Armbruster
  2025-03-21 14:51 ` [PULL 5/8] target/loongarch: Fix error handling of KVM feature checks Markus Armbruster
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Markus Armbruster @ 2025-03-21 14:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, Stefano Stabellini

xen_bus_realize() reports a failure to set up a watch as error, but it
doesn't treat it as one: it simply continues.  Report a warning
instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250314143500.2449658-3-armbru@redhat.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 hw/xen/xen-bus.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c
index 2aacc1436f..f808a01813 100644
--- a/hw/xen/xen-bus.c
+++ b/hw/xen/xen-bus.c
@@ -353,10 +353,9 @@ static void xen_bus_realize(BusState *bus, Error **errp)
             xs_node_watch(xenbus->xsh, node, key, xen_bus_backend_changed,
                           xenbus, &local_err);
         if (local_err) {
-            /* This need not be treated as a hard error so don't propagate */
-            error_reportf_err(local_err,
-                              "failed to set up '%s' enumeration watch: ",
-                              type[i]);
+            warn_reportf_err(local_err,
+                             "failed to set up '%s' enumeration watch: ",
+                             type[i]);
             local_err = NULL;
         }
 
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PULL 5/8] target/loongarch: Fix error handling of KVM feature checks
  2025-03-21 14:51 [PULL 0/8] Error reporting patches for 2025-03-21 Markus Armbruster
                   ` (3 preceding siblings ...)
  2025-03-21 14:51 ` [PULL 4/8] hw/xen: Downgrade a xen_bus_realize() non-error to warning Markus Armbruster
@ 2025-03-21 14:51 ` Markus Armbruster
  2025-03-21 14:51 ` [PULL 6/8] hw/loongarch/virt: Eliminate error_propagate() Markus Armbruster
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Markus Armbruster @ 2025-03-21 14:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, Bibo Mao, Philippe Mathieu-Daudé

From: Bibo Mao <maobibo@loongson.cn>

For some paravirt KVM features, if user forces to enable it however
KVM does not support, qemu should fail to run and exit immediately,
rather than continue to run. Here set error message and return directly
in function kvm_arch_init_vcpu().

Fixes: 6edd2a9bec90 (target/loongarch/kvm: Implement LoongArch PMU extension)
Fixes: 936c3f4d7916 (target/loongarch: Use auto method with LSX feature)
Fixes: 5e360dabedb1 (target/loongarch: Use auto method with LASX feature)
Fixes: 620d9bd0022e (target/loongarch: Add paravirt ipi feature detection)
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250320032158.1762751-2-maobibo@loongson.cn>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 target/loongarch/kvm/kvm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/target/loongarch/kvm/kvm.c b/target/loongarch/kvm/kvm.c
index 28735c80be..7f63e7c8fe 100644
--- a/target/loongarch/kvm/kvm.c
+++ b/target/loongarch/kvm/kvm.c
@@ -1081,7 +1081,6 @@ int kvm_arch_init_vcpu(CPUState *cs)
     int ret;
     Error *local_err = NULL;
 
-    ret = 0;
     qemu_add_vm_change_state_handler(kvm_loongarch_vm_stage_change, cs);
 
     if (!kvm_get_one_reg(cs, KVM_REG_LOONGARCH_DEBUG_INST, &val)) {
@@ -1091,29 +1090,34 @@ int kvm_arch_init_vcpu(CPUState *cs)
     ret = kvm_cpu_check_lsx(cs, &local_err);
     if (ret < 0) {
         error_report_err(local_err);
+        return ret;
     }
 
     ret = kvm_cpu_check_lasx(cs, &local_err);
     if (ret < 0) {
         error_report_err(local_err);
+        return ret;
     }
 
     ret = kvm_cpu_check_lbt(cs, &local_err);
     if (ret < 0) {
         error_report_err(local_err);
+        return ret;
     }
 
     ret = kvm_cpu_check_pmu(cs, &local_err);
     if (ret < 0) {
         error_report_err(local_err);
+        return ret;
     }
 
     ret = kvm_cpu_check_pv_features(cs, &local_err);
     if (ret < 0) {
         error_report_err(local_err);
+        return ret;
     }
 
-    return ret;
+    return 0;
 }
 
 static bool loongarch_get_lbt(Object *obj, Error **errp)
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PULL 6/8] hw/loongarch/virt: Eliminate error_propagate()
  2025-03-21 14:51 [PULL 0/8] Error reporting patches for 2025-03-21 Markus Armbruster
                   ` (4 preceding siblings ...)
  2025-03-21 14:51 ` [PULL 5/8] target/loongarch: Fix error handling of KVM feature checks Markus Armbruster
@ 2025-03-21 14:51 ` Markus Armbruster
  2025-03-21 14:51 ` [PULL 7/8] target/loongarch: Remove unnecessary temporary variable assignment Markus Armbruster
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Markus Armbruster @ 2025-03-21 14:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, Bibo Mao

From: Bibo Mao <maobibo@loongson.cn>

When there is an error, it is put into a local variable and then
propagated to somewhere else. Instead the error can be set right
away, error propagation can be removed.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Message-ID: <20250320032158.1762751-5-maobibo@loongson.cn>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/loongarch/virt.c | 32 +++++++++++---------------------
 1 file changed, 11 insertions(+), 21 deletions(-)

diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index a5840ff968..4674bd9163 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -859,30 +859,29 @@ static void virt_cpu_pre_plug(HotplugHandler *hotplug_dev,
     LoongArchCPU *cpu = LOONGARCH_CPU(dev);
     CPUState *cs = CPU(dev);
     CPUArchId *cpu_slot;
-    Error *err = NULL;
     LoongArchCPUTopo topo;
     int arch_id;
 
     if (lvms->acpi_ged) {
         if ((cpu->thread_id < 0) || (cpu->thread_id >= ms->smp.threads)) {
-            error_setg(&err,
+            error_setg(errp,
                        "Invalid thread-id %u specified, must be in range 1:%u",
                        cpu->thread_id, ms->smp.threads - 1);
-            goto out;
+            return;
         }
 
         if ((cpu->core_id < 0) || (cpu->core_id >= ms->smp.cores)) {
-            error_setg(&err,
+            error_setg(errp,
                        "Invalid core-id %u specified, must be in range 1:%u",
                        cpu->core_id, ms->smp.cores - 1);
-            goto out;
+            return;
         }
 
         if ((cpu->socket_id < 0) || (cpu->socket_id >= ms->smp.sockets)) {
-            error_setg(&err,
+            error_setg(errp,
                        "Invalid socket-id %u specified, must be in range 1:%u",
                        cpu->socket_id, ms->smp.sockets - 1);
-            goto out;
+            return;
         }
 
         topo.socket_id = cpu->socket_id;
@@ -891,11 +890,11 @@ static void virt_cpu_pre_plug(HotplugHandler *hotplug_dev,
         arch_id =  virt_get_arch_id_from_topo(ms, &topo);
         cpu_slot = virt_find_cpu_slot(ms, arch_id);
         if (CPU(cpu_slot->cpu)) {
-            error_setg(&err,
+            error_setg(errp,
                        "cpu(id%d=%d:%d:%d) with arch-id %" PRIu64 " exists",
                        cs->cpu_index, cpu->socket_id, cpu->core_id,
                        cpu->thread_id, cpu_slot->arch_id);
-            goto out;
+            return;
         }
     } else {
         /* For cold-add cpu, find empty cpu slot */
@@ -911,33 +910,24 @@ static void virt_cpu_pre_plug(HotplugHandler *hotplug_dev,
     cpu->env.address_space_iocsr = &lvms->as_iocsr;
     cpu->phy_id = cpu_slot->arch_id;
     cs->cpu_index = cpu_slot - ms->possible_cpus->cpus;
-    numa_cpu_pre_plug(cpu_slot, dev, &err);
-out:
-    if (err) {
-        error_propagate(errp, err);
-    }
+    numa_cpu_pre_plug(cpu_slot, dev, errp);
 }
 
 static void virt_cpu_unplug_request(HotplugHandler *hotplug_dev,
                                     DeviceState *dev, Error **errp)
 {
     LoongArchVirtMachineState *lvms = LOONGARCH_VIRT_MACHINE(hotplug_dev);
-    Error *err = NULL;
     LoongArchCPU *cpu = LOONGARCH_CPU(dev);
     CPUState *cs = CPU(dev);
 
     if (cs->cpu_index == 0) {
-        error_setg(&err, "hot-unplug of boot cpu(id%d=%d:%d:%d) not supported",
+        error_setg(errp, "hot-unplug of boot cpu(id%d=%d:%d:%d) not supported",
                    cs->cpu_index, cpu->socket_id,
                    cpu->core_id, cpu->thread_id);
-        error_propagate(errp, err);
         return;
     }
 
-    hotplug_handler_unplug_request(HOTPLUG_HANDLER(lvms->acpi_ged), dev, &err);
-    if (err) {
-        error_propagate(errp, err);
-    }
+    hotplug_handler_unplug_request(HOTPLUG_HANDLER(lvms->acpi_ged), dev, errp);
 }
 
 static void virt_cpu_unplug(HotplugHandler *hotplug_dev,
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PULL 7/8] target/loongarch: Remove unnecessary temporary variable assignment
  2025-03-21 14:51 [PULL 0/8] Error reporting patches for 2025-03-21 Markus Armbruster
                   ` (5 preceding siblings ...)
  2025-03-21 14:51 ` [PULL 6/8] hw/loongarch/virt: Eliminate error_propagate() Markus Armbruster
@ 2025-03-21 14:51 ` Markus Armbruster
  2025-03-21 14:51 ` [PULL 8/8] target/loongarch: Clean up virt_cpu_irq_init() error handling Markus Armbruster
  2025-03-23 22:29 ` [PULL 0/8] Error reporting patches for 2025-03-21 Stefan Hajnoczi
  8 siblings, 0 replies; 10+ messages in thread
From: Markus Armbruster @ 2025-03-21 14:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, Bibo Mao, Philippe Mathieu-Daudé

From: Bibo Mao <maobibo@loongson.cn>

Temporary variable ret is assigned at last line and return, it can
be removed and return directly.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250320032158.1762751-6-maobibo@loongson.cn>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 target/loongarch/tcg/tlb_helper.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/target/loongarch/tcg/tlb_helper.c b/target/loongarch/tcg/tlb_helper.c
index 646dbf59de..182881a237 100644
--- a/target/loongarch/tcg/tlb_helper.c
+++ b/target/loongarch/tcg/tlb_helper.c
@@ -543,7 +543,7 @@ target_ulong helper_lddir(CPULoongArchState *env, target_ulong base,
                           target_ulong level, uint32_t mem_idx)
 {
     CPUState *cs = env_cpu(env);
-    target_ulong badvaddr, index, phys, ret;
+    target_ulong badvaddr, index, phys;
     uint64_t dir_base, dir_width;
 
     if (unlikely((level == 0) || (level > 4))) {
@@ -571,8 +571,7 @@ target_ulong helper_lddir(CPULoongArchState *env, target_ulong base,
     get_dir_base_width(env, &dir_base, &dir_width, level);
     index = (badvaddr >> dir_base) & ((1 << dir_width) - 1);
     phys = base | index << 3;
-    ret = ldq_phys(cs->as, phys) & TARGET_PHYS_MASK;
-    return ret;
+    return ldq_phys(cs->as, phys) & TARGET_PHYS_MASK;
 }
 
 void helper_ldpte(CPULoongArchState *env, target_ulong base, target_ulong odd,
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PULL 8/8] target/loongarch: Clean up virt_cpu_irq_init() error handling
  2025-03-21 14:51 [PULL 0/8] Error reporting patches for 2025-03-21 Markus Armbruster
                   ` (6 preceding siblings ...)
  2025-03-21 14:51 ` [PULL 7/8] target/loongarch: Remove unnecessary temporary variable assignment Markus Armbruster
@ 2025-03-21 14:51 ` Markus Armbruster
  2025-03-23 22:29 ` [PULL 0/8] Error reporting patches for 2025-03-21 Stefan Hajnoczi
  8 siblings, 0 replies; 10+ messages in thread
From: Markus Armbruster @ 2025-03-21 14:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, Bibo Mao

From: Bibo Mao <maobibo@loongson.cn>

The Error ** argument must be NULL, &error_abort, &error_fatal, or a
pointer to a variable containing NULL. Passing an argument of the
latter kind twice without clearing it in between is wrong: if the
first call sets an error, it no longer points to NULL for the second
call.

virt_cpu_irq_init() is wrong that way: it passes &err to
hotplug_handler_plug() twice.  If both calls failed, this could trip
error_setv()'s assertion.  Moreover, if just one fails, the Error
object leaks. Fortunately, these calls can't actually fail.

Messed up in commit 50ebc3fc47f7 (hw/intc/loongarch_ipi: Notify ipi
object when cpu is plugged) and commit 087a23a87c57
(hw/intc/loongarch_extioi: Use cpu plug notification).

Clean this up by passing &error_abort instead.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Acked-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20250320032158.1762751-7-maobibo@loongson.cn>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/loongarch/virt.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index 4674bd9163..63477de5e4 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -327,7 +327,6 @@ static void virt_cpu_irq_init(LoongArchVirtMachineState *lvms)
     MachineClass *mc = MACHINE_GET_CLASS(ms);
     const CPUArchIdList *possible_cpus;
     CPUState *cs;
-    Error *err = NULL;
 
     /* cpu nodes */
     possible_cpus = mc->possible_cpu_arch_ids(ms);
@@ -337,8 +336,10 @@ static void virt_cpu_irq_init(LoongArchVirtMachineState *lvms)
             continue;
         }
 
-        hotplug_handler_plug(HOTPLUG_HANDLER(lvms->ipi), DEVICE(cs), &err);
-        hotplug_handler_plug(HOTPLUG_HANDLER(lvms->extioi), DEVICE(cs), &err);
+        hotplug_handler_plug(HOTPLUG_HANDLER(lvms->ipi), DEVICE(cs),
+                             &error_abort);
+        hotplug_handler_plug(HOTPLUG_HANDLER(lvms->extioi), DEVICE(cs),
+                             &error_abort);
     }
 }
 
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PULL 0/8] Error reporting patches for 2025-03-21
  2025-03-21 14:51 [PULL 0/8] Error reporting patches for 2025-03-21 Markus Armbruster
                   ` (7 preceding siblings ...)
  2025-03-21 14:51 ` [PULL 8/8] target/loongarch: Clean up virt_cpu_irq_init() error handling Markus Armbruster
@ 2025-03-23 22:29 ` Stefan Hajnoczi
  8 siblings, 0 replies; 10+ messages in thread
From: Stefan Hajnoczi @ 2025-03-23 22:29 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, stefanha

[-- Attachment #1: Type: text/plain, Size: 116 bytes --]

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-03-24 13:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-21 14:51 [PULL 0/8] Error reporting patches for 2025-03-21 Markus Armbruster
2025-03-21 14:51 ` [PULL 1/8] cryptodev: Fix error handling in cryptodev_lkcf_execute_task() Markus Armbruster
2025-03-21 14:51 ` [PULL 2/8] error: Strip trailing '\n' from an error string argument Markus Armbruster
2025-03-21 14:51 ` [PULL 3/8] hw/xen: Fix xen_bus_realize() error handling Markus Armbruster
2025-03-21 14:51 ` [PULL 4/8] hw/xen: Downgrade a xen_bus_realize() non-error to warning Markus Armbruster
2025-03-21 14:51 ` [PULL 5/8] target/loongarch: Fix error handling of KVM feature checks Markus Armbruster
2025-03-21 14:51 ` [PULL 6/8] hw/loongarch/virt: Eliminate error_propagate() Markus Armbruster
2025-03-21 14:51 ` [PULL 7/8] target/loongarch: Remove unnecessary temporary variable assignment Markus Armbruster
2025-03-21 14:51 ` [PULL 8/8] target/loongarch: Clean up virt_cpu_irq_init() error handling Markus Armbruster
2025-03-23 22:29 ` [PULL 0/8] Error reporting patches for 2025-03-21 Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).