From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96A72C4CECE for ; Thu, 12 Mar 2020 09:03:09 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 768CC20716 for ; Thu, 12 Mar 2020 09:03:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 768CC20716 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCJkC-0004Es-EV for qemu-devel@archiver.kernel.org; Thu, 12 Mar 2020 05:03:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51624) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCJhH-00073z-Rj for qemu-devel@nongnu.org; Thu, 12 Mar 2020 05:00:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCJhB-0004s0-PO for qemu-devel@nongnu.org; Thu, 12 Mar 2020 05:00:07 -0400 Received: from relay.sw.ru ([185.231.240.75]:48458) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jCJhB-0004qf-EM for qemu-devel@nongnu.org; Thu, 12 Mar 2020 05:00:01 -0400 Received: from vovaso.qa.sw.ru ([10.94.3.0] helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1jCJgp-0004Ve-Pn; Thu, 12 Mar 2020 11:59:40 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v9 00/10] error: auto propagated local_err part I Date: Thu, 12 Mar 2020 11:59:26 +0300 Message-Id: <20200312085936.9552-1-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , vsementsov@virtuozzo.com, Laszlo Ersek , qemu-block@nongnu.org, Paul Durrant , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Christian Schoenebeck , Greg Kurz , armbru@redhat.com, Stefano Stabellini , Gerd Hoffmann , Stefan Hajnoczi , Anthony Perard , xen-devel@lists.xenproject.org, Max Reitz , Michael Roth , Stefan Berger Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" v9 01: A lot of rewordings [thanks to Eric] Still, keep all r-b marks, assuming that they are mostly about macro definition 02: significant changes are: 1. Do not match double propagation pattern in ERRP_AUTO_PROPAGATE-adding rule 2. Introduce errp->____->errp scheme to match only functions matched by rule1 in rules inherited from rule1 3. Add rules to warn about unusual patterns Also, add line to MAINTAINERS to keep error related coccinelle scripts under Error section. 07: add Christian's r-b 09: add Eric's r-b 10: a bit of context in xen_block_iothread_create and qmp_object_add() signature are changed. Patch change is obvious, so I keep Paul's r-b v9 is available at https://src.openvz.org/scm/~vsementsov/qemu.git #tag up-auto-local-err-partI-v9 v8 is available at https://src.openvz.org/scm/~vsementsov/qemu.git #tag up-auto-local-err-partI-v8 In these series, there is no commit-per-subsystem script, each generated commit is generated in separate. Still, generating commands are very similar, and looks like sed -n '/^$/,/^$/{s/^F: //p}' MAINTAINERS | \ xargs git ls-files | grep '\.[hc]$' | \ xargs spatch \ --sp-file scripts/coccinelle/auto-propagated-errp.cocci \ --macro-file scripts/cocci-macro-file.h \ --in-place --no-show-diff --max-width 80 Note, that in each generated commit, generation command is the only text, indented by 8 spaces in 'git log -1' output, so, to regenerate all commits (for example, after rebase, or change in coccinelle script), you may use the following command: git rebase -x "sh -c \"git show --pretty= --name-only | xargs git checkout HEAD^ -- ; git reset; git log -1 | grep '^ ' | sh\"" HEAD~7 Which will start automated interactive rebase for generated patches, which will stop if generated patch changed (you may do git commit --amend to apply updated generated changes). Note: git show --pretty= --name-only - lists files, changed in HEAD git log -1 | grep '^ ' | sh - rerun generation command of HEAD Check for compilation of changed .c files git rebase -x "sh -c \"git show --pretty= --name-only | sed -n 's/\.c$/.o/p' | xargs make -j9\"" HEAD~7 Vladimir Sementsov-Ogievskiy (10): error: auto propagated local_err scripts: Coccinelle script to use ERRP_AUTO_PROPAGATE() hw/sd/ssi-sd: fix error handling in ssi_sd_realize SD (Secure Card): introduce ERRP_AUTO_PROPAGATE pflash: introduce ERRP_AUTO_PROPAGATE fw_cfg: introduce ERRP_AUTO_PROPAGATE virtio-9p: introduce ERRP_AUTO_PROPAGATE TPM: introduce ERRP_AUTO_PROPAGATE nbd: introduce ERRP_AUTO_PROPAGATE xen: introduce ERRP_AUTO_PROPAGATE scripts/coccinelle/auto-propagated-errp.cocci | 327 ++++++++++++++++++ include/block/nbd.h | 1 + include/qapi/error.h | 208 +++++++++-- block/nbd.c | 21 +- hw/9pfs/9p-local.c | 12 +- hw/9pfs/9p.c | 1 + hw/block/dataplane/xen-block.c | 17 +- hw/block/pflash_cfi01.c | 7 +- hw/block/pflash_cfi02.c | 7 +- hw/block/xen-block.c | 125 +++---- hw/nvram/fw_cfg.c | 14 +- hw/pci-host/xen_igd_pt.c | 7 +- hw/sd/sdhci-pci.c | 7 +- hw/sd/sdhci.c | 21 +- hw/sd/ssi-sd.c | 26 +- hw/tpm/tpm_util.c | 7 +- hw/xen/xen-backend.c | 7 +- hw/xen/xen-bus.c | 92 +++-- hw/xen/xen-host-pci-device.c | 27 +- hw/xen/xen_pt.c | 25 +- hw/xen/xen_pt_config_init.c | 20 +- nbd/client.c | 5 + nbd/server.c | 5 + tpm.c | 7 +- MAINTAINERS | 1 + 25 files changed, 717 insertions(+), 280 deletions(-) create mode 100644 scripts/coccinelle/auto-propagated-errp.cocci Cc: Eric Blake Cc: Kevin Wolf Cc: Max Reitz Cc: Greg Kurz Cc: Christian Schoenebeck Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: Stefan Hajnoczi Cc: "Philippe Mathieu-Daudé" Cc: Laszlo Ersek Cc: Gerd Hoffmann Cc: Stefan Berger Cc: Markus Armbruster Cc: Michael Roth Cc: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org Cc: xen-devel@lists.xenproject.org -- 2.21.0