From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696441310; cv=none; d=zohomail.com; s=zohoarc; b=d/9a6QqjaddtjcsbpEIyMGSetPotBvqJOixXpOIHxCPQveiYZNT6KV0pCNNqrS9SpCPlEMokyhAvIhz8MonVs7wU51mBTqETkrTSs+iWa3VN5Fnokcqt4nrWyvF35KYrTxwlXzpJ3j1AojYAsQCqP8DLWLhYfAUcAuxizsv4XUU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696441310; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zxIwwvtSDa6HXj+GPDZLsyAAO0jyEUx+3zbxHDZan+w=; b=h34TtFkxyGzbV3FRk5DUtqcXZrofPSU8oDehoPAeuBA3mJMdvzdVyH1ZNWmY+VF5dgAw+UN36IkezqnCbx41Y1cnNqWvTYvyigZ30NvG25xGRVwmApUC9Z+3WUOr2RqMH7RqzhWBAaPPomWyzAhFiL9UiTwfGUsWF/MnpgplZuY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696441310216443.2858372085989; Wed, 4 Oct 2023 10:41:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5jV-00037Z-0X; Wed, 04 Oct 2023 13:32:25 -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 1qo5jO-00034S-P3 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:18 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5jI-0000rX-Ag for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:16 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-405417465aaso470035e9.1 for ; Wed, 04 Oct 2023 10:32:10 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id m15-20020a7bcb8f000000b003fc0505be19sm2002229wmi.37.2023.10.04.10.32.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440729; x=1697045529; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zxIwwvtSDa6HXj+GPDZLsyAAO0jyEUx+3zbxHDZan+w=; b=JKSryxNaBE1PTWpdgxnn43dbHu+jRpoFB1yG5VMCSmWw4z3yk0tXX1juZXZNo/Ulv1 s9aEvPDZnZkNw5xAFne54Ztuyu7C5O9ekC6J46a4d4G1cQIbaPVvR6TuFi2oaGUGyOFk VQo9BHG1kq3wXe3Q+yyXMpNzr8/9AKdYyj1IJUxn8lo0en2Zi/JSfZesYlNuLy7PpnRd I2l3x0lhI9rfb0XCgD2YbB6qaoyfbb/+NcdVucXiYHnO1fy6rVWm3e2un/XnZ54MtT+b tpqnNNAgsByX67YyTJSqj1HOs1C+kYLweA8bgbNxlnRsTHQsQ27DaJaQQfLC1QBBDkLu akQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440729; x=1697045529; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zxIwwvtSDa6HXj+GPDZLsyAAO0jyEUx+3zbxHDZan+w=; b=vy6bYRQvGCyADzFd0dXq12ZpBnFq1wykPXyQK67G8AOKypDyVVcJo0wz22FhgdOpYF Qcv9L332Z+IIjSc4b+bGGHB9VeTvb2igU3wvKGJveIchIM0TglJzTSguyqDIEeeA8hTE X+Nw6LOzQQAqW7g/AL4HwWOncBn9LNAQMQtSsh7sHqpWbQ9geHR9UcnttxRWFgUDVkTi 8AoDvs1Y3ZCAxkMHJDApaucVwl4N+T4WG7+BnwTQbl4ZeBg0yxB/2Nb0Nkb3j6UIiHKC GKThJQZ2jdO7RppYUM0SoKzC0ccHY71q5wa6X1r2FA1VDXsRLZ2Td4HIYdcFUMtihnx5 0A/g== X-Gm-Message-State: AOJu0YyECb6vQRLsbfkmVS1WHJmziIfnpNdJ3AWkdDUwlkJRBe1BpcI4 GtOlpapQX0k2vaXOb1d89Oe4TevzEEO9TG6FyQw= X-Google-Smtp-Source: AGHT+IHFJRiWgiXxCNCuOhksrc/+zJJyQyXst+sPuVqWTmmvISnQXpGX+DAcLS0uGP8mE0QrohYoFQ== X-Received: by 2002:a7b:c4cb:0:b0:401:cb45:3fb8 with SMTP id g11-20020a7bc4cb000000b00401cb453fb8mr2874935wmk.38.1696440729211; Wed, 04 Oct 2023 10:32:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Nicholas Piggin , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson , Harsh Prateek Bora , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH 01/21] qapi: Inline and remove QERR_BUS_NO_HOTPLUG definition Date: Wed, 4 Oct 2023 19:31:36 +0200 Message-ID: <20231004173158.42591-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696441310791100005 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, manually removing the definition in include/qapi/qmp/qerror.h. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qapi/qmp/qerror.h | 3 --- hw/ppc/spapr_pci.c | 4 ++-- softmmu/qdev-monitor.c | 8 +++++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 8dd9fcb071..1a9c2d3502 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,9 +17,6 @@ * add new ones! */ =20 -#define QERR_BUS_NO_HOTPLUG \ - "Bus '%s' does not support hotplugging" - #define QERR_DEVICE_HAS_NO_MEDIUM \ "Device '%s' has no medium" =20 diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 370c5a90f2..7f063f5852 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1550,7 +1550,7 @@ static void spapr_pci_pre_plug(HotplugHandler *plug_h= andler, * we need to let them know it's not enabled */ if (plugged_dev->hotplugged) { - error_setg(errp, QERR_BUS_NO_HOTPLUG, + error_setg(errp, "Bus '%s' does not support hotplugging", object_get_typename(OBJECT(phb))); return; } @@ -1671,7 +1671,7 @@ static void spapr_pci_unplug_request(HotplugHandler *= plug_handler, SpaprDrc *drc =3D drc_from_dev(phb, pdev); =20 if (!phb->dr_enabled) { - error_setg(errp, QERR_BUS_NO_HOTPLUG, + error_setg(errp, "Bus '%s' does not support hotplugging", object_get_typename(OBJECT(phb))); return; } diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 74f4e41338..3a9740dcbd 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -656,7 +656,8 @@ DeviceState *qdev_device_add_from_qdict(const QDict *op= ts, =20 if (qdev_should_hide_device(opts, from_json, errp)) { if (bus && !qbus_is_hotpluggable(bus)) { - error_setg(errp, QERR_BUS_NO_HOTPLUG, bus->name); + error_setg(errp, "Bus '%s' does not support hotplugging", + bus->name); } return NULL; } else if (*errp) { @@ -664,7 +665,7 @@ DeviceState *qdev_device_add_from_qdict(const QDict *op= ts, } =20 if (phase_check(PHASE_MACHINE_READY) && bus && !qbus_is_hotpluggable(b= us)) { - error_setg(errp, QERR_BUS_NO_HOTPLUG, bus->name); + error_setg(errp, "Bus '%s' does not support hotplugging", bus->nam= e); return NULL; } =20 @@ -904,7 +905,8 @@ void qdev_unplug(DeviceState *dev, Error **errp) } =20 if (dev->parent_bus && !qbus_is_hotpluggable(dev->parent_bus)) { - error_setg(errp, QERR_BUS_NO_HOTPLUG, dev->parent_bus->name); + error_setg(errp, "Bus '%s' does not support hotplugging", + dev->parent_bus->name); return; } =20 --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696440827; cv=none; d=zohomail.com; s=zohoarc; b=k2IfTfc/YgK9qhIlfihcY/rNyB0fJdm9lPtrk8qqfJDyLI3YM46KIQYXt4q2Li246LHtSAYB/9gSJlluwmilmtPzSy6pmoKICfaAjA60V42xD6A+Vl8Sbso0qe8h/LMPMhO2WEJqW/Jke642OYRRqtS5xYjtvLyzv49rydWSZfs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696440827; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iUgMeUD+upV2LccJ26enpy7uECYexY6ww0G/2qJYl+4=; b=YS//p4IbQstzxrv3QZrIz8RdYe8kBtk7tUmRIlRtF654Df/qYAWVca4+bTSu46g608EhRbF+DF0yLpRFkz+d/IUeWcITGhlMgXw5xo18yJUAftkeAeGKGtiiKKNaTV9k2BAX3maKfqlCcBE72ZQF7yNQRcjPCPZJbN+ioOpcjJQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696440827220437.2628246923741; Wed, 4 Oct 2023 10:33:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5jW-00039h-4m; Wed, 04 Oct 2023 13:32:26 -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 1qo5jP-00035J-Vx for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:20 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5jO-0000ti-E4 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:19 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40651a72807so465355e9.1 for ; Wed, 04 Oct 2023 10:32:17 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id 10-20020a05600c228a00b004065d72ab19sm2059688wmf.0.2023.10.04.10.32.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440736; x=1697045536; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iUgMeUD+upV2LccJ26enpy7uECYexY6ww0G/2qJYl+4=; b=cLNJVtnKzc3wwJ8rHg5Okc/FfO/MF9cDGfyPqUrJbR+SE5a7jEkcyzChoJNz/eenyt 5snfuiD9zPLjYwTep1hk9QrrDosGq+Xz/vlWj5p6ExfZ5orWKou87rbmZ+9Fl39ya11b PbtUIzcHrHXzgStA39PICdJE3CyaADSkRypNJ/l8PPayEqEPGmK0Imx+M1iSaxvI8aYL /4jR82Na4Et7nZgceGt1J2IHNqBuKxMADFZd5eYE2likYUhVvUxIAaPPouIvxJsPpF2C Jrguj8gw5he5RVqdRQZLfG2/bGXtQx5DLF/lNndUMJPLvvM55vWZ0EQEr2ptBXgFNDAt gdQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440736; x=1697045536; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iUgMeUD+upV2LccJ26enpy7uECYexY6ww0G/2qJYl+4=; b=gKA4CtZ16r5caCgUGRSbMBj3m+AfrPoKsrUMHUiAWbepESnS0ui+zjD3RkRxZaQhAN /ANip8BdoBynwcOWu/nFrOtKqisiWjtEyJsHqfHF/TbbRRIHhaERa/itPOfMP5S1u3j6 x/KLos4P4V4zfHb/cY0qNnOusguJKfD0L46Jo31t7bxtsD6LtxWud37XSWB/EJLBNgsx CrP/0rdTvfEoyc8l8oHPe2gStKN1+LsSZcLKsjOInWEyNlRdUPxgZPs6zecEVEgAlmwM emMn8NI7AVFHhVHCi47DlxJngoFSZnFqltiE23F+vXlkY0FwOnH4oK+yZmPnAhJu01ZW SPZA== X-Gm-Message-State: AOJu0Yz1ZI9Zz2NWIqL4o4ZHkoJjhDS56kvPw0OJ+lDr8on7tR4Ce5Rw 2vRQN40v520pBdnp0apJ8HJ7r4IaHtCl2f/sQd0= X-Google-Smtp-Source: AGHT+IHsPNCReIto6W+6CAHbw8CGfedRQ9MqS3svW1ytyQvvdaFPi/eTwK9ztJfcZ3+YqlCygjwaMg== X-Received: by 2002:adf:e606:0:b0:317:6314:96e2 with SMTP id p6-20020adfe606000000b00317631496e2mr2624583wrm.14.1696440735924; Wed, 04 Oct 2023 10:32:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kevin Wolf , Hanna Reitz Subject: [PATCH 02/21] qapi: Inline and remove QERR_DEVICE_HAS_NO_MEDIUM definition Date: Wed, 4 Oct 2023 19:31:37 +0200 Message-ID: <20231004173158.42591-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696440828644100003 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, manually removing the definition in include/qapi/qmp/qerror.h. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qapi/qmp/qerror.h | 3 --- block/snapshot.c | 4 ++-- blockdev.c | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 1a9c2d3502..168177bcd7 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,9 +17,6 @@ * add new ones! */ =20 -#define QERR_DEVICE_HAS_NO_MEDIUM \ - "Device '%s' has no medium" - #define QERR_DEVICE_IN_USE \ "Device '%s' is in use" =20 diff --git a/block/snapshot.c b/block/snapshot.c index b86b5b24ad..eb43e957e1 100644 --- a/block/snapshot.c +++ b/block/snapshot.c @@ -345,7 +345,7 @@ int bdrv_snapshot_delete(BlockDriverState *bs, GLOBAL_STATE_CODE(); =20 if (!drv) { - error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, bdrv_get_device_name(b= s)); + error_setg(errp, "Device '%s' has no medium", bdrv_get_device_name= (bs)); return -ENOMEDIUM; } if (!snapshot_id && !name) { @@ -420,7 +420,7 @@ int bdrv_snapshot_load_tmp(BlockDriverState *bs, GLOBAL_STATE_CODE(); =20 if (!drv) { - error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, bdrv_get_device_name(b= s)); + error_setg(errp, "Device '%s' has no medium", bdrv_get_device_name= (bs)); return -ENOMEDIUM; } if (!snapshot_id && !name) { diff --git a/blockdev.c b/blockdev.c index 325b7a3bef..e5617faf0f 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1422,7 +1422,7 @@ static void external_snapshot_action(TransactionActio= n *action, bdrv_drained_begin(state->old_bs); =20 if (!bdrv_is_inserted(state->old_bs)) { - error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, device); + error_setg(errp, "Device '%s' has no medium", device); goto out; } =20 --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696440898; cv=none; d=zohomail.com; s=zohoarc; b=PHFf6UntzGJpoh5b/m4nyVa0CiHObPylSl5m4y+a+gCqfnpZL+Yr/K2POuYcTuKSQKihAne+Y9eZJoUsU7oezoxdY3EofbAl2L7JN+azDi1PhwQHoY1NAiBayvi1NXIjjWTrEAkGopiOAzli+5DL5DdvR3y9R5NyG/iTKWcsraE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696440898; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bBDxOWnGC99luImlqjntVhvHvQ5f4z9cF2Uz6KLOjxk=; b=O2MrnSJ2ulAJEcXWOmb9/tKA/9HOybIeRjf4gF48VZF5VjV/Zv14Xomq3V9tILYnOzt8GT+uGDI5VsUKhhn4gWvlZdUgDw7ClFAm8vFSJaXXLO4+oGWCn+BhPeSn5NYljbyXduhg9OQ64ASQ5EAi1Hz6fIWttdDPLJ9WA62vvxs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696440898220964.6020964737249; Wed, 4 Oct 2023 10:34:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5jZ-0003C4-PL; Wed, 04 Oct 2023 13:32:29 -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 1qo5jW-0003A3-Sq for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:26 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5jV-0000wR-ES for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:26 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40537481094so569695e9.0 for ; Wed, 04 Oct 2023 10:32:24 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id d9-20020adff849000000b003248a490e3asm4502639wrq.39.2023.10.04.10.32.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:32:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440742; x=1697045542; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bBDxOWnGC99luImlqjntVhvHvQ5f4z9cF2Uz6KLOjxk=; b=VSp17taar6VbWZfp9AnJdLculXNb7EzI8Dnwscv462lHqLzlYqw/y4CyFkunO52/dE cxPizSyaUzKfJrRTlWCUMkKSO8IoVKOe9lFeJ62WykY8apykTO7EerUUAxQAYperJGcI CbGBc439kYpxUy04d2iXe+BmI6JzixbKIv6LVGJ2Px6y8WtizoEoo5NvVZC23HvQZurw yXOWufh8COCAVsQeYzDx+L+xwLwPJJCIoS6nFphY5RorLQcwd2jTrMXxlO05dQA9IQ7a JxkRcbdF5s4FezaXNdyQmQEY8LEHO9Vp95TGjZ76wQYX1CvrbWPUvLbrIcjN1fEM/4wD Razg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440742; x=1697045542; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bBDxOWnGC99luImlqjntVhvHvQ5f4z9cF2Uz6KLOjxk=; b=bgOfzc4lWnthomkzNciV0bBLTzT2Ziko55QT6Yn5nc5VuS5D99nfXyPAwZ3BOl3Rio z49VcQJeo13o+bAkEJhmkl3jCX/CxfTHu661JeEaPRdejA3aCi4q9Xjz/qnPOcI80Oq+ 1H56ZF8VgyJMG3kzuD+Pii0yiyz1ZoIoNrQ2r7ygbWCaV134LK/YCpOfnIfK2hB53quE Twq2XcWS95rAxsSOHISknHXnVa8gYdQTi7DP7+zl4OILf8ntRM1DGZP1ZXW7gEzO3iM3 MtTSNWf4mIgsAP4+tZ3dLg+0bjpShKPhQlwt8cTCuooCEbnfppnDUxcP65x6yhI8Vdmy AhGg== X-Gm-Message-State: AOJu0YxPJRTirZ0/GEeIm2DgDp8bKbE8E9c3sBe1ONk24LAk88McVTiY vu8AFzZR/HSjIiqy9eYuDPb8AT7wYDL7BtCgZtI= X-Google-Smtp-Source: AGHT+IEVljxrxbsTZQVFDgQIe0njJ4Lx923OxtxzyYWRZsBZF6rMONC8Boq2o3sO5PkWTZQcaosXkg== X-Received: by 2002:a5d:6991:0:b0:320:976:f940 with SMTP id g17-20020a5d6991000000b003200976f940mr2718283wru.13.1696440742687; Wed, 04 Oct 2023 10:32:22 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kevin Wolf , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini Subject: [PATCH 03/21] qapi: Inline and remove QERR_DEVICE_IN_USE definition Date: Wed, 4 Oct 2023 19:31:38 +0200 Message-ID: <20231004173158.42591-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696440898503100001 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, manually removing the definition in include/qapi/qmp/qerror.h. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qapi/qmp/qerror.h | 3 --- blockdev.c | 2 +- chardev/char-fe.c | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 168177bcd7..daa889809b 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,9 +17,6 @@ * add new ones! */ =20 -#define QERR_DEVICE_IN_USE \ - "Device '%s' is in use" - #define QERR_DEVICE_NO_HOTPLUG \ "Device '%s' does not support hotplugging" =20 diff --git a/blockdev.c b/blockdev.c index e5617faf0f..da39da457e 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2345,7 +2345,7 @@ void coroutine_fn qmp_block_resize(const char *device= , const char *node_name, } =20 if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_RESIZE, NULL)) { - error_setg(errp, QERR_DEVICE_IN_USE, device); + error_setg(errp, "Device '%s' is in use", device); return; } =20 diff --git a/chardev/char-fe.c b/chardev/char-fe.c index 7789f7be9c..7d33b3ccd1 100644 --- a/chardev/char-fe.c +++ b/chardev/char-fe.c @@ -217,7 +217,7 @@ bool qemu_chr_fe_init(CharBackend *b, Chardev *s, Error= **errp) return true; =20 unavailable: - error_setg(errp, QERR_DEVICE_IN_USE, s->label); + error_setg(errp, "Device '%s' is in use", s->label); return false; } =20 --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696440807; cv=none; d=zohomail.com; s=zohoarc; b=J4yiAih/dHbKFqQfCSdqPxF0kgXWThDjue1bmodhJHL5BZpMENtBxEsmyniOdTFuvm+OpAMtqjrMO6mrIAdOHzOCNGCmcfKPsuJOYdycFGnQqr575lEktcg7wygXXvPcv1+RORdDzwLlr9EukBjolfHPzLWQJbTKy8fp2CwLzW8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696440807; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4tlfU+e5P66No2dfLjlw3nceh1BAOvyaTo2g5TESIX0=; b=judV40L6Hjd5tPgHD8S4+h3tXj7ezvFI7yTBDv6zxj76gM+2W2gqqaPl3YsKVPlf7+Ugh8nwIH1T16/tmn/IaA3HRJY59B06hDO3r3IiAsuIPnfFkGv3UrHuCGPMwqn0M41d35A7n2R7cr82uoLUDh4yqmJh4gsreyL9S7p2BKE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696440807578672.5565202498639; Wed, 4 Oct 2023 10:33:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5jj-0003JQ-K3; Wed, 04 Oct 2023 13:32:40 -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 1qo5jd-0003D9-DJ for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:34 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5jb-0000yQ-Ab for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:33 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3215f19a13aso97798f8f.3 for ; Wed, 04 Oct 2023 10:32:30 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id y6-20020adff6c6000000b0031c6581d55esm4448332wrp.91.2023.10.04.10.32.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440749; x=1697045549; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4tlfU+e5P66No2dfLjlw3nceh1BAOvyaTo2g5TESIX0=; b=fbTjUTTwnb1isW0M5J9DD8eMgHw+UZqumH3fg+8XPQmpPKdQB8XaGN+9ofhial+yNf Oj/nGAvU9Woe702khrsVN39GszY+nIGkpd5+bkhftJ7V8xBzhaV47x4wbpIsef7MyO5I tfTBMfS8NXK5gXcRh4HDHn4af74au+RedR6iRwXnvF2RPYbF+YhAUC2PIqletZo2IxLu eqiQwRGL3QiM4uKa6dwThg+fql621CM8lvP8+Djnqk5wmwsj6fiAabpoMp17R63ziAHn rRzmIJzYmo5+VkJXFNq5iOiMUeSOw81KFuqb9rEcFlnnCU27PBfWrVq6eOPi3xlWuZrW ir4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440749; x=1697045549; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4tlfU+e5P66No2dfLjlw3nceh1BAOvyaTo2g5TESIX0=; b=BZ1w6FnvlXmblkkJ1P/2ht6oAhWwqYE6TLJn2pgcBOb/3rZeSRZ/S4uNgw+OLMbHNs kBq4OJhVJ5Uwb3HcqS2gmaphJtiskbc4A5jZdA5PyBoG4nMSfdy7j13wgWaK7lkK60y1 c3tnorjEiHrCZaL1qhaSoAsQKmeQH5ZNLuvTicArDmnBmcalRtbSqucGVPIs2fW9z42M st0hfaynV2W2XN/YdRlZDCfU1NXVKrxTalbVXmYYEDOeWPRtIXQzjyE9dgYnAj56BnKS q6QWtQSJPKoHAZp/rzC4ebpBaZNgh59kExo6NW0WApnSkbncBed1JEVuxI8Y+G9iet4F zGZQ== X-Gm-Message-State: AOJu0YyGPeLfAWkHh7qxan9vguZcVP+A4FOrq8tsmCPTNKRNWgzOApqa jiGU7/XXJEWvjx3aSBxDgQ0sAGPTZSSNeLXqR34= X-Google-Smtp-Source: AGHT+IFoPPWXzQA0A8EQzmJZASy0AdPWwEXQC8fHhFBqt+F+/8YBKZcmN6FPNzHMTZ221trQvpljXw== X-Received: by 2002:a5d:60d1:0:b0:321:7052:6406 with SMTP id x17-20020a5d60d1000000b0032170526406mr2778244wrt.12.1696440749298; Wed, 04 Oct 2023 10:32:29 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH 04/21] qapi: Inline and remove QERR_DEVICE_NO_HOTPLUG definition Date: Wed, 4 Oct 2023 19:31:39 +0200 Message-ID: <20231004173158.42591-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696440808253100002 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, manually removing the definition in include/qapi/qmp/qerror.h. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qapi/qmp/qerror.h | 3 --- hw/core/qdev.c | 3 ++- softmmu/qdev-monitor.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index daa889809b..e93211085a 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,9 +17,6 @@ * add new ones! */ =20 -#define QERR_DEVICE_NO_HOTPLUG \ - "Device '%s' does not support hotplugging" - #define QERR_INVALID_PARAMETER \ "Invalid parameter '%s'" =20 diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 43d863b0c5..9b62e0573d 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -479,7 +479,8 @@ static void device_set_realized(Object *obj, bool value= , Error **errp) static int unattached_count; =20 if (dev->hotplugged && !dc->hotpluggable) { - error_setg(errp, QERR_DEVICE_NO_HOTPLUG, object_get_typename(obj)); + error_setg(errp, "Device '%s' does not support hotplugging", + object_get_typename(obj)); return; } =20 diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 3a9740dcbd..a964bd80df 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -911,7 +911,7 @@ void qdev_unplug(DeviceState *dev, Error **errp) } =20 if (!dc->hotpluggable) { - error_setg(errp, QERR_DEVICE_NO_HOTPLUG, + error_setg(errp, "Device '%s' does not support hotplugging", object_get_typename(OBJECT(dev))); return; } --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696441150; cv=none; d=zohomail.com; s=zohoarc; b=ie7G54rYgbm5b6fzvHPAP7Glp3vV+U5E5FMTbuGqKv/O8kpgihPvQ5IwxSpx1SuvyB6JmtT/mXreHtZ30PV0gx5B29RwyroFKyuaUWPd6OFdF9A6vf6QbnLw5BDy308p9Jjidt3XQj1kUUPByKi8Vm9kLueTr/R9efjoEhKZMgw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696441150; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=i0f/S9sk5n4iTXtNvEpxFckitQTJsYOjTpjl0/I1BCA=; b=jcGop+N4s/2E79IOqCO6KN2xAgyydgWWMN1EIbwULe6vYMOiKI5ZJmS7nQPV0VQN7FqlKue0fMiaMYwk4Eban7MyIyx9kxteYnj1FxG7bblZYMJx11hIKsOO8scLRwre6ZWlWhmpPeOmzVv12JuBSwy8C18gStgq9NCKoUhKJS0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696441150114198.39703653573895; Wed, 4 Oct 2023 10:39:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5k4-0003bW-Ll; Wed, 04 Oct 2023 13:33:00 -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 1qo5k3-0003aw-DI for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:59 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5ji-0000zz-1S for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:59 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3231d6504e1so102555f8f.2 for ; Wed, 04 Oct 2023 10:32:37 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id j6-20020adfff86000000b0031423a8f4f7sm4508086wrr.56.2023.10.04.10.32.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:32:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440756; x=1697045556; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i0f/S9sk5n4iTXtNvEpxFckitQTJsYOjTpjl0/I1BCA=; b=PmqwI1mTj7JMI2SxH81d4YYnLWp5gevd4JSRKqgkEmuJAr3oBEUXQnduWReC14Wvhp iWML/SAKHzI4H+YxidQM0MMBjo9ti/nuk2csQSNwvSofFKr16VRTQHC9LdlmobptxNiA coFD6jynmjbhOqN5vRm/D/LbHpJ1COYPZUBNncYaP5X62uBJ4DIALCKhfjo3Ys2fl0f0 iMz2tjGhI+5RvA3bc1aPv4BcUVXQcM5ryu+uobH8EYqrDTgUxhepXskfhffUVHJVKaPW +dWzaCqlZx5mua+un7N0UceFS6fcKFS6PwXkGj3reyeX/cKLjymsHH/QEh9s91ZOT0ZK u0Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440756; x=1697045556; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i0f/S9sk5n4iTXtNvEpxFckitQTJsYOjTpjl0/I1BCA=; b=O5VuYvDRje6t3EiwSq/YS1FkmopPVMXZjiWptm5Hlc2kbu+CFqr8A5qAQv+DjY6jHC PrBo/53LQxHksyidOtcVGNYuA34AU9xNodymc/PEHTErmf980Ma8MerScH2lqWC/aIfZ 5fLiTn37llSxJP4mQ07MxE5dYyFCAq6KzQEeITmEWcR7c4DVRbBqoUsGIoNm4K+diMTG dFax4U57f257Ees4c6SjnZAcRKqKNNTwGKEiVWNWByRctYSrysiBcbZ/fsUU9fct7RsR /2PafiyhwenFhiLD6e0n/l8dtCEDmKEow7uIB35q8j5h7BJrylF+NUI09JfIDSjDnKaS 9i7A== X-Gm-Message-State: AOJu0YxOwMmo/9BmGThdUZOwZv0jwqHcBAQwYKYNdU4YBFB4IaQ0j/0S Sv4OAPMQm4BWmnsaKMoqDO8upBhYZF8RsY6Qgxs= X-Google-Smtp-Source: AGHT+IEyJRF13iyLbNh6DMzMUU/xyLRb/9FWN5daRf86NmsoNelUul76wjR8GQLPMWAtW6Oyc61i+w== X-Received: by 2002:adf:efd1:0:b0:31f:fc96:9af1 with SMTP id i17-20020adfefd1000000b0031ffc969af1mr2729111wrp.59.1696440756089; Wed, 04 Oct 2023 10:32:36 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Michael Roth , Konstantin Kostiuk , Gerd Hoffmann Subject: [PATCH 05/21] qapi: Inline QERR_INVALID_PARAMETER definition (constant parameter) Date: Wed, 4 Oct 2023 19:31:40 +0200 Message-ID: <20231004173158.42591-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696441150843100001 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 the following coccinelle semantic patch: @match@ expression errp; constant param; @@ error_setg(errp, QERR_INVALID_PARAMETER, param); @script:python strformat depends on match@ param << match.param; fixedfmt; // new var @@ fixedfmt =3D f'"Invalid parameter \'{param[1:-1]}\'"' # Format skipping= '"'. coccinelle.fixedfmt =3D cocci.make_ident(fixedfmt) @replace@ expression match.errp; constant match.param; identifier strformat.fixedfmt; @@ - error_setg(errp, QERR_INVALID_PARAMETER, param); + error_setg(errp, fixedfmt); Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- dump/dump.c | 6 +++--- qga/commands.c | 2 +- ui/ui-qmp-cmds.c | 2 +- util/qemu-option.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index d4ef713cd0..e173f1f14c 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -1810,7 +1810,7 @@ static void dump_init(DumpState *s, int fd, bool has_= format, =20 s->fd =3D fd; if (has_filter && !length) { - error_setg(errp, QERR_INVALID_PARAMETER, "length"); + error_setg(errp, "Invalid parameter 'length'"); goto cleanup; } s->filter_area_begin =3D begin; @@ -1841,7 +1841,7 @@ static void dump_init(DumpState *s, int fd, bool has_= format, =20 /* Is the filter filtering everything? */ if (validate_start_block(s) =3D=3D -1) { - error_setg(errp, QERR_INVALID_PARAMETER, "begin"); + error_setg(errp, "Invalid parameter 'begin'"); goto cleanup; } =20 @@ -2145,7 +2145,7 @@ void qmp_dump_guest_memory(bool paging, const char *f= ile, } =20 if (fd =3D=3D -1) { - error_setg(errp, QERR_INVALID_PARAMETER, "protocol"); + error_setg(errp, "Invalid parameter 'protocol'"); return; } =20 diff --git a/qga/commands.c b/qga/commands.c index 09c683e263..871210ab0b 100644 --- a/qga/commands.c +++ b/qga/commands.c @@ -154,7 +154,7 @@ GuestExecStatus *qmp_guest_exec_status(int64_t pid, Err= or **errp) =20 gei =3D guest_exec_info_find(pid); if (gei =3D=3D NULL) { - error_setg(errp, QERR_INVALID_PARAMETER, "pid"); + error_setg(errp, "Invalid parameter 'pid'"); return NULL; } =20 diff --git a/ui/ui-qmp-cmds.c b/ui/ui-qmp-cmds.c index debc07d678..41ca0100e7 100644 --- a/ui/ui-qmp-cmds.c +++ b/ui/ui-qmp-cmds.c @@ -44,7 +44,7 @@ void qmp_set_password(SetPasswordOptions *opts, Error **e= rrp) assert(opts->protocol =3D=3D DISPLAY_PROTOCOL_VNC); if (opts->connected !=3D SET_PASSWORD_ACTION_KEEP) { /* vnc supports "connected=3Dkeep" only */ - error_setg(errp, QERR_INVALID_PARAMETER, "connected"); + error_setg(errp, "Invalid parameter 'connected'"); return; } /* diff --git a/util/qemu-option.c b/util/qemu-option.c index eedd08929b..fb391a7904 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -612,7 +612,7 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const ch= ar *id, =20 if (list->merge_lists) { if (id) { - error_setg(errp, QERR_INVALID_PARAMETER, "id"); + error_setg(errp, "Invalid parameter 'id'"); return NULL; } opts =3D qemu_opts_find(list, NULL); --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696441338; cv=none; d=zohomail.com; s=zohoarc; b=SbdXPp00cs/PiH/TA5dhahN2fOYj6WygVhz8GCVQek2u/2lpwGuRLdV7T6oAMZKNw0alu0jIa6cz70KYq0H/3JNNK9i61fa71/EhVNqlOv3z8+WnwiaLPDW9J5SoglSSWiANHFq3gD758k+EN5xcO2Ka/qOgXXRyTzawZVDi7io= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696441338; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mQJAMU/w6o8m8TBpb8PzaVjQ4Gp1ZRSyPEWXTvxRp/M=; b=QfNoyo0kzvc78bJHVXPZ/uLC8POYswfWMJjFPOAue9iJqgXnUB8EAABaOeS9nmUjbQl74rDjoBLuW5X39M5EYCDblyOYA+o0YKUnM455K552Smeu0BSE9BwKkdqGqYKUDuFiIK1XijmtrQwa1CxXpKWVNZx4BLhOsUF6zKdHq2s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696441338414987.7696080479881; Wed, 4 Oct 2023 10:42:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5jy-0003X7-Lv; Wed, 04 Oct 2023 13:32: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 1qo5jw-0003U0-H6 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:52 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5jo-000111-GN for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:52 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40572aeb673so613955e9.0 for ; Wed, 04 Oct 2023 10:32:43 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id s21-20020a7bc395000000b004064cd71aa8sm2001402wmj.34.2023.10.04.10.32.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:32:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440762; x=1697045562; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mQJAMU/w6o8m8TBpb8PzaVjQ4Gp1ZRSyPEWXTvxRp/M=; b=muLON2sbIUWVkzf7VUfniYMuJUy0UMiFICdEz//KXTbV3lOu/r3v+7kE/cjrdS1yRj MdIA/VZFjBuBOrKC5X2XRXrcXUvslOoJofGP/T4uYnpgcNlj3No42wr3Tx8YLXdzldQR ICtNBaCT6xTd8Ba4fBhEqakVPF3cet63VHloGN5PyJcXybW9x0GsoE+QmCqdUu5J2/1G kujKRErykpENDrZB7nrl0DNBU3AecvAPqC+bzg1w9ySofgEwuSx7QWTI0pjjZDd4y7m+ 1M6oJKW+l3QWPrXmwN5tcly374TroU45q6L4rGVNjw5T96EIpJk3+g5KSW6vaAaJrtKr DrPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440762; x=1697045562; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mQJAMU/w6o8m8TBpb8PzaVjQ4Gp1ZRSyPEWXTvxRp/M=; b=Gd2rTPM0jhB4qFDiPMlxs+loo/nn3ukVVM8qjDqlIBO+7XLRbCV1aVlbYYhF0ZgUbS PS4ZicIQY1nO1/BSTX/vk4sAiHzWOYuF7D7u8krLoOThEkLRqcSKIy+g/W44Ti/9iQCK Y4VqaqM9J+iHR09Rj7kwShyGb8PkZCLXTdMvJ+FlVXR9QK/lzc9ylJK08jIU5/RxkDsJ LoKp1IaKlYP5mVt7nMa0rjYlo1bkCNtmhBu6Nwvkel0TD2WNjVtVpNJtwlVuJ1uZNHrO kyLY4KsxNMgEe7moJeGJFw+iKCcwb87WDHxTCiIG8a+6rddieUST0ApusxAutzi+iWd/ 02Cg== X-Gm-Message-State: AOJu0YwJyOi2pZElC73886akujy/cv23nrX9bLTH9JNYhshZ/z8BIGES ukzO6SGIx/Ybts6LToYEcjN26KO0yByVUHeWl+E= X-Google-Smtp-Source: AGHT+IGB9Z3liXGVxuWXqi7aWSNYTUCxZ/+mkliOlY8YbjDRfu7KYDpgo8lcmRBSh353ymlNKmVyDg== X-Received: by 2002:a05:600c:c9:b0:406:3fda:962c with SMTP id u9-20020a05600c00c900b004063fda962cmr2753663wmm.31.1696440762533; Wed, 04 Oct 2023 10:32:42 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , Michael Roth Subject: [PATCH 06/21] qapi: Inline and remove QERR_INVALID_PARAMETER definition Date: Wed, 4 Oct 2023 19:31:41 +0200 Message-ID: <20231004173158.42591-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696441339117100001 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_INVALID_PARAMETER,/\"Invalid parameter '%s'\",/" \ $(git grep -lw QERR_INVALID_PARAMETER) then manually removing the definition in include/qapi/qmp/qerror.h. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qapi/qmp/qerror.h | 3 --- monitor/hmp-cmds.c | 2 +- qapi/opts-visitor.c | 2 +- util/qemu-option.c | 8 ++++---- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index e93211085a..63ab775dc5 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,9 +17,6 @@ * add new ones! */ =20 -#define QERR_INVALID_PARAMETER \ - "Invalid parameter '%s'" - #define QERR_INVALID_PARAMETER_TYPE \ "Invalid parameter type for '%s', expected: %s" =20 diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 6c559b48c8..9d6533643d 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -138,7 +138,7 @@ void hmp_sync_profile(Monitor *mon, const QDict *qdict) } else { Error *err =3D NULL; =20 - error_setg(&err, QERR_INVALID_PARAMETER, op); + error_setg(&err, "Invalid parameter '%s'", op); hmp_handle_error(mon, err); } } diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c index 8f1efab8b9..3d1a28b419 100644 --- a/qapi/opts-visitor.c +++ b/qapi/opts-visitor.c @@ -184,7 +184,7 @@ opts_check_struct(Visitor *v, Error **errp) const QemuOpt *first; =20 first =3D g_queue_peek_head(any); - error_setg(errp, QERR_INVALID_PARAMETER, first->name); + error_setg(errp, "Invalid parameter '%s'", first->name); return false; } return true; diff --git a/util/qemu-option.c b/util/qemu-option.c index fb391a7904..201f7a87f3 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -498,7 +498,7 @@ static bool opt_validate(QemuOpt *opt, Error **errp) =20 desc =3D find_desc_by_name(list->desc, opt->name); if (!desc && !opts_accepts_any(list)) { - error_setg(errp, QERR_INVALID_PARAMETER, opt->name); + error_setg(errp, "Invalid parameter '%s'", opt->name); return false; } =20 @@ -531,7 +531,7 @@ bool qemu_opt_set_bool(QemuOpts *opts, const char *name= , bool val, =20 desc =3D find_desc_by_name(list->desc, name); if (!desc && !opts_accepts_any(list)) { - error_setg(errp, QERR_INVALID_PARAMETER, name); + error_setg(errp, "Invalid parameter '%s'", name); return false; } =20 @@ -554,7 +554,7 @@ bool qemu_opt_set_number(QemuOpts *opts, const char *na= me, int64_t val, =20 desc =3D find_desc_by_name(list->desc, name); if (!desc && !opts_accepts_any(list)) { - error_setg(errp, QERR_INVALID_PARAMETER, name); + error_setg(errp, "Invalid parameter '%s'", name); return false; } =20 @@ -1103,7 +1103,7 @@ bool qemu_opts_validate(QemuOpts *opts, const QemuOpt= Desc *desc, Error **errp) QTAILQ_FOREACH(opt, &opts->head, next) { opt->desc =3D find_desc_by_name(desc, opt->name); if (!opt->desc) { - error_setg(errp, QERR_INVALID_PARAMETER, opt->name); + error_setg(errp, "Invalid parameter '%s'", opt->name); return false; } =20 --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696441191; cv=none; d=zohomail.com; s=zohoarc; b=adt1g9A82LP+KT8F80/vhREbEpwIqtZ/5RqHvAgBatbR2pzgG9LpvNE8M/tuxYSQO0nw4Ae6Rq8cl8ym7jo+VQFls9t7Bc7RCh51TK2LVU1nfwxpp7zatSv6ddqn/3JEJQLQwVi1uiry0HXyu0YsLS47tP/wQXUw/84sH5J8HgI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696441191; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MGJIXDRJu9nRlkvT0HuUW6wiDMZ2EXW42Fkcow2Wmmc=; b=L7V5QnQ/ouSUFUxffXRlW1sH3mMo9LuDUq0bjOVTn4aXMC2WcwGb0Sf5pVeMMYbiXcdJ+2XI0rCh1RNutyJ6KS1yAHwyezy8v69+1ZEpgvIcetMlRdNIqPVvzqG1xKywLQtVKjHPpPBrQ5UVWfscZjOoN2KG0i66O/RJYwuSyOY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696441191183519.8540121940513; Wed, 4 Oct 2023 10:39:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5jz-0003YG-GH; Wed, 04 Oct 2023 13:32:55 -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 1qo5jy-0003WK-3R for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:54 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5jw-00012P-2F for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:53 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4056ce55e7eso375795e9.2 for ; Wed, 04 Oct 2023 10:32:51 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id w21-20020a05600c015500b0040652e8ca13sm2011782wmm.43.2023.10.04.10.32.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440769; x=1697045569; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MGJIXDRJu9nRlkvT0HuUW6wiDMZ2EXW42Fkcow2Wmmc=; b=dAtVN/H72dd5veYTUlbJ78N8jmDPHy/V65XrqcC9foxksc1IWZHI+MuW3vZonXwRJ9 U6zkUMdHm9ZH6/sLzvhVjs4rSLhnMf4LXNE1WPL+Hq/iaqySJ4J12o2Rsi1bwTXrVF9E R+oOk+vrhhVUvboaymYaOFYpuF4AaukL5lE+G9Mj7BUrBQYxZ8In7cflTmhuzfbZBWGp 3FlimrnvVmMcAV7OI9AnJ6/oc24lGHTOxphfM3lPl1D3CK8A2i0MqW1lPXS0ySIZ3vU+ 6+6sFqYSrHxZkS5KRSFNvSTp6SXobHqXIO+xzg8RAgj/+y6zPS0LkakIepVQjY20/CdD /86Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440769; x=1697045569; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MGJIXDRJu9nRlkvT0HuUW6wiDMZ2EXW42Fkcow2Wmmc=; b=Jh4bNjJD0daXZ4yFAaN5jv7/IaM1Nf5OsSwbKLk9DhNVju3aod73l8Senu1cl+bov4 vYX4gihlUw7fPElzsxU+YwYMASKWHkoGaGhoUz0sPKLE0n9aARm3WdTmtXy987sTmJU0 ruGuY9E4PA+Ze7tbSaWr32K4zHZymfWasQduUjW0/nVwdah+j6Snk/X0YOv0wX6f+TYR oVarfAz5dfm0d+VKLWKX7+p8j9HR+0MmXKt9A7bPcWjpX9tAyzE+Gx6ceZUAI7DRdYfN Os/bu/H+voR/Z//PZWZ97ixyD50soLQOgJ1uM5zVabYsAk0nYUgUE9yF1ejn+/LMd8/W GYIA== X-Gm-Message-State: AOJu0YyUA7Bfvig4uMiTXhn+7YLR5km45NUskEDCdNZ0vrQyhVz+SZP4 4vb8OJyJ4JTwSMrZdtYpHkSxyd7pXCvpkpzWklc= X-Google-Smtp-Source: AGHT+IEbkOhMaEJy/rCsBI/FeDf+daJgpixyA4ZYMBpatjF919qpdEZDy8miCs2E+T3QGJpDEQrG9g== X-Received: by 2002:a1c:4c13:0:b0:406:7d74:a29b with SMTP id z19-20020a1c4c13000000b004067d74a29bmr2907167wmf.13.1696440769157; Wed, 04 Oct 2023 10:32:49 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Richard Henderson , David Hildenbrand , Ilya Leoshkevich , Thomas Huth Subject: [PATCH 07/21] qapi: Inline QERR_INVALID_PARAMETER_TYPE definition (constant param) Date: Wed, 4 Oct 2023 19:31:42 +0200 Message-ID: <20231004173158.42591-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696441191757100003 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 the following coccinelle semantic patch: @match@ expression errp; constant param; constant value; @@ error_setg(errp, QERR_INVALID_PARAMETER_TYPE, param, value); @script:python strformat depends on match@ param << match.param; value << match.value; fixedfmt; // new var @@ fixedfmt =3D f'"Invalid parameter type for \'{param[1:-1]}\', expected:= {value[1:-1]}"' coccinelle.fixedfmt =3D cocci.make_ident(fixedfmt) @replace@ expression match.errp; constant match.param; constant match.value; identifier strformat.fixedfmt; @@ - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, param, value); + error_setg(errp, fixedfmt); Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Thomas Huth --- target/arm/arm-qmp-cmds.c | 3 ++- target/s390x/cpu_models_sysemu.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c index b53d5efe13..3c99fd8222 100644 --- a/target/arm/arm-qmp-cmds.c +++ b/target/arm/arm-qmp-cmds.c @@ -154,7 +154,8 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(Cp= uModelExpansionType type, if (model->props) { qdict_in =3D qobject_to(QDict, model->props); if (!qdict_in) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, "props", "dict"); + error_setg(errp, + "Invalid parameter type for 'props', expected: dict= "); return NULL; } } diff --git a/target/s390x/cpu_models_sysemu.c b/target/s390x/cpu_models_sys= emu.c index 63981bf36b..4507714493 100644 --- a/target/s390x/cpu_models_sysemu.c +++ b/target/s390x/cpu_models_sysemu.c @@ -111,7 +111,8 @@ static void cpu_model_from_info(S390CPUModel *model, co= nst CpuModelInfo *info, if (info->props) { qdict =3D qobject_to(QDict, info->props); if (!qdict) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, "props", "dict"); + error_setg(errp, + "Invalid parameter type for 'props', expected: dict= "); return; } } --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696440977; cv=none; d=zohomail.com; s=zohoarc; b=TYOc3Iz9RcWMAtLnrFtd/egOklTWGXwqaz7qxeqYcwwkz4z7b1aAnY1udsdgtB5p/d5Z/OBY/6eMgj59OHTvm3VvQGE04yMlnZ/xOdzV+peQW96KBAkZeitePaI6p5rUmI8iMOCZFVc3X5+4qB6m5I6+5cwAZMrfv5n7MOE7Wq0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696440977; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UnezdLBVjvZnCdXX1V4kutiq/Z6kzmSrGXxXnwF1wNc=; b=oFmx1NwjtoeP5WgpWdAtJuIm3OgcCLtPyc8CAa+DVNE7Jk9Le8J0yc2OuYgPNwXLeup2wG+7Y+7Vs5Gf94kemQbdeZZqjjh4DVhN5G+FZ2CiSltSOUW4zswhBv9u0D1hjM1340liLrABX4vl8IF/mTV1rX7cPd2oEc4N7u5bzSs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696440977101673.4988567720118; Wed, 4 Oct 2023 10:36:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5kC-0003g4-1S; Wed, 04 Oct 2023 13:33:08 -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 1qo5kA-0003fS-88 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:06 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5k2-000145-Kb for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:05 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-32320381a07so124465f8f.0 for ; Wed, 04 Oct 2023 10:32:57 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id da4-20020a056000196400b003279518f51dsm4540235wrb.2.2023.10.04.10.32.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440776; x=1697045576; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UnezdLBVjvZnCdXX1V4kutiq/Z6kzmSrGXxXnwF1wNc=; b=sg+KkrzBZvXNnOdTztj47iSk9z4Dgm9B+9T1GXmei67Cv3nxjpkmI073fVUQthxCOG q0a9UEnV03XAayvjbuGrDOQOZ4cSDwo3HU0zE74/7Ppyv27ortP0eLBj21WbCaPid5Ew WclSn8SX0FyZ60NPExSsFenIfykTC7PB08lGGux/rR3X4ZMcmauxV4PBg5i7HmR1U+Ec Yksd/qShqkdx2H6S7VFq8sU3jNhLhVcDzWauddlD/Hr/uQJ4W0nCXAtie7qj2J3r+P+5 K5L9ntTSvusLHZlE4NNMJJgvegp8ggedUnyYsqakeWcVB1UwYBIp5oqe3iuwYpq7DACG RK+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440776; x=1697045576; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UnezdLBVjvZnCdXX1V4kutiq/Z6kzmSrGXxXnwF1wNc=; b=CN/eBiCPfEQ8atkJvaK9rHFTQEod6F/hbkcGg9RfOEb38oTBTur3uBJcqnv9RnjWNz bPmjt/QhxY/MnoaLJfaCFBJ9GtomkEeNl924W/xwG8AoZlPuU3I9s/jWkkvmgifCmjCc FY9zmULk6w2cSKpUaZ4GEkROj7WqNbNSykNohIaCi5WDnv4uODIRv9ULCpL4Rk4PQIVn RSSKzpZl6fncHG7IDwQgDWKzrFsnjKtJbuu/Lv6dcsLuN+7aM9JOkOgNveWzlDuJiUgn ihJH5anR5dCU3VskngIliXxMfnSXcDaqMVh+7j1M84dxQB26hs8arZZMaZ79sZEafITu LsLg== X-Gm-Message-State: AOJu0YzQj48HchaN5zY59/t+1ylC61Mkq+pQ3XzI31lsxW+ZtZUsFN80 c6WW0jeiWkiZqQ+sWknhUbyIkhlBIiGA3LSPn88= X-Google-Smtp-Source: AGHT+IELE6UxM3C0QwmfbPNDdnY4wg5bsbXWLEOQlIG4VlLZUeENYkfg07iNRRwrOOZ+lB0vGSA0xw== X-Received: by 2002:adf:f407:0:b0:323:2d1b:eaf6 with SMTP id g7-20020adff407000000b003232d1beaf6mr2866207wro.67.1696440775855; Wed, 04 Oct 2023 10:32:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Roth , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH 08/21] qapi: Inline QERR_INVALID_PARAMETER_TYPE definition (constant value) Date: Wed, 4 Oct 2023 19:31:43 +0200 Message-ID: <20231004173158.42591-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696440978273100001 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 the following coccinelle semantic patch: @match@ expression errp; expression param; constant value; @@ error_setg(errp, QERR_INVALID_PARAMETER_TYPE, param, value); @script:python strformat depends on match@ value << match.value; fixedfmt; // new var @@ fixedfmt =3D f'"Invalid parameter type for \'%s\', expected: {value[1:-= 1]}"' coccinelle.fixedfmt =3D cocci.make_ident(fixedfmt) @replace@ expression match.errp; expression match.param; constant match.value; identifier strformat.fixedfmt; @@ - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, param, value); + error_setg(errp, fixedfmt, param); Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- qapi/qobject-input-visitor.c | 32 ++++++++++++++++---------------- qapi/string-input-visitor.c | 8 ++++---- qom/object.c | 12 ++++++++---- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c index 3e8aca6b15..f110a804b2 100644 --- a/qapi/qobject-input-visitor.c +++ b/qapi/qobject-input-visitor.c @@ -288,8 +288,8 @@ static bool qobject_input_start_struct(Visitor *v, cons= t char *name, void **obj, return false; } if (qobject_type(qobj) !=3D QTYPE_QDICT) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, - full_name(qiv, name), "object"); + error_setg(errp, "Invalid parameter type for '%s', expected: objec= t", + full_name(qiv, name)); return false; } =20 @@ -326,8 +326,8 @@ static bool qobject_input_start_list(Visitor *v, const = char *name, return false; } if (qobject_type(qobj) !=3D QTYPE_QLIST) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, - full_name(qiv, name), "array"); + error_setg(errp, "Invalid parameter type for '%s', expected: array= ", + full_name(qiv, name)); return false; } =20 @@ -405,8 +405,8 @@ static bool qobject_input_type_int64(Visitor *v, const = char *name, int64_t *obj, } qnum =3D qobject_to(QNum, qobj); if (!qnum || !qnum_get_try_int(qnum, obj)) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, - full_name(qiv, name), "integer"); + error_setg(errp, "Invalid parameter type for '%s', expected: integ= er", + full_name(qiv, name)); return false; } return true; @@ -494,8 +494,8 @@ static bool qobject_input_type_bool(Visitor *v, const c= har *name, bool *obj, } qbool =3D qobject_to(QBool, qobj); if (!qbool) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, - full_name(qiv, name), "boolean"); + error_setg(errp, "Invalid parameter type for '%s', expected: boole= an", + full_name(qiv, name)); return false; } =20 @@ -534,8 +534,8 @@ static bool qobject_input_type_str(Visitor *v, const ch= ar *name, char **obj, } qstr =3D qobject_to(QString, qobj); if (!qstr) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, - full_name(qiv, name), "string"); + error_setg(errp, "Invalid parameter type for '%s', expected: strin= g", + full_name(qiv, name)); return false; } =20 @@ -565,8 +565,8 @@ static bool qobject_input_type_number(Visitor *v, const= char *name, double *obj, } qnum =3D qobject_to(QNum, qobj); if (!qnum) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, - full_name(qiv, name), "number"); + error_setg(errp, "Invalid parameter type for '%s', expected: numbe= r", + full_name(qiv, name)); return false; } =20 @@ -587,8 +587,8 @@ static bool qobject_input_type_number_keyval(Visitor *v= , const char *name, =20 if (qemu_strtod_finite(str, NULL, &val)) { /* TODO report -ERANGE more nicely */ - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, - full_name(qiv, name), "number"); + error_setg(errp, "Invalid parameter type for '%s', expected: numbe= r", + full_name(qiv, name)); return false; } =20 @@ -623,8 +623,8 @@ static bool qobject_input_type_null(Visitor *v, const c= har *name, } =20 if (qobject_type(qobj) !=3D QTYPE_QNULL) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, - full_name(qiv, name), "null"); + error_setg(errp, "Invalid parameter type for '%s', expected: null", + full_name(qiv, name)); return false; } *obj =3D qnull(); diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c index 197139c1c0..3f1b9e9b41 100644 --- a/qapi/string-input-visitor.c +++ b/qapi/string-input-visitor.c @@ -353,8 +353,8 @@ static bool parse_type_number(Visitor *v, const char *n= ame, double *obj, =20 assert(siv->lm =3D=3D LM_NONE); if (qemu_strtod_finite(siv->string, NULL, &val)) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", - "number"); + error_setg(errp, "Invalid parameter type for '%s', expected: numbe= r", + name ? name : "null"); return false; } =20 @@ -371,8 +371,8 @@ static bool parse_type_null(Visitor *v, const char *nam= e, QNull **obj, *obj =3D NULL; =20 if (siv->string[0]) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", - "null"); + error_setg(errp, "Invalid parameter type for '%s', expected: null", + name ? name : "null"); return false; } =20 diff --git a/qom/object.c b/qom/object.c index e25f1e96db..890fa0a106 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1443,7 +1443,8 @@ char *object_property_get_str(Object *obj, const char= *name, } qstring =3D qobject_to(QString, ret); if (!qstring) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, "string"); + error_setg(errp, "Invalid parameter type for '%s', expected: strin= g", + name); retval =3D NULL; } else { retval =3D g_strdup(qstring_get_str(qstring)); @@ -1504,7 +1505,8 @@ bool object_property_get_bool(Object *obj, const char= *name, } qbool =3D qobject_to(QBool, ret); if (!qbool) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, "boolean"); + error_setg(errp, "Invalid parameter type for '%s', expected: boole= an", + name); retval =3D false; } else { retval =3D qbool_get_bool(qbool); @@ -1537,7 +1539,8 @@ int64_t object_property_get_int(Object *obj, const ch= ar *name, =20 qnum =3D qobject_to(QNum, ret); if (!qnum || !qnum_get_try_int(qnum, &retval)) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, "int"); + error_setg(errp, "Invalid parameter type for '%s', expected: int", + name); retval =3D -1; } =20 @@ -1606,7 +1609,8 @@ uint64_t object_property_get_uint(Object *obj, const = char *name, } qnum =3D qobject_to(QNum, ret); if (!qnum || !qnum_get_try_uint(qnum, &retval)) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, "uint"); + error_setg(errp, "Invalid parameter type for '%s', expected: uint", + name); retval =3D 0; } =20 --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696440991; cv=none; d=zohomail.com; s=zohoarc; b=ch3dMVdnrR0AqgdW82nmXGjtKcVkJ9yog4B4vvubPaM0zRRdCuifWutzFkZKSLl5w3aB6TqmFXt/fltbCQvUXtJ3UNLWqqK8Q/EgHjqokSLREapyQ13r/YycKGoBzrSmEy/N2oYkC8OSU09HUbOc8sVtlQ2NBaMGgj9wBCXpiLA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696440991; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1Q3iLFdosYlx+ShI5rJfNC7P4KhR6Nf8wUwiWyt6XeA=; b=JiaSmPI59FSvHZ4we0Z6pO0Zop371GdPwGG98MnJijXkMIQpcm6yFlTC5bEG9BVeOjN17xgx3Nex38ff5kTN0FHbzO/ZL26mMHQwOFv1jiKp3lyIZKbcMNjK+245QvRs75QKHXJgG2M8+85uqWwHLGhSz44D1SrXpKL9/cXoCfs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696440991709101.36097342108803; Wed, 4 Oct 2023 10:36:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5kP-0003tr-7X; Wed, 04 Oct 2023 13:33:21 -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 1qo5kM-0003p5-Kr for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:18 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5k9-00015u-3A for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:18 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-406650da82bso350285e9.3 for ; Wed, 04 Oct 2023 10:33:04 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id y8-20020a7bcd88000000b00406447b798bsm2019756wmj.37.2023.10.04.10.33.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:33:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440782; x=1697045582; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1Q3iLFdosYlx+ShI5rJfNC7P4KhR6Nf8wUwiWyt6XeA=; b=mrkIyXsd96vun4GqJrNv+VAFXfyTkJQXWTMWmlMYS8IXp26iwyqCA8qMQkqPLKI8+7 YWe2QH2TUowUsDtBaXIK5ZQ0kyRsU69E7WwToDf4jSia/0Bakii026UIWreLplhk/Smw gKCRT8/nluL+C85bOqvO+1kPIaVRBdbDHIknCa8fDqLpbYBURw65aaY0PkiWGu/PA2vE dTN3ZqSF7scxpnoPnUwMRky67qz7vxYNKBqNjk4UbnOBB/k1pTFcMVmxMqfoxh/ib8to Aear/9zYCHdBT/XCyIVnIcf2P77GhJEQUe2YTQjllIErO0owXGzr602OHPObpRan73uo NUEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440782; x=1697045582; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1Q3iLFdosYlx+ShI5rJfNC7P4KhR6Nf8wUwiWyt6XeA=; b=ObCUYEVjBsdynwis+KS6yn6K686tAvakv6hA07jY5zUSdDwGVUcjZrVu2x+NS+RZJm 4FEvSv2FvN122ZHi4D2HsM6YWfXZLi9Yh/On/zmdOxrHBS5R1O48nbsQBVePcL1WCUSr gWbGR8/dCpPy3LlVk7fQ/cD9cmgUaLc39Eu69etfsyk9UgezCx7Rzrt+BWqiTxoHC2R2 0A5ONNpM6mbjW/A1DQL6qCPtMQhbXlmEoMjQ/fMNq8GYQoXp1Ke3TnLDSOMINaG2AXfV o+IOEXbpUR6s8AI0J4AJl/sJpD4ELcmM0E6x3NNBTNV6LfLvYHxqqMjqCaTCu9RKF2uP RgMA== X-Gm-Message-State: AOJu0YzW1zpT63sz9vLIs7GZ2SdBm2QJ4wov6J/shHW6d6LxlEZ9y4h6 Z5QWm9S9ol4Sd2c7wVf4drYfle3S4jGUawepvyA= X-Google-Smtp-Source: AGHT+IGvZDNwGACwFiZQ/XjfJF+hOV32cWd+gJhvaNKHCq3cykMs47gMHslp071MMtVKDqnVN7u7LQ== X-Received: by 2002:adf:fec4:0:b0:31f:f9fb:d5bd with SMTP id q4-20020adffec4000000b0031ff9fbd5bdmr3006135wrs.68.1696440782655; Wed, 04 Oct 2023 10:33:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Michael Roth Subject: [PATCH 09/21] qapi: Inline and remove QERR_INVALID_PARAMETER_TYPE definition Date: Wed, 4 Oct 2023 19:31:44 +0200 Message-ID: <20231004173158.42591-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696440992513100007 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! */ Manual changes (escaping the format in qapi/visit.py). Remove the definition in include/qapi/qmp/qerror.h. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qapi/qmp/qerror.h | 3 --- qom/object.c | 3 ++- scripts/qapi/visit.py | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 63ab775dc5..b723830eff 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,9 +17,6 @@ * add new ones! */ =20 -#define QERR_INVALID_PARAMETER_TYPE \ - "Invalid parameter type for '%s', expected: %s" - #define QERR_INVALID_PARAMETER_VALUE \ "Parameter '%s' expects %s" =20 diff --git a/qom/object.c b/qom/object.c index 890fa0a106..eea61a5068 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1855,7 +1855,8 @@ static Object *object_resolve_link(Object *obj, const= char *name, } else if (!target) { target =3D object_resolve_path(path, &ambiguous); if (target || ambiguous) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, target_typ= e); + error_setg(errp, "Invalid parameter type for '%s', expected: %= s", + name, target_type); } else { error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found", path); diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py index c56ea4d724..4b4a442383 100644 --- a/scripts/qapi/visit.py +++ b/scripts/qapi/visit.py @@ -278,8 +278,8 @@ def gen_visit_alternate(name: str, variants: QAPISchema= Variants) -> str: abort(); default: assert(visit_is_input(v)); - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", - "%(name)s"); + error_setg(errp, "Invalid parameter type for '%%s', expected: %(na= me)s", + name ? name : "null"); /* Avoid passing invalid *obj to qapi_free_%(c_name)s() */ g_free(*obj); *obj =3D NULL; --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696441257; cv=none; d=zohomail.com; s=zohoarc; b=ZvOVTVgKDq8vXlG1mm5uiJOK/YAv5BssD4qhRlpw4Vta9RHHLZc3raLTaDRKFiLkdv5r6xD85hpmRHB9zXIGzXbuRb8sqjTSO3cg++qH5I8qTXdlUiomiqHSBL/okXX1ygH0CjXRVQC3KiRpMA8ihLlUHRSi2NNrFcZZP4PBPQ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696441257; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=oTU3cmOgWwF4B3e85DxyA+pTw6zzh/7R2AsxZx8iffs=; b=BvPAgogTOeQaEV+am+4WQFz+qVeVvDFRtyel1SLtdfm+MOIKCqe+SG+56BCoJ1CJp08pAcrseaBm/B6kf3O1vS3BW6XPqfL3kubyCuQSYeoOp2IE3Rgqrf0Zx8tbyvFEIVMiqFZiWBlP3zU6JmxPpHld+iJm259PSpTQcrB1mJc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16964412570701005.5085086197136; Wed, 4 Oct 2023 10:40:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5kL-0003oF-FA; Wed, 04 Oct 2023 13:33:17 -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 1qo5kJ-0003lg-Uc for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:15 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5kH-00018Z-2n for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:15 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40566f89f6eso367705e9.3 for ; Wed, 04 Oct 2023 10:33:12 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id k16-20020a05600c0b5000b00403bbe69629sm2027908wmr.31.2023.10.04.10.33.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:33:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440791; x=1697045591; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oTU3cmOgWwF4B3e85DxyA+pTw6zzh/7R2AsxZx8iffs=; b=ivLgSoVjyzH9UO3HaN0vGn5W2OkUEK7FCmCVBDcbr5Rlu8sf7rz15tLPkeuef63CNy pi3OLiD2DDBI+FrVmuwgcdoRIfwFPNFnLMvYKuPDk1byIOyQPgnlTWzEpja0zpfGQQI8 ONle4je+QScxAKcWoLJquv5L0BNQPzoPhI1ENmFAFzlfW6IQlFSQkCIuk0wrCLnCmvPX 9J8a6rIn7oyobNLzM+IJQZEAWdrkzhKN6poHbiDW35h09e8qJkInvhUksXjqZ6zrnxB9 WvjkzkNumataLgxWMS3m4XaP3WvBd/QZYKPshlOZspD/txolDvhGfR6C6Y0R03LA8l81 8X4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440791; x=1697045591; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oTU3cmOgWwF4B3e85DxyA+pTw6zzh/7R2AsxZx8iffs=; b=e/GSHt9SaQnpdzaHAeYRfxhxMi00IVKx+M4wqGRn87QEYG6A/51bVkcBa47jqLLto6 TVonU+FGi90BjNOdGvCddONZ0M/JNxk/G6My4TdHnkyIuA1zY9sj8gqdh5qHCKeAv6YQ mP2i+AcaDC/8o/TkaujQ1TxRWlseGI8HSugs/hQiG9YCcpVsi4hBoLrCFtL3zFz0FJnw I+kDJcj4l7cvT6AbhM8JSAJ9Um1DxP1c/wawbTO4j0eeRtevd5JQt0Dh7YSrSABZf33W QFTjzdSYTHNS2MW/t0BrE64x8Vm1Iz+iJWQK/4syi3Gi+GeY9j2ellOU7CMHdRZJvdWQ V1Rw== X-Gm-Message-State: AOJu0YxO9ObsbxhNySSPqwx+yH0q0fyErKW+FQ4PQRFGUDt9XpJ5nsJP eGD5ERGzkhQGq+VFaLxftQq3RKr8EdQRN0IiDI0= X-Google-Smtp-Source: AGHT+IEzqUkpLmHKwCi0bPBWFoLo/UvwAus+SRKpNTfAoOtjFfiGlqwmpY1py48hRB/ZfRSJLUBFyA== X-Received: by 2002:a05:600c:244:b0:401:c944:a4d6 with SMTP id 4-20020a05600c024400b00401c944a4d6mr2997837wmj.28.1696440791374; Wed, 04 Oct 2023 10:33:11 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Gonglei (Arei)" , Zhenwei Pi , Laurent Vivier , Amit Shah , Alberto Garcia , Kevin Wolf , Hanna Reitz , John Snow , Vladimir Sementsov-Ogievskiy , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Gerd Hoffmann , Juan Quintela , Peter Xu , Leonardo Bras , Jason Wang , Konstantin Kostiuk , Michael Roth , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , "Michael S. Tsirkin" , David Hildenbrand , Richard Henderson Subject: [PATCH 10/21] qapi: Inline QERR_INVALID_PARAMETER_VALUE definition (constant value) Date: Wed, 4 Oct 2023 19:31:45 +0200 Message-ID: <20231004173158.42591-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696441257718100001 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 the following coccinelle semantic patch: @match@ expression errp; constant param; constant value; @@ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, param, value); @script:python strformat depends on match@ param << match.param; value << match.value; fixedfmt; // new var @@ fixedfmt =3D "\"Parameter '%s' expects %s\"" % (param[1:-1], value[1:-1= ]) coccinelle.fixedfmt =3D cocci.make_ident(fixedfmt) @replace@ expression match.errp; constant match.param; constant match.value; identifier strformat.fixedfmt; @@ - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, param, value); + error_setg(errp, fixedfmt); Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Juan Quintela --- backends/cryptodev-vhost-user.c | 4 +- backends/rng-egd.c | 4 +- backends/rng-random.c | 3 +- block/quorum.c | 3 +- blockdev.c | 9 ++-- blockjob.c | 3 +- chardev/char.c | 3 +- hw/usb/redirect.c | 4 +- migration/migration.c | 4 +- migration/options.c | 94 +++++++++++++-------------------- migration/page_cache.c | 8 +-- migration/ram.c | 4 +- monitor/fds.c | 8 +-- monitor/qmp-cmds.c | 3 +- net/filter-buffer.c | 3 +- net/filter.c | 7 ++- net/net.c | 9 ++-- qga/commands-win32.c | 4 +- qom/object_interfaces.c | 2 +- qom/qom-qmp-cmds.c | 7 ++- softmmu/balloon.c | 2 +- softmmu/cpus.c | 3 +- softmmu/qdev-monitor.c | 11 ++-- ui/ui-qmp-cmds.c | 2 +- util/qemu-option.c | 3 +- 25 files changed, 88 insertions(+), 119 deletions(-) diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-use= r.c index c3283ba84a..d93ccd5528 100644 --- a/backends/cryptodev-vhost-user.c +++ b/backends/cryptodev-vhost-user.c @@ -136,8 +136,8 @@ cryptodev_vhost_claim_chardev(CryptoDevBackendVhostUser= *s, Chardev *chr; =20 if (s->chr_name =3D=3D NULL) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "chardev", "a valid character device"); + error_setg(errp, + "Parameter 'chardev' expects a valid character device"); return NULL; } =20 diff --git a/backends/rng-egd.c b/backends/rng-egd.c index 684c3cf3d6..8f101afadc 100644 --- a/backends/rng-egd.c +++ b/backends/rng-egd.c @@ -90,8 +90,8 @@ static void rng_egd_opened(RngBackend *b, Error **errp) Chardev *chr; =20 if (s->chr_name =3D=3D NULL) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "chardev", "a valid character device"); + error_setg(errp, + "Parameter 'chardev' expects a valid character device"); return; } =20 diff --git a/backends/rng-random.c b/backends/rng-random.c index 80eb5be138..9cb7d26cb5 100644 --- a/backends/rng-random.c +++ b/backends/rng-random.c @@ -72,8 +72,7 @@ static void rng_random_opened(RngBackend *b, Error **errp) RngRandom *s =3D RNG_RANDOM(b); =20 if (s->filename =3D=3D NULL) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "filename", "a valid filename"); + error_setg(errp, "Parameter 'filename' expects a valid filename"); } else { s->fd =3D qemu_open_old(s->filename, O_RDONLY | O_NONBLOCK); if (s->fd =3D=3D -1) { diff --git a/block/quorum.c b/block/quorum.c index 05220cab7f..8e9f279568 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -882,8 +882,7 @@ static int quorum_valid_threshold(int threshold, int nu= m_children, Error **errp) { =20 if (threshold < 1) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "vote-threshold", "a value >=3D 1"); + error_setg(errp, "Parameter 'vote-threshold' expects a value >=3D = 1"); return -ERANGE; } =20 diff --git a/blockdev.c b/blockdev.c index da39da457e..ed90365329 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2340,7 +2340,7 @@ void coroutine_fn qmp_block_resize(const char *device= , const char *node_name, } =20 if (size < 0) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "size", "a >0 size"= ); + error_setg(errp, "Parameter 'size' expects a >0 size"); return; } =20 @@ -2905,13 +2905,12 @@ static void blockdev_mirror_common(const char *job_= id, BlockDriverState *bs, } =20 if (granularity !=3D 0 && (granularity < 512 || granularity > 1048576 = * 64)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "granularity", - "a value in range [512B, 64MB]"); + error_setg(errp, + "Parameter 'granularity' expects a value in range [512B= , 64MB]"); return; } if (granularity & (granularity - 1)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "granularity", - "a power of 2"); + error_setg(errp, "Parameter 'granularity' expects a power of 2"); return; } =20 diff --git a/blockjob.c b/blockjob.c index 58c5d64539..f95f73244e 100644 --- a/blockjob.c +++ b/blockjob.c @@ -297,8 +297,7 @@ bool block_job_set_speed_locked(BlockJob *job, int64_t = speed, Error **errp) return false; } if (speed < 0) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "speed", - "a non-negative value"); + error_setg(errp, "Parameter 'speed' expects a non-negative value"); return false; } =20 diff --git a/chardev/char.c b/chardev/char.c index 996a024c7a..447b4d9d06 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -517,8 +517,7 @@ static const ChardevClass *char_get_class(const char *d= river, Error **errp) } =20 if (object_class_is_abstract(oc)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "driver", - "an abstract device type"); + error_setg(errp, "Parameter 'driver' expects an abstract device ty= pe"); return NULL; } =20 diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index c9893df867..ac6fa34ad1 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -1435,8 +1435,8 @@ static void usbredir_realize(USBDevice *udev, Error *= *errp) &dev->filter_rules, &dev->filter_rules_count); if (i) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "filter", - "a usb device filter string"); + error_setg(errp, + "Parameter 'filter' expects a usb device filter str= ing"); return; } } diff --git a/migration/migration.c b/migration/migration.c index 6d3cf5d5cd..b7f6818a15 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1703,8 +1703,8 @@ void qmp_migrate(const char *uri, bool has_blk, bool = blk, } else if (strstart(uri, "fd:", &p)) { fd_start_outgoing_migration(s, p, &local_err); } else { - error_setg(&local_err, QERR_INVALID_PARAMETER_VALUE, "uri", - "a valid migration protocol"); + error_setg(&local_err, + "Parameter 'uri' expects a valid migration protocol"); migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, MIGRATION_STATUS_FAILED); block_cleanup_parameters(); diff --git a/migration/options.c b/migration/options.c index 1d1e1321b0..3a2180b779 100644 --- a/migration/options.c +++ b/migration/options.c @@ -1002,137 +1002,121 @@ bool migrate_params_check(MigrationParameters *pa= rams, Error **errp) { if (params->has_compress_level && (params->compress_level > 9)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "compress_level", - "a value between 0 and 9"); + error_setg(errp, + "Parameter 'compress_level' expects a value between 0 a= nd 9"); return false; } =20 if (params->has_compress_threads && (params->compress_threads < 1)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "compress_threads", - "a value between 1 and 255"); + error_setg(errp, + "Parameter 'compress_threads' expects a value between 1= and 255"); return false; } =20 if (params->has_decompress_threads && (params->decompress_threads < 1)= ) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "decompress_threads", - "a value between 1 and 255"); + error_setg(errp, + "Parameter 'decompress_threads' expects a value between= 1 and 255"); return false; } =20 if (params->has_throttle_trigger_threshold && (params->throttle_trigger_threshold < 1 || params->throttle_trigger_threshold > 100)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "throttle_trigger_threshold", - "an integer in the range of 1 to 100"); + error_setg(errp, + "Parameter 'throttle_trigger_threshold' expects an inte= ger in the range of 1 to 100"); return false; } =20 if (params->has_cpu_throttle_initial && (params->cpu_throttle_initial < 1 || params->cpu_throttle_initial > 99)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "cpu_throttle_initial", - "an integer in the range of 1 to 99"); + error_setg(errp, + "Parameter 'cpu_throttle_initial' expects an integer in= the range of 1 to 99"); return false; } =20 if (params->has_cpu_throttle_increment && (params->cpu_throttle_increment < 1 || params->cpu_throttle_increment > 99)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "cpu_throttle_increment", - "an integer in the range of 1 to 99"); + error_setg(errp, + "Parameter 'cpu_throttle_increment' expects an integer = in the range of 1 to 99"); return false; } =20 if (params->has_max_bandwidth && (params->max_bandwidth > SIZE_MAX)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "max_bandwidth", - "an integer in the range of 0 to "stringify(SIZE_MAX) - " bytes/second"); + error_setg(errp,"Parameter 'max_bandwidth' expects an integer in t= he range of 0 to " stringify ( SIZE_MAX )=20 + " bytes/second"); return false; } =20 if (params->has_downtime_limit && (params->downtime_limit > MAX_MIGRATE_DOWNTIME)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "downtime_limit", - "an integer in the range of 0 to " - stringify(MAX_MIGRATE_DOWNTIME)" ms"); + error_setg(errp, + "Parameter 'downtime_limit' expects an integer in the r= ange of 0 to " stringify ( MAX_MIGRATE_DOWNTIME ) " ms"); return false; } =20 /* x_checkpoint_delay is now always positive */ =20 if (params->has_multifd_channels && (params->multifd_channels < 1)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "multifd_channels", - "a value between 1 and 255"); + error_setg(errp, + "Parameter 'multifd_channels' expects a value between 1= and 255"); return false; } =20 if (params->has_multifd_zlib_level && (params->multifd_zlib_level > 9)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "multifd_zlib_level= ", - "a value between 0 and 9"); + error_setg(errp, + "Parameter 'multifd_zlib_level' expects a value between= 0 and 9"); return false; } =20 if (params->has_multifd_zstd_level && (params->multifd_zstd_level > 20)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "multifd_zstd_level= ", - "a value between 0 and 20"); + error_setg(errp, + "Parameter 'multifd_zstd_level' expects a value between= 0 and 20"); return false; } =20 if (params->has_xbzrle_cache_size && (params->xbzrle_cache_size < qemu_target_page_size() || !is_power_of_2(params->xbzrle_cache_size))) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "xbzrle_cache_size", - "a power of two no less than the target page size"); + error_setg(errp, + "Parameter 'xbzrle_cache_size' expects a power of two n= o less than the target page size"); return false; } =20 if (params->has_max_cpu_throttle && (params->max_cpu_throttle < params->cpu_throttle_initial || params->max_cpu_throttle > 99)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "max_cpu_throttle", - "an integer in the range of cpu_throttle_initial to 99"= ); + error_setg(errp, + "Parameter 'max_cpu_throttle' expects an integer in the= range of cpu_throttle_initial to 99"); return false; } =20 if (params->has_announce_initial && params->announce_initial > 100000) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "announce_initial", - "a value between 0 and 100000"); + error_setg(errp, + "Parameter 'announce_initial' expects a value between 0= and 100000"); return false; } if (params->has_announce_max && params->announce_max > 100000) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "announce_max", - "a value between 0 and 100000"); + error_setg(errp, + "Parameter 'announce_max' expects a value between 0 and= 100000"); return false; } if (params->has_announce_rounds && params->announce_rounds > 1000) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "announce_rounds", - "a value between 0 and 1000"); + error_setg(errp, + "Parameter 'announce_rounds' expects a value between 0 = and 1000"); return false; } if (params->has_announce_step && (params->announce_step < 1 || params->announce_step > 10000)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "announce_step", - "a value between 0 and 10000"); + error_setg(errp, + "Parameter 'announce_step' expects a value between 0 an= d 10000"); return false; } =20 @@ -1155,17 +1139,15 @@ bool migrate_params_check(MigrationParameters *para= ms, Error **errp) if (params->has_x_vcpu_dirty_limit_period && (params->x_vcpu_dirty_limit_period < 1 || params->x_vcpu_dirty_limit_period > 1000)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "x-vcpu-dirty-limit-period", - "a value between 1 and 1000"); + error_setg(errp, + "Parameter 'x-vcpu-dirty-limit-period' expects a value = between 1 and 1000"); return false; } =20 if (params->has_vcpu_dirty_limit && (params->vcpu_dirty_limit < 1)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "vcpu_dirty_limit", - "is invalid, it must greater then 1 MB/s"); + error_setg(errp, + "Parameter 'vcpu_dirty_limit' expects is invalid, it mu= st greater then 1 MB/s"); return false; } =20 diff --git a/migration/page_cache.c b/migration/page_cache.c index 6d4f7a9bbc..d430ce742b 100644 --- a/migration/page_cache.c +++ b/migration/page_cache.c @@ -45,15 +45,15 @@ PageCache *cache_init(uint64_t new_size, size_t page_si= ze, Error **errp) PageCache *cache; =20 if (new_size < page_size) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size", - "is smaller than one target page size"); + error_setg(errp, + "Parameter 'cache size' expects is smaller than one tar= get page size"); return NULL; } =20 /* round down to the nearest power of 2 */ if (!is_power_of_2(num_pages)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size", - "is not a power of two number of pages"); + error_setg(errp, + "Parameter 'cache size' expects is not a power of two n= umber of pages"); return NULL; } =20 diff --git a/migration/ram.c b/migration/ram.c index e4bfd39f08..0a4a0d7a0e 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -165,8 +165,8 @@ int xbzrle_cache_resize(uint64_t new_size, Error **errp) =20 /* Check for truncation */ if (new_size !=3D (size_t)new_size) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cache size", - "exceeding address space"); + error_setg(errp, + "Parameter 'cache size' expects exceeding address space= "); return -1; } =20 diff --git a/monitor/fds.c b/monitor/fds.c index d86c2c674c..17e9c126e3 100644 --- a/monitor/fds.c +++ b/monitor/fds.c @@ -67,8 +67,8 @@ static bool monitor_add_fd(Monitor *mon, int fd, const ch= ar *fdname, Error **err =20 if (qemu_isdigit(fdname[0])) { close(fd); - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "fdname", - "a name not starting with a digit"); + error_setg(errp, + "Parameter 'fdname' expects a name not starting with a = digit"); return false; } =20 @@ -353,8 +353,8 @@ AddfdInfo *monitor_fdset_add_fd(int fd, bool has_fdset_= id, int64_t fdset_id, =20 if (has_fdset_id) { if (fdset_id < 0) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "fdset-id", - "a non-negative value"); + error_setg(errp, + "Parameter 'fdset-id' expects a non-negative va= lue"); return NULL; } /* Use specified fdset ID */ diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index b0f948d337..2d2e71b867 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -173,8 +173,7 @@ char *qmp_human_monitor_command(const char *command_lin= e, bool has_cpu_index, if (has_cpu_index) { int ret =3D monitor_set_cpu(&hmp.common, cpu_index); if (ret < 0) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cpu-index", - "a CPU number"); + error_setg(errp, "Parameter 'cpu-index' expects a CPU number"); goto out; } } diff --git a/net/filter-buffer.c b/net/filter-buffer.c index 283dc9cbe6..071029a6c7 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -121,8 +121,7 @@ static void filter_buffer_setup(NetFilterState *nf, Err= or **errp) * or COLO use this filter to release packets on demand. */ if (!s->interval) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "interval", - "a non-zero interval"); + error_setg(errp, "Parameter 'interval' expects a non-zero interval= "); return; } =20 diff --git a/net/filter.c b/net/filter.c index 3335908771..1621513bab 100644 --- a/net/filter.c +++ b/net/filter.c @@ -232,8 +232,7 @@ static void netfilter_complete(UserCreatable *uc, Error= **errp) NET_CLIENT_DRIVER_NIC, MAX_QUEUE_NUM); if (queues < 1) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "netdev", - "a network backend id"); + error_setg(errp, "Parameter 'netdev' expects a network backend id"= ); return; } else if (queues > 1) { error_setg(errp, "multiqueue is not supported"); @@ -251,8 +250,8 @@ static void netfilter_complete(UserCreatable *uc, Error= **errp) char *position_id; =20 if (!g_str_has_prefix(nf->position, "id=3D")) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "position", - "'head', 'tail' or 'id=3D'"); + error_setg(errp, + "Parameter 'position' expects 'head', 'tail' or 'id= =3D'"); return; } =20 diff --git a/net/net.c b/net/net.c index 1c0bfdaa6c..5cdbd9c218 100644 --- a/net/net.c +++ b/net/net.c @@ -1236,8 +1236,8 @@ static int net_client_init(QemuOpts *opts, bool is_ne= tdev, Error **errp) =20 substrings =3D g_strsplit(ip6_net, "/", 2); if (!substrings || !substrings[0]) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "ipv6-net", - "a valid IPv6 prefix"); + error_setg(errp, + "Parameter 'ipv6-net' expects a valid IPv6 prefix"); goto out; } =20 @@ -1247,8 +1247,7 @@ static int net_client_init(QemuOpts *opts, bool is_ne= tdev, Error **errp) if (substrings[1] && qemu_strtoul(substrings[1], NULL, 10, &prefix_len)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "ipv6-prefixlen", "a number"); + error_setg(errp, "Parameter 'ipv6-prefixlen' expects a number"= ); goto out; } =20 @@ -1283,7 +1282,7 @@ void netdev_add(QemuOpts *opts, Error **errp) void qmp_netdev_add(Netdev *netdev, Error **errp) { if (!id_wellformed(netdev->id)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "id", "an identifie= r"); + error_setg(errp, "Parameter 'id' expects an identifier"); return; } =20 diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 6beae659b7..946dbafbb6 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -328,8 +328,8 @@ void qmp_guest_shutdown(const char *mode, Error **errp) } else if (strcmp(mode, "reboot") =3D=3D 0) { shutdown_flag |=3D EWX_REBOOT; } else { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "mode", - "'halt', 'powerdown', or 'reboot'"); + error_setg(errp, + "Parameter 'mode' expects 'halt', 'powerdown', or 'rebo= ot'"); return; } =20 diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index 7d31589b04..be04b2c5ab 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -84,7 +84,7 @@ Object *user_creatable_add_type(const char *type, const c= har *id, Error *local_err =3D NULL; =20 if (id !=3D NULL && !id_wellformed(id)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "id", "an identifie= r"); + error_setg(errp, "Parameter 'id' expects an identifier"); error_append_hint(errp, "Identifiers consist of letters, digits, " "'-', '.', '_', starting with a letter.\n"); return NULL; diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index 7c087299de..3d014f1bea 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -136,8 +136,8 @@ ObjectPropertyInfoList *qmp_device_list_properties(cons= t char *typename, =20 if (!object_class_dynamic_cast(klass, TYPE_DEVICE) || object_class_is_abstract(klass)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "typename", - "a non-abstract device type"); + error_setg(errp, + "Parameter 'typename' expects a non-abstract device typ= e"); return NULL; } =20 @@ -194,8 +194,7 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const c= har *typename, } =20 if (!object_class_dynamic_cast(klass, TYPE_OBJECT)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "typename", - "a QOM type"); + error_setg(errp, "Parameter 'typename' expects a QOM type"); return NULL; } =20 diff --git a/softmmu/balloon.c b/softmmu/balloon.c index e0e8969a4b..d941c6b9c1 100644 --- a/softmmu/balloon.c +++ b/softmmu/balloon.c @@ -97,7 +97,7 @@ void qmp_balloon(int64_t target, Error **errp) } =20 if (target <=3D 0) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "target", "a size"); + error_setg(errp, "Parameter 'target' expects a size"); return; } =20 diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 0848e0dbdb..7fc70f9166 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -753,8 +753,7 @@ void qmp_memsave(int64_t addr, int64_t size, const char= *filename, =20 cpu =3D qemu_get_cpu(cpu_index); if (cpu =3D=3D NULL) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cpu-index", - "a CPU number"); + error_setg(errp, "Parameter 'cpu-index' expects a CPU number"); return; } =20 diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index a964bd80df..b17aec4357 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -246,16 +246,15 @@ static DeviceClass *qdev_get_device_class(const char = **driver, Error **errp) } =20 if (object_class_is_abstract(oc)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "driver", - "a non-abstract device type"); + error_setg(errp, + "Parameter 'driver' expects a non-abstract device type"= ); return NULL; } =20 dc =3D DEVICE_CLASS(oc); if (!dc->user_creatable || (phase_check(PHASE_MACHINE_READY) && !dc->hotpluggable)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "driver", - "a pluggable device type"); + error_setg(errp, "Parameter 'driver' expects a pluggable device ty= pe"); return NULL; } =20 @@ -263,8 +262,8 @@ static DeviceClass *qdev_get_device_class(const char **= driver, Error **errp) /* sysbus devices need to be allowed by the machine */ MachineClass *mc =3D MACHINE_CLASS(object_get_class(qdev_get_machi= ne())); if (!device_type_is_dynamic_sysbus(mc, *driver)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "driver", - "a dynamic sysbus device type for the machine"); + error_setg(errp, + "Parameter 'driver' expects a dynamic sysbus device= type for the machine"); return NULL; } } diff --git a/ui/ui-qmp-cmds.c b/ui/ui-qmp-cmds.c index 41ca0100e7..a95fd35948 100644 --- a/ui/ui-qmp-cmds.c +++ b/ui/ui-qmp-cmds.c @@ -209,7 +209,7 @@ void qmp_client_migrate_info(const char *protocol, cons= t char *hostname, return; } =20 - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "protocol", "'spice'"); + error_setg(errp, "Parameter 'protocol' expects 'spice'"); } =20 #ifdef CONFIG_PNG diff --git a/util/qemu-option.c b/util/qemu-option.c index 201f7a87f3..62dd80a5ae 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -622,8 +622,7 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const ch= ar *id, } else if (id) { assert(fail_if_exists); if (!id_wellformed(id)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "id", - "an identifier"); + error_setg(errp, "Parameter 'id' expects an identifier"); error_append_hint(errp, "Identifiers consist of letters, digit= s, " "'-', '.', '_', starting with a letter.\n"); return NULL; --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696441396; cv=none; d=zohomail.com; s=zohoarc; b=PA3thF4R8SXLQKX7UIaZaiv7QP9h06qAw3izkw2IkVN4jUhYJ/Z4XaFVV5RB0Si5LLAkdC673qqbO/5qy7y4q6uGG87ToWP5RsM6sc2idvMNiGxHtGDDgpmg2TFSOxS/DhuqYYDqBhp7dNGKT5Wksqi/J4evdFHLHUV6OST6+R8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696441396; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+PTJ/05sHPgcAUDGq2+BZ4afKq7cNyAKTrzR+aRyMME=; b=UaDi5l4RUPsUHsEqE/r8h4slWZdXmnL8mO4FEDFkA84uVdXM2J4LOEmtdr83vl8wNP62WCh0ucsJ68g/v3AZhcs7nWZzlN7oAFLpEwsixk8SiN4/q4rFe0acupGagy4ENMivIvplD3Dc3OU8uQv+Bb1FN9luOkhgQuc3Kn9VdJo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696441396154776.7788228263831; Wed, 4 Oct 2023 10:43:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5kr-0004ho-Qm; Wed, 04 Oct 2023 13:33:49 -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 1qo5kV-0004Gb-Ag for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:28 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5kO-0001AA-1b for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:26 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-405361bb9f7so369075e9.2 for ; Wed, 04 Oct 2023 10:33:19 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id f20-20020a1c6a14000000b00405959bbf4fsm2000368wmc.19.2023.10.04.10.33.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:33:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440798; x=1697045598; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+PTJ/05sHPgcAUDGq2+BZ4afKq7cNyAKTrzR+aRyMME=; b=mvWjUJzcNPREtn226QaWJvZXizjmZYwgSqQ/TNs0fK6w8ixutMvMn1cFg3B92cK22K 0iLPYwrlEK5YlmPUcARlYGfGj1aVfOg6rU5TiUYkYMUw9gBb3/ncZzaf1F5QmU0ciZVn G/v9t/FHf14wIHqbvDHYU8VpaSqFEAFt0nKxn/8plgQelJGD2johb7PJJTMavfDM2qR0 PAM+0Vftfjv9KRjSXr4oIRZEnS2Hy4vkiggD2TE/0HRkewUAV6pETKYgY5zCyzTvZCb5 /ZugiuUNkwz1WN+LU23cu9Gc5eSJ0FiN36WHk7Z8/gzoOXEYlpammn4vM1SzXg7n9hhM T38w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440798; x=1697045598; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+PTJ/05sHPgcAUDGq2+BZ4afKq7cNyAKTrzR+aRyMME=; b=F4aJkKKPAiCm1+iDXk4+Om1ykW0GDhl4xKIXDiqZQdg6Fhyj/ws8CNlw/cEfMgTWS7 jbevPFiSejB8YQw9fPy+woao1yBzU34OzINNjOv18nSnQHaMSBOxUifoMgkexw6gbw4a LBHRCnmMahth+J0V1sio26RpE0yC+y/y5F/SE2rawRJGgalFHxPvPaqdGg6tR2NHqg/b /cyet61jNLzBKOlbmv/bipowxFhIc+hdKKATeTe9YPX/AG8dtxhEUpBTt+WTeRgFHxbT pzlem801yZS6Hrnt1a8e5hvaIrFZBVR2G9qgnFoXkJCFpXzHq631PyXic5xbiBbmNz4q dR4g== X-Gm-Message-State: AOJu0YzzOc2aY71FusOgKI7eFh/5h7zPMl4YE+e1gIA05bQ210E/go/k yG4MWHktpsQyBur2wBNw38m9CbmO6giO8v4TNJQ= X-Google-Smtp-Source: AGHT+IE/j2If/Gbt/uu6G49MkbYtXRXJLnIk2q+N2YvjSnfYB1EQJdeMTX3lxGs4d/rNGGoaqB6pVQ== X-Received: by 2002:a1c:6a0d:0:b0:3fc:1a6:7764 with SMTP id f13-20020a1c6a0d000000b003fc01a67764mr2834064wmc.16.1696440798375; Wed, 04 Oct 2023 10:33:18 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Michael Roth Subject: [PATCH 11/21] qapi: Inline QERR_INVALID_PARAMETER_VALUE definition (constant param) Date: Wed, 4 Oct 2023 19:31:46 +0200 Message-ID: <20231004173158.42591-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696441398244100001 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 the following coccinelle semantic patch: @match@ identifier errp; expression param; // not constant constant value; @@ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, param, value); @script:python strformat depends on match@ param << match.param; value << match.value; fixedfmt; // new var @@ fixedfmt =3D f"\"Parameter '%s' expects {value[1:-1]}\"" coccinelle.fixedfmt =3D cocci.make_ident(fixedfmt) @replace@ identifier match.errp; expression match.param; constant match.value; identifier strformat.fixedfmt; @@ - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, param, value); + error_setg(errp, fixedfmt, param); Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/qdev-properties-system.c | 5 +++-- qapi/opts-visitor.c | 3 +-- qapi/qapi-util.c | 3 +-- qapi/qobject-input-visitor.c | 18 ++++++++---------- qapi/string-input-visitor.c | 18 ++++++++++-------- util/qemu-option.c | 7 ++++--- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 688340610e..7752c5fda5 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -769,8 +769,9 @@ static void set_pci_devfn(Object *obj, Visitor *v, cons= t char *name, return; } if (value < -1 || value > 255) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - name ? name : "null", "a value between -1 and 255"); + error_setg(errp, + "Parameter '%s' expects a value between -1 and 255", + name ? name : "null"); return; } *ptr =3D value; diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c index 3d1a28b419..0393704a73 100644 --- a/qapi/opts-visitor.c +++ b/qapi/opts-visitor.c @@ -515,8 +515,7 @@ opts_type_size(Visitor *v, const char *name, uint64_t *= obj, Error **errp) =20 err =3D qemu_strtosz(opt->str ? opt->str : "", NULL, obj); if (err < 0) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, opt->name, - "a size value"); + error_setg(errp, "Parameter '%s' expects a size value", opt->name); return false; } =20 diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index 63596e11c5..82c3425566 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -101,8 +101,7 @@ bool qapi_bool_parse(const char *name, const char *valu= e, bool *obj, Error **err return true; } =20 - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name, - "'on' or 'off'"); + error_setg(errp, "Parameter '%s' expects 'on' or 'off'", name); return false; } =20 diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c index f110a804b2..f5fa6c1878 100644 --- a/qapi/qobject-input-visitor.c +++ b/qapi/qobject-input-visitor.c @@ -424,8 +424,8 @@ static bool qobject_input_type_int64_keyval(Visitor *v,= const char *name, =20 if (qemu_strtoi64(str, NULL, 0, obj) < 0) { /* TODO report -ERANGE more nicely */ - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - full_name(qiv, name), "integer"); + error_setg(errp, "Parameter '%s' expects integer", + full_name(qiv, name)); return false; } return true; @@ -458,8 +458,7 @@ static bool qobject_input_type_uint64(Visitor *v, const= char *name, } =20 err: - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - full_name(qiv, name), "uint64"); + error_setg(errp, "Parameter '%s' expects uint64", full_name(qiv, name)= ); return false; } =20 @@ -475,8 +474,8 @@ static bool qobject_input_type_uint64_keyval(Visitor *v= , const char *name, =20 if (qemu_strtou64(str, NULL, 0, obj) < 0) { /* TODO report -ERANGE more nicely */ - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - full_name(qiv, name), "integer"); + error_setg(errp, "Parameter '%s' expects integer", + full_name(qiv, name)); return false; } return true; @@ -514,8 +513,8 @@ static bool qobject_input_type_bool_keyval(Visitor *v, = const char *name, } =20 if (!qapi_bool_parse(name, str, obj, NULL)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - full_name(qiv, name), "'on' or 'off'"); + error_setg(errp, "Parameter '%s' expects 'on' or 'off'", + full_name(qiv, name)); return false; } return true; @@ -643,8 +642,7 @@ static bool qobject_input_type_size_keyval(Visitor *v, = const char *name, =20 if (qemu_strtosz(str, NULL, obj) < 0) { /* TODO report -ERANGE more nicely */ - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - full_name(qiv, name), "size"); + error_setg(errp, "Parameter '%s' expects size", full_name(qiv, nam= e)); return false; } return true; diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c index 3f1b9e9b41..6ea6a0c676 100644 --- a/qapi/string-input-visitor.c +++ b/qapi/string-input-visitor.c @@ -189,16 +189,17 @@ static bool parse_type_int64(Visitor *v, const char *= name, int64_t *obj, case LM_NONE: /* just parse a simple int64, bail out if not completely consumed = */ if (qemu_strtoi64(siv->string, NULL, 0, &val)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - name ? name : "null", "int64"); + error_setg(errp, "Parameter '%s' expects int64", + name ? name : "null"); return false; } *obj =3D val; return true; case LM_UNPARSED: if (try_parse_int64_list_entry(siv, obj)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "= null", - "list of int64 values or ranges"); + error_setg(errp, + "Parameter '%s' expects list of int64 values or ran= ges", + name ? name : "null"); return false; } assert(siv->lm =3D=3D LM_INT64_RANGE); @@ -279,16 +280,17 @@ static bool parse_type_uint64(Visitor *v, const char = *name, uint64_t *obj, case LM_NONE: /* just parse a simple uint64, bail out if not completely consumed= */ if (qemu_strtou64(siv->string, NULL, 0, &val)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "= null", - "uint64"); + error_setg(errp, "Parameter '%s' expects uint64", + name ? name : "null"); return false; } *obj =3D val; return true; case LM_UNPARSED: if (try_parse_uint64_list_entry(siv, obj)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "= null", - "list of uint64 values or ranges"); + error_setg(errp, + "Parameter '%s' expects list of uint64 values or ra= nges", + name ? name : "null"); return false; } assert(siv->lm =3D=3D LM_UINT64_RANGE); diff --git a/util/qemu-option.c b/util/qemu-option.c index 62dd80a5ae..9440224e5b 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -101,7 +101,7 @@ static bool parse_option_number(const char *name, const= char *value, return false; } if (err) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name, "a number"); + error_setg(errp, "Parameter '%s' expects a number", name); return false; } *ret =3D number; @@ -142,8 +142,9 @@ bool parse_option_size(const char *name, const char *va= lue, return false; } if (err) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name, - "a non-negative number below 2^64"); + error_setg(errp, + "Parameter '%s' expects a non-negative number below 2^6= 4", + name); error_append_hint(errp, "Optional suffix k, M, G, T, P or E means" " kilo-, mega-, giga-, tera-, peta-\n" "and exabytes, respectively.\n"); --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696440880; cv=none; d=zohomail.com; s=zohoarc; b=nRJ7NTGP6UhPHeMj4hLvOeuETd5mt0vZjq+k+grkEfg26ALWylted0DpLjlBzkqPU1ZPEPzllCAjbIBEcjbUQ5tMQdL0ohMm5AxnrpTGAeFGxtsfj2vGrxxn6CHvygJLPtRdHNnPRRrYU2v0YyuclNb/Wh8H3Nr61jDvPWIEfAo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696440880; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Gyoso152fQUVv2VI4kNr2GZSI6iVV+4Nv9SPfhHf5XM=; b=ZS3KAGOygpUUysa/yGEADCIKcjdCqn/e/g/H2Vl6Caf0rXOoCetKx58oDy3fInZLvnkLA5itbmfazvR/zXuzAIRvDi/tGXF0Pf1rsyJfMjz7kePVdCr2XjCEHwEeb98V7HyhHk3Vs68/tpdMiWtt+meq4ycJgg3nWcvfC7ZvdEo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696440880617738.4848083112521; Wed, 4 Oct 2023 10:34:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5km-0004R8-U2; Wed, 04 Oct 2023 13:33:45 -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 1qo5kW-0004IV-Fr for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:30 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5kU-0001B0-K8 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:28 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-31427ddd3fbso132062f8f.0 for ; Wed, 04 Oct 2023 10:33:26 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id da4-20020a056000196400b003279518f51dsm4541053wrb.2.2023.10.04.10.33.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:33:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440805; x=1697045605; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Gyoso152fQUVv2VI4kNr2GZSI6iVV+4Nv9SPfhHf5XM=; b=oh5ch8a7v5j/mOBTUG5Z2BqImBb05AUpabdOLbcdLXthe9WjEV6CWqTeFPtKtIocza l3H9DXK1EO+YnEpC5jsPyrDL8+VZwYXEN/cnoj8l9iqnm8SxWUgmvKxVgKpAFf4TriTN z9EVbjQbY8/N+cfT9oobFoccLUqIORwDS+VOxX7MH6WctL/K13Vq8aX69EwQ4Di/975+ unoOGh/DkJ1oI71ek3Kvm4emxBf3qN4P5tdTUnVlCRUitD7aX6YOJAGSTiWJytnEM+M6 xDAgDOiF0uE0gTE++oIEkd9ajzM/tIC+if0bWRlz0Xf/jbfJMMoa8a/um44z6IjhSK2+ Et3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440805; x=1697045605; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gyoso152fQUVv2VI4kNr2GZSI6iVV+4Nv9SPfhHf5XM=; b=rAp/e8L+3U7an+kL9CJyC312vTNlybYH2NaZrX+2kYUFSrnOg7+jjJSO/xIwSycgcg uNATd2OV35ZODGU1LaK0NcrZafnAfxm8pEvrMmqIxomVOv2TbES+JDAK1GttOfMycW16 vqxkl3BTsE+QbNMyEkCxlfcALNJlPZt1tq/SZN3UMOrIrGcK2QANDnzdcHv7w9vA9s5Y 28NpdnKdEokFzFZUjQfVvUCV/De2G8EW41xvdjLYIEMAfsDarqUNtXqfgGZsVnnCxGsQ ELzEUI7bomP8dX1bkwLqEYWer1mkfELXHX8sqBTosAG/5VIZl9WKHwHedyS6cKY/Orqj YPfA== X-Gm-Message-State: AOJu0Yxxv5xXc/EM16zqN/xqdlC5r+g8DBm1XTjeMElvI+6QP/CnVfTo bkOKkzPg9r6EZVeqjF3LcRyJwK+kT71BSUy+GBs= X-Google-Smtp-Source: AGHT+IH8SEZLt9lDipXSDPk3Fp901Wl5QO2HAst6ms5kqEDZbhv8mbn5cHDvW3XDldfFAh8fBEGzSg== X-Received: by 2002:a5d:444b:0:b0:319:52da:8f0b with SMTP id x11-20020a5d444b000000b0031952da8f0bmr2690457wrr.17.1696440804870; Wed, 04 Oct 2023 10:33:24 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Roth , Stefan Berger Subject: [PATCH 12/21] qapi: Inline and remove QERR_INVALID_PARAMETER_VALUE definition Date: Wed, 4 Oct 2023 19:31:47 +0200 Message-ID: <20231004173158.42591-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696440882085100003 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! */ Manually modify the error_report() call in softmmu/tpm.c, then use sed to mechanically transform the rest. Finally remove the definition in include/qapi/qmp/qerror.h. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Berger --- include/qapi/qmp/qerror.h | 3 --- qapi/opts-visitor.c | 4 ++-- qapi/qapi-visit-core.c | 4 ++-- softmmu/tpm.c | 3 +-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index b723830eff..ac727d1c2d 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,9 +17,6 @@ * add new ones! */ =20 -#define QERR_INVALID_PARAMETER_VALUE \ - "Parameter '%s' expects %s" - #define QERR_IO_ERROR \ "An IO error has occurred" =20 diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c index 0393704a73..844db583f4 100644 --- a/qapi/opts-visitor.c +++ b/qapi/opts-visitor.c @@ -441,7 +441,7 @@ opts_type_int64(Visitor *v, const char *name, int64_t *= obj, Error **errp) } } } - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, opt->name, + error_setg(errp, "Parameter '%s' expects %s", opt->name, (ov->list_mode =3D=3D LM_NONE) ? "an int64 value" : "an int64 value or range"); return false; @@ -494,7 +494,7 @@ opts_type_uint64(Visitor *v, const char *name, uint64_t= *obj, Error **errp) } } } - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, opt->name, + error_setg(errp, "Parameter '%s' expects %s", opt->name, (ov->list_mode =3D=3D LM_NONE) ? "a uint64 value" : "a uint64 value or range"); return false; diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c index 6c13510a2b..01793d6e74 100644 --- a/qapi/qapi-visit-core.c +++ b/qapi/qapi-visit-core.c @@ -194,7 +194,7 @@ static bool visit_type_uintN(Visitor *v, uint64_t *obj,= const char *name, } if (value > max) { assert(v->type =3D=3D VISITOR_INPUT); - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, + error_setg(errp, "Parameter '%s' expects %s", name ? name : "null", type); return false; } @@ -262,7 +262,7 @@ static bool visit_type_intN(Visitor *v, int64_t *obj, c= onst char *name, } if (value < min || value > max) { assert(v->type =3D=3D VISITOR_INPUT); - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, + error_setg(errp, "Parameter '%s' expects %s", name ? name : "null", type); return false; } diff --git a/softmmu/tpm.c b/softmmu/tpm.c index 578563f05a..8437c4efc3 100644 --- a/softmmu/tpm.c +++ b/softmmu/tpm.c @@ -120,8 +120,7 @@ static int tpm_init_tpmdev(void *dummy, QemuOpts *opts,= Error **errp) i =3D qapi_enum_parse(&TpmType_lookup, value, -1, NULL); be =3D i >=3D 0 ? tpm_be_find_by_type(i) : NULL; if (be =3D=3D NULL) { - error_report(QERR_INVALID_PARAMETER_VALUE, - "type", "a TPM backend type"); + error_report("Parameter 'type' expects a TPM backend type"); tpm_display_backend_drivers(); return 1; } --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696440956; cv=none; d=zohomail.com; s=zohoarc; b=c/ebyePjNF2gB7Za7OhTyhEMmdrrKH1asv72zmuUKm5ugv89Va0wm1saA5zjr10Fe29f/xe9q0mB00NNM/ciuTI/AtfUwMXF7znrjtR0HSzjpymKLqpzTsSwbVE/DZoNZEWclS71k52q1C4k3lPq2KWGx/9bKOtFSx7kAtEruS8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696440956; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LgqEreWct7MZtVTd4L58i3yyOMJt49ibdnNqLW0cY8Q=; b=Mc3m3zycCa+1gqhrRRVgw//RYingEIMi4PP4HfPTrZ4kcX98EkcYRY87sUInf+L15WxlZsf9kdR77GrgLkdQJiwmHrhahSL9nO0UBCsApbdvvQTjXXN1xIgUxB/kMHgY97dzhAMmR7B8bbpl8cfyGqGyjXvm+DGKmhcxieL0hOY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696440956824580.9638456271373; Wed, 4 Oct 2023 10:35:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5kt-0004pj-7n; Wed, 04 Oct 2023 13:33:51 -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 1qo5ke-0004NJ-VW for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:40 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5kb-0001Cy-QR for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:36 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-32483535e51so128581f8f.0 for ; Wed, 04 Oct 2023 10:33:33 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id p9-20020adfcc89000000b00326028b4dd5sm4471194wrj.113.2023.10.04.10.33.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:33:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440812; x=1697045612; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LgqEreWct7MZtVTd4L58i3yyOMJt49ibdnNqLW0cY8Q=; b=Txvwlx9jeGOgKHmiXK+GB0yEn+uSjmx0BuJHdvT33FsNUWXSY5ky+YGobL8JoSw4oD vIc9MGrXiTyBjBv85kOC68nb3+0jZcDXFSKlQ305SpDjnc9w8gEYc+I+wiX9yh3+0edf 626Jq36WmumxIzcyfpLj05xEP43s0XEQ3oP5ZddBkE88dpwwS1V17t6Wa7P0gwluWb6P h4yQifK6hv/NghHNTSisK2Ggrsp6VWI7DNlDLZ51FMM/OmLDORsiK6LFrkJ6rwi4FuWn Yzhd980djhz4kxUghV9S4pLzlVMtn6O0EGrfAnfJRkW+u2JbQROp3ycLDi3yWEeFeK6P euig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440812; x=1697045612; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LgqEreWct7MZtVTd4L58i3yyOMJt49ibdnNqLW0cY8Q=; b=A/9b7HujtV4UmddhhvK3qrRh6X8FKvQQe7iWKbffajUV/tR/WGNWBwHo05K41JvVdo n4+uZ/8XJEhWOsGbZINmKVOBKwT9cPbj4gG9Xo7vCzTBjZoycQkxEISqXMIrn5cKD4ac qCTtpUqvHcLnXwAyirCrCagcKkm5A1kQ9BbQ1DrGv48j8ISgzCI4nlz6bdn+hULINT1Z guZWASqCBW6GVV2BP3j3hqBebfT3OCJ/n75BBql2xA02u8DCD+jktNLACWbCqwgsvk6E O8jRbIZQ5WzSfdGiwMKLfquTCgeg0Z3DEPL31+rB97+8S3F1HB8XOtrwZf6M8BKwXHeC qQYA== X-Gm-Message-State: AOJu0YwPuBAiUjqWTyoiQfJpQApZimhrP5QFEdPXbTV+bzXOdbd+Q/4R tQ2s7eHp6gYzLojTH3fzVKxHKdC/vtTF6gYaZRs= X-Google-Smtp-Source: AGHT+IH9LIR9lKU2LqSUqfZiKsxIsA94sXQKP0iEePNgfhrz9C+cfdVw8eoMwlMjbnmd9ap0AQkMyw== X-Received: by 2002:a5d:4d43:0:b0:31c:6420:fff with SMTP id a3-20020a5d4d43000000b0031c64200fffmr2622991wru.62.1696440811915; Wed, 04 Oct 2023 10:33:31 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fam Zheng , Kevin Wolf , Hanna Reitz , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Juan Quintela , Peter Xu , Leonardo Bras , Richard Henderson , Paolo Bonzini Subject: [PATCH 13/21] qapi: Inline and remove QERR_IO_ERROR definition Date: Wed, 4 Oct 2023 19:31:48 +0200 Message-ID: <20231004173158.42591-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696440958010100001 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 -#define QERR_IO_ERROR \ - "An IO error has occurred" - #define QERR_MIGRATION_ACTIVE \ "There's a migration process in progress" =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 filesiz= e, 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); + error_setg(errp, "An IO error has occurred"); 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 @@ -2271,7 +2271,7 @@ vmdk_init_extent(BlockBackend *blk, int64_t filesize,= bool flat, bool compress, ret =3D blk_co_pwrite(blk, le64_to_cpu(header.rgd_offset) * BDRV_SECTO= R_SIZE, gd_buf_size, gd_buf, 0); if (ret < 0) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "An IO error has occurred"); goto exit; } =20 @@ -2283,7 +2283,7 @@ vmdk_init_extent(BlockBackend *blk, int64_t filesize,= bool flat, bool compress, ret =3D blk_co_pwrite(blk, le64_to_cpu(header.gd_offset) * BDRV_SECTOR= _SIZE, gd_buf_size, gd_buf, 0); if (ret < 0) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "An IO error has occurred"); } =20 ret =3D 0; diff --git a/blockdev.c b/blockdev.c index ed90365329..228cebf9a2 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1433,7 +1433,7 @@ static void external_snapshot_action(TransactionActio= n *action, =20 if (!bdrv_is_read_only(state->old_bs)) { if (bdrv_flush(state->old_bs)) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "An IO error has occurred"); goto out; } } diff --git a/dump/win_dump.c b/dump/win_dump.c index b7bfaff379..0115a609e0 100644 --- a/dump/win_dump.c +++ b/dump/win_dump.c @@ -67,7 +67,7 @@ static size_t write_run(uint64_t base_page, uint64_t page= _count, l =3D qemu_write_full(fd, buf, len); cpu_physical_memory_unmap(buf, addr, false, len); if (l !=3D len) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "An IO error has occurred"); return 0; } =20 @@ -459,7 +459,7 @@ void create_win_dump(DumpState *s, Error **errp) =20 s->written_size =3D qemu_write_full(s->fd, h, hdr_size); if (s->written_size !=3D hdr_size) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "An IO error has occurred"); goto out_restore; } =20 diff --git a/migration/savevm.c b/migration/savevm.c index bb3e99194c..41c7f39ef5 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -3099,7 +3099,7 @@ void qmp_xen_save_devices_state(const char *filename,= bool has_live, bool live, object_unref(OBJECT(ioc)); ret =3D qemu_save_device_state(f); if (ret < 0 || qemu_fclose(f) < 0) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "An IO error has occurred"); } else { /* libxl calls the QMP command "stop" before calling * "xen-save-devices-state" and in case of migration failure, libxl @@ -3148,7 +3148,7 @@ void qmp_xen_load_devices_state(const char *filename,= Error **errp) ret =3D qemu_loadvm_state(f); qemu_fclose(f); if (ret < 0) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "An IO error has occurred"); } migration_incoming_state_destroy(); } diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 7fc70f9166..f7c743b0ce 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -773,7 +773,7 @@ void qmp_memsave(int64_t addr, int64_t size, const char= *filename, goto exit; } if (fwrite(buf, 1, l, f) !=3D l) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "An IO error has occurred"); goto exit; } addr +=3D l; @@ -803,7 +803,7 @@ void qmp_pmemsave(int64_t addr, int64_t size, const cha= r *filename, l =3D size; cpu_physical_memory_read(addr, buf, l); if (fwrite(buf, 1, l, f) !=3D l) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "An IO error has occurred"); goto exit; } addr +=3D l; --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696440987; cv=none; d=zohomail.com; s=zohoarc; b=nQorKGHhUU0wzp0pNAQ3Swddb2M86gLiSLoZVPpJRaj28uuouMHxnAE603/zGtEhvGilVeegCD6LlA7PEAAzaT8RIFWIX0VbAsc6ubHy0SUbd6QDgYXJ9C48Tlz2WVK8FrRJe0UJEoJ8aez+J/eonV40l/6o6i+bKDn/SzLvBew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696440987; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/2mqPUiLY+xgyp8WhkPgnmE5sxcUntO1BZj3t2/zBvU=; b=ZchwyKMdC47uPTG5SZ7RNBtd6nniktOG3eRtW7v6e1jmRfr9AMobh1fz5qUobfPyRqmODAQNga3AZHZEKDrWKaIA0K1YLLdiL6n+5PEs6/n+MtJVOz/zpvW+brD6DjrsndCHuKMhv6Wm4yYleRHKptDN2gnhqSL+UKAxY5p4ohM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16964409872791023.6696158283526; Wed, 4 Oct 2023 10:36:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5kw-00051y-8T; Wed, 04 Oct 2023 13:33: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 1qo5kk-0004SQ-MX for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:44 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5kh-0001E0-U6 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:41 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3231df68584so112198f8f.1 for ; Wed, 04 Oct 2023 10:33:39 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id d14-20020adfe84e000000b0031c5b380291sm4459057wrn.110.2023.10.04.10.33.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440818; x=1697045618; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/2mqPUiLY+xgyp8WhkPgnmE5sxcUntO1BZj3t2/zBvU=; b=IOdeVNJNrLy/4yV01S75rnsSqYmcoPYXbNH+LCzNO1nFy0JNc4tBzwFPbrZYLNIewm 6HzlzCEPOfk01Fg94K1HcFpfbMjmNeyG37ZpcWaEm1KsC7oxTpOozxdwnF/YArml2l42 tntzBvt6eEe0MjoCf0vWnZWOG1q3Q+Vx3IqmccbcNse1uZyTuTDZ7VIFY3hhzdyWSccZ 4dbat1ZDDfMl/BSRLX96jKPRdWO0e6b2e0gD01Pk0M5pCWBKBOl/txi5raEFcIXnq0Rc OSarMfJKYnVNrZ2mn4aGBymOUWpaJp70Ic9SHwUEr1+LnIp9+O3DUWv64RzqO0suJ9pt awSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440818; x=1697045618; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/2mqPUiLY+xgyp8WhkPgnmE5sxcUntO1BZj3t2/zBvU=; b=nYfxWaYqkSMnKohCaeuVOfnLeuGFkSX7sl8VBawJXRaSZbKAXmSFJgqXUkpoLYvdpa 8mZ78TFipM8PEdAIjla7RodKusxFY9VnqdZw0G99uUTqn/cRkx4AH3zF4OGGydOZqt64 KYEgpjz8//Umm3h7D4BFXKwj25q65cqxWlcSx/hg7K2L1etkBaQZAv68r4c6dLVaXRqB Gak3vdBb4+m+Xada+i2AkZIMfR3rWGHfr8Wtaurf07tFPcD3jzzWIX5/I4EzuU1pNR/8 EIvuP263PzvGjR6fsTe8k6fBua69ZGHaaVZqwKVJyizFENMXB1Q/sT3m3Pwd8iQPFNlE S7xg== X-Gm-Message-State: AOJu0YzzFAvxU2dZLNzrI8LNdSdG9Pad3krdiixIj6BHemHJr+sRR71i mNRB+UwdI9gv2UH7Yg6LUbU1iM932yH4DHDzOcY= X-Google-Smtp-Source: AGHT+IG65jLeDptHqIznHYwtU279e92Hx1gp5+3joNpHjdMPWSM/ouFAr23LDsDFSYQkISif2xHnFQ== X-Received: by 2002:a5d:440f:0:b0:320:a4e:6b83 with SMTP id z15-20020a5d440f000000b003200a4e6b83mr2742242wrq.31.1696440818441; Wed, 04 Oct 2023 10:33:38 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Juan Quintela , Peter Xu , Leonardo Bras Subject: [PATCH 14/21] qapi: Inline and remove QERR_MIGRATION_ACTIVE definition Date: Wed, 4 Oct 2023 19:31:49 +0200 Message-ID: <20231004173158.42591-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696440988483100001 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, 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 --- migration/migration.c | 2 +- migration/options.c | 4 ++-- migration/savevm.c | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index d95c4b84b9..cc4dae1076 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,9 +17,6 @@ * add new ones! */ =20 -#define QERR_MIGRATION_ACTIVE \ - "There's a migration process in progress" - #define QERR_MISSING_PARAMETER \ "Parameter '%s' is missing" =20 diff --git a/migration/migration.c b/migration/migration.c index b7f6818a15..5703cc34ae 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1616,7 +1616,7 @@ static bool migrate_prepare(MigrationState *s, bool b= lk, bool blk_inc, } =20 if (migration_is_running(s->state)) { - error_setg(errp, QERR_MIGRATION_ACTIVE); + error_setg(errp, "There's a migration process in progress"); return false; } =20 diff --git a/migration/options.c b/migration/options.c index 3a2180b779..e363b4885f 100644 --- a/migration/options.c +++ b/migration/options.c @@ -618,7 +618,7 @@ bool migrate_cap_set(int cap, bool value, Error **errp) bool new_caps[MIGRATION_CAPABILITY__MAX]; =20 if (migration_is_running(s->state)) { - error_setg(errp, QERR_MIGRATION_ACTIVE); + error_setg(errp, "There's a migration process in progress"); return false; } =20 @@ -662,7 +662,7 @@ void qmp_migrate_set_capabilities(MigrationCapabilitySt= atusList *params, bool new_caps[MIGRATION_CAPABILITY__MAX]; =20 if (migration_is_running(s->state) || migration_in_colo_state()) { - error_setg(errp, QERR_MIGRATION_ACTIVE); + error_setg(errp, "There's a migration process in progress"); return; } =20 diff --git a/migration/savevm.c b/migration/savevm.c index 41c7f39ef5..c0e0585bc1 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1634,7 +1634,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **err= p) MigrationStatus status; =20 if (migration_is_running(ms->state)) { - error_setg(errp, QERR_MIGRATION_ACTIVE); + error_setg(errp, "There's a migration process in progress"); return -EINVAL; } =20 --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696441357; cv=none; d=zohomail.com; s=zohoarc; b=Kf20P2a/l1m6PBcBEy1ZDLua3E/kZD40LoAm0+A2UuoC3QkHdrBiiFqsA9CyDfUbEYr6k765+MUoWimy74kx3t8OIKWtGI9kL9b2LuAAI945NmPyQFSc4/gC2euEFq1Mvej7uzBxBKLiZNlMj6CIA/QLZT/TASH9z4tUTH7WV6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696441357; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kOY6u6B9/Vt1ZpzeRPPPARZ8tvwMbrjh+qtuhF8OwAQ=; b=bQFPY9yA3YZmKpMUmkCojl+IprwQ5G6bN+LufA2lPHi9NcRJm6LIf+lkMn2miFiyX43fOPl0l4FUXUb9RZPqEObVpvzQULc+BvFlspDO/qMF4JUD8EpgiZCmoNRYPB7whI4r7TxDrXK8b81GbQzupWhuM6WpLcd2aM7DsM17zTY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696441357171628.406097286531; Wed, 4 Oct 2023 10:42:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5kx-00054s-Cg; Wed, 04 Oct 2023 13:33:55 -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 1qo5ku-0004v2-0T for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:52 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5kq-0001FN-88 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:51 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-327b7e08456so110383f8f.2 for ; Wed, 04 Oct 2023 10:33:47 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id m7-20020adff387000000b0032710f5584fsm4469894wro.25.2023.10.04.10.33.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:33:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440825; x=1697045625; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kOY6u6B9/Vt1ZpzeRPPPARZ8tvwMbrjh+qtuhF8OwAQ=; b=Ec8Kag8KmIdAH0iLM8Os826bpXmebXegnIwNZ1B6VIOzgadUXxA/mDMhYFe7kuDeqR +aurfJKSiGZEGh0+9a25tgN3La4u2/6G6z95CHRukXvG0rodG64cF1M+vimypHuZAYPo xqelOifjPSLerv1WHBBWGjXW5KLgRcK2bsP08JeEkbXP0kIpgjKeZ6vF1I9F0c3GURWj ZkKTBdHPP1pryjZGkpkdo0V++KBBlex50rCzRgRPYvcYGv7iBFXZo/XINLUZiWj/eKRB nEpn/jTPhIrRuFUSKmN3U8Lu/8lSZinGwUSGxaFO0/QEr7B3BdtnxF5TFOL6MxhJPC1R ndng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440825; x=1697045625; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kOY6u6B9/Vt1ZpzeRPPPARZ8tvwMbrjh+qtuhF8OwAQ=; b=CpGVZTfkcq30L4mB9ZbakCI0DVT9gQqldZnBsQTcxsYSmKfDjsN/g659XUMFKkmhem u+ixjzhwPtVgjl1uf+J0hqGzUJkjZUwiOmXPyn/xwFtpP1zjEBx9IdfC11vvKQh0Vmv1 Foey3UMecjNUScNrUcyvhH0R/ASKsOWjfvJ3oLLbb4OntBPgmhPCJBMQbGhwS4AlTrf3 Ktn3+uEUx1/NI/tLJAE0VY1ooN5eG+jE83M5ria6w98usLOqDHl5OGHYykfndz/L/rDy ppeV+0BDnq223syNykgb/UQVygDLu6O7g46vOVnmaZvPjp98FbO0AArXhIDebOYXWlLh c33A== X-Gm-Message-State: AOJu0YwH4kz1YvCTTShbSLHs7rvt2Qia90O9TN7m4VnczzO94IC+Iym+ uLh1tNAQfa8fRf6f40GK4tZGQqzwrkduE6fRVQ4= X-Google-Smtp-Source: AGHT+IEi4FH0GP2l3/PXLzKlhntlkRF2OpXtkmEgVCaTroUhm7P0PC6nbIci32NcU/PsyJV+9sVfiQ== X-Received: by 2002:a5d:56d0:0:b0:31c:5c77:48ec with SMTP id m16-20020a5d56d0000000b0031c5c7748ecmr2553733wrw.62.1696440825381; Wed, 04 Oct 2023 10:33:45 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Kevin Wolf , Hanna Reitz , Gerd Hoffmann , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Stefan Berger , integration@gluster.org Subject: [PATCH 15/21] qapi: Inline QERR_MISSING_PARAMETER definition (constant parameter) Date: Wed, 4 Oct 2023 19:31:50 +0200 Message-ID: <20231004173158.42591-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696441357617100001 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 the following coccinelle semantic patches: @match@ expression errp; constant param; @@ error_setg(errp, QERR_MISSING_PARAMETER, param); @script:python strformat depends on match@ param << match.param; fixedfmt; // new var @@ if param[0] =3D=3D '"': # Format skipping '"', fixedfmt =3D f'"Parameter \'{param[1:-1]}\' is missing"' else: # or use definition. fixedfmt =3D f'"Parameter " {param} " is missing"' coccinelle.fixedfmt =3D cocci.make_ident(fixedfmt) @replace@ expression match.errp; constant match.param; identifier strformat.fixedfmt; @@ - error_setg(errp, QERR_MISSING_PARAMETER, param); + error_setg(errp, fixedfmt); and: @match@ constant param; @@ error_report(QERR_MISSING_PARAMETER, param); @script:python strformat depends on match@ param << match.param; fixedfmt; // new var @@ fixedfmt =3D f'"Parameter \'{param[1:-1]}\' is missing"' coccinelle.fixedfmt =3D cocci.make_ident(fixedfmt) @replace@ constant match.param; identifier strformat.fixedfmt; @@ - error_report(QERR_MISSING_PARAMETER, param); + error_report(fixedfmt); Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Berger --- backends/dbus-vmstate.c | 2 +- block/gluster.c | 21 +++++++++++---------- block/monitor/block-hmp-cmds.c | 6 +++--- dump/dump.c | 4 ++-- hw/usb/redirect.c | 2 +- softmmu/qdev-monitor.c | 2 +- softmmu/tpm.c | 4 ++-- softmmu/vl.c | 4 ++-- ui/input-barrier.c | 2 +- ui/ui-qmp-cmds.c | 2 +- 10 files changed, 25 insertions(+), 24 deletions(-) diff --git a/backends/dbus-vmstate.c b/backends/dbus-vmstate.c index 57369ec0f2..e781ded17c 100644 --- a/backends/dbus-vmstate.c +++ b/backends/dbus-vmstate.c @@ -413,7 +413,7 @@ dbus_vmstate_complete(UserCreatable *uc, Error **errp) } =20 if (!self->dbus_addr) { - error_setg(errp, QERR_MISSING_PARAMETER, "addr"); + error_setg(errp, "Parameter 'addr' is missing"); return; } =20 diff --git a/block/gluster.c b/block/gluster.c index ad5fadbe79..8d97d698c3 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -530,20 +530,20 @@ static int qemu_gluster_parse_json(BlockdevOptionsGlu= ster *gconf, =20 num_servers =3D qdict_array_entries(options, GLUSTER_OPT_SERVER_PATTER= N); if (num_servers < 1) { - error_setg(&local_err, QERR_MISSING_PARAMETER, "server"); + error_setg(&local_err, "Parameter 'server' is missing"); goto out; } =20 ptr =3D qemu_opt_get(opts, GLUSTER_OPT_VOLUME); if (!ptr) { - error_setg(&local_err, QERR_MISSING_PARAMETER, GLUSTER_OPT_VOLUME); + error_setg(&local_err, "Parameter " GLUSTER_OPT_VOLUME " is missin= g"); goto out; } gconf->volume =3D g_strdup(ptr); =20 ptr =3D qemu_opt_get(opts, GLUSTER_OPT_PATH); if (!ptr) { - error_setg(&local_err, QERR_MISSING_PARAMETER, GLUSTER_OPT_PATH); + error_setg(&local_err, "Parameter " GLUSTER_OPT_PATH " is missing"= ); goto out; } gconf->path =3D g_strdup(ptr); @@ -562,7 +562,8 @@ static int qemu_gluster_parse_json(BlockdevOptionsGlust= er *gconf, =20 ptr =3D qemu_opt_get(opts, GLUSTER_OPT_TYPE); if (!ptr) { - error_setg(&local_err, QERR_MISSING_PARAMETER, GLUSTER_OPT_TYP= E); + error_setg(&local_err, + "Parameter " GLUSTER_OPT_TYPE " is missing"); error_append_hint(&local_err, GERR_INDEX_HINT, i); goto out; =20 @@ -592,16 +593,16 @@ static int qemu_gluster_parse_json(BlockdevOptionsGlu= ster *gconf, =20 ptr =3D qemu_opt_get(opts, GLUSTER_OPT_HOST); if (!ptr) { - error_setg(&local_err, QERR_MISSING_PARAMETER, - GLUSTER_OPT_HOST); + error_setg(&local_err, + "Parameter " GLUSTER_OPT_HOST " is missing"); error_append_hint(&local_err, GERR_INDEX_HINT, i); goto out; } gsconf->u.inet.host =3D g_strdup(ptr); ptr =3D qemu_opt_get(opts, GLUSTER_OPT_PORT); if (!ptr) { - error_setg(&local_err, QERR_MISSING_PARAMETER, - GLUSTER_OPT_PORT); + error_setg(&local_err, + "Parameter " GLUSTER_OPT_PORT " is missing"); error_append_hint(&local_err, GERR_INDEX_HINT, i); goto out; } @@ -648,8 +649,8 @@ static int qemu_gluster_parse_json(BlockdevOptionsGlust= er *gconf, goto out; } if (!ptr) { - error_setg(&local_err, QERR_MISSING_PARAMETER, - GLUSTER_OPT_PATH); + error_setg(&local_err, + "Parameter " GLUSTER_OPT_PATH " is missing"); error_append_hint(&local_err, GERR_INDEX_HINT, i); goto out; } diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c index ca2599de44..90e593ed38 100644 --- a/block/monitor/block-hmp-cmds.c +++ b/block/monitor/block-hmp-cmds.c @@ -252,7 +252,7 @@ void hmp_drive_mirror(Monitor *mon, const QDict *qdict) }; =20 if (!filename) { - error_setg(&err, QERR_MISSING_PARAMETER, "target"); + error_setg(&err, "Parameter 'target' is missing"); goto end; } qmp_drive_mirror(&mirror, &err); @@ -281,7 +281,7 @@ void hmp_drive_backup(Monitor *mon, const QDict *qdict) }; =20 if (!filename) { - error_setg(&err, QERR_MISSING_PARAMETER, "target"); + error_setg(&err, "Parameter 'target' is missing"); goto end; } =20 @@ -356,7 +356,7 @@ void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdi= ct) * In the future, if 'snapshot-file' is not specified, the snapshot * will be taken internally. Today it's actually required. */ - error_setg(&err, QERR_MISSING_PARAMETER, "snapshot-file"); + error_setg(&err, "Parameter 'snapshot-file' is missing"); goto end; } =20 diff --git a/dump/dump.c b/dump/dump.c index e173f1f14c..642b952985 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -2096,11 +2096,11 @@ void qmp_dump_guest_memory(bool paging, const char = *file, return; } if (has_begin && !has_length) { - error_setg(errp, QERR_MISSING_PARAMETER, "length"); + error_setg(errp, "Parameter 'length' is missing"); return; } if (!has_begin && has_length) { - error_setg(errp, QERR_MISSING_PARAMETER, "begin"); + error_setg(errp, "Parameter 'begin' is missing"); return; } if (has_detach) { diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index ac6fa34ad1..83bfc9dc19 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -1426,7 +1426,7 @@ static void usbredir_realize(USBDevice *udev, Error *= *errp) int i; =20 if (!qemu_chr_fe_backend_connected(&dev->cs)) { - error_setg(errp, QERR_MISSING_PARAMETER, "chardev"); + error_setg(errp, "Parameter 'chardev' is missing"); return; } =20 diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index b17aec4357..b7b2bf18d4 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -622,7 +622,7 @@ DeviceState *qdev_device_add_from_qdict(const QDict *op= ts, =20 driver =3D qdict_get_try_str(opts, "driver"); if (!driver) { - error_setg(errp, QERR_MISSING_PARAMETER, "driver"); + error_setg(errp, "Parameter 'driver' is missing"); return NULL; } =20 diff --git a/softmmu/tpm.c b/softmmu/tpm.c index 8437c4efc3..3a7d4b5c67 100644 --- a/softmmu/tpm.c +++ b/softmmu/tpm.c @@ -106,13 +106,13 @@ static int tpm_init_tpmdev(void *dummy, QemuOpts *opt= s, Error **errp) =20 id =3D qemu_opts_id(opts); if (id =3D=3D NULL) { - error_report(QERR_MISSING_PARAMETER, "id"); + error_report("Parameter 'id' is missing"); return 1; } =20 value =3D qemu_opt_get(opts, "type"); if (!value) { - error_report(QERR_MISSING_PARAMETER, "type"); + error_report("Parameter 'type' is missing"); tpm_display_backend_drivers(); return 1; } diff --git a/softmmu/vl.c b/softmmu/vl.c index 98e071e63b..840ac84069 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1801,7 +1801,7 @@ static void object_option_parse(const char *optarg) =20 type =3D qemu_opt_get(opts, "qom-type"); if (!type) { - error_setg(&error_fatal, QERR_MISSING_PARAMETER, "qom-type"); + error_setg(&error_fatal, "Parameter 'qom-type' is missing"); } if (user_creatable_print_help(type, opts)) { exit(0); @@ -2266,7 +2266,7 @@ static int do_configure_accelerator(void *opaque, Qem= uOpts *opts, Error **errp) bool qtest_with_kvm; =20 if (!acc) { - error_setg(errp, QERR_MISSING_PARAMETER, "accel"); + error_setg(errp, "Parameter 'accel' is missing"); goto bad; } =20 diff --git a/ui/input-barrier.c b/ui/input-barrier.c index 2d57ca7079..ecbba4adc2 100644 --- a/ui/input-barrier.c +++ b/ui/input-barrier.c @@ -493,7 +493,7 @@ static void input_barrier_complete(UserCreatable *uc, E= rror **errp) Error *local_err =3D NULL; =20 if (!ib->name) { - error_setg(errp, QERR_MISSING_PARAMETER, "name"); + error_setg(errp, "Parameter 'name' is missing"); return; } =20 diff --git a/ui/ui-qmp-cmds.c b/ui/ui-qmp-cmds.c index a95fd35948..0e350fc333 100644 --- a/ui/ui-qmp-cmds.c +++ b/ui/ui-qmp-cmds.c @@ -195,7 +195,7 @@ void qmp_client_migrate_info(const char *protocol, cons= t char *hostname, } =20 if (!has_port && !has_tls_port) { - error_setg(errp, QERR_MISSING_PARAMETER, "port/tls-port"); + error_setg(errp, "Parameter 'port/tls-port' is missing"); return; } =20 --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696440978; cv=none; d=zohomail.com; s=zohoarc; b=J5a6jIt8/4n3O/Cg/YwMXLDpZjtBYEYjUZelcX4DbSfI9Mt53N+5KJ3XdRp4Y4xAXP10GExgmnsvV2S2XJZ2mvHUnIkqqU7KhnCU4GsvdhhI3Uo0dSwl2zFwMcpz82FNqgpHX8ZHiPAtOCTRwNvaqw0e2agWPFduiXYqRsdgRgI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696440978; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZMzoYshmIKgiyI46JZRTSl2tAoK4bhnefguZfodjbZQ=; b=jvC2ko8SGAleMXD9Wpjbf43XJozILULcugeWGqX2AS23qf9NPOMIxYlwR5/SPA6oB4xlxyCg9BMfVt4WOVoUYz8BkrN29jRis6nrTJzrVXPt8cb4CYs8+37A7CpoVtSzZHQUEwx//EVemv9N3K394mOCVFTMzkNu7jb7AAGQTA0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696440978256641.4427988813915; Wed, 4 Oct 2023 10:36:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5l3-0005Fh-P9; Wed, 04 Oct 2023 13:34:01 -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 1qo5kw-00053c-UD for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:55 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5kv-0001Gp-3s for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:33:54 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-31c5cac3ae2so94724f8f.3 for ; Wed, 04 Oct 2023 10:33:52 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id v22-20020a1cf716000000b003fefcbe7fa8sm2013488wmh.28.2023.10.04.10.33.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:33:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440831; x=1697045631; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZMzoYshmIKgiyI46JZRTSl2tAoK4bhnefguZfodjbZQ=; b=SPzsInjlowfDayG/a8nkQuspKf6w14l0qIKS7blCzN1gGAXtU23Sh/2et7Cn3Bt1fr 4c9bj5uXVYIN4xG3UbSN0+YTznXSoCfCEX6sGDDHGgHXKnv6k2CcObZNEnlY05u7iB0x pj4j45Bt/BltLAKsJ885Pix+3M4e5/jLFmhT+uvfzz2+SXpTThENqGNp0inKPZqstl7p QiV+airD+6AT2xZVusRhG0//rG4+YMbbkmOfuwf7oKAGG04Ju7cxQ6cFRlCDHmYCbu6a X64u897h+LiJr8ywe3yOwB/2Zj6egGo+67Y2+H5l1AoFDHzXssft/jZTGxkjYp0vJ79I z/GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440831; x=1697045631; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZMzoYshmIKgiyI46JZRTSl2tAoK4bhnefguZfodjbZQ=; b=I6BVTk2fSATZnn0eNxi9gVjRcHTJuVXLHTaNxSih2Oyif/5pv13hC9SbCOZ1e/BUhg s+qeGss+rCmjbEs/gCE93tPvQu8otrsap4vPjS/cKJDD/4yLt2j6/6yk/jR+EJJ5hfS2 4AUq56gmHTfeB68yQnkK2Kf/B6sYFZIQsRBTOaZq7OlvYCKLtcFB33g1EG6a28tErf1S ffBcUns8NUij4uU9zOIxRe715XYBsQvwn5o/Rh3yUBDdmOHcfiuhYAxtgyCPTVxGpDq5 IbRUkpGjfAu4Jk8cNybVOvc54l8yXA5c3Q/S73VadsrFznBVx00FWr+sklupt/9FSxYr 1ueg== X-Gm-Message-State: AOJu0YzHjlGf9UhsRzfCHUsGSIJagMZNftY2G9LLsfqlOhygJ0RzjlAE 2SrR99dG4wI2B2erRulM7Ueu8IzztygkU3ZO10I= X-Google-Smtp-Source: AGHT+IFJJpzTqkzOF039EX+CWtVdV0BjqrGr/qWew7l0FrUMdg2ttar1aWp6F3Fwm7b2+vLI2m8qiQ== X-Received: by 2002:adf:ecc3:0:b0:319:7c0f:d920 with SMTP id s3-20020adfecc3000000b003197c0fd920mr2875094wro.57.1696440831513; Wed, 04 Oct 2023 10:33:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Roth Subject: [PATCH 16/21] qapi: Inline and remove QERR_MISSING_PARAMETER definition Date: Wed, 4 Oct 2023 19:31:51 +0200 Message-ID: <20231004173158.42591-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696440980253100007 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, manually removing the definition in include/qapi/qmp/qerror.h. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qapi/qmp/qerror.h | 3 --- qapi/opts-visitor.c | 2 +- qapi/qapi-forward-visitor.c | 2 +- qapi/qobject-input-visitor.c | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index cc4dae1076..b0f48f22fe 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,9 +17,6 @@ * add new ones! */ =20 -#define QERR_MISSING_PARAMETER \ - "Parameter '%s' is missing" - #define QERR_PROPERTY_VALUE_BAD \ "Property '%s.%s' doesn't take value '%s'" =20 diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c index 844db583f4..bf0d8acbd6 100644 --- a/qapi/opts-visitor.c +++ b/qapi/opts-visitor.c @@ -218,7 +218,7 @@ lookup_distinct(const OptsVisitor *ov, const char *name= , Error **errp) =20 list =3D g_hash_table_lookup(ov->unprocessed_opts, name); if (!list) { - error_setg(errp, QERR_MISSING_PARAMETER, name); + error_setg(errp, "Parameter '%s' is missing", name); } return list; } diff --git a/qapi/qapi-forward-visitor.c b/qapi/qapi-forward-visitor.c index e36d9bc9ba..3fb2c954aa 100644 --- a/qapi/qapi-forward-visitor.c +++ b/qapi/qapi-forward-visitor.c @@ -49,7 +49,7 @@ static bool forward_field_translate_name(ForwardFieldVisi= tor *v, const char **na *name =3D v->to; return true; } - error_setg(errp, QERR_MISSING_PARAMETER, *name); + error_setg(errp, "Parameter '%s' is missing", *name); return false; } =20 diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c index f5fa6c1878..17e9f3b638 100644 --- a/qapi/qobject-input-visitor.c +++ b/qapi/qobject-input-visitor.c @@ -168,7 +168,7 @@ static QObject *qobject_input_get_object(QObjectInputVi= sitor *qiv, QObject *obj =3D qobject_input_try_get_object(qiv, name, consume); =20 if (!obj) { - error_setg(errp, QERR_MISSING_PARAMETER, full_name(qiv, name)); + error_setg(errp, "Parameter '%s' is missing", full_name(qiv, name)= ); } return obj; } --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696441317; cv=none; d=zohomail.com; s=zohoarc; b=JcvqfVpOOzBPmU92ZaeIM4tQvEXsG+4HV4g6oUVqT7ZWGHTDDuEe9vJRfkX2oImY2ylmTSHT0uDSZ3V5Bc8yVg9TgYFh3qLDEUWN8hj29MoS2OXJ/HBvM3oTh0E2ojRpCuurg5RYiIOeMjRlBVcvoE4INBII4GvFtpDhirtvLf4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696441317; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+wgGQUdIqiLvE9KKvhjp7xkKxDkuA49hJ4+Z2t/uhpA=; b=SIDyjf1fRGGoyZZt7qe/9H1lgC+tq6NK4KF+LYQXOGBdsKMMtBmYt8rRAtWDDYIXkgzWGVLZpHlW5l8sJGJTIgB9IgJDJdBnrrPI/9G77eB7o25OiFKc2JYJ/hg3Z7wUjS/gVjrk79bgJfk8EvzuB3Gjh7yfm2LULCMtADTlBfM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696441317303883.9485801382507; Wed, 4 Oct 2023 10:41:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5lc-0005xF-UQ; Wed, 04 Oct 2023 13:34:38 -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 1qo5l5-0005QC-H6 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:34:06 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5l1-0001IW-NL for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:34:02 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3232be274a0so774322f8f.1 for ; Wed, 04 Oct 2023 10:33:59 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id b7-20020a5d5507000000b003247f732c11sm4499225wrv.76.2023.10.04.10.33.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:33:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440838; x=1697045638; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+wgGQUdIqiLvE9KKvhjp7xkKxDkuA49hJ4+Z2t/uhpA=; b=hZB/CKx1pd5p0+oU/wOex0HZCaYFijZ2K/ar+bchIzz/D5Fnu2njue/V4x0xcDxi2x OAJ0RXuQrDx5xzhc3ck+/X6wsaNLJBzDBD3C2cgRp2dZFnmt7WZKjvyNPgHwP86gayCJ Fzsc8SSqRNRR+jo49UolpGnkyIcPVl3vHIc19zux/5eFLC/kjpI9LBD9XEKb53YO2tlA +Xo4KRZUAO4Yofty+sYVxHXfcJMoA7ZP8buj4SrF2iss/mI6h7Y7wWuHrKSdZrMjeQ3l 81pGp2KGIjMum+Oz+iSi0oYgY1XkXDuwP/GLdPn02BRv7wU60f9JOE8b3ZRhY0K2pRb2 aNEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440838; x=1697045638; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+wgGQUdIqiLvE9KKvhjp7xkKxDkuA49hJ4+Z2t/uhpA=; b=GbSNJa+S+4/4U8WvDDhFPlos3bWrak6Fle4TGh4lqZcz56RNPaLawmb7w35pxKpKoS d2Q1jC2GzoqCdV8mOZZDxjCnVtM6YDXnxJFIddQ8JVDqKD2g30sA05gAn6/bsKcqhXUl NYz76sUok19TKfpGbgkp7AoF4E83h8zk1BfbkQ/XWzC7Zg7qC0NSqH2dcaxhKOduLfZ2 raxYlhLaJUtIqHGJzDVl7BU4qa81/qAY2hgiMsT+j/OnT1bkzdftPKCA3vrdbZ8ecpxW rB7i2Jxd0dM4vl8w6NZxAktvN9ZidEPM5pZ9rsWMWpV8QDeJivUrh5uUXnpoO5z8ib4l D6ug== X-Gm-Message-State: AOJu0YzXGZG7i0vExhYpBatQ+eiY3SZCp5RDbZ8KhtgUXuwdQp8x0kls G1JHgoyMHc27vav1y97KHGcNEM5N1GffO91tJZQ= X-Google-Smtp-Source: AGHT+IG5t9+ERq5Dx3FYyAIHdJmdCRaZM1DB1dv9z2ImlObMWh99iAzoLGLOaSxi5d0tVcFlpve3bQ== X-Received: by 2002:adf:cd81:0:b0:31c:2f95:8056 with SMTP id q1-20020adfcd81000000b0031c2f958056mr249994wrj.23.1696440838160; Wed, 04 Oct 2023 10:33:58 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH 17/21] qapi: Inline and remove QERR_PROPERTY_VALUE_BAD definition Date: Wed, 4 Oct 2023 19:31:52 +0200 Message-ID: <20231004173158.42591-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696441318706100003 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! */ Manual change. Remove the definition in include/qapi/qmp/qerror.h. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qapi/qmp/qerror.h | 3 --- hw/core/qdev-properties.c | 2 +- target/i386/cpu.c | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index b0f48f22fe..7862ac55a1 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,9 +17,6 @@ * add new ones! */ =20 -#define QERR_PROPERTY_VALUE_BAD \ - "Property '%s.%s' doesn't take value '%s'" - #define QERR_PROPERTY_VALUE_OUT_OF_RANGE \ "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", = maximum: %" PRId64 ")" =20 diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 357b8761b5..44fc1686e0 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -682,7 +682,7 @@ void error_set_from_qdev_prop_error(Error **errp, int r= et, Object *obj, break; default: case -EINVAL: - error_setg(errp, QERR_PROPERTY_VALUE_BAD, + error_setg(errp, "Property '%s.%s' doesn't take value '%s'", object_get_typename(obj), name, value); break; case -ENOENT: diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ed72883bf3..e5a14885ed 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5190,7 +5190,7 @@ static void x86_cpuid_set_vendor(Object *obj, const c= har *value, int i; =20 if (strlen(value) !=3D CPUID_VENDOR_SZ) { - error_setg(errp, QERR_PROPERTY_VALUE_BAD, "", "vendor", value); + error_setg(errp, "Property 'vendor' doesn't take value '%s'", valu= e); return; } =20 --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696440936; cv=none; d=zohomail.com; s=zohoarc; b=cuaext5XVM/R6GtJpgEUm2H4w3KGADCiGFyQrxZdinGExFCBloaPRw3fjyYV4/Y2LIisabI6Rmq1ucorfWXhkPCz06Zcq+aj+FQPgyby/zueQkF4c60QCnCkJlYmqqphAGgFfG4PrZ1GT6q/M/DQDMd6TwPR7jXh5O4NaoiyL9g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696440936; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xsWfVZc9VxkTZJYVgn0fspMadC16MHZrVQJV0TPl4cg=; b=lkxzzZ6u6BrlE8GAujJvwiIVLvUSwiHdyx5Yq6oa4nIV+V0QndX+Ce7WPSz7DPUDmDsO++/SdFXfCU94Xlp+UlmUbAUxdTd0bAwDwfJ/V48B9EJtiihKfYjzsnFmOSN8bzIj0wHHVyIvHXnursSDTQyr0gLVg/BYY92zgPyxtZY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696440936050696.3433712090088; Wed, 4 Oct 2023 10:35:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5lt-0006So-MZ; Wed, 04 Oct 2023 13:34: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 1qo5lE-0005bi-46 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:34:16 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5lA-0001Jo-4u for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:34:11 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-406402933edso395525e9.2 for ; Wed, 04 Oct 2023 10:34:05 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id f16-20020a5d4dd0000000b00323384e04e8sm4460434wru.111.2023.10.04.10.34.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440844; x=1697045644; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xsWfVZc9VxkTZJYVgn0fspMadC16MHZrVQJV0TPl4cg=; b=EK/dmszo5RUMDwl/9yLoS1u5JAsct6KgBScTDAr942Tz/sE9lthUUILICcjtLE6cij igZLBlY439bHpH8XsnVCzGu+YH9CP4yd1HIbYIFh64AAWZH5sOEEqw0R6y1qWOMUQyJ6 K0AJ7Yzaxc7qpoPklsju7oitKReG8lDz25+FbhRZxjERm2ityF3EIOKMlOkWtXNckw2+ 8I6BZNUnYGSyEdvrPpW6HaDqSzi9p0mEw1G6BNncuXHVqq051doybvn3PIThri327TSo Vl8Nj04MyCezXuhzuJuc0YB+yUv09aU7PrTHJU43KF1fylia2hTvGmhLUGZ43Vc9I47l 8kPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440844; x=1697045644; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xsWfVZc9VxkTZJYVgn0fspMadC16MHZrVQJV0TPl4cg=; b=tLtfY0JAwZKacMx7iznhj6lIXZLt1dpc+mteiwDigxBeM1dCCe8Xf2b2A+WPal7O55 1faATIQ/bNTIBxH78HvT3nfUiJc9EJ8F4pyJLzNU27fH5jQYPtOOBwxX+KDEjr85wsDl u7+GfCfoyZPC12XNP+1wLOxmP17vuyQF2CmTCJAKDPg4s9DYAZuYLdmSK95iPd/bYzJr O5MRfADA71UiP83vrOUdjW2n8201VwLCmKQRQTMDi3dwVmLBPiSH/96i8Nj4zYNlQKoy +7/QMxPDn/vXgipdut1JHhInPupKL2Q2X2MlL2gki7aisCc/lVCJxHRL4141PYs+Nv/p c97w== X-Gm-Message-State: AOJu0YwooDHTktEtjqjdLIX5ppkhyWKsdYyLdCGhL71nOPHPwtdABJZd r31l6NhOYZeWbkG2km3WbQmOQulIwMCAbVPtm4o= X-Google-Smtp-Source: AGHT+IG1kBwi1v3Csgfs6npWCLFTp3rIzq63qhG9QDSDnQhnP+HzXD1teddfXNTohsxN/1UpTML6rA== X-Received: by 2002:a7b:c7d7:0:b0:3fd:2e89:31bd with SMTP id z23-20020a7bc7d7000000b003fd2e8931bdmr2995592wmk.14.1696440844525; Wed, 04 Oct 2023 10:34:04 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland Subject: [PATCH 18/21] qapi: Inline and remove QERR_PROPERTY_VALUE_OUT_OF_RANGE definition Date: Wed, 4 Oct 2023 19:31:53 +0200 Message-ID: <20231004173158.42591-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696440937698100003 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, manually removing the definition in include/qapi/qmp/qerror.h. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qapi/qmp/qerror.h | 3 --- hw/intc/openpic.c | 3 ++- target/i386/cpu.c | 12 ++++++++---- util/block-helpers.c | 3 ++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 7862ac55a1..e094f13114 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,9 +17,6 @@ * add new ones! */ =20 -#define QERR_PROPERTY_VALUE_OUT_OF_RANGE \ - "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", = maximum: %" PRId64 ")" - #define QERR_QGA_COMMAND_FAILED \ "Guest agent command failed, error was '%s'" =20 diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c index a6f91d4bcd..4f6ee930e2 100644 --- a/hw/intc/openpic.c +++ b/hw/intc/openpic.c @@ -1535,7 +1535,8 @@ static void openpic_realize(DeviceState *dev, Error *= *errp) }; =20 if (opp->nb_cpus > MAX_CPU) { - error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, + error_setg(errp, "Property %s.%s doesn't take value %" PRId64 + " (minimum: %" PRId64 ", maximum: %" PRId64 ")", TYPE_OPENPIC, "nb_cpus", (uint64_t)opp->nb_cpus, (uint64_t)0, (uint64_t)MAX_CPU); return; diff --git a/target/i386/cpu.c b/target/i386/cpu.c index e5a14885ed..273f865228 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5086,7 +5086,8 @@ static void x86_cpuid_version_set_family(Object *obj,= Visitor *v, return; } if (value < min || value > max) { - error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "", + error_setg(errp, "Property %s doesn't take value %" PRId64 + " (minimum: %" PRId64 ", maximum: %" PRId64 ")", name ? name : "null", value, min, max); return; } @@ -5126,7 +5127,8 @@ static void x86_cpuid_version_set_model(Object *obj, = Visitor *v, return; } if (value < min || value > max) { - error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "", + error_setg(errp, "Property %s doesn't take value %" PRId64 + " (minimum: %" PRId64 ", maximum: %" PRId64 ")", name ? name : "null", value, min, max); return; } @@ -5161,7 +5163,8 @@ static void x86_cpuid_version_set_stepping(Object *ob= j, Visitor *v, return; } if (value < min || value > max) { - error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "", + error_setg(errp, "Property %s doesn't take value %" PRId64 + " (minimum: %" PRId64 ", maximum: %" PRId64 ")", name ? name : "null", value, min, max); return; } @@ -5263,7 +5266,8 @@ static void x86_cpuid_set_tsc_freq(Object *obj, Visit= or *v, const char *name, return; } if (value < min || value > max) { - error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "", + error_setg(errp, "Property %s doesn't take value %" PRId64 + " (minimum: %" PRId64 ", maximum: %" PRId64 ")", name ? name : "null", value, min, max); return; } diff --git a/util/block-helpers.c b/util/block-helpers.c index c4851432f5..de94909bc4 100644 --- a/util/block-helpers.c +++ b/util/block-helpers.c @@ -30,7 +30,8 @@ void check_block_size(const char *id, const char *name, i= nt64_t value, { /* value of 0 means "unset" */ if (value && (value < MIN_BLOCK_SIZE || value > MAX_BLOCK_SIZE)) { - error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, + error_setg(errp, "Property %s.%s doesn't take value %" PRId64 + " (minimum: %" PRId64 ", maximum: %" PRId64 ")", id, name, value, MIN_BLOCK_SIZE, MAX_BLOCK_SIZE); return; } --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696441216; cv=none; d=zohomail.com; s=zohoarc; b=P0aVcrJF2s1d6C+84HZqytRnBlarsbgqDe5lSSm9pqAwjVACfpfoT6gSi1mXFgX4v3hG9a2jckk8ImlCdEsxH9T0YrjFDeBYpT7KL3vy6NXZ0A/0ZOyQh/jKrr3MiYJ7kdbSrXZ69Nd7qxshoVv5uBfG/N46EI9FWVDeay1vA50= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696441216; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JgzZrOytqrUApWTqn24h2uNs6StZKBnGHRMADJvQBG0=; b=XUTkQkspLk58eWpPfJYiULoxwoJI8emS0mg9RtOfQ5w/jXXAjZD9tGOaFWWhHEy7ckAzJC0eFOaaVv/A2AI5hc6uGjrGccbh0LnnCYkPAOL54a3xE7eBkAR/E2Z+2qyxv5je2fXqGmQDNyxB0engC4Q5yo5h+W/IZ1aIdROsIwI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696441216915638.4479771942471; Wed, 4 Oct 2023 10:40:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5mY-0006vv-Kd; Wed, 04 Oct 2023 13:35:36 -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 1qo5lN-0005lK-Hb for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:34:24 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5lH-0001M9-KV for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:34:20 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-405417465aaso493345e9.1 for ; Wed, 04 Oct 2023 10:34:12 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id v7-20020a5d4a47000000b00321773bb933sm4520859wrs.77.2023.10.04.10.34.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440851; x=1697045651; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JgzZrOytqrUApWTqn24h2uNs6StZKBnGHRMADJvQBG0=; b=ESdxJKxt0pIV9/8opF4/xCqE11XKvMbvHy9zLbfzYLJgakO+TFl68jjWNZc22r/bUe tIT9E2sJ3ujnZYE0FVx5O4tI1J33Z8EYK+agGatUlmOZIplHsURV4mc6pu3qg4iVxin/ SGdNIHOEdoySQADNEUtJVEEbAwRPWEnxPZisgEAXIcYl/GoKF/BZcXmIr0fY/dV5a6AL CstWAFa5QXAutDbvnh/NvL1jiXaNEA4LgQY6wMmYWU9bjyIEDe1REx4VVJ5BMzqDUEGJ Ko7YKvV6649bzuphft2UUKVCGszBL4Z1cUgOqysqc2FRRverNFXkBATtFazQu86VB+x2 Nnjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440851; x=1697045651; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JgzZrOytqrUApWTqn24h2uNs6StZKBnGHRMADJvQBG0=; b=kd2MhOSaf88lw8bXZWNJgLOub3hsXyUBbYzk2F5g0MFWy4m/oTuI7xBF/XZstykKxl p1Al0qckWoleoDN62HY2pmiu+UteEzsbc17TBHSe35qqQd4FzBj6rhPY5ig6PgPTdFYH cJIzSUF9Tetn+s39ywQz7rw57VhixkfbTBjqAG1D+FTzTBBKsMXTke4GUwq9wMsQcTqP wB/VLQBaUpXe0mXvvikGdo39toyQqKUfYyYl5/aiAqlJXn6HeeJhD/q25r5xPP9nvDQH UDxS2Vxt7f1V7KuXGGjZlBmx6NXhknFPVeD/+AO2WtAjLZJgUDyE4wqzpCfqVeQlaBMh VDlQ== X-Gm-Message-State: AOJu0YyEVjjkhG4sIsNpH/61/+QIqelkAH4tF6sl9tiPV80NJFwWj89C Jj2GmOwzC+b1uhPrJMcpgHHdw4xACPbaIxhaizQ= X-Google-Smtp-Source: AGHT+IHAga3heVXWns2qU5ZRkKRbIoAycmyM+teHZW6jqYex9EGAd7QLDFI5uD9YXVAUxC/WWtti2w== X-Received: by 2002:a7b:cc8e:0:b0:401:38dc:8916 with SMTP id p14-20020a7bcc8e000000b0040138dc8916mr2831246wma.10.1696440850986; Wed, 04 Oct 2023 10:34:10 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Konstantin Kostiuk , Michael Roth Subject: [PATCH 19/21] qapi: Inline and remove QERR_QGA_COMMAND_FAILED definition Date: Wed, 4 Oct 2023 19:31:54 +0200 Message-ID: <20231004173158.42591-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696441218253100003 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 the following coccinelle semantic patch: @match exists@ expression errp; expression errmsg; @@ error_setg(errp, QERR_QGA_COMMAND_FAILED, errmsg); @script:python strformat depends on match@ errmsg << match.errmsg; fixedfmt; // new var @@ # Format skipping '"'. fixedfmt =3D f'"Guest agent command failed, error was \'{errmsg[1:-1]}\= '"' coccinelle.fixedfmt =3D cocci.make_ident(fixedfmt) @replace@ expression match.errp; expression match.errmsg; identifier strformat.fixedfmt; @@ - error_setg(errp, QERR_QGA_COMMAND_FAILED, errmsg); + error_setg(errp, fixedfmt); then manually removing the definition in include/qapi/qmp/qerror.h. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qapi/qmp/qerror.h | 3 --- qga/commands-win32.c | 38 ++++++++++++++++++++------------------ qga/commands.c | 7 ++++--- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index e094f13114..840831cc6a 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,9 +17,6 @@ * add new ones! */ =20 -#define QERR_QGA_COMMAND_FAILED \ - "Guest agent command failed, error was '%s'" - #define QERR_UNSUPPORTED \ "this feature or command is not currently supported" =20 diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 946dbafbb6..aa8c9770d4 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -245,7 +245,8 @@ int64_t qmp_guest_file_open(const char *path, const cha= r *mode, Error **errp) =20 done: if (gerr) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, gerr->message); + error_setg(errp, + "Guest agent command failed, error was 'err -> messag'"= ); g_error_free(gerr); } g_free(w_path); @@ -279,8 +280,8 @@ static void acquire_privilege(const char *name, Error *= *errp) TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token)) { if (!LookupPrivilegeValue(NULL, name, &priv.Privileges[0].Luid)) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "no luid for requested privilege"); + error_setg(errp, + "Guest agent command failed, error was 'no luid for= requested privilege'"); goto out; } =20 @@ -288,14 +289,14 @@ static void acquire_privilege(const char *name, Error= **errp) priv.Privileges[0].Attributes =3D SE_PRIVILEGE_ENABLED; =20 if (!AdjustTokenPrivileges(token, FALSE, &priv, 0, NULL, 0)) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "unable to acquire requested privilege"); + error_setg(errp, + "Guest agent command failed, error was 'unable to a= cquire requested privilege'"); goto out; } =20 } else { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "failed to open privilege token"); + error_setg(errp, + "Guest agent command failed, error was 'failed to open = privilege token'"); } =20 out: @@ -309,8 +310,8 @@ static void execute_async(DWORD WINAPI (*func)(LPVOID),= LPVOID opaque, { HANDLE thread =3D CreateThread(NULL, 0, func, opaque, 0, NULL); if (!thread) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "failed to dispatch asynchronous command"); + error_setg(errp, + "Guest agent command failed, error was 'failed to dispa= tch asynchronous command'"); } } =20 @@ -1423,22 +1424,22 @@ static void check_suspend_mode(GuestSuspendMode mod= e, Error **errp) =20 ZeroMemory(&sys_pwr_caps, sizeof(sys_pwr_caps)); if (!GetPwrCapabilities(&sys_pwr_caps)) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "failed to determine guest suspend capabilities"); + error_setg(errp, + "Guest agent command failed, error was 'failed to deter= mine guest suspend capabilities'"); return; } =20 switch (mode) { case GUEST_SUSPEND_MODE_DISK: if (!sys_pwr_caps.SystemS4) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "suspend-to-disk not supported by OS"); + error_setg(errp, + "Guest agent command failed, error was 'suspend-to-= disk not supported by OS'"); } break; case GUEST_SUSPEND_MODE_RAM: if (!sys_pwr_caps.SystemS3) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "suspend-to-ram not supported by OS"); + error_setg(errp, + "Guest agent command failed, error was 'suspend-to-= ram not supported by OS'"); } break; default: @@ -1971,7 +1972,8 @@ void qmp_guest_set_user_password(const char *username, =20 done: if (gerr) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, gerr->message); + error_setg(errp, + "Guest agent command failed, error was 'err -> messag'"= ); g_error_free(gerr); } g_free(user); @@ -2180,8 +2182,8 @@ static void ga_get_win_version(RTL_OSVERSIONINFOEXW *= info, Error **errp) HMODULE module =3D GetModuleHandle("ntdll"); PVOID fun =3D GetProcAddress(module, "RtlGetVersion"); if (fun =3D=3D NULL) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "Failed to get address of RtlGetVersion"); + error_setg(errp, + "Guest agent command failed, error was 'Failed to get a= ddress of RtlGetVersion'"); return; } =20 diff --git a/qga/commands.c b/qga/commands.c index 871210ab0b..936634c50a 100644 --- a/qga/commands.c +++ b/qga/commands.c @@ -475,7 +475,8 @@ GuestExec *qmp_guest_exec(const char *path, guest_exec_task_setup, &has_merge, &pid, input_data ? &in_fd := NULL, has_output ? &out_fd : NULL, has_output ? &err_fd : NULL, &ger= r); if (!ret) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, gerr->message); + error_setg(errp, + "Guest agent command failed, error was 'err -> messag'"= ); g_error_free(gerr); goto done; } @@ -586,8 +587,8 @@ GuestTimezone *qmp_guest_get_timezone(Error **errp) info =3D g_new0(GuestTimezone, 1); tz =3D g_time_zone_new_local(); if (tz =3D=3D NULL) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "Couldn't retrieve local timezone"); + error_setg(errp, + "Guest agent command failed, error was 'Couldn't retrie= ve local timezone'"); goto error; } =20 --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696441351; cv=none; d=zohomail.com; s=zohoarc; b=foHBXyc5KlFcq5zo8ghutJZqbu6JdpMBmJZgfvR9qPEFJ6PpXlz7IiKZGdTs/mzKsWc10MFV4VD0/GTyIu3MN58IGBD3lRDGxUZArhq38En+3s6Ho73tmVfwuCP9QF8NOdx2gsS4xOjVLkEDEQBv1+h4J+urdj9f/D7rtnsMD18= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696441351; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YgccYr5Dzt6X/tQjLL34w8Nky+uqW63WT4BtHcxYfTM=; b=AGyZoEXbIn/c1DjLw5q2tLa0J1+CasZfozsO+JcnV6huHgm5eRbrHfVxzpic5hTkHmfHnS81iL3u6Fj5dHROVjGqVfeDUdr9T2SaQHb9nKzWTGe2iCoLjPfB45SXVFU+XoEdeDd7oI7hFpjFqMkUz2MaZQSAiW9hw1JY54r7Lwc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16964413512544.787959140085377; Wed, 4 Oct 2023 10:42:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5md-00076H-KH; Wed, 04 Oct 2023 13:35:39 -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 1qo5lR-0005rj-Eq for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:34:28 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5lN-0001NR-9D for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:34:25 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4064876e8b8so642535e9.0 for ; Wed, 04 Oct 2023 10:34:19 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id bf7-20020a0560001cc700b003140f47224csm4457730wrb.15.2023.10.04.10.34.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440857; x=1697045657; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YgccYr5Dzt6X/tQjLL34w8Nky+uqW63WT4BtHcxYfTM=; b=B28vahGQlyU8GcBmWGfC1IdSYJ/qmaUEVa6qF3Fg5KhacuwOUY3PQBWCXJcy9v9Syc xeJiP5ooRifmcQ6Iz8GSVJyREXJeqSa6Fztb/n8ixZjyknFa6Bu9ySmNM9CUTFWt7Mhv 9g7sOKmszhT1sRPlGZpcn8XXFdBtHKPayyxnUusVWv5IYqKS8qsuv3faBL836AI++ydt qA1pICwpBL9GGxOShF+0QK6QZJmpQF+oxvhUInqjqO23HcQXige3bmcn0S/FGm7I5bpb bTUAv+QCZ8IPtdiLRAVL6iiRIF+l5sUWhdcfE7iP9VndhA0pu8EQZh3o4WQrlcWOxQih vEGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440857; x=1697045657; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YgccYr5Dzt6X/tQjLL34w8Nky+uqW63WT4BtHcxYfTM=; b=YGj/Jia0pbnWW6nNkFfFOvBIEXaUYfaqn78eHvbzWdRAXWy7Ic6gNGPyQ9qHx287Zh euImOLLcA/4ERHGDv791nFn5jd3UzICfQgJwj9fc6qxTAXXCpiENZhxSs60UYkfK0t27 ANW/auEI4hMprLKczAvq/Ui4RC114J/Ap1mXK+qb3ez3agHNALeRiyrJ6foHNLhWI63I 8KmV8OWZQ2yKj0Em1mqYIQuVE2p71ZatrxukX5IUx7meW3OgA7kKh9TJ0F7xUeK0yb1Y u8xnYm8GLaLx3ku7w5ax3Sjb56YU2FveNmOnODJZI+KPBUJIko7UPAmtk6NIOlI795yd gNMQ== X-Gm-Message-State: AOJu0YyQfy6sfVIgXNSWi4I3/rGsdyCT2ccbng1LJRfas8aH+CwKCM0g 9CoKDM7ru2n3foBSsMTcnf7il78XDvIJy1RLTxU= X-Google-Smtp-Source: AGHT+IH2o2Gng+1SrnejbxrC4tv3PQLdT9tsmy55o2/RKY/aAKdiskJdopcyCS262aLlxfXNZXtS9g== X-Received: by 2002:a5d:4564:0:b0:314:152d:f8db with SMTP id a4-20020a5d4564000000b00314152df8dbmr2759811wrc.58.1696440857397; Wed, 04 Oct 2023 10:34:17 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Michael Roth , Konstantin Kostiuk Subject: [RFC PATCH 20/21] qapi: Inline and remove QERR_UNSUPPORTED definition Date: Wed, 4 Oct 2023 19:31:55 +0200 Message-ID: <20231004173158.42591-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696441353444100003 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_UNSUPPORTED/"this feature or command is not currently= supported"/' \ $(git grep -wl QERR_UNSUPPORTED) then manually removing the definition in include/qapi/qmp/qerror.h. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- RFC: Not sure what is the best way to change the comment in qga/qapi-schema.json... --- qga/qapi-schema.json | 5 +++-- include/qapi/qmp/qerror.h | 3 --- qga/commands-bsd.c | 8 +++---- qga/commands-posix.c | 46 +++++++++++++++++++-------------------- qga/commands-win32.c | 22 +++++++++---------- 5 files changed, 41 insertions(+), 43 deletions(-) diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index b720dd4379..51683f4dc2 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json @@ -6,8 +6,9 @@ # # "unsupported" is a higher-level error than the errors that # individual commands might document. The caller should always be -# prepared to receive QERR_UNSUPPORTED, even if the given command -# doesn't specify it, or doesn't document any failure mode at all. +# prepared to receive the "this feature or command is not currently suppor= ted" +# message, even if the given command doesn't specify it, or doesn't docume= nt +# any failure mode at all. ## =20 ## diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 840831cc6a..7606f4525d 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,7 +17,4 @@ * add new ones! */ =20 -#define QERR_UNSUPPORTED \ - "this feature or command is not currently supported" - #endif /* QERROR_H */ diff --git a/qga/commands-bsd.c b/qga/commands-bsd.c index 17bddda1cf..11536f148f 100644 --- a/qga/commands-bsd.c +++ b/qga/commands-bsd.c @@ -152,25 +152,25 @@ int qmp_guest_fsfreeze_do_thaw(Error **errp) =20 GuestFilesystemInfoList *qmp_guest_get_fsinfo(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 GuestDiskInfoList *qmp_guest_get_disks(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 GuestDiskStatsInfoList *qmp_guest_get_diskstats(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 GuestCpuStatsList *qmp_guest_get_cpustats(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } #endif /* CONFIG_FSFREEZE */ diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 6169bbf7a0..f510add366 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -165,7 +165,7 @@ void qmp_guest_set_time(bool has_time, int64_t time_ns,= Error **errp) } =20 if (!hwclock_available) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently support= ed"); return; } =20 @@ -1540,7 +1540,7 @@ GuestDiskInfoList *qmp_guest_get_disks(Error **errp) =20 GuestDiskInfoList *qmp_guest_get_disks(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 @@ -2235,7 +2235,7 @@ void qmp_guest_set_user_password(const char *username, bool crypted, Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); } #endif /* __linux__ || __FreeBSD__ */ =20 @@ -2751,47 +2751,47 @@ GuestCpuStatsList *qmp_guest_get_cpustats(Error **e= rrp) =20 void qmp_guest_suspend_disk(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); } =20 void qmp_guest_suspend_ram(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); } =20 void qmp_guest_suspend_hybrid(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); } =20 GuestLogicalProcessorList *qmp_guest_get_vcpus(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 int64_t qmp_guest_set_vcpus(GuestLogicalProcessorList *vcpus, Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return -1; } =20 GuestMemoryBlockList *qmp_guest_get_memory_blocks(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 GuestMemoryBlockResponseList * qmp_guest_set_memory_blocks(GuestMemoryBlockList *mem_blks, Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 GuestMemoryBlockInfo *qmp_guest_get_memory_block_info(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 @@ -3056,7 +3056,7 @@ error: =20 GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 @@ -3066,20 +3066,20 @@ GuestNetworkInterfaceList *qmp_guest_network_get_in= terfaces(Error **errp) =20 GuestFilesystemInfoList *qmp_guest_get_fsinfo(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); =20 return 0; } =20 int64_t qmp_guest_fsfreeze_freeze(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); =20 return 0; } @@ -3088,33 +3088,33 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mou= ntpoints, strList *mountpoints, Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); =20 return 0; } =20 int64_t qmp_guest_fsfreeze_thaw(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); =20 return 0; } =20 GuestDiskInfoList *qmp_guest_get_disks(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 GuestDiskStatsInfoList *qmp_guest_get_diskstats(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 GuestCpuStatsList *qmp_guest_get_cpustats(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 @@ -3124,7 +3124,7 @@ GuestCpuStatsList *qmp_guest_get_cpustats(Error **err= p) GuestFilesystemTrimResponse * qmp_guest_fstrim(bool has_minimum, int64_t minimum, Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } #endif @@ -3243,7 +3243,7 @@ GuestUserList *qmp_guest_get_users(Error **errp) =20 GuestUserList *qmp_guest_get_users(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 @@ -3386,7 +3386,7 @@ GuestOSInfo *qmp_guest_get_osinfo(Error **errp) =20 GuestDeviceInfoList *qmp_guest_get_devices(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); =20 return NULL; } diff --git a/qga/commands-win32.c b/qga/commands-win32.c index aa8c9770d4..5c9f8e0923 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -1213,7 +1213,7 @@ GuestFilesystemInfoList *qmp_guest_get_fsinfo(Error *= *errp) GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **errp) { if (!vss_initialized()) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently support= ed"); return 0; } =20 @@ -1241,7 +1241,7 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mount= points, Error *local_err =3D NULL; =20 if (!vss_initialized()) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently support= ed"); return 0; } =20 @@ -1276,7 +1276,7 @@ int64_t qmp_guest_fsfreeze_thaw(Error **errp) int i; =20 if (!vss_initialized()) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently support= ed"); return 0; } =20 @@ -1509,7 +1509,7 @@ out: =20 void qmp_guest_suspend_hybrid(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); } =20 static IP_ADAPTER_ADDRESSES *guest_get_adapters_addresses(Error **errp) @@ -1877,7 +1877,7 @@ GuestLogicalProcessorList *qmp_guest_get_vcpus(Error = **errp) =20 int64_t qmp_guest_set_vcpus(GuestLogicalProcessorList *vcpus, Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return -1; } =20 @@ -1938,7 +1938,7 @@ void qmp_guest_set_user_password(const char *username, GError *gerr =3D NULL; =20 if (crypted) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently support= ed"); return; } =20 @@ -1983,20 +1983,20 @@ done: =20 GuestMemoryBlockList *qmp_guest_get_memory_blocks(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 GuestMemoryBlockResponseList * qmp_guest_set_memory_blocks(GuestMemoryBlockList *mem_blks, Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 GuestMemoryBlockInfo *qmp_guest_get_memory_block_info(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 @@ -2522,12 +2522,12 @@ char *qga_get_host_name(Error **errp) =20 GuestDiskStatsInfoList *qmp_guest_get_diskstats(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } =20 GuestCpuStatsList *qmp_guest_get_cpustats(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return NULL; } --=20 2.41.0 From nobody Fri Nov 1 01:04:54 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1696441249; cv=none; d=zohomail.com; s=zohoarc; b=n/z1on+no0i0aNC/EPmm7pU7x5ab0aS86VYdqkduWGN11pZllPHtz1pzXNcKi2RyqsFnL+MRioyscfFiYMI/jSRG6K5KLIOHtK8uJ9YB4WQB1oeGeo7ynwihvBr82IbOLdyS7qgIYdSTXm1okc7xRjOBF59tsgnbGWwbGF7zn+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1696441249; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rXQCp069O7lED68gZDU7dxJmBJ+oYWkpx632klsL3dA=; b=AiuBYXlqRVa0CMJWZYOxJmrsqsqO0O69Wq5YVrpsqcb8v76TyzhJHCzQrExKnAKVB9ZH16VlFQiZ9pYI2MX8cGzJ8ZKDS1xrHNeEZhpWZkxpPL8i2aAsz163DHRfNnVZvE7N6M4gmN4pGQqCLjLEe5sCwZFcduuRQwruZrvAegY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1696441249080816.9828125242955; Wed, 4 Oct 2023 10:40:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qo5mY-0006vn-Hi; Wed, 04 Oct 2023 13:35:35 -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 1qo5lb-00060E-Qh for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:34:36 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5lW-0001Pd-FM for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:34:35 -0400 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-533d31a8523so40396a12.1 for ; Wed, 04 Oct 2023 10:34:29 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id j24-20020a50ed18000000b005232ea6a330sm180106eds.2.2023.10.04.10.34.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440868; x=1697045668; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rXQCp069O7lED68gZDU7dxJmBJ+oYWkpx632klsL3dA=; b=i5SXpg81F0UjGpHEmVydVIo8vRDisliVYOcQZ7ovnDl/oo75bVRfL3imyh7sjvvoN2 U8m9sENWA0s6H42S/fEz6rcuv3i9YnbWGAeEhoUJ6QMcfAvzr3SWGEAFmh3jXe1uRLIE D2Ie/9+WlAqfx6DQ1xinROMTTXN22REp9wrpYvJ3y6lFjTYevZQtWSspjTBrWhjIvWqG 7EQ3cTA5KRO99gNGGVUbElgw2L0GPL+5yULFOHFZWZsYNRbzVsTActr8eOc1RM2Xxa0h J0JSrojAi//PbLARM8HyqH6gtYYOhsNKHdd3ooPJQpX18HycueLm7FKtQaW9ZLyFPe7d LZZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440868; x=1697045668; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rXQCp069O7lED68gZDU7dxJmBJ+oYWkpx632klsL3dA=; b=WpKzYtlWt3jsfijuMuAGbjGE6b3f3DXtYnvz91qEMalK2XtA7cjcIoPiudPhBy6Jkp j2K3f/q4PbOZIHOygUs70T84rQcJmH7R/t/znMyXIz03R55Y6IhYTd3OHkyIDpnxvaF2 XJJ25CxmjibhH2DPIH7y2zDBZ3nrya+ayePMBc2FWwCn0ym4/vJxdqIMm2N7h95AI73S JtRyeMtt3o+ep04Y9GEcFAtLK1EnTyRwh9gx85zg6+5QAqDBpLeTWUEUaD+77h5GNdo8 mCHLJO02W4wAOUP2DBxAT7u+3jT+7W9Bl6+3UzVhm1FGlRclnfX2T4ZY7qs/GXiTF8+E 8ITw== X-Gm-Message-State: AOJu0Ywt3+5Y+Q5u0E0TssZiJA+6zNxd8qiABd1gdKfpdAZUywl9LbjE 0dm+NuXuutFZSCRvnkliq7Uw+1TAU8w3yzXBEeM= X-Google-Smtp-Source: AGHT+IHPhW6ayLnVni3KMHCowb+9GxWmztfZsqT1LwYvlRdMjFaZhND6b58aJ0JnlO5SJZM+8xUUYA== X-Received: by 2002:a50:fb12:0:b0:536:e03f:62b6 with SMTP id d18-20020a50fb12000000b00536e03f62b6mr2739021edq.30.1696440867971; Wed, 04 Oct 2023 10:34:27 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Gonglei (Arei)" , Zhenwei Pi , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Amit Shah , Kevin Wolf , Hanna Reitz , Alberto Garcia , Fam Zheng , John Snow , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Mark Cave-Ayland , Nicholas Piggin , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson , Harsh Prateek Bora , Gerd Hoffmann , Juan Quintela , Peter Xu , Leonardo Bras , "Dr. David Alan Gilbert" , Jason Wang , Michael Roth , Konstantin Kostiuk , "Michael S. Tsirkin" , David Hildenbrand , Richard Henderson , Stefan Berger , Peter Maydell , Ilya Leoshkevich , Thomas Huth , integration@gluster.org Subject: [PATCH 21/21] qapi: Remove 'qapi/qmp/qerror.h' header Date: Wed, 4 Oct 2023 19:31:56 +0200 Message-ID: <20231004173158.42591-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=philmd@linaro.org; helo=mail-ed1-x52f.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1696441251335100003 This file is now empty. Avoid new definitions by killing it, paying off a 8 years old debt (with interests). Mechanical change using: $ git grep -l qapi/qmp/qerror.h | while read f; do \ gawk -i inplace '/#include "qapi\/qmp\/qerror.h"/ && !p {p++;next}1' = $f; \ done Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Juan Quintela --- include/qapi/qmp/qerror.h | 20 -------------------- backends/cryptodev-vhost-user.c | 1 - backends/dbus-vmstate.c | 1 - backends/rng-egd.c | 1 - backends/rng-random.c | 1 - block/gluster.c | 1 - block/monitor/block-hmp-cmds.c | 1 - block/quorum.c | 1 - block/snapshot.c | 1 - block/vmdk.c | 1 - blockdev.c | 1 - blockjob.c | 1 - chardev/char-fe.c | 1 - chardev/char.c | 1 - dump/dump.c | 1 - dump/win_dump.c | 1 - hw/core/qdev-properties-system.c | 1 - hw/core/qdev-properties.c | 1 - hw/core/qdev.c | 1 - hw/intc/openpic.c | 1 - hw/ppc/spapr_pci.c | 1 - hw/usb/redirect.c | 1 - migration/migration.c | 1 - migration/options.c | 1 - migration/page_cache.c | 1 - migration/ram.c | 1 - migration/savevm.c | 1 - monitor/fds.c | 1 - monitor/hmp-cmds.c | 1 - monitor/qmp-cmds.c | 1 - net/filter-buffer.c | 1 - net/filter.c | 1 - net/net.c | 1 - qapi/opts-visitor.c | 1 - qapi/qapi-forward-visitor.c | 1 - qapi/qapi-util.c | 1 - qapi/qapi-visit-core.c | 1 - qapi/qobject-input-visitor.c | 1 - qapi/string-input-visitor.c | 1 - qga/commands-bsd.c | 1 - qga/commands-posix.c | 1 - qga/commands-win32.c | 1 - qga/commands.c | 1 - qom/object.c | 1 - qom/object_interfaces.c | 1 - qom/qom-qmp-cmds.c | 1 - softmmu/balloon.c | 1 - softmmu/cpus.c | 1 - softmmu/qdev-monitor.c | 1 - softmmu/rtc.c | 1 - softmmu/tpm.c | 1 - softmmu/vl.c | 1 - target/arm/arm-qmp-cmds.c | 1 - target/i386/cpu.c | 1 - target/s390x/cpu_models_sysemu.c | 1 - ui/input-barrier.c | 1 - ui/ui-qmp-cmds.c | 1 - util/block-helpers.c | 1 - util/qemu-option.c | 1 - scripts/qapi/visit.py | 1 - 60 files changed, 79 deletions(-) delete mode 100644 include/qapi/qmp/qerror.h diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h deleted file mode 100644 index 7606f4525d..0000000000 --- a/include/qapi/qmp/qerror.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * QError Module - * - * Copyright (C) 2009 Red Hat Inc. - * - * Authors: - * Luiz Capitulino - * - * This work is licensed under the terms of the GNU LGPL, version 2.1 or l= ater. - * See the COPYING.LIB file in the top-level directory. - */ -#ifndef QERROR_H -#define QERROR_H - -/* - * These macros will go away, please don't use in new code, and do not - * add new ones! - */ - -#endif /* QERROR_H */ diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-use= r.c index d93ccd5528..5a41aa7be8 100644 --- a/backends/cryptodev-vhost-user.c +++ b/backends/cryptodev-vhost-user.c @@ -23,7 +23,6 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "hw/virtio/vhost-user.h" #include "standard-headers/linux/virtio_crypto.h" diff --git a/backends/dbus-vmstate.c b/backends/dbus-vmstate.c index e781ded17c..0006f8c400 100644 --- a/backends/dbus-vmstate.c +++ b/backends/dbus-vmstate.c @@ -16,7 +16,6 @@ #include "qemu/error-report.h" #include "qapi/error.h" #include "qom/object_interfaces.h" -#include "qapi/qmp/qerror.h" #include "migration/vmstate.h" #include "trace.h" #include "qom/object.h" diff --git a/backends/rng-egd.c b/backends/rng-egd.c index 8f101afadc..35f19257bd 100644 --- a/backends/rng-egd.c +++ b/backends/rng-egd.c @@ -14,7 +14,6 @@ #include "sysemu/rng.h" #include "chardev/char-fe.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qemu/module.h" #include "qom/object.h" =20 diff --git a/backends/rng-random.c b/backends/rng-random.c index 9cb7d26cb5..a49e4a4970 100644 --- a/backends/rng-random.c +++ b/backends/rng-random.c @@ -14,7 +14,6 @@ #include "sysemu/rng-random.h" #include "sysemu/rng.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qemu/main-loop.h" #include "qemu/module.h" =20 diff --git a/block/gluster.c b/block/gluster.c index 8d97d698c3..91df6f1d07 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -16,7 +16,6 @@ #include "block/qdict.h" #include "qapi/error.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qerror.h" #include "qemu/uri.h" #include "qemu/error-report.h" #include "qemu/module.h" diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c index 90e593ed38..9c3d3bedc6 100644 --- a/block/monitor/block-hmp-cmds.c +++ b/block/monitor/block-hmp-cmds.c @@ -43,7 +43,6 @@ #include "qapi/qapi-commands-block-export.h" #include "qapi/qmp/qdict.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qemu/config-file.h" #include "qemu/option.h" #include "qemu/sockets.h" diff --git a/block/quorum.c b/block/quorum.c index 8e9f279568..34ebbf4ce0 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -24,7 +24,6 @@ #include "qapi/error.h" #include "qapi/qapi-events-block.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qerror.h" #include "qapi/qmp/qlist.h" #include "qapi/qmp/qstring.h" #include "crypto/hash.h" diff --git a/block/snapshot.c b/block/snapshot.c index eb43e957e1..131b4bd6d0 100644 --- a/block/snapshot.c +++ b/block/snapshot.c @@ -28,7 +28,6 @@ #include "block/qdict.h" #include "qapi/error.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qerror.h" #include "qapi/qmp/qstring.h" #include "qemu/option.h" #include "sysemu/block-backend.h" diff --git a/block/vmdk.c b/block/vmdk.c index 6779a181f0..ed9742f9da 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -28,7 +28,6 @@ #include "block/block_int.h" #include "sysemu/block-backend.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/option.h" diff --git a/blockdev.c b/blockdev.c index 228cebf9a2..5a76bb1498 100644 --- a/blockdev.c +++ b/blockdev.c @@ -50,7 +50,6 @@ #include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qapi/qmp/qlist.h" #include "qapi/qobject-output-visitor.h" #include "sysemu/sysemu.h" diff --git a/blockjob.c b/blockjob.c index f95f73244e..d359ea72e5 100644 --- a/blockjob.c +++ b/blockjob.c @@ -32,7 +32,6 @@ #include "sysemu/block-backend.h" #include "qapi/error.h" #include "qapi/qapi-events-block-core.h" -#include "qapi/qmp/qerror.h" #include "qemu/main-loop.h" #include "qemu/timer.h" =20 diff --git a/chardev/char-fe.c b/chardev/char-fe.c index 7d33b3ccd1..ff4cee00fc 100644 --- a/chardev/char-fe.c +++ b/chardev/char-fe.c @@ -24,7 +24,6 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "sysemu/replay.h" =20 #include "chardev/char-fe.h" diff --git a/chardev/char.c b/chardev/char.c index 447b4d9d06..cc61f3a6e7 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -32,7 +32,6 @@ #include "chardev/char.h" #include "qapi/error.h" #include "qapi/qapi-commands-char.h" -#include "qapi/qmp/qerror.h" #include "sysemu/replay.h" #include "qemu/help_option.h" #include "qemu/module.h" diff --git a/dump/dump.c b/dump/dump.c index 642b952985..daa0c69305 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -23,7 +23,6 @@ #include "qapi/error.h" #include "qapi/qapi-commands-dump.h" #include "qapi/qapi-events-dump.h" -#include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "hw/misc/vmcoreinfo.h" diff --git a/dump/win_dump.c b/dump/win_dump.c index 0115a609e0..1772db8530 100644 --- a/dump/win_dump.c +++ b/dump/win_dump.c @@ -12,7 +12,6 @@ #include "sysemu/dump.h" #include "qapi/error.h" #include "qemu/error-report.h" -#include "qapi/qmp/qerror.h" #include "exec/cpu-defs.h" #include "hw/core/cpu.h" #include "qemu/win_dump_defs.h" diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 7752c5fda5..ec68281b61 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -18,7 +18,6 @@ #include "qapi/qapi-types-block.h" #include "qapi/qapi-types-machine.h" #include "qapi/qapi-types-migration.h" -#include "qapi/qmp/qerror.h" #include "qemu/ctype.h" #include "qemu/cutils.h" #include "qemu/units.h" diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 44fc1686e0..5005954b50 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -2,7 +2,6 @@ #include "hw/qdev-properties.h" #include "qapi/error.h" #include "qapi/qapi-types-misc.h" -#include "qapi/qmp/qerror.h" #include "qemu/ctype.h" #include "qemu/error-report.h" #include "qapi/visitor.h" diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 9b62e0573d..165ce95a11 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -29,7 +29,6 @@ #include "qapi/error.h" #include "qapi/qapi-events-qdev.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qerror.h" #include "qapi/visitor.h" #include "qemu/error-report.h" #include "qemu/option.h" diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c index 4f6ee930e2..991b2efa25 100644 --- a/hw/intc/openpic.c +++ b/hw/intc/openpic.c @@ -41,7 +41,6 @@ #include "hw/pci/msi.h" #include "qapi/error.h" #include "qemu/bitops.h" -#include "qapi/qmp/qerror.h" #include "qemu/module.h" #include "qemu/timer.h" #include "qemu/error-report.h" diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 7f063f5852..a24755c8ff 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -39,7 +39,6 @@ #include "trace.h" #include "qemu/error-report.h" #include "qemu/module.h" -#include "qapi/qmp/qerror.h" #include "hw/ppc/fdt.h" #include "hw/pci/pci_bridge.h" #include "hw/pci/pci_bus.h" diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 83bfc9dc19..1147e8d018 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -32,7 +32,6 @@ #include "qemu/timer.h" #include "sysemu/runstate.h" #include "sysemu/sysemu.h" -#include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "qemu/iov.h" #include "qemu/module.h" diff --git a/migration/migration.c b/migration/migration.c index 5703cc34ae..a6b3e83867 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -42,7 +42,6 @@ #include "qapi/qapi-visit-sockets.h" #include "qapi/qapi-commands-migration.h" #include "qapi/qapi-events-migration.h" -#include "qapi/qmp/qerror.h" #include "qapi/qmp/qnull.h" #include "qemu/rcu.h" #include "block.h" diff --git a/migration/options.c b/migration/options.c index e363b4885f..47577f3bc5 100644 --- a/migration/options.c +++ b/migration/options.c @@ -17,7 +17,6 @@ #include "qapi/error.h" #include "qapi/qapi-commands-migration.h" #include "qapi/qapi-visit-migration.h" -#include "qapi/qmp/qerror.h" #include "qapi/qmp/qnull.h" #include "sysemu/runstate.h" #include "migration/colo.h" diff --git a/migration/page_cache.c b/migration/page_cache.c index d430ce742b..af6683c45e 100644 --- a/migration/page_cache.c +++ b/migration/page_cache.c @@ -14,7 +14,6 @@ =20 #include "qemu/osdep.h" =20 -#include "qapi/qmp/qerror.h" #include "qapi/error.h" #include "qemu/host-utils.h" #include "page_cache.h" diff --git a/migration/ram.c b/migration/ram.c index 0a4a0d7a0e..a5f05c5832 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -47,7 +47,6 @@ #include "qapi/qapi-types-migration.h" #include "qapi/qapi-events-migration.h" #include "qapi/qapi-commands-migration.h" -#include "qapi/qmp/qerror.h" #include "trace.h" #include "exec/ram_addr.h" #include "exec/target_page.h" diff --git a/migration/savevm.c b/migration/savevm.c index c0e0585bc1..3c49f2dbff 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -45,7 +45,6 @@ #include "qapi/qapi-commands-migration.h" #include "qapi/clone-visitor.h" #include "qapi/qapi-builtin-visit.h" -#include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "sysemu/cpus.h" #include "exec/memory.h" diff --git a/monitor/fds.c b/monitor/fds.c index 17e9c126e3..4882db3232 100644 --- a/monitor/fds.c +++ b/monitor/fds.c @@ -26,7 +26,6 @@ #include "monitor-internal.h" #include "qapi/error.h" #include "qapi/qapi-commands-misc.h" -#include "qapi/qmp/qerror.h" #include "qemu/ctype.h" #include "qemu/cutils.h" #include "sysemu/runstate.h" diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 9d6533643d..912471f419 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -24,7 +24,6 @@ #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qerror.h" #include "qemu/cutils.h" #include "hw/intc/intc.h" #include "qemu/log.h" diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index 2d2e71b867..c2d81b2f77 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -27,7 +27,6 @@ #include "qapi/qapi-init-commands.h" #include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-misc.h" -#include "qapi/qmp/qerror.h" #include "qapi/type-helpers.h" #include "hw/mem/memory-device.h" #include "hw/intc/intc.h" diff --git a/net/filter-buffer.c b/net/filter-buffer.c index 071029a6c7..46738415b7 100644 --- a/net/filter-buffer.c +++ b/net/filter-buffer.c @@ -13,7 +13,6 @@ #include "qemu/timer.h" #include "qemu/iov.h" #include "qapi/qapi-builtin-visit.h" -#include "qapi/qmp/qerror.h" #include "qom/object.h" =20 #define TYPE_FILTER_BUFFER "filter-buffer" diff --git a/net/filter.c b/net/filter.c index 1621513bab..8ff1eae923 100644 --- a/net/filter.c +++ b/net/filter.c @@ -8,7 +8,6 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qemu/error-report.h" =20 #include "net/filter.h" diff --git a/net/net.c b/net/net.c index 5cdbd9c218..fdfe4f8eb1 100644 --- a/net/net.c +++ b/net/net.c @@ -37,7 +37,6 @@ #include "qapi/qapi-commands-net.h" #include "qapi/qapi-visit-net.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "qemu/sockets.h" #include "qemu/cutils.h" diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c index bf0d8acbd6..7b595bb00b 100644 --- a/qapi/opts-visitor.c +++ b/qapi/opts-visitor.c @@ -13,7 +13,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/cutils.h" -#include "qapi/qmp/qerror.h" #include "qapi/opts-visitor.h" #include "qemu/queue.h" #include "qemu/option_int.h" diff --git a/qapi/qapi-forward-visitor.c b/qapi/qapi-forward-visitor.c index 3fb2c954aa..613e6d0f19 100644 --- a/qapi/qapi-forward-visitor.c +++ b/qapi/qapi-forward-visitor.c @@ -17,7 +17,6 @@ #include "qapi/qmp/qjson.h" #include "qapi/qmp/qbool.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qerror.h" #include "qapi/qmp/qlist.h" #include "qapi/qmp/qnull.h" #include "qapi/qmp/qnum.h" diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index 82c3425566..f144ac1f70 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -14,7 +14,6 @@ #include "qapi/compat-policy.h" #include "qapi/error.h" #include "qemu/ctype.h" -#include "qapi/qmp/qerror.h" =20 CompatPolicy compat_policy; =20 diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c index 01793d6e74..a3214fa1a1 100644 --- a/qapi/qapi-visit-core.c +++ b/qapi/qapi-visit-core.c @@ -15,7 +15,6 @@ #include "qemu/osdep.h" #include "qapi/compat-policy.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qapi/visitor.h" #include "qapi/visitor-impl.h" #include "trace.h" diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c index 17e9f3b638..82b33b6b64 100644 --- a/qapi/qobject-input-visitor.c +++ b/qapi/qobject-input-visitor.c @@ -22,7 +22,6 @@ #include "qapi/qmp/qjson.h" #include "qapi/qmp/qbool.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qerror.h" #include "qapi/qmp/qlist.h" #include "qapi/qmp/qnull.h" #include "qapi/qmp/qnum.h" diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c index 6ea6a0c676..bb1c43a6d7 100644 --- a/qapi/string-input-visitor.c +++ b/qapi/string-input-visitor.c @@ -14,7 +14,6 @@ #include "qapi/error.h" #include "qapi/string-input-visitor.h" #include "qapi/visitor-impl.h" -#include "qapi/qmp/qerror.h" #include "qapi/qmp/qnull.h" #include "qemu/option.h" #include "qemu/cutils.h" diff --git a/qga/commands-bsd.c b/qga/commands-bsd.c index 11536f148f..5508bc02ab 100644 --- a/qga/commands-bsd.c +++ b/qga/commands-bsd.c @@ -12,7 +12,6 @@ =20 #include "qemu/osdep.h" #include "qga-qapi-commands.h" -#include "qapi/qmp/qerror.h" #include "qapi/error.h" #include "qemu/queue.h" #include "commands-common.h" diff --git a/qga/commands-posix.c b/qga/commands-posix.c index f510add366..6ea8a03e61 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -18,7 +18,6 @@ #include #include "qga-qapi-commands.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qemu/host-utils.h" #include "qemu/sockets.h" #include "qemu/base64.h" diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 5c9f8e0923..db973c2e7e 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -32,7 +32,6 @@ #include "vss-win32.h" #include "qga-qapi-commands.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qemu/queue.h" #include "qemu/host-utils.h" #include "qemu/base64.h" diff --git a/qga/commands.c b/qga/commands.c index 936634c50a..738d3d9da6 100644 --- a/qga/commands.c +++ b/qga/commands.c @@ -15,7 +15,6 @@ #include "guest-agent-core.h" #include "qga-qapi-commands.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qemu/base64.h" #include "qemu/cutils.h" #include "commands-common.h" diff --git a/qom/object.c b/qom/object.c index eea61a5068..66b02c0f22 100644 --- a/qom/object.c +++ b/qom/object.c @@ -23,7 +23,6 @@ #include "qapi/qobject-input-visitor.h" #include "qapi/forward-visitor.h" #include "qapi/qapi-builtin-visit.h" -#include "qapi/qmp/qerror.h" #include "qapi/qmp/qjson.h" #include "trace.h" =20 diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index be04b2c5ab..391ea8561b 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -5,7 +5,6 @@ #include "qapi/qapi-visit-qom.h" #include "qapi/qmp/qobject.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qerror.h" #include "qapi/qmp/qjson.h" #include "qapi/qobject-input-visitor.h" #include "qapi/qobject-output-visitor.h" diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c index 3d014f1bea..67ab1774eb 100644 --- a/qom/qom-qmp-cmds.c +++ b/qom/qom-qmp-cmds.c @@ -21,7 +21,6 @@ #include "qapi/qapi-commands-qom.h" #include "qapi/qapi-visit-qom.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qerror.h" #include "qapi/qobject-input-visitor.h" #include "qapi/qobject-output-visitor.h" #include "qemu/cutils.h" diff --git a/softmmu/balloon.c b/softmmu/balloon.c index d941c6b9c1..f2545a6e58 100644 --- a/softmmu/balloon.c +++ b/softmmu/balloon.c @@ -30,7 +30,6 @@ #include "sysemu/balloon.h" #include "qapi/error.h" #include "qapi/qapi-commands-machine.h" -#include "qapi/qmp/qerror.h" #include "trace.h" =20 static QEMUBalloonEvent *balloon_event_fn; diff --git a/softmmu/cpus.c b/softmmu/cpus.c index f7c743b0ce..bee6afbd6d 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -29,7 +29,6 @@ #include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-misc.h" #include "qapi/qapi-events-run-state.h" -#include "qapi/qmp/qerror.h" #include "exec/gdbstub.h" #include "sysemu/hw_accel.h" #include "exec/cpu-common.h" diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index b7b2bf18d4..9d608d5d65 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -27,7 +27,6 @@ #include "qapi/qapi-commands-qdev.h" #include "qapi/qmp/dispatch.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qerror.h" #include "qapi/qmp/qstring.h" #include "qapi/qobject-input-visitor.h" #include "qemu/config-file.h" diff --git a/softmmu/rtc.c b/softmmu/rtc.c index 4904581abe..dc44576686 100644 --- a/softmmu/rtc.c +++ b/softmmu/rtc.c @@ -25,7 +25,6 @@ #include "qemu/osdep.h" #include "qemu/cutils.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/timer.h" diff --git a/softmmu/tpm.c b/softmmu/tpm.c index 3a7d4b5c67..aee351e896 100644 --- a/softmmu/tpm.c +++ b/softmmu/tpm.c @@ -16,7 +16,6 @@ =20 #include "qapi/error.h" #include "qapi/qapi-commands-tpm.h" -#include "qapi/qmp/qerror.h" #include "sysemu/tpm_backend.h" #include "sysemu/tpm.h" #include "qemu/config-file.h" diff --git a/softmmu/vl.c b/softmmu/vl.c index 840ac84069..8bfe51fce4 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -129,7 +129,6 @@ #include "qapi/qapi-visit-qom.h" #include "qapi/qapi-commands-ui.h" #include "block/qdict.h" -#include "qapi/qmp/qerror.h" #include "sysemu/iothread.h" #include "qemu/guest-random.h" #include "qemu/keyval.h" diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c index 3c99fd8222..dabe89e4bc 100644 --- a/target/arm/arm-qmp-cmds.c +++ b/target/arm/arm-qmp-cmds.c @@ -28,7 +28,6 @@ #include "qapi/qobject-input-visitor.h" #include "qapi/qapi-commands-machine-target.h" #include "qapi/qapi-commands-misc-target.h" -#include "qapi/qmp/qerror.h" #include "qapi/qmp/qdict.h" #include "qom/qom-qobject.h" =20 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 273f865228..53124f5319 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -31,7 +31,6 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qapi/qapi-visit-machine.h" -#include "qapi/qmp/qerror.h" #include "standard-headers/asm-x86/kvm_para.h" #include "hw/qdev-properties.h" #include "hw/i386/topology.h" diff --git a/target/s390x/cpu_models_sysemu.c b/target/s390x/cpu_models_sys= emu.c index 4507714493..4b3fd70ea1 100644 --- a/target/s390x/cpu_models_sysemu.c +++ b/target/s390x/cpu_models_sysemu.c @@ -17,7 +17,6 @@ #include "sysemu/kvm.h" #include "qapi/error.h" #include "qapi/visitor.h" -#include "qapi/qmp/qerror.h" #include "qapi/qobject-input-visitor.h" #include "qapi/qmp/qdict.h" #include "qapi/qapi-commands-machine-target.h" diff --git a/ui/input-barrier.c b/ui/input-barrier.c index ecbba4adc2..8df118b440 100644 --- a/ui/input-barrier.c +++ b/ui/input-barrier.c @@ -21,7 +21,6 @@ #include "qom/object.h" #include "ui/vnc_keysym.h" /* use name2keysym from VNC as we use X11 value= s */ #include "qemu/cutils.h" -#include "qapi/qmp/qerror.h" #include "input-barrier.h" =20 #define TYPE_INPUT_BARRIER "input-barrier" diff --git a/ui/ui-qmp-cmds.c b/ui/ui-qmp-cmds.c index 0e350fc333..a7ce9c1892 100644 --- a/ui/ui-qmp-cmds.c +++ b/ui/ui-qmp-cmds.c @@ -18,7 +18,6 @@ #include "io/channel-file.h" #include "monitor/qmp-helpers.h" #include "qapi/qapi-commands-ui.h" -#include "qapi/qmp/qerror.h" #include "qemu/coroutine.h" #include "qemu/cutils.h" #include "trace.h" diff --git a/util/block-helpers.c b/util/block-helpers.c index de94909bc4..85b53e30d2 100644 --- a/util/block-helpers.c +++ b/util/block-helpers.c @@ -10,7 +10,6 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "block-helpers.h" =20 /** diff --git a/util/qemu-option.c b/util/qemu-option.c index 9440224e5b..6b86792ae7 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -31,7 +31,6 @@ #include "qapi/qmp/qdict.h" #include "qapi/qmp/qnum.h" #include "qapi/qmp/qstring.h" -#include "qapi/qmp/qerror.h" #include "qemu/option_int.h" #include "qemu/cutils.h" #include "qemu/id.h" diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py index 4b4a442383..a21b7b1468 100644 --- a/scripts/qapi/visit.py +++ b/scripts/qapi/visit.py @@ -356,7 +356,6 @@ def _begin_user_module(self, name: str) -> None: self._genc.preamble_add(mcgen(''' #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "%(visit)s.h" ''', visit=3Dvisit)) --=20 2.41.0