From patchwork Thu Oct 5 04:50:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729704 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp694998wrs; Wed, 4 Oct 2023 21:53:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTwSoQ2yKzwCWubnsIJBXPyH7AFWm8FjRcNKJHLHUc6B6o5cnlloOCypLNGJ9TdzGVj1yi X-Received: by 2002:a05:620a:2847:b0:775:ce3e:7bff with SMTP id h7-20020a05620a284700b00775ce3e7bffmr3276961qkp.32.1696481593132; Wed, 04 Oct 2023 21:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481593; cv=none; d=google.com; s=arc-20160816; b=PNFGekJyk7BipE3s5hDwfdwYS9Mj+elfhXmRRMmbvY5wPPl+qZsucs3rztquIaVrGX ZEHkSc0Kldef2eeszCjGoeahAG1Un76gyJANukBIVsSHlIBi97uvpZ2nQOYK86vfAoCc ebYHcEO9YXtj/VJX/vSANr5tz3Wa32FseckGSQFNJRL/8HAy+mBwzp+OfCRquMas4XTi H0IHiMjW3wGW+dC/AXB85Y9zJDyY+jViAcPEOiFPmkBhTko6PLWwIHCscPrvtB2LGK/z umfEWooBErQoEONsRIN1c74qloubuxjcB38nhqy8LoWsCvh3IAxnTONqi6Xm5Dus5AJS kfyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zxIwwvtSDa6HXj+GPDZLsyAAO0jyEUx+3zbxHDZan+w=; fh=c+VVz10n7KAlu8gpz6nnUtnQFNzd2eguUG1EsrUYgts=; b=HkDlwnzL6J8HuZzoMTnCl9l57mtb6t7DqmiC1iDjs6Al0DgvOE3ky2Zz0ihZQvbOlf Z6zhJwhtlpcYNdmJ3YtUBss7QAPHwFaZIl7cP1552BN7a7Mqsx+XvHxQV+T3653bM0v8 Rm7R8xUvDg3pxsRaTSvDhHLkNAmR1TBrwGRrY2cYEl2KQkHxvBpuzmK6Zf4IUNLqHTiJ D+y9EZJyZMjt4dlaUG5BvMoVQag5eWjk6paUgMgzZTekAv4aLIrZJ9mCgklyXLvTe0pe 89uOGaeKtEPvhsPGMJFRbbS2sHt/2E1ai3Y9AeelcgpzMZu0ECn+ZSnzlnELVKx40Xer cZtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lYp3Rah3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t20-20020a05620a451400b00773c792bdcesi407422qkp.545.2023.10.04.21.53.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:53:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lYp3Rah3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGKT-0005RU-7p; Thu, 05 Oct 2023 00:51: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 1qoGKH-0005Gs-BI for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:11 -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 1qoGK9-0005RW-Nm for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:05 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3248e90f032so580025f8f.1 for ; Wed, 04 Oct 2023 21:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481451; x=1697086251; 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=lYp3Rah3WIR8DU2cOsjo2zMX9kyQrgP48g+O+DQ8/PHjLbTENBjoJKQy2K7W05qp8X w/yxFqIv/JwZaiwSDi/K/v+wblVPG2ch1Ph/SGPX/khHxTAsxN2nc6orUbwPqs6fxnhX QQS5j+bB7ik4qt3XSBYzF67Kvz7teWM6qFfq3Uw1QUxolyaRfaafPjlhsyM4EHmZuvcg gIjC3fpjupjUq+XkMKIKk2mGcAUPsA0HYFg6gy/8vIXDh1/WWn10RxmzGGrASsdP9K9q FgoQP2K1cGTrzp3TNm+v8ymXC+kfghBzC+kn3dCo2fHHM42NKjKRm5ZW4Adyf7ccqlIf xIWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481451; x=1697086251; 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=ZVYcTr/0op3/2ZV+0WKM3QSameorVp4rRMPeb2vgWyXC3ZffgDAtkwqOF0nI36IY7F LbsdGEuLfy9E4QBs96PUiV6XrFRoxbFH5ykF0XVw+JajBsqRRlpVakIHmDpIm1txgCtR eAM/hrxDZbqXw9b9M2umVguHh3O5pbRj1VkB+ym4969gegyFi7l/kWyjokmLoX6XWbWq 1wNvxysdWW7G+cFXadh+RJX/w84a8e5gD35/fpsqB8mN8SIwnCAOVimcHfe9nPJT+reK PQKsQiK475dYNpD/awZUn+YnrjCR/fqrFLAkUTU3paMlzLJJkLFJX41s0qpsMH06FumT roSw== X-Gm-Message-State: AOJu0Yy+iE5P0oxPJID65aJPCTLQ1Wn7Bj/Rvk6iMaemACyZJW6PJMGm Qjv48hxuhckLqaxlO501BdSbjKkGp3KY9ogoZCQ= X-Received: by 2002:adf:de0d:0:b0:31f:e759:d687 with SMTP id b13-20020adfde0d000000b0031fe759d687mr3578604wrm.50.1696481451473; Wed, 04 Oct 2023 21:50:51 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id u2-20020a5d5142000000b003142e438e8csm751402wrt.26.2023.10.04.21.50.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:50:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Nicholas Piggin , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , David Gibson , Harsh Prateek Bora , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH v2 01/22] qapi: Inline and remove QERR_BUS_NO_HOTPLUG definition Date: Thu, 5 Oct 2023 06:50:18 +0200 Message-ID: <20231005045041.52649-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Reviewed-by: Cédric Le Goater --- 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! */ -#define QERR_BUS_NO_HOTPLUG \ - "Bus '%s' does not support hotplugging" - #define QERR_DEVICE_HAS_NO_MEDIUM \ "Device '%s' has no medium" 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_handler, * 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 = drc_from_dev(phb, pdev); 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 *opts, 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 *opts, } if (phase_check(PHASE_MACHINE_READY) && 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; } @@ -904,7 +905,8 @@ void qdev_unplug(DeviceState *dev, Error **errp) } 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; } From patchwork Thu Oct 5 04:50:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729707 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp695209wrs; Wed, 4 Oct 2023 21:54:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMxnVxV7+07GOkzNMTieSj8FfaTiPrMn23iC86uzaFhJSk70r321trC6Uep63uP/7MyA7X X-Received: by 2002:a05:622a:1a1f:b0:412:1ae0:e127 with SMTP id f31-20020a05622a1a1f00b004121ae0e127mr301023qtb.31.1696481649543; Wed, 04 Oct 2023 21:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481649; cv=none; d=google.com; s=arc-20160816; b=Jj5R+QDXU7tHjrBAvTTJQ5FGh8A5jeSACbV7t9vdxXA/Yy3z7Iax39mMG8XFy8D+ka nRpLXOMrtF7JncDpcTbvI4nBC0czXCAgLOe/egc5L6lDQu6msl6zhFykbOguY+6K8h/I CQXUjyiFcx1cJJbVA1T/nj7OHO0fs/sS7IuREBhbSb/OEXY1pzDsGWhpnOermbtW1lxR lrC6OZ5DwxJ6Nr5EzJZ3AMBqF8FCFHPhWgrMhgWC+gsQuKBGh/DWKlL9R3H7kfEtbzMy bvASx8iqA7AVEv233WysQCDdS6BzxM7bGMgrzTReVyS90Vy12Lnwws7RE8AksJNy0ENy gs9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iUgMeUD+upV2LccJ26enpy7uECYexY6ww0G/2qJYl+4=; fh=hQC7qgxuI1C+CoTC+aPjdtvWzX3JHmASdQZJ5g3QVcM=; b=tm0ARVHQbERwXeSExWCFtODhLhlna5gwX2o1tLUzt4T8tvf0/Gs8N2bFoWyFKYHFHP EIUFUZIrTgLoMoqNMWrdl2vO4uzVSfOHMNovhrtdB8PYWzkzRuSp7eZNdghLUl7bAiVn 5sHP+KsR2AIahFp89qlv6XT93ScoAibZzXl3IMn1LeX3IrTnLpPNJeQMjHVDMSIUeh1S EWCaQ9lHK+l7u6qsr/nvGdMjbp2MPc3Q0rJBdPx5qlXkeUvxpddKaq3klw0kiO3WtSgz ayW+TVKeTLGI7IE5KI5l/qBvGgUwglHCdhzUfuzWcDarjd1669Pvk/TyJedt/I5OmQDq qhkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NVXIzMMk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c5-20020ac87dc5000000b0041876c7529esi408563qte.463.2023.10.04.21.54.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:54:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NVXIzMMk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGKS-0005Qt-QB; Thu, 05 Oct 2023 00:51:16 -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 1qoGKL-0005Hu-5x for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:11 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qoGKG-0005SE-M7 for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:08 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40651a72807so5064525e9.1 for ; Wed, 04 Oct 2023 21:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481458; x=1697086258; 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=NVXIzMMkYtI5F0kODpz6zRRwRgIUY7oPA57T9Fof+f3N0dV+PHUSe4J4k1/E0H8oda zCoJH4j74mYudNfMq9N3uKAu72Uny/lV0UDTgwI6AjKkEvWk3tskWLcr0YKw5yjz9sNT K0wbN2Bde7TO/1h6dW243sssc9H65PoU0kKOrns9GcoSecGa/EvqoWbzNPZWQUl/fF9k sPdNcmCnk6dTwrRmRnDEItaUkh40Su4RTZBKm6nSnuVV+IBn1LoULqulG0Kz4cPb02H2 52wBUsQi/qfciRz++neVuSZlS1Iy/ElQe0T7hw0fE8EvtPcVm6/ob9uJbYAVkofKp9oz HNvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481458; x=1697086258; 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=isG+8TuaQ1dnokCYMZvHUuHdwpsQz2Yf2Qe2R42c/YGyiFsoQcQwu09iYwT6GWjjGZ OIHQ8lrV0EtHlmWSl+4RlYexe2rsU5IVXVsdp4aJcajlMZVdsw9k/al60AAHyx6UcGj0 V1/Dhh7vu4EyBnaEEC2WQ8ymlTOk/bd7fgEC3tJxJ2odrfhz5oWWMYLQ1mUrgkUX/LFq yg8y/khz27s3Bm6Cq1a1OqTvIW6qycDzCrSqR1mO/35OlkZDzA5nD7dYzIQ1cQ2k02mz rm0MuNhpTOAQ4voDQ4QMLtmeeR5xGtAGHR5fTCjtNgb9GrfzvEtYihAvKmalAwDHURZL +eMg== X-Gm-Message-State: AOJu0YxXFnSYm4WQmPEvFuQIgMWQ01zfANEm2y/RnQilFFfsUtJBSxBG TGs/PT6KncvKFRMG633tMzdVKVpK0y50kgP8ZsA= X-Received: by 2002:a5d:4d8e:0:b0:324:7bdd:678e with SMTP id b14-20020a5d4d8e000000b003247bdd678emr3802256wru.60.1696481457809; Wed, 04 Oct 2023 21:50:57 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id o6-20020a5d58c6000000b0031aef72a021sm746323wrf.86.2023.10.04.21.50.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:50:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Kevin Wolf , Hanna Reitz Subject: [PATCH v2 02/22] qapi: Inline and remove QERR_DEVICE_HAS_NO_MEDIUM definition Date: Thu, 5 Oct 2023 06:50:19 +0200 Message-ID: <20231005045041.52649-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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! */ -#define QERR_DEVICE_HAS_NO_MEDIUM \ - "Device '%s' has no medium" - #define QERR_DEVICE_IN_USE \ "Device '%s' is in use" 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(); if (!drv) { - error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, bdrv_get_device_name(bs)); + 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(); if (!drv) { - error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, bdrv_get_device_name(bs)); + 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(TransactionAction *action, bdrv_drained_begin(state->old_bs); 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; } From patchwork Thu Oct 5 04:50:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729705 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp694999wrs; Wed, 4 Oct 2023 21:53:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4FcAEuafRx7wNlUjpL49Xv6AEMfGcHBTs+4brSIkeh4Chp8uSEfbrqHi/SeSnx863vVtA X-Received: by 2002:a05:620a:444c:b0:775:9bc3:c492 with SMTP id w12-20020a05620a444c00b007759bc3c492mr5268744qkp.7.1696481593389; Wed, 04 Oct 2023 21:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481593; cv=none; d=google.com; s=arc-20160816; b=K1DvkitytSfJD4hFR34pErqjVumJshm4FxLp/CcnDY9ODEZ9F8p1bJTqHlLrcVkK6+ gN1/DegpLPrk76owAvHZrtvYPI7HjidC5oi4DidM79lZzuXAetB3RYLs/v0Tx+oiQYgk UE1JOCyaEWFsj6lwVLB/C0EMmPHy3HxzdKOwamNh9u/DZyr3xcZYYn/UK+lyePkInZDC OV5EnmDDRZNA0OgpD6TjLlgVHKvYK7/HwzNlQcU+uug0npTAXUfjZaBLlXJNJdBSV5K4 uyg87XbX3FGqclWHRyWmjO57ZJa5/5wva2q6kQRXatrGpOIPXkFT9iWdtZCamIEuHOYF AHJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bBDxOWnGC99luImlqjntVhvHvQ5f4z9cF2Uz6KLOjxk=; fh=Zqss3DfmoBwdRU7PdTHuedy0/Kl0JhC5UcIz397tYYo=; b=fNInZXxw+sIKEmt1pyBZB69dnDwGymlkFmXTn6VY5i4DC8vmu2MzLf5RJ0oIs58oKu BkkEw3I/9mB+hyNRwNGzo6lwkglolcuxrsmXKr+2D08vzxHsSLG1gRxAKOLJ73DU5zK6 V5UUIFg+M7QuBYjuBPEJGINB4XWAsDR61MlZqIaDib5D/nXbfSyixoWgua8IuI7URI59 8UMzWdg7eWF6Ozh66q33MD0WB6e8KLtIVMh6TF6u0zQs7Glh9a781fohTgG8SiKd7haw fzC7b/Hwc0yPtlcc79cQW8xEVEGPTf6O5i5irDueqm22vsJUQtaS6tL2O6Q0Q5J0YFPq dJiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nyu1TCQd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id br42-20020a05620a462a00b0077573396927si417345qkb.260.2023.10.04.21.53.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:53:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nyu1TCQd; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGKS-0005PB-1H; Thu, 05 Oct 2023 00:51:16 -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 1qoGKN-0005Ik-LC for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:12 -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 1qoGKI-0005TQ-QH for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:11 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-32488a22810so506350f8f.3 for ; Wed, 04 Oct 2023 21:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481464; x=1697086264; 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=Nyu1TCQdiopw44rhqWnMJC4Usmj2wzlevTkghe2KtCvEA11j5RQJZI3RY9uT04GSMy d/vnj0qElBgbi6icb4NlMfyYsNgo8tb/0aOvMQ6wIn8KBavfTFSxk6bfXTEvPR+Jbk62 LJdcrjXaiRllBViJOOwRX6xZ2XaxE5D5V2aHnI5WbX21WnDSAZdvTsdmgwBZmJ03AuaS SXYubDi0/D1wnlP78bTzDL9HOEIYsMt0sdhj3WHK4NJq9GKlrtfypWAdp0IZvAvEQO66 4CA0flnL3bytOQiWqbJnFEqRz+HS3E1lrgo758MkGYc9iBuOsNYT7DFC6yTtScGNY9rj Aaxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481464; x=1697086264; 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=Z77dJl31EoKg54WnPLb0yuDG3K87Dd63ROZOTtw2yejKVUQSSDJtdWZhKr5uvK3onp OjTU05MK5sENkEx+2FpXrB9HavjmIaPIb+4ERu5qHzW9TzIAGJq8abCN/bP7QAvg78xk IZYo9xs37bAsbtF1n7u5UGfk0x9CvGGx1TXaU+kQJuel4fH4DLu/+ituRrqDckDhlzC+ VB9wKBPbwvJRNlyKmniKDs74eiCnP8+mPbfIryYLzhSd+Tj7q7X4Lx7H8uOnuBTXXDmL 0Lpyy/AZbyOFEE6TOfpB6FeNDSG3/MPE9AGLvxSxXtHo6q+YOL1mkn4vFSU+dKWDQZkx J5Wg== X-Gm-Message-State: AOJu0YxxXdylr/l+mKypnnz7wJbDis6BfDuXoYaJbPg2bv4QHrMjcDXj 9b6khfOLLF8Bd04oohdumwkBORnaz/eBK/0YH7o= X-Received: by 2002:a5d:5309:0:b0:319:68ce:2c53 with SMTP id e9-20020a5d5309000000b0031968ce2c53mr3713824wrv.25.1696481464321; Wed, 04 Oct 2023 21:51:04 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id f14-20020a5d568e000000b00315af025098sm749160wrv.46.2023.10.04.21.51.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:51:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Kevin Wolf , Hanna Reitz , =?utf-8?q?M?= =?utf-8?q?arc-Andr=C3=A9_Lureau?= , Paolo Bonzini Subject: [PATCH v2 03/22] qapi: Inline and remove QERR_DEVICE_IN_USE definition Date: Thu, 5 Oct 2023 06:50:20 +0200 Message-ID: <20231005045041.52649-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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! */ -#define QERR_DEVICE_IN_USE \ - "Device '%s' is in use" - #define QERR_DEVICE_NO_HOTPLUG \ "Device '%s' does not support hotplugging" 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, } 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; } 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; unavailable: - error_setg(errp, QERR_DEVICE_IN_USE, s->label); + error_setg(errp, "Device '%s' is in use", s->label); return false; } From patchwork Thu Oct 5 04:50:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729711 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp695697wrs; Wed, 4 Oct 2023 21:56:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHG5F3oo+rGaIq0dyNuh5yREdeWKolm5mEI6f0jeYuXtLJqgUrr2dnr5nJ/5RLjAnB83oGH X-Received: by 2002:a05:620a:21da:b0:76e:f320:9b52 with SMTP id h26-20020a05620a21da00b0076ef3209b52mr4186269qka.73.1696481770486; Wed, 04 Oct 2023 21:56:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481770; cv=none; d=google.com; s=arc-20160816; b=WrDo1FrpzTTFVi2mNxD/BKDxZTDSk/YYN5659ufieWOcQakqpBe+YRlKuLnhH06fkg CrBpDkQusnPjraLeH8lt6g6Ihrz40JdaH2NjVhMR+Vv3RWcPCbRl/4wlHP30E6d+IHcD q4hQc0XQ/U/ZrYA/YepFS8hhcf4mzAIP9J5pjVzkgMM8zLNGRXHJ3LtDe/mmlwcuJH/y l+z3fp2nbrJWPU965yx+YY2bi6hydFVCCPe0WIn0Rn3c+NRednHXaKcdwE/CLEoCZk/Q rn9JHRu5w6ZvqJbfsNsYbNMjvLMf0Z7BtdyXrS3gY+uBc5bot4Aecx9h9a46o4M9G2Vi EVWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4tlfU+e5P66No2dfLjlw3nceh1BAOvyaTo2g5TESIX0=; fh=r7t9u1m/3sV3OYOunn66FtVWKqNKkVkgluAHIqk9tCI=; b=O2Jx0PvobQrX9JMYwt+Ts3U6Q8HpMEbhtmCs6J3vPas2fiWQ7EuBayWTNQhd3Cm8HN ayNjPxwOvCcwZw6m3sdQAt23WLm1P58feFkn/yDMQMiS5rQ0q0OCnikbX4GpHx1FYEQr 9UR3Fp5WvXuQWrH6wJLOfYt604ch7Y9rFVynBTg10TQMVQ+s3jf0zbT4pNQBLRbLW07a nmjWrd66o62UU7qVcEh7Zws8fUr6gFyZioG7XOMmyldQQYrrlaOtUErckOhLxNzw3vat 58Y1Lz7JrtAVUjMVH4AouXczYJPOTt412xLFcqfiX311CijUPw9GbRlqMfaYdNp5MMbP kdMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z7iD+z5l; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e13-20020ac8598d000000b004198a46d6d9si433900qte.30.2023.10.04.21.56.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:56:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z7iD+z5l; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGKU-0005Sq-IM; Thu, 05 Oct 2023 00:51:18 -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 1qoGKQ-0005NY-Ve for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:15 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qoGKO-0005Ve-Ax for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:14 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4054496bde3so4906025e9.1 for ; Wed, 04 Oct 2023 21:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481471; x=1697086271; 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=Z7iD+z5lHYf0k9kk2uatQUYFyePgewaDtoxGu60m3AWyMGEXNkcDDAc/ogv5MmM5LP p19bNmHH7j/mN4nEGdMUIyprb7sbm7TV6WCCTY+LfBbvoz0podAciwDjrLxQ7NMOHTbJ mBNwSYafVOwdu3Zk/C19+HDV5VVOVFywGIfkvMMOe944qypBo6vAXWSSfTvRTTQN/fpv VM30NbCUjmM1mNfMM0VBQf10YFtjvShsGVnTPJw1kVUdSjHbE6AYBg+MnKLuB5f4Uj+o GArdoDdfcMMXLVsPGxbpRRJKBjHp0yQIF62v8amEIIMLy9f3XuEK7WA/vSkRbJJC/fVL 9afg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481471; x=1697086271; 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=WvvuJ9CoPrgByLoZz+qVYFTeKwOPnXUy3DiStTY0VnUSGkLaUxG3J9LLgiLh87/Nah F5WKIZfZjdn1R1eHbjnct128+4Tejr7p94OkI9Pycy+x6tB81xgLt03+Z1fapTsKg8/W OAov0ES9oJYmGjF0kKAkgLNDxrireaaeqMqekHKdU69vV7zvKNp2gpGwrIhyylcBG3hT AaHOoNkFJ42ForMWxmXsj/HlhiLnz76Q109bQlb+fKX1BG+7x+DQ7AeeIn/GGwqDUt2Y naSEW2Iz56lwX9qjHNuZsUwuSWxp7cQ4hq6jxHj2lZO96pjSHcy0PHO5FITwxg2rk6kU JEZQ== X-Gm-Message-State: AOJu0Yx8rYtEr5DPhPehBT5xVm1RA0khv+EkFnmHC97lmtKKG8fCXcpY 5xPij9bT7Kc6S+OMZwZtdnsCuA1Nma1IIUBtvmg= X-Received: by 2002:a7b:cd85:0:b0:403:cc64:2dbf with SMTP id y5-20020a7bcd85000000b00403cc642dbfmr4199063wmj.27.1696481470736; Wed, 04 Oct 2023 21:51:10 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id m20-20020a7bca54000000b00406408dc788sm2866220wml.44.2023.10.04.21.51.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:51:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH v2 04/22] qapi: Inline and remove QERR_DEVICE_NO_HOTPLUG definition Date: Thu, 5 Oct 2023 06:50:21 +0200 Message-ID: <20231005045041.52649-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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! */ -#define QERR_DEVICE_NO_HOTPLUG \ - "Device '%s' does not support hotplugging" - #define QERR_INVALID_PARAMETER \ "Invalid parameter '%s'" 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; 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; } 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) } 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; } From patchwork Thu Oct 5 04:50:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729702 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp694861wrs; Wed, 4 Oct 2023 21:52:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGEltt9bL/JNtWtiObQjYlRF5Wa0nRRdZ5GfEz0CbDLYcjFGAn6bOCadXtXLvr/g1BENZzK X-Received: by 2002:a05:620a:4793:b0:773:c792:bdda with SMTP id dt19-20020a05620a479300b00773c792bddamr4745176qkb.53.1696481559093; Wed, 04 Oct 2023 21:52:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481559; cv=none; d=google.com; s=arc-20160816; b=XI3YyPv76jIgFjtbHdqD6TRoV0n8yxhufOf7v3OkSRzJ0zveoYE8UTvbCYj91FB7gK JyJ+2bD/027NbKa5Mg3kMohcA3bq17WNfFqmj5mDcLK+NFaSoREdqQm4c7mketYxEk8u TxexDDuOOsU+lg1hmI6vIEPDl63LAHfT/LR6lz2+3H6bR8XulwtBjNOB8ENzOdZs6f/q a/hvwPsdx4NisPnHD/5qYqBJnt9tvUy5ZlejEDvKPbN3VaLtgZW2s0w7dc1ff7kdZw55 sFzKYTn+Lr9hev6lfHga536zhIX8DRM+IVfl1M3ZOASb5EUh7ofLd4V/9pdRr2BWGU2m F/5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=i0f/S9sk5n4iTXtNvEpxFckitQTJsYOjTpjl0/I1BCA=; fh=Z7Pv+eyhTL5wOgIfxY9/3/BHWOZWo37vnRD3FWoic8E=; b=ueOc2qAaFEHYn2ZUyFTgSriiu0slKEF1dz431qXjOhXWQRWLa71OAic+ipxGZHwDXx LwlDQl3s8U1kxAYV7bXEggkgGEhXo3Dih02CZ3edr5rC+QsbmraqcJCHhQl9BcgrlBF6 1UB5/MmftA1JRU9TmoWez/WiR8G0n0dedkj3rna8KvkODpM2on5O3VvF0vhe42fOwc1a EE0IMg+fOHGMoWkl3L9I4MdrzvooL6yZAedNEKsDpGiJ6mu9Kr4NkOh1Ir8h8ZySybvL VrkzM4EHtCbKVKJN6uIOORXEIESxmkfq9r5V6GDVYer1SjlKItIJz643V9Bt4p1hFSQy 6izg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="reKEUX/E"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ql13-20020a05620a890d00b00773a23eb2a8si406932qkn.671.2023.10.04.21.52.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:52:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="reKEUX/E"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGKa-0005Ya-4T; Thu, 05 Oct 2023 00:51:24 -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 1qoGKX-0005Ww-PC for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:21 -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 1qoGKU-0005X8-S8 for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:21 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-405524e6769so3034865e9.1 for ; Wed, 04 Oct 2023 21:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481477; x=1697086277; 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=reKEUX/E5S9dXFUpMCzT1K/QIvP9KkZ5kyXP6w9VMwXm/jsRSZYWyRBnglh4q8LF9P Kh30Y197bawa6rHG7npdnA0zJz6Jfc2tRy4mwKjESgIim0vGG6J/yJLAd2vEHI4VReIl pT4No/0bqeXV+ltRjd4hEki/o+8Nlre+Z9+JGpdWkcddiVhzEqBi35+eut55BK/83mvR h9syXsb2htdzDSIhTAY855lt5CZ3G/IaxVoDAc+GjDvyd6fn4l14/ra8OHnJeVlZVc9z 5GBUVFlHgLrMtkgTuORCUQ37DnEbQA2eOmCP/c2vJUgGsoOJkNkqd/rerEB8SaMneFz0 2jDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481477; x=1697086277; 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=jnOodSxwK67zBGvs7KvoKZsK3dObcMu+f9DV8smU95QYhiDJ8z3+IZqwxYvdbZGq5e i85mUrTbyIVhBy44Zvjnc3sGQ3A9e5bcO8yEejgEUaR7Pk4lCVCX8ep09HYToTMwwf15 UmNGR1/h6p0CK0E+1GkO8FQIco5WviftHhF2AtczdXYzpPV2TxQR014qLRS7nxMMTmnl S8IAgLWm+9B0BGHlSlalnqyOy8ukM5RzQ4Axomv962CgtUO+WSJu8p3q54DxRWK/VeUs G3DeYZADNzSarAQ+GjeC0uICl5/bxyPzA3+BR8B4rGV6wjRxrz/BXtHZDC/mzQydNP/C wr8A== X-Gm-Message-State: AOJu0YxyMJkhEvG3KItQLS9u8YT830FYytPjM+VCiROJ+sjCXwohcd62 EXubSYP07fAfZVeutUjj8uXGDW/L2oJdLGx79Do= X-Received: by 2002:a1c:7505:0:b0:405:3f06:d2ef with SMTP id o5-20020a1c7505000000b004053f06d2efmr174242wmc.4.1696481477187; Wed, 04 Oct 2023 21:51:17 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id y4-20020a05600c364400b0040472ad9a3dsm623215wmq.14.2023.10.04.21.51.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:51:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc?= =?utf-8?q?-Andr=C3=A9_Lureau?= , Michael Roth , Konstantin Kostiuk , Gerd Hoffmann Subject: [PATCH v2 05/22] qapi: Inline QERR_INVALID_PARAMETER definition (constant parameter) Date: Thu, 5 Oct 2023 06:50:22 +0200 Message-ID: <20231005045041.52649-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 = f'"Invalid parameter \'{param[1:-1]}\'"' # Format skipping '"'. coccinelle.fixedfmt = 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é --- 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, s->fd = fd; if (has_filter && !length) { - error_setg(errp, QERR_INVALID_PARAMETER, "length"); + error_setg(errp, "Invalid parameter 'length'"); goto cleanup; } s->filter_area_begin = begin; @@ -1841,7 +1841,7 @@ static void dump_init(DumpState *s, int fd, bool has_format, /* Is the filter filtering everything? */ if (validate_start_block(s) == -1) { - error_setg(errp, QERR_INVALID_PARAMETER, "begin"); + error_setg(errp, "Invalid parameter 'begin'"); goto cleanup; } @@ -2145,7 +2145,7 @@ void qmp_dump_guest_memory(bool paging, const char *file, } if (fd == -1) { - error_setg(errp, QERR_INVALID_PARAMETER, "protocol"); + error_setg(errp, "Invalid parameter 'protocol'"); return; } 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, Error **errp) gei = guest_exec_info_find(pid); if (gei == NULL) { - error_setg(errp, QERR_INVALID_PARAMETER, "pid"); + error_setg(errp, "Invalid parameter 'pid'"); return NULL; } 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 **errp) assert(opts->protocol == DISPLAY_PROTOCOL_VNC); if (opts->connected != SET_PASSWORD_ACTION_KEEP) { /* vnc supports "connected=keep" 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 char *id, if (list->merge_lists) { if (id) { - error_setg(errp, QERR_INVALID_PARAMETER, "id"); + error_setg(errp, "Invalid parameter 'id'"); return NULL; } opts = qemu_opts_find(list, NULL); From patchwork Thu Oct 5 04:50:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729723 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp697168wrs; Wed, 4 Oct 2023 22:01:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEYyLYm6I+tlX9ySD/LBVLfJ81kDo24bguUgdUdTsHrNKSeMT06oYcZRLYuTALHzd8brppz X-Received: by 2002:a05:6214:488e:b0:65d:9b6:b9ff with SMTP id pc14-20020a056214488e00b0065d09b6b9ffmr4874511qvb.15.1696482072668; Wed, 04 Oct 2023 22:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696482072; cv=none; d=google.com; s=arc-20160816; b=VV6np1CxAkVZGoRv45W9P0oIYwvIfcroT+emCNBs4H02mP5w7h7D1doasucdkz/10S fGpWK5sSn/0525LjYiqgcYaCROXKv/XCXj2ckf0I38R+Q9hPG7jQmDBN4jTf9001nmXl aj5KRu5XezBobeW2lDAhjml4YzdrGVCGUAHpIUqkqqB9l1kNv2eVCAE+o4o6IAWhzj/A eUpOLQIJgF0+yNeP6j3HnMCsLdJMmzQAFVD/4bJ4Qwd77m8loKyFah1jzytwF7UbLEjI twjmWhI6drnHxzHgKsGfidYsrDG85RfyObMcPAF+DTKkgHgX1e2gV4u1hICvt5jQiqha RTjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mQJAMU/w6o8m8TBpb8PzaVjQ4Gp1ZRSyPEWXTvxRp/M=; fh=ijKMo1pDu6TtK35CgkV+A4bzObOA/9yc38s67OINvPA=; b=bjZ77129qSDXFenujs+jHTUoC6X1vfPquxIRp22fZa1l6+nv7szCdKR0MFFFDHXk8n 7M4VbCz/NYq8iglSYlLuaGFAScAzLW19r/CQaTexOdhVAYcParlxLOSi8/9MPVKyLapw LqIU8osy0CKSGAdXrsS7McIyTQBDtzdVVZGJ2HdeX/7FKjm/SRLmy/M+GDK6mjBQLr++ 9cVxchI7mAIBKGd29vxKzCAhGGs9CPj13nIWfKtUwVrqCdEvvkUqcaHPrr1f6T8yoYay VOrp3K/BjGTrFi8aCnf6mK8zYrd482xQC7KC0IylDqYTZ9W73au+ntVAtAkuZ66NAiH7 8FiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gCE//ubl"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f18-20020a05620a409200b0076f2c73cff6si412790qko.697.2023.10.04.22.01.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 22:01:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="gCE//ubl"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGKt-00067K-FF; Thu, 05 Oct 2023 00:51:43 -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 1qoGKs-00066U-2s for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:42 -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 1qoGKb-0005Zt-5N for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:40 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40651a726acso4850815e9.1 for ; Wed, 04 Oct 2023 21:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481483; x=1697086283; 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=gCE//ublxXWKxHmL7oM6TpQw4h7XLRzAqKeCyu+Y2CJZwe7kfCIKnZ51S10lhg9s3+ /cnC6SNbEnU5hhcsy0d1bmEWZssgJZvMm/OInpuIPOa+xhJjjt2yhRmHeY/3YUXxfbTf yR1TQ6DRlE1ebFirlPj39jSvmE4FtPtDn4Ewh/8wmPcIIBrpgRmGPCttkZfViBDL5sYr J0HeljewFvHygE68Tm1MmmsGkFLTcoeXOadXOKDuFTyZrr5Jj0f/d9Wz5ZwBmdVibV5i wbjS08sWijIG61FhP035mAk0ewGWpkcN1cJxsdqVX3GodHxX9tcNs0de/HJqxZtQiqMI gIbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481483; x=1697086283; 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=ms6x82ETAP/yB/+3HJY3MvNI6fCtVVgR9c34Kx8+04xlnQVnOugHu//753hik44RyQ 0UVfOjRqceolHI+2UcfHaynUVIjXRcj41C0yWOs0URUmhvuGJySolOTgL8HTBq1VJKr+ ppG1r2VygoZWruWD/pBLIiSQGkdUx8dEdFhCLdSfqfguVWFDS+o9tM6yBvq7YM8fk9+Q 2ZwP9sAYtGpHOeQlgOWMp9NrEZeGGNbb+GX3S9yWD+FtDmn5fTmWXTDCNPpE7ZTZQbAz XU7NUxQ2bDQEGzubn48hYCT76zi/X0/R6FEhF64Jh3cssbkme2edr5Ixg2J9Webom2CJ AkgQ== X-Gm-Message-State: AOJu0YweAT3Z0fCP9uPFZDGe6AqYdHv6mW0/BLOYTzVVQVa5WGzsGcEl PjA1axcTOt1SqMRKPo/CB5LwELmdkY0q/xrsx7Y= X-Received: by 2002:adf:de11:0:b0:31f:f753:9938 with SMTP id b17-20020adfde11000000b0031ff7539938mr3660400wrm.58.1696481483506; Wed, 04 Oct 2023 21:51:23 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id z11-20020a5d4d0b000000b0031ff89af0e4sm739425wrt.99.2023.10.04.21.51.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:51:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , Michael Roth Subject: [PATCH v2 06/22] qapi: Inline and remove QERR_INVALID_PARAMETER definition Date: Thu, 5 Oct 2023 06:50:23 +0200 Message-ID: <20231005045041.52649-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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! */ -#define QERR_INVALID_PARAMETER \ - "Invalid parameter '%s'" - #define QERR_INVALID_PARAMETER_TYPE \ "Invalid parameter type for '%s', expected: %s" 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 = NULL; - 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; first = 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) desc = 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; } @@ -531,7 +531,7 @@ bool qemu_opt_set_bool(QemuOpts *opts, const char *name, bool val, desc = 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; } @@ -554,7 +554,7 @@ bool qemu_opt_set_number(QemuOpts *opts, const char *name, int64_t val, desc = 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; } @@ -1103,7 +1103,7 @@ bool qemu_opts_validate(QemuOpts *opts, const QemuOptDesc *desc, Error **errp) QTAILQ_FOREACH(opt, &opts->head, next) { opt->desc = 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; } From patchwork Thu Oct 5 04:50:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729722 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp697167wrs; Wed, 4 Oct 2023 22:01:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7aqu329Vv+E2Q74siZltShsiL5pl++xDbH9ElMsaOHuhCDsSwf9+qC5N6qqhPaspQ1sF4 X-Received: by 2002:a05:620a:f0e:b0:76c:ba10:4973 with SMTP id v14-20020a05620a0f0e00b0076cba104973mr4838512qkl.37.1696482072636; Wed, 04 Oct 2023 22:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696482072; cv=none; d=google.com; s=arc-20160816; b=fKZIIv17/EBx8kT5uXZHoJFLfvgvyL8Nk1cyw6YeoFCRmdnpmG3YD38il1y5PCJL0m EffirITM8K1CwDqKIzZ09rypBJILAmZUJg7OTm2lyJO+kG80MzUhCaL610IoFiOW/cMX V2fbDPBGwU3gWC5O+YdzlnqL7DyR5LK0r08kbxsE4Hj7noTCm8rBaXSIDaLgkxTpCz1R FWr+bmRrZ6e4OByc6bUGn9PQzy5KIensw3sXtMnR+YMZy7OztSOfvc8zzwrUW0bW6+KH 72xR/GqROLiM+FsJcSzoORk09VnrvgBwha0jJEdz0+sKqrE+pPzav/zHB/PIsgMdrg/a PdHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GescFgTUfXFoVvcmAz4axPebdRl/aulbPng86nuCdlw=; fh=sJoShjc+22fNqMxUL+tIPcryN+fZ3hVRk+hhtgKxgXo=; b=lFO/4LaWiEe43OS84f0MOQBhEovTpTDCzU+6nZFP3VrpIWh5VrHKkMbXLdwXQrylDI BTLJRaGisHRt1++50OtQQIRet0wUVPXshaNEfL0FmPWTNX8MPC7cLGhZmZmJFz0VALXB gwBRDB2J5ehDiE2uRVsmhptndk8x73NMS6AKwrt2rAWsMI0WydFhHzZ/7/LEkObnVobV ML81q4Cb18hDuwpk3+6o/ucDDfriRW+VTGpoBPWLmWRYeJLUpkVj21pbYJg1j//bc4OH v+WnR0L3UzajQfdYWqQ0zCuuBGyRrRTf/+EOztggk83TVeHer2wS6DZj3cJvd+BFH8pM LTzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l7uFcOCt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w28-20020a05620a0e9c00b00773a681104csi418499qkm.684.2023.10.04.22.01.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 22:01:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l7uFcOCt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGKm-0005sX-K0; Thu, 05 Oct 2023 00:51: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 1qoGKl-0005nj-Lw for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:35 -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 1qoGKh-0005ax-Rg for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:35 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40566f89f6eso5049745e9.3 for ; Wed, 04 Oct 2023 21:51:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481490; x=1697086290; 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=GescFgTUfXFoVvcmAz4axPebdRl/aulbPng86nuCdlw=; b=l7uFcOCtRzmUqLB1K42VH6z8E6Say+znLJID+2p7OkEJvXa4J8R3/GWJNxegNkQX1V 7jb3SpqONoB3PmlaZXF+Fi2dJIpGlPflSXW6BW5uA70APTNDhrMvR7/Tue5s1GHUnvqP NIY4OgeDw78G1Tw24/ZYtl5n1+g1XEFzx5o62DyyKI5ZC+9H4kj7WLA6NEKJdxAcbq9G 6x/Vtf0TSnGHI238+fdGMcAhGAObJTOp0S/SueAGQ80JyROXC9cSBDxksc4vMEcMSAvP N8qyMQ3GRezI79dmOM8eYxAW/QO36KHWP7yk917OS2QdKo6v973dxdkKB9LdYOkqOokW m7jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481490; x=1697086290; 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=GescFgTUfXFoVvcmAz4axPebdRl/aulbPng86nuCdlw=; b=YJlHpYdNLbh7uZHwVqA0vZSLs86Dtzuexo8VOW3wP5YB27eX+nfYA7b8gXW83g0ynw 7ZSLio5sBZccf0Bq9aJ3o7skqduUsNQOcXmL51CqJYkYy3p5JmoVGPGeYt3Y7WVoLSaJ 8uXtC3Ol7CG4dT3DhntJUxX+bIyRAXf6RbTiRtIAMjQZSmmF/dfqHweUVtmAgBRJGx/T URQeaqJijaGUfPm3eQpsaYIByuiGy+7Uk2+FVCvUy4LLEt9XlM/82gpPKTMporA4aWdz euWBtHZhCq5DPdSeqw9BL9M7UiER9Yh15k/wZhaEM82u/ZNNAxkZJrrA5urUoNxyPmz3 703Q== X-Gm-Message-State: AOJu0Yz7MGc+taIF8XF7UhQfpmokFC414Kp4W2WLukGatsyUYgMszezH u+q3iDBjfpp2AI7nLIM04W5pgyEuaDZMxR6cSJw= X-Received: by 2002:a7b:ce8f:0:b0:3fe:2bb1:11ba with SMTP id q15-20020a7bce8f000000b003fe2bb111bamr4170385wmj.27.1696481490269; Wed, 04 Oct 2023 21:51:30 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id w21-20020a05600c015500b0040652e8ca13sm2856084wmm.43.2023.10.04.21.51.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:51:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , Peter Maydell , Richard Henderson , David Hildenbrand , Ilya Leoshkevich Subject: [PATCH v2 07/22] qapi: Inline QERR_INVALID_PARAMETER_TYPE definition (constant param) Date: Thu, 5 Oct 2023 06:50:24 +0200 Message-ID: <20231005045041.52649-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 = f'"Invalid parameter type for \'{param[1:-1]}\', expected: {value[1:-1]}"' coccinelle.fixedfmt = 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é 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(CpuModelExpansionType type, if (model->props) { qdict_in = 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_sysemu.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, const CpuModelInfo *info, if (info->props) { qdict = 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; } } From patchwork Thu Oct 5 04:50:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729714 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp695879wrs; Wed, 4 Oct 2023 21:56:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGx64XLamR5mWXyMdZDBpSgzBpHycLfmtnaQQbbPSKvcfTb7BsRh1Cy5qpev1KZUzKskhAg X-Received: by 2002:a05:620a:31a3:b0:76d:a110:856d with SMTP id bi35-20020a05620a31a300b0076da110856dmr5209414qkb.0.1696481809177; Wed, 04 Oct 2023 21:56:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481809; cv=none; d=google.com; s=arc-20160816; b=t+b3uXXFusvZCso42rqTgCYKeOZsEBnO1Hr9kqgI9Py1d8gNczKifxAjAncEGiKO3c 3SACDIAOQO/QHPXV+DvLOzCmQqzALa1toyp3b6fzCEw+UZUNc5Zn21YZVuTHVi12XS04 Y9t6Vjyw0fh3zIqYDXa0ry4FY41gP2mHZUwhYv+hvcVrJkAqoF2UzuKvwJeiCiOuUoaL A6G/tNNi15IhKuPh7mhOm4odkgxKJmScVG2cW/324enRkLnCrHUE1QCmiPwyNG3UYLgu EZm8xtzSjYrVjhLJIKlzf3S7GFwmtVJq4PIg/rz7vE1FrWzhIAVh2OppmrcKaqzKT2nT UuMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UnezdLBVjvZnCdXX1V4kutiq/Z6kzmSrGXxXnwF1wNc=; fh=mOvKa1oMAvPR5RjPR5ofPIt1a9Xhg06cYPysM5IEYtQ=; b=mO1UXHowdRWYR2MVjQ7V7F7aV5jUclc9YrwnjEDRYv/iw7HvjT+o4g4UC5OkzPGMi9 5kjy2PQGucgM6yyGuDAVHGhUUZ2GK/wGN+BXk4Sn2NLRVf/7SVr7lCLTZ/8anvwNtEL1 Eb/+mrStjAIw+DtuE7THK0mlY7jk6M4XSOg1ZIy0cdoac1KpEvWOyxF8ESrITlMu0ClZ DvN1e6NDCFwpgK/3Vc95tD9snPho/8pkd61VCsuy6mw2m0H7doL7KEiW8M4zX24nU47e v0v0ZRjqEFtonMiU3HPPiKph22chZUJqnC8mw04P+LNnjW5KXfkfc3pclXBLDj5FxOZi RoOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xkT+6lGn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g3-20020a0ce4c3000000b0065b11085b24si378136qvm.299.2023.10.04.21.56.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:56:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xkT+6lGn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGKy-0006BC-5O; Thu, 05 Oct 2023 00:51:48 -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 1qoGKs-00066V-2t for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:42 -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 1qoGKo-0005c9-6d for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:41 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3248aa5cf4eso590998f8f.1 for ; Wed, 04 Oct 2023 21:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481496; x=1697086296; 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=xkT+6lGnrWf8t0VNKfPpz+M+5K1VLK0wpzL8JqGVok+mUg9utPE3LeS6VqH/0vwnWp QeQo4fxqS0sakUvOZV1GI9d8BGMpRYSmvMJ96rGf5pYooU8DW8x8q16iEC4igOm1pco5 ckFC9Uuo3U3huD6D+jf+z6WVCU1Qnb9UgWwhF7XELc+rT+WWCKYkchXtaOn0lZPT80GY p9mo8XlsO/6nrPYup8Mck49Bs182oZVHta6y1pQHZOIddUHSRxhjadAzJc95FhuT2JZi nJ0GfiX3ESr9vGGBNn1eJxYCf7PIdCWQzwHmF6BCfAsqD86IKuPxWaewd/p5El+illT7 p0bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481496; x=1697086296; 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=hzosjJxOQUnFdYqG7CtZ6/5hw5R+CaTHjZbMVDUZr5bYcsRBJmxeCWD6/qOxdLMedx nNjvgHAUaWxBoHpaWQnXWoEAt6oUm/CvAFlTIORgygqP6UZPuvJtPU2JaWPP1ndcajHC 0R5iBRxmKP3dCyoh7E5UEJ6aFD+FAdV0q7eiPa+NHF+i+Xl/tQR1+NUYTCUxDd+mqINV 1HJfGPqMy3QSCoORnU/OAYWiw0EMoJ4Cz90b5LJWz+ykLaq3CvbKg9DCi7kmgrcLgRM6 VQPLgCy+YLvIi1rQ0uvi3p20PR2/laLbZe+agu/XPLs/Uh7YGpDqs8ieRA7IaIuZIIB4 rBPA== X-Gm-Message-State: AOJu0Yy5EbvACDuoCACyXscYQyNYNwI+A1SIxjll6E1yewewRJlIsH4u VQt01rtjis/GJVRPUc3ys4v0N+uinqarttfmUVc= X-Received: by 2002:a5d:6a07:0:b0:321:7844:de44 with SMTP id m7-20020a5d6a07000000b003217844de44mr3618406wru.45.1696481496706; Wed, 04 Oct 2023 21:51:36 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id e15-20020a5d594f000000b0030ada01ca78sm750316wri.10.2023.10.04.21.51.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:51:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Roth , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH v2 08/22] qapi: Inline QERR_INVALID_PARAMETER_TYPE definition (constant value) Date: Thu, 5 Oct 2023 06:50:25 +0200 Message-ID: <20231005045041.52649-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 = f'"Invalid parameter type for \'%s\', expected: {value[1:-1]}"' coccinelle.fixedfmt = 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é --- 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, const char *name, void **obj, return false; } if (qobject_type(qobj) != QTYPE_QDICT) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, - full_name(qiv, name), "object"); + error_setg(errp, "Invalid parameter type for '%s', expected: object", + full_name(qiv, name)); return false; } @@ -326,8 +326,8 @@ static bool qobject_input_start_list(Visitor *v, const char *name, return false; } if (qobject_type(qobj) != 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; } @@ -405,8 +405,8 @@ static bool qobject_input_type_int64(Visitor *v, const char *name, int64_t *obj, } qnum = 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: integer", + full_name(qiv, name)); return false; } return true; @@ -494,8 +494,8 @@ static bool qobject_input_type_bool(Visitor *v, const char *name, bool *obj, } qbool = 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: boolean", + full_name(qiv, name)); return false; } @@ -534,8 +534,8 @@ static bool qobject_input_type_str(Visitor *v, const char *name, char **obj, } qstr = 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: string", + full_name(qiv, name)); return false; } @@ -565,8 +565,8 @@ static bool qobject_input_type_number(Visitor *v, const char *name, double *obj, } qnum = 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: number", + full_name(qiv, name)); return false; } @@ -587,8 +587,8 @@ static bool qobject_input_type_number_keyval(Visitor *v, const char *name, 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: number", + full_name(qiv, name)); return false; } @@ -623,8 +623,8 @@ static bool qobject_input_type_null(Visitor *v, const char *name, } if (qobject_type(qobj) != 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 = 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 *name, double *obj, assert(siv->lm == 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: number", + name ? name : "null"); return false; } @@ -371,8 +371,8 @@ static bool parse_type_null(Visitor *v, const char *name, QNull **obj, *obj = NULL; 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; } 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 = qobject_to(QString, ret); if (!qstring) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, "string"); + error_setg(errp, "Invalid parameter type for '%s', expected: string", + name); retval = NULL; } else { retval = g_strdup(qstring_get_str(qstring)); @@ -1504,7 +1505,8 @@ bool object_property_get_bool(Object *obj, const char *name, } qbool = qobject_to(QBool, ret); if (!qbool) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, "boolean"); + error_setg(errp, "Invalid parameter type for '%s', expected: boolean", + name); retval = false; } else { retval = qbool_get_bool(qbool); @@ -1537,7 +1539,8 @@ int64_t object_property_get_int(Object *obj, const char *name, qnum = 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 = -1; } @@ -1606,7 +1609,8 @@ uint64_t object_property_get_uint(Object *obj, const char *name, } qnum = 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 = 0; } From patchwork Thu Oct 5 04:50:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729712 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp695788wrs; Wed, 4 Oct 2023 21:56:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbxfJHPZ5wEACeJaS2q+Y+SzOMwES1BusqzCTD8trVaXX7ixS/gxaCcmcGVZdQMGbn1Q0r X-Received: by 2002:a05:620a:2804:b0:774:14bd:ecc9 with SMTP id f4-20020a05620a280400b0077414bdecc9mr4567953qkp.23.1696481789829; Wed, 04 Oct 2023 21:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481789; cv=none; d=google.com; s=arc-20160816; b=0/GPYuQVH6gho+xRFjV9EuCa1bnwglgygDRAkAXs4H+X0Uh8TP8yzrZUp8JG1spcs+ yKD1brfQugS4bXH4QoHDh0lLbRPr85NLvDlNvcMq49y3Ouf1wPPWGFrBc4cMZCHmlVPK kU1Bh9KXJZV8no6RasatG2sZPfYChA1EewiCEI+aCkzcLwSGANsFYeHIeHpKI8YViGgy LtCeS14Gp3XJoxQdJ1044bbSHOT3/S7XiuIvdAPJhru6cKvxEAi7OweOwqWzkKnJ88DH Zkx5vWu8TivrwJKsLPmYeGQiET4kwVcU1uxm/LbVcIuvFL46/Fme1yJWqxb13FRRsElU PDhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1Q3iLFdosYlx+ShI5rJfNC7P4KhR6Nf8wUwiWyt6XeA=; fh=f/1l33s7qhTIbw99Jc6KpxmMb7npFzisdUwydpQPn0k=; b=uYV2nlZ1vLstHA0+cyatXaUzZxoZXtj+oF1KUxIXCTtXAeBp4mPPws5JdBZljeZuSv AnpRxH+ZRSxy0dzVtVaKUmLkGo0BBs6hACj/X+TZ1/lt3wq73z3tyehgwEe6WRP4tXUF mUxno1NwPhL/qKnUhwFELjZfH5SqIy4+aprpQyR4jK76DgrGR7Q15HgQNLoabV/yIQZL 0sm3hS9NU5kxn/PyXxxoN69RSnIQltay1pdl/fbCAp2/0k/Ytcka0pXz/77T9yGSZSAI GIc8X8aklC/jKwpIIhH4tf3lVvDyh2N3OHjSL2YaGtNb3/o03d3AgfF1loq0wsbVkqDo 68XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H+A25NBo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j6-20020a05620a0a4600b007759c231db0si400458qka.422.2023.10.04.21.56.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:56:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H+A25NBo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGL4-0006I2-Jj; Thu, 05 Oct 2023 00:51: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 1qoGKz-0006CU-PG for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:49 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qoGKv-0005cx-IZ for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:47 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3248ac76acbso519049f8f.1 for ; Wed, 04 Oct 2023 21:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481503; x=1697086303; 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=H+A25NBo2FF5cwFv8OKP4DsgoB7kFOUO9kiwYXkMt/rQhOnuNDXBUz8cELE20XRIT8 EEfees+PCBeObtoQmSuyZMfOctA9gVIgtwcy70A78Dmo4RHoE13oqULD+tnkWt7KO4zC yQAWYHkmCdYuzYVFLUggWHn6/mfBzu0JTrYeR4YxYmArUkF0UDCeUHyLJ15wuCjFBIn8 zsMpZeBcw7usPuU12GywVXXkKsWRudLqFwSWLYWflY2Ys00el7yh0B3nrHdFNel1fraK yo51bRruFlIQRFgu3a6pttPpcR3vJTTNMOJS+TMLHOzYGllQVYmc0Ub7MuxAsWFyX1br 4PUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481503; x=1697086303; 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=LwxB4ZFhXrrvEhd/l2xkdor120AjvHYFsIdPU5LeMz4D0S1I3e+/PCpRT6V04uXeA+ /WCU/HJSPIoYaIEcojl+iLNwhg7MDAvD89LJ6IiLUN6Ss095IVXawWbthKevov3JpPKx jfL5MH6ghZvCS5GLIjCVPbM3kGZSbNdQ9ZSG1ykA+Et4NjE6fUm/uArHzxlw8ZZLZBGq bZ4JXAKbQWAjbhqFmaE1A4s4FV856EyfPHW3kK2ROb8M06W9tEM/fmABdzm3oQK8IeO4 y9Do98hEtCiKt54OoOUegU6t6Tg+nHzb12J/VTxvR5ZwqfYWDenh0mqjgbuVYVuH0jCq e6uQ== X-Gm-Message-State: AOJu0YwfzuC9OixKy6t9kN+fFEzn/irnnI6cLlZZQVyKn1kn1k809BZV Wk9+3wFKZsp/BSN3MLidvdVvNu31cvyzozVsrKU= X-Received: by 2002:a5d:6942:0:b0:31d:c9a1:c538 with SMTP id r2-20020a5d6942000000b0031dc9a1c538mr3547086wrw.35.1696481503012; Wed, 04 Oct 2023 21:51:43 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id u17-20020adfed51000000b003197efd1e7bsm734982wro.114.2023.10.04.21.51.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:51:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Michael Roth Subject: [PATCH v2 09/22] qapi: Inline and remove QERR_INVALID_PARAMETER_TYPE definition Date: Thu, 5 Oct 2023 06:50:26 +0200 Message-ID: <20231005045041.52649-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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! */ -#define QERR_INVALID_PARAMETER_TYPE \ - "Invalid parameter type for '%s', expected: %s" - #define QERR_INVALID_PARAMETER_VALUE \ "Parameter '%s' expects %s" 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 = object_resolve_path(path, &ambiguous); if (target || ambiguous) { - error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, target_type); + 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: QAPISchemaVariants) -> 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: %(name)s", + name ? name : "null"); /* Avoid passing invalid *obj to qapi_free_%(c_name)s() */ g_free(*obj); *obj = NULL; From patchwork Thu Oct 5 04:50:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729701 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp694840wrs; Wed, 4 Oct 2023 21:52:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFoXdLxIMUWxZRjPsN9vO9PENBcV93ExjYU6OghLqe1r2/6UNt2KZb+35xaAfcjgxGSwya X-Received: by 2002:a05:620a:1a89:b0:773:a83f:413c with SMTP id bl9-20020a05620a1a8900b00773a83f413cmr5541163qkb.30.1696481555980; Wed, 04 Oct 2023 21:52:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481555; cv=none; d=google.com; s=arc-20160816; b=gE0OOPwBa3PdK/y3JKX3iDdH+fnscY7YB5Q74Ehz+aFYxhl0xzCu0YKXGionsbCj75 Urb/9Qmw4RkVOfj+BtHopx/GCa7Dev7O/S4okuFdEw549bcbx/5DFOh8iknQPlyA7vsE fARbJcZm166qEOZKd40xWtlfe3LNXIe8vIAQPs8q+NgB9TMOOQW1wi5OLQ37s1B2oDCB +k2E19KwT4YQkbmFrsU2dEVVmOq+Stxa6aM9t4nyTT3CqwB3xBpie8I7JcDrZVx6IV4n DOuFGzeyZMDasjbjKvtxT1DPUZ4bcALIRa88fqb3ZGTSKw2VbSUso6a3KLXyGuhBLVDF MPsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1SNFnHlL4hvCYTsSAUCxKg7fEKq/31KjVEaRB5Pubfs=; fh=8kPojgz0Lj/kINi+7TLymFEExDOI5/Rymkq8qHUApi4=; b=YUmKyJf0UMyjB4Xbrm+UyWBaRcK40gB1HKhLf1A+aL97J/5snqrNW2MFIG6pI3a+gD DNCjbtPfMJrQ02nGPUAY/4J7ZAgI4Gzh5C//RAeRxrrCgHvaRGlW4RBs3uCCidKppYAM 35WVoMZAhEfXhUTGliCPpX7mP/XYDW63m6pwYBkqwuGiZAZABxibIQOJKo51Kd4BQoNk jSypTpxU5+yqNdIZbuci9OLe8yTy+i9QUC6VEabiGrwaXouo7xG6+WBJQJCkYKGY6IzJ zTeAzk280nWZzIqEVMxDyiDj5ytaRdLdJKyGJN5RAgCk4MiEDC54cgRoEH3ClIl0f6LQ HVbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xf6XmpCm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o27-20020a05620a22db00b00767dfe07ec4si404458qki.164.2023.10.04.21.52.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:52:35 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xf6XmpCm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGL5-0006K6-RP; Thu, 05 Oct 2023 00:51: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 1qoGL4-0006J0-RJ for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:54 -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 1qoGL1-0005kE-JD for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:54 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3231dff4343so315392f8f.0 for ; Wed, 04 Oct 2023 21:51:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481509; x=1697086309; 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=1SNFnHlL4hvCYTsSAUCxKg7fEKq/31KjVEaRB5Pubfs=; b=Xf6XmpCmohYv++AKHPstdOGLlht5RJPKVY47+f8QCMsQ1wruQTY2nKOYxtyeki05dE Y+DiYTV7ZfGiDRi0xk+AuH4eTREWPj+XcplZe9UveAn69JCeJZr4ipljD5BFzZiHid54 OiIiLdxTEhya4brN9GzeK2Zs21QZjXVsukerZSDS1aWEPrYRCqhEeW6PidqlOBCpna7f HJufYL1wGzFdEtkY9yUnMZ9VEo4OB9K5WHqT6Y+7Wr/MVDX6Awrhqv2jBZXoP+5lqhbB 4n2tLRqumupXzEpYlIkJyJxMJzr+HYAMHXrhxYgi3ts2xRsqOzbsv+Eh3zDNSno2t/wU aW0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481509; x=1697086309; 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=1SNFnHlL4hvCYTsSAUCxKg7fEKq/31KjVEaRB5Pubfs=; b=MTx/oCLFqx2Kdwxd7kpAVYqtZPv++rmy1CMn63iA4oVaq6u6ovCi5mbAGTIBKfDUOA jvJaix0hbPhMOnPPjc4fT53My1MZ9BiUsg/bOdksSALAv5gSW36AeTluTFSgcKaX0b5c S7eKqylgQubolwf3M/ANEJxXxO3KKr0BOmGDi45TIGz4mLi774WB+6/+dn6rxg6Gmo4U m5GqOkNq9zxUDWRu+Zzjj/C0fFF3d2y4pW2/XmAHnSRJmgy5XCTpsAtL32WMkMag/JSj 6Gz/Am5tFFk4RmLzwa7B/Dcl67d52tzsbkJyLLRPphn1I7WNcn2ETV9x+tUihbhDLt+1 uZxg== X-Gm-Message-State: AOJu0YxjxML0Neh8jpUEQRI9oA84BxglxJn4yHctOMP3vRxlnhKyzhUl KwpaPkLjKfhwBTuDRCVhqyHc/f2j0r/+3AyJWDU= X-Received: by 2002:a5d:4dc9:0:b0:321:f74d:ade3 with SMTP id f9-20020a5d4dc9000000b00321f74dade3mr159772wru.32.1696481509352; Wed, 04 Oct 2023 21:51:49 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id s4-20020adff804000000b00327db11731csm753246wrp.22.2023.10.04.21.51.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:51:49 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Juan Quintela , Peter Xu , Leonardo Bras Subject: [PATCH v2 10/22] qapi: Correct error message for 'vcpu_dirty_limit' parameter Date: Thu, 5 Oct 2023 06:50:27 +0200 Message-ID: <20231005045041.52649-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org QERR_INVALID_PARAMETER_VALUE is defined as: #define QERR_INVALID_PARAMETER_VALUE \ "Parameter '%s' expects %s" The current error is formatted as: "Parameter 'vcpu_dirty_limit' expects is invalid, it must greater then 1 MB/s" Replace by: "Parameter 'vcpu_dirty_limit' is invalid, it must greater then 1 MB/s" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela --- migration/options.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/migration/options.c b/migration/options.c index 1d1e1321b0..79fce0c3a9 100644 --- a/migration/options.c +++ b/migration/options.c @@ -1163,9 +1163,8 @@ bool migrate_params_check(MigrationParameters *params, Error **errp) 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' is invalid," + " it must greater then 1 MB/s"); return false; } From patchwork Thu Oct 5 04:50:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729717 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp696281wrs; Wed, 4 Oct 2023 21:58:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2h8vIA97mQ6C/EHWhVPsMv4ZyF2S9ys1sgrc/ilCjoclCve1oH4HYtnaAdBi7wItxMRH4 X-Received: by 2002:a0c:cb12:0:b0:649:8f20:552e with SMTP id o18-20020a0ccb12000000b006498f20552emr4016464qvk.62.1696481905701; Wed, 04 Oct 2023 21:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481905; cv=none; d=google.com; s=arc-20160816; b=e1SxO8hzzOnjRMgNO7Fi1806qred4fWGocreZ52sWDgYKbbvnwssAKaCCXnqfsxYCe qAh2nLAEs+IxCFPq78X4uDhWYRluAhOH8Vdq3RCAkEzwkX6CnpqFpCQjEcJZgSNTLNpE FCR0tMvL+GPmMUhsnRe87K6M0K2yqa0oNU+6NKZ5A16D0WbCJ6rAEjMZd3bU8nEAvBvK 0cWG1row93h8LTvNjFyC8t40ZhPfQtgbKBeVhWWcSyCYuvuEf69a4zJUQogNBen5Kgj0 NyZ8wfyKx5yguxvtKd8z+n9faQafIubrOBXSLnQLSdmN00agDnKU8svCVtnJheCQrRsQ 7wzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gYlRLR05ALxovESIOoL1y2S0MzkeE1wUvZ4+dhslFYU=; fh=Ft3vlGecpSHzS1OGsLMbZ5d0Ed9jpuWxwIyloQvwnlI=; b=jrHkejbCIOCRVCEkpJCB4Fiig3Mps3fuLfXKQOJxsbqsdxwT4CWNxlv/xVxHbIw25b 7UDRqbQ3Xm/m5SWFH5JY8bNtdoKb5A7RdxGJ0FOoi67cn3zzypxOvSvJE0ozCfV4MkHj umEKb+xMblqkrSQ5E6CPRGJXXM2ayJgQdlo7P0xqIrJPJEEQsnJeQzJXwa6uG9MQLD+x mU26va0HqYtpfuTdU/hLTBPFw8uygb+G0/8rwJcmkRp67QeXn1LtAm6rDTr0uPh1U8uR 9EbLI26WO3c4TgPUngVmxHmwJnn5DJItwtiBTIKQFgkSvibQDQs0e4uDnTMen8ezbujl Ab1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FMWMqFIk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h7-20020a05620a400700b0077417e7fd27si433437qko.290.2023.10.04.21.58.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:58:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FMWMqFIk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGLH-0006hJ-S9; Thu, 05 Oct 2023 00:52:07 -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 1qoGLE-0006bG-Hv for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:04 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qoGL9-00063Z-Kv for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:04 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-317c3ac7339so549795f8f.0 for ; Wed, 04 Oct 2023 21:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481518; x=1697086318; 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=gYlRLR05ALxovESIOoL1y2S0MzkeE1wUvZ4+dhslFYU=; b=FMWMqFIkXG9bCq9NOsfNsxNqwa5u5sckOv6pZFnJUF3lN637Gb3teev6p6bt+b2JCB 9w0TnNxSLXOxcGdboC+tPhxIrWnsmbbK8xxHd56R+OdetZMHmzgrED7Tyn0/K4RaZw/v J8iy9cs/gAtuYy5A7kl+RPongaa1P+Bl+HH+CY7j9BxlbAutIy38ayma67hL+OY09abh M2rxqwk+IA+6R9Szb/kkMe3Wxbk2D1LxjK1x9JI+cTvw8qKNAgbS/wdwFfF+XQiEtCpA EUjH1gtz82mNA0T1M3ObqdBC68OHoUraTv3yt7+fjWcLGe0Ai1q4kuRStapy/v+LxtBw MvAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481518; x=1697086318; 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=gYlRLR05ALxovESIOoL1y2S0MzkeE1wUvZ4+dhslFYU=; b=SsJ+vaCvcEuzsI119cvKDVxXpt2y9QeBf/umNPwnavU9gDzVAFU3kGvWEG6pkwiQop Kzlj8KNSFSXZbbCpgGd41QgquCZqIqO0wAk+tR7CHkpIwJgP5tGtZvLiTLMG4Jw36rP9 kJ1G16t9YPopP8H4zLi2PAvVYq8KstUX/MB8mymgIYDjAJNmOU929k/gQaKt4GGUW3NJ EhPtdYf5YGedAaCdxleCrzfLed5w8Y/Iq9zc8mSMVdVlNJtP3UQ5AnJVSyobr3IN4bgE FyVebEx6HXMSWdlipqYrMDwRAniKxdGYtKQtvuAbfCWtbzn2n6TtUJLR0T00hBkwepTj Ocag== X-Gm-Message-State: AOJu0YzmXhL42w/nupqwEQxhfqWtX84W6Lw5j0zSkBIB1LYv5e/jiDJt H0IOOTGtqECneHzsPaMLZ7nOx/bBVu3FDcF/BAY= X-Received: by 2002:a5d:6450:0:b0:315:ad1a:5abc with SMTP id d16-20020a5d6450000000b00315ad1a5abcmr3881866wrw.5.1696481517729; Wed, 04 Oct 2023 21:51:57 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id x4-20020a5d54c4000000b00327bf4f2f16sm747652wrv.30.2023.10.04.21.51.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:51:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Juan Quintela , "Gonglei (Arei)" , Zhenwei Pi , Laurent Vivier , Amit Shah , Alberto Garcia , Kevin Wolf , Hanna Reitz , John Snow , Vladimir Sementsov-Ogievskiy , =?utf-8?q?Marc-An?= =?utf-8?q?dr=C3=A9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Peter Xu , Leonardo Bras , Jason Wang , Konstantin Kostiuk , Michael Roth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , "Michael S. Tsirkin" , David Hildenbrand , Richard Henderson Subject: [PATCH v2 11/22] qapi: Inline QERR_INVALID_PARAMETER_VALUE definition (constant value) Date: Thu, 5 Oct 2023 06:50:28 +0200 Message-ID: <20231005045041.52649-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org vcpu_dirty_limit 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 = "\"Parameter '%s' expects %s\"" % (param[1:-1], value[1:-1]) coccinelle.fixedfmt = 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); Then manually splitting lines over 90 characters. Reviewed-by: Juan Quintela Signed-off-by: Philippe Mathieu-Daudé 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 | 92 ++++++++++++++------------------- 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, 89 insertions(+), 116 deletions(-) diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-user.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; if (s->chr_name == 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; } 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; if (s->chr_name == NULL) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "chardev", "a valid character device"); + error_setg(errp, + "Parameter 'chardev' expects a valid character device"); return; } 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 = RNG_RANDOM(b); if (s->filename == NULL) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "filename", "a valid filename"); + error_setg(errp, "Parameter 'filename' expects a valid filename"); } else { s->fd = qemu_open_old(s->filename, O_RDONLY | O_NONBLOCK); if (s->fd == -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 num_children, Error **errp) { if (threshold < 1) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "vote-threshold", "a value >= 1"); + error_setg(errp, "Parameter 'vote-threshold' expects a value >= 1"); return -ERANGE; } 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, } if (size < 0) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "size", "a >0 size"); + error_setg(errp, "Parameter 'size' expects a >0 size"); return; } @@ -2905,13 +2905,12 @@ static void blockdev_mirror_common(const char *job_id, BlockDriverState *bs, } if (granularity != 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; } 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; } 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 *driver, Error **errp) } 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 type"); return NULL; } 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 string"); 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 79fce0c3a9..4f6c8e810c 100644 --- a/migration/options.c +++ b/migration/options.c @@ -1002,137 +1002,124 @@ bool migrate_params_check(MigrationParameters *params, 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 and 9"); return false; } 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; } 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; } 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 integer in the range of 1 to 100"); return false; } 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; } 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; } 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 the range of 0" + " to " stringify(SIZE_MAX) " bytes/second"); return false; } 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 range of 0" + " to " stringify(MAX_MIGRATE_DOWNTIME) " ms"); return false; } /* x_checkpoint_delay is now always positive */ 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; } 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; } 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; } 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 no less than the target page size"); return false; } 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; } 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 and 10000"); return false; } @@ -1155,9 +1142,8 @@ bool migrate_params_check(MigrationParameters *params, 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; } 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_size, Error **errp) PageCache *cache; 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 target page size"); return NULL; } /* 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 number of pages"); return NULL; } 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) /* Check for truncation */ if (new_size != (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; } 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 char *fdname, Error **err 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; } @@ -353,8 +353,8 @@ AddfdInfo *monitor_fdset_add_fd(int fd, bool has_fdset_id, int64_t fdset_id, 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 value"); 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_line, bool has_cpu_index, if (has_cpu_index) { int ret = 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, Error **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; } 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; if (!g_str_has_prefix(nf->position, "id=")) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "position", - "'head', 'tail' or 'id='"); + error_setg(errp, + "Parameter 'position' expects 'head', 'tail' or 'id='"); return; } 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_netdev, Error **errp) substrings = 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; } @@ -1247,8 +1247,7 @@ static int net_client_init(QemuOpts *opts, bool is_netdev, 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; } @@ -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 identifier"); + error_setg(errp, "Parameter 'id' expects an identifier"); return; } 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") == 0) { shutdown_flag |= EWX_REBOOT; } else { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "mode", - "'halt', 'powerdown', or 'reboot'"); + error_setg(errp, + "Parameter 'mode' expects 'halt', 'powerdown', or 'reboot'"); return; } 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 char *id, Error *local_err = NULL; if (id != NULL && !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, 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(const char *typename, 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 type"); return NULL; } @@ -194,8 +194,7 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const char *typename, } 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; } 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) } if (target <= 0) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "target", "a size"); + error_setg(errp, "Parameter 'target' expects a size"); return; } 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, cpu = qemu_get_cpu(cpu_index); if (cpu == NULL) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "cpu-index", - "a CPU number"); + error_setg(errp, "Parameter 'cpu-index' expects a CPU number"); return; } 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) } 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; } dc = 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 type"); return NULL; } @@ -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 = MACHINE_CLASS(object_get_class(qdev_get_machine())); 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, const char *hostname, return; } - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "protocol", "'spice'"); + error_setg(errp, "Parameter 'protocol' expects 'spice'"); } #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 char *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, digits, " "'-', '.', '_', starting with a letter.\n"); return NULL; From patchwork Thu Oct 5 04:50:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729718 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp696360wrs; Wed, 4 Oct 2023 21:58:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQm7fxtdwbzv005Ne5iLFUZbY0Q6YWuEMAKXmIPoZAkuJm/DpDTVfqfP4pwkObakXFeG9C X-Received: by 2002:a05:620a:4103:b0:76c:707e:8fdc with SMTP id j3-20020a05620a410300b0076c707e8fdcmr4781157qko.6.1696481921221; Wed, 04 Oct 2023 21:58:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481921; cv=none; d=google.com; s=arc-20160816; b=Axyw2hhkqqaP/kMMWrckC5uBUAPH5V732+SEfEpm/u4i+S4Yw9RALmVZHV20k3WN6X 7u5Wf5kqiNRSodO04QaogTnnco8zJW270rwNORsTQhAdtgv2fb5tXGd4PP8bKM4CRF43 1lgHsVJcUvwD+0Fy2eMy2MN+jWFANOOOgajPkySZUePfZTDtvKayt7DxK2Dop0ph12lE p3OMy8TLSQv+hBbRZp9RKFwuWdjjjHPWzgPkdPj1EEvf0jYCPvTnRcZNeHLS6XaHGQDx UKI8PURlgRBPC0zwM4ToL0iqNP+seYoSOEY+5R/b3z12HtmahX8kxu0OptAHwzOKzsHh sb6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+PTJ/05sHPgcAUDGq2+BZ4afKq7cNyAKTrzR+aRyMME=; fh=f/1l33s7qhTIbw99Jc6KpxmMb7npFzisdUwydpQPn0k=; b=hi/yMU5LM4/mhsYg00l7dYR0jU/nX2cqZcb1N8aZUd1GHNe0rOKLg+wxHMq/aAi7n2 Do6YJNgQYKWb9W8tqHT0u7XwQelhIGWNn1b3HXODGY3S7zsIZtGUssICBwUBS5MyXNMK WOQtMp/eaT+pQFiYicP5o9wf/83QpzD2HZZZqfL3u2f50RmhqTfT2t4ZD/yIFlEOVogK gaaBQSr3l6SU7u2IlOycFy2F+8IjFa7AJzg6hrI2vjzpwpXjLcpckJKwpVdvgO914FpH OyqYA/BsCdWO2yO3OOY/n8IRAYLFn/TGv40I80X4YlOZmI3h+uN2QS2zaAzik1P5SSig CJAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Py9dJhth; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bq39-20020a05620a46a700b00774396341a3si414374qkb.363.2023.10.04.21.58.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:58:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Py9dJhth; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGLM-0006mK-Rh; Thu, 05 Oct 2023 00:52:12 -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 1qoGLJ-0006l2-Mn for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:09 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qoGLH-0006Jc-04 for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:08 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3214cdb4b27so571508f8f.1 for ; Wed, 04 Oct 2023 21:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481524; x=1697086324; 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=Py9dJhthVnEVQD3N5NhxgAOYSmIt8uRU3DsByURzCf1HjJ8dKIOTcadn0Rj9Sr6BtI 23fzGPp4/ogjwQ5g9i1gIzuTT53TH0b1karW3M+Vm9e7JrthPHhhOqrVwjaQpGlE42iV BfL8cqGsgPeJGdb2pplv+L5KQz3md8kvXiUiQSoOq3+dA/VloSXeX/cGZx9mdtuSUNbT gJiwh+Km/u7cGeYCqK3BIdfAQkVTql1jZcm/Att+MplbbzKY3RfCxoCStKtGyM/XKpoV gQjv6X7O5pdNwcFnb5D7sKAIO6hcrXSec2OCeMYS3ZX36z8VaRSq7nIO0C3toern7Q9a 5XVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481524; x=1697086324; 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=VhYznMkKLDSFWHlrnP3aNSIdB2jflQD0VKQ2YPT80bhIdsTiBcWsVnlDU3fGCBM/Bq 1256Hvualf65IVICDL9MYaX/mXCiIXYGbHP5jNeabOFsqkM5CtwunAL8v677SbZO3tjy Tli27fZ9khise2hA4pjDUx71vwNYubpfDy0VJfIFFm/Cb+daERveY7D5Ke9MWZqbIO0u wZBzJ17JGvmVrfRi5NSOZgwaZOsWaqcZ+GQ0g0ah1B2FdeDH7Hc5LcdfuXRaRJzzafak P3rPogXFiwWdcqCfBcPrvOZNOMPkCL8jPY3PIyuFaiQO5FkvcJGSvsE/tBshDse/Gjwf pC/g== X-Gm-Message-State: AOJu0YwZK5sAW9HF1Q5srGSMYGDJgPBREZjTU37ORLDZ0hwSxpQQzdnD GtwmzrGc7zE59x3dCPueg0HRPYJrhV20WPyEh4Q= X-Received: by 2002:a5d:6447:0:b0:31f:fb5d:96da with SMTP id d7-20020a5d6447000000b0031ffb5d96damr4082442wrw.64.1696481524229; Wed, 04 Oct 2023 21:52:04 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id c7-20020a5d4f07000000b00317e77106dbsm747391wru.48.2023.10.04.21.52.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:52:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Michael Roth Subject: [PATCH v2 12/22] qapi: Inline QERR_INVALID_PARAMETER_VALUE definition (constant param) Date: Thu, 5 Oct 2023 06:50:29 +0200 Message-ID: <20231005045041.52649-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 = f"\"Parameter '%s' expects {value[1:-1]}\"" coccinelle.fixedfmt = 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é --- 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-system.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, const 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 = 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) err = 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; } 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 *value, bool *obj, Error **err return true; } - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name, - "'on' or 'off'"); + error_setg(errp, "Parameter '%s' expects 'on' or 'off'", name); return false; } 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, 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, } 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; } @@ -475,8 +474,8 @@ static bool qobject_input_type_uint64_keyval(Visitor *v, const char *name, 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, } 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, 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, name)); 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 = 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 ranges", + name ? name : "null"); return false; } assert(siv->lm == 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 = 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 ranges", + name ? name : "null"); return false; } assert(siv->lm == 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 = number; @@ -142,8 +142,9 @@ bool parse_option_size(const char *name, const char *value, 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^64", + 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"); From patchwork Thu Oct 5 04:50:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729703 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp694994wrs; Wed, 4 Oct 2023 21:53:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF60+0g1Zj79K7SqvcowagrABPW3+eYYP7fJgGSBLSqmXo6sGo3GrSZVWyoZP/aFwulmx2J X-Received: by 2002:a05:622a:1ba9:b0:401:e0b4:a93f with SMTP id bp41-20020a05622a1ba900b00401e0b4a93fmr4205667qtb.41.1696481592897; Wed, 04 Oct 2023 21:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481592; cv=none; d=google.com; s=arc-20160816; b=Rw0AhqG07rX/6om+lGKE9wg+KSeh1A6oB7dp3vmp7CFs4T5FTlg46UNJKx28pxyTrO TRc6hG0tDn4GfCXyXx400X92M4rcq4bSUn0AObpf/AfCZGD7xur0CSquoidy6CQsEjXI DZb2y7SiACWfilLT9Njy+9WSBU0qEbsEAI9WAmARLg9Scu+yoo0939xTRGVrB/n/+er3 rEenJYNoLe4/OBD5CQFm6IJIDVVIuTOKNMNxKPH/dI16rmcwBdYePl10Hhguv3EQbiG/ IpgOz9ukOXcYa2H9xWeOVuOkkM3COlwNpxDvxkISlycXO0V+3f6Ojq1YqMim3M0WAq9r Kj2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ce+npZH/Sy2YDK63SGGk3kjcbFRbVjeH5n2iFjnqdA8=; fh=oTVVnlHUp5QE/wOIiIgepm05fDtHARCE1EdcJ6poEF0=; b=KnSQG5KzXija8S16kIgTfc3LFheU0OgKh7VhrQGyHBP9PK9eDrZVDWvNflDd/VdNlP LuQgaGgxk31Nc6Z70LKsKA9U8eCjmJg8+jXl8dgmbm1BaDar7FN5ikJ3NxaHjOpAe33E dm7Th41Kn6U/7K/GPsK0vbtZNQ8OctEakVmXqYGjZYLdvyx0sKiZUj4zuDNyo4gxRfaw QNjBtyez2dlGevwTar9xReCDdKWsAoaSUUw+kCX80G+/RzzYZe/itansSBlxsAXd4POC CpcVEgADLq48Atgsmnz+/IFzpQ5rF5rmORSZm0es2kHVm34YXrEIaMo6roCyhGpcZoJx 95uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UwYDa3iM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c14-20020ac87d8e000000b004180a838585si418923qtd.661.2023.10.04.21.53.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:53:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UwYDa3iM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGMA-0007zu-Kv; Thu, 05 Oct 2023 00:53:05 -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 1qoGLd-0007c1-0c for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:30 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qoGLN-0006cc-CG for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:28 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-317c3ac7339so549912f8f.0 for ; Wed, 04 Oct 2023 21:52:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481531; x=1697086331; 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=Ce+npZH/Sy2YDK63SGGk3kjcbFRbVjeH5n2iFjnqdA8=; b=UwYDa3iMuu6rPik84qhZ03gtOzrEb6KezCgtOHSHugZde8/m6LfrVHi4J5brSq8s1+ cRg7VSjr/+zdwGoyx5uo8SfFroQyH8LcxSt9q6ZBw4S4u2war3FSiKPQNU+/isAIUK4s YJmYioQYDIsi++j6A2bxkVlAzkQDKKkpqpmgTrsUaM0wio3VksN9XAaZfxmF3YphgBqd ANJE9vUy4+uqxj87h9NHAGM+oozkGGnsudjNQ8WgtEz4GMxECt6mW382+1r4TFwKHRsI htIbOgUsSDHOlLKGp3EZ3JchV5WgtSKkOwOb2yJc1ZS+oJgNv0NOQxoP2LhcgSHsCXAF b8PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481531; x=1697086331; 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=Ce+npZH/Sy2YDK63SGGk3kjcbFRbVjeH5n2iFjnqdA8=; b=cpi6H3eFahWjLfVlMfvtdN5rTv/bvQePjro4dVRIEJsD2ELcyv2uz3OiefhI9zsYSd LLhJ3gqxBnW/afsoJYlLtUDY8bsW15a4/dGMgLE/p0fK/bXmo7Qgtumw8zD2jHVllxOI ZWN5U5Gf1yCBzphp1GFNr24+CGdDoVxzlD9wLxMw+yZKV/L2QPbB8KBVh9E9Y19dfQLG OpAiMX6BI8vq/p5+qabSwd8pS4UuERrfCxmmRxY6Uvn0b4FYVBoqHEP72BmmRCke3TTc ewBJfBMTM4HRdbL7ToP7WHMbOvzEYmXG4HA4K6bCVuMqptNndgi6frIGMDLGDSfjFKPW ZD7w== X-Gm-Message-State: AOJu0YwFytCh0vLV15eHDZWAXfbV5JsyTjsGou9LuJfjgbF3BxRPK/QC uT0uAlNH0XbQj+9+8ev4M37jXBf7JDktoT2Dyj8= X-Received: by 2002:adf:fdc7:0:b0:31f:f982:5395 with SMTP id i7-20020adffdc7000000b0031ff9825395mr3820274wrs.35.1696481530920; Wed, 04 Oct 2023 21:52:10 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id x10-20020a5d54ca000000b003200c918c81sm738225wrv.112.2023.10.04.21.52.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:52:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Berger , Michael Roth , Stefan Berger Subject: [PATCH v2 13/22] qapi: Inline and remove QERR_INVALID_PARAMETER_VALUE definition Date: Thu, 5 Oct 2023 06:50:30 +0200 Message-ID: <20231005045041.52649-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é 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! */ -#define QERR_INVALID_PARAMETER_VALUE \ - "Parameter '%s' expects %s" - #define QERR_IO_ERROR \ "An IO error has occurred" 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 == 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 == 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 == 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, const char *name, } if (value < min || value > max) { assert(v->type == 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 = qapi_enum_parse(&TpmType_lookup, value, -1, NULL); be = i >= 0 ? tpm_be_find_by_type(i) : NULL; if (be == 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; } From patchwork Thu Oct 5 04:50:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729715 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp695930wrs; Wed, 4 Oct 2023 21:57:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHj+/Twn6tWRmDIvQgdm32tvzZSsuQt0PVvh8Ut0/fhHurUUpXgUdmhnffkp7SM8C9PMQOE X-Received: by 2002:a05:622a:2d4:b0:417:9962:4de9 with SMTP id a20-20020a05622a02d400b0041799624de9mr4535313qtx.1.1696481824224; Wed, 04 Oct 2023 21:57:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481824; cv=none; d=google.com; s=arc-20160816; b=oIUvUOESjf+IJy8q9wkoohSSiAXDcuq49dodQ0KtUq9G+daPGJbG9znJoJ0bCIY4rj uqL0EbFK6WhLJOU2Gp63nap6pujx0uaTUmvIngff10t9HmGUnyOZ3vnT52MJLCiMjM/h FMN13tityQhwwO1CbeO66WfPQZQDC7BNND/ZndhM0GvOX5pBuBx5sHVcpbMy7c9MoK8J wAVRH9FGndhQzE+wZbB+d0FYOi8IiIbodFcFhtlFy5krAWK9ZcagmuwCq+nI27sC2iK+ TNhVGxlk2Ra5SetAt5Z+lp8LS69NwAM9deneGsAh6ES7t3arLlsMRGG6cLsZ9GCheoxB avcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Qa4hZwslsMUZLJlwqNVA+27NbdRXcJ1/n/O43TVo9q8=; fh=288tj/YA8CeqdsE1IAqipHYy1NJ0ligrxjm8FB2ZG8k=; b=b15g2t7yyUe/lglQJjgvsVEoBXwj7QJKCnkSblmsN2LI9PEZZ4a1Er1fEYLwla6ZPp 39knc5hsWSYSOuU066ICKZuAgwTWX1pgL4xomVmIpKqlXo1hH16ryrWTqSUXxjYUiL77 v+ZV7t+ELgoZyHkK3aTr/Oy1toSj/9lOg/90b1hf5kmjn63G3vgLL4l0JoP7SdWkY36m cwphZi3tkroAVHyWdZdRaZI3CN8a+WuUmOd4ivDA2lXEzS20JRKZsSmLVVtm3m3It6GJ NoGzA9TyftB6UTb7Ngvg29Q54DnZ/XH58JTL4ka1wN8ZPMnYDhfFSrFLxNJq4T8w4SZo Fizw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dOvKOxMl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n17-20020a05622a11d100b00417fd10f754si424555qtk.412.2023.10.04.21.57.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:57:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dOvKOxMl; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGLg-0007dh-MS; Thu, 05 Oct 2023 00:52:34 -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 1qoGLW-0007AN-9T for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:22 -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 1qoGLT-0006kH-NY for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:21 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4066241289bso4972125e9.0 for ; Wed, 04 Oct 2023 21:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481537; x=1697086337; 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=Qa4hZwslsMUZLJlwqNVA+27NbdRXcJ1/n/O43TVo9q8=; b=dOvKOxMlnpTgaZRj52rzNJP06WYBwpsIZsOELlwMiX6LrdVvjcMlgs3E6NlOJZ87/a k96SRBVq1ZFPOZP1YjOJD0Vxj6X0rEBWOi+8tVyd4noHeO6NR4ZQX/4CuL2EvWpYXM34 MFGvK7HBD1tiSrcvr/hhoz2rzjACBcR78I/ZSBfCJ/yuypVuGB2LMxcizdc+qsed0iRv lQj8tYs26Irlk2xohZkXSc874XSiy+CBwUYS/9E7CUxluM0isfs8vVgiJuhOnLsaAVw5 ZNhYMHKB+LHrKtbvHFFdx624+3TIzT7kHx7eKwX+Wr94boYmFfFibNq/p0m/QnCR84Gb +AZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481537; x=1697086337; 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=Qa4hZwslsMUZLJlwqNVA+27NbdRXcJ1/n/O43TVo9q8=; b=QrRrsOdPxAnBTQnMkmFOBnHbGuwdx1jraWlTwGqpYIYcvh29AV/dy6jD1DBR1qYEld 9Ssv3+8aDlKCCeQG5s3Y+lfOydNDQgiD6t4uusJuiNvaUUPU585ZqVfsYluUcEtHxlXX nvgAQW7ByLiqzkvC7PZrv4FI0VIkd9kqkTuXr7xKxCUTblQ90KwQNzbn1HxkC08XwgUc kk/JfMs5/8hgZtiRGquGvitlkwRNP4Xs5WIovCn46QIxoyJrvbwaxCeeKj/OGRadyiia UL3DD+6rUF7UFanxNxsPTst8wb74HnRT5hRCIOD/ZMiQLIStaLNUQNMq/v+LexRGNmN+ tSsA== X-Gm-Message-State: AOJu0YwO36LmWJF/XUOrEiH01M5RhjfNnjccMc8n8Opb4nVC7TZ13sPz JuvEJBQsFlSro8EsXUyrtnsbDLagCAAALuwCUQM= X-Received: by 2002:a1c:6a03:0:b0:406:535a:cfb4 with SMTP id f3-20020a1c6a03000000b00406535acfb4mr4040816wmc.1.1696481537733; Wed, 04 Oct 2023 21:52:17 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id z7-20020a7bc7c7000000b003fee567235bsm2891894wmk.1.2023.10.04.21.52.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:52:17 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Juan Quintela , Fam Zheng , Kevin Wolf , Hanna Reitz , =?utf-8?q?M?= =?utf-8?q?arc-Andr=C3=A9_Lureau?= , Peter Xu , Leonardo Bras , Paolo Bonzini , Richard Henderson Subject: [PATCH v2 14/22] qapi: Inline and remove QERR_IO_ERROR definition Date: Thu, 5 Oct 2023 06:50:31 +0200 Message-ID: <20231005045041.52649-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é 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! */ -#define QERR_IO_ERROR \ - "An IO error has occurred" - #define QERR_MIGRATION_ACTIVE \ "There's a migration process in progress" 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 filesize, bool flat, bool compress, /* write all the data */ ret = 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 = 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; } @@ -2271,7 +2271,7 @@ vmdk_init_extent(BlockBackend *blk, int64_t filesize, bool flat, bool compress, ret = blk_co_pwrite(blk, le64_to_cpu(header.rgd_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"); goto exit; } @@ -2283,7 +2283,7 @@ vmdk_init_extent(BlockBackend *blk, int64_t filesize, bool flat, bool compress, ret = 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"); } ret = 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(TransactionAction *action, 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 = qemu_write_full(fd, buf, len); cpu_physical_memory_unmap(buf, addr, false, len); if (l != len) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "An IO error has occurred"); return 0; } @@ -459,7 +459,7 @@ void create_win_dump(DumpState *s, Error **errp) s->written_size = qemu_write_full(s->fd, h, hdr_size); if (s->written_size != hdr_size) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "An IO error has occurred"); goto out_restore; } 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 = 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 = 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) != l) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "An IO error has occurred"); goto exit; } addr += l; @@ -803,7 +803,7 @@ void qmp_pmemsave(int64_t addr, int64_t size, const char *filename, l = size; cpu_physical_memory_read(addr, buf, l); if (fwrite(buf, 1, l, f) != l) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "An IO error has occurred"); goto exit; } addr += l; From patchwork Thu Oct 5 04:50:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729721 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp696711wrs; Wed, 4 Oct 2023 22:00:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2Sz6iXH96cr4V9ELRdwpyAl6xQOFlOExblE/gOarJFBwQPzQ5FtPULiJ828E7MhiB2YDL X-Received: by 2002:a0c:f28e:0:b0:656:25a3:d5f2 with SMTP id k14-20020a0cf28e000000b0065625a3d5f2mr2212536qvl.24.1696482001423; Wed, 04 Oct 2023 22:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696482001; cv=none; d=google.com; s=arc-20160816; b=uiN0q7tKQ6H9Rl910OcvbbehWyXee8nniIVBdbb4Dzef463EdF9rB7oU0qbAtJBKZ9 2x7pBvVHzrIHI+c6idn8bY0PrXAd+p4NjHIKwuHeskkjcuPSQ319+JCrQ07ndbnTc0AV /h83CN5Zs104dJEB25rc86Ey3v8HjLH47Lyqu/NEiiMyCE1bCqz47gAoQ9k9nQKKintr q+Hj2WM5Dpp7zCjXWZos7s3Va1Y2Uj3s4Llki5CkLHj0v6NvYjWGY3yhDkbtCzhSR7Vr kbksNCrIwtzIGU/Rd9uD8sLwdWf2/QpZ9nIWFqZ+WJVM45ca3ykRYFXxyb3z0HSFvj4/ gy9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ljhUm+yE397bxq9Bx01IEVCivdgyT/wBeqgB6zr/g7E=; fh=8kPojgz0Lj/kINi+7TLymFEExDOI5/Rymkq8qHUApi4=; b=iVuKVHINEY3Ub69dNUEyGybWa9fYFkFf/E8kdGARqTxSDiLtTE+oTEWg7jFd96d9Jo 9VNT4UsYkc1HHJfOD5FNx7p6Xl6GLbgj2/G0T0Oj8BX3Va9o9gZmDbreoQdliWDeWnbI 3Zeq5ZkWxMRtHMLTfAdH3r58LaHow8xwSptuGgc1JAJmEPTfyQBB9Sup08R9Ozb4PAXh 7eL2vxU2gT09CV/vgsT5jh6V/YAJrGzD31evhsayW5AAFsZnBZL0Dn8YDx4Q6h2DnFeo X4ejZXH2YsiwQoL3sJmkaRullNePwkkZ28AYAloOBzRQ3Rd0MaUVt5rQd1o/2ixmZUOC TTsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rcg8gl8I; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j11-20020a0ce00b000000b00655dadf3eaasi382638qvk.141.2023.10.04.22.00.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 22:00:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rcg8gl8I; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGME-00084W-Nv; Thu, 05 Oct 2023 00:53: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 1qoGLe-0007c7-C2 for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:30 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qoGLb-0006yd-Qr for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:30 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40535597f01so4758955e9.3 for ; Wed, 04 Oct 2023 21:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481544; x=1697086344; 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=ljhUm+yE397bxq9Bx01IEVCivdgyT/wBeqgB6zr/g7E=; b=rcg8gl8InsyBBBLqIOzePgEKP9Klwr5MMruySHdERPvfGOAVPgeIUIIik7jf3pm/ye hwk4jxqS31jEEUAsu33jjCQlMnhdMeBp1+IWOJOtY6HqvoCUyJAeIO+tB1sI1bQwEDQ1 hYsr3iTprbWwIaq20F9TWJBY/tNeUT5UZlDAKp7yNSZsKFvWDyDxz0kIPNLqqSOR/PDh PLqmJKpqqhl49nCWwVu2dEDEp42NnybN+XyBX03hyy7Yyz05+iTPNKuyTuxcQ9I8mp8S HBxZhBfoz78lhxKSm3+GyYCoZw+cV7Gc9Xn9ROIqUN4kpyIVT5nqAjpQUEWbLDFwRZRQ ZEWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481544; x=1697086344; 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=ljhUm+yE397bxq9Bx01IEVCivdgyT/wBeqgB6zr/g7E=; b=DJ2v/45yRzxR0usJBqvOm4La30z47/bMD4lnvOlX15dK9A5Juw7KNozp9T+LXxBT0i T9DV1Bb3Pss6ErS2+j5e+Keu5K3vtzCF+Ls6j+Ols0FGqBTuoa3GUpFw31oEsApXDCn0 HD/9qLRmQufCGg5aFsnEyPkQAbh6nxxcUzDGsbm1teQTCu/+YB2f38OBL2PrktfhfRq1 oOEMlp8xaetuLXfocG/7geOfk0g36RtvZGPDxeEqsj59TzsrHDk96dpKcqNErcSW9fQg Jal0btm7J2xywSlP0G9bYoYyRGVEiSdSQCYeVKeDyV+zjfdI3DCPtwipzEFQ3c//SOgo ytHA== X-Gm-Message-State: AOJu0Yw+bRTsZvA1P9nXMo6+91QctQFYRL3cGfLqqjup/x+bRomYyyNb mNQxYUrw05m6+PperWBZH+5fwYuw2ILK++BQzp0= X-Received: by 2002:a05:600c:255:b0:405:2d23:16d9 with SMTP id 21-20020a05600c025500b004052d2316d9mr3994983wmj.21.1696481544211; Wed, 04 Oct 2023 21:52:24 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id u22-20020a05600c00d600b00405ee9dc69esm2868359wmm.18.2023.10.04.21.52.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:52:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Juan Quintela , Peter Xu , Leonardo Bras Subject: [PATCH v2 15/22] qapi: Inline and remove QERR_MIGRATION_ACTIVE definition Date: Thu, 5 Oct 2023 06:50:32 +0200 Message-ID: <20231005045041.52649-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é 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! */ -#define QERR_MIGRATION_ACTIVE \ - "There's a migration process in progress" - #define QERR_MISSING_PARAMETER \ "Parameter '%s' is missing" 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 blk, bool blk_inc, } if (migration_is_running(s->state)) { - error_setg(errp, QERR_MIGRATION_ACTIVE); + error_setg(errp, "There's a migration process in progress"); return false; } diff --git a/migration/options.c b/migration/options.c index 4f6c8e810c..7360a22252 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]; if (migration_is_running(s->state)) { - error_setg(errp, QERR_MIGRATION_ACTIVE); + error_setg(errp, "There's a migration process in progress"); return false; } @@ -662,7 +662,7 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params, bool new_caps[MIGRATION_CAPABILITY__MAX]; 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; } 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 **errp) MigrationStatus status; if (migration_is_running(ms->state)) { - error_setg(errp, QERR_MIGRATION_ACTIVE); + error_setg(errp, "There's a migration process in progress"); return -EINVAL; } From patchwork Thu Oct 5 04:50:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729716 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp696188wrs; Wed, 4 Oct 2023 21:58:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbOCuZrzM7/BTs9K0ZIz4ZxrsLQFk8yNSy2NHrxX1gTwzhmHILQKc9dDt5YsC3DPFN3xwQ X-Received: by 2002:a05:6214:194b:b0:656:519c:5a07 with SMTP id q11-20020a056214194b00b00656519c5a07mr311294qvk.25.1696481886865; Wed, 04 Oct 2023 21:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481886; cv=none; d=google.com; s=arc-20160816; b=Fm0SEhOl0McGsBx52+OUOVudI25mca7z0aEZLTfaI6DksebA3rnIuAEhn/yOKKMteL altnj+uZFVwu3qqPvfhzesxCxF/k5aum+pjyfqXJ3yxuIh+lmQTp3FmdT5ylRk4waXX3 1ObyHAOtEkD0iU6oKac8iTijqPEfoNW74gqwy2CbuJjdAx1rFCfF7/FsMbjRQvS/R3x8 ynH3jBKopfalMynjqYUHJUN3YhhHoqbYrsOvpP7TTLnUYPKPq0BmEPH4qESZmOyt3zHT uJahxfEFYccbVXkM44DDlqYJYDwXIXN4KqcJebB9XJ0f00RFgcOrxpuZD0OxXcpfIuP/ yyqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YZajAk/2I9ikw2/rt53JYOwTH2I6pFeiAjPgvz+uD7Y=; fh=buAIIXlR70lPcD8BO+Bim/gtRDoADGdBLYvvWFS22AE=; b=OFga6E622nSAIT6BKdEQYv5Ywpo0qD7TULer2XA6Is0FRmTFsLXvnWsH7U4umCbQga JzdnW8Y0nzRLmNDEMAKDsgItUB2clCpCLJsDNRIm6kD44Xsb3Ba+PgRlQeE5I8hYBaIp ncdCpTjmh/Yh2k2QILtkt62MsmOuO9TvLRpm37jum7x0iGmNvBGtQpcUP88yo1EZr3Hj Oq6Yb3sbADJiiRcuamQ3qW1eM2Z5IIY22A+9+P1FcYVv1KHTA30/90UsXjg9EvbioG33 WdlPhh65hzRQ79G7bEow5SHmf1zTdHlqRm+wOmJPQylOpe92IyAb+/YQdKombk+RIisQ jqMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lXZBEOIz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i17-20020a0cab51000000b00658561d244esi375284qvb.358.2023.10.04.21.58.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:58:06 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lXZBEOIz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGMM-0000IK-FY; Thu, 05 Oct 2023 00:53:14 -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 1qoGLk-0007kV-9E for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:36 -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 1qoGLg-0007E7-VD for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:36 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-32336a30d18so508421f8f.2 for ; Wed, 04 Oct 2023 21:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481551; x=1697086351; 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=YZajAk/2I9ikw2/rt53JYOwTH2I6pFeiAjPgvz+uD7Y=; b=lXZBEOIzlC6ur7js7yHjgPMSbO91uFv2tSjI7NMxq2+oeBx6J9egwY59DgNrCz/ofb oG+kUDMwDGnMjlfrLNTS7DxoacX6ouhDmyGOkw/O6K63Ugj8PDE9Xmgp9miDU+dSfJVF 8BIZffeAWZ9UAg9cvXN2tf6/NrGnnxVLqtkGens6e8fzmN6/grO5WeUV5tS/zviyiiuL fyaU4uDkKTVE5mPVU5JUwqFoWsf8Im9NGXG26saAtkTT4VYCWzXLxhlNUb+XT+GmMcxG uaNNZQ1MX0UiLKv7Fb4Meh46YtSrOGXKh5kyAIpozSgq0qAgFKuQ28/JM7x3n+0vAKqO TA6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481551; x=1697086351; 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=YZajAk/2I9ikw2/rt53JYOwTH2I6pFeiAjPgvz+uD7Y=; b=FtlY72vfr7giahgyXVe4N2hg0xNzlK8XrxxF13Jiqj/vENim9uDmQxsMNB5TOdzjoP nP3y3NHwPtBSxrJCuMuPY6EEi8/+JoAbvAPp+mqY7z8OFDa0pX/Hh9Vfu7fy/HlRBqwt ZenXO0v5hZPY97AkN5ktrIOJFFc3gGZFbAwvn5CvT7PwrsBaMWvsHlCcGDAfDVuuViyl A8bMd2Mds95Np29w8le8Ot9LKstNmdmanZ8EriuIkGUJw+vF6QsZZi1EQIsSZ2bo0AXm p4VpA1X9hqvhFdB39TYLhHMZoNl2wbhvAB9LyehWUVf0Gp8rlAn/M+hFNZPXXhKrUSnl MmEA== X-Gm-Message-State: AOJu0Ywoqmt0d39gFu5WMucMLW2tpAd8dD0gZPUXdkhHgDDuEuEayl9m mAnSA12Or/A7o6YGEq4hSZWFkxlUvmy2/i/YiG8= X-Received: by 2002:adf:e406:0:b0:31a:e6c2:7705 with SMTP id g6-20020adfe406000000b0031ae6c27705mr3486721wrm.50.1696481551363; Wed, 04 Oct 2023 21:52:31 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id x4-20020a5d54c4000000b00327bf4f2f16sm748742wrv.30.2023.10.04.21.52.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:52:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Berger , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Kevin Wolf , Hanna Reitz , Gerd Hoffmann , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Stefan Berger , integration@gluster.org Subject: [PATCH v2 16/22] qapi: Inline QERR_MISSING_PARAMETER definition (constant parameter) Date: Thu, 5 Oct 2023 06:50:33 +0200 Message-ID: <20231005045041.52649-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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] == '"': # Format skipping '"', fixedfmt = f'"Parameter \'{param[1:-1]}\' is missing"' else: # or use definition. fixedfmt = f'"Parameter " {param} " is missing"' coccinelle.fixedfmt = 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 = f'"Parameter \'{param[1:-1]}\' is missing"' coccinelle.fixedfmt = 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é 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) } if (!self->dbus_addr) { - error_setg(errp, QERR_MISSING_PARAMETER, "addr"); + error_setg(errp, "Parameter 'addr' is missing"); return; } 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(BlockdevOptionsGluster *gconf, num_servers = qdict_array_entries(options, GLUSTER_OPT_SERVER_PATTERN); if (num_servers < 1) { - error_setg(&local_err, QERR_MISSING_PARAMETER, "server"); + error_setg(&local_err, "Parameter 'server' is missing"); goto out; } ptr = 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 missing"); goto out; } gconf->volume = g_strdup(ptr); ptr = 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 = g_strdup(ptr); @@ -562,7 +562,8 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf, ptr = qemu_opt_get(opts, GLUSTER_OPT_TYPE); if (!ptr) { - error_setg(&local_err, QERR_MISSING_PARAMETER, GLUSTER_OPT_TYPE); + error_setg(&local_err, + "Parameter " GLUSTER_OPT_TYPE " is missing"); error_append_hint(&local_err, GERR_INDEX_HINT, i); goto out; @@ -592,16 +593,16 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf, ptr = 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 = g_strdup(ptr); ptr = 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(BlockdevOptionsGluster *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) }; 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) }; if (!filename) { - error_setg(&err, QERR_MISSING_PARAMETER, "target"); + error_setg(&err, "Parameter 'target' is missing"); goto end; } @@ -356,7 +356,7 @@ void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict) * 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; } 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; if (!qemu_chr_fe_backend_connected(&dev->cs)) { - error_setg(errp, QERR_MISSING_PARAMETER, "chardev"); + error_setg(errp, "Parameter 'chardev' is missing"); return; } 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 *opts, driver = qdict_get_try_str(opts, "driver"); if (!driver) { - error_setg(errp, QERR_MISSING_PARAMETER, "driver"); + error_setg(errp, "Parameter 'driver' is missing"); return NULL; } 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 *opts, Error **errp) id = qemu_opts_id(opts); if (id == NULL) { - error_report(QERR_MISSING_PARAMETER, "id"); + error_report("Parameter 'id' is missing"); return 1; } value = 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) type = 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, QemuOpts *opts, Error **errp) bool qtest_with_kvm; if (!acc) { - error_setg(errp, QERR_MISSING_PARAMETER, "accel"); + error_setg(errp, "Parameter 'accel' is missing"); goto bad; } 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, Error **errp) Error *local_err = NULL; if (!ib->name) { - error_setg(errp, QERR_MISSING_PARAMETER, "name"); + error_setg(errp, "Parameter 'name' is missing"); return; } 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, const char *hostname, } 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; } From patchwork Thu Oct 5 04:50:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729719 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp696521wrs; Wed, 4 Oct 2023 21:59:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHL/EEwB/VOTMougJOheOjfOhCtZf3HSu8wtVxZACOY+W67MYw4mHZtcmePvZhw15pzNmiY X-Received: by 2002:a0c:e284:0:b0:65b:2008:8a25 with SMTP id r4-20020a0ce284000000b0065b20088a25mr4208332qvl.47.1696481964528; Wed, 04 Oct 2023 21:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481964; cv=none; d=google.com; s=arc-20160816; b=OcTpNEbK0Z2+hp6SZhxkqP6Pmb5Jvgu1SOo80TZUu4vDpaS3Tug/xJApwbG2M0uanQ TCmc+vmBY1w9Z0BqEdu2cGM1mcak3Lpy7R0m1xJPdWcaXgaEWtX2kiXjMOtEvY/5kzMl MafWpjFGyYnWkLHGxZiPnU8zIwwK4dRrH1crGXrxAqFO2FaQtYXK7kGh51fW4o9C+I9O L7HydWpaeSHC8rXwjR4oSxIWUS/kM1T71MFGRSlXJc5u7lmN4VkoFigb06hxNATVcBm/ A8uhi5DOPVNn5ccRxwS5Dfnm5EOk7/kOUmeLxPbTaokWckA/G0vwWi38dfOkxSX04Rgy aa7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZMzoYshmIKgiyI46JZRTSl2tAoK4bhnefguZfodjbZQ=; fh=UDFk7AMDAi9TGZTd8AeDYxQWxMLSVq4WmLfu6YLWv1g=; b=AuXVMmoJ+gzu5SYSVC777/YjUByZgVGYLmr3gokQZlnKrJ8FstTQoX+zX+wJZcsTV1 FecyJ4QiLIqh03SWgLn99+80HdAa1cfyhpEC7nTZsr/qaUm73RikDfhlwBaHeO8sR0Lv 0jyNxhHhfIj3T3mzrC0r0MpTaSRRptNrRCpL7Vw1H24Y0KoK61FROdLgaP10NsFigb0s Ivd4DwidGf1lUWLqrp3jPnDcrt0InTOPdsHdDMdWYYPgmDfzxymz1T8mu4TpkGiNDO0Y L7GCCNBlGagK25nDc2VlyOE8gsQzfPh91jxWQBXU0vqvpBmwraaR1c7qgXVQeuJ1zJwH N2EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VbBLU7Fe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x13-20020a0cda0d000000b00656386f2546si382985qvj.158.2023.10.04.21.59.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:59:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VbBLU7Fe; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGMN-0000is-Uf; Thu, 05 Oct 2023 00:53:16 -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 1qoGLx-00080J-JF for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:54 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qoGLq-0007Np-Lc for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:45 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-405497850dbso5030755e9.0 for ; Wed, 04 Oct 2023 21:52:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481557; x=1697086357; 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=VbBLU7FeVN2pcvXqgOlP3zxhcTirOKZVho47eQzeIhhhlUZGhUYMAnborGH/plFbwK YSDwOVv5SGHtGCJO7rQjowyEHb7HPC3gJ21qyIZBZWYfyEZjIa2YfAkD5GKOoF60su9c nCjWbUduUSgPHufAU6fIvYjPcQjKqhupMmnUvg665bL0heNP4sr6f4beNbJvbjfs6tFa MPd4QYOMaXaxqziDJOP9MRjyrBIQeRXnmHsP9g6oB9phWrGxNTBv0urRm0hyfLn3x2Nk rFuBAJ4nZq+P6jJEOrvlrMNUvVRaKvy3h+uKpB3ceRUu9jHdUXnyDp78vWS0ACED1qqV G0KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481557; x=1697086357; 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=rGaP1KFjkMP9lslfHL13uWsNnhYiirx18NHDoPGwVJk84VVfN+iulXVVlsdVTTPE1Y uvEJXgmgg+w/I07Exf3oxk8uC5i9mEP2K5Ua0w64MwaXL4D/6ZdGcjOfHjVEm5A2Ug0a 0TfWu7bnb2TWtQYcnpSQmW6HdAs40ajZDSbNGHT01ZblV6JOE1nsD9JIaK/lZ+almKjw omu4PTdDeBupkSExpGgDcsTK4l7FO2qodRIDXydzA4GiNgOV9qWHtdoac+x5YNadNEqb jYE0ty+7J8G9Ks6xcC8QrwG58AyjB5sWtRb89MUHW8REvEqIBgiKUdfR0Ehtvb2XqCap clTg== X-Gm-Message-State: AOJu0YyWFldrAW5XFSiw9ssH4V0MiDfOqn7uy6xZdV5rSaqaA/bb7XQy 2mhIFZIzMgoh9KCmO3DwwM/iues4KfmDTaov7zg= X-Received: by 2002:a05:600c:ad0:b0:405:375d:b860 with SMTP id c16-20020a05600c0ad000b00405375db860mr4082300wmr.21.1696481557727; Wed, 04 Oct 2023 21:52:37 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id y6-20020a1c4b06000000b00405588aa40asm617496wma.24.2023.10.04.21.52.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:52:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Roth Subject: [PATCH v2 17/22] qapi: Inline and remove QERR_MISSING_PARAMETER definition Date: Thu, 5 Oct 2023 06:50:34 +0200 Message-ID: <20231005045041.52649-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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! */ -#define QERR_MISSING_PARAMETER \ - "Parameter '%s' is missing" - #define QERR_PROPERTY_VALUE_BAD \ "Property '%s.%s' doesn't take value '%s'" 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) list = 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(ForwardFieldVisitor *v, const char **na *name = v->to; return true; } - error_setg(errp, QERR_MISSING_PARAMETER, *name); + error_setg(errp, "Parameter '%s' is missing", *name); return false; } 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(QObjectInputVisitor *qiv, QObject *obj = qobject_input_try_get_object(qiv, name, consume); 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; } From patchwork Thu Oct 5 04:50:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729706 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp695187wrs; Wed, 4 Oct 2023 21:54:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbhETtk40o/X/dkh3bblMKD+rvFfVM/r0jjY53ylMgSq19MzfPkUgOzSLpMRjo64jRVDn0 X-Received: by 2002:a0c:eb82:0:b0:655:dc84:d744 with SMTP id x2-20020a0ceb82000000b00655dc84d744mr4333161qvo.25.1696481642663; Wed, 04 Oct 2023 21:54:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481642; cv=none; d=google.com; s=arc-20160816; b=TrEeN54UCgfyWIhFqqSJUSLuc/8AqqzxdhDZi3pvN2kwI9WGjgMt/qH7shc/YvMbak WtSXYqcYQUI8CoCWebi0vkGVqV5hvC+mqn0w84CZoNikWjwBDPFf5SZGP01gsdBwPPHs AY6d7C6VjcNEHBGH0anP+X16Kqj6k6vs33zGqZTG777p2sH5Qbhm01a4deUfPFFGjkaL GXuqEF16qbDBaJSquXnRm7/f3+zirP0SSKBDPKbUSjnXpnwOTbxt3IdSH9a3xFeK8k06 Zb9lWZ2MeYA5dB24Rt6hVbXvxgrNsyncR3Ql0JM3QImymBTlLVlGz3ebA95QgzEEMPZ4 uGxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+wgGQUdIqiLvE9KKvhjp7xkKxDkuA49hJ4+Z2t/uhpA=; fh=r7t9u1m/3sV3OYOunn66FtVWKqNKkVkgluAHIqk9tCI=; b=vlvxec/7ZM/lCWJLYB42NMkUbkv8i27wlgV5MmPBDdtcHTTEx1dMHRXqAiAbWR3sJb Wa7YH7YFcS7cJH9RbKJNp6QhZix4eiuxFFSABHR1eMTJlwxeL3QMCOw7ciHpB/MAqsb4 c9zxB3ezNh1X/9Xaqr/90WtX2QR5r/hn3BKAPzB96uTCMBMLhvFEjywMyavP5fvVqycU HSkkc959vEjkK5BifqjJV7r4sS0+SjL46TMAy5f+dWNFLDu1O6ta0ChTs7aqVYF5PBLI OHVoeYqy2ujH5pUPimnTEYnU79r8laFbf2b6p+wgJ5QI4Rvl7MYm6AFjW08ohbqsYsdg OG2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SDEOpmTi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o17-20020a0ccb11000000b0065d148589dfsi367510qvk.574.2023.10.04.21.54.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:54:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SDEOpmTi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGMK-0000Ka-2A; Thu, 05 Oct 2023 00:53:14 -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 1qoGMB-00089P-2I for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:53:06 -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 1qoGLx-0007WX-AE for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:53:02 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3231d67aff2so597174f8f.0 for ; Wed, 04 Oct 2023 21:52:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481564; x=1697086364; 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=SDEOpmTikw5g6deflJo53rh1/u3ysaag+xEQYrSkZhB9D9VnjdbRWNVgTQbFaPi4aj P1LH4jyGNXWfOVDbXaXIMigRV7NYqahh+zMpR0By5Vj28JC5SzrOl6uQe0I3I4OeCCiS Fed528RNplbg+m5tN/yPHokmcLMaS8d2HYrorvFf+NcMLkReHP24kuFbjJX0OVtJns5S aWFZgCJtv4FuMNhONmpdkbKMplPQIZ4EbcRP4gP+U4Js9ylPIG6pcrqkQL6XNRx5m/ZQ /dHJFZSCroIg1eg56q/HRJoGnFdyUBkWw0M8cS8xV5lwUYfqwYvfRtcB1yG7w+BWzAzy pRJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481564; x=1697086364; 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=H+JR/yip2ECOtJYEgfUR5CXReuYZsFerEfCrmVaFH46HBXXC+qlRNp3qdqRkqM/wQF KoipSY+uSWFlid1oE7FWRudrbP6p0I5pH3FG5n1s39vOYH+oDX71QAp/K7wEI0exp/Af ja+M52dESvP1VPr4MWhGzjBug1F0BiRkLlw3sEpj0b3ucA/n0HYEwliTF4bsnyEMCAem PkGj4ffRQzg0jHnYmfI55zevmsk2YGVNmeMsZkpN4TNQUtzml2Xrqbp2RAQnoOfu1jPh 5RB0g7NsKwRU6+mAaltn33xMB7D9TBKiJWdikLBcksl1l+GjjRwcrNoKHw37SEtD4aRy he1Q== X-Gm-Message-State: AOJu0YzxyCyoxfQa/7dmENvvqlGlZX1RGzsuVZqlBO9OC2TQRrZmf4bq RmBeyyJBQFB/q3/gozbdIhyiJU372BcOIqdTYEc= X-Received: by 2002:a5d:628a:0:b0:320:bb1:5a73 with SMTP id k10-20020a5d628a000000b003200bb15a73mr4072042wru.22.1696481564050; Wed, 04 Oct 2023 21:52:44 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id e14-20020a5d594e000000b0030ae53550f5sm749481wri.51.2023.10.04.21.52.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:52:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH v2 18/22] qapi: Inline and remove QERR_PROPERTY_VALUE_BAD definition Date: Thu, 5 Oct 2023 06:50:35 +0200 Message-ID: <20231005045041.52649-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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! */ -#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 ")" 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 ret, 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 char *value, int i; if (strlen(value) != CPUID_VENDOR_SZ) { - error_setg(errp, QERR_PROPERTY_VALUE_BAD, "", "vendor", value); + error_setg(errp, "Property 'vendor' doesn't take value '%s'", value); return; } From patchwork Thu Oct 5 04:50:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729709 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp695382wrs; Wed, 4 Oct 2023 21:54:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYokDenveWZqnLEPyr0GcbklM/ReskOx+sIhvw2xCfbmNwET/jg5LrTRM00hvsE/phws2d X-Received: by 2002:ac8:5916:0:b0:417:9fd6:d498 with SMTP id 22-20020ac85916000000b004179fd6d498mr4846171qty.51.1696481690405; Wed, 04 Oct 2023 21:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481690; cv=none; d=google.com; s=arc-20160816; b=AUeHuvlsD7nLNwylDDXPlIDntZSlDAXIrmmbCZ4zUQ9+otK1hebcLB1HbSak2qZXKv GZcDkPvQHyMCwQ4f0sQ870a/hMjOEYq+7ZOuHEaYRZEiZDENd3briNLyeYiFtzagM9xL kzwYxk7XQw2GHtEgtSqJcZ6yaXSq0aunplAy8GFHqSxTn7dlExt3Amrrc553QecbG9ce 1bM9T4SMnP6vxifrBbd3Ycs+Ot451w5IcAw7etoyKu89awiFf+0Ds2ohKs2w1bmtk6dN PMSK7V+8LCM/XPdkWdFehgZ/ivSla8qUZVi8yotw3sdut8+Ccq0k3VT9/bQJFYQyMp49 GdBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xsWfVZc9VxkTZJYVgn0fspMadC16MHZrVQJV0TPl4cg=; fh=a3ep33pT5Svu2cDH7WgKWLRwYs5FEj3gqPDuRWXhFrQ=; b=HI5hXp/PTICcCejlnhMkPXWwnXkRjYVWdv50UpkmsqvpoL9uPLwEq2Bu9Y/nUWUCwN KVR0qLfGNLDsnUlmuc0mrBR06fKMThCF+phnbaEd1QH+S1DUSmQ6TaHuQoCR1/NMi94J Ar2Apt6GiOCIhL5FLmXNNlrWMX0Wrxqaq2A17d+DJdcuTRKvOmfrV5Ci/MSwhi/JJ5Au UVzZ42kjpU8Wc7Yp5AF2CPnXJvtL3Nlsh75/IPZo9KFEugBrrMHyveNrWHq4Safy+I6b lFKCcarjOZY0Wvmnn3rLJ+s3JxURVAXpohPh9AijXo/8+HSo3VdQbZ4M1TyscEYlPmA9 7e5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YmpkJFhg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b21-20020ac87fd5000000b0041908908ba9si439818qtk.165.2023.10.04.21.54.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:54:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YmpkJFhg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGMP-0000qu-51; Thu, 05 Oct 2023 00:53: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 1qoGM7-00084X-5k for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:53:02 -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 1qoGM1-0007az-1J for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:52:58 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4064876e8b8so5432395e9.0 for ; Wed, 04 Oct 2023 21:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481570; x=1697086370; 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=YmpkJFhgU3u1YMySpq0rCpKVzddvnnyW8GuPSNDoq2/DWJWovm41EcjMQBLX03kBEd jkffygnQvyozKbqiC/aZg9eaD977fmc1J7yd/sLkXwHcA51G85O9miAzxjJ7QMKHTrFD uRX7kT0ToCcqDhWzIqqY8LYRrF+VOPmBPWdeBKwzPHlh00uaommLwqLq07QFGMWXHv0h l4svZAL30c8Yh0yoE2DVS2oUZ/Ce0PJ5FfeYDlBk6CpqrteRYs4sFigm3t2XxFzIrHtz +hvX7Q4W4HysXnZvLmbplhlRMAnn/yqMRDQSXn/aUjsjdr/Y9ov7Xn8gy6VuBFmjYfn5 uLNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481570; x=1697086370; 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=abra5xLGYmrRKyWtyHTi5T3WEL/8wVd1vk0dp5SKMN9a0o9DIfSMm2rt9JYW3SUpBV LQj7eFuUuMRAOzQABzyPifvIgBahuU4ORDi1ndEjo3x5EBNqieVXzMAYWb0BTwBRoa+F nZWCRiMAEkvhQ7FAi6fGOdn/1WVIljGrhF7ozc5YzF3E89owZl/17nFT1v7cn9vFyALu Ei1aRMEnF9h+HUPOj8MEh+ewqeT87uZJbCS4DRjwHrzUAUcabb6RwCVFYUMUvelX+ilF TKcekbv+jDWNmoKIH9vcPG1oK2SrATtRGfPfH7LQPZdMeYpjZ8fxvvjV56mAw6H4dDry aGjg== X-Gm-Message-State: AOJu0YznW0cJFNbWrw7s6PFKGwZOznaPQG3KJi3BOePhRoDQZHHkf6nC ZmcWWfGKzjh5ZL2bxnCCMwtEklitlvkHRRktrFk= X-Received: by 2002:a1c:4b12:0:b0:403:cab3:b763 with SMTP id y18-20020a1c4b12000000b00403cab3b763mr4218395wma.33.1696481570406; Wed, 04 Oct 2023 21:52:50 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id q15-20020a7bce8f000000b00405391f485fsm604322wmj.41.2023.10.04.21.52.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:52:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland Subject: [PATCH v2 19/22] qapi: Inline and remove QERR_PROPERTY_VALUE_OUT_OF_RANGE definition Date: Thu, 5 Oct 2023 06:50:36 +0200 Message-ID: <20231005045041.52649-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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! */ -#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'" 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) }; 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 *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; } @@ -5263,7 +5266,8 @@ static void x86_cpuid_set_tsc_freq(Object *obj, Visitor *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, int64_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; } From patchwork Thu Oct 5 04:50:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729708 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp695284wrs; Wed, 4 Oct 2023 21:54:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEtC44zKUINSbx63o2sTefwmAS2Zt5A4+Irp2Clxu2ZwTpHL4jmfjusEC0QXAWVu1nfMkti X-Received: by 2002:ac8:5704:0:b0:419:4e1c:6904 with SMTP id 4-20020ac85704000000b004194e1c6904mr5423786qtw.20.1696481665532; Wed, 04 Oct 2023 21:54:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481665; cv=none; d=google.com; s=arc-20160816; b=u2IuglZRCke2WHw4b4QLl9P/yiCJmkOfYGPJweeOZZaqt+5NhMlGs4vd8c4pjKWaER QGyq3KSUcIO47C0q9raLb0lnZnfoaW6EtlRXbAY5tu/kUS5iCup4SxgsSF7evRusJhc5 eEj8dSnLQDhNhYY5kHcmvqzqq0E5eIvoy6IBqgRXs7epAm7c+yMlqSrJQPVtU1RKq1+D oDgZQCSKHGoGrDB+ZWQ0z5jwYNiACBhtHQIekdbRUJxvjO3lnWpxDARVhxyAtpk2WhWa cycOftOZvJlWEPqwEiPEsGV7fo0pEiBQEV5DE9kSA2G5XYQsDqKe8PDaBzbGSJHqzgoI Dc3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JgzZrOytqrUApWTqn24h2uNs6StZKBnGHRMADJvQBG0=; fh=ZoAjrgjP1RJGSa9RP9dEtrBjzoYOJeMjdGtN7WHGfK4=; b=He2xWSRkMIdjs7aCfxy+PN18z798AcBHRGr1cUPq8FNC75e8/jCLphpsjjSLbP1Z5O WdKhucaxltwdyqdCP1B7vVsALn73gW/wlOph9aoTyFMlne0vCTzFSIX3HiMnRhz9R4Y5 Ch1o2TJvV4QF9+WRoxh69+04pO+PTVsyVn5qJprhsqiC5wdU63vAj7LEBdrO4BDCv7AO j0+YSUdOw9SECgMuplankGks5WhMV9r/lC9g1eF1ztzk8SaMSYCkUMz5BurcSXdTshVl 4nYnN9zl75raTvR84USr9rMNUQuLOUo9z+qLAern+8ZY8WelTVrC5OTP+k5/uiau7yIM kj3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r6N156Se; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d19-20020a05622a101300b0041975795c17si414742qte.230.2023.10.04.21.54.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:54:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r6N156Se; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGMS-0001Al-Kq; Thu, 05 Oct 2023 00:53:20 -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 1qoGMB-00089S-AN for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:53:06 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qoGM6-0007iG-S4 for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:53:03 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-317c3ac7339so550344f8f.0 for ; Wed, 04 Oct 2023 21:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481576; x=1697086376; 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=r6N156Se1kVQOmjFZjLRcDk/AJgw0EhnC+gTgib438FetR7fQ1BzwJdZSKZuet4Tn/ EhYcH1o2r12itPsn5N/exjqUdG0iFndsouFw3Q43MsFtA+Np8DuvomaBq5c9ivP77aMz /7Q7acpc84rxTYCDpiaE69ePYPODozTXSRSJVYLFXHsg6oq1wCG7ijMaNdaTbb1ZR9RL bod47kt1I0KJONzBOB8O7rvK5w+3UOxDNkUb4sg2qtkUBGX9l+ZHsssir4v4cWT4r1Cj Du50LDAXUTkb0AHxf0Ijmkvfh+0qEEL4DrYUzp6W6yP3aZ7XZIONSWrcx2uCB5hi5ZhD DQ5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481576; x=1697086376; 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=DNRH9hIyvSLFvrG/4ESbgQUtuV2C8UNWJ+4Nw3emVJ24gISK3h73IJOQiPfNrWreXu HhG9IZugkl/735m7gAmTv4IIYx31M+/Wz+co20OLFV6MwcphhnGx9B6TBHGPTWD6nyki SYI54KWI4Ya8j7IpEoOQjgKWcEd+yyXQtr3acJO3YJckZEWaKjKr1QgRzyJzOivCjRmW wBJC01rVYtVXGkNXMNQBmzAl6ifrpZf/gNYzQnxCpFJQ37Q0hsF6Rl83ffCEE1wSjQ7M rDS2cJt6L1WxL77JJWT16aW5nxobG3rYusvJhBNV/ctj2S3EFOLyu4hZMv6mRyvRqGXC 04Mg== X-Gm-Message-State: AOJu0YzSQIJBCoDmen1/X387+Xq9MRI829bxe8xMWaHejNHuJ/63zOiA mYbbXFnP/vsUhQshx1p8ZoWd+d1ACuOmKnnU5ow= X-Received: by 2002:a05:6000:118d:b0:31f:98b4:4b4d with SMTP id g13-20020a056000118d00b0031f98b44b4dmr3699522wrx.42.1696481576065; Wed, 04 Oct 2023 21:52:56 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id g14-20020adfe40e000000b0031980783d78sm748747wrm.54.2023.10.04.21.52.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:52:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Konstantin Kostiuk , Michael Roth Subject: [PATCH v2 20/22] qapi: Inline and remove QERR_QGA_COMMAND_FAILED definition Date: Thu, 5 Oct 2023 06:50:37 +0200 Message-ID: <20231005045041.52649-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 = f'"Guest agent command failed, error was \'{errmsg[1:-1]}\'"' coccinelle.fixedfmt = 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é --- 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! */ -#define QERR_QGA_COMMAND_FAILED \ - "Guest agent command failed, error was '%s'" - #define QERR_UNSUPPORTED \ "this feature or command is not currently supported" 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 char *mode, Error **errp) 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; } @@ -288,14 +289,14 @@ static void acquire_privilege(const char *name, Error **errp) priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; 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 acquire requested privilege'"); goto out; } } 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'"); } out: @@ -309,8 +310,8 @@ static void execute_async(DWORD WINAPI (*func)(LPVOID), LPVOID opaque, { HANDLE thread = 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 dispatch asynchronous command'"); } } @@ -1423,22 +1424,22 @@ static void check_suspend_mode(GuestSuspendMode mode, Error **errp) 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 determine guest suspend capabilities'"); return; } 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, 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 = GetModuleHandle("ntdll"); PVOID fun = GetProcAddress(module, "RtlGetVersion"); if (fun == 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 address of RtlGetVersion'"); return; } 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, &gerr); 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 = g_new0(GuestTimezone, 1); tz = g_time_zone_new_local(); if (tz == NULL) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "Couldn't retrieve local timezone"); + error_setg(errp, + "Guest agent command failed, error was 'Couldn't retrieve local timezone'"); goto error; } From patchwork Thu Oct 5 04:50:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729710 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp695476wrs; Wed, 4 Oct 2023 21:55:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGM2FWN0kBM6cqjtps5YNUjTGEhX7ikQp5kSiYDJoH6p9CJa00EhAznoJzniitucB4IKSsd X-Received: by 2002:a05:620a:269a:b0:773:e488:320a with SMTP id c26-20020a05620a269a00b00773e488320amr4497060qkp.59.1696481713857; Wed, 04 Oct 2023 21:55:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481713; cv=none; d=google.com; s=arc-20160816; b=M0mKCl6P2MO/N1RsoURHstZ6n2yfivhIo+BEE3AKDqz7gzT+SjWaAyYeZINlRrapVT yaIGp8WLxfWB/bDPRgDwfkcbRnxglZYi+l8xlADca0WyD9VbOthKN0RGRaLSGJJ4DEut TRwKNlQQCzEgcgVIkW1NhdDFfGwaN793B6MNi16s5tnVKHm0dGG83IgklFV4i/MkdUqR 3Y7Fj1D0b8e0JCIYEs1/5JUF0bJBscmfiKM9pX7sKgQarHYAmPP1RX+zFObUW26vPexe g67WxfseJr0sbtcd1+G8gDaOwZ5DNK+dzBZqri2HHf790nAEdeltQ1hsYTwZaW0Bw2Sp lFug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YgccYr5Dzt6X/tQjLL34w8Nky+uqW63WT4BtHcxYfTM=; fh=ua6qulcWihvAMbyeHDk2JG5T8PW//dxPndMHeqNlEsg=; b=Gmn++By8DpEpEI/6lkmoiWvwqbV/IDBaCqIOQlwuB1b6z6yyOQH6uvUfLduTsGs8Fa PgsoGg5iMgd4TmY+ZBq5fB1eKsezHXyD0wbVQmzvbCU8JBZuyc9/+Ux3SJT5sDjy5tZ2 Rkbq+TuSsjC7gHeV/cZLSdYRKi1NwRdbPjQf/u3JzBd2ywsYDJEqG7JfKiFtIna9mMZR OaqCffJxO8wmCHcPuRQMwFhaZ3kou3mr1cDidHk6EShk9qZc0yun9FMZUhUrbUEiTpuF 9J7E7ut63pn/NeQ7eoCsFpmyuxb9cpj2TEYPFFVxHkfZ/eZawTUhk5zg98TTxxYLTlBh IXgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tsxn5RgD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i20-20020a05620a0a1400b007758ffaef15si400775qka.522.2023.10.04.21.55.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:55:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tsxn5RgD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGMS-00018A-77; Thu, 05 Oct 2023 00:53:20 -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 1qoGMG-0008HT-CY for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:53:08 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qoGMB-0007j3-H4 for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:53:08 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3231d67aff2so597333f8f.0 for ; Wed, 04 Oct 2023 21:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481582; x=1697086382; 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=tsxn5RgDjtR6zceeCoAmcBhCDjUrazsPWwYSnxUJDH2TWA8tkl/JjhkWHYOJ0cErJa mRpr4TY9K/a2SBzNSxh66IuoeLksFZ0cdM1zGEIvTo93CPM1kqf1yeduNUtWctmf8v8o b0LSJKGNSRuEyYT/PJE4cSj92gt1a9Dzv3lM05j+Z4rUPdHXjwqhe+d3YQJbQBP0DjfN s7LBELDhD5X/i+Wsdt93Hf/4Fbdx6tC07+oZjDU3Wx83RXgMpDJ/mwmAtKSKCIlLtM7k cXzxA6Dg+fp6XnRreBLJgJ7m4iWyT6DESZy+9epmTwNiGTZlka7MwJCKsMzT4i4TRfNM xdsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481582; x=1697086382; 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=qRSporsZD8AcaEu1uH0I5SBgaN+IGlHNJceQW9u9zRRyIydfQPqLY91PE93a9J56h9 sYIL10AmTQ9VgLUxRevTmoqdLyKsEMsaugtXHdYH+96DQcKDKOzku7acdedGt3fCtEJ7 +xKgErpWVlQIC6uESFpdmexPtWnA+EAb/9nq0ydAgEXLJb/W9uBN3VuX5Yk/EVAY6TuX m9Qm93OaTBJgqULIbL2h5kmnQwpjPTNv7dG7/FmMJut7z2JWWO/JzJbt9Bw87jF2gA0j r3+aWj1IiBYEbWMgw316/mXUEaglMnpn2eWyj34k1v7CevS9J51NO5PZPSaT1vfr9Co8 ArFQ== X-Gm-Message-State: AOJu0Yw36AMNyt/kCkA1EfocnLsVtiv+dc2Ow/d4gExUR+cLjz8I8ruW JXtS6r+zTpBm/kmCwO157iuCWG0rShY9lniuxOo= X-Received: by 2002:a5d:4144:0:b0:31a:d4e4:4f63 with SMTP id c4-20020a5d4144000000b0031ad4e44f63mr3618344wrq.18.1696481581749; Wed, 04 Oct 2023 21:53:01 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id g4-20020adff404000000b0031c52e81490sm750030wro.72.2023.10.04.21.53.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:53:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Roth , Konstantin Kostiuk Subject: [RFC PATCH v2 21/22] qapi: Inline and remove QERR_UNSUPPORTED definition Date: Thu, 5 Oct 2023 06:50:38 +0200 Message-ID: <20231005045041.52649-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é --- 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 supported" +# message, even if the given command doesn't specify it, or doesn't document +# any failure mode at all. ## ## 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! */ -#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) 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; } 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; } 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; } 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) } if (!hwclock_available) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return; } @@ -1540,7 +1540,7 @@ GuestDiskInfoList *qmp_guest_get_disks(Error **errp) 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; } @@ -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__ */ @@ -2751,47 +2751,47 @@ GuestCpuStatsList *qmp_guest_get_cpustats(Error **errp) void qmp_guest_suspend_disk(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); } void qmp_guest_suspend_ram(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); } void qmp_guest_suspend_hybrid(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); } 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; } 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; } 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; } 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; } 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; } @@ -3056,7 +3056,7 @@ error: 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; } @@ -3066,20 +3066,20 @@ GuestNetworkInterfaceList *qmp_guest_network_get_interfaces(Error **errp) 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; } GuestFsfreezeStatus qmp_guest_fsfreeze_status(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return 0; } int64_t qmp_guest_fsfreeze_freeze(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return 0; } @@ -3088,33 +3088,33 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints, strList *mountpoints, Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return 0; } int64_t qmp_guest_fsfreeze_thaw(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return 0; } 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; } 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; } 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; } @@ -3124,7 +3124,7 @@ GuestCpuStatsList *qmp_guest_get_cpustats(Error **errp) 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) 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; } @@ -3386,7 +3386,7 @@ GuestOSInfo *qmp_guest_get_osinfo(Error **errp) GuestDeviceInfoList *qmp_guest_get_devices(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); 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 supported"); return 0; } @@ -1241,7 +1241,7 @@ int64_t qmp_guest_fsfreeze_freeze_list(bool has_mountpoints, Error *local_err = NULL; if (!vss_initialized()) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return 0; } @@ -1276,7 +1276,7 @@ int64_t qmp_guest_fsfreeze_thaw(Error **errp) int i; if (!vss_initialized()) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return 0; } @@ -1509,7 +1509,7 @@ out: void qmp_guest_suspend_hybrid(Error **errp) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); } static IP_ADAPTER_ADDRESSES *guest_get_adapters_addresses(Error **errp) @@ -1877,7 +1877,7 @@ GuestLogicalProcessorList *qmp_guest_get_vcpus(Error **errp) 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; } @@ -1938,7 +1938,7 @@ void qmp_guest_set_user_password(const char *username, GError *gerr = NULL; if (crypted) { - error_setg(errp, QERR_UNSUPPORTED); + error_setg(errp, "this feature or command is not currently supported"); return; } @@ -1983,20 +1983,20 @@ done: 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; } 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; } 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; } @@ -2522,12 +2522,12 @@ char *qga_get_host_name(Error **errp) 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; } 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; } From patchwork Thu Oct 5 04:50:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729720 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp696615wrs; Wed, 4 Oct 2023 21:59:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPoW0TZ4uBboQmYwreFh7hg4g9cWH7gVks4JcDUoFnbPBx1zVm97rENrP0XXn6bSLNkGk4 X-Received: by 2002:a05:6214:41a1:b0:65a:f332:10fa with SMTP id ld33-20020a05621441a100b0065af33210famr4256168qvb.29.1696481983065; Wed, 04 Oct 2023 21:59:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696481983; cv=none; d=google.com; s=arc-20160816; b=gXqmqm4gCDquSKg7VVXEdXxgOZsvXsXvXPwSzPaErCyo3TDe7Lza371CQHGJCNQG9y EOPMfQ24njXtR8SoyEb9VDlqS8ZXdZZQKLfjXmwE9QCXl+ln1WRCH18Tj0v0HZxr1E46 qNtbW3lZLUv8/gpJct+bdc3U+T1rxtfvcKwtqyc60bx8xhI7Q4VfC6Sw7f/JWanMQ0d4 U4SBaaFM4S7e28KNFwpZNOjGxTxMKOIHAvKLHsD3yge7ecRjcHCNZszV4n5uHSQ80e2F z9V5zjBv5M6uyr8Zcakljz5dUfhGtiLBqZVnsKDzEGe4XZcBtt2j4jzRGvuSPCFMp1ZZ 5fMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MZHDirR49kl/OFImSRD5/SXCqBaJRHCMrzCJafFdwgU=; fh=rEcd8tzCWqIm42ZSK9whNPe0pQhSuvN+BbhygqYGL1Y=; b=bgDeFGSivN2tKo2sUdCXRAmfG4ibFkONh1/nOR8rn6Rg+6myFYqsQrpSBA+wiSzPaI e35m2SYh1bm+co9JhKAEJMQVNXTgSbnO313cdO/ihKijewpsTW6IbCrWgmS2WjooYrTc ppbEFAW2LmI8ky4qB44QWu9nLgbDOPNf29yDU6/kmErn3nvpRsJqWlwSIE+I3UeSRrTF A3kfpBsj5OTBFflCoArus+K8INV7mtwwe6XvWTYMDvRwUtN4xoiSxJ6vWa6NG5LsGBYa dxiRXnlMvWDbzx15FzhYL+IeAg4L2WrZZ3T77DgK8rTjepRyom2zzLkC3uC5/NXlw6Aq LhkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e16dIs3u; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y15-20020a0cf14f000000b0065d05af4053si382015qvl.550.2023.10.04.21.59.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:59:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e16dIs3u; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGMW-0001eE-Bc; Thu, 05 Oct 2023 00:53:24 -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 1qoGMR-00016n-Cm for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:53:19 -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 1qoGML-0007tW-QH for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:53:19 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-32336a30d18so508689f8f.2 for ; Wed, 04 Oct 2023 21:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481591; x=1697086391; 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=MZHDirR49kl/OFImSRD5/SXCqBaJRHCMrzCJafFdwgU=; b=e16dIs3uX495oLA7QAm1Vn71fFyMty1QBbJcKCAZZRBn56MLQI7TW5vkKngx5WHYD2 8Lc4mVSz/9QWjOzTJHstR5II/jd0AT/cGDwFikb2PYrnBChs35/4WHzXRm4gneAFv8BK 74+Se9buwPK3i9dfG6FMzi9eWxDowewLQvXtUfU4bxoYEsfF2/tMAye2pc7TQ6KiSKYY YkPhqIaxM+qk3Rfd6KzXggpf3il5ERT+zjw0xcpkMz6xfvm9xY1uoRGTnoyU8QrBcdJv yBWlniCrAYaMVPFCqYV7scBuBhEB2Qe3oni3TCnFEZIdsWZ0E9frnyjofLdoP8oXCT07 Uxpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481591; x=1697086391; 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=MZHDirR49kl/OFImSRD5/SXCqBaJRHCMrzCJafFdwgU=; b=lMk6qXg4l2JR1/ein+bM/EgfdtDqVHcZvcjZ+u902O69guVkfYsU4tydfyaBHI1knp jSeBuEpzV+sN2ApldvcS6lbo2ZpbTs9T3LbLWCDrdEDNwSFils0BKJVuh44bHSyvxVpF eYr9dxeVfPJnW1st3J12Ye9Nw+/lPhQP6/BxiinKXOpg0+WrNVOIbIod6mw5191Q2qPs bZ6QntpLoLRZ2NbZnCvG8XTSGkP2qZbLXzRNZvCu/hJnkQkwGqtpPDZRfK2d/VNHygtN EmAnyvnFKxItbUUpDUIbnTOrDPs0wX5fgLubRXAebvaedIwNh8MVSu10jh/MiqL6uh8T YK5Q== X-Gm-Message-State: AOJu0Yw8IblT85ADMNnRzH8PIGCUsMKaef95f5csE4umCI1zNIgv3B8D 5mQI8ZOsrkzEpBfAn8Oe791Idd15WBCTeV44hPc= X-Received: by 2002:adf:f286:0:b0:31f:db1b:7296 with SMTP id k6-20020adff286000000b0031fdb1b7296mr3919088wro.21.1696481590888; Wed, 04 Oct 2023 21:53:10 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id w17-20020a5d4b51000000b0031ad5fb5a0fsm755396wrs.58.2023.10.04.21.53.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:53:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Juan Quintela , "Gonglei (Arei)" , Zhenwei Pi , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Laurent Vivier , Amit Shah , Kevin Wolf , Hanna Reitz , Alberto Garcia , Fam Zheng , John Snow , Vladimir Sementsov-Ogievskiy , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Mark Cave-Ayland , Nicholas Piggin , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , David Gibson , Harsh Prateek Bora , Gerd Hoffmann , 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 v2 22/22] qapi: Remove 'qapi/qmp/qerror.h' header Date: Thu, 5 Oct 2023 06:50:39 +0200 Message-ID: <20231005045041.52649-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231005045041.52649-1-philmd@linaro.org> References: <20231005045041.52649-1-philmd@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 $ git rm include/qapi/qmp/qerror.h Signed-off-by: Philippe Mathieu-Daudé 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 later. - * 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-user.c index d93ccd5528..5a41aa7be8 100644 --- a/backends/cryptodev-vhost-user.c +++ b/backends/cryptodev-vhost-user.c @@ -23,7 +23,6 @@ #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" 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" 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" 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" #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-system.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 7360a22252..777200e65a 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 @@ #include "qemu/osdep.h" -#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" #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 @@ #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #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" CompatPolicy compat_policy; 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 @@ #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" 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" 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 @@ #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" 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_sysemu.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 values */ #include "qemu/cutils.h" -#include "qapi/qmp/qerror.h" #include "input-barrier.h" #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 @@ #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "block-helpers.h" /** 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=visit))