From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a17:906:cf90:b0:9bd:85f7:2662 with SMTP id um16csp1158537ejb; Fri, 20 Oct 2023 04:51:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQ3QYHNcrdKXgVHWNkUahhgVT0lO/t+9BU7NAr5DU1agSsHsPnd1VIohApNg5ZsyNcGGE2 X-Received: by 2002:a05:620a:2b4d:b0:775:96c8:f560 with SMTP id dp13-20020a05620a2b4d00b0077596c8f560mr1478624qkb.31.1697802662544; Fri, 20 Oct 2023 04:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697802662; cv=none; d=google.com; s=arc-20160816; b=Eij+tY0PZp5zweYyKD7NUY3I2MuWzu+3s/r5yqeZdbZ+vof/Z0eX6X41hOON9rMgMt eowJbY6MX35os5fm7dveeHYSMOtK2eAdlD3GFwOH4/4r8uYKQbuhni+nWO+ZQOuHUl+a q6lYbTNOs57u0Kd0196KOeegJstu52P/9Gjo7EoENFPN60eifWoIP3dxMvy/TQj8MGqi NZe8+HBkm/Fqsw7Pd4zJi3H4xYU9FpdlkjbOx9PRbinXxSC5yO7DoC+fNLKKPn2aijsH Sn4Q8Oc/3KfxhWZOHs1wWr9zRxMKgxmZ3dN09qcO4F+h4dveIqvj4kDVAOEeSqxRHlp3 5CZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:dkim-signature; bh=CYgcAkSAR957BdA+0448FHo6zd07oCrkdPxOxAN5IrU=; fh=ZZ2Bm7fSe7kjmny5Y9G7v+lFOxjQqvyS046H1otKStU=; b=XWpFGD525DZuv3oHJU6cOJgVIfx0YK5ZfRiHeFZqlgzEKdKOfPr+qEh+xqAOU0hk2E sdyV69/L25spubHjkszUZj3nLblVVxe3NzIsebAq+92Buu6iNNYDm2TozKtUUoXSRGxO w3ccF74mDD+J+i8qQ+Mh7HvW8VopbEHHnBXE4iDv9ZbkIwUezMHCql6MjO53KvaZqCcG yKvR8iDUY6JcMgMgIvu8RtgxZ/aTk5ADEJcIpZop/WtGIaHuZN28vxWW9UTtYu7uoTEq tTP3jnD3YNhPTTC6Hvjs8xRapArh+NNzC8gC97dLwn5x/kVJmFuwO3XsbDYsjs2LxqW7 fI6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BdHIfkCf; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c18-20020a05620a11b200b00775bfe3a8f7si1152529qkk.410.2023.10.20.04.51.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 04:51:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BdHIfkCf; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qto1m-0002Cm-Ku; Fri, 20 Oct 2023 07:50:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qto1S-00024u-3f for qemu-devel@nongnu.org; Fri, 20 Oct 2023 07:50:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qto1O-0006zd-Rh for qemu-devel@nongnu.org; Fri, 20 Oct 2023 07:50:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697802629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CYgcAkSAR957BdA+0448FHo6zd07oCrkdPxOxAN5IrU=; b=BdHIfkCfAKpk0WqiDn6MrH822HxcBt07pBi5lfgGD+JwetbEYTcmhM7KwS+RFIQ+t3GI7J EPHFVXyhR1KJUKZkAMkvnDbwD5BphyHlqDCt2+TtHSgrRrG26Bp2Dk/zkvOG0VEJK1IzbA 2U721885hYEfmbTiwY3dcDoOPHvQBQk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-84-Yh8B0O6BNDaY5vxkcJK1Gg-1; Fri, 20 Oct 2023 07:50:27 -0400 X-MC-Unique: Yh8B0O6BNDaY5vxkcJK1Gg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E9FE0889064; Fri, 20 Oct 2023 11:50:26 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.193.56]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BF0AF40C6F7E; Fri, 20 Oct 2023 11:50:26 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CB47721E6A1F; Fri, 20 Oct 2023 13:50:25 +0200 (CEST) From: Markus Armbruster To: Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Cc: qemu-devel@nongnu.org, Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, Juan Quintela , Fam Zheng , Kevin Wolf , Hanna Reitz , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Peter Xu , Leonardo Bras , Paolo Bonzini , Richard Henderson Subject: Re: [PATCH v2 14/22] qapi: Inline and remove QERR_IO_ERROR definition References: <20231005045041.52649-1-philmd@linaro.org> <20231005045041.52649-15-philmd@linaro.org> Date: Fri, 20 Oct 2023 13:50:25 +0200 In-Reply-To: <20231005045041.52649-15-philmd@linaro.org> ("Philippe =?utf-8?Q?Mathieu-Daud=C3=A9=22's?= message of "Thu, 5 Oct 2023 06:50:31 +0200") Message-ID: <875y314iny.fsf@pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: gSYDHxEazhM8 Philippe Mathieu-Daud=C3=A9 writes: > Address the comment added in commit 4629ed1e98 > ("qerror: Finally unused, clean up"), from 2015: > > /* > * These macros will go away, please don't use > * in new code, and do not add new ones! > */ > > Mechanical transformation using: > > $ sed -i -e 's/QERR_IO_ERROR/"An IO error has occurred"/' \ > $(git grep -wl QERR_IO_ERROR) > > then manually removing the definition in include/qapi/qmp/qerror.h. > > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > Reviewed-by: Juan Quintela > --- > include/qapi/qmp/qerror.h | 3 --- > block/vmdk.c | 8 ++++---- > blockdev.c | 2 +- > dump/win_dump.c | 4 ++-- > migration/savevm.c | 4 ++-- > softmmu/cpus.c | 4 ++-- > 6 files changed, 11 insertions(+), 14 deletions(-) > > diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h > index ac727d1c2d..d95c4b84b9 100644 > --- a/include/qapi/qmp/qerror.h > +++ b/include/qapi/qmp/qerror.h > @@ -17,9 +17,6 @@ > * add new ones! > */ >=20=20 > -#define QERR_IO_ERROR \ > - "An IO error has occurred" > - > #define QERR_MIGRATION_ACTIVE \ > "There's a migration process in progress" >=20=20 > diff --git a/block/vmdk.c b/block/vmdk.c > index e90649c8bf..6779a181f0 100644 > --- a/block/vmdk.c > +++ b/block/vmdk.c > @@ -2246,12 +2246,12 @@ vmdk_init_extent(BlockBackend *blk, int64_t files= ize, bool flat, bool compress, > /* write all the data */ > ret =3D blk_co_pwrite(blk, 0, sizeof(magic), &magic, 0); > if (ret < 0) { > - error_setg(errp, QERR_IO_ERROR); As far as I can tell, blk_co_pwrite() returns a negative errno code. Which we throw away, and claim "IO error". I expect that to be misleading at least sometimes. I suspect the other uses of QERR_IO_ERROR are similarly problematic more often than not. Not your patch's problem, of course. > + error_setg(errp, "An IO error has occurred"); We should spell it "I/O", unless we're reporting trouble with Jupiter's moon. > goto exit; > } > ret =3D blk_co_pwrite(blk, sizeof(magic), sizeof(header), &header, 0= ); > if (ret < 0) { > - error_setg(errp, QERR_IO_ERROR); > + error_setg(errp, "An IO error has occurred"); > goto exit; > } >=20=20 [...]