From patchwork Tue Sep 24 20:08:38 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: 1166828 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 46dC4F0NZ7z9sNk for ; Wed, 25 Sep 2019 06:10:52 +1000 (AEST) Received: from localhost ([::1]:50492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr97-0000RI-71 for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:10:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43640) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr84-0000Mb-1c for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr82-0002oO-AE for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:43 -0400 Received: from relay.sw.ru ([185.231.240.75]:38016) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr82-0002nL-3F for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:42 -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 1iCr7z-0001Mk-Pq; Tue, 24 Sep 2019 23:09:39 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 01/25] errp: rename errp to errp_in where it is IN-argument Date: Tue, 24 Sep 2019 23:08:38 +0300 Message-Id: <20190924200902.4703-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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: vsementsov@virtuozzo.com, 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 Sep 24 20:08:39 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: 1166829 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 46dC4J2FcSz9sNf for ; Wed, 25 Sep 2019 06:10:56 +1000 (AEST) Received: from localhost ([::1]:50512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr9B-0000XZ-O8 for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:10:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43681) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr87-0000Rt-B0 for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr86-0002qA-DO for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:47 -0400 Received: from relay.sw.ru ([185.231.240.75]:38030) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr86-0002pf-5e for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:46 -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 1iCr84-0001Mk-K6; Tue, 24 Sep 2019 23:09:44 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 02/25] hw/core/loader-fit: fix freeing errp in fit_load_fdt Date: Tue, 24 Sep 2019 23:08:39 +0300 Message-Id: <20190924200902.4703-3-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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 , vsementsov@virtuozzo.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" fit_load_fdt forget to zero errp. Fix it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- hw/core/loader-fit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/core/loader-fit.c b/hw/core/loader-fit.c index 953b16bc82..11e4fad595 100644 --- a/hw/core/loader-fit.c +++ b/hw/core/loader-fit.c @@ -201,6 +201,7 @@ static int fit_load_fdt(const struct fit_loader *ldr, const void *itb, if (err == -ENOENT) { load_addr = ROUND_UP(kernel_end, 64 * KiB) + (10 * MiB); error_free(*errp); + *errp = NULL; } else if (err) { error_prepend(errp, "unable to read FDT load address from FIT: "); ret = err; From patchwork Tue Sep 24 20:08:40 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: 1166833 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 46dC7Y1GXyz9sNf for ; Wed, 25 Sep 2019 06:13:45 +1000 (AEST) Received: from localhost ([::1]:50608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrBu-0004mb-8Z for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:13:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43701) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr89-0000Uj-7c for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr88-0002rH-3F for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:49 -0400 Received: from relay.sw.ru ([185.231.240.75]:38038) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr87-0002qf-SB for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09: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 1iCr86-0001Mk-Fg; Tue, 24 Sep 2019 23:09:46 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 03/25] net/net: fix local variable shadowing in net_client_init Date: Tue, 24 Sep 2019 23:08:40 +0300 Message-Id: <20190924200902.4703-4-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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 , vsementsov@virtuozzo.com 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 Sep 24 20:08:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1166834 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 46dC7Y4Xd3z9sNk for ; Wed, 25 Sep 2019 06:13:45 +1000 (AEST) Received: from localhost ([::1]:50610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrBv-0004ox-48 for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:13:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43743) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8B-0000XG-0L for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr89-0002ru-0V for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:50 -0400 Received: from relay.sw.ru ([185.231.240.75]:38042) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr88-0002qu-Nm; Tue, 24 Sep 2019 16:09: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 1iCr86-0001Mk-Qn; Tue, 24 Sep 2019 23:09:46 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 04/25] error: auto propagated local_err Date: Tue, 24 Sep 2019 23:08:41 +0300 Message-Id: <20190924200902.4703-5-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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 , Paul Burton , Peter Maydell , Jeff Cody , Jason Wang , Mark Cave-Ayland , Michael Roth , Gerd Hoffmann , Subbaraya Sundeep , qemu-block@nongnu.org, Juan Quintela , Aleksandar Rikalo , "Michael S. Tsirkin" , Markus Armbruster , Halil Pasic , Christian Borntraeger , =?utf-8?q?Marc-Andr?= =?utf-8?b?w6kgTHVyZWF1?= , David Gibson , Eric Farman , Eduardo Habkost , Greg Kurz , Yuval Shaia , "Dr. David Alan Gilbert" , Alex Williamson , integration@gluster.org, David Hildenbrand , John Snow , Richard Henderson , Kevin Wolf , vsementsov@virtuozzo.com, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Cornelia Huck , qemu-s390x@nongnu.org, Max Reitz , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Here is introduced ERRP_FUNCTION_BEGIN macro, to be used at start of functions with errp parameter. It has three goals: 1. Fix issue with error_fatal & error_append_hint: user can't see these hints, because exit() happens in error_setg earlier than hint is appended. [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: John Snow CC: Kevin Wolf CC: Max Reitz CC: Fam Zheng CC: Jeff Cody CC: "Marc-André Lureau" CC: Paolo Bonzini CC: Greg Kurz CC: Subbaraya Sundeep CC: Peter Maydell CC: Paul Burton CC: Aleksandar Rikalo CC: "Michael S. Tsirkin" CC: Marcel Apfelbaum CC: Mark Cave-Ayland CC: David Gibson CC: Yuval Shaia CC: Cornelia Huck CC: Eric Farman CC: Richard Henderson CC: David Hildenbrand CC: Halil Pasic CC: Christian Borntraeger CC: Gerd Hoffmann CC: Alex Williamson CC: Markus Armbruster CC: Michael Roth CC: Juan Quintela CC: "Dr. David Alan Gilbert" CC: Eric Blake CC: Jason Wang CC: "Daniel P. Berrangé" CC: Eduardo Habkost CC: qemu-block@nongnu.org CC: qemu-devel@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 | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/include/qapi/error.h b/include/qapi/error.h index 9376f59c35..fb41f7a790 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -322,6 +322,41 @@ 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_FUNCTION_BEGIN + * + * This macro is created to be the first line of a function with Error **errp + * parameter. + * + * 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_FUNCTION_BEGIN() \ +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 Sep 24 20:08:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 1166831 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 46dC4j0ysFz9sNf for ; Wed, 25 Sep 2019 06:11:17 +1000 (AEST) Received: from localhost ([::1]:50590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr9W-0001T6-FK for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:11:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43734) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8A-0000Wb-JM for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr88-0002rl-TU for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:50 -0400 Received: from relay.sw.ru ([185.231.240.75]:38048) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr88-0002r3-Km; Tue, 24 Sep 2019 16:09: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 1iCr87-0001Mk-7T; Tue, 24 Sep 2019 23:09:47 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 05/25] scripts: add coccinelle script to fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:42 +0300 Message-Id: <20190924200902.4703-6-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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 , Paul Burton , Peter Maydell , Jeff Cody , Jason Wang , Mark Cave-Ayland , Michael Roth , Gerd Hoffmann , Subbaraya Sundeep , qemu-block@nongnu.org, Juan Quintela , Aleksandar Rikalo , "Michael S. Tsirkin" , Markus Armbruster , Halil Pasic , Christian Borntraeger , =?utf-8?q?Marc-Andr?= =?utf-8?b?w6kgTHVyZWF1?= , David Gibson , Eric Farman , Eduardo Habkost , Greg Kurz , Yuval Shaia , "Dr. David Alan Gilbert" , Alex Williamson , integration@gluster.org, David Hildenbrand , John Snow , Richard Henderson , Kevin Wolf , vsementsov@virtuozzo.com, =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Cornelia Huck , qemu-s390x@nongnu.org, Max Reitz , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" error_append_hint will not work, if errp == &fatal_error, as program will exit before error_append_hint call. Fix this by use of special macro ERRP_FUNCTION_BEGIN. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- CC: John Snow CC: Kevin Wolf CC: Max Reitz CC: Fam Zheng CC: Jeff Cody CC: "Marc-André Lureau" CC: Paolo Bonzini CC: Greg Kurz CC: Subbaraya Sundeep CC: Peter Maydell CC: Paul Burton CC: Aleksandar Rikalo CC: "Michael S. Tsirkin" CC: Marcel Apfelbaum CC: Mark Cave-Ayland CC: David Gibson CC: Yuval Shaia CC: Cornelia Huck CC: Eric Farman CC: Richard Henderson CC: David Hildenbrand CC: Halil Pasic CC: Christian Borntraeger CC: Gerd Hoffmann CC: Alex Williamson CC: Markus Armbruster CC: Michael Roth CC: Juan Quintela CC: "Dr. David Alan Gilbert" CC: Eric Blake CC: Jason Wang CC: "Daniel P. Berrangé" CC: Eduardo Habkost CC: qemu-block@nongnu.org CC: qemu-devel@nongnu.org CC: integration@gluster.org CC: qemu-arm@nongnu.org CC: qemu-ppc@nongnu.org CC: qemu-s390x@nongnu.org .../fix-error_append_hint-usage.cocci | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/coccinelle/fix-error_append_hint-usage.cocci diff --git a/scripts/coccinelle/fix-error_append_hint-usage.cocci b/scripts/coccinelle/fix-error_append_hint-usage.cocci new file mode 100644 index 0000000000..327fe6098c --- /dev/null +++ b/scripts/coccinelle/fix-error_append_hint-usage.cocci @@ -0,0 +1,25 @@ +@rule0@ +// Add invocation to errp-functions +identifier fn; +@@ + + fn(..., Error **errp, ...) + { ++ ERRP_FUNCTION_BEGIN(); + <+... + error_append_hint(errp, ...); + ...+> + } + +@@ +// Drop doubled invocation +identifier rule0.fn; +@@ + + fn(...) +{ + ERRP_FUNCTION_BEGIN(); +- ERRP_FUNCTION_BEGIN(); + ... +} + From patchwork Tue Sep 24 20:08:43 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: 1166838 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 46dCDY4N7mz9sNx for ; Wed, 25 Sep 2019 06:18:05 +1000 (AEST) Received: from localhost ([::1]:50638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrG6-0000fn-Mo for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:18:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43739) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8A-0000X6-Vn for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr89-0002s1-3M for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:50 -0400 Received: from relay.sw.ru ([185.231.240.75]:38052) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr88-0002r6-PV for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09: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 1iCr87-0001Mk-G8; Tue, 24 Sep 2019 23:09:47 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 06/25] python: add commit-per-subsystem.py Date: Tue, 24 Sep 2019 23:08:43 +0300 Message-Id: <20190924200902.4703-7-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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: vsementsov@virtuozzo.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 --- 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 Sep 24 20:08:44 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: 1166835 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 46dC871ZL3z9sNf for ; Wed, 25 Sep 2019 06:14:13 +1000 (AEST) Received: from localhost ([::1]:50614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrCN-0005Mh-3C for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:14:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43740) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8A-0000XB-VE for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr89-0002sN-Cy for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:50 -0400 Received: from relay.sw.ru ([185.231.240.75]:38056) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr89-0002rL-26; Tue, 24 Sep 2019 16:09: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 1iCr87-0001Mk-Mr; Tue, 24 Sep 2019 23:09:47 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 07/25] s390: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:44 +0300 Message-Id: <20190924200902.4703-8-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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 , vsementsov@virtuozzo.com, 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 append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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/s390x/s390-ccw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index 0c5a5b60bd..c445dca2e1 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_FUNCTION_BEGIN(); unsigned int cssid, ssid, devid; char dev_path[PATH_MAX] = {0}, *tmp; From patchwork Tue Sep 24 20:08:45 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: 1166839 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 46dCF11k7dz9sNf for ; Wed, 25 Sep 2019 06:18:29 +1000 (AEST) Received: from localhost ([::1]:50644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrGV-00016r-08 for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:18:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43744) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8B-0000XH-0R for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr89-0002sT-Eq for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:50 -0400 Received: from relay.sw.ru ([185.231.240.75]:38058) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr89-0002rN-3b; Tue, 24 Sep 2019 16:09: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 1iCr87-0001Mk-TL; Tue, 24 Sep 2019 23:09:47 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 08/25] ARM TCG CPUs: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:45 +0300 Message-Id: <20190924200902.4703-9-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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 , vsementsov@virtuozzo.com, 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 append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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..21e4bdfb72 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_FUNCTION_BEGIN(); 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..e79a46b0b3 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_FUNCTION_BEGIN(); 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_FUNCTION_BEGIN(); VirtMachineState *vms = VIRT_MACHINE(obj); if (!strcmp(value, "smmuv3")) { From patchwork Tue Sep 24 20:08:46 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: 1166836 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 46dC9D3ztKz9sNk for ; Wed, 25 Sep 2019 06:15:12 +1000 (AEST) Received: from localhost ([::1]:50618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrDJ-0006EK-Js for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:15:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43764) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8C-0000Z2-BI for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8A-0002t3-9A for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:51 -0400 Received: from relay.sw.ru ([185.231.240.75]:38064) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr89-0002rW-Gx; Tue, 24 Sep 2019 16:09: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 1iCr88-0001Mk-1Q; Tue, 24 Sep 2019 23:09:48 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 09/25] PowerPC TCG CPUs: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:46 +0300 Message-Id: <20190924200902.4703-10-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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: qemu-ppc@nongnu.org, vsementsov@virtuozzo.com, Mark Cave-Ayland , Greg Kurz , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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/spapr.c | 1 + hw/ppc/spapr_pci.c | 1 + target/ppc/kvm.c | 2 ++ 4 files changed, 5 insertions(+) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index c5bbcc7433..939fdd258f 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_FUNCTION_BEGIN(); Core99MachineState *cms = CORE99_MACHINE(obj); if (!strcmp(value, "cuda")) { diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 08a2a5a770..d0dd8aaa22 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_FUNCTION_BEGIN(); SpaprMachineState *spapr = SPAPR_MACHINE(qdev_get_machine()); MachineState *ms = MACHINE(spapr); int vcpu_id; diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 7b71ad7c74..172d6689d0 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_FUNCTION_BEGIN(); /* 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..aacfe194e2 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_FUNCTION_BEGIN(); 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_FUNCTION_BEGIN(); int i; GString *g; char *s; From patchwork Tue Sep 24 20:08:47 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: 1166842 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 46dCJy6gP1z9sNf for ; Wed, 25 Sep 2019 06:21:54 +1000 (AEST) Received: from localhost ([::1]:50684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrJo-0004x5-A6 for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:21:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43757) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8B-0000YL-Ke for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr89-0002sl-W1 for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:09:51 -0400 Received: from relay.sw.ru ([185.231.240.75]:38068) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr89-0002rd-Nn; Tue, 24 Sep 2019 16:09: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 1iCr88-0001Mk-Aq; Tue, 24 Sep 2019 23:09:48 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 10/25] arm: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:47 +0300 Message-Id: <20190924200902.4703-11-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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 , vsementsov@virtuozzo.com, Greg Kurz , qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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..42487fc62b 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_FUNCTION_BEGIN(); GICv3State *s = KVM_ARM_GICV3(dev); KVMARMGICv3Class *kgc = KVM_ARM_GICV3_GET_CLASS(s); bool multiple_redist_region_allowed; From patchwork Tue Sep 24 20:08:48 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: 1166847 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 46dCQX0tkxz9sNf for ; Wed, 25 Sep 2019 06:26:43 +1000 (AEST) Received: from localhost ([::1]:50744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrOS-0002aC-Gk for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:26:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43963) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8L-0000ox-OC for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8K-0002zJ-Aj for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:01 -0400 Received: from relay.sw.ru ([185.231.240.75]:38076) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8K-0002s8-3K for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:00 -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 1iCr88-0001Mk-Hi; Tue, 24 Sep 2019 23:09:48 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 11/25] SmartFusion2: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:48 +0300 Message-Id: <20190924200902.4703-12-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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 , vsementsov@virtuozzo.com, Greg Kurz , Subbaraya Sundeep Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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..a2f5310fe0 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_FUNCTION_BEGIN(); MSF2SysregState *s = MSF2_SYSREG(dev); if ((s->apb0div > 32 || !is_power_of_2(s->apb0div)) From patchwork Tue Sep 24 20:08: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: 1166837 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 46dCDY0pZGz9sNk for ; Wed, 25 Sep 2019 06:18:05 +1000 (AEST) Received: from localhost ([::1]:50640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrG6-0000gF-AG for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:18:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43970) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8M-0000pP-0d for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8K-0002zW-Km for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:01 -0400 Received: from relay.sw.ru ([185.231.240.75]:38088) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8K-0002sZ-BP for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:00 -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 1iCr88-0001Mk-Th; Tue, 24 Sep 2019 23:09:49 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 12/25] PCI: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:49 +0300 Message-Id: <20190924200902.4703-13-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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: vsementsov@virtuozzo.com, Greg Kurz , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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..a0aacad711 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_FUNCTION_BEGIN(); PCIEPort *p = PCIE_PORT(d); PCIESlot *s = PCIE_SLOT(d); PCIDeviceClass *dc = PCI_DEVICE_GET_CLASS(d); From patchwork Tue Sep 24 20:08: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: 1166850 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 46dCWW4FjZz9sNf for ; Wed, 25 Sep 2019 06:31:03 +1000 (AEST) Received: from localhost ([::1]:50774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrSe-0006TM-Rp for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:31:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43980) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8M-0000qB-J4 for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8K-0002zi-PR for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:02 -0400 Received: from relay.sw.ru ([185.231.240.75]:38094) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8K-0002sb-Hp for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:00 -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 1iCr89-0001Mk-70; Tue, 24 Sep 2019 23:09:49 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 13/25] SCSI: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:50 +0300 Message-Id: <20190924200902.4703-14-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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 , vsementsov@virtuozzo.com, Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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 + 2 files changed, 2 insertions(+) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 915641a0f1..72ac308b6c 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_FUNCTION_BEGIN(); 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..e955f4e0a5 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_FUNCTION_BEGIN(); int rc; int sg_version; struct sg_scsi_id scsiid; From patchwork Tue Sep 24 20:08: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: 1166851 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 46dCcC2Flbz9sNf for ; Wed, 25 Sep 2019 06:35:07 +1000 (AEST) Received: from localhost ([::1]:50818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrWb-00028t-1z for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:35:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43991) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8M-0000qt-Q2 for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8L-0002zy-5Z for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:02 -0400 Received: from relay.sw.ru ([185.231.240.75]:38106) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8K-0002sh-Tk for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:01 -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 1iCr89-0001Mk-Dx; Tue, 24 Sep 2019 23:09:49 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 14/25] USB: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:51 +0300 Message-Id: <20190924200902.4703-15-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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: vsementsov@virtuozzo.com, Greg Kurz , Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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..9a2ea129dd 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_FUNCTION_BEGIN(); EmulatedState *card = EMULATED_CCID_CARD(base); VCardEmulError ret; const EnumTable *ptable; From patchwork Tue Sep 24 20:08: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: 1166852 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 46dCgN6y1Jz9sNx for ; Wed, 25 Sep 2019 06:37:52 +1000 (AEST) Received: from localhost ([::1]:50850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrZG-0005mb-OB for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:37:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44028) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8O-0000sd-2X for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8M-00030c-1o for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:03 -0400 Received: from relay.sw.ru ([185.231.240.75]:38112) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8L-0002t7-KO for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:01 -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 1iCr89-0001Mk-PQ; Tue, 24 Sep 2019 23:09:49 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 15/25] VFIO: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:52 +0300 Message-Id: <20190924200902.4703-16-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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 , vsementsov@virtuozzo.com, Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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 | 2 ++ hw/vfio/pci.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 3e03c495d8..d08276b1e6 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -1437,6 +1437,7 @@ static void vfio_disconnect_container(VFIOGroup *group) VFIOGroup *vfio_get_group(int groupid, AddressSpace *as, Error **errp) { + ERRP_FUNCTION_BEGIN(); VFIOGroup *group; char path[32]; struct vfio_group_status status = { .argsz = sizeof(status) }; @@ -1526,6 +1527,7 @@ void vfio_put_group(VFIOGroup *group) int vfio_get_device(VFIOGroup *group, const char *name, VFIODevice *vbasedev, Error **errp) { + ERRP_FUNCTION_BEGIN(); struct vfio_device_info dev_info = { .argsz = sizeof(dev_info) }; int ret, fd; diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index c5e6fe61cb..57208c7075 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -2469,6 +2469,7 @@ int vfio_populate_vga(VFIOPCIDevice *vdev, Error **errp) static void vfio_populate_device(VFIOPCIDevice *vdev, Error **errp) { + ERRP_FUNCTION_BEGIN(); VFIODevice *vbasedev = &vdev->vbasedev; struct vfio_region_info *reg_info; struct vfio_irq_info irq_info = { .argsz = sizeof(irq_info) }; @@ -2700,6 +2701,7 @@ static void vfio_unregister_req_notifier(VFIOPCIDevice *vdev) static void vfio_realize(PCIDevice *pdev, Error **errp) { + ERRP_FUNCTION_BEGIN(); VFIOPCIDevice *vdev = PCI_VFIO(pdev); VFIODevice *vbasedev_iter; VFIOGroup *group; From patchwork Tue Sep 24 20:08: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: 1166841 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 46dCJf1vKcz9sNf for ; Wed, 25 Sep 2019 06:21:38 +1000 (AEST) Received: from localhost ([::1]:50676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrJX-0004Xh-FZ for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:21:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44021) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8N-0000sA-Qk for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8L-00030F-OO for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:03 -0400 Received: from relay.sw.ru ([185.231.240.75]:38124) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8L-0002tJ-FP for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:01 -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 1iCr8A-0001Mk-2O; Tue, 24 Sep 2019 23:09:50 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 16/25] virtio: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:53 +0300 Message-Id: <20190924200902.4703-17-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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: vsementsov@virtuozzo.com, Greg Kurz , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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/virtio-pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index c6b47a9c73..291044c4e4 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_FUNCTION_BEGIN(); 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_FUNCTION_BEGIN(); 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 Sep 24 20:08: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: 1166854 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 46dCjX6Nmbz9sNf for ; Wed, 25 Sep 2019 06:39:43 +1000 (AEST) Received: from localhost ([::1]:50872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrb3-00005N-5k for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:39:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44024) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8N-0000sH-Tb for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8M-00030k-4B for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:03 -0400 Received: from relay.sw.ru ([185.231.240.75]:38132) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8L-0002tV-MP for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:01 -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 1iCr8A-0001Mk-C9; Tue, 24 Sep 2019 23:09:50 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 17/25] virtio-9p: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:54 +0300 Message-Id: <20190924200902.4703-18-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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: vsementsov@virtuozzo.com, Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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 + 2 files changed, 2 insertions(+) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 08e673a79c..6b1a805575 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_FUNCTION_BEGIN(); 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..01ff411aea 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_FUNCTION_BEGIN(); 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" From patchwork Tue Sep 24 20:08: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: 1166849 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 46dCTn0ZS6z9sNk for ; Wed, 25 Sep 2019 06:29:31 +1000 (AEST) Received: from localhost ([::1]:50767 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrRA-0005RX-Jc for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:29:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44131) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8Z-0000zm-AN for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8W-000397-G1 for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:14 -0400 Received: from relay.sw.ru ([185.231.240.75]:38136) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8W-0002u5-8q; Tue, 24 Sep 2019 16:10:12 -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 1iCr8A-0001Mk-JZ; Tue, 24 Sep 2019 23:09:50 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 18/25] block: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:55 +0300 Message-Id: <20190924200902.4703-19-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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 , vsementsov@virtuozzo.com, qemu-block@nongnu.org, Jeff Cody , 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 append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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 Reviewed-by: Eric Blake --- block/backup.c | 1 + block/dirty-bitmap.c | 1 + block/file-posix.c | 3 +++ block/gluster.c | 2 ++ block/qcow.c | 1 + block/qcow2.c | 1 + block/vhdx-log.c | 1 + block/vpc.c | 1 + 8 files changed, 11 insertions(+) diff --git a/block/backup.c b/block/backup.c index 763f0d7ff6..8cb0201833 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_FUNCTION_BEGIN(); int ret; BlockDriverInfo bdi; diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index 134e0c9a0c..eba47490ea 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_FUNCTION_BEGIN(); 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..46818fe4fc 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_FUNCTION_BEGIN(); BDRVRawState *s = bs->opaque; char *buf; size_t max_align = MAX(MAX_BLOCKSIZE, getpagesize()); @@ -817,6 +818,7 @@ static int raw_handle_perm_lock(BlockDriverState *bs, uint64_t new_perm, uint64_t new_shared, Error **errp) { + ERRP_FUNCTION_BEGIN(); BDRVRawState *s = bs->opaque; int ret = 0; Error *local_err = NULL; @@ -2232,6 +2234,7 @@ static int64_t raw_get_allocated_file_size(BlockDriverState *bs) static int coroutine_fn raw_co_create(BlockdevCreateOptions *options, Error **errp) { + ERRP_FUNCTION_BEGIN(); BlockdevCreateOptionsFile *file_opts; Error *local_err = NULL; int fd; diff --git a/block/gluster.c b/block/gluster.c index 64028b2cba..7023807326 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_FUNCTION_BEGIN(); 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_FUNCTION_BEGIN(); int ret; if (filename) { ret = qemu_gluster_parse_uri(gconf, filename); diff --git a/block/qcow.c b/block/qcow.c index 5bdf72ba33..33a004350b 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_FUNCTION_BEGIN(); BDRVQcowState *s = bs->opaque; unsigned int len, i, shift; int ret; diff --git a/block/qcow2.c b/block/qcow2.c index 4d16393e61..d9aac1186d 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_FUNCTION_BEGIN(); BDRVQcow2State *s = bs->opaque; unsigned int len, i; int ret = 0; diff --git a/block/vhdx-log.c b/block/vhdx-log.c index fdd3a7adc3..24e5efb46c 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_FUNCTION_BEGIN(); int ret = 0; VHDXHeader *hdr; VHDXLogSequence logs = { 0 }; diff --git a/block/vpc.c b/block/vpc.c index 5cd3890780..b12a2d964a 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_FUNCTION_BEGIN(); BlockdevCreateOptionsVpc *vpc_opts; BlockBackend *blk = NULL; BlockDriverState *bs = NULL; From patchwork Tue Sep 24 20:08: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: 1166840 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 46dCH15CD2z9sNf for ; Wed, 25 Sep 2019 06:20:13 +1000 (AEST) Received: from localhost ([::1]:50666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrIA-0002zy-Vk for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:20:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44057) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8O-0000tc-RP for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8M-00031G-SA for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:04 -0400 Received: from relay.sw.ru ([185.231.240.75]:38146) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8M-0002u8-Ef for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:02 -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 1iCr8B-0001Mk-2H; Tue, 24 Sep 2019 23:09:51 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 19/25] chardev: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:56 +0300 Message-Id: <20190924200902.4703-20-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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?= , vsementsov@virtuozzo.com, Greg Kurz , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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..1421c85464 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_FUNCTION_BEGIN(); ChardevSpiceChannel *spicevmc = backend->u.spicevmc.data; const char *type = spicevmc->type; const char **psubtype = spice_server_char_device_recognized_subtypes(); From patchwork Tue Sep 24 20:08: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: 1166855 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 46dCn04bBFz9sNf for ; Wed, 25 Sep 2019 06:42:44 +1000 (AEST) Received: from localhost ([::1]:50908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrdw-0002TY-Ny for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:42:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44070) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8P-0000tv-5Y for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8N-00031c-E7 for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:04 -0400 Received: from relay.sw.ru ([185.231.240.75]:38150) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8M-0002uJ-PT for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:03 -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 1iCr8B-0001Mk-Ag; Tue, 24 Sep 2019 23:09:51 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 20/25] cmdline: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:57 +0300 Message-Id: <20190924200902.4703-21-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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: vsementsov@virtuozzo.com, Greg Kurz , Markus Armbruster Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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..7136d83b1d 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_FUNCTION_BEGIN(); 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_FUNCTION_BEGIN(); QemuOpts *opts = NULL; if (id) { From patchwork Tue Sep 24 20:08: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: 1166845 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 46dCMy4hXDz9sNf for ; Wed, 25 Sep 2019 06:24:29 +1000 (AEST) Received: from localhost ([::1]:50710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrMI-0000MR-6l for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:24:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44069) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8P-0000tu-5p for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8N-00031m-Kp for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:04 -0400 Received: from relay.sw.ru ([185.231.240.75]:38158) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8N-0002uR-02 for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:03 -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 1iCr8B-0001Mk-Kj; Tue, 24 Sep 2019 23:09:51 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 21/25] QOM: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:58 +0300 Message-Id: <20190924200902.4703-22-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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 , vsementsov@virtuozzo.com, =?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 append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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 --- qdev-monitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qdev-monitor.c b/qdev-monitor.c index 148df9cacf..d0129411fb 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_FUNCTION_BEGIN(); 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_FUNCTION_BEGIN(); BusChild *kid; const char *sep = " "; From patchwork Tue Sep 24 20:08: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: 1166846 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 46dCP437R4z9sNx for ; Wed, 25 Sep 2019 06:25:28 +1000 (AEST) Received: from localhost ([::1]:50726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrNF-0001j6-Jz for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:25:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44077) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8P-0000uB-AW for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8N-000321-RQ for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:05 -0400 Received: from relay.sw.ru ([185.231.240.75]:38168) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8N-0002ud-D0 for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:03 -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 1iCr8B-0001Mk-Ry; Tue, 24 Sep 2019 23:09:51 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 22/25] Migration: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:59 +0300 Message-Id: <20190924200902.4703-23-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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: vsementsov@virtuozzo.com, 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 append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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 + 1 file changed, 1 insertion(+) diff --git a/migration/migration.c b/migration/migration.c index 01863a95f5..031b85e670 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_FUNCTION_BEGIN(); MigrationCapabilityStatusList *cap; bool old_postcopy_cap; MigrationIncomingState *mis = migration_incoming_get_current(); From patchwork Tue Sep 24 20:09: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: 1166843 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 46dCKk3VS2z9sNf for ; Wed, 25 Sep 2019 06:22:34 +1000 (AEST) Received: from localhost ([::1]:50692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrKR-0005qw-L9 for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:22:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44084) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8P-0000uW-D8 for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8O-00032I-10 for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:05 -0400 Received: from relay.sw.ru ([185.231.240.75]:38174) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8N-0002un-G6 for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:03 -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 1iCr8C-0001Mk-2A; Tue, 24 Sep 2019 23:09:52 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 23/25] Sockets: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:09:00 +0300 Message-Id: <20190924200902.4703-24-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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: vsementsov@virtuozzo.com, =?utf-8?q?Daniel_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 append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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 Reviewed-by: Eric Blake --- util/qemu-sockets.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c index 98ff3a1cce..fb21b78369 100644 --- a/util/qemu-sockets.c +++ b/util/qemu-sockets.c @@ -860,6 +860,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr, int num, Error **errp) { + ERRP_FUNCTION_BEGIN(); struct sockaddr_un un; int sock, fd; char *pathbuf = NULL; @@ -935,6 +936,7 @@ err: static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp) { + ERRP_FUNCTION_BEGIN(); struct sockaddr_un un; int sock, rc; size_t pathlen; From patchwork Tue Sep 24 20:09: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: 1166844 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 46dCLS3FKdz9sNk for ; Wed, 25 Sep 2019 06:23:12 +1000 (AEST) Received: from localhost ([::1]:50698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrL4-0006fD-98 for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:23:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44144) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8a-000121-He for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8Z-00039z-8e for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:16 -0400 Received: from relay.sw.ru ([185.231.240.75]:38178) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8X-0002v0-Np; Tue, 24 Sep 2019 16:10:14 -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 1iCr8C-0001Mk-AA; Tue, 24 Sep 2019 23:09:52 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 24/25] nbd: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:09:01 +0300 Message-Id: <20190924200902.4703-25-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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: vsementsov@virtuozzo.com, Greg Kurz , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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 Reviewed-by: Eric Blake --- nbd/client.c | 1 + nbd/server.c | 1 + 2 files changed, 2 insertions(+) diff --git a/nbd/client.c b/nbd/client.c index b9dc829175..4d90a26c00 100644 --- a/nbd/client.c +++ b/nbd/client.c @@ -153,6 +153,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_FUNCTION_BEGIN(); g_autofree char *msg = NULL; if (!(reply->type & (1 << 31))) { diff --git a/nbd/server.c b/nbd/server.c index 28c3c8be85..09565ad8dc 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -1616,6 +1616,7 @@ void nbd_export_close(NBDExport *exp) void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp) { + ERRP_FUNCTION_BEGIN(); if (mode == NBD_SERVER_REMOVE_MODE_HARD || QTAILQ_EMPTY(&exp->clients)) { nbd_export_close(exp); return; From patchwork Tue Sep 24 20:09: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: 1166857 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 46dCr041Nxz9sNf for ; Wed, 25 Sep 2019 06:45:19 +1000 (AEST) Received: from localhost ([::1]:50936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrgT-0005Em-9f for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2019 16:45:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44097) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8P-0000vJ-Rl for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8O-00032a-DA for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:05 -0400 Received: from relay.sw.ru ([185.231.240.75]:38184) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8N-0002vB-Ug for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:04 -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 1iCr8C-0001Mk-HJ; Tue, 24 Sep 2019 23:09:52 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 25/25] PVRDMA: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:09:02 +0300 Message-Id: <20190924200902.4703-26-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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: vsementsov@virtuozzo.com, Greg Kurz , Yuval Shaia Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) 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..3cc02311bf 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_FUNCTION_BEGIN(); int rc = 0; PVRDMADev *dev = PVRDMA_DEV(pdev); Object *memdev_root;