aboutsummaryrefslogtreecommitdiff
path: root/hw/hyperv
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2022-11-21 09:50:45 +0100
committerMarkus Armbruster <armbru@redhat.com>2022-12-14 16:19:35 +0100
commit6c37ebf3301ca449ebe449138b86e55762503250 (patch)
tree1b0e28279ef42b2cce3936f961618c7dc627b0b7 /hw/hyperv
parent3d558330adec7233da6c48c5e8584eb176fb77d7 (diff)
downloadqemu-6c37ebf3301ca449ebe449138b86e55762503250.zip
qemu-6c37ebf3301ca449ebe449138b86e55762503250.tar.gz
qemu-6c37ebf3301ca449ebe449138b86e55762503250.tar.bz2
error: Drop some obviously superfluous error_propagate()
When error_propagate(errp, local_err) is the only reader of @local_err, we can just as well change its writers to write @errp directly, and drop the error_propagate() along with @local_err. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20221121085054.683122-2-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'hw/hyperv')
-rw-r--r--hw/hyperv/vmbus.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
index f956381..8ee08ae 100644
--- a/hw/hyperv/vmbus.c
+++ b/hw/hyperv/vmbus.c
@@ -2404,7 +2404,6 @@ static const TypeInfo vmbus_dev_type_info = {
static void vmbus_realize(BusState *bus, Error **errp)
{
int ret = 0;
- Error *local_err = NULL;
VMBus *vmbus = VMBUS(bus);
qemu_mutex_init(&vmbus->rx_queue_lock);
@@ -2415,13 +2414,13 @@ static void vmbus_realize(BusState *bus, Error **errp)
ret = hyperv_set_msg_handler(VMBUS_MESSAGE_CONNECTION_ID,
vmbus_recv_message, vmbus);
if (ret != 0) {
- error_setg(&local_err, "hyperv set message handler failed: %d", ret);
+ error_setg(errp, "hyperv set message handler failed: %d", ret);
goto error_out;
}
ret = event_notifier_init(&vmbus->notifier, 0);
if (ret != 0) {
- error_setg(&local_err, "event notifier failed to init with %d", ret);
+ error_setg(errp, "event notifier failed to init with %d", ret);
goto remove_msg_handler;
}
@@ -2429,7 +2428,7 @@ static void vmbus_realize(BusState *bus, Error **errp)
ret = hyperv_set_event_flag_handler(VMBUS_EVENT_CONNECTION_ID,
&vmbus->notifier);
if (ret != 0) {
- error_setg(&local_err, "hyperv set event handler failed with %d", ret);
+ error_setg(errp, "hyperv set event handler failed with %d", ret);
goto clear_event_notifier;
}
@@ -2441,7 +2440,6 @@ remove_msg_handler:
hyperv_set_msg_handler(VMBUS_MESSAGE_CONNECTION_ID, NULL, NULL);
error_out:
qemu_mutex_destroy(&vmbus->rx_queue_lock);
- error_propagate(errp, local_err);
}
static void vmbus_unrealize(BusState *bus)