From nobody Sat Apr 27 06:53:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499952901727612.3643191974072; Thu, 13 Jul 2017 06:35:01 -0700 (PDT) Received: from localhost ([::1]:60098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeGf-0006Ej-Bx for importer@patchew.org; Thu, 13 Jul 2017 09:34:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeA2-0008WA-VA for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVeA2-0001O5-2n for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23713) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVe9w-0001K6-Of; Thu, 13 Jul 2017 09:28:00 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7064AC04B929; Thu, 13 Jul 2017 13:27:58 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-60.ams2.redhat.com [10.36.116.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E4C5B67CC1; Thu, 13 Jul 2017 13:27:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4E1071138647; Thu, 13 Jul 2017 15:27:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7064AC04B929 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7064AC04B929 From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 15:27:48 +0200 Message-Id: <1499952476-3454-2-git-send-email-armbru@redhat.com> In-Reply-To: <1499952476-3454-1-git-send-email-armbru@redhat.com> References: <1499952476-3454-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 13 Jul 2017 13:27:58 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/9] xilinx: Fix latent error handling bug X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E. Iglesias" , Jason Wang , qemu-arm@nongnu.org, Eduardo Habkost , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eduardo Habkost Assigning directly to *errp is not valid, as errp may be null, &error_fatal, or &error_abort. The !*errp conditional protects against the latter two, but we then leak @local_err. Fortunately, the qdev core always passes pointer to null, so this is "merely" a latent bug. Use error_propagate() instead. Cc: "Edgar E. Iglesias" Cc: Alistair Francis Cc: Jason Wang Cc: qemu-arm@nongnu.org Signed-off-by: Eduardo Habkost Message-Id: <20170608133906.12737-2-ehabkost@redhat.com> Reviewed-by: Alistair Francis Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster [Commit message clarified] Signed-off-by: Markus Armbruster --- hw/dma/xilinx_axidma.c | 4 +--- hw/net/xilinx_axienet.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index 6065689..3987b5f 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -554,9 +554,7 @@ static void xilinx_axidma_realize(DeviceState *dev, Err= or **errp) return; =20 xilinx_axidma_realize_fail: - if (!*errp) { - *errp =3D local_err; - } + error_propagate(errp, local_err); } =20 static void xilinx_axidma_init(Object *obj) diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index b670184..5ffa739 100644 --- a/hw/net/xilinx_axienet.c +++ b/hw/net/xilinx_axienet.c @@ -981,9 +981,7 @@ static void xilinx_enet_realize(DeviceState *dev, Error= **errp) return; =20 xilinx_enet_realize_fail: - if (!*errp) { - *errp =3D local_err; - } + error_propagate(errp, local_err); } =20 static void xilinx_enet_init(Object *obj) --=20 2.7.5 From nobody Sat Apr 27 06:53:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149995275433431.947845121811724; Thu, 13 Jul 2017 06:32:34 -0700 (PDT) Received: from localhost ([::1]:60088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeEJ-0003mn-5t for importer@patchew.org; Thu, 13 Jul 2017 09:32:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeA2-0008Vp-Ih for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVeA1-0001Nq-N2 for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60478) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVe9w-0001Jr-AJ; Thu, 13 Jul 2017 09:28:00 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5362365CF1; Thu, 13 Jul 2017 13:27:59 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-60.ams2.redhat.com [10.36.116.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E4E3467CD9; Thu, 13 Jul 2017 13:27:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 517C91138648; Thu, 13 Jul 2017 15:27:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5362365CF1 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 5362365CF1 From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 15:27:49 +0200 Message-Id: <1499952476-3454-3-git-send-email-armbru@redhat.com> In-Reply-To: <1499952476-3454-1-git-send-email-armbru@redhat.com> References: <1499952476-3454-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 13 Jul 2017 13:27:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/9] block: Don't try to set *errp directly X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Eduardo Habkost , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eduardo Habkost Assigning directly to *errp is not valid, as errp may be NULL, &error_fatal, or &error_abort. Use error_propagate() instead. With this, there's no need to check if errp is NULL anymore, as error_propagate() and error_prepend() are able to handle that. Cc: Kevin Wolf Cc: Max Reitz Cc: qemu-block@nongnu.org Signed-off-by: Eduardo Habkost Message-Id: <20170608133906.12737-3-ehabkost@redhat.com> Reviewed-by: Alberto Garcia Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- block.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/block.c b/block.c index 6943962..b1599d2 100644 --- a/block.c +++ b/block.c @@ -4267,11 +4267,9 @@ bool bdrv_op_is_blocked(BlockDriverState *bs, BlockO= pType op, Error **errp) assert((int) op >=3D 0 && op < BLOCK_OP_TYPE_MAX); if (!QLIST_EMPTY(&bs->op_blockers[op])) { blocker =3D QLIST_FIRST(&bs->op_blockers[op]); - if (errp) { - *errp =3D error_copy(blocker->reason); - error_prepend(errp, "Node '%s' is busy: ", - bdrv_get_device_or_node_name(bs)); - } + error_propagate(errp, error_copy(blocker->reason)); + error_prepend(errp, "Node '%s' is busy: ", + bdrv_get_device_or_node_name(bs)); return true; } return false; --=20 2.7.5 From nobody Sat Apr 27 06:53:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499952766611592.3962330502609; Thu, 13 Jul 2017 06:32:46 -0700 (PDT) Received: from localhost ([::1]:60090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeEU-0003uJ-DT for importer@patchew.org; Thu, 13 Jul 2017 09:32:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeA0-0008V8-Hj for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVe9x-0001Kr-0p for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60488) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVe9w-0001K5-PK for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:00 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 51F88A78ED for ; Thu, 13 Jul 2017 13:27:58 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-60.ams2.redhat.com [10.36.116.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E859F7046C; Thu, 13 Jul 2017 13:27:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 55365113864A; Thu, 13 Jul 2017 15:27:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 51F88A78ED Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 51F88A78ED From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 15:27:50 +0200 Message-Id: <1499952476-3454-4-git-send-email-armbru@redhat.com> In-Reply-To: <1499952476-3454-1-git-send-email-armbru@redhat.com> References: <1499952476-3454-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 13 Jul 2017 13:27:58 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/9] websock: Don't try to set *errp directly X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eduardo Habkost Assigning directly to *errp is not valid, as errp may be NULL, &error_fatal, or &error_abort. Use error_propagate() instead. Cc: "Daniel P. Berrange" Signed-off-by: Eduardo Habkost Message-Id: <20170608133906.12737-4-ehabkost@redhat.com> Reviewed-by: Manos Pitsidianakis Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- io/channel-websock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io/channel-websock.c b/io/channel-websock.c index 8fabade..5a3badb 100644 --- a/io/channel-websock.c +++ b/io/channel-websock.c @@ -856,7 +856,7 @@ static ssize_t qio_channel_websock_readv(QIOChannel *io= c, ssize_t ret; =20 if (wioc->io_err) { - *errp =3D error_copy(wioc->io_err); + error_propagate(errp, error_copy(wioc->io_err)); return -1; } =20 @@ -902,7 +902,7 @@ static ssize_t qio_channel_websock_writev(QIOChannel *i= oc, ssize_t ret; =20 if (wioc->io_err) { - *errp =3D error_copy(wioc->io_err); + error_propagate(errp, error_copy(wioc->io_err)); return -1; } =20 --=20 2.7.5 From nobody Sat Apr 27 06:53:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499952606570819.121281711049; Thu, 13 Jul 2017 06:30:06 -0700 (PDT) Received: from localhost ([::1]:60077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeBv-0001S1-9M for importer@patchew.org; Thu, 13 Jul 2017 09:30:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeA0-0008V2-3E for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVe9v-0001Jl-JT for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55970) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVe9v-0001JN-Cy for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:27:59 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 31F5D80F96; Thu, 13 Jul 2017 13:27:58 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-60.ams2.redhat.com [10.36.116.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EA04D6061A; Thu, 13 Jul 2017 13:27:57 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 58EDA113864C; Thu, 13 Jul 2017 15:27:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 31F5D80F96 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 31F5D80F96 From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 15:27:51 +0200 Message-Id: <1499952476-3454-5-git-send-email-armbru@redhat.com> In-Reply-To: <1499952476-3454-1-git-send-email-armbru@redhat.com> References: <1499952476-3454-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 13 Jul 2017 13:27:58 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/9] util/qemu-error: Rename error_print_loc() to be more generic X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Rename the error_print_loc() function in preparation for using it to print warnings as well. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Message-Id: <661b215695db878a0aef8401b506fb3da50e981a.1499866456.git.alista= ir.francis@xilinx.com> Signed-off-by: Markus Armbruster --- util/qemu-error.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/qemu-error.c b/util/qemu-error.c index b331f8f..1c5e35e 100644 --- a/util/qemu-error.c +++ b/util/qemu-error.c @@ -146,7 +146,7 @@ const char *error_get_progname(void) /* * Print current location to current monitor if we have one, else to stder= r. */ -static void error_print_loc(void) +static void print_loc(void) { const char *sep =3D ""; int i; @@ -197,7 +197,7 @@ void error_vreport(const char *fmt, va_list ap) g_free(timestr); } =20 - error_print_loc(); + print_loc(); error_vprintf(fmt, ap); error_printf("\n"); } --=20 2.7.5 From nobody Sat Apr 27 06:53:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499952595373126.5959563645115; Thu, 13 Jul 2017 06:29:55 -0700 (PDT) Received: from localhost ([::1]:60075 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeBk-0001I4-Q4 for importer@patchew.org; Thu, 13 Jul 2017 09:29:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeA0-0008V7-Hl for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVe9x-0001L7-6d for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16489) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVe9w-0001KM-UC for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:01 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DEAD275721; Thu, 13 Jul 2017 13:27:59 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-60.ams2.redhat.com [10.36.116.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B7AD60609; Thu, 13 Jul 2017 13:27:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5CC7F113864D; Thu, 13 Jul 2017 15:27:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DEAD275721 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DEAD275721 From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 15:27:52 +0200 Message-Id: <1499952476-3454-6-git-send-email-armbru@redhat.com> In-Reply-To: <1499952476-3454-1-git-send-email-armbru@redhat.com> References: <1499952476-3454-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 13 Jul 2017 13:28:00 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/9] error: Functions to report warnings and informational messages X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Add warn_report(), warn_vreport() for reporting warnings, and info_report(), info_vreport() for informational messages. These are implemented them with a helper function factored out of error_vreport(), suitably generalized. This patch makes no changes to the output of the original error_report() function. Signed-off-by: Alistair Francis Reviewed-by: Markus Armbruster Message-Id: Signed-off-by: Markus Armbruster --- include/qemu/error-report.h | 7 +++ scripts/checkpatch.pl | 6 ++- util/qemu-error.c | 102 ++++++++++++++++++++++++++++++++++++++++= +--- 3 files changed, 109 insertions(+), 6 deletions(-) diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h index 3001865..e1c8ae1 100644 --- a/include/qemu/error-report.h +++ b/include/qemu/error-report.h @@ -35,8 +35,15 @@ void error_printf(const char *fmt, ...) GCC_FMT_ATTR(1, = 2); void error_vprintf_unless_qmp(const char *fmt, va_list ap) GCC_FMT_ATTR(1,= 0); void error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2); void error_set_progname(const char *argv0); + void error_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); +void warn_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); +void info_vreport(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); + void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +void warn_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); +void info_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); + const char *error_get_progname(void); extern bool enable_timestamp_msg; =20 diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 73efc92..9287cc5 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2535,7 +2535,11 @@ sub process { error_prepend| error_reportf_err| error_vreport| - error_report}x; + warn_vreport| + info_vreport| + error_report| + warn_report| + info_report}x; =20 if ($rawline =3D~ /\b(?:$qemu_error_funcs)\s*\(.*\".*\\n/) { ERROR("Error messages should not contain newlines\n" . $herecurr); diff --git a/util/qemu-error.c b/util/qemu-error.c index 1c5e35e..c557c6a 100644 --- a/util/qemu-error.c +++ b/util/qemu-error.c @@ -14,6 +14,16 @@ #include "monitor/monitor.h" #include "qemu/error-report.h" =20 +/* + * @report_type is the type of message: error, warning or + * informational. + */ +typedef enum { + REPORT_TYPE_ERROR, + REPORT_TYPE_WARNING, + REPORT_TYPE_INFO, +} report_type; + void error_printf(const char *fmt, ...) { va_list ap; @@ -179,17 +189,29 @@ static void print_loc(void) =20 bool enable_timestamp_msg; /* - * Print an error message to current monitor if we have one, else to stder= r. + * Print a message to current monitor if we have one, else to stderr. + * @report_type is the type of message: error, warning or informational. * Format arguments like vsprintf(). The resulting message should be * a single phrase, with no newline or trailing punctuation. * Prepend the current location and append a newline. * It's wrong to call this in a QMP monitor. Use error_setg() there. */ -void error_vreport(const char *fmt, va_list ap) +static void vreport(report_type type, const char *fmt, va_list ap) { GTimeVal tv; gchar *timestr; =20 + switch (type) { + case REPORT_TYPE_ERROR: + break; + case REPORT_TYPE_WARNING: + error_printf("warning: "); + break; + case REPORT_TYPE_INFO: + error_printf("info: "); + break; + } + if (enable_timestamp_msg && !cur_mon) { g_get_current_time(&tv); timestr =3D g_time_val_to_iso8601(&tv); @@ -204,8 +226,45 @@ void error_vreport(const char *fmt, va_list ap) =20 /* * Print an error message to current monitor if we have one, else to stder= r. - * Format arguments like sprintf(). The resulting message should be a - * single phrase, with no newline or trailing punctuation. + * Format arguments like vsprintf(). The resulting message should be + * a single phrase, with no newline or trailing punctuation. + * Prepend the current location and append a newline. + * It's wrong to call this in a QMP monitor. Use error_setg() there. + */ +void error_vreport(const char *fmt, va_list ap) +{ + vreport(REPORT_TYPE_ERROR, fmt, ap); +} + +/* + * Print a warning message to current monitor if we have one, else to stde= rr. + * Format arguments like vsprintf(). The resulting message should be + * a single phrase, with no newline or trailing punctuation. + * Prepend the current location and append a newline. + * It's wrong to call this in a QMP monitor. Use error_setg() there. + */ +void warn_vreport(const char *fmt, va_list ap) +{ + vreport(REPORT_TYPE_WARNING, fmt, ap); +} + +/* + * Print an information message to current monitor if we have one, else to + * stderr. + * Format arguments like vsprintf(). The resulting message should be + * a single phrase, with no newline or trailing punctuation. + * Prepend the current location and append a newline. + * It's wrong to call this in a QMP monitor. Use error_setg() there. + */ +void info_vreport(const char *fmt, va_list ap) +{ + vreport(REPORT_TYPE_INFO, fmt, ap); +} + +/* + * Print an error message to current monitor if we have one, else to stder= r. + * Format arguments like sprintf(). The resulting message should be + * a single phrase, with no newline or trailing punctuation. * Prepend the current location and append a newline. * It's wrong to call this in a QMP monitor. Use error_setg() there. */ @@ -214,6 +273,39 @@ void error_report(const char *fmt, ...) va_list ap; =20 va_start(ap, fmt); - error_vreport(fmt, ap); + vreport(REPORT_TYPE_ERROR, fmt, ap); + va_end(ap); +} + +/* + * Print a warning message to current monitor if we have one, else to stde= rr. + * Format arguments like sprintf(). The resulting message should be a + * single phrase, with no newline or trailing punctuation. + * Prepend the current location and append a newline. + * It's wrong to call this in a QMP monitor. Use error_setg() there. + */ +void warn_report(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vreport(REPORT_TYPE_WARNING, fmt, ap); + va_end(ap); +} + +/* + * Print an information message to current monitor if we have one, else to + * stderr. + * Format arguments like sprintf(). The resulting message should be a + * single phrase, with no newline or trailing punctuation. + * Prepend the current location and append a newline. + * It's wrong to call this in a QMP monitor. Use error_setg() there. + */ +void info_report(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vreport(REPORT_TYPE_INFO, fmt, ap); va_end(ap); } --=20 2.7.5 From nobody Sat Apr 27 06:53:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499952769491302.09588171403936; Thu, 13 Jul 2017 06:32:49 -0700 (PDT) Received: from localhost ([::1]:60091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeEY-0003w8-To for importer@patchew.org; Thu, 13 Jul 2017 09:32:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeAE-0000H6-OM for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVeA8-0001QP-7H for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43852) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVeA7-0001Q3-Po for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:12 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0948A42BD8; Thu, 13 Jul 2017 13:28:10 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-60.ams2.redhat.com [10.36.116.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C9BB60612; Thu, 13 Jul 2017 13:27:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 604B01138650; Thu, 13 Jul 2017 15:27:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0948A42BD8 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0948A42BD8 From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 15:27:53 +0200 Message-Id: <1499952476-3454-7-git-send-email-armbru@redhat.com> In-Reply-To: <1499952476-3454-1-git-send-email-armbru@redhat.com> References: <1499952476-3454-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 13 Jul 2017 13:28:10 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 6/9] Convert error_report() to warn_report() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Cornelia Huck , Stefan Hajnoczi , "Michael S. Tsirkin" , Jeff Cody , Gerd Hoffmann , Rob Herring , Josh Durgin , Alexander Graf , Christian Borntraeger , Marcel Apfelbaum , Richard Henderson , Jason Wang , Eduardo Habkost , Peter Lieven , Greg Kurz , Alistair Francis , Peter Chubb , Ronnie Sahlberg , Paolo Bonzini , David Gibson , Kevin Wolf , Peter Crosthwaite , Marcelo Tosatti , "Richard W.M. Jones" , Max Reitz , "Aneesh Kumar K.V" , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Convert all uses of error_report("warning:"... to use warn_report() instead. This helps standardise on a single method of printing warnings to the user. All of the warnings were changed using these two commands: find ./* -type f -exec sed -i \ 's|error_report(".*warning[,:] |warn_report("|Ig' {} + Indentation fixed up manually afterwards. The test-qdev-global-props test case was manually updated to ensure that this patch passes make check (as the test cases are case sensitive). Signed-off-by: Alistair Francis Suggested-by: Thomas Huth Cc: Jeff Cody Cc: Kevin Wolf Cc: Max Reitz Cc: Ronnie Sahlberg Cc: Paolo Bonzini Cc: Peter Lieven Cc: Josh Durgin Cc: "Richard W.M. Jones" Cc: Markus Armbruster Cc: Peter Crosthwaite Cc: Richard Henderson Cc: "Aneesh Kumar K.V" Cc: Greg Kurz Cc: Rob Herring Cc: Peter Maydell Cc: Peter Chubb Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: David Gibson Cc: Alexander Graf Cc: Gerd Hoffmann Cc: Jason Wang Cc: Marcelo Tosatti Cc: Christian Borntraeger Cc: Cornelia Huck Cc: Stefan Hajnoczi Acked-by: David Gibson Acked-by: Greg Kurz Acked-by: Cornelia Huck Reviewed-by: Stefan Hajnoczi Reviewed by: Peter Chubb Acked-by: Max Reitz Acked-by: Marcel Apfelbaum Message-Id: Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- block/backup.c | 12 ++++++------ block/gluster.c | 3 +-- block/iscsi.c | 6 +++--- block/nfs.c | 12 ++++++------ block/rbd.c | 6 +++--- block/ssh.c | 4 ++-- blockdev.c | 2 +- cpus.c | 2 +- hw/9pfs/9p.c | 2 +- hw/arm/highbank.c | 6 +++--- hw/arm/imx25_pdk.c | 6 +++--- hw/arm/kzm.c | 6 +++--- hw/core/machine.c | 10 +++++----- hw/core/qdev-properties.c | 8 ++++---- hw/i386/acpi-build.c | 10 +++++----- hw/i386/kvm/pci-assign.c | 6 +++--- hw/i386/pc.c | 10 +++++----- hw/i386/pc_piix.c | 8 ++++---- hw/i386/pc_q35.c | 6 +++--- hw/misc/aspeed_sdmc.c | 8 ++++---- hw/nvram/fw_cfg.c | 2 +- hw/pci-host/piix.c | 2 +- hw/ppc/pnv.c | 6 +++--- hw/ppc/spapr.c | 4 ++-- hw/ppc/spapr_iommu.c | 2 +- hw/scsi/scsi-bus.c | 6 +++--- hw/usb/dev-smartcard-reader.c | 6 +++--- hw/usb/redirect.c | 2 +- net/tap-linux.c | 2 +- target/i386/cpu.c | 22 +++++++++++----------- target/i386/kvm.c | 12 ++++++------ target/s390x/cpu_models.c | 6 +++--- target/s390x/kvm.c | 4 ++-- tests/test-qdev-global-props.c | 6 +++--- trace/control.c | 8 ++++---- vl.c | 20 ++++++++++---------- 36 files changed, 121 insertions(+), 122 deletions(-) diff --git a/block/backup.c b/block/backup.c index b69184e..504a089 100644 --- a/block/backup.c +++ b/block/backup.c @@ -639,12 +639,12 @@ BlockJob *backup_job_create(const char *job_id, Block= DriverState *bs, ret =3D bdrv_get_info(target, &bdi); if (ret =3D=3D -ENOTSUP && !target->backing) { /* Cluster size is not defined */ - error_report("WARNING: The target block device doesn't provide " - "information about the block size and it doesn't have= a " - "backing file. The default block size of %u bytes is " - "used. If the actual block size of the target exceeds= " - "this default, the backup may be unusable", - BACKUP_CLUSTER_SIZE_DEFAULT); + warn_report("The target block device doesn't provide " + "information about the block size and it doesn't have = a " + "backing file. The default block size of %u bytes is " + "used. If the actual block size of the target exceeds " + "this default, the backup may be unusable", + BACKUP_CLUSTER_SIZE_DEFAULT); job->cluster_size =3D BACKUP_CLUSTER_SIZE_DEFAULT; } else if (ret < 0 && !target->backing) { error_setg_errno(errp, -ret, diff --git a/block/gluster.c b/block/gluster.c index addceed..c2a5241 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -345,8 +345,7 @@ static int qemu_gluster_parse_uri(BlockdevOptionsGluste= r *gconf, is_unix =3D true; } else if (!strcmp(uri->scheme, "gluster+rdma")) { gsconf->type =3D SOCKET_ADDRESS_TYPE_INET; - error_report("Warning: rdma feature is not supported, falling " - "back to tcp"); + warn_report("rdma feature is not supported, falling back to tcp"); } else { ret =3D -EINVAL; goto out; diff --git a/block/iscsi.c b/block/iscsi.c index 54067e2..3aa438a 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1761,9 +1761,9 @@ static int iscsi_open(BlockDriverState *bs, QDict *op= tions, int flags, * filename encoded options */ filename =3D qdict_get_try_str(options, "filename"); if (filename) { - error_report("Warning: 'filename' option specified. " - "This is an unsupported option, and may be deprecate= d " - "in the future"); + warn_report("'filename' option specified. " + "This is an unsupported option, and may be deprecated " + "in the future"); iscsi_parse_filename(filename, options, &local_err); if (local_err) { ret =3D -EINVAL; diff --git a/block/nfs.c b/block/nfs.c index c3c5de0..5e98528 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -558,8 +558,8 @@ static int64_t nfs_client_open(NFSClient *client, QDict= *options, } client->readahead =3D qemu_opt_get_number(opts, "readahead-size", = 0); if (client->readahead > QEMU_NFS_MAX_READAHEAD_SIZE) { - error_report("NFS Warning: Truncating NFS readahead " - "size to %d", QEMU_NFS_MAX_READAHEAD_SIZE); + warn_report("Truncating NFS readahead size to %d", + QEMU_NFS_MAX_READAHEAD_SIZE); client->readahead =3D QEMU_NFS_MAX_READAHEAD_SIZE; } nfs_set_readahead(client->context, client->readahead); @@ -579,8 +579,8 @@ static int64_t nfs_client_open(NFSClient *client, QDict= *options, } client->pagecache =3D qemu_opt_get_number(opts, "page-cache-size",= 0); if (client->pagecache > QEMU_NFS_MAX_PAGECACHE_SIZE) { - error_report("NFS Warning: Truncating NFS pagecache " - "size to %d pages", QEMU_NFS_MAX_PAGECACHE_SIZE); + warn_report("Truncating NFS pagecache size to %d pages", + QEMU_NFS_MAX_PAGECACHE_SIZE); client->pagecache =3D QEMU_NFS_MAX_PAGECACHE_SIZE; } nfs_set_pagecache(client->context, client->pagecache); @@ -595,8 +595,8 @@ static int64_t nfs_client_open(NFSClient *client, QDict= *options, /* limit the maximum debug level to avoid potential flooding * of our log files. */ if (client->debug > QEMU_NFS_MAX_DEBUG_LEVEL) { - error_report("NFS Warning: Limiting NFS debug level " - "to %d", QEMU_NFS_MAX_DEBUG_LEVEL); + warn_report("Limiting NFS debug level to %d", + QEMU_NFS_MAX_DEBUG_LEVEL); client->debug =3D QEMU_NFS_MAX_DEBUG_LEVEL; } nfs_set_debug(client->context, client->debug); diff --git a/block/rbd.c b/block/rbd.c index 9da02cd..d461f7d 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -555,9 +555,9 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *o= ptions, int flags, * filename encoded options */ filename =3D qdict_get_try_str(options, "filename"); if (filename) { - error_report("Warning: 'filename' option specified. " - "This is an unsupported option, and may be deprecate= d " - "in the future"); + warn_report("'filename' option specified. " + "This is an unsupported option, and may be deprecated " + "in the future"); qemu_rbd_parse_filename(filename, options, &local_err); if (local_err) { r =3D -EINVAL; diff --git a/block/ssh.c b/block/ssh.c index 5296441..07a57eb 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -1114,8 +1114,8 @@ static coroutine_fn int ssh_co_writev(BlockDriverStat= e *bs, static void unsafe_flush_warning(BDRVSSHState *s, const char *what) { if (!s->unsafe_flush_warning) { - error_report("warning: ssh server %s does not support fsync", - s->inet->host); + warn_report("ssh server %s does not support fsync", + s->inet->host); if (what) { error_report("to support fsync, you need %s", what); } diff --git a/blockdev.c b/blockdev.c index e2016b6..a521c85 100644 --- a/blockdev.c +++ b/blockdev.c @@ -914,7 +914,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterface= Type block_default_type) copy_on_read =3D qemu_opt_get_bool(legacy_opts, "copy-on-read", false); =20 if (read_only && copy_on_read) { - error_report("warning: disabling copy-on-read on read-only drive"); + warn_report("disabling copy-on-read on read-only drive"); copy_on_read =3D false; } =20 diff --git a/cpus.c b/cpus.c index 14bb8d5..9bed61e 100644 --- a/cpus.c +++ b/cpus.c @@ -557,7 +557,7 @@ void qemu_start_warp_timer(void) if (deadline < 0) { static bool notified; if (!icount_sleep && !notified) { - error_report("WARNING: icount sleep disabled and no active tim= ers"); + warn_report("icount sleep disabled and no active timers"); notified =3D true; } return; diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 6c92bad..333dbb6 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -2376,7 +2376,7 @@ static void coroutine_fn v9fs_flush(void *opaque) trace_v9fs_flush(pdu->tag, pdu->id, tag); =20 if (pdu->tag =3D=3D tag) { - error_report("Warning: the guest sent a self-referencing 9P flush = request"); + warn_report("the guest sent a self-referencing 9P flush request"); } else { QLIST_FOREACH(cancel_pdu, &s->active_list, next) { if (cancel_pdu->tag =3D=3D tag) { diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index d209b97..750c463 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -383,9 +383,9 @@ static void calxeda_init(MachineState *machine, enum cx= machines machine_id) highbank_binfo.write_board_setup =3D hb_write_board_setup; highbank_binfo.secure_board_setup =3D true; } else { - error_report("WARNING: cannot load built-in Monitor support " - "if KVM is enabled. Some guests (such as Linux) " - "may not boot."); + warn_report("cannot load built-in Monitor support " + "if KVM is enabled. Some guests (such as Linux) " + "may not boot."); } =20 arm_load_kernel(ARM_CPU(first_cpu), &highbank_binfo); diff --git a/hw/arm/imx25_pdk.c b/hw/arm/imx25_pdk.c index 44e741f..7d42c74 100644 --- a/hw/arm/imx25_pdk.c +++ b/hw/arm/imx25_pdk.c @@ -80,9 +80,9 @@ static void imx25_pdk_init(MachineState *machine) =20 /* We need to initialize our memory */ if (machine->ram_size > (FSL_IMX25_SDRAM0_SIZE + FSL_IMX25_SDRAM1_SIZE= )) { - error_report("WARNING: RAM size " RAM_ADDR_FMT " above max support= ed, " - "reduced to %x", machine->ram_size, - FSL_IMX25_SDRAM0_SIZE + FSL_IMX25_SDRAM1_SIZE); + warn_report("RAM size " RAM_ADDR_FMT " above max supported, " + "reduced to %x", machine->ram_size, + FSL_IMX25_SDRAM0_SIZE + FSL_IMX25_SDRAM1_SIZE); machine->ram_size =3D FSL_IMX25_SDRAM0_SIZE + FSL_IMX25_SDRAM1_SIZ= E; } =20 diff --git a/hw/arm/kzm.c b/hw/arm/kzm.c index 2c96ee3..3ed6577 100644 --- a/hw/arm/kzm.c +++ b/hw/arm/kzm.c @@ -79,9 +79,9 @@ static void kzm_init(MachineState *machine) =20 /* Check the amount of memory is compatible with the SOC */ if (machine->ram_size > (FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE= )) { - error_report("WARNING: RAM size " RAM_ADDR_FMT " above max support= ed, " - "reduced to %x", machine->ram_size, - FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE); + warn_report("RAM size " RAM_ADDR_FMT " above max supported, " + "reduced to %x", machine->ram_size, + FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZE); machine->ram_size =3D FSL_IMX31_SDRAM0_SIZE + FSL_IMX31_SDRAM1_SIZ= E; } =20 diff --git a/hw/core/machine.c b/hw/core/machine.c index ecb5552..dc431fa 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -741,11 +741,11 @@ static void machine_numa_finish_init(MachineState *ma= chine) } } if (s->len && !qtest_enabled()) { - error_report("warning: CPU(s) not present in any NUMA nodes: %s", - s->str); - error_report("warning: All CPU(s) up to maxcpus should be describe= d " - "in NUMA config, ability to start up with partial NUM= A " - "mappings is obsoleted and will be removed in future"= ); + warn_report("CPU(s) not present in any NUMA nodes: %s", + s->str); + warn_report("All CPU(s) up to maxcpus should be described " + "in NUMA config, ability to start up with partial NUMA= " + "mappings is obsoleted and will be removed in future"); } g_string_free(s, true); } diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index f11d578..f5983c8 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -1132,15 +1132,15 @@ int qdev_prop_check_globals(void) oc =3D object_class_by_name(prop->driver); oc =3D object_class_dynamic_cast(oc, TYPE_DEVICE); if (!oc) { - error_report("Warning: global %s.%s has invalid class name", - prop->driver, prop->property); + warn_report("global %s.%s has invalid class name", + prop->driver, prop->property); ret =3D 1; continue; } dc =3D DEVICE_CLASS(oc); if (!dc->hotpluggable && !prop->used) { - error_report("Warning: global %s.%s=3D%s not used", - prop->driver, prop->property, prop->value); + warn_report("global %s.%s=3D%s not used", + prop->driver, prop->property, prop->value); ret =3D 1; continue; } diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 5464977..6b7bade 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2766,17 +2766,17 @@ void acpi_build(AcpiBuildTables *tables, MachineSta= te *machine) ACPI_BUILD_ALIGN_SIZE); if (tables_blob->len > legacy_table_size) { /* Should happen only with PCI bridges and -M pc-i440fx-2.0. = */ - error_report("Warning: migration may not work."); + warn_report("migration may not work."); } g_array_set_size(tables_blob, legacy_table_size); } else { /* Make sure we have a buffer in case we need to resize the tables= . */ if (tables_blob->len > ACPI_BUILD_TABLE_SIZE / 2) { /* As of QEMU 2.1, this fires with 160 VCPUs and 255 memory sl= ots. */ - error_report("Warning: ACPI tables are larger than 64k."); - error_report("Warning: migration may not work."); - error_report("Warning: please remove CPUs, NUMA nodes, " - "memory slots or PCI bridges."); + warn_report("ACPI tables are larger than 64k."); + warn_report("migration may not work."); + warn_report("please remove CPUs, NUMA nodes, " + "memory slots or PCI bridges."); } acpi_align_size(tables_blob, ACPI_BUILD_TABLE_SIZE); } diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c index 9f2615c..33e20cb 100644 --- a/hw/i386/kvm/pci-assign.c +++ b/hw/i386/kvm/pci-assign.c @@ -1353,9 +1353,9 @@ static int assigned_device_pci_cap_init(PCIDevice *pc= i_dev, Error **errp) PCI_CAP_ID_EXP); return -EINVAL; } else if (size !=3D 0x3c) { - error_report("WARNING, %s: PCIe cap-id 0x%x has " - "non-standard size 0x%x; std size should be 0= x3c", - __func__, PCI_CAP_ID_EXP, size); + warn_report("%s: PCIe cap-id 0x%x has " + "non-standard size 0x%x; std size should be 0x= 3c", + __func__, PCI_CAP_ID_EXP, size); } } else if (version =3D=3D 0) { uint16_t vid, did; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 224fe58..465e91c 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -381,8 +381,8 @@ ISADevice *pc_find_fdc0(void) } =20 if (state.multiple) { - error_report("warning: multiple floppy disk controllers with " - "iobase=3D0x3f0 have been found"); + warn_report("multiple floppy disk controllers with " + "iobase=3D0x3f0 have been found"); error_printf("the one being picked for CMOS setup might not reflec= t " "your intent\n"); } @@ -2087,9 +2087,9 @@ static void pc_machine_set_max_ram_below_4g(Object *o= bj, Visitor *v, } =20 if (value < (1ULL << 20)) { - error_report("Warning: small max_ram_below_4g(%"PRIu64 - ") less than 1M. BIOS may not work..", - value); + warn_report("small max_ram_below_4g(%"PRIu64 + ") less than 1M. BIOS may not work..", + value); } =20 pcms->max_ram_below_4g =3D value; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 22dbef6..11b4336 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -131,10 +131,10 @@ static void pc_init1(MachineState *machine, lowmem =3D 0xc0000000; } if (lowmem & ((1ULL << 30) - 1)) { - error_report("Warning: Large machine and max_ram_below= _4g " - "(%" PRIu64 ") not a multiple of 1G; " - "possible bad performance.", - pcms->max_ram_below_4g); + warn_report("Large machine and max_ram_below_4g " + "(%" PRIu64 ") not a multiple of 1G; " + "possible bad performance.", + pcms->max_ram_below_4g); } } } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 8f696b7..1653a47 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -101,9 +101,9 @@ static void pc_q35_init(MachineState *machine) lowmem =3D pcms->max_ram_below_4g; if (machine->ram_size - lowmem > lowmem && lowmem & ((1ULL << 30) - 1)) { - error_report("Warning: Large machine and max_ram_below_4g(%"PR= Iu64 - ") not a multiple of 1G; possible bad performance= .", - pcms->max_ram_below_4g); + warn_report("Large machine and max_ram_below_4g(%"PRIu64 + ") not a multiple of 1G; possible bad performance.= ", + pcms->max_ram_below_4g); } } =20 diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index 5f3ac0b..f0b3053 100644 --- a/hw/misc/aspeed_sdmc.c +++ b/hw/misc/aspeed_sdmc.c @@ -157,8 +157,8 @@ static int ast2400_rambits(AspeedSDMCState *s) } =20 /* use a common default */ - error_report("warning: Invalid RAM size 0x%" PRIx64 - ". Using default 256M", s->ram_size); + warn_report("Invalid RAM size 0x%" PRIx64 ". Using default 256M", + s->ram_size); s->ram_size =3D 256 << 20; return ASPEED_SDMC_DRAM_256MB; } @@ -179,8 +179,8 @@ static int ast2500_rambits(AspeedSDMCState *s) } =20 /* use a common default */ - error_report("warning: Invalid RAM size 0x%" PRIx64 - ". Using default 512M", s->ram_size); + warn_report("Invalid RAM size 0x%" PRIx64 ". Using default 512M", + s->ram_size); s->ram_size =3D 512 << 20; return ASPEED_SDMC_AST2500_512MB; } diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 99bdbc2..e881e3b 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -781,7 +781,7 @@ static int get_fw_cfg_order(FWCfgState *s, const char *= name) } =20 /* Stick unknown stuff at the end. */ - error_report("warning: Unknown firmware file in legacy mode: %s", name= ); + warn_report("Unknown firmware file in legacy mode: %s", name); return FW_CFG_ORDER_OVERRIDE_LAST; } =20 diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index a2c1033..072a04e 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -307,7 +307,7 @@ static void i440fx_realize(PCIDevice *dev, Error **errp) dev->config[I440FX_SMRAM] =3D 0x02; =20 if (object_property_get_bool(qdev_get_machine(), "iommu", NULL)) { - error_report("warning: i440fx doesn't support emulated iommu"); + warn_report("i440fx doesn't support emulated iommu"); } } =20 diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index a4cd733..4722115 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -160,13 +160,13 @@ static void powernv_create_core_node(PnvChip *chip, P= nvCore *pc, void *fdt) _FDT((fdt_setprop_cell(fdt, offset, "d-cache-size", pcc->l1_dcache_size))); } else { - error_report("Warning: Unknown L1 dcache size for cpu"); + warn_report("Unknown L1 dcache size for cpu"); } if (pcc->l1_icache_size) { _FDT((fdt_setprop_cell(fdt, offset, "i-cache-size", pcc->l1_icache_size))); } else { - error_report("Warning: Unknown L1 icache size for cpu"); + warn_report("Unknown L1 icache size for cpu"); } =20 _FDT((fdt_setprop_cell(fdt, offset, "timebase-frequency", tbfreq))); @@ -556,7 +556,7 @@ static void ppc_powernv_init(MachineState *machine) =20 /* allocate RAM */ if (machine->ram_size < (1 * G_BYTE)) { - error_report("Warning: skiboot may not work with < 1GB of RAM"); + warn_report("skiboot may not work with < 1GB of RAM"); } =20 ram =3D g_new(MemoryRegion, 1); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index d38563d..16638ce 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -534,13 +534,13 @@ static void spapr_populate_cpu_dt(CPUState *cs, void = *fdt, int offset, _FDT((fdt_setprop_cell(fdt, offset, "d-cache-size", pcc->l1_dcache_size))); } else { - error_report("Warning: Unknown L1 dcache size for cpu"); + warn_report("Unknown L1 dcache size for cpu"); } if (pcc->l1_icache_size) { _FDT((fdt_setprop_cell(fdt, offset, "i-cache-size", pcc->l1_icache_size))); } else { - error_report("Warning: Unknown L1 icache size for cpu"); + warn_report("Unknown L1 icache size for cpu"); } =20 _FDT((fdt_setprop_cell(fdt, offset, "timebase-frequency", tbfreq))); diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c index 8656a54..583afc1 100644 --- a/hw/ppc/spapr_iommu.c +++ b/hw/ppc/spapr_iommu.c @@ -334,7 +334,7 @@ void spapr_tce_table_enable(sPAPRTCETable *tcet, uint32_t nb_table) { if (tcet->nb_table) { - error_report("Warning: trying to enable already enabled TCE table"= ); + warn_report("trying to enable already enabled TCE table"); return; } =20 diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index f557446..23c51de 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -282,9 +282,9 @@ void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, bool = deprecated) continue; /* claimed */ } if (!dinfo->is_default) { - error_report("warning: bus=3D%d,unit=3D%d is deprecated wi= th this" - " machine type", - bus->busnr, unit); + warn_report("bus=3D%d,unit=3D%d is deprecated with this" + " machine type", + bus->busnr, unit); } } scsi_bus_legacy_add_drive(bus, blk_by_legacy_dinfo(dinfo), diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index 49cb182..bef1f03 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -1314,12 +1314,12 @@ static int ccid_card_init(DeviceState *qdev) int ret =3D 0; =20 if (card->slot !=3D 0) { - error_report("Warning: usb-ccid supports one slot, can't add %d", - card->slot); + warn_report("usb-ccid supports one slot, can't add %d", + card->slot); return -1; } if (s->card !=3D NULL) { - error_report("Warning: usb-ccid card already full, not adding"); + warn_report("usb-ccid card already full, not adding"); return -1; } ret =3D ccid_card_initfn(card); diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index aa22d69..5b65965 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -193,7 +193,7 @@ static void usbredir_handle_status(USBRedirDevice *dev,= USBPacket *p, #define WARNING(...) \ do { \ if (dev->debug >=3D usbredirparser_warning) { \ - error_report("usb-redir warning: " __VA_ARGS__); \ + warn_report("" __VA_ARGS__); \ } \ } while (0) #define INFO(...) \ diff --git a/net/tap-linux.c b/net/tap-linux.c index a503fa9..535b1dd 100644 --- a/net/tap-linux.c +++ b/net/tap-linux.c @@ -55,7 +55,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, ifr.ifr_flags =3D IFF_TAP | IFF_NO_PI; =20 if (ioctl(fd, TUNGETFEATURES, &features) =3D=3D -1) { - error_report("warning: TUNGETFEATURES failed: %s", strerror(errno)= ); + warn_report("TUNGETFEATURES failed: %s", strerror(errno)); features =3D 0; } =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index c571772..da942d9 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -2060,15 +2060,15 @@ static void x86_cpu_parse_featurestr(const char *ty= pename, char *features, name =3D featurestr; =20 if (g_list_find_custom(plus_features, name, compare_string)) { - error_report("warning: Ambiguous CPU model string. " - "Don't mix both \"+%s\" and \"%s=3D%s\"", - name, name, val); + warn_report("Ambiguous CPU model string. " + "Don't mix both \"+%s\" and \"%s=3D%s\"", + name, name, val); ambiguous =3D true; } if (g_list_find_custom(minus_features, name, compare_string)) { - error_report("warning: Ambiguous CPU model string. " - "Don't mix both \"-%s\" and \"%s=3D%s\"", - name, name, val); + warn_report("Ambiguous CPU model string. " + "Don't mix both \"-%s\" and \"%s=3D%s\"", + name, name, val); ambiguous =3D true; } =20 @@ -2096,8 +2096,8 @@ static void x86_cpu_parse_featurestr(const char *type= name, char *features, } =20 if (ambiguous) { - error_report("warning: Compatibility of ambiguous CPU model " - "strings won't be kept on future QEMU versions"); + warn_report("Compatibility of ambiguous CPU model " + "strings won't be kept on future QEMU versions"); } } =20 @@ -3547,9 +3547,9 @@ static void x86_cpu_realizefn(DeviceState *dev, Error= **errp) */ if (cpu->phys_bits !=3D host_phys_bits && cpu->phys_bits !=3D = 0 && !warned) { - error_report("Warning: Host physical bits (%u)" - " does not match phys-bits property (%u)", - host_phys_bits, cpu->phys_bits); + warn_report("Host physical bits (%u)" + " does not match phys-bits property (%u)", + host_phys_bits, cpu->phys_bits); warned =3D true; } =20 diff --git a/target/i386/kvm.c b/target/i386/kvm.c index f84a49d..a6613e1 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -600,10 +600,10 @@ static int kvm_arch_set_tsc_khz(CPUState *cs) kvm_vcpu_ioctl(cs, KVM_GET_TSC_KHZ) : -ENOTSUP; if (cur_freq <=3D 0 || cur_freq !=3D env->tsc_khz) { - error_report("warning: TSC frequency mismatch between " - "VM (%" PRId64 " kHz) and host (%d kHz), " - "and TSC scaling unavailable", - env->tsc_khz, cur_freq); + warn_report("TSC frequency mismatch between " + "VM (%" PRId64 " kHz) and host (%d kHz), " + "and TSC scaling unavailable", + env->tsc_khz, cur_freq); return r; } } @@ -919,8 +919,8 @@ int kvm_arch_init_vcpu(CPUState *cs) error_report("kvm: LMCE not supported"); return -ENOTSUP; } - error_report("warning: Unsupported MCG_CAP bits: 0x%" PRIx64, - unsupported_caps); + warn_report("Unsupported MCG_CAP bits: 0x%" PRIx64, + unsupported_caps); } =20 env->mcg_cap &=3D mcg_cap | MCG_CAP_BANKS_MASK; diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 7cb55dc..f56d57b 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -677,9 +677,9 @@ static void check_consistency(const S390CPUModel *model) for (i =3D 0; i < ARRAY_SIZE(dep); i++) { if (test_bit(dep[i][0], model->features) && !test_bit(dep[i][1], model->features)) { - error_report("Warning: \'%s\' requires \'%s\'.", - s390_feat_def(dep[i][0])->name, - s390_feat_def(dep[i][1])->name); + warn_report("\'%s\' requires \'%s\'.", + s390_feat_def(dep[i][0])->name, + s390_feat_def(dep[i][1])->name); } } } diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index a3d0019..271bd65 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2675,8 +2675,8 @@ void kvm_s390_apply_cpu_model(const S390CPUModel *mod= el, Error **errp) /* enable CMM via CMMA - disable on hugetlbfs */ if (test_bit(S390_FEAT_CMM, model->features)) { if (mem_path) { - error_report("Warning: CMM will not be enabled because it is n= ot " - "compatible to hugetlbfs."); + warn_report("CMM will not be enabled because it is not " + "compatible to hugetlbfs."); } else { kvm_s390_enable_cmma(); } diff --git a/tests/test-qdev-global-props.c b/tests/test-qdev-global-props.c index 48e5b73..b25fe89 100644 --- a/tests/test-qdev-global-props.c +++ b/tests/test-qdev-global-props.c @@ -232,10 +232,10 @@ static void test_dynamic_globalprop(void) g_test_trap_assert_passed(); g_test_trap_assert_stderr_unmatched("*prop1*"); g_test_trap_assert_stderr_unmatched("*prop2*"); - g_test_trap_assert_stderr("*Warning: global dynamic-prop-type-bad.prop= 3 has invalid class name\n*"); + g_test_trap_assert_stderr("*warning: global dynamic-prop-type-bad.prop= 3 has invalid class name\n*"); g_test_trap_assert_stderr_unmatched("*prop4*"); - g_test_trap_assert_stderr("*Warning: global nohotplug-type.prop5=3D105= not used\n*"); - g_test_trap_assert_stderr("*Warning: global nondevice-type.prop6 has i= nvalid class name\n*"); + g_test_trap_assert_stderr("*warning: global nohotplug-type.prop5=3D105= not used\n*"); + g_test_trap_assert_stderr("*warning: global nondevice-type.prop6 has i= nvalid class name\n*"); g_test_trap_assert_stdout(""); } =20 diff --git a/trace/control.c b/trace/control.c index 9b157b0..f5fb11d 100644 --- a/trace/control.c +++ b/trace/control.c @@ -171,8 +171,8 @@ static void do_trace_enable_events(const char *line_buf) while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { if (!trace_event_get_state_static(ev)) { if (!is_pattern) { - error_report("WARNING: trace event '%s' is not traceable", - line_ptr); + warn_report("trace event '%s' is not traceable", + line_ptr); return; } continue; @@ -186,8 +186,8 @@ static void do_trace_enable_events(const char *line_buf) } =20 if (!is_pattern) { - error_report("WARNING: trace event '%s' does not exist", - line_ptr); + warn_report("trace event '%s' does not exist", + line_ptr); } } =20 diff --git a/vl.c b/vl.c index f7560de..8efd48b 100644 --- a/vl.c +++ b/vl.c @@ -952,8 +952,8 @@ static void bt_vhci_add(int vlan_id) struct bt_scatternet_s *vlan =3D qemu_find_bt_vlan(vlan_id); =20 if (!vlan->slave) - error_report("warning: adding a VHCI to an empty scatternet %i", - vlan_id); + warn_report("adding a VHCI to an empty scatternet %i", + vlan_id); =20 bt_vhci_init(bt_new_hci(vlan)); } @@ -979,8 +979,8 @@ static struct bt_device_s *bt_device_add(const char *op= t) vlan =3D qemu_find_bt_vlan(vlan_id); =20 if (!vlan->slave) - error_report("warning: adding a slave device to an empty scatterne= t %i", - vlan_id); + warn_report("adding a slave device to an empty scatternet %i", + vlan_id); =20 if (!strcmp(devname, "keyboard")) return bt_keyboard_init(vlan); @@ -2302,8 +2302,8 @@ static int parse_fw_cfg(void *opaque, QemuOpts *opts,= Error **errp) return -1; } if (strncmp(name, "opt/", 4) !=3D 0) { - error_report("warning: externally provided fw_cfg item names " - "should be prefixed with \"opt/\""); + warn_report("externally provided fw_cfg item names " + "should be prefixed with \"opt/\""); } if (nonempty_str(str)) { size =3D strlen(str); /* NUL terminator NOT included in fw_cfg blo= b */ @@ -3760,7 +3760,7 @@ int main(int argc, char **argv, char **envp) qemu_opts_parse_noisily(olist, "accel=3Dtcg", false); break; case QEMU_OPTION_no_kvm_pit: { - error_report("warning: ignoring deprecated option"); + warn_report("ignoring deprecated option"); break; } case QEMU_OPTION_no_kvm_pit_reinjection: { @@ -3770,8 +3770,8 @@ int main(int argc, char **argv, char **envp) .value =3D "discard", }; =20 - error_report("warning: deprecated, replaced by " - "-global kvm-pit.lost_tick_policy=3Ddiscard"); + warn_report("deprecated, replaced by " + "-global kvm-pit.lost_tick_policy=3Ddiscard"); qdev_prop_register_global(&kvm_pit_lost_tick_policy); break; } @@ -3896,7 +3896,7 @@ int main(int argc, char **argv, char **envp) } break; case QEMU_OPTION_tdf: - error_report("warning: ignoring deprecated option"); + warn_report("ignoring deprecated option"); break; case QEMU_OPTION_name: opts =3D qemu_opts_parse_noisily(qemu_find_opts("name"), --=20 2.7.5 From nobody Sat Apr 27 06:53:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499952593662819.7716881820627; Thu, 13 Jul 2017 06:29:53 -0700 (PDT) Received: from localhost ([::1]:60074 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeBi-0001GJ-70 for importer@patchew.org; Thu, 13 Jul 2017 09:29:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeA0-0008V5-HG for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVe9x-0001Kj-0S for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56784) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVe9w-0001K9-OZ for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:00 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1581C045768; Thu, 13 Jul 2017 13:27:59 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-60.ams2.redhat.com [10.36.116.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C2416C1F9; Thu, 13 Jul 2017 13:27:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6392B1138651; Thu, 13 Jul 2017 15:27:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C1581C045768 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C1581C045768 From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 15:27:54 +0200 Message-Id: <1499952476-3454-8-git-send-email-armbru@redhat.com> In-Reply-To: <1499952476-3454-1-git-send-email-armbru@redhat.com> References: <1499952476-3454-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 13 Jul 2017 13:27:59 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 7/9] char-socket: Report TCP socket waiting as information X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis When QEMU is waiting for a TCP socket connection it reports that message as an error. This isn't an error it is just information so let's change the report to use info_report() instead. Signed-off-by: Alistair Francis Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: Signed-off-by: Markus Armbruster --- chardev/char-socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index ccc499c..a050a68 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -765,8 +765,8 @@ static int tcp_chr_wait_connected(Chardev *chr, Error *= *errp) * in TLS and telnet cases, only wait for an accepted socket */ while (!s->ioc) { if (s->is_listen) { - error_report("QEMU waiting for connection on: %s", - chr->filename); + info_report("QEMU waiting for connection on: %s", + chr->filename); qio_channel_set_blocking(QIO_CHANNEL(s->listen_ioc), true, NUL= L); tcp_chr_accept(QIO_CHANNEL(s->listen_ioc), G_IO_IN, chr); qio_channel_set_blocking(QIO_CHANNEL(s->listen_ioc), false, NU= LL); --=20 2.7.5 From nobody Sat Apr 27 06:53:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499952753670789.3194676753383; Thu, 13 Jul 2017 06:32:33 -0700 (PDT) Received: from localhost ([::1]:60087 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeEH-0003kR-BC for importer@patchew.org; Thu, 13 Jul 2017 09:32:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeA0-0008V9-J2 for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVe9x-0001Kz-3y for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38572) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVe9w-0001KB-Q7 for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:01 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C2174BCFEE; Thu, 13 Jul 2017 13:27:59 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-60.ams2.redhat.com [10.36.116.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 891DD61B96; Thu, 13 Jul 2017 13:27:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 66F5C1138657; Thu, 13 Jul 2017 15:27:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C2174BCFEE Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C2174BCFEE From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 15:27:55 +0200 Message-Id: <1499952476-3454-9-git-send-email-armbru@redhat.com> In-Reply-To: <1499952476-3454-1-git-send-email-armbru@redhat.com> References: <1499952476-3454-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 13 Jul 2017 13:27:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 8/9] error: Implement the warn and free Error functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Implement warn_report_err() and warn_reportf_err() functions which are the same as the error_report_err() and error_reportf_err() functions except report a warning instead of an error. Signed-off-by: Alistair Francis Reviewed-by: Markus Armbruster Message-Id: <276ff93eadc0b01b8243cc61ffc331f77922c0d0.1499866456.git.alista= ir.francis@xilinx.com> Signed-off-by: Markus Armbruster --- include/qapi/error.h | 11 +++++++++++ scripts/checkpatch.pl | 1 + util/error.c | 20 ++++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/include/qapi/error.h b/include/qapi/error.h index 7e532d0..af53b34 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -267,11 +267,22 @@ void error_free(Error *err); void error_free_or_abort(Error **errp); =20 /* + * Convenience function to warn_report() and free @err. + */ +void warn_report_err(Error *err); + +/* * Convenience function to error_report() and free @err. */ void error_report_err(Error *err); =20 /* + * Convenience function to error_prepend(), warn_report() and free @err. + */ +void warn_reportf_err(Error *err, const char *fmt, ...) + GCC_FMT_ATTR(2, 3); + +/* * Convenience function to error_prepend(), error_report() and free @err. */ void error_reportf_err(Error *err, const char *fmt, ...) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9287cc5..4e91122 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2533,6 +2533,7 @@ sub process { error_setg_file_open| error_set| error_prepend| + warn_reportf_err| error_reportf_err| error_vreport| warn_vreport| diff --git a/util/error.c b/util/error.c index 020b86b..3efdd69 100644 --- a/util/error.c +++ b/util/error.c @@ -232,6 +232,15 @@ void error_report_err(Error *err) error_free(err); } =20 +void warn_report_err(Error *err) +{ + warn_report("%s", error_get_pretty(err)); + if (err->hint) { + error_printf_unless_qmp("%s", err->hint->str); + } + error_free(err); +} + void error_reportf_err(Error *err, const char *fmt, ...) { va_list ap; @@ -242,6 +251,17 @@ void error_reportf_err(Error *err, const char *fmt, ..= .) error_report_err(err); } =20 + +void warn_reportf_err(Error *err, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + error_vprepend(&err, fmt, ap); + va_end(ap); + warn_report_err(err); +} + void error_free(Error *err) { if (err) { --=20 2.7.5 From nobody Sat Apr 27 06:53:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499952901280986.2119883684732; Thu, 13 Jul 2017 06:35:01 -0700 (PDT) Received: from localhost ([::1]:60099 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeGi-0006Ks-40 for importer@patchew.org; Thu, 13 Jul 2017 09:35:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeA4-00005w-12 for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVeA3-0001Oh-2b for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56178) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dVeA2-0001OE-Sn for qemu-devel@nongnu.org; Thu, 13 Jul 2017 09:28:07 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C43B878ECB; Thu, 13 Jul 2017 13:28:05 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-60.ams2.redhat.com [10.36.116.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A82F2702E6; Thu, 13 Jul 2017 13:27:59 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6A7AF113866C; Thu, 13 Jul 2017 15:27:56 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C43B878ECB Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=armbru@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C43B878ECB From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 15:27:56 +0200 Message-Id: <1499952476-3454-10-git-send-email-armbru@redhat.com> In-Reply-To: <1499952476-3454-1-git-send-email-armbru@redhat.com> References: <1499952476-3454-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 13 Jul 2017 13:28:06 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 9/9] Convert error_report*_err() to warn_report*_err() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , "Michael S. Tsirkin" , Eduardo Habkost , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alistair Francis Convert all uses of error_report*_err("Warning:"... to use warn_report*_err() instead. This helps standardise on a single method of printing warnings to the user. Signed-off-by: Alistair Francis Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: "Michael S. Tsirkin" Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eduardo Habkost Reviewed-by: Markus Armbruster Message-Id: Signed-off-by: Markus Armbruster --- hw/core/qdev-properties.c | 2 +- hw/i386/pc.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index f5983c8..3d0bba2 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -1169,7 +1169,7 @@ static void qdev_prop_set_globals_for_type(DeviceStat= e *dev, error_propagate(prop->errp, err); } else { assert(prop->user_provided); - error_reportf_err(err, "Warning: "); + warn_report_err(err); } } } diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 465e91c..bf541ca 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1320,8 +1320,7 @@ void pc_acpi_init(const char *default_dsdt) =20 acpi_table_add_builtin(opts, &err); if (err) { - error_reportf_err(err, "WARNING: failed to load %s: ", - filename); + warn_reportf_err(err, "failed to load %s: ", filename); } g_free(filename); } --=20 2.7.5