From nobody Wed May 15 11:04:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1586810989; cv=none; d=zohomail.com; s=zohoarc; b=MlE9oTelf8NQID9nahEMiu504Z3kpehU7aHXkMbVM3Li+icQ/N5irJX9AZXAttU1XDpsX3xiaMpeb2QK0On3e4d1W6hj9wIkw8vd9A+6bhx5F2+/wgqVX2NRJkE9+UTfrAT2w4gzSxHq+2owKteCkBj2ItjKtGU5c8v3XHGSvdg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586810989; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=QAjTCOX4eYcBvo0NrQxhDD/AdRXkPtS7fHXUdXwRsWc=; b=FTKt4RuqEMaWKNRCneQr6wWqeplEHyq8Te2vmtUz03z0RbWJZZPlj1wwCOFWYTM5OzA0FIK0ZVuHDbVkunv0exkzmuixnn56wrCpJGROkOFcwT/8mMGsgn+chXo1S/b83TuuX+V7ZZxTY6QuyX5GYGlPPH27C4Pvk+PCvI5mvtY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 158681098953018.755918125037738; Mon, 13 Apr 2020 13:49:49 -0700 (PDT) Received: from localhost ([::1]:48672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO61b-0004cK-Oj for importer@patchew.org; Mon, 13 Apr 2020 16:49:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35681) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO60a-000462-RP for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:48:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jO60Z-0006Sf-LX for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:48:44 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:45045) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jO60Z-0006SQ-Dh for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:48:43 -0400 Received: by mail-wr1-x442.google.com with SMTP id d17so4783936wrg.11 for ; Mon, 13 Apr 2020 13:48:43 -0700 (PDT) Received: from localhost.localdomain (116.red-83-42-57.dynamicip.rima-tde.net. [83.42.57.116]) by smtp.gmail.com with ESMTPSA id y16sm16404922wrp.78.2020.04.13.13.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 13:48:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QAjTCOX4eYcBvo0NrQxhDD/AdRXkPtS7fHXUdXwRsWc=; b=gFE/8x7kkbFHz/b5BvCGcR7URVWeW+lqsq4kXNyXDKfqV1MKg6PQgq+s5u3OTaxTX+ 3t4oJZ/Z3EwuccXMV5mpItr7I/fNOASsK9BV0+3KGMpHmUEg+/p7NIQjOtzqZR5u7+zl cazOUAzWNjC84dJ2Rayf/xkjwJKukRP4B9YV7qeN5GjZ2aiHbe1pCWL4CvH2wgWhbeEm Ph1XW3wPrtn0cjhTYZnMUra2aFY4x4Oe4KTkK1XufVbF/qu++n/w7L4TSN0Eak5L0JYi Xe+iIXpwrAI3RkINrWppMfMN8EeLgHucWc4ww2TsN4JHJoDVgfEzWIxsaeR0n2XefI2n 1gmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=QAjTCOX4eYcBvo0NrQxhDD/AdRXkPtS7fHXUdXwRsWc=; b=YlsyLcmnItXpchqx6HpPImya8NMuCyy9DhDqjjN19UdKZGM7AA2nYWWsRUuAlUBOoC Bcn2guKgypzPcW5yfn3LBVop89iCxJop2QXd7ui0mMLnWQaItoQb+rUb3vyGivfoLCfZ I9oE7Lk5bV2j7e9lg/4jdnuYqBmj9bZmGlNf5lkUKk0Y52VWl9cmCgFB5Zj+T4zA2ya+ PHpxVeijPRfDFUXhJHMbiNRifbQts+PdgDpomK+9yuj/KZKthUv6dxN+tGTmDk34cQ9h hBJMFjcau0TypA+amp/0dQw5d9IdJaIsdvQQ8J+8vZsBJVGd2glVErCoPiOTwNmX9KL5 N+Ag== X-Gm-Message-State: AGi0PuaDv8B6sW0KhIapxFz+gh3EsBAGshTfdW6IcFWmBnsF2vjKYssu SaXTbXLlz3KuqucqSCMteCtbM3GrMUc= X-Google-Smtp-Source: APiQypJuwJybL4KFdUf1xPYjwq/1jojjgv5s2XJngrS/eiKAvcWNO198gAOHl05rcm35gn/G5DEG1w== X-Received: by 2002:adf:ed07:: with SMTP id a7mr21012044wro.2.1586810921547; Mon, 13 Apr 2020 13:48:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH-for-5.1 v3 1/7] scripts/coccinelle: Use &error_abort in TypeInfo::instance_init() Date: Mon, 13 Apr 2020 22:48:32 +0200 Message-Id: <20200413204832.404-1-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: 20200412224517.12869-1-f4bug@amsat.org References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The instance_init() calls are not suppose to fail. Add a Coccinelle script to use &error_abort instead of ignoring errors by using a NULL Error*. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- v3: Improved script (Vladimir Sementsov-Ogievskiy suggestions) .../use-error_abort-in-instance_init.cocci | 45 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 46 insertions(+) create mode 100644 scripts/coccinelle/use-error_abort-in-instance_init.coc= ci diff --git a/scripts/coccinelle/use-error_abort-in-instance_init.cocci b/sc= ripts/coccinelle/use-error_abort-in-instance_init.cocci new file mode 100644 index 0000000000..706c60163c --- /dev/null +++ b/scripts/coccinelle/use-error_abort-in-instance_init.cocci @@ -0,0 +1,45 @@ +// Use &error_abort in TypeInfo::instance_init() +// +// Copyright: (C) 2020 Philippe Mathieu-Daud=C3=A9 +// This work is licensed under the terms of the GNU GPLv2 or later. +// +// spatch \ +// --macro-file scripts/cocci-macro-file.h --include-headers \ +// --sp-file scripts/coccinelle/use-error_abort-in-instance_init.cocci \ +// --keep-comments --in-place +// +// Inspired by https://www.mail-archive.com/qemu-devel@nongnu.org/msg69250= 0.html +// and https://www.mail-archive.com/qemu-devel@nongnu.org/msg693637.html + + +@ has_qapi_error @ +@@ + #include "qapi/error.h" + + +@ match_instance_init @ +TypeInfo info; +identifier instance_initfn; +@@ + info.instance_init =3D instance_initfn; + + +@ use_error_abort_in_instance_init @ +identifier match_instance_init.instance_initfn; +identifier func_with_error !=3D {qbus_create_inplace, object_initialize_ch= ild}; +position pos; +@@ +void instance_initfn(...) +{ + <+... + func_with_error@pos(..., +- NULL); ++ &error_abort); + ...+> +} + + +@ depends on use_error_abort_in_instance_init && !has_qapi_error @ +@@ + #include ... ++ #include "qapi/error.h" diff --git a/MAINTAINERS b/MAINTAINERS index f996e72780..77b93612bc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2060,6 +2060,7 @@ F: scripts/coccinelle/error-use-after-free.cocci F: scripts/coccinelle/error_propagate_null.cocci F: scripts/coccinelle/remove_local_err.cocci F: scripts/coccinelle/simplify-init-realize-error_propagate.cocci +F: scripts/coccinelle/use-error_abort-in-instance_init.cocci F: scripts/coccinelle/use-error_fatal.cocci F: scripts/coccinelle/use-error_propagate-in-realize.cocci =20 --=20 2.21.1 From nobody Wed May 15 11:04:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1586813980; cv=none; d=zohomail.com; s=zohoarc; b=LOeVrhWwzZxG3Rbgjs8WTIxaoEZbLsoUO616NUIw4rVYlhiLAXwcJx7I+3WNIOzH1rUVktYlD9zL+ziwfF/Me/zqfBwLMgz5648gD/xpmSwK8Ba5wPzkz7Wrb4op2ofqWxOmkbUBkF//D2XzRAoyKopGKCIUp68DFyIccYcXiHg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586813980; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=sGAga8BYVHJSNF2JXAFuIVgkfvIclW5q+uLZoijoRJw=; b=HFmYxXhW8Gao6GBKDe/DyKWrN4ynMAKql+p98559cbQuLakSQqJL3eqy4mrHfu6M2ckHr9ML+XPGF7vcXE5u7bNRbxxwHnwVX2WzbxAqxjMMIOOOen5PU8rHxzad0u4YEfVXu75loQA/7TBoXqRq9TbpylB8/9ommKr+BgNvDLo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586813980217336.02824690361354; Mon, 13 Apr 2020 14:39:40 -0700 (PDT) Received: from localhost ([::1]:49098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO6np-0000UY-Ph for importer@patchew.org; Mon, 13 Apr 2020 17:39:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40312) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO6n1-0008Ub-H5 for qemu-devel@nongnu.org; Mon, 13 Apr 2020 17:38:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jO6mx-0002fG-7t for qemu-devel@nongnu.org; Mon, 13 Apr 2020 17:38:47 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:38605) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jO6mw-0002f5-PB for qemu-devel@nongnu.org; Mon, 13 Apr 2020 17:38:43 -0400 Received: by mail-wm1-x335.google.com with SMTP id g12so3795278wmh.3 for ; Mon, 13 Apr 2020 14:38:42 -0700 (PDT) Received: from localhost.localdomain (116.red-83-42-57.dynamicip.rima-tde.net. [83.42.57.116]) by smtp.gmail.com with ESMTPSA id k184sm16825270wma.13.2020.04.13.14.38.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 14:38:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sGAga8BYVHJSNF2JXAFuIVgkfvIclW5q+uLZoijoRJw=; b=ry/sQtQ8VFvKhi8w6mQl8+hrfHAYj71oZPq+VoWr8zoWwv/ZzqaMY9XoIXU+Zg/vxx S7NUICggtPK6MfkmaKDxCMzWxK7NGahD/RSxMl/5wZysNZWH/6/sfDnLsPVXO05eIWbm +wH9XDpZ4deDesXTCR3jkWyMfEcp/iz2Stx9tq6+8mDP56747D93Ugj69zngofZ98hQS QKvS/wABfbOP1Ne4FxavhvYn6T7U4TA43LOCy/5DRcCPlMGhrImZpw2cyotBZOcEvs53 hqw8DzyI3zO8MMaVle5w2MyD1CBNRplgMRrvbRGPbS4Chi46fln/oJyLS7gxE46tLlSl IbhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=sGAga8BYVHJSNF2JXAFuIVgkfvIclW5q+uLZoijoRJw=; b=jglgvi2iRE30LzDpShjTAQeNs+Y95X0i6d57iQdpd14fdH8H76+N1Ozu3/yuOrk+kv +OkjM4QIISSo9+RngohhBnpw3wBmwaNE826uYUYn56ef1+6i9YwibEgV132HTzfEqJRO pdhwzCAAc1qXyfOHHcFXQkBti1n3oqVclpfedVkKPyNQ7Fcu+VyRosAgQQFsOqIxGQwE BxFGQPsoFiGTffqUtg1Xd8CprZM0yllPBKLvTVnJnrnHeZ/fGtPbMmox8YBZkLjKFEqY OqtvwBO/bGpf1gN30uUreAKYCYQX6uQAvcnmagHZJXdW3OZaVCz3k/UtE6UiefUsrdOv bquA== X-Gm-Message-State: AGi0PuaDzSQxOJFz8Rd1+prKmdqNjTMgnBbEmJ7e8PIoiP86guJ33uHL QpoKx+8SP9aLHSKA7AYHPxNMiS4YIZsHeA== X-Google-Smtp-Source: APiQypKG01VASxTx3QqAQ4pKFc7S5YMKKhBm9AQcHg++oIyumOLLzwH9ISd+qsFDw5VVldNU7oZuHQ== X-Received: by 2002:a05:600c:2f17:: with SMTP id r23mr19433076wmn.81.1586813919823; Mon, 13 Apr 2020 14:38:39 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH-for-5.1 v3 2/7] various: Use &error_abort in instance_init() Date: Mon, 13 Apr 2020 23:38:25 +0200 Message-Id: <20200413213825.15584-1-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: 20200412224517.12869-1-f4bug@amsat.org References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::335 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Cornelia Huck , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Patch created mechanically by running: $ spatch \ --macro-file scripts/cocci-macro-file.h \ --include-headers --keep-comments --in-place \ --sp-file \ scripts/coccinelle/use-error_abort-in-instance_init.cocci Reviewed-by: C=C3=A9dric Le Goater Acked-by: Cornelia Huck Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- v3: Include "qapi/error.h" in spapr_llan.c and test-qdev-global-props.c --- backends/cryptodev-vhost-user.c | 2 +- backends/rng-egd.c | 2 +- backends/rng-random.c | 2 +- backends/vhost-user.c | 3 ++- hw/arm/bcm2835_peripherals.c | 6 ++++-- hw/arm/vexpress.c | 8 ++++---- hw/arm/xlnx-zcu102.c | 8 ++++---- hw/block/fdc.c | 4 ++-- hw/block/vhost-user-blk.c | 2 +- hw/block/virtio-blk.c | 2 +- hw/core/machine.c | 6 +++--- hw/cpu/core.c | 4 ++-- hw/display/vga-pci.c | 7 +++++-- hw/display/xlnx_dp.c | 4 ++-- hw/dma/sparc32_dma.c | 2 +- hw/gpio/aspeed_gpio.c | 2 +- hw/ide/macio.c | 4 +++- hw/ide/qdev.c | 4 ++-- hw/intc/apic_common.c | 2 +- hw/mem/nvdimm.c | 4 ++-- hw/misc/aspeed_sdmc.c | 2 +- hw/misc/edu.c | 3 ++- hw/misc/macio/macio.c | 4 ++-- hw/misc/macio/pmu.c | 3 ++- hw/misc/pca9552.c | 2 +- hw/misc/tmp105.c | 2 +- hw/misc/tmp421.c | 8 ++++---- hw/net/e1000.c | 3 ++- hw/net/lance.c | 3 ++- hw/net/lasi_i82596.c | 3 ++- hw/net/ne2000-isa.c | 4 ++-- hw/net/spapr_llan.c | 3 ++- hw/net/virtio-net.c | 2 +- hw/pci-host/grackle.c | 2 +- hw/pci-host/i440fx.c | 8 ++++---- hw/pci-host/prep.c | 2 +- hw/pci-host/q35.c | 23 ++++++++++++++--------- hw/pci-host/sabre.c | 3 ++- hw/pci-host/uninorth.c | 9 +++++---- hw/pcmcia/pxa2xx.c | 3 ++- hw/ppc/spapr_drc.c | 6 +++--- hw/ppc/spapr_rng.c | 2 +- hw/riscv/sifive_u.c | 4 ++-- hw/s390x/event-facility.c | 6 +++--- hw/s390x/s390-ccw.c | 2 +- hw/s390x/s390-skeys.c | 4 ++-- hw/s390x/s390-stattrib.c | 4 ++-- hw/s390x/sclp.c | 2 +- hw/scsi/scsi-bus.c | 2 +- hw/ssi/xilinx_spips.c | 2 +- hw/usb/bus.c | 4 ++-- hw/usb/dev-network.c | 2 +- hw/usb/dev-storage.c | 4 ++-- hw/usb/host-libusb.c | 2 +- hw/usb/redirect.c | 2 +- hw/virtio/virtio-balloon.c | 4 ++-- net/dump.c | 4 ++-- net/filter-buffer.c | 2 +- net/filter-mirror.c | 10 +++++----- net/filter-rewriter.c | 3 ++- target/arm/cpu64.c | 4 ++-- target/i386/cpu.c | 23 ++++++++++++++--------- target/s390x/cpu.c | 3 ++- tests/check-qom-proplist.c | 7 ++++--- tests/test-qdev-global-props.c | 5 +++-- 65 files changed, 157 insertions(+), 126 deletions(-) diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-use= r.c index 6edada8e9e..2fb28c13ac 100644 --- a/backends/cryptodev-vhost-user.c +++ b/backends/cryptodev-vhost-user.c @@ -341,7 +341,7 @@ static void cryptodev_vhost_user_instance_int(Object *o= bj) object_property_add_str(obj, "chardev", cryptodev_vhost_user_get_chardev, cryptodev_vhost_user_set_chardev, - NULL); + &error_abort); } =20 static void cryptodev_vhost_user_finalize(Object *obj) diff --git a/backends/rng-egd.c b/backends/rng-egd.c index e380519408..58fb73f03a 100644 --- a/backends/rng-egd.c +++ b/backends/rng-egd.c @@ -139,7 +139,7 @@ static void rng_egd_init(Object *obj) { object_property_add_str(obj, "chardev", rng_egd_get_chardev, rng_egd_set_chardev, - NULL); + &error_abort); } =20 static void rng_egd_finalize(Object *obj) diff --git a/backends/rng-random.c b/backends/rng-random.c index a810581393..6429276a95 100644 --- a/backends/rng-random.c +++ b/backends/rng-random.c @@ -111,7 +111,7 @@ static void rng_random_init(Object *obj) object_property_add_str(obj, "filename", rng_random_get_filename, rng_random_set_filename, - NULL); + &error_abort); =20 s->filename =3D g_strdup("/dev/urandom"); s->fd =3D -1; diff --git a/backends/vhost-user.c b/backends/vhost-user.c index 2bf3406525..491da81653 100644 --- a/backends/vhost-user.c +++ b/backends/vhost-user.c @@ -177,7 +177,8 @@ static char *get_chardev(Object *obj, Error **errp) =20 static void vhost_user_backend_init(Object *obj) { - object_property_add_str(obj, "chardev", get_chardev, set_chardev, NULL= ); + object_property_add_str(obj, "chardev", get_chardev, set_chardev, + &error_abort); } =20 static void vhost_user_backend_finalize(Object *obj) diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c index a111e91069..201123dd05 100644 --- a/hw/arm/bcm2835_peripherals.c +++ b/hw/arm/bcm2835_peripherals.c @@ -43,12 +43,14 @@ static void bcm2835_peripherals_init(Object *obj) =20 /* Memory region for peripheral devices, which we export to our parent= */ memory_region_init(&s->peri_mr, obj,"bcm2835-peripherals", 0x1000000); - object_property_add_child(obj, "peripheral-io", OBJECT(&s->peri_mr), N= ULL); + object_property_add_child(obj, "peripheral-io", OBJECT(&s->peri_mr), + &error_abort); sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->peri_mr); =20 /* Internal memory region for peripheral bus addresses (not exported) = */ memory_region_init(&s->gpu_bus_mr, obj, "bcm2835-gpu", (uint64_t)1 << = 32); - object_property_add_child(obj, "gpu-bus", OBJECT(&s->gpu_bus_mr), NULL= ); + object_property_add_child(obj, "gpu-bus", OBJECT(&s->gpu_bus_mr), + &error_abort); =20 /* Internal memory region for request/response communication with * mailbox-addressable peripherals (not exported) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index ed683eeea5..7f79c4eb13 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -749,11 +749,11 @@ static void vexpress_instance_init(Object *obj) /* EL3 is enabled by default on vexpress */ vms->secure =3D true; object_property_add_bool(obj, "secure", vexpress_get_secure, - vexpress_set_secure, NULL); + vexpress_set_secure, &error_abort); object_property_set_description(obj, "secure", "Set on/off to enable/disable the ARM " "Security Extensions (TrustZone)", - NULL); + &error_abort); } =20 static void vexpress_a15_instance_init(Object *obj) @@ -766,12 +766,12 @@ static void vexpress_a15_instance_init(Object *obj) */ vms->virt =3D true; object_property_add_bool(obj, "virtualization", vexpress_get_virt, - vexpress_set_virt, NULL); + vexpress_set_virt, &error_abort); object_property_set_description(obj, "virtualization", "Set on/off to enable/disable the ARM " "Virtualization Extensions " "(defaults to same as 'secure')", - NULL); + &error_abort); } =20 static void vexpress_a9_instance_init(Object *obj) diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c index bd645ad818..e4d233ec58 100644 --- a/hw/arm/xlnx-zcu102.c +++ b/hw/arm/xlnx-zcu102.c @@ -178,21 +178,21 @@ static void xlnx_zcu102_machine_instance_init(Object = *obj) /* Default to secure mode being disabled */ s->secure =3D false; object_property_add_bool(obj, "secure", zcu102_get_secure, - zcu102_set_secure, NULL); + zcu102_set_secure, &error_abort); object_property_set_description(obj, "secure", "Set on/off to enable/disable the ARM " "Security Extensions (TrustZone)", - NULL); + &error_abort); =20 /* Default to virt (EL2) being disabled */ s->virt =3D false; object_property_add_bool(obj, "virtualization", zcu102_get_virt, - zcu102_set_virt, NULL); + zcu102_set_virt, &error_abort); object_property_set_description(obj, "virtualization", "Set on/off to enable/disable emulatin= g a " "guest CPU which implements the ARM " "Virtualization Extensions", - NULL); + &error_abort); } =20 static void xlnx_zcu102_machine_class_init(ObjectClass *oc, void *data) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 33bc9e2f92..29b499260d 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -2812,10 +2812,10 @@ static void isabus_fdc_instance_init(Object *obj) =20 device_add_bootindex_property(obj, &isa->bootindexA, "bootindexA", "/floppy@0", - DEVICE(obj), NULL); + DEVICE(obj), &error_abort); device_add_bootindex_property(obj, &isa->bootindexB, "bootindexB", "/floppy@1", - DEVICE(obj), NULL); + DEVICE(obj), &error_abort); } =20 static const TypeInfo isa_fdc_info =3D { diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 17df5338e7..22ddccefce 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -477,7 +477,7 @@ static void vhost_user_blk_instance_init(Object *obj) VHostUserBlk *s =3D VHOST_USER_BLK(obj); =20 device_add_bootindex_property(obj, &s->bootindex, "bootindex", - "/disk@0,0", DEVICE(obj), NULL); + "/disk@0,0", DEVICE(obj), &error_abort); } =20 static const VMStateDescription vmstate_vhost_user_blk =3D { diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 97ba8a2187..5af420fd15 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -1248,7 +1248,7 @@ static void virtio_blk_instance_init(Object *obj) =20 device_add_bootindex_property(obj, &s->conf.conf.bootindex, "bootindex", "/disk@0,0", - DEVICE(obj), NULL); + DEVICE(obj), &error_abort); } =20 static const VMStateDescription vmstate_virtio_blk =3D { diff --git a/hw/core/machine.c b/hw/core/machine.c index de0c425605..6c114cdd6b 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -894,7 +894,7 @@ static void machine_initfn(Object *obj) &error_abort); object_property_set_description(obj, "nvdimm", "Set on/off to enable/disable " - "NVDIMM instantiation", NULL); + "NVDIMM instantiation", &error_abo= rt); =20 object_property_add_str(obj, "nvdimm-persistence", machine_get_nvdimm_persistence, @@ -903,7 +903,7 @@ static void machine_initfn(Object *obj) object_property_set_description(obj, "nvdimm-persistence", "Set NVDIMM persistence" "Valid values are cpu, mem-ctrl", - NULL); + &error_abort); } =20 if (mc->cpu_index_to_instance_props && mc->get_default_cpu_node_id) { @@ -914,7 +914,7 @@ static void machine_initfn(Object *obj) object_property_set_description(obj, "hmat", "Set on/off to enable/disable " "ACPI Heterogeneous Memory Attribu= te " - "Table (HMAT)", NULL); + "Table (HMAT)", &error_abort); } =20 object_property_add_str(obj, "memory-backend", diff --git a/hw/cpu/core.c b/hw/cpu/core.c index 9874c5c870..aa0040f8e6 100644 --- a/hw/cpu/core.c +++ b/hw/cpu/core.c @@ -76,9 +76,9 @@ static void cpu_core_instance_init(Object *obj) CPUCore *core =3D CPU_CORE(obj); =20 object_property_add(obj, "core-id", "int", core_prop_get_core_id, - core_prop_set_core_id, NULL, NULL, NULL); + core_prop_set_core_id, NULL, NULL, &error_abort); object_property_add(obj, "nr-threads", "int", core_prop_get_nr_threads, - core_prop_set_nr_threads, NULL, NULL, NULL); + core_prop_set_nr_threads, NULL, NULL, &error_abort= ); core->nr_threads =3D ms->smp.threads; } =20 diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index 6b9db86e36..423943bd35 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -25,6 +25,7 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/pci/pci.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" @@ -270,7 +271,8 @@ static void pci_std_vga_init(Object *obj) { /* Expose framebuffer byteorder via QOM */ object_property_add_bool(obj, "big-endian-framebuffer", - vga_get_big_endian_fb, vga_set_big_endian_fb,= NULL); + vga_get_big_endian_fb, vga_set_big_endian_fb, + &error_abort); } =20 static void pci_secondary_vga_realize(PCIDevice *dev, Error **errp) @@ -321,7 +323,8 @@ static void pci_secondary_vga_init(Object *obj) { /* Expose framebuffer byteorder via QOM */ object_property_add_bool(obj, "big-endian-framebuffer", - vga_get_big_endian_fb, vga_set_big_endian_fb,= NULL); + vga_get_big_endian_fb, vga_set_big_endian_fb, + &error_abort); } =20 static void pci_secondary_vga_reset(DeviceState *dev) diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c index 7058443797..af5958d256 100644 --- a/hw/display/xlnx_dp.c +++ b/hw/display/xlnx_dp.c @@ -1249,11 +1249,11 @@ static void xlnx_dp_init(Object *obj) * Initialize DPCD and EDID.. */ s->dpcd =3D DPCD(aux_create_slave(s->aux_bus, "dpcd")); - object_property_add_child(OBJECT(s), "dpcd", OBJECT(s->dpcd), NULL); + object_property_add_child(OBJECT(s), "dpcd", OBJECT(s->dpcd), &error_a= bort); =20 s->edid =3D I2CDDC(qdev_create(BUS(aux_get_i2c_bus(s->aux_bus)), "i2c-= ddc")); i2c_set_slave_address(I2C_SLAVE(s->edid), 0x50); - object_property_add_child(OBJECT(s), "edid", OBJECT(s->edid), NULL); + object_property_add_child(OBJECT(s), "edid", OBJECT(s->edid), &error_a= bort); =20 fifo8_create(&s->rx_fifo, 16); fifo8_create(&s->tx_fifo, 16); diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c index 3e4da0c47f..cd751b6d63 100644 --- a/hw/dma/sparc32_dma.c +++ b/hw/dma/sparc32_dma.c @@ -264,7 +264,7 @@ static void sparc32_dma_device_init(Object *obj) object_property_add_link(OBJECT(dev), "iommu", TYPE_SUN4M_IOMMU, (Object **) &s->iommu, qdev_prop_allow_set_link_before_realize, - 0, NULL); + 0, &error_abort); =20 qdev_init_gpio_in(dev, dma_set_irq, 1); qdev_init_gpio_out(dev, s->gpio, 2); diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index e52fcfd9a0..8aed5c4583 100644 --- a/hw/gpio/aspeed_gpio.c +++ b/hw/gpio/aspeed_gpio.c @@ -873,7 +873,7 @@ static void aspeed_gpio_init(Object *obj) name =3D g_strdup_printf("gpio%s%d", props->group_label[group_idx], pin_idx % GPIOS_PER_GROUP); object_property_add(obj, name, "bool", aspeed_gpio_get_pin, - aspeed_gpio_set_pin, NULL, NULL, NULL); + aspeed_gpio_set_pin, NULL, NULL, &error_abort); g_free(name); } } diff --git a/hw/ide/macio.c b/hw/ide/macio.c index a9f25e5d02..c4e20a246f 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -24,6 +24,7 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/ppc/mac.h" #include "hw/ppc/mac_dbdma.h" #include "hw/qdev-properties.h" @@ -459,7 +460,8 @@ static void macio_ide_initfn(Object *obj) =20 object_property_add_link(obj, "dbdma", TYPE_MAC_DBDMA, (Object **) &s->dbdma, - qdev_prop_allow_set_link_before_realize, 0, N= ULL); + qdev_prop_allow_set_link_before_realize, 0, + &error_abort); } =20 static Property macio_ide_properties[] =3D { diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index c22afdb8ee..a25c424bdf 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -266,8 +266,8 @@ static void ide_dev_instance_init(Object *obj) { object_property_add(obj, "bootindex", "int32", ide_dev_get_bootindex, - ide_dev_set_bootindex, NULL, NULL, NULL); - object_property_set_int(obj, -1, "bootindex", NULL); + ide_dev_set_bootindex, NULL, NULL, &error_abort); + object_property_set_int(obj, -1, "bootindex", &error_abort); } =20 static void ide_hd_realize(IDEDevice *dev, Error **errp) diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c index 9ec0f2deb2..710deed276 100644 --- a/hw/intc/apic_common.c +++ b/hw/intc/apic_common.c @@ -445,7 +445,7 @@ static void apic_common_initfn(Object *obj) s->id =3D s->initial_apic_id =3D -1; object_property_add(obj, "id", "uint32", apic_common_get_id, - apic_common_set_id, NULL, NULL, NULL); + apic_common_set_id, NULL, NULL, &error_abort); } =20 static void apic_common_class_init(ObjectClass *klass, void *data) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c index 8e426d24bb..be9f145dfd 100644 --- a/hw/mem/nvdimm.c +++ b/hw/mem/nvdimm.c @@ -110,10 +110,10 @@ static void nvdimm_init(Object *obj) { object_property_add(obj, NVDIMM_LABEL_SIZE_PROP, "int", nvdimm_get_label_size, nvdimm_set_label_size, NULL, - NULL, NULL); + NULL, &error_abort); =20 object_property_add(obj, NVDIMM_UUID_PROP, "QemuUUID", nvdimm_get_uuid, - nvdimm_set_uuid, NULL, NULL, NULL); + nvdimm_set_uuid, NULL, NULL, &error_abort); } =20 static void nvdimm_finalize(Object *obj) diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index 7b466bf19a..6154cd23d8 100644 --- a/hw/misc/aspeed_sdmc.c +++ b/hw/misc/aspeed_sdmc.c @@ -255,7 +255,7 @@ static void aspeed_sdmc_initfn(Object *obj) { object_property_add(obj, "ram-size", "int", aspeed_sdmc_get_ram_size, aspeed_sdmc_set_ram_size, - NULL, NULL, NULL); + NULL, NULL, &error_abort); } =20 static void aspeed_sdmc_realize(DeviceState *dev, Error **errp) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index ff10f5b794..9ecbfc767b 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu/units.h" #include "hw/pci/pci.h" #include "hw/hw.h" @@ -403,7 +404,7 @@ static void edu_instance_init(Object *obj) edu->dma_mask =3D (1UL << 28) - 1; object_property_add_uint64_ptr(obj, "dma_mask", &edu->dma_mask, OBJ_PROP_FLAG_READWRITE, - NULL); + &error_abort); } =20 static void edu_class_init(ObjectClass *class, void *data) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index fffb64a7d5..3c40256ae5 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -241,7 +241,7 @@ static void macio_oldworld_init(Object *obj) object_property_add_link(obj, "pic", TYPE_HEATHROW, (Object **) &os->pic, qdev_prop_allow_set_link_before_realize, - 0, NULL); + 0, &error_abort); =20 macio_init_child_obj(s, "cuda", &s->cuda, sizeof(s->cuda), TYPE_CUDA); =20 @@ -401,7 +401,7 @@ static void macio_newworld_init(Object *obj) object_property_add_link(obj, "pic", TYPE_OPENPIC, (Object **) &ns->pic, qdev_prop_allow_set_link_before_realize, - 0, NULL); + 0, &error_abort); =20 macio_init_child_obj(s, "gpio", &ns->gpio, sizeof(ns->gpio), TYPE_MACIO_GPIO); diff --git a/hw/misc/macio/pmu.c b/hw/misc/macio/pmu.c index b8466a4a3f..22b380e2fd 100644 --- a/hw/misc/macio/pmu.c +++ b/hw/misc/macio/pmu.c @@ -30,6 +30,7 @@ =20 #include "qemu/osdep.h" #include "qemu-common.h" +#include "qapi/error.h" #include "hw/ppc/mac.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" @@ -773,7 +774,7 @@ static void pmu_init(Object *obj) object_property_add_link(obj, "gpio", TYPE_MACIO_GPIO, (Object **) &s->gpio, qdev_prop_allow_set_link_before_realize, - 0, NULL); + 0, &error_abort); =20 sysbus_init_child_obj(obj, "mos6522-pmu", &s->mos6522_pmu, sizeof(s->mos6522_pmu), TYPE_MOS6522_PMU); diff --git a/hw/misc/pca9552.c b/hw/misc/pca9552.c index efd961e041..9abb84cb24 100644 --- a/hw/misc/pca9552.c +++ b/hw/misc/pca9552.c @@ -298,7 +298,7 @@ static void pca9552_initfn(Object *obj) =20 name =3D g_strdup_printf("led%d", led); object_property_add(obj, name, "bool", pca9552_get_led, pca9552_se= t_led, - NULL, NULL, NULL); + NULL, NULL, &error_abort); g_free(name); } } diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c index 75ddad3a12..e3e1f03e51 100644 --- a/hw/misc/tmp105.c +++ b/hw/misc/tmp105.c @@ -245,7 +245,7 @@ static void tmp105_initfn(Object *obj) { object_property_add(obj, "temperature", "int", tmp105_get_temperature, - tmp105_set_temperature, NULL, NULL, NULL); + tmp105_set_temperature, NULL, NULL, &error_abort); } =20 static void tmp105_class_init(ObjectClass *klass, void *data) diff --git a/hw/misc/tmp421.c b/hw/misc/tmp421.c index c0bc150bca..a49835f6b6 100644 --- a/hw/misc/tmp421.c +++ b/hw/misc/tmp421.c @@ -347,16 +347,16 @@ static void tmp421_initfn(Object *obj) { object_property_add(obj, "temperature0", "int", tmp421_get_temperature, - tmp421_set_temperature, NULL, NULL, NULL); + tmp421_set_temperature, NULL, NULL, &error_abort); object_property_add(obj, "temperature1", "int", tmp421_get_temperature, - tmp421_set_temperature, NULL, NULL, NULL); + tmp421_set_temperature, NULL, NULL, &error_abort); object_property_add(obj, "temperature2", "int", tmp421_get_temperature, - tmp421_set_temperature, NULL, NULL, NULL); + tmp421_set_temperature, NULL, NULL, &error_abort); object_property_add(obj, "temperature3", "int", tmp421_get_temperature, - tmp421_set_temperature, NULL, NULL, NULL); + tmp421_set_temperature, NULL, NULL, &error_abort); } =20 static void tmp421_class_init(ObjectClass *klass, void *data) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 2a69eee63f..6b76e71e4c 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -26,6 +26,7 @@ =20 =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/pci/pci.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" @@ -1774,7 +1775,7 @@ static void e1000_instance_init(Object *obj) E1000State *n =3D E1000(obj); device_add_bootindex_property(obj, &n->conf.bootindex, "bootindex", "/ethernet-phy@0", - DEVICE(n), NULL); + DEVICE(n), &error_abort); } =20 static const TypeInfo e1000_base_info =3D { diff --git a/hw/net/lance.c b/hw/net/lance.c index 688724db0b..436a40225b 100644 --- a/hw/net/lance.c +++ b/hw/net/lance.c @@ -38,6 +38,7 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "qemu/timer.h" +#include "qapi/error.h" #include "hw/sparc/sparc32_dma.h" #include "migration/vmstate.h" #include "hw/net/lance.h" @@ -134,7 +135,7 @@ static void lance_instance_init(Object *obj) =20 device_add_bootindex_property(obj, &s->conf.bootindex, "bootindex", "/ethernet-phy@0", - DEVICE(obj), NULL); + DEVICE(obj), &error_abort); } =20 static Property lance_properties[] =3D { diff --git a/hw/net/lasi_i82596.c b/hw/net/lasi_i82596.c index 52637a562d..7c7e9f3366 100644 --- a/hw/net/lasi_i82596.c +++ b/hw/net/lasi_i82596.c @@ -11,6 +11,7 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu/timer.h" #include "hw/sysbus.h" #include "net/eth.h" @@ -152,7 +153,7 @@ static void lasi_82596_instance_init(Object *obj) =20 device_add_bootindex_property(obj, &s->conf.bootindex, "bootindex", "/ethernet-phy@0", - DEVICE(obj), NULL); + DEVICE(obj), &error_abort); } =20 static Property lasi_82596_properties[] =3D { diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c index e744eff153..fece06c59f 100644 --- a/hw/net/ne2000-isa.c +++ b/hw/net/ne2000-isa.c @@ -133,8 +133,8 @@ static void isa_ne2000_instance_init(Object *obj) { object_property_add(obj, "bootindex", "int32", isa_ne2000_get_bootindex, - isa_ne2000_set_bootindex, NULL, NULL, NULL); - object_property_set_int(obj, -1, "bootindex", NULL); + isa_ne2000_set_bootindex, NULL, NULL, &error_abort= ); + object_property_set_int(obj, -1, "bootindex", &error_abort); } static const TypeInfo ne2000_isa_info =3D { .name =3D TYPE_ISA_NE2000, diff --git a/hw/net/spapr_llan.c b/hw/net/spapr_llan.c index a2377025a7..f81b39c812 100644 --- a/hw/net/spapr_llan.c +++ b/hw/net/spapr_llan.c @@ -29,6 +29,7 @@ #include "cpu.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qapi/error.h" #include "net/net.h" #include "migration/vmstate.h" #include "hw/ppc/spapr.h" @@ -340,7 +341,7 @@ static void spapr_vlan_instance_init(Object *obj) =20 device_add_bootindex_property(obj, &dev->nicconf.bootindex, "bootindex", "", - DEVICE(dev), NULL); + DEVICE(dev), &error_abort); =20 if (dev->compat_flags & SPAPRVLAN_FLAG_RX_BUF_POOLS) { for (i =3D 0; i < RX_MAX_POOLS; i++) { diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index eddfa7f923..ba93984c6d 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3122,7 +3122,7 @@ static void virtio_net_instance_init(Object *obj) n->config_size =3D sizeof(struct virtio_net_config); device_add_bootindex_property(obj, &n->nic_conf.bootindex, "bootindex", "/ethernet-phy@0", - DEVICE(n), NULL); + DEVICE(n), &error_abort); } =20 static int virtio_net_pre_save(void *opaque) diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index 24ccdf6ceb..89e37c4bf8 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -109,7 +109,7 @@ static void grackle_init(Object *obj) object_property_add_link(obj, "pic", TYPE_HEATHROW, (Object **) &s->pic, qdev_prop_allow_set_link_before_realize, - 0, NULL); + 0, &error_abort); =20 sysbus_init_mmio(sbd, &phb->conf_mem); sysbus_init_mmio(sbd, &phb->data_mem); diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index d980c97049..512ff600a6 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -212,19 +212,19 @@ static void i440fx_pcihost_initfn(Object *obj) =20 object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", i440fx_pcihost_get_pci_hole_start, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, &error_abort); =20 object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", i440fx_pcihost_get_pci_hole_end, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, &error_abort); =20 object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", i440fx_pcihost_get_pci_hole64_start, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, &error_abort); =20 object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", i440fx_pcihost_get_pci_hole64_end, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, &error_abort); } =20 static void i440fx_pcihost_realize(DeviceState *dev, Error **errp) diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c index 1a02e9a670..22dc3bd033 100644 --- a/hw/pci-host/prep.c +++ b/hw/pci-host/prep.c @@ -311,7 +311,7 @@ static void raven_pcihost_initfn(Object *obj) pci_dev =3D DEVICE(&s->pci_dev); qdev_set_parent_bus(pci_dev, BUS(&s->pci_bus)); object_property_set_int(OBJECT(&s->pci_dev), PCI_DEVFN(0, 0), "addr", - NULL); + &error_abort); qdev_prop_set_bit(pci_dev, "multifunction", false); } =20 diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 2bbc90b28f..f05fbae3c9 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -222,38 +222,43 @@ static void q35_host_initfn(Object *obj) Q35_PCI_HOST_HOLE64_SIZE_DEFAULT); object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", q35_host_get_pci_hole_start, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, &error_abort); =20 object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_END, "uint32", q35_host_get_pci_hole_end, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, &error_abort); =20 object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_START, "uint64", q35_host_get_pci_hole64_start, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, &error_abort); =20 object_property_add(obj, PCI_HOST_PROP_PCI_HOLE64_END, "uint64", q35_host_get_pci_hole64_end, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, &error_abort); =20 object_property_add_uint64_ptr(obj, PCIE_HOST_MCFG_SIZE, - &pehb->size, OBJ_PROP_FLAG_READ, NULL); + &pehb->size, OBJ_PROP_FLAG_READ, + &error_abort); =20 object_property_add_link(obj, MCH_HOST_PROP_RAM_MEM, TYPE_MEMORY_REGIO= N, (Object **) &s->mch.ram_memory, - qdev_prop_allow_set_link_before_realize, 0, N= ULL); + qdev_prop_allow_set_link_before_realize, 0, + &error_abort); =20 object_property_add_link(obj, MCH_HOST_PROP_PCI_MEM, TYPE_MEMORY_REGIO= N, (Object **) &s->mch.pci_address_space, - qdev_prop_allow_set_link_before_realize, 0, N= ULL); + qdev_prop_allow_set_link_before_realize, 0, + &error_abort); =20 object_property_add_link(obj, MCH_HOST_PROP_SYSTEM_MEM, TYPE_MEMORY_RE= GION, (Object **) &s->mch.system_memory, - qdev_prop_allow_set_link_before_realize, 0, N= ULL); + qdev_prop_allow_set_link_before_realize, 0, + &error_abort); =20 object_property_add_link(obj, MCH_HOST_PROP_IO_MEM, TYPE_MEMORY_REGION, (Object **) &s->mch.address_space_io, - qdev_prop_allow_set_link_before_realize, 0, N= ULL); + qdev_prop_allow_set_link_before_realize, 0, + &error_abort); } =20 static const TypeInfo q35_host_info =3D { diff --git a/hw/pci-host/sabre.c b/hw/pci-host/sabre.c index 2b8503b709..b02c56def5 100644 --- a/hw/pci-host/sabre.c +++ b/hw/pci-host/sabre.c @@ -25,6 +25,7 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/sysbus.h" #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" @@ -442,7 +443,7 @@ static void sabre_init(Object *obj) object_property_add_link(obj, "iommu", TYPE_SUN4U_IOMMU, (Object **) &s->iommu, qdev_prop_allow_set_link_before_realize, - 0, NULL); + 0, &error_abort); =20 /* sabre_config */ memory_region_init_io(&s->sabre_config, OBJECT(s), &sabre_config_ops, = s, diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index cf70b76fe2..14e619d1d3 100644 --- a/hw/pci-host/uninorth.c +++ b/hw/pci-host/uninorth.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/irq.h" #include "hw/ppc/mac.h" #include "hw/qdev-properties.h" @@ -175,7 +176,7 @@ static void pci_unin_main_init(Object *obj) object_property_add_link(obj, "pic", TYPE_OPENPIC, (Object **) &s->pic, qdev_prop_allow_set_link_before_realize, - 0, NULL); + 0, &error_abort); =20 sysbus_init_mmio(sbd, &h->conf_mem); sysbus_init_mmio(sbd, &h->data_mem); @@ -223,7 +224,7 @@ static void pci_u3_agp_init(Object *obj) object_property_add_link(obj, "pic", TYPE_OPENPIC, (Object **) &s->pic, qdev_prop_allow_set_link_before_realize, - 0, NULL); + 0, &error_abort); =20 sysbus_init_mmio(sbd, &h->conf_mem); sysbus_init_mmio(sbd, &h->data_mem); @@ -262,7 +263,7 @@ static void pci_unin_agp_init(Object *obj) object_property_add_link(obj, "pic", TYPE_OPENPIC, (Object **) &s->pic, qdev_prop_allow_set_link_before_realize, - 0, NULL); + 0, &error_abort); =20 sysbus_init_mmio(sbd, &h->conf_mem); sysbus_init_mmio(sbd, &h->data_mem); @@ -299,7 +300,7 @@ static void pci_unin_internal_init(Object *obj) object_property_add_link(obj, "pic", TYPE_OPENPIC, (Object **) &s->pic, qdev_prop_allow_set_link_before_realize, - 0, NULL); + 0, &error_abort); =20 sysbus_init_mmio(sbd, &h->conf_mem); sysbus_init_mmio(sbd, &h->data_mem); diff --git a/hw/pcmcia/pxa2xx.c b/hw/pcmcia/pxa2xx.c index 14e4dfe8b1..c0d2bf4c9a 100644 --- a/hw/pcmcia/pxa2xx.c +++ b/hw/pcmcia/pxa2xx.c @@ -11,6 +11,7 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/irq.h" #include "hw/sysbus.h" #include "qemu/module.h" @@ -189,7 +190,7 @@ static void pxa2xx_pcmcia_initfn(Object *obj) object_property_add_link(obj, "card", TYPE_PCMCIA_CARD, (Object **)&s->card, NULL, /* read-only property */ - 0, NULL); + 0, &error_abort); } =20 /* Insert a new card into a slot */ diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 47e6bb12f9..5537468e20 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -584,11 +584,11 @@ static void spapr_dr_connector_instance_init(Object *= obj) SpaprDrcClass *drck =3D SPAPR_DR_CONNECTOR_GET_CLASS(drc); =20 object_property_add_uint32_ptr(obj, "id", &drc->id, OBJ_PROP_FLAG_READ, - NULL); + &error_abort); object_property_add(obj, "index", "uint32", prop_get_index, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, &error_abort); object_property_add(obj, "fdt", "struct", prop_get_fdt, - NULL, NULL, NULL, NULL); + NULL, NULL, NULL, &error_abort); drc->state =3D drck->empty_state; } =20 diff --git a/hw/ppc/spapr_rng.c b/hw/ppc/spapr_rng.c index e8e8d65ec0..e82b0db598 100644 --- a/hw/ppc/spapr_rng.c +++ b/hw/ppc/spapr_rng.c @@ -104,7 +104,7 @@ static void spapr_rng_instance_init(Object *obj) =20 object_property_set_description(obj, "rng", "ID of the random number generator bac= kend", - NULL); + &error_abort); } =20 static void spapr_rng_realize(DeviceState *dev, Error **errp) diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index b6c27bc970..6fda0db71e 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -487,11 +487,11 @@ static void riscv_sifive_u_machine_instance_init(Obje= ct *obj) =20 s->start_in_flash =3D false; object_property_add_bool(obj, "start-in-flash", sifive_u_get_start_in_= flash, - sifive_u_set_start_in_flash, NULL); + sifive_u_set_start_in_flash, &error_abort); object_property_set_description(obj, "start-in-flash", "Set on to tell QEMU's ROM to jump to " "flash. Otherwise QEMU will jump to DR= AM", - NULL); + &error_abort); } =20 static void riscv_sifive_u_soc_realize(DeviceState *dev, Error **errp) diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c index 9d6972afa8..a1c555fb84 100644 --- a/hw/s390x/event-facility.c +++ b/hw/s390x/event-facility.c @@ -449,18 +449,18 @@ static void init_event_facility(Object *obj) event_facility->allow_all_mask_sizes =3D true; object_property_add_bool(obj, "allow_all_mask_sizes", sclp_event_get_allow_all_mask_sizes, - sclp_event_set_allow_all_mask_sizes, NULL); + sclp_event_set_allow_all_mask_sizes, &error_a= bort); /* Spawn a new bus for SCLP events */ qbus_create_inplace(&event_facility->sbus, sizeof(event_facility->sbus= ), TYPE_SCLP_EVENTS_BUS, sdev, NULL); =20 new =3D object_new(TYPE_SCLP_QUIESCE); - object_property_add_child(obj, TYPE_SCLP_QUIESCE, new, NULL); + object_property_add_child(obj, TYPE_SCLP_QUIESCE, new, &error_abort); object_unref(new); qdev_set_parent_bus(DEVICE(new), BUS(&event_facility->sbus)); =20 new =3D object_new(TYPE_SCLP_CPU_HOTPLUG); - object_property_add_child(obj, TYPE_SCLP_CPU_HOTPLUG, new, NULL); + object_property_add_child(obj, TYPE_SCLP_CPU_HOTPLUG, new, &error_abor= t); object_unref(new); qdev_set_parent_bus(DEVICE(new), BUS(&event_facility->sbus)); /* the facility will automatically realize the devices via the bus */ diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c index 0c5a5b60bd..f67306de13 100644 --- a/hw/s390x/s390-ccw.c +++ b/hw/s390x/s390-ccw.c @@ -151,7 +151,7 @@ static void s390_ccw_instance_init(Object *obj) S390CCWDevice *dev =3D S390_CCW_DEVICE(obj); =20 device_add_bootindex_property(obj, &dev->bootindex, "bootindex", - "/disk@0,0", DEVICE(obj), NULL); + "/disk@0,0", DEVICE(obj), &error_abort); } =20 static void s390_ccw_class_init(ObjectClass *klass, void *data) diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c index a9a4ae7b39..8dbb0eb48a 100644 --- a/hw/s390x/s390-skeys.c +++ b/hw/s390x/s390-skeys.c @@ -400,8 +400,8 @@ static void s390_skeys_instance_init(Object *obj) { object_property_add_bool(obj, "migration-enabled", s390_skeys_get_migration_enabled, - s390_skeys_set_migration_enabled, NULL); - object_property_set_bool(obj, true, "migration-enabled", NULL); + s390_skeys_set_migration_enabled, &error_abor= t); + object_property_set_bool(obj, true, "migration-enabled", &error_abort); } =20 static void s390_skeys_class_init(ObjectClass *oc, void *data) diff --git a/hw/s390x/s390-stattrib.c b/hw/s390x/s390-stattrib.c index 58121b9f68..f73139c939 100644 --- a/hw/s390x/s390-stattrib.c +++ b/hw/s390x/s390-stattrib.c @@ -387,8 +387,8 @@ static void s390_stattrib_instance_init(Object *obj) =20 object_property_add_bool(obj, "migration-enabled", s390_stattrib_get_migration_enabled, - s390_stattrib_set_migration_enabled, NULL); - object_property_set_bool(obj, true, "migration-enabled", NULL); + s390_stattrib_set_migration_enabled, &error_a= bort); + object_property_set_bool(obj, true, "migration-enabled", &error_abort); sas->migration_cur_gfn =3D 0; } =20 diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index f0c35aa57a..dbfa4c8514 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -349,7 +349,7 @@ static void sclp_init(Object *obj) Object *new; =20 new =3D object_new(TYPE_SCLP_EVENT_FACILITY); - object_property_add_child(obj, TYPE_SCLP_EVENT_FACILITY, new, NULL); + object_property_add_child(obj, TYPE_SCLP_EVENT_FACILITY, new, &error_a= bort); object_unref(new); sclp->event_facility =3D EVENT_FACILITY(new); =20 diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 1c980cab38..339635d99e 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -1738,7 +1738,7 @@ static void scsi_dev_instance_init(Object *obj) =20 device_add_bootindex_property(obj, &s->conf.bootindex, "bootindex", NULL, - &s->qdev, NULL); + &s->qdev, &error_abort); } =20 static const TypeInfo scsi_device_type_info =3D { diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c index c57850a505..15f9c0c188 100644 --- a/hw/ssi/xilinx_spips.c +++ b/hw/ssi/xilinx_spips.c @@ -1361,7 +1361,7 @@ static void xlnx_zynqmp_qspips_init(Object *obj) (Object **)&rq->dma, object_property_allow_set_link, OBJ_PROP_LINK_STRONG, - NULL); + &error_abort); } =20 static int xilinx_spips_post_load(void *opaque, int version_id) diff --git a/hw/usb/bus.c b/hw/usb/bus.c index c9a390063f..c076d2d436 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -754,11 +754,11 @@ static void usb_device_instance_init(Object *obj) if (klass->attached_settable) { object_property_add_bool(obj, "attached", usb_get_attached, usb_set_attached, - NULL); + &error_abort); } else { object_property_add_bool(obj, "attached", usb_get_attached, NULL, - NULL); + &error_abort); } } =20 diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index 6210427544..d56b9c4ad0 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -1381,7 +1381,7 @@ static void usb_net_instance_init(Object *obj) =20 device_add_bootindex_property(obj, &s->conf.bootindex, "bootindex", "/ethernet-phy@0", - &dev->qdev, NULL); + &dev->qdev, &error_abort); } =20 static const VMStateDescription vmstate_usb_net =3D { diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 5c4b57b06b..6e8d1fbd60 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -753,8 +753,8 @@ static void usb_msd_instance_init(Object *obj) { object_property_add(obj, "bootindex", "int32", usb_msd_get_bootindex, - usb_msd_set_bootindex, NULL, NULL, NULL); - object_property_set_int(obj, -1, "bootindex", NULL); + usb_msd_set_bootindex, NULL, NULL, &error_abort); + object_property_set_int(obj, -1, "bootindex", &error_abort); } =20 static void usb_msd_class_bot_initfn(ObjectClass *klass, void *data) diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index 2ac7a936fb..a25b590dde 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -1101,7 +1101,7 @@ static void usb_host_instance_init(Object *obj) =20 device_add_bootindex_property(obj, &s->bootindex, "bootindex", NULL, - &udev->qdev, NULL); + &udev->qdev, &error_abort); } =20 static void usb_host_unrealize(USBDevice *udev, Error **errp) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 45d8b76218..f1fe21e1a4 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -2595,7 +2595,7 @@ static void usbredir_instance_init(Object *obj) =20 device_add_bootindex_property(obj, &dev->bootindex, "bootindex", NULL, - &udev->qdev, NULL); + &udev->qdev, &error_abort); } =20 static const TypeInfo usbredir_dev_info =3D { diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index a4729f7fc9..d528cf5de7 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -893,12 +893,12 @@ static void virtio_balloon_instance_init(Object *obj) VirtIOBalloon *s =3D VIRTIO_BALLOON(obj); =20 object_property_add(obj, "guest-stats", "guest statistics", - balloon_stats_get_all, NULL, NULL, s, NULL); + balloon_stats_get_all, NULL, NULL, s, &error_abort= ); =20 object_property_add(obj, "guest-stats-polling-interval", "int", balloon_stats_get_poll_interval, balloon_stats_set_poll_interval, - NULL, s, NULL); + NULL, s, &error_abort); } =20 static const VMStateDescription vmstate_virtio_balloon =3D { diff --git a/net/dump.c b/net/dump.c index 23b3628dde..ea738ff7c3 100644 --- a/net/dump.c +++ b/net/dump.c @@ -232,9 +232,9 @@ static void filter_dump_instance_init(Object *obj) nfds->maxlen =3D 65536; =20 object_property_add(obj, "maxlen", "uint32", filter_dump_get_maxlen, - filter_dump_set_maxlen, NULL, NULL, NULL); + filter_dump_set_maxlen, NULL, NULL, &error_abort); object_property_add_str(obj, "file", file_dump_get_filename, - file_dump_set_filename, NULL); + file_dump_set_filename, &error_abort); } =20 static void filter_dump_instance_finalize(Object *obj) diff --git a/net/filter-buffer.c b/net/filter-buffer.c index 12e0254287..b9fa2d5c57 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -192,7 +192,7 @@ static void filter_buffer_init(Object *obj) { object_property_add(obj, "interval", "uint32", filter_buffer_get_interval, - filter_buffer_set_interval, NULL, NULL, NULL); + filter_buffer_set_interval, NULL, NULL, &error_abo= rt); } =20 static const TypeInfo filter_buffer_info =3D { diff --git a/net/filter-mirror.c b/net/filter-mirror.c index d83e815545..3893dd299c 100644 --- a/net/filter-mirror.c +++ b/net/filter-mirror.c @@ -392,12 +392,12 @@ static void filter_mirror_init(Object *obj) MirrorState *s =3D FILTER_MIRROR(obj); =20 object_property_add_str(obj, "outdev", filter_mirror_get_outdev, - filter_mirror_set_outdev, NULL); + filter_mirror_set_outdev, &error_abort); =20 s->vnet_hdr =3D false; object_property_add_bool(obj, "vnet_hdr_support", filter_mirror_get_vnet_hdr, - filter_mirror_set_vnet_hdr, NULL); + filter_mirror_set_vnet_hdr, &error_abort); } =20 static void filter_redirector_init(Object *obj) @@ -405,14 +405,14 @@ static void filter_redirector_init(Object *obj) MirrorState *s =3D FILTER_REDIRECTOR(obj); =20 object_property_add_str(obj, "indev", filter_redirector_get_indev, - filter_redirector_set_indev, NULL); + filter_redirector_set_indev, &error_abort); object_property_add_str(obj, "outdev", filter_redirector_get_outdev, - filter_redirector_set_outdev, NULL); + filter_redirector_set_outdev, &error_abort); =20 s->vnet_hdr =3D false; object_property_add_bool(obj, "vnet_hdr_support", filter_redirector_get_vnet_hdr, - filter_redirector_set_vnet_hdr, NULL); + filter_redirector_set_vnet_hdr, &error_abort); } =20 static void filter_mirror_fini(Object *obj) diff --git a/net/filter-rewriter.c b/net/filter-rewriter.c index 31da08a2f4..7d713c7193 100644 --- a/net/filter-rewriter.c +++ b/net/filter-rewriter.c @@ -10,6 +10,7 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "trace.h" #include "colo.h" #include "net/filter.h" @@ -413,7 +414,7 @@ static void filter_rewriter_init(Object *obj) s->failover_mode =3D FAILOVER_MODE_OFF; object_property_add_bool(obj, "vnet_hdr_support", filter_rewriter_get_vnet_hdr, - filter_rewriter_set_vnet_hdr, NULL); + filter_rewriter_set_vnet_hdr, &error_abort); } =20 static void colo_rewriter_class_init(ObjectClass *oc, void *data) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 62d36f9e8d..6a0a668e17 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -782,11 +782,11 @@ static void aarch64_cpu_set_aarch64(Object *obj, bool= value, Error **errp) static void aarch64_cpu_initfn(Object *obj) { object_property_add_bool(obj, "aarch64", aarch64_cpu_get_aarch64, - aarch64_cpu_set_aarch64, NULL); + aarch64_cpu_set_aarch64, &error_abort); object_property_set_description(obj, "aarch64", "Set on/off to enable/disable aarch64 " "execution state ", - NULL); + &error_abort); } =20 static void aarch64_cpu_finalizefn(Object *obj) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 9c256ab159..f5795788bb 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6905,28 +6905,32 @@ static void x86_cpu_initfn(Object *obj) =20 object_property_add(obj, "family", "int", x86_cpuid_version_get_family, - x86_cpuid_version_set_family, NULL, NULL, NULL); + x86_cpuid_version_set_family, NULL, NULL, + &error_abort); object_property_add(obj, "model", "int", x86_cpuid_version_get_model, - x86_cpuid_version_set_model, NULL, NULL, NULL); + x86_cpuid_version_set_model, NULL, NULL, + &error_abort); object_property_add(obj, "stepping", "int", x86_cpuid_version_get_stepping, - x86_cpuid_version_set_stepping, NULL, NULL, NULL); + x86_cpuid_version_set_stepping, NULL, NULL, + &error_abort); object_property_add_str(obj, "vendor", x86_cpuid_get_vendor, - x86_cpuid_set_vendor, NULL); + x86_cpuid_set_vendor, &error_abort); object_property_add_str(obj, "model-id", x86_cpuid_get_model_id, - x86_cpuid_set_model_id, NULL); + x86_cpuid_set_model_id, &error_abort); object_property_add(obj, "tsc-frequency", "int", x86_cpuid_get_tsc_freq, - x86_cpuid_set_tsc_freq, NULL, NULL, NULL); + x86_cpuid_set_tsc_freq, NULL, NULL, &error_abort); object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo", x86_cpu_get_feature_words, - NULL, NULL, (void *)env->features, NULL); + NULL, NULL, (void *)env->features, &error_abort); object_property_add(obj, "filtered-features", "X86CPUFeatureWordInfo", x86_cpu_get_feature_words, - NULL, NULL, (void *)cpu->filtered_features, NULL); + NULL, NULL, (void *)cpu->filtered_features, + &error_abort); /* * The "unavailable-features" property has the same semantics as * CpuDefinitionInfo.unavailable-features on the "query-cpu-definition= s" @@ -6938,7 +6942,8 @@ static void x86_cpu_initfn(Object *obj) NULL, NULL, NULL, &error_abort); =20 object_property_add(obj, "crash-information", "GuestPanicInformation", - x86_cpu_get_crash_info_qom, NULL, NULL, NULL, NULL= ); + x86_cpu_get_crash_info_qom, NULL, NULL, NULL, + &error_abort); =20 for (w =3D 0; w < FEATURE_WORDS; w++) { int bitnr; diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 427a46e3e1..1ae550867e 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -287,7 +287,8 @@ static void s390_cpu_initfn(Object *obj) cs->halted =3D 1; cs->exception_index =3D EXCP_HLT; object_property_add(obj, "crash-information", "GuestPanicInformation", - s390_cpu_get_crash_info_qom, NULL, NULL, NULL, NUL= L); + s390_cpu_get_crash_info_qom, NULL, NULL, NULL, + &error_abort); s390_cpu_model_register_props(obj); #if !defined(CONFIG_USER_ONLY) cpu->env.tod_timer =3D diff --git a/tests/check-qom-proplist.c b/tests/check-qom-proplist.c index a8b2958e6e..999eb1ce40 100644 --- a/tests/check-qom-proplist.c +++ b/tests/check-qom-proplist.c @@ -255,13 +255,14 @@ static void dummy_dev_init(Object *obj) DummyBus *bus =3D DUMMY_BUS(object_new(TYPE_DUMMY_BUS)); DummyBackend *backend =3D DUMMY_BACKEND(object_new(TYPE_DUMMY_BACKEND)= ); =20 - object_property_add_child(obj, "bus", OBJECT(bus), NULL); + object_property_add_child(obj, "bus", OBJECT(bus), &error_abort); dev->bus =3D bus; - object_property_add_child(OBJECT(bus), "backend", OBJECT(backend), NUL= L); + object_property_add_child(OBJECT(bus), "backend", OBJECT(backend), + &error_abort); bus->backend =3D backend; =20 object_property_add_link(obj, "backend", TYPE_DUMMY_BACKEND, - (Object **)&bus->backend, NULL, 0, NULL); + (Object **)&bus->backend, NULL, 0, &error_abo= rt); } =20 static void dummy_dev_unparent(Object *obj) diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c index 270c690479..5186c3cb36 100644 --- a/tests/test-qdev-global-props.c +++ b/tests/test-qdev-global-props.c @@ -27,6 +27,7 @@ #include "hw/qdev-properties.h" #include "qom/object.h" #include "qapi/visitor.h" +#include "qapi/error.h" =20 =20 #define TYPE_STATIC_PROPS "static_prop_type" @@ -151,9 +152,9 @@ static void prop2_accessor(Object *obj, Visitor *v, con= st char *name, static void dynamic_instance_init(Object *obj) { object_property_add(obj, "prop1", "uint32", prop1_accessor, prop1_acce= ssor, - NULL, NULL, NULL); + NULL, NULL, &error_abort); object_property_add(obj, "prop2", "uint32", prop2_accessor, prop2_acce= ssor, - NULL, NULL, NULL); + NULL, NULL, &error_abort); } =20 static void dynamic_class_init(ObjectClass *oc, void *data) --=20 2.21.1 From nobody Wed May 15 11:04:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1586811094; cv=none; d=zohomail.com; s=zohoarc; b=jUFQAF8vQp+PxDKt3g7x258Y/q2l7tbMpQwTz/eXASnAfuQkTRTdI2fHTVlzZDg+ADp+ChVssz7MON2YFdwtl4hjc1GgjI78Iv5t1yug5+IBxrVUxmOwLkn8WllgSBWLgBIeq9xPlZFWkqo8vA5WeD4yvIEbJZwb23uoL5KuyMA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586811094; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=AYMAqmFGrqu8cY7KLFJtaKcRzl2CAk958x2nV2IeMnc=; b=WcDJugZFOxhS2+7X7ZzoliN0oOnUHuA9djy7N9vAbRLizIOKh3NezXdZxc4D7WXBxLuDGFjQcxLLE3O1e8tJv7ZxjzVnjFFmH8820PC3ugMQZgw21c8+mbG7CdVqh9Ee9MMepTfodLjxonHgo/57R3jB5PoWDL+vq/ropQKrzoI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586811094186819.4591460407513; Mon, 13 Apr 2020 13:51:34 -0700 (PDT) Received: from localhost ([::1]:48694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO63I-0005cy-OQ for importer@patchew.org; Mon, 13 Apr 2020 16:51:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35795) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO62g-0005Dt-QF for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:50:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jO62f-0007QS-L0 for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:50:54 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:36322) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jO62f-0007QI-FP for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:50:53 -0400 Received: by mail-wr1-x431.google.com with SMTP id u13so11218329wrp.3 for ; Mon, 13 Apr 2020 13:50:53 -0700 (PDT) Received: from localhost.localdomain (116.red-83-42-57.dynamicip.rima-tde.net. [83.42.57.116]) by smtp.gmail.com with ESMTPSA id j13sm16991001wro.51.2020.04.13.13.50.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 13:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AYMAqmFGrqu8cY7KLFJtaKcRzl2CAk958x2nV2IeMnc=; b=SDaX+DG69w9fYNwhavk7u5aGy/srvj+4JSyMk9/HKwhP43qMy+YTzAmpFlKD0Kf8WQ R4csbfi7Ju/oBBNEqVYb/tbj1oLAGmJe3NFqcIFPoXM3MnDGsbCFUNzT5hIkM9Ely3XV CqQXf6md1DuKoL7F4pJRe07F3SWcOnfYlaYiRyZjOrK1s88UF5NDc4A74rH3AiHDE9du sOzFgwxSfl2dMeiRQZO0gk8mp2URLpbXMEVvSrceX9HgJsNlQwVIVQELB2TY2n1+VhlW I9Fz0XyrTtu7pnmLys4p2pN92cCBQM7fdeHLbx2+/6B3PVsKlB1R6a0XgBKxf1UrYaez XPcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=AYMAqmFGrqu8cY7KLFJtaKcRzl2CAk958x2nV2IeMnc=; b=R7c6JzHb3ZD179s7JKUENz4tRsP2lupya0hPkAoGRzhu0fvhzP6ADhkOZX4Rpk4WOk vGwFXruCwu7hY/SQV7pZ+9mP4DsLlIO0TFo931zPCuhw6WbulkHXccsI/D7AkjvEIKZV xZgqErHP1NoNokwDY5hAW30lGWaBwkKEmIj7XUW9qQU/s4VD4NO62ZgeFi8ZOs+SNGQ9 Zdmwo7zW7fFtpotf5OifISewMNfPPn4vRCeJjPU1RJVFC8YYQ05LI6XWh43dsJn0W7Y4 dJKNSczU1hRymbA3YwNKIAThlhXX/Zrp5ja96jo4Nbz+F1wT9CgJICZH2sjGsZUIKAYL c1fw== X-Gm-Message-State: AGi0PubtOZR9n+Xpa37S1VG05r2hxbYJ0S6b6X+IhDG8tpmicUuYSoWZ ioAnXLa+dY7hwczh/LRC3DABKxXE0u0= X-Google-Smtp-Source: APiQypLAOatj+YxxI2Pu8F/0jUoCxkcEAiKV55+AH5dVJSIqFSFrnhuTLcDnM+ps6+RKwYRag4IDvg== X-Received: by 2002:a5d:4248:: with SMTP id s8mr19950773wrr.216.1586811051860; Mon, 13 Apr 2020 13:50:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH-for-5.1 v3 3/7] scripts/coccinelle: Find eventually missing error_propagate() calls Date: Mon, 13 Apr 2020 22:50:40 +0200 Message-Id: <20200413205040.518-1-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: 20200412224517.12869-1-f4bug@amsat.org References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::431 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Markus Armbruster Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) In some places in we put an error into a local Error*, but forget to use it. Add a Coccinelle patch to find such cases and report them. Inspired-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- .../find-missing-error_propagate.cocci | 53 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 54 insertions(+) create mode 100644 scripts/coccinelle/find-missing-error_propagate.cocci diff --git a/scripts/coccinelle/find-missing-error_propagate.cocci b/script= s/coccinelle/find-missing-error_propagate.cocci new file mode 100644 index 0000000000..8b75b37b64 --- /dev/null +++ b/scripts/coccinelle/find-missing-error_propagate.cocci @@ -0,0 +1,53 @@ +// Find places likely missing error-propagation code, but code is too +// complex for automatic transformation, so manual analysis is required. +// +// Copyright: (C) 2020 Philippe Mathieu-Daud=C3=A9 +// This work is licensed under the terms of the GNU GPLv2 or later. +// +// spatch \ +// --macro-file scripts/cocci-macro-file.h --include-headers \ +// --sp-file scripts/coccinelle/find-missing-error_propagate.cocci +// +// Inspired by https://www.mail-archive.com/qemu-devel@nongnu.org/msg69163= 8.html + + +// First match two subsequent calls using local Error* +// in function provided a Error** argument +// +@discard_func_with_errp_argument@ +typedef Error; +Error *local_err; +identifier func, errp, errfunc1, errfunc2; +@@ +void func(..., Error **errp) +{ + <+... + errfunc1(..., &local_err); + ... when !=3D local_err // local_err is not used between the cal= ls + errfunc2(..., &local_err); + ...+> +} + + +// Again, match two subsequent calls using local Error* +// but ignoring within functions provided a Error** argument +// +@manual depends on never discard_func_with_errp_argument@ +Error *local_err; +identifier errfunc1, errfunc2; +position p; +@@ + errfunc1@p(..., &local_err); + ... when !=3D local_err + errfunc2(..., &local_err); + + +// As it is likely too complex to transform, report the hit +// +@script:python@ +f << manual.errfunc1; +p << manual.p; +@@ +print("[[manual check required: " + "error_propagate() might be missing in {}() {}:{}:{}]]".format( + f, p[0].file, p[0].line, p[0].column)) diff --git a/MAINTAINERS b/MAINTAINERS index 77b93612bc..1150ec95a8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2058,6 +2058,7 @@ F: scripts/coccinelle/add-missing-error_propagate.coc= ci F: scripts/coccinelle/err-bad-newline.cocci F: scripts/coccinelle/error-use-after-free.cocci F: scripts/coccinelle/error_propagate_null.cocci +F: scripts/coccinelle/find-missing-error_propagate.cocci F: scripts/coccinelle/remove_local_err.cocci F: scripts/coccinelle/simplify-init-realize-error_propagate.cocci F: scripts/coccinelle/use-error_abort-in-instance_init.cocci --=20 2.21.1 From nobody Wed May 15 11:04:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1586811245; cv=none; d=zohomail.com; s=zohoarc; b=G8U5l58uIEini5UXnnTllX7H16P43aOMRXCGA+XNYJckrH97uOfHXXsXA7cLMD6ad4kOfmzw4wN6RY9FLAqL6I9GXcl/6xhH3UbULLPAEdH+7PS7/98MsluPMEL4dWEZqSPmHkmsj2XuSwW+SNyewxykNxY6Y2d0/KujuN6raP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586811245; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=cq4SYX1xB02rm5tx4ZW/dd/4RXE5CGOFLNOTw+3yasw=; b=mysKvl4B+8NDSJtSuwg2YH2fIeHH8JTD+eDlCo7gDRHyBZnaak/bjouPyCn+3caS9dtoGJoKi0WuE1nfybunSlfsXUNSfQ58EJUPcshfbPqHukJBdstu2LUT6NPGWMs6JxXWJWaNXmn+3qtqiqowE0XSvuRYFvDYYEpsZltYIwo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586811245900535.7744568033804; Mon, 13 Apr 2020 13:54:05 -0700 (PDT) Received: from localhost ([::1]:48704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO65j-00072H-DX for importer@patchew.org; Mon, 13 Apr 2020 16:54:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36019) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO64o-0006Fd-Gf for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:53:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jO64n-0008DE-Eq for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:53:06 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:38414) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jO64n-0008AQ-8P for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:53:05 -0400 Received: by mail-wr1-x430.google.com with SMTP id k11so11085234wrp.5 for ; Mon, 13 Apr 2020 13:53:01 -0700 (PDT) Received: from localhost.localdomain (116.red-83-42-57.dynamicip.rima-tde.net. [83.42.57.116]) by smtp.gmail.com with ESMTPSA id b11sm16380603wrq.26.2020.04.13.13.52.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 13:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cq4SYX1xB02rm5tx4ZW/dd/4RXE5CGOFLNOTw+3yasw=; b=bFe6JOqKSVyoha6O+PdlV8H3q508ylQYoPs5i9hC9kzIZL99pWR697BPh9zYKoq+kw 0+x3MYI5pTuUtKEvAgy3Koq8s1zYPCTm/UtER1KJYc84QSDEaH0S8RqUQdyzcRAii0Fu 34REgE+NbADXzcGYX95GFRsFUB2CjSHepAE26z+s318ZXmIXTsCVoUYlJ/USNC7c5ina TXWnjs7yEXDrO6wtg+O+Kpe++1LJiBVn6JOCFWpcRbQ74Y++zDN0kiMgqD7VPW/XJMV4 S91/iKtC4KDk/jcrsitZxsQ4s21YY8+2b1ihPCcY0Ip/5cBv+GDCt8O1O+93t8CMpMaZ 6x7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=cq4SYX1xB02rm5tx4ZW/dd/4RXE5CGOFLNOTw+3yasw=; b=re9AscEaX7YdBBRbW1UUmNttAh/c6zIEl7I/0LYy3cZvMYtvZW92Irto6HhnCnNwRf NYSUI72oxfZ3n4z5u2LwQmXjhayUEK8PLHAk/64qi5frx3ucRSXdjlOzIYS4eyhHcD17 GYBZH0328IgHyLuSGZlEjQmNhEEd8CtqFv9NJTPWNmTgdcjzEoBFYbVLGrp9CtUdYwaI ZvFh8CWCH8bLPLVeD56kmhKVJYcbKzSv5neCfhAKQv4lTCmUiK0uQ7OEKTQccdxm1jAR cDNupCnBWFPHY/ai1z8kWGYP4BZDWTEDz2gE5o48psakf1D/sqDHrfIanuL0IqfrGZQH S7cA== X-Gm-Message-State: AGi0Pua3wJM82pKynkdnQTI+dYwMkIzdIizR9yIohVcPCxTcuKZ1yImF koLH0UU3PN+MUbGs1ygMZl1olP0k6to= X-Google-Smtp-Source: APiQypJIgFXcN9hdXY+vBkUr+2ZqRss4uVGDavqmNSip/5QWTnxlxWB871X5b7YSXmFeAvlxJT8E+A== X-Received: by 2002:a5d:6412:: with SMTP id z18mr7448919wru.322.1586811180117; Mon, 13 Apr 2020 13:53:00 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH-for-5.1 v3 4/7] migration/colo: Add missing error-propagation code Date: Mon, 13 Apr 2020 22:52:49 +0200 Message-Id: <20200413205250.687-1-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: 20200412224517.12869-1-f4bug@amsat.org References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::430 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: Juan Quintela , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , Hailiang Zhang Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Running the coccinelle script produced: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/find-missing-error_propagate.cocci \ --keep-comments --smpl-spacing --dir . HANDLING: ./migration/colo.c [[manual check required: error_propagate() might be missing in migrate_se= t_block_enabled() ./migration/colo.c:439:4]] Add the missing error_propagate() after review. Reviewed-by: Juan Quintela Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- migration/colo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/migration/colo.c b/migration/colo.c index a54ac84f41..57b2adb0cc 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -437,6 +437,9 @@ static int colo_do_checkpoint_transaction(MigrationStat= e *s, =20 /* Disable block migration */ migrate_set_block_enabled(false, &local_err); + if (local_err) { + goto out; + } qemu_mutex_lock_iothread(); =20 #ifdef CONFIG_REPLICATION --=20 2.21.1 From nobody Wed May 15 11:04:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1586811248; cv=none; d=zohomail.com; s=zohoarc; b=m0O4CVCNc651tpY/BV1XZACSmgISBmR+5ybiKbA78V5+823cMmqjtRAivb8iR5peNqpUI6Z5Z9X04fTqGFGmLUJMiEgj6/4CsKS4xQ4vqA0b/XQyAbAth+C9PCOsrBVbQEIujHrPGPK0p2pZ9u5dONLIZc0Wu7S+kdHTM3S//gw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586811248; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UhAVvFgdKZItMBK76DLdu4ImD7RTe3y+DxnwlUR9418=; b=idun5t/Zl+pG0guZ7Kf1k8hiQ4XhPDWmZ+u3HqfnJFHcPKE7C3j7ao4aSSgqzWpc5JqxKEkF/iEaUmoHGpmF8XQ/bj+LxtyftlC9CeiEQudQPwBcaqa9lEjwkbwWLG9EiG0AzSAsjPkzyJApk4/UShOHaOHDGghSRLoIn0aiGeo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586811248284522.2628454759024; Mon, 13 Apr 2020 13:54:08 -0700 (PDT) Received: from localhost ([::1]:48706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO65n-000788-1M for importer@patchew.org; Mon, 13 Apr 2020 16:54:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36021) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO64o-0006Fe-I2 for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:53:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jO64n-0008D7-El for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:53:06 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:40878) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jO64n-0008B0-8K for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:53:05 -0400 Received: by mail-wm1-x32e.google.com with SMTP id a81so11455383wmf.5 for ; Mon, 13 Apr 2020 13:53:03 -0700 (PDT) Received: from localhost.localdomain (116.red-83-42-57.dynamicip.rima-tde.net. [83.42.57.116]) by smtp.gmail.com with ESMTPSA id b11sm16380603wrq.26.2020.04.13.13.53.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 13:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UhAVvFgdKZItMBK76DLdu4ImD7RTe3y+DxnwlUR9418=; b=OQ931QxBe8caqBbmyj6AF1nHPmcco/xdLpSnTciOWUPbMnjrEIIXrPiZQLv6d+aOXG 2K6N74v3A+7bYckfUU8mOFUwROwXZ8ThNjMhIl8NPqN9H99zV0OUlAFGmudWFhMne1Kw jhhcZnS93Gkr4eDK+3t2RUPFGb201sZC2lA+a9t5bIhdwnl9yt8agSUDse5DSPla3V+E +E+EEbrobDl8XioSBXuMUW8snw31TRS028Xpk5tUeCS8dBLt0aqj0eMfPnqsIobGkXyY VeUl65awKJse3rd9X5y8HfS+V1vyDQb+hg10WhoFEDtXORJMba8f4gUA5OoYiYvEnt2z kouA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=UhAVvFgdKZItMBK76DLdu4ImD7RTe3y+DxnwlUR9418=; b=pkuDYfvibv/tSpAyqtY5ajzh72W2DfvXKQjfdBiP7Nc7YUiGqRCjzkj7I7qVUjZp1a O+xTQrToeSQQbBGb8YuMkAJJLIdJz+lrcuoifIfUWpnOInSHskUqy4LOlCOSUnXFJf8F fZ40rWWE4OSC/zQ4CHj36SOt3drBK4XaVtwt/EXolviRWWdjE8c/E+P/d+wIyf2p1k/i 57GHjLM/bUZ2ZDJym7JIKRkKpxxJbjoEY8PAq46pfkeYwLsrWQyNbR7MUZI5mtsocKiW 77D4c9wRr5pNt2Upfp2Js5z2NFb+2Ma1xIyHSQezWPXBgxKGad0xI9ThzwjJAnNbnVKh UidQ== X-Gm-Message-State: AGi0PuYe0jg97DA+MAQ0NVOT7NoM6A07akaWeaNP2RJ5Byy9bc0jWOYI xx3vTp3V2pCtzoE0lDE5kQzqWs3kBAhL8A== X-Google-Smtp-Source: APiQypJiuj4/Moc+ZdnGr20f8ywVaxpL07DLoU1G63o29yOKqv1DzTPC6Q9Byzc8oEwFzO+7QFk4Ug== X-Received: by 2002:a1c:7d90:: with SMTP id y138mr21637039wmc.121.1586811182101; Mon, 13 Apr 2020 13:53:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH-for-5.1 v3 5/7] hw/mips/boston: Add missing error-propagation code Date: Mon, 13 Apr 2020 22:52:50 +0200 Message-Id: <20200413205250.687-2-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: 20200412224517.12869-1-f4bug@amsat.org References: <20200413205250.687-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e 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 , Paul Burton , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic , Aleksandar Rikalo , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Running the coccinelle script produced: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/find-missing-error_propagate.cocci \ --keep-comments --smpl-spacing --dir . HANDLING: ./hw/mips/boston.c [[manual check required: error_propagate() might be missing in object_pro= perty_set_int() ./hw/mips/boston.c:462:4]] [[manual check required: error_propagate() might be missing in object_pro= perty_set_str() ./hw/mips/boston.c:460:4]] Since the uses are inside a MachineClass::init() function, directly use &error_fatal instead of error_propagate(). Reviewed-by: Peter Maydell Reviewed-by: Aleksandar Markovic Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/mips/boston.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/hw/mips/boston.c b/hw/mips/boston.c index 98ecd25e8e..2e821ca7d6 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -426,7 +426,6 @@ static void boston_mach_init(MachineState *machine) { DeviceState *dev; BostonState *s; - Error *err =3D NULL; MemoryRegion *flash, *ddr_low_alias, *lcd, *platreg; MemoryRegion *sys_mem =3D get_system_memory(); XilinxPCIEHost *pcie2; @@ -458,19 +457,15 @@ static void boston_mach_init(MachineState *machine) sysbus_init_child_obj(OBJECT(machine), "cps", OBJECT(&s->cps), sizeof(s->cps), TYPE_MIPS_CPS); object_property_set_str(OBJECT(&s->cps), machine->cpu_type, "cpu-type", - &err); - object_property_set_int(OBJECT(&s->cps), machine->smp.cpus, "num-vp", = &err); - object_property_set_bool(OBJECT(&s->cps), true, "realized", &err); - - if (err !=3D NULL) { - error_report("%s", error_get_pretty(err)); - exit(1); - } - + &error_fatal); + object_property_set_int(OBJECT(&s->cps), machine->smp.cpus, "num-vp", + &error_fatal); + object_property_set_bool(OBJECT(&s->cps), true, "realized", &error_fat= al); sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->cps), 0, 0, 1); =20 flash =3D g_new(MemoryRegion, 1); - memory_region_init_rom(flash, NULL, "boston.flash", 128 * MiB, &err); + memory_region_init_rom(flash, NULL, "boston.flash", 128 * MiB, + &error_fatal); memory_region_add_subregion_overlap(sys_mem, 0x18000000, flash, 0); =20 memory_region_add_subregion_overlap(sys_mem, 0x80000000, machine->ram,= 0); --=20 2.21.1 From nobody Wed May 15 11:04:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1586810144; cv=none; d=zohomail.com; s=zohoarc; b=ELwFepkPP8UxggsQfVvQaWz7PDqlCVYWrwv55OBpj1ZIi9bKJXJMec/eJ6S84+xWS/HDGZ5aZlzWJicdCu/g4Ts9kIkX/B4G5Kqozjhg88n+M3ATrKlHfrT4ZPyBOnlnlOUMMh6vBxUqijyrwXeF3QsBabQpVcrdVBW9JN/BzrI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586810144; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=TSTOgqIqkHP/A6SEq23VPb4QmBizW4+fbueFj4i2CPw=; b=FJYUEYpBu/9fagWKt5pg55+FvyETYnUjQCpgmlohth5KBv3Hati3hN28d8H9FmzzeL9wmw+93tT1BK8CYSny5I/3sWIkj1FVdn8d7uqTEcgSfoRDAWTVIxxABj+i3c8DKCPVo3tFf9EslrME7uF/QiUvcpkTfutLxHyLgFM0z6A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586810144788132.3751732294345; Mon, 13 Apr 2020 13:35:44 -0700 (PDT) Received: from localhost ([::1]:48524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO5nz-0006MG-6Z for importer@patchew.org; Mon, 13 Apr 2020 16:35:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34164) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO5mK-0005DD-Or for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:34:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jO5mJ-0000lw-MW for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:34:00 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:37988) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jO5mJ-0000lg-GB for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:33:59 -0400 Received: by mail-wr1-x442.google.com with SMTP id k11so11016170wrp.5 for ; Mon, 13 Apr 2020 13:33:59 -0700 (PDT) Received: from localhost.localdomain (116.red-83-42-57.dynamicip.rima-tde.net. [83.42.57.116]) by smtp.gmail.com with ESMTPSA id i97sm17519238wri.1.2020.04.13.13.33.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 13:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TSTOgqIqkHP/A6SEq23VPb4QmBizW4+fbueFj4i2CPw=; b=aNw7cq3+8KXzWk3JWdUnifnGtCtfiMMk9+0FNN4hsxYU8NUL4ihIN0QZ/59z7S5oAE 9wCoMBzMHzsuOao8uSC9ItkEplzIn3uL1PJpbDCefxQ9g4Zn20GqutEnIt5wa6ONZUM2 CDsFJTJF/Q/bfNc6Xw2d4j9VZYqmF2aXwD+UZGL1/d8VxyMKK94dtCqkvnDzZ3+nIHIH v/uDVu5yOfqgBWGWUCbzozu9fcaWmEcV7zDHXx+8qEVwv2+TnC44sgOdr2lJNc/MJGw6 i3FnY1fimduDHHiB/vR6osAUYNHbKd82bulwPjA606/g9LsGyt3q/d26FgwU1LcIq9Dv jwjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=TSTOgqIqkHP/A6SEq23VPb4QmBizW4+fbueFj4i2CPw=; b=PFfxoaVRnFcWHoUcYc6ElZCAvwVnQHJ7YuwroiGlmdEUkr0zN6CjDL5JYc33E5SiAm acwYgcWBLzrEoKNJIh6SGvtO1IyCtT+8VggsrdRor3y2OmN8UYOrWaNypLpGGBQc7Yhg XPHEu6wD0N42gF4Q+qwkyxGaqe8YPogjDlyttt4RCcjfAkQ5nzwuSnxNl95vYjp5JP0n Fzf6NY29tzOfq3z2i9ldkhmjqpNTTimzxkY3TdWSIrhKrISQKLh034y7GA5aBcuYQ9Ay rKEy7blegW+ERzqeIfpy1tc+e7OhzNPqw4UhF3JOopgqBN6iJtJOCtK0OLNf8QcXbAD0 +PQQ== X-Gm-Message-State: AGi0PuagBcJu5PNssGlsl8qFM4Nvw8ChCA/oOsfWsTLugg5JV2e3xGAe +xXPhCzUBCat2SJsl5/g09OAOk3rBJ/4Lg== X-Google-Smtp-Source: APiQypJiBME2Z8nP2c+ZIdmqOWuUO4dAGgiEvbalzHjaDeEA0+leygUgmTik2/BLaBUTZP/DabfxCg== X-Received: by 2002:a05:6000:4:: with SMTP id h4mr20875286wrx.386.1586810037973; Mon, 13 Apr 2020 13:33:57 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH-for-5.1 v3 6/7] hw/mips/mips_malta: Use &error_abort in MachineClass::init -> create_cps Date: Mon, 13 Apr 2020 22:33:49 +0200 Message-Id: <20200413203349.30590-1-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: 20200412224517.12869-1-f4bug@amsat.org References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 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: Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Running the coccinelle script produced: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/find-missing-error_propagate.cocci \ --keep-comments --smpl-spacing --dir . HANDLING: ./hw/mips/mips_malta.c [[manual check required: error_propagate() might be missing in object_pro= perty_set_int() ./hw/mips/mips_malta.c:1193:4]] [[manual check required: error_propagate() might be missing in object_pro= perty_set_str() ./hw/mips/mips_malta.c:1192:4]] Since create_cps() is called from a MachineClass::init(), replace local Error* by &error_abort. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- v3: Use &error_fatal (rth) --- hw/mips/mips_malta.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index e4c4de1b4e..477ee6cc5b 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -51,7 +51,6 @@ #include "sysemu/reset.h" #include "sysemu/runstate.h" #include "qapi/error.h" -#include "qemu/error-report.h" #include "hw/empty_slot.h" #include "sysemu/kvm.h" #include "hw/semihosting/semihost.h" @@ -1185,17 +1184,13 @@ static void create_cpu_without_cps(MachineState *ms, static void create_cps(MachineState *ms, MaltaState *s, qemu_irq *cbus_irq, qemu_irq *i8259_irq) { - Error *err =3D NULL; - sysbus_init_child_obj(OBJECT(s), "cps", OBJECT(&s->cps), sizeof(s->cps= ), TYPE_MIPS_CPS); - object_property_set_str(OBJECT(&s->cps), ms->cpu_type, "cpu-type", &er= r); - object_property_set_int(OBJECT(&s->cps), ms->smp.cpus, "num-vp", &err); - object_property_set_bool(OBJECT(&s->cps), true, "realized", &err); - if (err !=3D NULL) { - error_report("%s", error_get_pretty(err)); - exit(1); - } + object_property_set_str(OBJECT(&s->cps), ms->cpu_type, "cpu-type", + &error_fatal); + object_property_set_int(OBJECT(&s->cps), ms->smp.cpus, "num-vp", + &error_fatal); + object_property_set_bool(OBJECT(&s->cps), true, "realized", &error_fat= al); =20 sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->cps), 0, 0, 1); =20 --=20 2.21.1 From nobody Wed May 15 11:04:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1586810495; cv=none; d=zohomail.com; s=zohoarc; b=bNiWQlUEoGnT8hhA6GCA+qwOWclYwBsIILkfGXrGUESPkNrKjMRsjyZco6XEODLWcIJVtFloogpyNmSYiVyJf4JqYlNq99G6J4Wakp7rng4hZQOUfXJ0DZvxWENEtwVxkyfbixlo9pzdNUSwmNo6XDJdPoKDq7XXmR4O79H6EJo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586810495; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=41dnSW14EdDvEOvenf0xilVesJ/VyYm5m6Di/l78nEQ=; b=ZSYe51myReMipwv01U8we72FtRWACu5a8q36ac0mO0M/bJkkMDxO+QDntIqPpAxyBIwefKpHOCdJrA9Wxz9nJqMmJw7tuLlhQ9V+pcnXBpnEbApMsO35hWEHSJfQcPf5aGpffBKV+X4SV3olf6WPIjIgj5Y99xZN8d9us/FXZkw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586810495430904.1470681843159; Mon, 13 Apr 2020 13:41:35 -0700 (PDT) Received: from localhost ([::1]:48602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO5te-0001n0-37 for importer@patchew.org; Mon, 13 Apr 2020 16:41:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34958) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jO5sr-0000yY-Md for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:40:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jO5sq-0003Rz-KD for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:40:45 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:45338) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jO5sq-0003RP-Dh for qemu-devel@nongnu.org; Mon, 13 Apr 2020 16:40:44 -0400 Received: by mail-wr1-x432.google.com with SMTP id v5so11635858wrp.12 for ; Mon, 13 Apr 2020 13:40:44 -0700 (PDT) Received: from localhost.localdomain (116.red-83-42-57.dynamicip.rima-tde.net. [83.42.57.116]) by smtp.gmail.com with ESMTPSA id k8sm14389389wrm.52.2020.04.13.13.40.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 13:40:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=41dnSW14EdDvEOvenf0xilVesJ/VyYm5m6Di/l78nEQ=; b=biHJ7c2ZjTzmJBD5YRVKIeLnQeOkwnqzSaSYe+vvA6AdJyGLW73jII7YiCE9GW1Iau rlp2vCfNk/FNAoAvaH5Lc2JEgqQErI1qsGUgQOyWRZ3ZxxDGUFvcM/h32VjTO2/g68pl EjxVBUPLb/FPi2EHs/wMc+FXF2Rle8BQ3k6vZUTo7ZdA/4KCzyoTii1xv2cY+UwvrNcB Rp4QSbURrRFWHCoP56U6cZffaRR/s5AzrZBeuL66jDsRZlSZPgYLEFaVAohYfZe1AH4X 41YN9IVl74uMt08BICYRtgSL4Sg7ADeCF7Gb4ZRX5ECFXPB2U7XPDWJI/Q0+39k4qFmu 4KqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=41dnSW14EdDvEOvenf0xilVesJ/VyYm5m6Di/l78nEQ=; b=Kj/LrJT9VQ+BO4n5HRafcqlSeVcxAXAwNsRYI4bkvzY9PJZm0ExHEd1NRvemnIcmHS Em9HCLtt+Nz6d906/nluMWORKUQ2ScA/R+Hj+ihhd/zHr/IkhB/YklQcUBdN29+ev0wi xcLKYq/VU+fPsQr8zhFl/Y7xHbBJkJy6+7v9zENNSivi8v2iw6mB2WkTCOSXCQDYcKM1 GsiGiup5ae3qj7VgobUh6qW8OPwXGNQHILNFETg1aWLN6SGB+ixd9OU/T4zC9DT6gifF i3OlLiOoW2uqr/u0UlD6Hkj9SrDYbSEZkrFwU9yzc8kj5zd5DGRFV1Xm+e1TnZ517LMs eKtQ== X-Gm-Message-State: AGi0Puan4/SRQ2DgA41dV6fqf6g7VS+f9VwQfzDFWWnips4YxmJW3BYF XB5Q6mLmnNWLjcujweKSU8X7kUHeKb8= X-Google-Smtp-Source: APiQypJo6E74HGhiEPJSA3PuO80vX+YrLdTJHYGuNwuheFlLUElEBgSEWgDXaIGiHM15DzG8XoIOag== X-Received: by 2002:adf:f3c5:: with SMTP id g5mr20072500wrp.230.1586810442520; Mon, 13 Apr 2020 13:40:42 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH-for-5.1 v3 7/7] qga/commands-win32: Add missing error-propagation code Date: Mon, 13 Apr 2020 22:40:35 +0200 Message-Id: <20200413204036.30757-1-f4bug@amsat.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: 20200412224517.12869-1-f4bug@amsat.org References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 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: Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Roth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Running the coccinelle script produced: $ spatch \ --macro-file scripts/cocci-macro-file.h --include-headers \ --sp-file scripts/coccinelle/find-missing-error_propagate.cocci \ --keep-comments --smpl-spacing --dir . HANDLING: ./qga/commands-win32.c [[manual check required: error_propagate() might be missing in acquire_pr= ivilege() ./qga/commands-win32.c:1344:4]] [[manual check required: error_propagate() might be missing in acquire_pr= ivilege() ./qga/commands-win32.c:1360:4]] [[manual check required: error_propagate() might be missing in check_susp= end_mode() ./qga/commands-win32.c:1343:4]] [[manual check required: error_propagate() might be missing in check_susp= end_mode() ./qga/commands-win32.c:1359:4]] Add the missing error_propagate() after review. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- .../use-error_abort-in-instance_init.cocci | 17 ++++-------- qga/commands-win32.c | 26 +++++++++++++------ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/scripts/coccinelle/use-error_abort-in-instance_init.cocci b/sc= ripts/coccinelle/use-error_abort-in-instance_init.cocci index 8302d74a0c..706c60163c 100644 --- a/scripts/coccinelle/use-error_abort-in-instance_init.cocci +++ b/scripts/coccinelle/use-error_abort-in-instance_init.cocci @@ -24,29 +24,22 @@ identifier instance_initfn; info.instance_init =3D instance_initfn; =20 =20 -@ use_error_abort @ +@ use_error_abort_in_instance_init @ identifier match_instance_init.instance_initfn; -identifier func_with_error; -expression parentobj, propname, childobj, size, type, errp; +identifier func_with_error !=3D {qbus_create_inplace, object_initialize_ch= ild}; position pos; @@ void instance_initfn(...) { <+... -( - object_initialize_child(parentobj, propname, - childobj, size, type, - errp, NULL); -| func_with_error@pos(..., - NULL); + &error_abort); -) ...+> } =20 =20 -@script:python depends on use_error_abort && !has_qapi_error@ -p << use_error_abort.pos; +@ depends on use_error_abort_in_instance_init && !has_qapi_error @ @@ -print('[[manual edit required, %s misses #include "qapi/error.h"]]' % p[0]= .file) + #include ... ++ #include "qapi/error.h" diff --git a/qga/commands-win32.c b/qga/commands-win32.c index b49920e201..8b66098056 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -1341,13 +1341,18 @@ void qmp_guest_suspend_disk(Error **errp) =20 *mode =3D GUEST_SUSPEND_MODE_DISK; check_suspend_mode(*mode, &local_err); + if (local_err) { + goto out; + } acquire_privilege(SE_SHUTDOWN_NAME, &local_err); + if (local_err) { + goto out; + } execute_async(do_suspend, mode, &local_err); =20 - if (local_err) { - error_propagate(errp, local_err); - g_free(mode); - } +out: + error_propagate(errp, local_err); + g_free(mode); } =20 void qmp_guest_suspend_ram(Error **errp) @@ -1357,13 +1362,18 @@ void qmp_guest_suspend_ram(Error **errp) =20 *mode =3D GUEST_SUSPEND_MODE_RAM; check_suspend_mode(*mode, &local_err); + if (local_err) { + goto out; + } acquire_privilege(SE_SHUTDOWN_NAME, &local_err); + if (local_err) { + goto out; + } execute_async(do_suspend, mode, &local_err); =20 - if (local_err) { - error_propagate(errp, local_err); - g_free(mode); - } +out: + error_propagate(errp, local_err); + g_free(mode); } =20 void qmp_guest_suspend_hybrid(Error **errp) --=20 2.21.1