From patchwork Tue Oct 1 15:52:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jP814hnlz9sP7 for ; Wed, 2 Oct 2019 01:58:41 +1000 (AEST) Received: from localhost ([::1]:43984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKXv-0004du-3V for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 11:58:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49873) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKT0-00080S-7m for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKSy-0006Vv-Te for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:34 -0400 Received: from relay.sw.ru ([185.231.240.75]:38356) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKSy-0006UX-KV for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:32 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSw-0004xb-7y; Tue, 01 Oct 2019 18:53:30 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 01/31] errp: rename errp to errp_in where it is IN-argument Date: Tue, 1 Oct 2019 18:52:49 +0300 Message-Id: <20191001155319.8066-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy , Michael Roth , Markus Armbruster , "Dr. David Alan Gilbert" , Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Error **errp is almost always OUT-argument: it's assumed to be NULL, or pointer to NULL-initialized pointer, or pointer to error_abort or error_fatal, for callee to report error. But very few functions instead get Error **errp as IN-argument: it's assumed to be set, and callee should clean it. In such cases, rename errp to errp_in. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- include/monitor/hmp.h | 2 +- include/qapi/error.h | 2 +- ui/vnc.h | 2 +- monitor/hmp-cmds.c | 8 ++++---- ui/vnc.c | 10 +++++----- util/error.c | 8 ++++---- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/monitor/hmp.h b/include/monitor/hmp.h index a0e9511440..f929814f1a 100644 --- a/include/monitor/hmp.h +++ b/include/monitor/hmp.h @@ -16,7 +16,7 @@ #include "qemu/readline.h" -void hmp_handle_error(Monitor *mon, Error **errp); +void hmp_handle_error(Monitor *mon, Error **errp_in); void hmp_info_name(Monitor *mon, const QDict *qdict); void hmp_info_version(Monitor *mon, const QDict *qdict); diff --git a/include/qapi/error.h b/include/qapi/error.h index 3f95141a01..9376f59c35 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -283,7 +283,7 @@ void error_free(Error *err); /* * Convenience function to assert that *@errp is set, then silently free it. */ -void error_free_or_abort(Error **errp); +void error_free_or_abort(Error **errp_in); /* * Convenience function to warn_report() and free @err. diff --git a/ui/vnc.h b/ui/vnc.h index fea79c2fc9..00e0b48f2f 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -547,7 +547,7 @@ uint32_t read_u32(uint8_t *data, size_t offset); /* Protocol stage functions */ void vnc_client_error(VncState *vs); -size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp); +size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp_in); void start_client_init(VncState *vs); void start_auth_vnc(VncState *vs); diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index b2551c16d1..941d5d0a45 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -60,11 +60,11 @@ #include #endif -void hmp_handle_error(Monitor *mon, Error **errp) +void hmp_handle_error(Monitor *mon, Error **errp_in) { - assert(errp); - if (*errp) { - error_reportf_err(*errp, "Error: "); + assert(errp_in); + if (*errp_in) { + error_reportf_err(*errp_in, "Error: "); } } diff --git a/ui/vnc.c b/ui/vnc.c index 87b8045afe..9d6384d9b1 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1312,7 +1312,7 @@ void vnc_disconnect_finish(VncState *vs) g_free(vs); } -size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp) +size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp_in) { if (ret <= 0) { if (ret == 0) { @@ -1320,14 +1320,14 @@ size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp) vnc_disconnect_start(vs); } else if (ret != QIO_CHANNEL_ERR_BLOCK) { trace_vnc_client_io_error(vs, vs->ioc, - errp ? error_get_pretty(*errp) : + errp_in ? error_get_pretty(*errp_in) : "Unknown"); vnc_disconnect_start(vs); } - if (errp) { - error_free(*errp); - *errp = NULL; + if (errp_in) { + error_free(*errp_in); + *errp_in = NULL; } return 0; } diff --git a/util/error.c b/util/error.c index d4532ce318..b3ff3832d6 100644 --- a/util/error.c +++ b/util/error.c @@ -271,11 +271,11 @@ void error_free(Error *err) } } -void error_free_or_abort(Error **errp) +void error_free_or_abort(Error **errp_in) { - assert(errp && *errp); - error_free(*errp); - *errp = NULL; + assert(errp_in && *errp_in); + error_free(*errp_in); + *errp_in = NULL; } void error_propagate(Error **dst_errp, Error *local_err) From patchwork Tue Oct 1 15:52:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170032 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jP4B69JPz9sP7 for ; Wed, 2 Oct 2019 01:55:22 +1000 (AEST) Received: from localhost ([::1]:43890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKUi-0000eD-4a for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 11:55:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49871) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKT0-000800-8A for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKSy-0006W1-UG for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:33 -0400 Received: from relay.sw.ru ([185.231.240.75]:38350) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKSy-0006UE-LH for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:32 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSw-0004xb-DX; Tue, 01 Oct 2019 18:53:30 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 02/31] hw/core/loader-fit: fix freeing errp in fit_load_fdt Date: Tue, 1 Oct 2019 18:52:50 +0300 Message-Id: <20191001155319.8066-3-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Paul Burton , Vladimir Sementsov-Ogievskiy Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" fit_load_fdt forget to check that errp is not NULL and to zero it after freeing. Fix it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- hw/core/loader-fit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/core/loader-fit.c b/hw/core/loader-fit.c index 953b16bc82..3ee9fb2f2e 100644 --- a/hw/core/loader-fit.c +++ b/hw/core/loader-fit.c @@ -200,7 +200,10 @@ static int fit_load_fdt(const struct fit_loader *ldr, const void *itb, err = fit_image_addr(itb, img_off, "load", &load_addr, errp); if (err == -ENOENT) { load_addr = ROUND_UP(kernel_end, 64 * KiB) + (10 * MiB); - error_free(*errp); + if (errp) { + error_free(*errp); + *errp = NULL; + } } else if (err) { error_prepend(errp, "unable to read FDT load address from FIT: "); ret = err; From patchwork Tue Oct 1 15:52:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170042 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPDm6jmPz9sQm for ; Wed, 2 Oct 2019 02:02:48 +1000 (AEST) Received: from localhost ([::1]:44046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKbt-0000Gm-0p for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:02:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49872) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKT0-000804-7e for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKSy-0006WA-Vh for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:33 -0400 Received: from relay.sw.ru ([185.231.240.75]:38352) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKSy-0006UF-NZ for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:32 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSw-0004xb-IV; Tue, 01 Oct 2019 18:53:30 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 03/31] net/net: fix local variable shadowing in net_client_init Date: Tue, 1 Oct 2019 18:52:51 +0300 Message-Id: <20191001155319.8066-4-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , Vladimir Sementsov-Ogievskiy Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Don't shadow Error *err: it's a bad thing. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- net/net.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/net/net.c b/net/net.c index 84aa6d8d00..9e93c3f8a1 100644 --- a/net/net.c +++ b/net/net.c @@ -1126,16 +1126,13 @@ static int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp) prefix_addr = substrings[0]; - if (substrings[1]) { - /* User-specified prefix length. */ - int err; - - err = qemu_strtoul(substrings[1], NULL, 10, &prefix_len); - if (err) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "ipv6-prefixlen", "a number"); - goto out; - } + /* Handle user-specified prefix length. */ + if (substrings[1] && + qemu_strtoul(substrings[1], NULL, 10, &prefix_len)) + { + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, + "ipv6-prefixlen", "a number"); + goto out; } qemu_opt_set(opts, "ipv6-prefix", prefix_addr, &error_abort); From patchwork Tue Oct 1 15:52:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170059 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPhf07SKz9sDB for ; Wed, 2 Oct 2019 02:23:30 +1000 (AEST) Received: from localhost ([::1]:44356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKvv-0003yV-7P for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:23:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50410) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKU0-0000jN-C5 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:54:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTy-0007Ec-5G for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:54:36 -0400 Received: from relay.sw.ru ([185.231.240.75]:38470) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTr-0006Zo-8W; Tue, 01 Oct 2019 11:54:33 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSw-0004xb-Of; Tue, 01 Oct 2019 18:53:30 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 04/31] error: auto propagated local_err Date: Tue, 1 Oct 2019 18:52:52 +0300 Message-Id: <20191001155319.8066-5-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, pburton@wavecomp.com, peter.maydell@linaro.org, codyprime@gmail.com, jasowang@redhat.com, mark.cave-ayland@ilande.co.uk, mdroth@linux.vnet.ibm.com, kraxel@redhat.com, sundeep.lkml@gmail.com, qemu-block@nongnu.org, quintela@redhat.com, arikalo@wavecomp.com, mst@redhat.com, armbru@redhat.com, pasic@linux.ibm.com, borntraeger@de.ibm.com, joel@jms.id.au, marcandre.lureau@redhat.com, rth@twiddle.net, farman@linux.ibm.com, ehabkost@redhat.com, sw@weilnetz.de, groug@kaod.org, yuval.shaia@oracle.com, dgilbert@redhat.com, alex.williamson@redhat.com, integration@gluster.org, clg@kaod.org, stefanha@redhat.com, david@redhat.com, jsnow@redhat.com, david@gibson.dropbear.id.au, kwolf@redhat.com, Vladimir Sementsov-Ogievskiy , berrange@redhat.com, andrew@aj.id.au, cohuck@redhat.com, qemu-s390x@nongnu.org, mreitz@redhat.com, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, pbonzini@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Here is introduced ERRP_AUTO_PROPAGATE macro, to be used at start of functions with errp OUT parameter. It has three goals: 1. Fix issue with error_fatal & error_prepend/error_append_hint: user can't see this additional information, because exit() happens in error_setg earlier than information is added. [Reported by Greg Kurz] 2. Fix issue with error_abort & error_propagate: when we wrap error_abort by local_err+error_propagate, resulting coredump will refer to error_propagate and not to the place where error happened. (the macro itself doesn't fix the issue, but it allows to [3.] drop all local_err+error_propagate pattern, which will definitely fix the issue) [Reported by Kevin Wolf] 3. Drop local_err+error_propagate pattern, which is used to workaround void functions with errp parameter, when caller wants to know resulting status. (Note: actually these functions could be merely updated to return int error code). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- CC: kwolf@redhat.com CC: mreitz@redhat.com CC: jsnow@redhat.com CC: fam@euphon.net CC: sw@weilnetz.de CC: codyprime@gmail.com CC: marcandre.lureau@redhat.com CC: pbonzini@redhat.com CC: groug@kaod.org CC: sundeep.lkml@gmail.com CC: peter.maydell@linaro.org CC: stefanha@redhat.com CC: pburton@wavecomp.com CC: arikalo@wavecomp.com CC: berrange@redhat.com CC: ehabkost@redhat.com CC: david@gibson.dropbear.id.au CC: clg@kaod.org CC: mst@redhat.com CC: marcel.apfelbaum@gmail.com CC: mark.cave-ayland@ilande.co.uk CC: yuval.shaia@oracle.com CC: cohuck@redhat.com CC: farman@linux.ibm.com CC: rth@twiddle.net CC: david@redhat.com CC: pasic@linux.ibm.com CC: borntraeger@de.ibm.com CC: kraxel@redhat.com CC: alex.williamson@redhat.com CC: andrew@aj.id.au CC: joel@jms.id.au CC: eblake@redhat.com CC: armbru@redhat.com CC: mdroth@linux.vnet.ibm.com CC: quintela@redhat.com CC: dgilbert@redhat.com CC: jasowang@redhat.com CC: qemu-block@nongnu.org CC: integration@gluster.org CC: qemu-arm@nongnu.org CC: qemu-ppc@nongnu.org CC: qemu-s390x@nongnu.org include/qapi/error.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/include/qapi/error.h b/include/qapi/error.h index 9376f59c35..02f967ac1d 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -322,6 +322,43 @@ void error_set_internal(Error **errp, ErrorClass err_class, const char *fmt, ...) GCC_FMT_ATTR(6, 7); +typedef struct ErrorPropagator { + Error *local_err; + Error **errp; +} ErrorPropagator; + +static inline void error_propagator_cleanup(ErrorPropagator *prop) +{ + error_propagate(prop->errp, prop->local_err); +} + +G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(ErrorPropagator, error_propagator_cleanup); + +/* + * ERRP_AUTO_PROPAGATE + * + * This macro is created to be the first line of a function with Error **errp + * OUT parameter. It's needed only in cases where we want to use error_prepend, + * error_append_hint or dereference *errp. It's still safe (but useless) in + * other cases. + * + * If errp is NULL or points to error_fatal, it is rewritten to point to a + * local Error object, which will be automatically propagated to the original + * errp on function exit (see error_propagator_cleanup). + * + * After invocation of this macro it is always safe to dereference errp + * (as it's not NULL anymore) and to append hints (by error_append_hint) + * (as, if it was error_fatal, we swapped it with a local_error to be + * propagated on cleanup). + * + * Note: we don't wrap the error_abort case, as we want resulting coredump + * to point to the place where the error happened, not to error_propagate. + */ +#define ERRP_AUTO_PROPAGATE() \ +g_auto(ErrorPropagator) __auto_errp_prop = {.errp = errp}; \ +errp = ((errp == NULL || *errp == error_fatal) ? \ + &__auto_errp_prop.local_err : errp) + /* * Special error destination to abort on error. * See error_setg() and error_propagate() for details. From patchwork Tue Oct 1 15:52:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170061 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPmF6p1sz9sDB for ; Wed, 2 Oct 2019 02:26:37 +1000 (AEST) Received: from localhost ([::1]:44404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKyx-0007O3-7P for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:26:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50408) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKU0-0000jH-Bn for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:54:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTy-0007Em-8C for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:54:36 -0400 Received: from relay.sw.ru ([185.231.240.75]:38472) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTr-0006Zn-UH; Tue, 01 Oct 2019 11:54:34 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSw-0004xb-W4; Tue, 01 Oct 2019 18:53:31 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 05/31] scripts: add script to fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:52:53 +0300 Message-Id: <20191001155319.8066-6-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, pburton@wavecomp.com, peter.maydell@linaro.org, codyprime@gmail.com, jasowang@redhat.com, mark.cave-ayland@ilande.co.uk, mdroth@linux.vnet.ibm.com, kraxel@redhat.com, sundeep.lkml@gmail.com, qemu-block@nongnu.org, quintela@redhat.com, arikalo@wavecomp.com, mst@redhat.com, armbru@redhat.com, pasic@linux.ibm.com, borntraeger@de.ibm.com, joel@jms.id.au, marcandre.lureau@redhat.com, rth@twiddle.net, farman@linux.ibm.com, ehabkost@redhat.com, sw@weilnetz.de, groug@kaod.org, yuval.shaia@oracle.com, dgilbert@redhat.com, alex.williamson@redhat.com, integration@gluster.org, clg@kaod.org, stefanha@redhat.com, david@redhat.com, jsnow@redhat.com, david@gibson.dropbear.id.au, kwolf@redhat.com, Vladimir Sementsov-Ogievskiy , berrange@redhat.com, andrew@aj.id.au, cohuck@redhat.com, qemu-s390x@nongnu.org, mreitz@redhat.com, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, pbonzini@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" error_append_hint and error_prepend will not work, if errp == &fatal_error, as program will exit before error_append_hint or error_prepend call. Fix this by use of special macro ERRP_AUTO_PROPAGATE. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- CC: kwolf@redhat.com CC: mreitz@redhat.com CC: jsnow@redhat.com CC: fam@euphon.net CC: sw@weilnetz.de CC: codyprime@gmail.com CC: marcandre.lureau@redhat.com CC: pbonzini@redhat.com CC: groug@kaod.org CC: sundeep.lkml@gmail.com CC: peter.maydell@linaro.org CC: stefanha@redhat.com CC: pburton@wavecomp.com CC: arikalo@wavecomp.com CC: berrange@redhat.com CC: ehabkost@redhat.com CC: david@gibson.dropbear.id.au CC: clg@kaod.org CC: mst@redhat.com CC: marcel.apfelbaum@gmail.com CC: mark.cave-ayland@ilande.co.uk CC: yuval.shaia@oracle.com CC: cohuck@redhat.com CC: farman@linux.ibm.com CC: rth@twiddle.net CC: david@redhat.com CC: pasic@linux.ibm.com CC: borntraeger@de.ibm.com CC: kraxel@redhat.com CC: alex.williamson@redhat.com CC: andrew@aj.id.au CC: joel@jms.id.au CC: eblake@redhat.com CC: armbru@redhat.com CC: mdroth@linux.vnet.ibm.com CC: quintela@redhat.com CC: dgilbert@redhat.com CC: jasowang@redhat.com CC: qemu-block@nongnu.org CC: integration@gluster.org CC: qemu-arm@nongnu.org CC: qemu-ppc@nongnu.org CC: qemu-s390x@nongnu.org scripts/coccinelle/fix-error-add-info.cocci | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 scripts/coccinelle/fix-error-add-info.cocci diff --git a/scripts/coccinelle/fix-error-add-info.cocci b/scripts/coccinelle/fix-error-add-info.cocci new file mode 100644 index 0000000000..34fa3be720 --- /dev/null +++ b/scripts/coccinelle/fix-error-add-info.cocci @@ -0,0 +1,28 @@ +@rule0@ +// Add invocation to errp-functions +identifier fn; +@@ + + fn(..., Error **errp, ...) + { ++ ERRP_AUTO_PROPAGATE(); + <+... +( + error_append_hint(errp, ...); +| + error_prepend(errp, ...); +) + ...+> + } + +@@ +// Drop doubled invocation +identifier rule0.fn; +@@ + + fn(...) +{ + ERRP_AUTO_PROPAGATE(); +- ERRP_AUTO_PROPAGATE(); + ... +} From patchwork Tue Oct 1 15:52:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170056 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPc41wxkz9sDB for ; Wed, 2 Oct 2019 02:19:31 +1000 (AEST) Received: from localhost ([::1]:44278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKs3-0008WF-1Q for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:19:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50409) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKU0-0000jI-B8 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:54:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTy-0007Eu-97 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:54:36 -0400 Received: from relay.sw.ru ([185.231.240.75]:38482) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTr-0006Zq-SI; Tue, 01 Oct 2019 11:54:34 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSx-0004xb-Aj; Tue, 01 Oct 2019 18:53:31 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 06/31] python: add commit-per-subsystem.py Date: Tue, 1 Oct 2019 18:52:54 +0300 Message-Id: <20191001155319.8066-7-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, pburton@wavecomp.com, peter.maydell@linaro.org, codyprime@gmail.com, jasowang@redhat.com, mark.cave-ayland@ilande.co.uk, mdroth@linux.vnet.ibm.com, kraxel@redhat.com, sundeep.lkml@gmail.com, qemu-block@nongnu.org, quintela@redhat.com, arikalo@wavecomp.com, mst@redhat.com, armbru@redhat.com, pasic@linux.ibm.com, borntraeger@de.ibm.com, joel@jms.id.au, marcandre.lureau@redhat.com, rth@twiddle.net, farman@linux.ibm.com, ehabkost@redhat.com, sw@weilnetz.de, groug@kaod.org, yuval.shaia@oracle.com, dgilbert@redhat.com, alex.williamson@redhat.com, integration@gluster.org, clg@kaod.org, stefanha@redhat.com, david@redhat.com, jsnow@redhat.com, david@gibson.dropbear.id.au, kwolf@redhat.com, Vladimir Sementsov-Ogievskiy , berrange@redhat.com, andrew@aj.id.au, cohuck@redhat.com, qemu-s390x@nongnu.org, mreitz@redhat.com, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, pbonzini@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Add script to automatically commit tree-wide changes per-subsystem. Signed-off-by: Vladimir Sementsov-Ogievskiy --- CC: kwolf@redhat.com CC: mreitz@redhat.com CC: jsnow@redhat.com CC: fam@euphon.net CC: sw@weilnetz.de CC: codyprime@gmail.com CC: marcandre.lureau@redhat.com CC: pbonzini@redhat.com CC: groug@kaod.org CC: sundeep.lkml@gmail.com CC: peter.maydell@linaro.org CC: stefanha@redhat.com CC: pburton@wavecomp.com CC: arikalo@wavecomp.com CC: berrange@redhat.com CC: ehabkost@redhat.com CC: david@gibson.dropbear.id.au CC: clg@kaod.org CC: mst@redhat.com CC: marcel.apfelbaum@gmail.com CC: mark.cave-ayland@ilande.co.uk CC: yuval.shaia@oracle.com CC: cohuck@redhat.com CC: farman@linux.ibm.com CC: rth@twiddle.net CC: david@redhat.com CC: pasic@linux.ibm.com CC: borntraeger@de.ibm.com CC: kraxel@redhat.com CC: alex.williamson@redhat.com CC: andrew@aj.id.au CC: joel@jms.id.au CC: eblake@redhat.com CC: armbru@redhat.com CC: mdroth@linux.vnet.ibm.com CC: quintela@redhat.com CC: dgilbert@redhat.com CC: jasowang@redhat.com CC: qemu-block@nongnu.org CC: integration@gluster.org CC: qemu-arm@nongnu.org CC: qemu-ppc@nongnu.org CC: qemu-s390x@nongnu.org python/commit-per-subsystem.py | 69 ++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100755 python/commit-per-subsystem.py diff --git a/python/commit-per-subsystem.py b/python/commit-per-subsystem.py new file mode 100755 index 0000000000..d8442d9ea3 --- /dev/null +++ b/python/commit-per-subsystem.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 +# +# Copyright (c) 2019 Virtuozzo International GmbH +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +import subprocess +import sys + + +def git_add(pattern): + subprocess.run(['git', 'add', pattern]) + + +def git_commit(msg): + subprocess.run(['git', 'commit', '-m', msg], capture_output=True) + + +maintainers = sys.argv[1] +message = sys.argv[2].strip() + +subsystem = None + +shortnames = { + 'Block layer core': 'block', + 'ARM cores': 'arm', + 'Network Block Device (NBD)': 'nbd', + 'Command line option argument parsing': 'cmdline', + 'Character device backends': 'chardev', + 'S390 general architecture support': 's390' +} + + +def commit(): + if subsystem: + msg = subsystem + if msg in shortnames: + msg = shortnames[msg] + msg += ': ' + message + git_commit(msg) + + +with open(maintainers) as f: + for line in f: + line = line.rstrip() + if not line: + continue + if len(line) >= 2 and line[1] == ':': + if line[0] == 'F' and line[3:] not in ['*', '*/']: + git_add(line[3:]) + else: + # new subsystem start + commit() + + subsystem = line + +commit() From patchwork Tue Oct 1 15:52:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170053 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPTc0Sy4z9sDB for ; Wed, 2 Oct 2019 02:13:56 +1000 (AEST) Received: from localhost ([::1]:44204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKmf-0004C7-GB for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:13:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50270) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTP-0008Vi-FR for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:54:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTO-0006to-5g for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:59 -0400 Received: from relay.sw.ru ([185.231.240.75]:38426) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTN-0006YK-UO; Tue, 01 Oct 2019 11:53:58 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSx-0004xb-La; Tue, 01 Oct 2019 18:53:31 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 07/31] s390: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:52:55 +0300 Message-Id: <20191001155319.8066-8-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Farman , Vladimir Sementsov-Ogievskiy , David Hildenbrand , Cornelia Huck , Greg Kurz , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Cornelia Huck --- hw/s390x/s390-ccw.c | 1 + target/s390x/cpu_models.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index 0c5a5b60bd..c0a648a7e0 100644 --- a/hw/s390x/s390-ccw.c +++ b/hw/s390x/s390-ccw.c @@ -55,6 +55,7 @@ static void s390_ccw_get_dev_info(S390CCWDevice *cdev, char *sysfsdev, Error **errp) { + ERRP_AUTO_PROPAGATE(); unsigned int cssid, ssid, devid; char dev_path[PATH_MAX] = {0}, *tmp; diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 009afc38b9..32f2e5e822 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -840,6 +840,7 @@ static void error_prepend_missing_feat(const char *name, void *opaque) static void check_compatibility(const S390CPUModel *max_model, const S390CPUModel *model, Error **errp) { + ERRP_AUTO_PROPAGATE(); S390FeatBitmap missing; if (model->def->gen > max_model->def->gen) { @@ -922,6 +923,7 @@ static inline void apply_cpu_model(const S390CPUModel *model, Error **errp) void s390_realize_cpu_model(CPUState *cs, Error **errp) { + ERRP_AUTO_PROPAGATE(); S390CPUClass *xcc = S390_CPU_GET_CLASS(cs); S390CPU *cpu = S390_CPU(cs); const S390CPUModel *max_model; From patchwork Tue Oct 1 15:52:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170041 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPDV01fLz9sQq for ; Wed, 2 Oct 2019 02:02:34 +1000 (AEST) Received: from localhost ([::1]:44040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKbf-0008Tr-2V for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:02:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49917) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKT1-00082w-Mk for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKT0-0006XU-9m for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:35 -0400 Received: from relay.sw.ru ([185.231.240.75]:38372) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKT0-0006WM-0v; Tue, 01 Oct 2019 11:53:34 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSx-0004xb-Q0; Tue, 01 Oct 2019 18:53:31 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 08/31] ARM TCG CPUs: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:52:56 +0300 Message-Id: <20191001155319.8066-9-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Vladimir Sementsov-Ogievskiy , Greg Kurz , qemu-arm@nongnu.org, Subbaraya Sundeep Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/arm/msf2-soc.c | 1 + hw/arm/virt.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c index 008fd9327a..b76f45657e 100644 --- a/hw/arm/msf2-soc.c +++ b/hw/arm/msf2-soc.c @@ -85,6 +85,7 @@ static void m2sxxx_soc_initfn(Object *obj) static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp) { + ERRP_AUTO_PROPAGATE(); MSF2State *s = MSF2_SOC(dev_soc); DeviceState *dev, *armv7m; SysBusDevice *busdev; diff --git a/hw/arm/virt.c b/hw/arm/virt.c index d74538b021..ce2e57fd59 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1793,6 +1793,7 @@ static char *virt_get_gic_version(Object *obj, Error **errp) static void virt_set_gic_version(Object *obj, const char *value, Error **errp) { + ERRP_AUTO_PROPAGATE(); VirtMachineState *vms = VIRT_MACHINE(obj); if (!strcmp(value, "3")) { @@ -1825,6 +1826,7 @@ static char *virt_get_iommu(Object *obj, Error **errp) static void virt_set_iommu(Object *obj, const char *value, Error **errp) { + ERRP_AUTO_PROPAGATE(); VirtMachineState *vms = VIRT_MACHINE(obj); if (!strcmp(value, "smmuv3")) { From patchwork Tue Oct 1 15:52:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170046 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPKH41Pbz9sPJ for ; Wed, 2 Oct 2019 02:06:43 +1000 (AEST) Received: from localhost ([::1]:44094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKfg-00048Y-BS for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:06:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49970) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKT2-00084y-Tp for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKT1-0006Yq-59 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:36 -0400 Received: from relay.sw.ru ([185.231.240.75]:38394) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKT0-0006X5-Tx; Tue, 01 Oct 2019 11:53:35 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSx-0004xb-Vt; Tue, 01 Oct 2019 18:53:32 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 09/31] PowerPC TCG CPUs: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:52:57 +0300 Message-Id: <20191001155319.8066-10-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy , Mark Cave-Ayland , Greg Kurz , qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/ppc/mac_newworld.c | 1 + hw/ppc/pnv_lpc.c | 1 + hw/ppc/pnv_occ.c | 1 + hw/ppc/spapr.c | 1 + hw/ppc/spapr_irq.c | 1 + hw/ppc/spapr_pci.c | 1 + target/ppc/kvm.c | 2 ++ 7 files changed, 8 insertions(+) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index c5bbcc7433..1a37412d31 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -609,6 +609,7 @@ static char *core99_get_via_config(Object *obj, Error **errp) static void core99_set_via_config(Object *obj, const char *value, Error **errp) { + ERRP_AUTO_PROPAGATE(); Core99MachineState *cms = CORE99_MACHINE(obj); if (!strcmp(value, "cuda")) { diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c index 9466d4a1be..5022afa2a8 100644 --- a/hw/ppc/pnv_lpc.c +++ b/hw/ppc/pnv_lpc.c @@ -681,6 +681,7 @@ static const TypeInfo pnv_lpc_power9_info = { static void pnv_lpc_realize(DeviceState *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); PnvLpcController *lpc = PNV_LPC(dev); Object *obj; Error *local_err = NULL; diff --git a/hw/ppc/pnv_occ.c b/hw/ppc/pnv_occ.c index 8bead2c930..735e5655da 100644 --- a/hw/ppc/pnv_occ.c +++ b/hw/ppc/pnv_occ.c @@ -181,6 +181,7 @@ static const TypeInfo pnv_occ_power9_type_info = { static void pnv_occ_realize(DeviceState *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); PnvOCC *occ = PNV_OCC(dev); PnvOCCClass *poc = PNV_OCC_GET_CLASS(occ); Object *obj; diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 08a2a5a770..617afb722c 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4330,6 +4330,7 @@ int spapr_get_vcpu_id(PowerPCCPU *cpu) void spapr_set_vcpu_id(PowerPCCPU *cpu, int cpu_index, Error **errp) { + ERRP_AUTO_PROPAGATE(); SpaprMachineState *spapr = SPAPR_MACHINE(qdev_get_machine()); MachineState *ms = MACHINE(spapr); int vcpu_id; diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index 06fe2432ba..679f1306e4 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -549,6 +549,7 @@ static int spapr_irq_post_load_dual(SpaprMachineState *spapr, int version_id) static void spapr_irq_reset_dual(SpaprMachineState *spapr, Error **errp) { + ERRP_AUTO_PROPAGATE(); Error *local_err = NULL; /* diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 7b71ad7c74..012ecdd40a 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1817,6 +1817,7 @@ static void spapr_phb_destroy_msi(gpointer opaque) static void spapr_phb_realize(DeviceState *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); /* We don't use SPAPR_MACHINE() in order to exit gracefully if the user * tries to add a sPAPR PHB to a non-pseries machine. */ diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 8c5b1f25cc..6ea7502cb9 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -237,6 +237,7 @@ static int kvm_booke206_tlb_init(PowerPCCPU *cpu) #if defined(TARGET_PPC64) static void kvm_get_smmu_info(struct kvm_ppc_smmu_info *info, Error **errp) { + ERRP_AUTO_PROPAGATE(); int ret; assert(kvm_state != NULL); @@ -2073,6 +2074,7 @@ int kvmppc_set_smt_threads(int smt) void kvmppc_hint_smt_possible(Error **errp) { + ERRP_AUTO_PROPAGATE(); int i; GString *g; char *s; From patchwork Tue Oct 1 15:52:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170033 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jP4x3FXmz9sP7 for ; Wed, 2 Oct 2019 01:56:01 +1000 (AEST) Received: from localhost ([::1]:43948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKVK-0001Q1-Ue for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 11:55:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49916) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKT1-00082r-Lb for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKT0-0006Xe-AU for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:35 -0400 Received: from relay.sw.ru ([185.231.240.75]:38366) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKT0-0006WQ-1y; Tue, 01 Oct 2019 11:53:34 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSy-0004xb-4I; Tue, 01 Oct 2019 18:53:32 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 10/31] arm: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:52:58 +0300 Message-Id: <20191001155319.8066-11-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Vladimir Sementsov-Ogievskiy , Greg Kurz , qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/intc/arm_gicv3_kvm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c index 9c7f4ab871..e3b79d6179 100644 --- a/hw/intc/arm_gicv3_kvm.c +++ b/hw/intc/arm_gicv3_kvm.c @@ -766,6 +766,7 @@ static void vm_change_state_handler(void *opaque, int running, static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); GICv3State *s = KVM_ARM_GICV3(dev); KVMARMGICv3Class *kgc = KVM_ARM_GICV3_GET_CLASS(s); bool multiple_redist_region_allowed; From patchwork Tue Oct 1 15:52:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170043 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPF05lRgz9sP7 for ; Wed, 2 Oct 2019 02:03:00 +1000 (AEST) Received: from localhost ([::1]:44050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKc5-0000Ty-9f for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:02:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49955) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKT2-00084M-IF for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKT0-0006XL-8u for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:36 -0400 Received: from relay.sw.ru ([185.231.240.75]:38370) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKT0-0006WN-0f for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:34 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSy-0004xb-AU; Tue, 01 Oct 2019 18:53:32 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 11/31] SmartFusion2: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:52:59 +0300 Message-Id: <20191001155319.8066-12-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Vladimir Sementsov-Ogievskiy , Greg Kurz , Subbaraya Sundeep Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/misc/msf2-sysreg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/misc/msf2-sysreg.c b/hw/misc/msf2-sysreg.c index ddc5a30c80..343351480d 100644 --- a/hw/misc/msf2-sysreg.c +++ b/hw/misc/msf2-sysreg.c @@ -127,6 +127,7 @@ static Property msf2_sysreg_properties[] = { static void msf2_sysreg_realize(DeviceState *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); MSF2SysregState *s = MSF2_SYSREG(dev); if ((s->apb0div > 32 || !is_power_of_2(s->apb0div)) From patchwork Tue Oct 1 15:53:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170036 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jP8M0BG1z9sP7 for ; Wed, 2 Oct 2019 01:58:59 +1000 (AEST) Received: from localhost ([::1]:43992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKYC-0005Bd-DU for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 11:58:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49923) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKT1-00083F-Tm for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKT0-0006Y6-N6 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:35 -0400 Received: from relay.sw.ru ([185.231.240.75]:38378) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKT0-0006WV-C9; Tue, 01 Oct 2019 11:53:34 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSy-0004xb-G8; Tue, 01 Oct 2019 18:53:32 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 12/31] ASPEED BMCs: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:00 +0300 Message-Id: <20191001155319.8066-13-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Vladimir Sementsov-Ogievskiy , Andrew Jeffery , Greg Kurz , qemu-arm@nongnu.org, Joel Stanley , =?utf-8?q?C=C3=A9dric_Le_Goater?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/watchdog/wdt_aspeed.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/watchdog/wdt_aspeed.c b/hw/watchdog/wdt_aspeed.c index 9b93213417..a70d6dee63 100644 --- a/hw/watchdog/wdt_aspeed.c +++ b/hw/watchdog/wdt_aspeed.c @@ -243,6 +243,7 @@ static void aspeed_wdt_timer_expired(void *dev) static void aspeed_wdt_realize(DeviceState *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); AspeedWDTState *s = ASPEED_WDT(dev); Error *err = NULL; From patchwork Tue Oct 1 15:53:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170031 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jP3h34y7z9sP7 for ; Wed, 2 Oct 2019 01:54:56 +1000 (AEST) Received: from localhost ([::1]:43836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKUH-0008CH-HY for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 11:54:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49935) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKT2-00083l-75 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKT0-0006Y1-MT for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:36 -0400 Received: from relay.sw.ru ([185.231.240.75]:38384) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKT0-0006WX-C3 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:34 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSy-0004xb-L2; Tue, 01 Oct 2019 18:53:32 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 13/31] Boston: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:01 +0300 Message-Id: <20191001155319.8066-14-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , Paul Burton , Vladimir Sementsov-Ogievskiy , Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/core/loader-fit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/core/loader-fit.c b/hw/core/loader-fit.c index 3ee9fb2f2e..84f35a1fe2 100644 --- a/hw/core/loader-fit.c +++ b/hw/core/loader-fit.c @@ -120,6 +120,7 @@ static int fit_load_kernel(const struct fit_loader *ldr, const void *itb, int cfg, void *opaque, hwaddr *pend, Error **errp) { + ERRP_AUTO_PROPAGATE(); const char *name; const void *data; const void *load_data; @@ -178,6 +179,7 @@ static int fit_load_fdt(const struct fit_loader *ldr, const void *itb, int cfg, void *opaque, const void *match_data, hwaddr kernel_end, Error **errp) { + ERRP_AUTO_PROPAGATE(); const char *name; const void *data; const void *load_data; From patchwork Tue Oct 1 15:53:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170051 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPQ83TqNz9sDB for ; Wed, 2 Oct 2019 02:10:56 +1000 (AEST) Received: from localhost ([::1]:44158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKjl-0000lh-JY for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:10:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49966) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKT2-00084r-Qt for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKT0-0006Ya-VJ for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:36 -0400 Received: from relay.sw.ru ([185.231.240.75]:38390) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKT0-0006Wr-Lq; Tue, 01 Oct 2019 11:53:34 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSy-0004xb-Ps; Tue, 01 Oct 2019 18:53:32 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 14/31] PowerNV (Non-Virtualized): Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:02 +0300 Message-Id: <20191001155319.8066-15-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Vladimir Sementsov-Ogievskiy , qemu-ppc@nongnu.org, Greg Kurz , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/intc/pnv_xive.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c index ed6e9d71bb..61ad7d46fe 100644 --- a/hw/intc/pnv_xive.c +++ b/hw/intc/pnv_xive.c @@ -1659,6 +1659,7 @@ static void pnv_xive_init(Object *obj) static void pnv_xive_realize(DeviceState *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); PnvXive *xive = PNV_XIVE(dev); XiveSource *xsrc = &xive->ipi_source; XiveENDSource *end_xsrc = &xive->end_source; From patchwork Tue Oct 1 15:53:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170048 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPLG3cWNz9sDB for ; Wed, 2 Oct 2019 02:07:34 +1000 (AEST) Received: from localhost ([::1]:44108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKgV-0005UG-Kr for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:07:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49924) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKT1-00083H-Ux for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKT0-0006YC-Nc for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:35 -0400 Received: from relay.sw.ru ([185.231.240.75]:38386) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKT0-0006Wc-CP for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:34 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSz-0004xb-4e; Tue, 01 Oct 2019 18:53:33 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 15/31] PCI: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:03 +0300 Message-Id: <20191001155319.8066-16-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy , Greg Kurz , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/pci-bridge/pcie_root_port.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c index 012c2cb12c..a1b4989534 100644 --- a/hw/pci-bridge/pcie_root_port.c +++ b/hw/pci-bridge/pcie_root_port.c @@ -60,6 +60,7 @@ static void rp_reset(DeviceState *qdev) static void rp_realize(PCIDevice *d, Error **errp) { + ERRP_AUTO_PROPAGATE(); PCIEPort *p = PCIE_PORT(d); PCIESlot *s = PCIE_SLOT(d); PCIDeviceClass *dc = PCI_DEVICE_GET_CLASS(d); From patchwork Tue Oct 1 15:53:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170034 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jP7w4dgqz9sP7 for ; Wed, 2 Oct 2019 01:58:36 +1000 (AEST) Received: from localhost ([::1]:43978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKXp-0004S9-UT for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 11:58:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50116) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTG-0008LV-A9 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTE-0006lM-KL for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:50 -0400 Received: from relay.sw.ru ([185.231.240.75]:38412) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTD-0006YI-T0 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:48 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSz-0004xb-Al; Tue, 01 Oct 2019 18:53:33 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 16/31] SCSI: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:04 +0300 Message-Id: <20191001155319.8066-17-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Paolo Bonzini , Vladimir Sementsov-Ogievskiy , Greg Kurz , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/scsi/scsi-disk.c | 1 + hw/scsi/scsi-generic.c | 1 + hw/scsi/vhost-scsi.c | 1 + 3 files changed, 3 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 915641a0f1..48165dc128 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -2597,6 +2597,7 @@ static int get_device_type(SCSIDiskState *s) static void scsi_block_realize(SCSIDevice *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev); AioContext *ctx; int sg_version; diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c index e7798ebcd0..4c7543801f 100644 --- a/hw/scsi/scsi-generic.c +++ b/hw/scsi/scsi-generic.c @@ -653,6 +653,7 @@ static void scsi_generic_reset(DeviceState *dev) static void scsi_generic_realize(SCSIDevice *s, Error **errp) { + ERRP_AUTO_PROPAGATE(); int rc; int sg_version; struct sg_scsi_id scsiid; diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index c693fc748a..c01c6dfbe2 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -165,6 +165,7 @@ static const VMStateDescription vmstate_virtio_vhost_scsi = { static void vhost_scsi_realize(DeviceState *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(dev); VHostSCSICommon *vsc = VHOST_SCSI_COMMON(dev); Error *err = NULL; From patchwork Tue Oct 1 15:53:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170057 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPcn3zFtz9sDB for ; Wed, 2 Oct 2019 02:20:09 +1000 (AEST) Received: from localhost ([::1]:44286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKsg-0000YY-JP for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:20:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50110) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTG-0008LS-5F for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTD-0006kD-SQ for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:49 -0400 Received: from relay.sw.ru ([185.231.240.75]:38398) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTB-0006XB-9s for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:47 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSz-0004xb-K0; Tue, 01 Oct 2019 18:53:33 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 17/31] USB: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:05 +0300 Message-Id: <20191001155319.8066-18-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy , Greg Kurz , Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/usb/ccid-card-emulated.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index 291e41db8a..958791e817 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/ccid-card-emulated.c @@ -488,6 +488,7 @@ static uint32_t parse_enumeration(char *str, static void emulated_realize(CCIDCardState *base, Error **errp) { + ERRP_AUTO_PROPAGATE(); EmulatedState *card = EMULATED_CCID_CARD(base); VCardEmulError ret; const EnumTable *ptable; From patchwork Tue Oct 1 15:53:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170055 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPZp21mhz9sDB for ; Wed, 2 Oct 2019 02:18:26 +1000 (AEST) Received: from localhost ([::1]:44260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKr1-0007si-50 for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:18:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50178) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTJ-0008Mq-0f for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTF-0006mY-2k for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:50 -0400 Received: from relay.sw.ru ([185.231.240.75]:38424) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTE-0006YJ-1N for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:48 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKSz-0004xb-SA; Tue, 01 Oct 2019 18:53:34 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 18/31] VFIO: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:06 +0300 Message-Id: <20191001155319.8066-19-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Williamson , Vladimir Sementsov-Ogievskiy , Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/vfio/common.c | 3 +++ hw/vfio/pci-quirks.c | 1 + hw/vfio/pci.c | 3 +++ hw/vfio/platform.c | 1 + 4 files changed, 8 insertions(+) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 3e03c495d8..b0f3f64f5d 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -136,6 +136,7 @@ static const char *index_to_str(VFIODevice *vbasedev, int index) int vfio_set_irq_signaling(VFIODevice *vbasedev, int index, int subindex, int action, int fd, Error **errp) { + ERRP_AUTO_PROPAGATE(); struct vfio_irq_set *irq_set; int argsz, ret = 0; const char *name; @@ -1437,6 +1438,7 @@ static void vfio_disconnect_container(VFIOGroup *group) VFIOGroup *vfio_get_group(int groupid, AddressSpace *as, Error **errp) { + ERRP_AUTO_PROPAGATE(); VFIOGroup *group; char path[32]; struct vfio_group_status status = { .argsz = sizeof(status) }; @@ -1526,6 +1528,7 @@ void vfio_put_group(VFIOGroup *group) int vfio_get_device(VFIOGroup *group, const char *name, VFIODevice *vbasedev, Error **errp) { + ERRP_AUTO_PROPAGATE(); struct vfio_device_info dev_info = { .argsz = sizeof(dev_info) }; int ret, fd; diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index 136f3a9ad6..d8b6ef7021 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c @@ -2139,6 +2139,7 @@ const PropertyInfo qdev_prop_nv_gpudirect_clique = { static int vfio_add_nv_gpudirect_cap(VFIOPCIDevice *vdev, Error **errp) { + ERRP_AUTO_PROPAGATE(); PCIDevice *pdev = &vdev->pdev; int ret, pos = 0xC8; diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index c5e6fe61cb..4b537bce2c 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -1916,6 +1916,7 @@ static void vfio_check_af_flr(VFIOPCIDevice *vdev, uint8_t pos) static int vfio_add_std_cap(VFIOPCIDevice *vdev, uint8_t pos, Error **errp) { + ERRP_AUTO_PROPAGATE(); PCIDevice *pdev = &vdev->pdev; uint8_t cap_id, next, size; int ret; @@ -2469,6 +2470,7 @@ int vfio_populate_vga(VFIOPCIDevice *vdev, Error **errp) static void vfio_populate_device(VFIOPCIDevice *vdev, Error **errp) { + ERRP_AUTO_PROPAGATE(); VFIODevice *vbasedev = &vdev->vbasedev; struct vfio_region_info *reg_info; struct vfio_irq_info irq_info = { .argsz = sizeof(irq_info) }; @@ -2700,6 +2702,7 @@ static void vfio_unregister_req_notifier(VFIOPCIDevice *vdev) static void vfio_realize(PCIDevice *pdev, Error **errp) { + ERRP_AUTO_PROPAGATE(); VFIOPCIDevice *vdev = PCI_VFIO(pdev); VFIODevice *vbasedev_iter; VFIOGroup *group; diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index d7598c6152..236e5f8f57 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -617,6 +617,7 @@ static int vfio_base_device_init(VFIODevice *vbasedev, Error **errp) */ static void vfio_platform_realize(DeviceState *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); VFIOPlatformDevice *vdev = VFIO_PLATFORM_DEVICE(dev); SysBusDevice *sbdev = SYS_BUS_DEVICE(dev); VFIODevice *vbasedev = &vdev->vbasedev; From patchwork Tue Oct 1 15:53:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170060 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPjS6Qqzz9sDB for ; Wed, 2 Oct 2019 02:24:12 +1000 (AEST) Received: from localhost ([::1]:44378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKwc-0004aT-8W for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:24:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50124) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTG-0008Lb-Du for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTF-0006mo-50 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:50 -0400 Received: from relay.sw.ru ([185.231.240.75]:38414) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTE-0006YH-33 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:48 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKT0-0004xb-5G; Tue, 01 Oct 2019 18:53:34 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 19/31] vhost: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:07 +0300 Message-Id: <20191001155319.8066-20-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy , Greg Kurz , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/virtio/vhost-vsock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c index f5744363a8..61ade0fa65 100644 --- a/hw/virtio/vhost-vsock.c +++ b/hw/virtio/vhost-vsock.c @@ -300,6 +300,7 @@ static const VMStateDescription vmstate_virtio_vhost_vsock = { static void vhost_vsock_device_realize(DeviceState *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); VirtIODevice *vdev = VIRTIO_DEVICE(dev); VHostVSock *vsock = VHOST_VSOCK(dev); int vhostfd; From patchwork Tue Oct 1 15:53:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170063 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPtV0GQBz9sDB for ; Wed, 2 Oct 2019 02:32:01 +1000 (AEST) Received: from localhost ([::1]:44474 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFL4A-0003jY-Jw for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:31:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50254) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTO-0008UI-T0 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTN-0006tA-Cj for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:58 -0400 Received: from relay.sw.ru ([185.231.240.75]:38438) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTN-0006Yn-5H; Tue, 01 Oct 2019 11:53:57 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKT0-0004xb-Fg; Tue, 01 Oct 2019 18:53:34 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 20/31] virtio: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:08 +0300 Message-Id: <20191001155319.8066-21-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, "Michael S. Tsirkin" , Greg Kurz , Max Reitz , Stefan Hajnoczi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/block/dataplane/virtio-blk.c | 1 + hw/virtio/virtio-pci.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index 119906a5fe..f8a1e70886 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -85,6 +85,7 @@ bool virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf, VirtIOBlockDataPlane **dataplane, Error **errp) { + ERRP_AUTO_PROPAGATE(); VirtIOBlockDataPlane *s; BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev))); VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index c6b47a9c73..a36e5f6990 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1525,6 +1525,7 @@ static void virtio_pci_pre_plugged(DeviceState *d, Error **errp) /* This is called by virtio-bus just after the device is plugged. */ static void virtio_pci_device_plugged(DeviceState *d, Error **errp) { + ERRP_AUTO_PROPAGATE(); VirtIOPCIProxy *proxy = VIRTIO_PCI(d); VirtioBusState *bus = &proxy->bus; bool legacy = virtio_pci_legacy(proxy); @@ -1684,6 +1685,7 @@ static void virtio_pci_device_unplugged(DeviceState *d) static void virtio_pci_realize(PCIDevice *pci_dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); VirtIOPCIProxy *proxy = VIRTIO_PCI(pci_dev); VirtioPCIClass *k = VIRTIO_PCI_GET_CLASS(pci_dev); bool pcie_port = pci_bus_is_express(pci_get_bus(pci_dev)) && From patchwork Tue Oct 1 15:53:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPnG2SFpz9sPJ for ; Wed, 2 Oct 2019 02:27:30 +1000 (AEST) Received: from localhost ([::1]:44416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKzn-0008Ut-Ak for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:27:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50185) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTJ-0008NH-5v for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTG-0006nb-5Y for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:52 -0400 Received: from relay.sw.ru ([185.231.240.75]:38462) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTE-0006ZQ-Ga for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:49 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKT0-0004xb-VO; Tue, 01 Oct 2019 18:53:35 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 21/31] virtio-9p: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:09 +0300 Message-Id: <20191001155319.8066-22-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy , Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/9pfs/9p-local.c | 1 + hw/9pfs/9p-proxy.c | 1 + hw/9pfs/9p.c | 1 + 3 files changed, 3 insertions(+) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 08e673a79c..fccbf758bd 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -1471,6 +1471,7 @@ static void local_cleanup(FsContext *ctx) static void error_append_security_model_hint(Error **errp) { + ERRP_AUTO_PROPAGATE(); error_append_hint(errp, "Valid options are: security_model=" "[passthrough|mapped-xattr|mapped-file|none]\n"); } diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c index 57a8c1c808..9291c8efa2 100644 --- a/hw/9pfs/9p-proxy.c +++ b/hw/9pfs/9p-proxy.c @@ -1116,6 +1116,7 @@ static int connect_namedsocket(const char *path, Error **errp) static void error_append_socket_sockfd_hint(Error **errp) { + ERRP_AUTO_PROPAGATE(); error_append_hint(errp, "Either specify socket=/some/path where /some/path" " points to a listening AF_UNIX socket or sock_fd=fd" " where fd is a file descriptor to a connected AF_UNIX" diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index cce2366219..1df2749e03 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3552,6 +3552,7 @@ void pdu_submit(V9fsPDU *pdu, P9MsgHeader *hdr) int v9fs_device_realize_common(V9fsState *s, const V9fsTransport *t, Error **errp) { + ERRP_AUTO_PROPAGATE(); int i, len; struct stat stat; FsDriverEntry *fse; From patchwork Tue Oct 1 15:53:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170065 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPzm4g6cz9sDB for ; Wed, 2 Oct 2019 02:36:36 +1000 (AEST) Received: from localhost ([::1]:44610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFL8b-0007vZ-Lc for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:36:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50272) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTQ-0008Vk-GX for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:54:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTO-0006tw-7r for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:59 -0400 Received: from relay.sw.ru ([185.231.240.75]:38464) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTN-0006ZZ-W0; Tue, 01 Oct 2019 11:53:58 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKT1-0004xb-Eu; Tue, 01 Oct 2019 18:53:35 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 22/31] XIVE: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:10 +0300 Message-Id: <20191001155319.8066-23-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Vladimir Sementsov-Ogievskiy , qemu-ppc@nongnu.org, Greg Kurz , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/intc/xive.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/intc/xive.c b/hw/intc/xive.c index b7417210d8..926cb6741d 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -570,6 +570,7 @@ static void xive_tctx_reset(void *dev) static void xive_tctx_realize(DeviceState *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); XiveTCTX *tctx = XIVE_TCTX(dev); PowerPCCPU *cpu; CPUPPCState *env; @@ -1050,6 +1051,7 @@ static void xive_source_reset(void *dev) static void xive_source_realize(DeviceState *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); XiveSource *xsrc = XIVE_SOURCE(dev); Object *obj; Error *local_err = NULL; @@ -1798,6 +1800,7 @@ static const MemoryRegionOps xive_end_source_ops = { static void xive_end_source_realize(DeviceState *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); XiveENDSource *xsrc = XIVE_END_SOURCE(dev); Object *obj; Error *local_err = NULL; From patchwork Tue Oct 1 15:53:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170058 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPhT0lhWz9sDB for ; Wed, 2 Oct 2019 02:23:21 +1000 (AEST) Received: from localhost ([::1]:44352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKvl-0003Xd-SB for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:23:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50295) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTR-00006L-2e for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:54:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTO-0006te-1q for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:54:00 -0400 Received: from relay.sw.ru ([185.231.240.75]:38492) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTN-0006ae-Qw; Tue, 01 Oct 2019 11:53:58 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKT1-0004xb-Lz; Tue, 01 Oct 2019 18:53:35 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 23/31] block: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:11 +0300 Message-Id: <20191001155319.8066-24-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, Jeff Cody , Stefan Weil , Greg Kurz , Max Reitz , integration@gluster.org, John Snow Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/nbd.h | 1 + block.c | 3 +++ block/backup.c | 1 + block/dirty-bitmap.c | 1 + block/file-posix.c | 4 ++++ block/gluster.c | 2 ++ block/qcow.c | 1 + block/qcow2-bitmap.c | 1 + block/qcow2.c | 3 +++ block/vdi.c | 1 + block/vhdx-log.c | 1 + block/vmdk.c | 1 + block/vpc.c | 1 + 13 files changed, 21 insertions(+) diff --git a/include/block/nbd.h b/include/block/nbd.h index 316fd705a9..330f40142a 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -360,6 +360,7 @@ void nbd_server_start(SocketAddress *addr, const char *tls_creds, static inline int nbd_read(QIOChannel *ioc, void *buffer, size_t size, const char *desc, Error **errp) { + ERRP_AUTO_PROPAGATE(); int ret = qio_channel_read_all(ioc, buffer, size, errp) < 0 ? -EIO : 0; if (ret < 0) { diff --git a/block.c b/block.c index 5944124845..5dfcfc9b90 100644 --- a/block.c +++ b/block.c @@ -1565,6 +1565,7 @@ fail_opts: static QDict *parse_json_filename(const char *filename, Error **errp) { + ERRP_AUTO_PROPAGATE(); QObject *options_obj; QDict *options; int ret; @@ -2592,6 +2593,7 @@ out: int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options, const char *bdref_key, Error **errp) { + ERRP_AUTO_PROPAGATE(); char *backing_filename = NULL; char *bdref_key_dot; const char *reference = NULL; @@ -2823,6 +2825,7 @@ static BlockDriverState *bdrv_append_temp_snapshot(BlockDriverState *bs, QDict *snapshot_options, Error **errp) { + ERRP_AUTO_PROPAGATE(); /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */ char *tmp_filename = g_malloc0(PATH_MAX + 1); int64_t total_size; diff --git a/block/backup.c b/block/backup.c index 763f0d7ff6..58488a21fb 100644 --- a/block/backup.c +++ b/block/backup.c @@ -583,6 +583,7 @@ static const BlockJobDriver backup_job_driver = { static int64_t backup_calculate_cluster_size(BlockDriverState *target, Error **errp) { + ERRP_AUTO_PROPAGATE(); int ret; BlockDriverInfo bdi; diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index 134e0c9a0c..099ed74dfa 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -237,6 +237,7 @@ static bool bdrv_dirty_bitmap_recording(BdrvDirtyBitmap *bitmap) int bdrv_dirty_bitmap_check(const BdrvDirtyBitmap *bitmap, uint32_t flags, Error **errp) { + ERRP_AUTO_PROPAGATE(); if ((flags & BDRV_BITMAP_BUSY) && bdrv_dirty_bitmap_busy(bitmap)) { error_setg(errp, "Bitmap '%s' is currently in use by another" " operation and cannot be used", bitmap->name); diff --git a/block/file-posix.c b/block/file-posix.c index f12c06de2d..db7a5b7e1a 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -320,6 +320,7 @@ static bool raw_is_io_aligned(int fd, void *buf, size_t len) static void raw_probe_alignment(BlockDriverState *bs, int fd, Error **errp) { + ERRP_AUTO_PROPAGATE(); BDRVRawState *s = bs->opaque; char *buf; size_t max_align = MAX(MAX_BLOCKSIZE, getpagesize()); @@ -473,6 +474,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options, int bdrv_flags, int open_flags, bool device, Error **errp) { + ERRP_AUTO_PROPAGATE(); BDRVRawState *s = bs->opaque; QemuOpts *opts; Error *local_err = NULL; @@ -817,6 +819,7 @@ static int raw_handle_perm_lock(BlockDriverState *bs, uint64_t new_perm, uint64_t new_shared, Error **errp) { + ERRP_AUTO_PROPAGATE(); BDRVRawState *s = bs->opaque; int ret = 0; Error *local_err = NULL; @@ -2232,6 +2235,7 @@ static int64_t raw_get_allocated_file_size(BlockDriverState *bs) static int coroutine_fn raw_co_create(BlockdevCreateOptions *options, Error **errp) { + ERRP_AUTO_PROPAGATE(); BlockdevCreateOptionsFile *file_opts; Error *local_err = NULL; int fd; diff --git a/block/gluster.c b/block/gluster.c index 64028b2cba..a69e89b42a 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -419,6 +419,7 @@ out: static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf, Error **errp) { + ERRP_AUTO_PROPAGATE(); struct glfs *glfs; int ret; int old_errno; @@ -694,6 +695,7 @@ static int qemu_gluster_parse(BlockdevOptionsGluster *gconf, const char *filename, QDict *options, Error **errp) { + ERRP_AUTO_PROPAGATE(); int ret; if (filename) { ret = qemu_gluster_parse_uri(gconf, filename); diff --git a/block/qcow.c b/block/qcow.c index 5bdf72ba33..0caf94c8f8 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -117,6 +117,7 @@ static QemuOptsList qcow_runtime_opts = { static int qcow_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { + ERRP_AUTO_PROPAGATE(); BDRVQcowState *s = bs->opaque; unsigned int len, i, shift; int ret; diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index b2487101ed..90f2f010f2 100644 --- a/block/qcow2-bitmap.c +++ b/block/qcow2-bitmap.c @@ -1618,6 +1618,7 @@ bool qcow2_can_store_new_dirty_bitmap(BlockDriverState *bs, uint32_t granularity, Error **errp) { + ERRP_AUTO_PROPAGATE(); BDRVQcow2State *s = bs->opaque; bool found; Qcow2BitmapList *bm_list; diff --git a/block/qcow2.c b/block/qcow2.c index 4d16393e61..a8f0bf3cae 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1207,6 +1207,7 @@ static int qcow2_update_options(BlockDriverState *bs, QDict *options, static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { + ERRP_AUTO_PROPAGATE(); BDRVQcow2State *s = bs->opaque; unsigned int len, i; int ret = 0; @@ -3036,6 +3037,7 @@ static uint64_t qcow2_opt_get_refcount_bits_del(QemuOpts *opts, int version, static int coroutine_fn qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp) { + ERRP_AUTO_PROPAGATE(); BlockdevCreateOptionsQcow2 *qcow2_opts; QDict *options; @@ -3740,6 +3742,7 @@ fail: static int coroutine_fn qcow2_co_truncate(BlockDriverState *bs, int64_t offset, PreallocMode prealloc, Error **errp) { + ERRP_AUTO_PROPAGATE(); BDRVQcow2State *s = bs->opaque; uint64_t old_length; int64_t new_l1_size; diff --git a/block/vdi.c b/block/vdi.c index 806ba7f53c..5259cce24b 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -735,6 +735,7 @@ nonallocating_write: static int coroutine_fn vdi_co_do_create(BlockdevCreateOptions *create_options, size_t block_size, Error **errp) { + ERRP_AUTO_PROPAGATE(); BlockdevCreateOptionsVdi *vdi_opts; int ret = 0; uint64_t bytes = 0; diff --git a/block/vhdx-log.c b/block/vhdx-log.c index fdd3a7adc3..176e03327b 100644 --- a/block/vhdx-log.c +++ b/block/vhdx-log.c @@ -748,6 +748,7 @@ exit: int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s, bool *flushed, Error **errp) { + ERRP_AUTO_PROPAGATE(); int ret = 0; VHDXHeader *hdr; VHDXLogSequence logs = { 0 }; diff --git a/block/vmdk.c b/block/vmdk.c index fed3b50c8a..6b10830d94 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1078,6 +1078,7 @@ static const char *next_line(const char *s) static int vmdk_parse_extents(const char *desc, BlockDriverState *bs, QDict *options, Error **errp) { + ERRP_AUTO_PROPAGATE(); int ret; int matches; char access[11]; diff --git a/block/vpc.c b/block/vpc.c index 5cd3890780..90d0cae862 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -971,6 +971,7 @@ static int calculate_rounded_image_size(BlockdevCreateOptionsVpc *vpc_opts, static int coroutine_fn vpc_co_create(BlockdevCreateOptions *opts, Error **errp) { + ERRP_AUTO_PROPAGATE(); BlockdevCreateOptionsVpc *vpc_opts; BlockBackend *blk = NULL; BlockDriverState *bs = NULL; From patchwork Tue Oct 1 15:53:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170047 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPKq2Vdwz9sDB for ; Wed, 2 Oct 2019 02:07:11 +1000 (AEST) Received: from localhost ([::1]:44106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKg8-0004tx-6Q for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:07:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50123) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTG-0008La-EJ for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTF-0006mj-4k for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:50 -0400 Received: from relay.sw.ru ([185.231.240.75]:38500) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTE-0006bI-18 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:48 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKT1-0004xb-Vq; Tue, 01 Oct 2019 18:53:36 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 24/31] chardev: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:12 +0300 Message-Id: <20191001155319.8066-25-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Vladimir Sementsov-Ogievskiy , Greg Kurz , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- chardev/spice.c | 1 + 1 file changed, 1 insertion(+) diff --git a/chardev/spice.c b/chardev/spice.c index 241e2b7770..ce2145fb19 100644 --- a/chardev/spice.c +++ b/chardev/spice.c @@ -267,6 +267,7 @@ static void qemu_chr_open_spice_vmc(Chardev *chr, bool *be_opened, Error **errp) { + ERRP_AUTO_PROPAGATE(); ChardevSpiceChannel *spicevmc = backend->u.spicevmc.data; const char *type = spicevmc->type; const char **psubtype = spice_server_char_device_recognized_subtypes(); From patchwork Tue Oct 1 15:53:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170054 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPVZ084Cz9sDB for ; Wed, 2 Oct 2019 02:14:46 +1000 (AEST) Received: from localhost ([::1]:44232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKnT-0005DW-7h for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:14:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50120) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTG-0008LY-CJ for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTE-0006lH-Is for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:50 -0400 Received: from relay.sw.ru ([185.231.240.75]:38506) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTD-0006bQ-S5 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:48 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKT2-0004xb-9a; Tue, 01 Oct 2019 18:53:36 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 25/31] cmdline: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:13 +0300 Message-Id: <20191001155319.8066-26-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy , Greg Kurz , Markus Armbruster Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- util/qemu-option.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/qemu-option.c b/util/qemu-option.c index 97172b5eaa..031c01eddc 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -145,6 +145,7 @@ static const QemuOptDesc *find_desc_by_name(const QemuOptDesc *desc, void parse_option_size(const char *name, const char *value, uint64_t *ret, Error **errp) { + ERRP_AUTO_PROPAGATE(); uint64_t size; int err; @@ -660,6 +661,7 @@ QemuOpts *qemu_opts_find(QemuOptsList *list, const char *id) QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, int fail_if_exists, Error **errp) { + ERRP_AUTO_PROPAGATE(); QemuOpts *opts = NULL; if (id) { From patchwork Tue Oct 1 15:53:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170049 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPPS03p3z9sDB for ; Wed, 2 Oct 2019 02:10:20 +1000 (AEST) Received: from localhost ([::1]:44152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKjB-00008y-Fi for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:10:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50183) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTJ-0008NE-6f for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTG-0006nq-66 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:52 -0400 Received: from relay.sw.ru ([185.231.240.75]:38510) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTE-0006br-FN for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:49 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKT2-0004xb-JF; Tue, 01 Oct 2019 18:53:36 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 26/31] QOM: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:14 +0300 Message-Id: <20191001155319.8066-27-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Vladimir Sementsov-Ogievskiy , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Greg Kurz , Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/core/qdev-properties-system.c | 1 + qdev-monitor.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index 70bfd4809b..497a568cc2 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -221,6 +221,7 @@ static void get_chr(Object *obj, Visitor *v, const char *name, void *opaque, static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { + ERRP_AUTO_PROPAGATE(); DeviceState *dev = DEVICE(obj); Error *local_err = NULL; Property *prop = opaque; diff --git a/qdev-monitor.c b/qdev-monitor.c index 148df9cacf..89c99d9753 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -328,6 +328,7 @@ static Object *qdev_get_peripheral_anon(void) static void qbus_list_bus(DeviceState *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); BusState *child; const char *sep = " "; @@ -342,6 +343,7 @@ static void qbus_list_bus(DeviceState *dev, Error **errp) static void qbus_list_dev(BusState *bus, Error **errp) { + ERRP_AUTO_PROPAGATE(); BusChild *kid; const char *sep = " "; From patchwork Tue Oct 1 15:53:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170040 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPDB1wNfz9sP7 for ; Wed, 2 Oct 2019 02:02:18 +1000 (AEST) Received: from localhost ([::1]:44036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKbP-0008H4-1l for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:02:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50184) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTJ-0008NF-6d for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTG-0006nf-5N for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:52 -0400 Received: from relay.sw.ru ([185.231.240.75]:38518) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTE-0006cG-Hs for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:49 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKT2-0004xb-Qn; Tue, 01 Oct 2019 18:53:36 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 27/31] Migration: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:15 +0300 Message-Id: <20191001155319.8066-28-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy , Greg Kurz , "Dr. David Alan Gilbert" , Juan Quintela Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- migration/migration.c | 1 + migration/savevm.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index 5f7e4d15e9..deaa789533 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -971,6 +971,7 @@ static bool migrate_caps_check(bool *cap_list, MigrationCapabilityStatusList *params, Error **errp) { + ERRP_AUTO_PROPAGATE(); MigrationCapabilityStatusList *cap; bool old_postcopy_cap; MigrationIncomingState *mis = migration_incoming_get_current(); diff --git a/migration/savevm.c b/migration/savevm.c index bb9462a54d..f9293fe192 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -2586,6 +2586,7 @@ int qemu_load_device_state(QEMUFile *f) int save_snapshot(const char *name, Error **errp) { + ERRP_AUTO_PROPAGATE(); BlockDriverState *bs, *bs1; QEMUSnapshotInfo sn1, *sn = &sn1, old_sn1, *old_sn = &old_sn1; int ret = -1; @@ -2790,6 +2791,7 @@ void qmp_xen_load_devices_state(const char *filename, Error **errp) int load_snapshot(const char *name, Error **errp) { + ERRP_AUTO_PROPAGATE(); BlockDriverState *bs, *bs_vm_state; QEMUSnapshotInfo sn; QEMUFile *f; From patchwork Tue Oct 1 15:53:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170050 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPPV4mj1z9sDB for ; Wed, 2 Oct 2019 02:10:22 +1000 (AEST) Received: from localhost ([::1]:44154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKjD-0000FO-Ve for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:10:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50181) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTJ-0008N9-4u for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTG-0006nm-96 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:52 -0400 Received: from relay.sw.ru ([185.231.240.75]:38528) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTE-0006cK-Jb for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:49 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKT3-0004xb-13; Tue, 01 Oct 2019 18:53:37 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 28/31] Sockets: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:16 +0300 Message-Id: <20191001155319.8066-29-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy , =?utf-8?q?Dan?= =?utf-8?q?iel_P=2E_Berrang=C3=A9?= , Greg Kurz , Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- util/qemu-sockets.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index bcc06d0e01..396e028ae0 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -861,6 +861,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr, int num, Error **errp) { + ERRP_AUTO_PROPAGATE(); struct sockaddr_un un; int sock, fd; char *pathbuf = NULL; @@ -936,6 +937,7 @@ err: static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp) { + ERRP_AUTO_PROPAGATE(); struct sockaddr_un un; int sock, rc; size_t pathlen; From patchwork Tue Oct 1 15:53:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170066 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jQ3G050nz9sQq for ; Wed, 2 Oct 2019 02:39:38 +1000 (AEST) Received: from localhost ([::1]:44664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFLBX-0003Md-8E for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:39:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50287) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTQ-00005j-Gq for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:54:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTP-0006ue-9M for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:54:00 -0400 Received: from relay.sw.ru ([185.231.240.75]:38536) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTP-0006cf-1i; Tue, 01 Oct 2019 11:53:59 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKT3-0004xb-5m; Tue, 01 Oct 2019 18:53:37 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 29/31] nbd: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:17 +0300 Message-Id: <20191001155319.8066-30-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy , Greg Kurz , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/client.c | 5 +++++ nbd/server.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/nbd/client.c b/nbd/client.c index f6733962b4..6e510f4a14 100644 --- a/nbd/client.c +++ b/nbd/client.c @@ -68,6 +68,7 @@ static int nbd_send_option_request(QIOChannel *ioc, uint32_t opt, uint32_t len, const char *data, Error **errp) { + ERRP_AUTO_PROPAGATE(); NBDOption req; QEMU_BUILD_BUG_ON(sizeof(req) != 16); @@ -153,6 +154,7 @@ static int nbd_receive_option_reply(QIOChannel *ioc, uint32_t opt, static int nbd_handle_reply_err(QIOChannel *ioc, NBDOptionReply *reply, bool strict, Error **errp) { + ERRP_AUTO_PROPAGATE(); g_autofree char *msg = NULL; if (!(reply->type & (1 << 31))) { @@ -331,6 +333,7 @@ static int nbd_receive_list(QIOChannel *ioc, char **name, char **description, static int nbd_opt_info_or_go(QIOChannel *ioc, uint32_t opt, NBDExportInfo *info, Error **errp) { + ERRP_AUTO_PROPAGATE(); NBDOptionReply reply; uint32_t len = strlen(info->name); uint16_t type; @@ -870,6 +873,7 @@ static int nbd_start_negotiate(AioContext *aio_context, QIOChannel *ioc, bool structured_reply, bool *zeroes, Error **errp) { + ERRP_AUTO_PROPAGATE(); uint64_t magic; trace_nbd_start_negotiate(tlscreds, hostname ? hostname : ""); @@ -1005,6 +1009,7 @@ int nbd_receive_negotiate(AioContext *aio_context, QIOChannel *ioc, const char *hostname, QIOChannel **outioc, NBDExportInfo *info, Error **errp) { + ERRP_AUTO_PROPAGATE(); int result; bool zeroes; bool base_allocation = info->base_allocation; diff --git a/nbd/server.c b/nbd/server.c index d8d1e62455..e7eb154f53 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -365,6 +365,7 @@ static int nbd_opt_read_name(NBDClient *client, char *name, uint32_t *length, static int nbd_negotiate_send_rep_list(NBDClient *client, NBDExport *exp, Error **errp) { + ERRP_AUTO_PROPAGATE(); size_t name_len, desc_len; uint32_t len; const char *name = exp->name ? exp->name : ""; @@ -427,6 +428,7 @@ static void nbd_check_meta_export(NBDClient *client) static int nbd_negotiate_handle_export_name(NBDClient *client, bool no_zeroes, Error **errp) { + ERRP_AUTO_PROPAGATE(); char name[NBD_MAX_NAME_SIZE + 1]; char buf[NBD_REPLY_EXPORT_NAME_SIZE] = ""; size_t len; @@ -1260,6 +1262,7 @@ static int nbd_negotiate_options(NBDClient *client, Error **errp) */ static coroutine_fn int nbd_negotiate(NBDClient *client, Error **errp) { + ERRP_AUTO_PROPAGATE(); char buf[NBD_OLDSTYLE_NEGOTIATE_SIZE] = ""; int ret; @@ -1631,6 +1634,7 @@ void nbd_export_close(NBDExport *exp) void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp) { + ERRP_AUTO_PROPAGATE(); if (mode == NBD_SERVER_REMOVE_MODE_HARD || QTAILQ_EMPTY(&exp->clients)) { nbd_export_close(exp); return; From patchwork Tue Oct 1 15:53:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170045 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPJY3vbRz9sQm for ; Wed, 2 Oct 2019 02:06:05 +1000 (AEST) Received: from localhost ([::1]:44084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKf4-0003e6-1u for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:06:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50186) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTJ-0008NK-6t for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTG-0006oH-Ae for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:52 -0400 Received: from relay.sw.ru ([185.231.240.75]:38540) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTF-0006dP-36 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:50 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKT3-0004xb-Cj; Tue, 01 Oct 2019 18:53:37 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 30/31] PVRDMA: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:18 +0300 Message-Id: <20191001155319.8066-31-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy , Greg Kurz , Yuval Shaia Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/rdma/vmw/pvrdma_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c index 3e36e13013..fd1a6ef099 100644 --- a/hw/rdma/vmw/pvrdma_main.c +++ b/hw/rdma/vmw/pvrdma_main.c @@ -592,6 +592,7 @@ static void pvrdma_shutdown_notifier(Notifier *n, void *opaque) static void pvrdma_realize(PCIDevice *pdev, Error **errp) { + ERRP_AUTO_PROPAGATE(); int rc = 0; PVRDMADev *dev = PVRDMA_DEV(pdev); Object *memdev_root; From patchwork Tue Oct 1 15:53:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1170052 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46jPTX2Ysvz9sDB for ; Wed, 2 Oct 2019 02:13:51 +1000 (AEST) Received: from localhost ([::1]:44196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKmZ-000478-IF for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2019 12:13:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50182) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFKTJ-0008NC-6Q for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFKTG-0006oX-Dm for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:52 -0400 Received: from relay.sw.ru ([185.231.240.75]:38550) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iFKTG-0006dg-31 for qemu-devel@nongnu.org; Tue, 01 Oct 2019 11:53:50 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFKT3-0004xb-OO; Tue, 01 Oct 2019 18:53:37 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v4 31/31] ivshmem: Fix error_append_hint/error_prepend usage Date: Tue, 1 Oct 2019 18:53:19 +0300 Message-Id: <20191001155319.8066-32-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191001155319.8066-1-vsementsov@virtuozzo.com> References: <20191001155319.8066-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Sementsov-Ogievskiy , Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) and then by hand, for not maintained changed files: git commit -m ": $(< auto-msg)" Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/misc/ivshmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 5e3b05eae0..b6dcc27d18 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -864,6 +864,7 @@ static void ivshmem_write_config(PCIDevice *pdev, uint32_t address, static void ivshmem_common_realize(PCIDevice *dev, Error **errp) { + ERRP_AUTO_PROPAGATE(); IVShmemState *s = IVSHMEM_COMMON(dev); Error *err = NULL; uint8_t *pci_conf;