aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2018-08-15 21:37:37 +0800
committerMarkus Armbruster <armbru@redhat.com>2018-08-28 18:21:38 +0200
commit3ab72385b21d8d66df3f5fea42097ce264dc9d6b (patch)
tree47e25323bfe6a14e3cd5bdf66cdc6b94dbfa9533 /hw
parentbdd2d42b890b3a908fa3fbdc9661541e1b57eb15 (diff)
downloadqemu-3ab72385b21d8d66df3f5fea42097ce264dc9d6b.zip
qemu-3ab72385b21d8d66df3f5fea42097ce264dc9d6b.tar.gz
qemu-3ab72385b21d8d66df3f5fea42097ce264dc9d6b.tar.bz2
qapi: Drop qapi_event_send_FOO()'s Error ** argument
The generated qapi_event_send_FOO() take an Error ** argument. They can't actually fail, because all they do with the argument is passing it to functions that can't fail: the QObject output visitor, and the @qmp_emit callback, which is either monitor_qapi_event_queue() or event_test_emit(). Drop the argument, and pass &error_abort to the QObject output visitor and @qmp_emit instead. Suggested-by: Eric Blake <eblake@redhat.com> Suggested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180815133747.25032-4-peterx@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> [Commit message rewritten, update to qapi-code-gen.txt corrected] Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/acpi/core.c2
-rw-r--r--hw/acpi/cpu.c2
-rw-r--r--hw/acpi/memory_hotplug.c5
-rw-r--r--hw/char/virtio-console.c3
-rw-r--r--hw/core/qdev.c3
-rw-r--r--hw/net/virtio-net.c2
-rw-r--r--hw/ppc/spapr_rtc.c2
-rw-r--r--hw/timer/mc146818rtc.c2
-rw-r--r--hw/virtio/virtio-balloon.c3
-rw-r--r--hw/watchdog/watchdog.c15
10 files changed, 17 insertions, 22 deletions
diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index b8d3901..aafdc61 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -570,7 +570,7 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val)
break;
default:
if (sus_typ == ar->pm1.cnt.s4_val) { /* S4 request */
- qapi_event_send_suspend_disk(&error_abort);
+ qapi_event_send_suspend_disk();
qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
}
break;
diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
index 5ae595e..d19b772 100644
--- a/hw/acpi/cpu.c
+++ b/hw/acpi/cpu.c
@@ -160,7 +160,7 @@ static void cpu_hotplug_wr(void *opaque, hwaddr addr, uint64_t data,
cdev = &cpu_st->devs[cpu_st->selector];
cdev->ost_status = data;
info = acpi_cpu_device_status(cpu_st->selector, cdev);
- qapi_event_send_acpi_device_ost(info, &error_abort);
+ qapi_event_send_acpi_device_ost(info);
qapi_free_ACPIOSTInfo(info);
trace_cpuhp_acpi_write_ost_status(cpu_st->selector,
cdev->ost_status);
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index 0ff1712..8c7c101 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -161,7 +161,7 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data,
/* TODO: implement memory removal on guest signal */
info = acpi_memory_device_status(mem_st->selector, mdev);
- qapi_event_send_acpi_device_ost(info, &error_abort);
+ qapi_event_send_acpi_device_ost(info);
qapi_free_ACPIOSTInfo(info);
break;
case 0x14: /* set is_* fields */
@@ -185,8 +185,7 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data,
if (local_err) {
trace_mhp_acpi_pc_dimm_delete_failed(mem_st->selector);
qapi_event_send_mem_unplug_error(dev->id,
- error_get_pretty(local_err),
- &error_abort);
+ error_get_pretty(local_err));
error_free(local_err);
break;
}
diff --git a/hw/char/virtio-console.c b/hw/char/virtio-console.c
index 679a824..2cbe1d4 100644
--- a/hw/char/virtio-console.c
+++ b/hw/char/virtio-console.c
@@ -114,8 +114,7 @@ static void set_guest_connected(VirtIOSerialPort *port, int guest_connected)
}
if (dev->id) {
- qapi_event_send_vserport_change(dev->id, guest_connected,
- &error_abort);
+ qapi_event_send_vserport_change(dev->id, guest_connected);
}
}
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 529b82d..36b788a 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -1000,8 +1000,7 @@ static void device_finalize(Object *obj)
if (dev->pending_deleted_event) {
g_assert(dev->canonical_path);
- qapi_event_send_device_deleted(!!dev->id, dev->id, dev->canonical_path,
- &error_abort);
+ qapi_event_send_device_deleted(!!dev->id, dev->id, dev->canonical_path);
g_free(dev->canonical_path);
dev->canonical_path = NULL;
}
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index f154756..4bdd5b8 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -329,7 +329,7 @@ static void rxfilter_notify(NetClientState *nc)
if (nc->rxfilter_notify_enabled) {
gchar *path = object_get_canonical_path(OBJECT(n->qdev));
qapi_event_send_nic_rx_filter_changed(!!n->netclient_name,
- n->netclient_name, path, &error_abort);
+ n->netclient_name, path);
g_free(path);
/* disable event notification to avoid events flooding */
diff --git a/hw/ppc/spapr_rtc.c b/hw/ppc/spapr_rtc.c
index a373605..cd049f3 100644
--- a/hw/ppc/spapr_rtc.c
+++ b/hw/ppc/spapr_rtc.c
@@ -118,7 +118,7 @@ static void rtas_set_time_of_day(PowerPCCPU *cpu, sPAPRMachineState *spapr,
}
/* Generate a monitor event for the change */
- qapi_event_send_rtc_change(qemu_timedate_diff(&tm), &error_abort);
+ qapi_event_send_rtc_change(qemu_timedate_diff(&tm));
host_ns = qemu_clock_get_ns(rtc_clock);
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index a504f03..acee47d 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -635,7 +635,7 @@ static void rtc_set_time(RTCState *s)
s->base_rtc = mktimegm(&tm);
s->last_update = qemu_clock_get_ns(rtc_clock);
- qapi_event_send_rtc_change(qemu_timedate_diff(&tm), &error_abort);
+ qapi_event_send_rtc_change(qemu_timedate_diff(&tm));
}
static void rtc_set_cmos(RTCState *s, const struct tm *tm)
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index b542508..1728e4f 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -365,8 +365,7 @@ static void virtio_balloon_set_config(VirtIODevice *vdev,
dev->actual = le32_to_cpu(config.actual);
if (dev->actual != oldactual) {
qapi_event_send_balloon_change(vm_ram_size -
- ((ram_addr_t) dev->actual << VIRTIO_BALLOON_PFN_SHIFT),
- &error_abort);
+ ((ram_addr_t) dev->actual << VIRTIO_BALLOON_PFN_SHIFT));
}
trace_virtio_balloon_set_config(dev->actual, oldactual);
}
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 6e8ba06..33e6c20 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -102,17 +102,17 @@ void watchdog_perform_action(void)
{
switch (watchdog_action) {
case WATCHDOG_ACTION_RESET: /* same as 'system_reset' in monitor */
- qapi_event_send_watchdog(WATCHDOG_ACTION_RESET, &error_abort);
+ qapi_event_send_watchdog(WATCHDOG_ACTION_RESET);
qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
break;
case WATCHDOG_ACTION_SHUTDOWN: /* same as 'system_powerdown' in monitor */
- qapi_event_send_watchdog(WATCHDOG_ACTION_SHUTDOWN, &error_abort);
+ qapi_event_send_watchdog(WATCHDOG_ACTION_SHUTDOWN);
qemu_system_powerdown_request();
break;
case WATCHDOG_ACTION_POWEROFF: /* same as 'quit' command in monitor */
- qapi_event_send_watchdog(WATCHDOG_ACTION_POWEROFF, &error_abort);
+ qapi_event_send_watchdog(WATCHDOG_ACTION_POWEROFF);
exit(0);
case WATCHDOG_ACTION_PAUSE: /* same as 'stop' command in monitor */
@@ -120,22 +120,21 @@ void watchdog_perform_action(void)
* you would get a deadlock. Bypass the problem.
*/
qemu_system_vmstop_request_prepare();
- qapi_event_send_watchdog(WATCHDOG_ACTION_PAUSE, &error_abort);
+ qapi_event_send_watchdog(WATCHDOG_ACTION_PAUSE);
qemu_system_vmstop_request(RUN_STATE_WATCHDOG);
break;
case WATCHDOG_ACTION_DEBUG:
- qapi_event_send_watchdog(WATCHDOG_ACTION_DEBUG, &error_abort);
+ qapi_event_send_watchdog(WATCHDOG_ACTION_DEBUG);
fprintf(stderr, "watchdog: timer fired\n");
break;
case WATCHDOG_ACTION_NONE:
- qapi_event_send_watchdog(WATCHDOG_ACTION_NONE, &error_abort);
+ qapi_event_send_watchdog(WATCHDOG_ACTION_NONE);
break;
case WATCHDOG_ACTION_INJECT_NMI:
- qapi_event_send_watchdog(WATCHDOG_ACTION_INJECT_NMI,
- &error_abort);
+ qapi_event_send_watchdog(WATCHDOG_ACTION_INJECT_NMI);
nmi_monitor_handle(0, NULL);
break;