From patchwork Thu Oct 5 04:50:17 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: 729713 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp695787wrs; Wed, 4 Oct 2023 21:56:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG0MXBMUE9WSUovRsuuFnY/6xPwPFlYQj1ExwRvHQrjFR1SJTzsZSEb6LOSaqudC/x7gLi1 X-Received: by 2002:ac8:5e4c:0:b0:419:82fa:7102 with SMTP id i12-20020ac85e4c000000b0041982fa7102mr4364049qtx.38.1696481789598; 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=hGRpoX0nJhA9YMbUk0NScO0PG6sGW3JYPd5ZLRnBFp1IcTCw3NFBE7+PP/tLnE53ZD vksdHig3TlwovVAxEw9sIa3sqPSwMeMnIkUgEMyQ0ruOqg2l8eo8E1G/4MzeJ30l9dnv USllRW90G0ySXoS0XPH8soCyxXmzvXqDLPPpUP9LhUqgd1PqLhrRL0ERFseleU8uZKNM u7qy/MsqOLbeQzzkA8+LGOlhunx8R3wnxv+bBkgOoOkmU5gx4T3+QoxOf2vi10lbCY8n lyMygKbFO1cXaH9IsOQj9TFw4xu8OjZIqFq1CkEYHP5s2qbjfPsQcBZIrNHmTPYAVxQU DB6g== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=G5/bL+UFb8aN7V1hRtFDrx4S/Prog5l18VX5gdr2wlo=; fh=JX3J9/OKMshNdI/nEQBqYxJClpigKik+KHO5zdMJYQI=; b=m9dKiZjGZLd5A9I8D931VS9v0dL5TBDyPxGylTnVBLDV7rLeEyDVtcvZy/AKMFqKme Iq0LFbjailg67ExGlB6ws4gUbuAXYsTGg2xk7ePFWEvoZcH+mz4uuRjVeV9YCgcpt4Bx YLxmsGWiPWfsykqI1RwnA+4XEyC8Um6FmSGRKVztwuQJP/sK1VBJ+/RMYi9ET+3DvgJ0 /eE+0htaeUqW3wsYZ9aDzi9EGKT0N75JSqKQS62+9Ii5LHBFoagHcuaRVtM4iIfWB1yd +F+JkirWXlomu5CCG5FgnNgCZtIXuHkikMEo99ddg380/X0NDy/Z1f1rzT5l/JQMufmr 0csA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vsogpc9V; 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 c12-20020ac85a8c000000b004122ededdfesi423168qtc.253.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=vsogpc9V; 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-0005Sm-Bp; 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 1qoGKH-0005Gy-IA for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:11 -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 1qoGK0-0005Ql-HU for qemu-devel@nongnu.org; Thu, 05 Oct 2023 00:51:05 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-405361bb94eso5254445e9.0 for ; Wed, 04 Oct 2023 21:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696481445; x=1697086245; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=G5/bL+UFb8aN7V1hRtFDrx4S/Prog5l18VX5gdr2wlo=; b=vsogpc9VOjBJtK0AcDTd/9UpKnb2IedL12rktCegIHF6aM1wYhbdfXXFv+mcGfabJb KGTskxRfWbh9NnJW8xRrX3ltVLPZCtC63dSXLMbmtJN8W4bYkOVp2SuUmIkCpzTqLxp4 iZ7QddHoS+n5WoW8GDxJCJqIFkL4TtxNVMuBiYiV29C0gPmwBAd9rQgOiv9rBPyQjMn1 4i7W/oOEVbVAwux7ipKnongfpADHrJ3yseHteU0pw0rDDunWQ3brovjfcPldGhrKozxN SE65wylwkazP+HVIU6dD32dMDWwrcuvBPEuocywV/gMWVZjHs+exXiKnxu55JO+BCwJH h6Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696481445; x=1697086245; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=G5/bL+UFb8aN7V1hRtFDrx4S/Prog5l18VX5gdr2wlo=; b=kfuAc2Njs5zbogSpVKlAPwL0ttruSIGdMN04LORDvjIqGKRgYKxTniBBe+AiBUI539 XO7RkdmIw1xyocIT+t9SjQxd1k0ZCKfrSccuhElIOPLIYzt1/eOCMV34LhbfPBmusW5G OvvPh/YdeXAVK+q/P1PD2T35xfgKIjLtZpLiBR8T9LBCIovj9car7GspyI4VjlEYErXX /ZXD97D+lSJM5oxaBN6x743w+M9Hr7Jm06zfuOD/JkzNLvSLmowpm+t9LtXH3YWmCFK6 XGxAbPA/PPxo67NqKITATNc7k9/X1YvOCcauzwy8GWrnBAOz5pwctv8MaBSfBM1FDGXO 700Q== X-Gm-Message-State: AOJu0Yz93fGR3L6W6wE/fCnwjw0mbsA7PCbHhZ3ahfvROmZxh5yAsnP5 D9lxtwgxb64GARsRtqka0EYzmfuBSELATkZGwsk= X-Received: by 2002:a7b:ce8f:0:b0:3fe:2bb1:11ba with SMTP id q15-20020a7bce8f000000b003fe2bb111bamr4169410wmj.27.1696481444698; Wed, 04 Oct 2023 21:50: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 k22-20020a7bc416000000b00404719b05b5sm617269wmi.27.2023.10.04.21.50.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 21:50:44 -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?= Subject: [PATCH v2 00/22] qapi: Kill 'qapi/qmp/qerror.h' for good Date: Thu, 5 Oct 2023 06:50:17 +0200 Message-ID: <20231005045041.52649-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 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, 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 Since v1: - Fixed checkpatch warnings (Juan) - Added R-b tags - New patch for 'vcpu_dirty_limit' Hi, This is kind of a selfish series. I'm really tired to grep and read this comment from 2015 in qapi/qmp/qerror.h: /* * These macros will go away, please don't use * in new code, and do not add new ones! */ Besides, these definitions are still added in recent code (see for example commit 09f9ec9913 from June 2023). So let's finish with this 8 years old technical debt. Overall it took me 3h: 1h to find the correct Coccinelle doc about Python use and read it again [*], then 1h to adapt the script for each patch, rest is testing and writing comments, so the scripts used could be used as reference later. Regards, Phil. [*] https://www.lrz.de/services/compute/courses/x_lecturenotes/hspc1w19.pdf Philippe Mathieu-Daudé (22): qapi: Inline and remove QERR_BUS_NO_HOTPLUG definition qapi: Inline and remove QERR_DEVICE_HAS_NO_MEDIUM definition qapi: Inline and remove QERR_DEVICE_IN_USE definition qapi: Inline and remove QERR_DEVICE_NO_HOTPLUG definition qapi: Inline QERR_INVALID_PARAMETER definition (constant parameter) qapi: Inline and remove QERR_INVALID_PARAMETER definition qapi: Inline QERR_INVALID_PARAMETER_TYPE definition (constant param) qapi: Inline QERR_INVALID_PARAMETER_TYPE definition (constant value) qapi: Inline and remove QERR_INVALID_PARAMETER_TYPE definition qapi: Correct error message for 'vcpu_dirty_limit' parameter qapi: Inline QERR_INVALID_PARAMETER_VALUE definition (constant value) qapi: Inline QERR_INVALID_PARAMETER_VALUE definition (constant param) qapi: Inline and remove QERR_INVALID_PARAMETER_VALUE definition qapi: Inline and remove QERR_IO_ERROR definition qapi: Inline and remove QERR_MIGRATION_ACTIVE definition qapi: Inline QERR_MISSING_PARAMETER definition (constant parameter) qapi: Inline and remove QERR_MISSING_PARAMETER definition qapi: Inline and remove QERR_PROPERTY_VALUE_BAD definition qapi: Inline and remove QERR_PROPERTY_VALUE_OUT_OF_RANGE definition qapi: Inline and remove QERR_QGA_COMMAND_FAILED definition RFC qapi: Inline and remove QERR_UNSUPPORTED definition qapi: Remove 'qapi/qmp/qerror.h' header qga/qapi-schema.json | 5 +- include/qapi/qmp/qerror.h | 62 ------------------- backends/cryptodev-vhost-user.c | 5 +- backends/dbus-vmstate.c | 3 +- backends/rng-egd.c | 5 +- backends/rng-random.c | 4 +- block/gluster.c | 22 +++---- block/monitor/block-hmp-cmds.c | 7 +-- block/quorum.c | 4 +- block/snapshot.c | 5 +- block/vmdk.c | 9 ++- blockdev.c | 16 +++-- blockjob.c | 4 +- chardev/char-fe.c | 3 +- chardev/char.c | 4 +- dump/dump.c | 11 ++-- dump/win_dump.c | 5 +- hw/core/qdev-properties-system.c | 6 +- hw/core/qdev-properties.c | 3 +- hw/core/qdev.c | 4 +- hw/intc/openpic.c | 4 +- hw/ppc/spapr_pci.c | 5 +- hw/usb/redirect.c | 7 +-- migration/migration.c | 7 +-- migration/options.c | 102 +++++++++++++------------------ migration/page_cache.c | 9 ++- migration/ram.c | 5 +- migration/savevm.c | 7 +-- monitor/fds.c | 9 ++- monitor/hmp-cmds.c | 3 +- monitor/qmp-cmds.c | 4 +- net/filter-buffer.c | 4 +- net/filter.c | 8 +-- net/net.c | 10 ++- qapi/opts-visitor.c | 12 ++-- qapi/qapi-forward-visitor.c | 3 +- qapi/qapi-util.c | 4 +- qapi/qapi-visit-core.c | 5 +- qapi/qobject-input-visitor.c | 53 ++++++++-------- qapi/string-input-visitor.c | 27 ++++---- qga/commands-bsd.c | 9 ++- qga/commands-posix.c | 47 +++++++------- qga/commands-win32.c | 65 ++++++++++---------- qga/commands.c | 10 +-- qom/object.c | 16 +++-- qom/object_interfaces.c | 3 +- qom/qom-qmp-cmds.c | 8 +-- softmmu/balloon.c | 3 +- softmmu/cpus.c | 8 +-- softmmu/qdev-monitor.c | 24 ++++---- softmmu/rtc.c | 1 - softmmu/tpm.c | 8 +-- softmmu/vl.c | 5 +- target/arm/arm-qmp-cmds.c | 4 +- target/i386/cpu.c | 15 +++-- target/s390x/cpu_models_sysemu.c | 4 +- ui/input-barrier.c | 3 +- ui/ui-qmp-cmds.c | 7 +-- util/block-helpers.c | 4 +- util/qemu-option.c | 21 +++---- scripts/qapi/visit.py | 5 +- 61 files changed, 308 insertions(+), 437 deletions(-) delete mode 100644 include/qapi/qmp/qerror.h