From patchwork Wed Apr 24 08:03:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 791508 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp700594wrq; Wed, 24 Apr 2024 01:05:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXeR8CRvYpYLpdaIahj8ZTSnLbraDYNO0UrlISClYo5emVSJRM6MdKw8zCjJq/yAFITol+RFSY8yA/eNMh4sEMi X-Google-Smtp-Source: AGHT+IG8oHKYMPWidQSnysFa2526P7MtE3LxyUZqEMiXANzI9g3/HbHs8ZtkOWZqetAIYMPYRsIg X-Received: by 2002:ad4:40cb:0:b0:69c:a51d:4041 with SMTP id x11-20020ad440cb000000b0069ca51d4041mr1618088qvp.45.1713945959002; Wed, 24 Apr 2024 01:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713945958; cv=none; d=google.com; s=arc-20160816; b=Wm/KxPilKiftmfFNjTOr6kmwSTA9XwkfF5zvb0Op+8gFu8rrM2QByb0ked9UKCWhPN 2s2WESfV8mVk0Yiq3isN7f1BqyroWyBax0u5mat6rFTEAGR9qGugn3Szn2OyIqXogFd8 wmR7HaHm+ZRC8Fv3fysnswnY6gaJzefolPgUzgoTZGK5NyaBvEZzW9NTR8Zo4y4VJHaF sZaCuTRComjZwCo+LKwKKSzd+rGduNJyy2FUyQj0CKLG1PmvwV+5Z8t89dN+7sr7lZ6r BvFWxJhB8qe0FQhXQBV8wsnzbtU8u0z5pN0GAvRZ7M61ReRd6VH9Kzo3QQnPH9EHZwnR Swhw== 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=3tBjyp0E/07wS0Jc5eeRlzA54hufibhGrggWJ/rIYtA=; fh=TSG1EH5SPWBg+gLGBHXcOxv2KYvf8n7t4Rcci4tN/L8=; b=jIaQI6bFBODS9pCCRORn1uZ5QmXxPqjv+cOFM1SFL1+TpUxrf2HCaiTdFLLZaH1Tis RMejX27Tl0VYHtqngU22f/w+gryrJirvxi61nvGW32OJaY9aWM293drBdGeKe3N9NA0h s7B34n9AAo7fDgiPKUCKt4qxhDl34v/AIV38IoYmcT+0BIuYRrXDajwp5ABwuXOcMspw evOKBZ4aNi1SwiLceRzym8gTSdqPuFrfq3aqYAIlpyaQeP6Ize3z9oUl+g17lxL8DoVN wVOl1EuiUhTYswuXboIDPAxbXlMqVqi67CzA1BK2OkWIW8jjnA6ae/uiYDcUJFBEDhxm HPGA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RH8bNaLJ; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k2-20020ad45be2000000b006a067b5811esi11532344qvc.57.2024.04.24.01.05.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 01:05:58 -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=@redhat.com header.s=mimecast20190719 header.b=RH8bNaLJ; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzXbx-0006oR-0Z; Wed, 24 Apr 2024 04:04:13 -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 1rzXbU-0005pl-0W for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzXbR-0003n7-CV for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713945820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3tBjyp0E/07wS0Jc5eeRlzA54hufibhGrggWJ/rIYtA=; b=RH8bNaLJRr8KBpVt9w5Do+6Q1lQZKAxSaXI7X9z6dYw3u1OXocW5V7Ly+FCSV5VrVPsLLo wrR+r7WL28vyuSrlE3K8gXOsaC7fVLgzvsRwZRUwdMHP1Whze86DviRnQjg7hZrQBHPre6 c/W6SbM0cqsAnyohqJJ65hfMbfC+0CY= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-172-AWiPDqQrNY-2h2qAoeFYiA-1; Wed, 24 Apr 2024 04:03:38 -0400 X-MC-Unique: AWiPDqQrNY-2h2qAoeFYiA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4745A1C03151; Wed, 24 Apr 2024 08:03:38 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 281A5C01595; Wed, 24 Apr 2024 08:03:38 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3B15021E6690; Wed, 24 Apr 2024 10:03:37 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= Subject: [PULL 02/10] qapi: Inline and remove QERR_BUS_NO_HOTPLUG definition Date: Wed, 24 Apr 2024 10:03:29 +0200 Message-ID: <20240424080337.2782594-3-armbru@redhat.com> In-Reply-To: <20240424080337.2782594-1-armbru@redhat.com> References: <20240424080337.2782594-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.67, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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, and manual cleanup. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Signed-off-by: Markus Armbruster Message-ID: <20240312141343.3168265-3-armbru@redhat.com> --- include/qapi/qmp/qerror.h | 3 --- hw/ppc/spapr_pci.c | 5 ++--- system/qdev-monitor.c | 8 +++++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 0c2689cf8a..06a1d2248e 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 25e0295d6f..72cfba419a 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" @@ -1554,7 +1553,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", phb->parent_obj.bus->qbus.name); return; } @@ -1675,7 +1674,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", phb->parent_obj.bus->qbus.name); return; } diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 840177d19f..2ae1460e21 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -660,7 +660,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) { @@ -668,7 +669,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; } @@ -910,7 +911,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 Wed Apr 24 08:03:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 791507 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp700543wrq; Wed, 24 Apr 2024 01:05:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUN/V3b0cIIU+vO7MNhe/JBToWxquBwjbSsQ5FCjdPZyT69+H+NUsaisYJWxRzwsW5BEGS0DtJbgQcA8eJn9UKg X-Google-Smtp-Source: AGHT+IH+10sSTR5n9XEZ5wqR34repbUPsO4vjYgDaWV0EU80vx9JULJSsTU8W2f5MqD4z9MXHvqN X-Received: by 2002:ac8:7fd3:0:b0:437:bcac:a770 with SMTP id b19-20020ac87fd3000000b00437bcaca770mr1969518qtk.55.1713945951164; Wed, 24 Apr 2024 01:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713945951; cv=none; d=google.com; s=arc-20160816; b=irFoYB3sArp4oE8c8kLH21Xn8apkdIzGX4qdAI3Z5FJnlTngNnQmqGhjKc0jO5fTTl feupH8ozoefswSrpnog4snYbZ7l4juCWXHG35xd64lVTdJ/PGEmN9ePTm61xHWj0yX+G ww4o9Qa0KKEvLjDXcD6+fdJMD6wCbsjUxgJ2+OcBlm395RiKPUdCSTSB0GCCj/hCMu6t 112d6QecVE7OyqQGM2l1dr+16TSqHlWtJ1KL4U/Gr+B4iqgBtbsDNFGiF5jnLuEKPA7B eu5fTOI+yon36l2/qnM23EZIBQwcTasuE9YEjRdteuG2X2hNcixbf8iLcI109rmwXzZd xeXQ== 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=NiuiV2XNWoLOe0i8EiZrScnl5eVDDJW6PHINxn2sw/0=; fh=pGUaj4AwlbyGMsnOdYJwwNSDodFSz8lwvV6eBoMyFw4=; b=TWfzB6CaGM9ZIKnsEOnWhXwRaAjeLmhYCP9jQ1Kg2Kwv6dqc9/Kr/lQtn+rWPXnkxd VDmjBP+2jaXTnhXIlJeX5JQ0jyMF1HG7b206gYVk2vIS2gc6TxjBAkkyX2MPjaW6/Tj3 r32f8UQKZGTsPEropPhmV7DO+Thwm7HgVXyGoVwy+fb5HNpJjmPQkb6Iqn91BkEz0j1o ZSIAuTfl4prJ0U7x3B98paGXANm8Wn+IKGQLk2Zn9qRqowWByLnAdYGYhNkrh5pnlEkm IL3f85x+YDvJCyAlkeolTu7ksvObuYUz68en62hHcKt728z+Otzdk3WSsA3Hc0El9J+l z/aQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Pg+WD1YO; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 16-20020ac85750000000b00439a1f8e7c7si7107711qtx.156.2024.04.24.01.05.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 01:05:51 -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=@redhat.com header.s=mimecast20190719 header.b=Pg+WD1YO; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzXbx-0006ra-Hz; Wed, 24 Apr 2024 04:04:13 -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 1rzXbW-0005ss-OO for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzXbR-0003nI-Ms for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713945820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NiuiV2XNWoLOe0i8EiZrScnl5eVDDJW6PHINxn2sw/0=; b=Pg+WD1YOAMihhAGu9PCudo49jsD9Dt0SpsMdQ0Qtbf6ZzHBiHZqaAp8eIX5ovwzIOdM6pF 3c4oGzQPSLntr1TDaNohG9QwqU/uncuo7gJZDGQPsCulzirWWNQ8i8SLyHSjv5Yto3qGN4 eCc4Q/XcjJNrm0vkZ8xO+DNB4szIfkY= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-695-9BK_vXyENPqZQA65VJvL8w-1; Wed, 24 Apr 2024 04:03:38 -0400 X-MC-Unique: 9BK_vXyENPqZQA65VJvL8w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 39CD31C03159; Wed, 24 Apr 2024 08:03:38 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 19F5A1121312; Wed, 24 Apr 2024 08:03:38 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3E1B221E669B; Wed, 24 Apr 2024 10:03:37 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 03/10] qapi: Inline and remove QERR_DEVICE_HAS_NO_MEDIUM definition Date: Wed, 24 Apr 2024 10:03:30 +0200 Message-ID: <20240424080337.2782594-4-armbru@redhat.com> In-Reply-To: <20240424080337.2782594-1-armbru@redhat.com> References: <20240424080337.2782594-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.67, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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, and manual cleanup. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Markus Armbruster Message-ID: <20240312141343.3168265-4-armbru@redhat.com> --- include/qapi/qmp/qerror.h | 3 --- block/snapshot.c | 7 ++++--- blockdev.c | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 06a1d2248e..daa889809b 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_NO_HOTPLUG \ "Device '%s' does not support hotplugging" diff --git a/block/snapshot.c b/block/snapshot.c index 8242b4abac..8fd1756777 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" @@ -359,7 +358,8 @@ 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) { @@ -437,7 +437,8 @@ int bdrv_snapshot_load_tmp(BlockDriverState *bs, GRAPH_RDLOCK_GUARD_MAINLOOP(); 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 057601dcf0..08eccc9052 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1395,7 +1395,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, + error_setg(errp, "Device '%s' has no medium", bdrv_get_device_or_node_name(state->old_bs)); return; } From patchwork Wed Apr 24 08:03:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 791501 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp699992wrq; Wed, 24 Apr 2024 01:04:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVJZF5yyU3ovAmdgM/7X44pUgeV1IVG4iNI3yTPvTz4bAzIOZWmlf5FIYbBxkxlCvmdmvZPeJDMszVGjtwd08+e X-Google-Smtp-Source: AGHT+IHHV++lzDSnYs2llF4YeKrL8PzBoScnOeqNhNdY9QsSa+daCudFmkgD2aHT7Pq0EjO7B2XS X-Received: by 2002:a54:4503:0:b0:3c7:4d4e:f4d with SMTP id l3-20020a544503000000b003c74d4e0f4dmr1683020oil.39.1713945851324; Wed, 24 Apr 2024 01:04:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713945851; cv=none; d=google.com; s=arc-20160816; b=FzugQy3/0djeXlXdvFAlc47eKDMUCcsag4vweDgTWQGC0ZhQyexh48vnE4wnpXMAue m+O3gAOcNXXJHjnMV96v8kaHARUNHE7lQeFm1npL+EAGDKLmhRXJP9BSMPe/4hmtZJ0P PTsAdd97p89dYOMaT9lJOQR8oPKyr0U1yiR7smEIFXOvKLYg7YPjU23Th5Pm4XagtBdr nP0ShzJ8loOvlLaEijYi5G6TP1t1TJGexDNxeoLTShoBKht5wa+hDzGIGPuW+NJDUU0B UEzTQuP6pmFxl3ChRy89igKuS9pi2T/8KBabI1dRhxghVNEoLakweLaFHmo/vf5o2oLv 6J/Q== 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=ote8/Ggg+mQ1mV4i16sKa7lJ17Z9TkkbhrUQT2Vox2o=; fh=pGUaj4AwlbyGMsnOdYJwwNSDodFSz8lwvV6eBoMyFw4=; b=Omkf7kS5LKQBY0FQIZT3eSSeCzw210V/4AcQr7mRyVFqdp5GzjsPYVz6oEd8GNR+BL GgMBozyse9q25/2XJHFQV1JcleFRp2w9m8GVX2axfSkzmJqQzBNIVfzFEIRtCztKa+AK uD01OY9C6ySwHpoghGrPsa1gNZWY1Agk8xUfEpx/Hiz1KEb51NqBnClGJWT2F2KXoAFf h0VXU73QAqwsGZcCutBYGfKLo/qG35/VF4z2mXfdMFsk/1JcddJqvO+w9/CLEtpkiaUC Fv0gJmx/NQ4nYZFxOohzJs4mhR/eLQKN/MYWgxG6V/Pe+glUt7YZ9bl+STj5ED+7o5w6 qJFg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b3aVhcyE; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q6-20020a05620a038600b00789e614090bsi14174162qkm.696.2024.04.24.01.04.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 01:04:11 -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=@redhat.com header.s=mimecast20190719 header.b=b3aVhcyE; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzXbp-0006Na-KC; Wed, 24 Apr 2024 04:04: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 1rzXbT-0005pG-9l for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzXbR-0003nB-Di for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713945820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ote8/Ggg+mQ1mV4i16sKa7lJ17Z9TkkbhrUQT2Vox2o=; b=b3aVhcyEbRlT3IL5vOga0LtU7VZb1qT9zE6W00QniufW9OOZjFGiXm/ylNcbfmmapM/XFA iKIeiEsgn1tgWefJY4aKbIFv3hc5Br7HwZZajbNzT2ReTHqF0R6UGGRv/AvjAVfed4zCFK Fbd9BHoPLe0VDo4Te6wZzfrY+Qlc+28= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-172-BWuTSmCpNRemtIC9zTbvEQ-1; Wed, 24 Apr 2024 04:03:38 -0400 X-MC-Unique: BWuTSmCpNRemtIC9zTbvEQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3F579834FB3; Wed, 24 Apr 2024 08:03:38 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1EE301C060D0; Wed, 24 Apr 2024 08:03:38 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4148621E669C; Wed, 24 Apr 2024 10:03:37 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 04/10] qapi: Inline and remove QERR_DEVICE_NO_HOTPLUG definition Date: Wed, 24 Apr 2024 10:03:31 +0200 Message-ID: <20240424080337.2782594-5-armbru@redhat.com> In-Reply-To: <20240424080337.2782594-1-armbru@redhat.com> References: <20240424080337.2782594-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.67, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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, and manual cleanup. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Markus Armbruster Message-ID: <20240312141343.3168265-5-armbru@redhat.com> --- include/qapi/qmp/qerror.h | 3 --- hw/core/qdev.c | 4 ++-- system/qdev-monitor.c | 2 +- 3 files changed, 3 insertions(+), 6 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 c68d0f7c51..00efaf1bd1 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" @@ -479,7 +478,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/system/qdev-monitor.c b/system/qdev-monitor.c index 2ae1460e21..6af6ef7d66 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -917,7 +917,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 Wed Apr 24 08:03:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 791509 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp700596wrq; Wed, 24 Apr 2024 01:05:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUlSQDl+e9xLb5ibpr3aOx1hgZCG1pEJjmvPTF6QCis3ov7gFAplLjg33VeB5eOwEsY6gP03sJc+bpuaNkNDlQY X-Google-Smtp-Source: AGHT+IEHZBe/w1xlg3D9cDcALJIZ1r3Tdro3BrGmyrHwzIF5cH0gofRtivk6j4hbT8jb86DtZvQC X-Received: by 2002:a05:6358:d593:b0:186:2720:2122 with SMTP id ms19-20020a056358d59300b0018627202122mr1767666rwb.2.1713945959330; Wed, 24 Apr 2024 01:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713945959; cv=none; d=google.com; s=arc-20160816; b=ZCblO43bhhDT/6v3YjTA7Af4jyi37aJkRVG1Vp/SJY4ccnbcUQhCodJj06jrmdXFDZ BhppSOJ9mM9TxvujYsTqlizU3G7Cca3TOtETbJawKu1HnhX5x2/ZWXUkBisuCUfVHZne 8b++FHeqSJ8lKSMv2mdUsSeUXr2NIzmz9Wpvw9jFNKyJZ2bJi0dY23de5wQwf+1dW+WS kvAEl25jEpqrONHhggw26oWBEtFwGkv6kKgbRoKDlb+u0DJbAK2I9UCDaYsyq30LIywF /J1jL607qJx56slup2QNfsUyRVqo+EV7ycj3auG7O97gdcOKc3P2qgn7Q0dVcs/A9S80 uxqA== 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=RzyA+8FvRc0MMftFU70dD71qqB2P/3uuYTFBQFXNu+A=; fh=pGUaj4AwlbyGMsnOdYJwwNSDodFSz8lwvV6eBoMyFw4=; b=fMjMa1WLhv/OGyb/GdFzOre+WW2OdbhSPNc+A6+pkYNkBhU8tdHdBAuZO/KVGqm5tR l/IvXhWd8m1EMbrnRphgDJDZpA4DbQK8ck6+v8TUVab16AI/o6mAr1FQIpY4r1pMSeE9 4h8y9vqIQ47TCdbtXOFLPQgiUCSgZT25/OsHMRybBukgeFl+9jcvFtMNQDnjl5Dv1P9q uO9mSc9ydXJU7RXgOyNN5bqBu0r4mvN7cILFvG5GUyXMwyDltHVn3ULpo6u5JW6hGtu1 gw7QbS6mDGIHFVa4YNF6SNmzVkBWkHUkAYil1AZOEendRrqfxALm/pZDYPPyoZd7JF0z vhzw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L3M6GV2A; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ex5-20020a05622a518500b00439890fe230si8839916qtb.442.2024.04.24.01.05.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 01:05:59 -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=@redhat.com header.s=mimecast20190719 header.b=L3M6GV2A; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzXbx-0006sa-Kv; Wed, 24 Apr 2024 04:04:13 -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 1rzXbX-0005t2-7Z for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzXbS-0003no-CW for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713945821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RzyA+8FvRc0MMftFU70dD71qqB2P/3uuYTFBQFXNu+A=; b=L3M6GV2AX+9bp1juEnhfpqe8rZS1kYNdX2Ww3dC95dPpoqj5Nc7Bg93knxRhkxiaKQovfm 07SImKx5GBhvezjluQLjLegPpa4KgHnRcvv/xyjsEIjRMKsjhy4niTDvCOsOAfSOU52Qdi iFC3+EuZ/+xZQ7AQFFgZY2TMwb+VXy4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-183-zeBbQLcpNeC5jJiFqucZ5w-1; Wed, 24 Apr 2024 04:03:39 -0400 X-MC-Unique: zeBbQLcpNeC5jJiFqucZ5w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 319E780D0FA; Wed, 24 Apr 2024 08:03:39 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 121A93543A; Wed, 24 Apr 2024 08:03:39 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4499921E66A7; Wed, 24 Apr 2024 10:03:37 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 05/10] qapi: Inline and remove QERR_INVALID_PARAMETER definition Date: Wed, 24 Apr 2024 10:03:32 +0200 Message-ID: <20240424080337.2782594-6-armbru@redhat.com> In-Reply-To: <20240424080337.2782594-1-armbru@redhat.com> References: <20240424080337.2782594-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.67, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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) Manually simplify qemu_opts_create(), and remove the macro definition in include/qapi/qmp/qerror.h. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Markus Armbruster Message-ID: <20240312141343.3168265-6-armbru@redhat.com> --- include/qapi/qmp/qerror.h | 3 --- qapi/opts-visitor.c | 2 +- util/qemu-option.c | 10 +++++----- 3 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/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 eedd08929b..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; } @@ -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); @@ -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 Wed Apr 24 08:03:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 791503 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp700085wrq; Wed, 24 Apr 2024 01:04:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUJYUOtEPgLNXZ16bMzYPJ0mMDeij4PB7TUVglm/KgMOYmodIEcfv9r4UmGNanP7+cH4WdNc4+laS402hr9k5zF X-Google-Smtp-Source: AGHT+IEb2Nc2h9F06+ip51+9s3ALrAsk8Ghls9MOjPnyMhxicfm8vy31OeWuOidndCOGyzunBEkf X-Received: by 2002:a0c:e6e9:0:b0:69b:1aec:88fb with SMTP id m9-20020a0ce6e9000000b0069b1aec88fbmr1638747qvn.23.1713945869798; Wed, 24 Apr 2024 01:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713945869; cv=none; d=google.com; s=arc-20160816; b=d/P+w/2GGeeNft3pArRhzIh34V4vzb86zLfUBFerBesqKXV5RlHgRYkFmk3TPsQbMa 3DK/VYWn2pKTGUz5L2Lrh+QRd4zE26UUgzirVpdYl0GBod7LuHI6cX4FTN108yhTKU3b rM1JTA6XNuMrHDEvTcRCuRldkEHAl9lU/SuKERGY8ZbHanaoLoLjofOn0Tt+BKw1d3c0 SDKjY8YxaRSNXZQSSa8uygh8ZBjNeFQIZlhwKRUkRlpSOOBCuPDChs/lMeApQyH1epHy s4K1jCJSJdX1JSW8faECffUGSi8aGRb0n2oSDpQaBEiTefoQqYI4bUNc/zm24R4qMN3G XnRQ== 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=5eLCZ9KHi5R0d0wUIGjvKWZQ5Nv4c0Evx+7s73yXtuk=; fh=jgXZUdNI3mIRMXo4FO+maZv4rlmk7uZiHGIRmgw3yY8=; b=RxDgNYGwexdXJH02fVcNrwV4bjG/Z9NLAA7BA3ZVmrD0v5GDAFBpuPtZKQ9TM9JSwj ShbcCze/ZfnCjNNeRxC7J216inixWF5YjszOV2f0pjXo98AzMI036xnoR2V48d/bWzQC 9YMpmwGahxX2dZx9ivndh7FaTrrSvmmJdUjE6iSU7+CNarOLUZvqiXpfIFiiSpnuAtu6 8wo9HrgST5MhnPGGONo9kdig6ZrXiadsXUrQVlAy0oxb+WU7nqRiHqc7A9/135oBWYzf 78uLqA7J4PJ5kmqTHjdZBsJQ1DUKkVfKOd8uXhdHYUQ9ds1g4jet0Q9bna7u+3d8mMKc aPCQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hJ1sqrJB; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gm9-20020a056214268900b006991b67d51esi14751608qvb.277.2024.04.24.01.04.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 01:04: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=@redhat.com header.s=mimecast20190719 header.b=hJ1sqrJB; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzXc4-000706-K5; Wed, 24 Apr 2024 04:04:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzXbX-0005t1-6h for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzXbU-0003oA-Au for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713945823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5eLCZ9KHi5R0d0wUIGjvKWZQ5Nv4c0Evx+7s73yXtuk=; b=hJ1sqrJBH5MXLC+hNGaP986lV0pqWDkTf16mcRM8yF2xWmNJtgSJeCq0yNgIb+9ALqpxY2 ufPSFZeJsF65/2uhZsH5WJnnSYcDdvp//MlAO7yuV0/AZnWKsHIKQJLx1Gxv0pRkgT+AZK QUwForu3bw4r4LCVesv8Bs35sHagbZY= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-185-9VvF14vWN3GE7hZYOcALqw-1; Wed, 24 Apr 2024 04:03:39 -0400 X-MC-Unique: 9VvF14vWN3GE7hZYOcALqw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5ED833C3D0C5; Wed, 24 Apr 2024 08:03:39 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 258F4400EAC; Wed, 24 Apr 2024 08:03:39 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 47D1B21E66AB; Wed, 24 Apr 2024 10:03:37 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu Subject: [PULL 06/10] qapi: Inline QERR_INVALID_PARAMETER_TYPE definition (constant value) Date: Wed, 24 Apr 2024 10:03:33 +0200 Message-ID: <20240424080337.2782594-7-armbru@redhat.com> In-Reply-To: <20240424080337.2782594-1-armbru@redhat.com> References: <20240424080337.2782594-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.67, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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é Signed-off-by: Markus Armbruster Message-ID: <20240312141343.3168265-7-armbru@redhat.com> Reviewed-by: Zhao Liu --- 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 d4a001cf41..3d96818f7d 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1495,7 +1495,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)); @@ -1556,7 +1557,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); @@ -1589,7 +1591,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; } @@ -1663,7 +1666,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 Wed Apr 24 08:03:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 791504 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp700132wrq; Wed, 24 Apr 2024 01:04:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX9uPH7jMdbPzIQnHw25pgt7e7V5gEsUatwBikOnCsswcgpidhBVEt1zv0xoOsYnQ6lSVWy7U3vR+DKXpuEscRu X-Google-Smtp-Source: AGHT+IEImtFyeR2TFcXp1/mk6u8IX103Qsaauws3zQITQH5MPyJyY7dnDD63qdTg/tPc8MsCrfJi X-Received: by 2002:a25:854c:0:b0:de5:53a9:253f with SMTP id f12-20020a25854c000000b00de553a9253fmr1952113ybn.15.1713945878108; Wed, 24 Apr 2024 01:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713945878; cv=none; d=google.com; s=arc-20160816; b=lcol28cYSMFHTpoTwylOaSgJdQ62VVRDLZnUxbJajz44mYDvhVOlS5y1HP7WTpP7Je 34dXMjoYBuurWy2REpMHhl89sBAzqXglKngAJXdBrZMjRLrzmDtUDAbkY8vVpoe5RSau PsV53dE/NCYe7yf5rZ3C5xILdgZOSWXTIgmLye6jUBEcFZmsGd86OKtmgiDuzz3NyKsy W9l2gsWUPRbkRPlDHcQIn6mVTE7kdASJZTHS7+5R0xjBHnpx52A2gP5MuLq3AcVui1YE PzgTLl3GnVvycR5vmB6QKr5shqqZh/gZjKqMQLqWSds6O+lSiuitfKQhOSpcRSalqs4a 8UJQ== 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=ZdO3ys51gFGTtlPnaZEuNtvyTcKAodScH+C3F5XFx4Q=; fh=jgXZUdNI3mIRMXo4FO+maZv4rlmk7uZiHGIRmgw3yY8=; b=IFI9h/iojE2mf5VEcmK7opn113xefRCUN4U8xuzpvNawkrG5pxI1FRMmxiIQBdTLNa UmLw/BWZvIT/pSPQfxjGLEwFcAmkZbyI/xZ/1sNHK0NhCpWWSyONVU4TcegIKLzmRdV6 h93xyTz1NEDpivQMncmzu+qaso/rBNqjTtgv7JV5OKQu6GM+yCaxGfXogCYS54QVOGtj RUszEVq40wW+bA4QXqCon3KJS7j15MXCBObJFkRhSheY27QbaxitDFY/4fSieTN4/WvP Rca/XZQaj+m2keHjKZ57EGsL3FewuxupdSm8I9LLoaDJAb4CIEfj95zxzH8W8V8ieZ0o IRCw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Yv26J/Pn"; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id gc12-20020a056214230c00b0069b6bed643fsi14832611qvb.37.2024.04.24.01.04.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 01:04:38 -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=@redhat.com header.s=mimecast20190719 header.b="Yv26J/Pn"; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzXbt-0006Wq-0P; Wed, 24 Apr 2024 04:04:09 -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 1rzXbY-0005td-Go for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzXbW-0003oI-H2 for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713945823; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZdO3ys51gFGTtlPnaZEuNtvyTcKAodScH+C3F5XFx4Q=; b=Yv26J/PnBazg9yB/rQb5HNyYHqeOmCJxgzLov3YG1YI1Ryjr7W0WoR9OBRcijSi8zxmsFd TiXtudBzQWDT3B0jyn1qOj+xQBzkJc0PK9iqEziaOd01mM6sdnkvf4Whg2tzRFea+T/zo2 9jUyBY6HOeOv7oPaZyBk9ptmebrYaO0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-199-bbUme36JMGa1gPcDkbxOMw-1; Wed, 24 Apr 2024 04:03:39 -0400 X-MC-Unique: bbUme36JMGa1gPcDkbxOMw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 44875812C39; Wed, 24 Apr 2024 08:03:39 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 257F5C13FA4; Wed, 24 Apr 2024 08:03:39 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4AD0D21E65D8; Wed, 24 Apr 2024 10:03:37 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu Subject: [PULL 07/10] qapi: Inline and remove QERR_INVALID_PARAMETER_TYPE definition Date: Wed, 24 Apr 2024 10:03:34 +0200 Message-ID: <20240424080337.2782594-8-armbru@redhat.com> In-Reply-To: <20240424080337.2782594-1-armbru@redhat.com> References: <20240424080337.2782594-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.67, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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). Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Markus Armbruster Message-ID: <20240312141343.3168265-8-armbru@redhat.com> Reviewed-by: Zhao Liu --- include/qapi/qmp/qerror.h | 3 --- qom/object.c | 4 ++-- scripts/qapi/visit.py | 5 ++--- 3 files changed, 4 insertions(+), 8 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 3d96818f7d..44ec8f6460 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" @@ -1912,7 +1911,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..a21b7b1468 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; @@ -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)) From patchwork Wed Apr 24 08:03:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 791506 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp700448wrq; Wed, 24 Apr 2024 01:05:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXkX/l6/w+EMjFsJU9aOqD18SXVWMleGRtJpryN8ZIs6aBDdfOHfrrmBAn/eV/DzMrryEcOuHtvkrrahM+sTF7g X-Google-Smtp-Source: AGHT+IGaFZJPNrdey+4kz8UxCFZYJdC3oIcyNm9LyznZbYDBPkdcoDBbjzJOpmQmjusDoQ42bxCL X-Received: by 2002:a05:620a:5a75:b0:78e:bd5d:547d with SMTP id wx53-20020a05620a5a7500b0078ebd5d547dmr1794486qkn.43.1713945932471; Wed, 24 Apr 2024 01:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713945932; cv=none; d=google.com; s=arc-20160816; b=AtNtZkfasWI8sHoKW0oeA1BAc8EQ3vH2qITx3uVTG9uounMn9xqHbgXrmPT45Bz951 4LXrUFPK6O6/dCD9qw4iKIzZxBNvv28uATYZDwV+z/qUEAlW7MDFsnlrCzYp93ri2U2f vEYL8st+njgQAqHA9ZPeWomSkP1SLdunkCW7e+NlD3ZRMdxq9/kMD2zF4bwSyIFI2jj5 dl/VCqmw13iCBZO32QASBuy1/jpfJfUEiSzhAal+MoVX1jeZXeZcwqdAGX+bN3BNT1f/ obiX5MfPQclcNhXWhCmbLt+8q/Z9Z1dKSbkP6n9AkkE+SETYnrlnBUG1g8HAnv+lVmWr ORdg== 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=kXLAsN/MjWVrTQesWQIb8lj4bZIyULexZMx0u8KANK0=; fh=axzdzWpyk9nBHGlMTHXAA8pRXwojiLsYurKeeecLVqM=; b=XC0pYIlhsUg7sAXcRiHjoT3hwmOAF7+DKlLScqn6FriKf/5BPlY11/AfK+ohrhQ/ru sBKY9CkjUQxz2NEjrFczgZYgiBhWT1H9bQjLlXbYQ9S4LNh0ni82fPIyGbLP6v77/BkB 5xqfpjQ2HnDgGONteaWccxnRczCdf8cBNG2nLxdCpcsJryeFYQr6N0e5HjI4plHqypE7 1Gzj0I44UD2LyqD5bTrfinik4gu1ECPAWV8dPzSVdM8+HHh4E+SfJ0D07wYpd97KuQ/t gEgKhNe2CRmIhory0o0qcuhH20ooy7guel4CSQzIHMkCSePg6tBEZWS1yocR0xblDG06 VZ+Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UCYKdlLg; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id xz7-20020a05620a5e0700b0078e8cf3fc80si10871546qkn.175.2024.04.24.01.05.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 01:05:32 -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=@redhat.com header.s=mimecast20190719 header.b=UCYKdlLg; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzXc1-0006w9-3N; Wed, 24 Apr 2024 04:04: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 1rzXbX-0005su-3n for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzXbS-0003nj-78 for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713945821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kXLAsN/MjWVrTQesWQIb8lj4bZIyULexZMx0u8KANK0=; b=UCYKdlLgOz/Km603AA55deTGb5DNJf27q3UqRfH6lreiC1F7QUJw4IeFIFSREu7u9y6rSK EKeKOHBLZrRk3p8wLASQOrDvyClCOTT/op3kYeQuFkUs70StVJ6aL2Hs9SM9JJtnQeZDUV mdkQOlx0J4QTJlkQazUDewEOdwbdKxY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-185-0g-fZ5TLMgib_g2FIqKLoA-1; Wed, 24 Apr 2024 04:03:39 -0400 X-MC-Unique: 0g-fZ5TLMgib_g2FIqKLoA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 48033834FB1; Wed, 24 Apr 2024 08:03:39 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 25B49400EAF; Wed, 24 Apr 2024 08:03:39 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4E07B21E65DE; Wed, 24 Apr 2024 10:03:37 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Juan Quintela , Zhao Liu Subject: [PULL 08/10] qapi: Correct error message for 'vcpu_dirty_limit' parameter Date: Wed, 24 Apr 2024 10:03:35 +0200 Message-ID: <20240424080337.2782594-9-armbru@redhat.com> In-Reply-To: <20240424080337.2782594-1-armbru@redhat.com> References: <20240424080337.2782594-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.67, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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' must be greater than 1 MB/s" Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela Signed-off-by: Markus Armbruster Message-ID: <20240312141343.3168265-9-armbru@redhat.com> Reviewed-by: Zhao Liu [New error message corrected, commit message updated accordingly] --- migration/options.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/migration/options.c b/migration/options.c index bfd7753b69..d7a773aea8 100644 --- a/migration/options.c +++ b/migration/options.c @@ -1286,9 +1286,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' must be greater than 1 MB/s"); return false; } From patchwork Wed Apr 24 08:03:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 791502 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp700001wrq; Wed, 24 Apr 2024 01:04:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVv+AQIs7GdDFVNcnQDdBf+V5Y52nkFRIr+mcm0M40s1aq20aw28q4Tvbf0b7WeISCw2XjpbOBdE5KvSvcAbFmZ X-Google-Smtp-Source: AGHT+IHHAMOEQC/mMmh7NEnXANNGoiIq5AUyJD3HK32dE5rC8YXffJG7gRauki1Izv87nyOtrOD7 X-Received: by 2002:a05:6359:4288:b0:186:1d2a:a467 with SMTP id kp8-20020a056359428800b001861d2aa467mr2018607rwb.22.1713945852509; Wed, 24 Apr 2024 01:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713945852; cv=none; d=google.com; s=arc-20160816; b=Agc1FzSDKH8EljfIe+EHf/xWXtWpoUFdN5n6Y9tH+YjpHW/yqU+E4Dws0lO7p0WDSk /JvcwNk3IGgTUyuOmTX8WjYV2EgYT3d7ItyVCaWoL4NK8VAMd9HoPen/nzeI7yxDb/pQ T0vZpH59W972GxueSHa/Mwyp6TJpVN7A5AfRq4NMI4tULbhUE+cyJbDMUbVIc/YfKpwr ulLIEresJCYgjAIs5yyBunyzwk6nOrHFL86Vu64O/dKxb0D1fYJ3VFDscCIEcGkWQIls FJoxcQkx9qc/P660vVW9Aw+GZSwMr+XESBXdrggiSCPjwSJHa2GYig12NS5xgycd/XB5 UxQw== 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=C0vcnHD36q3vBRtSJzWoo1mOJokKaLTmecVzyyv/5dE=; fh=axzdzWpyk9nBHGlMTHXAA8pRXwojiLsYurKeeecLVqM=; b=WTTB9ITpwpGX0F004Jxon2aIzFQNJK7MFWiV2k+df6ziV3TgwJ1Uoe1Z1PH+c7R9Cw QnxCpL+BlJRufS/iHPiPlGJf7NDUFcsIRpPxRnXe3+zbXrws955R/Nto/yXDM1ApdzFS VtieTTlZiTRE8sSULLD0mjtzYNx7vdxm/OQHrSrNIjl6ll+GDUuJoB6nHF95/1+KexOk 5Iy/SvPYeY6Z3wipzwpTtX2393VyJkXgnDbQLn6MSIHE1b9kiKFlhu1PxZ6H5bkJKjOk Rfm0cxGXHMxmXzc2TlCnvnyUkUaJvTTPZHYCqE41aBhR/kOnHrrK5ePmG20P4MdmE34A xR6g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BaHFvdr0; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ea8-20020a05622a5b0800b0043780b2b689si8733412qtb.575.2024.04.24.01.04.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 01:04: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=@redhat.com header.s=mimecast20190719 header.b=BaHFvdr0; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzXbp-0006P3-LG; Wed, 24 Apr 2024 04:04: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 1rzXbY-0005te-JV for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzXbW-0003oV-N1 for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713945824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C0vcnHD36q3vBRtSJzWoo1mOJokKaLTmecVzyyv/5dE=; b=BaHFvdr0gQLd7ZW1wXT6hNtdAO+4nYj9UbUAPI3CcCXtCbUbL4iIfT2/oQ4rYdRN3FKYDC 4824vzhRcEK/IJpu4jkEraDdYPnLOHY9IzbFZiiisvOXqpc8wdd9IReLeYTEB7uR2PmSZb ltPUOAXcDmBMRY3xqSq5yMeP1gsayYQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-201-POa6OTM0OZyIeAXV6jgEVQ-1; Wed, 24 Apr 2024 04:03:39 -0400 X-MC-Unique: POa6OTM0OZyIeAXV6jgEVQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4610F812C55; Wed, 24 Apr 2024 08:03:39 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2599F1C060D0; Wed, 24 Apr 2024 08:03:39 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 512FD21E65E1; Wed, 24 Apr 2024 10:03:37 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Juan Quintela , Zhao Liu Subject: [PULL 09/10] qapi: Inline and remove QERR_MIGRATION_ACTIVE definition Date: Wed, 24 Apr 2024 10:03:36 +0200 Message-ID: <20240424080337.2782594-10-armbru@redhat.com> In-Reply-To: <20240424080337.2782594-1-armbru@redhat.com> References: <20240424080337.2782594-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.67, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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 Signed-off-by: Markus Armbruster Message-ID: <20240312141343.3168265-10-armbru@redhat.com> Reviewed-by: Zhao Liu [Straightforward conflict with commit aeaafb1e59f (migration: export migration_is_running) resolved] --- 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 b723830eff..385a4876d6 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -23,9 +23,6 @@ #define QERR_IO_ERROR \ "An IO error has occurred" -#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 86bf76e925..32cd89e13d 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1956,7 +1956,7 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc, } if (migration_is_running()) { - 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 d7a773aea8..239f5ecfb4 100644 --- a/migration/options.c +++ b/migration/options.c @@ -685,7 +685,7 @@ bool migrate_cap_set(int cap, bool value, Error **errp) bool new_caps[MIGRATION_CAPABILITY__MAX]; if (migration_is_running()) { - error_setg(errp, QERR_MIGRATION_ACTIVE); + error_setg(errp, "There's a migration process in progress"); return false; } @@ -729,7 +729,7 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params, bool new_caps[MIGRATION_CAPABILITY__MAX]; if (migration_is_running() || 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 e7c1215671..3fae9f155f 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1707,7 +1707,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp) MigrationStatus status; if (migration_is_running()) { - error_setg(errp, QERR_MIGRATION_ACTIVE); + error_setg(errp, "There's a migration process in progress"); return -EINVAL; } From patchwork Wed Apr 24 08:03:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 791505 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp700341wrq; Wed, 24 Apr 2024 01:05:16 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUgoi1EWqCv3K+GzVx5D3uHAf1JXe7IUT3H4Hq6WDqs7PsT5R5ZPZCvPcYiatdQ95hFStFLj3Y0YwCEDdfwmber X-Google-Smtp-Source: AGHT+IEMuHoI/3TSrGGM4x/9dlPX75I6Sr/qcIIFat66Was1Z5dBesDAsSRfTgzy+/odxvYT2pVZ X-Received: by 2002:a05:620a:59:b0:78d:743f:34ab with SMTP id t25-20020a05620a005900b0078d743f34abmr2207105qkt.65.1713945915805; Wed, 24 Apr 2024 01:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713945915; cv=none; d=google.com; s=arc-20160816; b=t8xJRuzuUflzZCi8orcDGcek8OKziBCLZpjnSFsyoLU9vzOT9Sm1xEBOC2DFsW335M Wo8YN49dxAM3m+2So5mZ7z4DWJwraH055U7TAOGwSRixE0z00cl5v7cNPzm3m/tldqLR fZFEXHbQNooJMm7IPnQ2EgfBLp+DUybcFceXAoAb5oZsGp7zLq+RyXZqzsYiWb3WejSe UOWALshmlQ/ywECeGhNfEKs5S4NIRsPWmwkcFuChZRy5eIfz6fdub6Mz7X96ZzxRWA44 rC3waT5uoQeYZsMmNtppfxMlvvb+cF8wuee+O4sK+Ti5PvcspayHCHCbqnB1n5Gbo/qd YEsQ== 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=yY7Lyt8jbClugq7sDetbkp4p8g2FdKdPefPysU+ox9U=; fh=jgXZUdNI3mIRMXo4FO+maZv4rlmk7uZiHGIRmgw3yY8=; b=QNO+n8jA3dFcOUwGDB33vugm/Ox9lbcoNNB9nA4cWo0QLhlzlQlUVSlP72AnnVXJlh v4z4NPNznjoy0RgGj4K90G3oDWi8aZAV66ymczyPCtOUNKOVs84vomDMy0tea1pD7HA2 jkbrcgXrjNg6RRi1aAyYVM332yI9X4CKJrGhUIApYVOVNxnI7qmmnK8367aSebaakodK firh0/qC/46l3h9z4LWlTTxo/YDBZJRe7s9TJp5oa4jLO0op9pIw9B/qMyJ+dhmgqI3z 6uNe4m8rurjSW3UnlTsaThZ8rMgruDDISEJah8eq5iVH5Z656VRcbe6/Dno6UpVxV6B/ ijjQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KG7Kau5q; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r1-20020a05620a298100b0078ef5f6e18dsi16277100qkp.694.2024.04.24.01.05.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 01:05:15 -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=@redhat.com header.s=mimecast20190719 header.b=KG7Kau5q; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzXc4-000709-Kb; Wed, 24 Apr 2024 04:04:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzXbZ-0005w3-Tb for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzXbW-0003oj-Tj for qemu-devel@nongnu.org; Wed, 24 Apr 2024 04:03:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713945825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yY7Lyt8jbClugq7sDetbkp4p8g2FdKdPefPysU+ox9U=; b=KG7Kau5qByNbMZurxfCxEkJLfkxbYBGgoeTNduzc2fwyxZKMxJIxLgJuX7AJ+kYAFCbshi bv6C8YbZphDjbJXLmytISv4mm+vhUO5EWoN/dIS+w7+5upJvWOkxGuHrKeBUgmfNNRpmy1 ZhwqgvbdtnyEBeraTdtTrnykuk480R0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-186-f4WgmtguOB2o3NQYoFgtQQ-1; Wed, 24 Apr 2024 04:03:39 -0400 X-MC-Unique: f4WgmtguOB2o3NQYoFgtQQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 464E5104B502; Wed, 24 Apr 2024 08:03:39 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.247]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 25A3940C6CC0; Wed, 24 Apr 2024 08:03:39 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5426021EE971; Wed, 24 Apr 2024 10:03:37 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu Subject: [PULL 10/10] qapi: Inline and remove QERR_PROPERTY_VALUE_BAD definition Date: Wed, 24 Apr 2024 10:03:37 +0200 Message-ID: <20240424080337.2782594-11-armbru@redhat.com> In-Reply-To: <20240424080337.2782594-1-armbru@redhat.com> References: <20240424080337.2782594-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 Received-SPF: pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.67, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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é Signed-off-by: Markus Armbruster Message-ID: <20240312141343.3168265-11-armbru@redhat.com> Reviewed-by: Zhao Liu --- include/qapi/qmp/qerror.h | 3 --- hw/core/qdev-properties.c | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 385a4876d6..00b18e9082 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -26,9 +26,6 @@ #define QERR_MISSING_PARAMETER \ "Parameter '%s' is missing" -#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 7d6fa726fd..86a583574d 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 "qapi/qmp/qlist.h" #include "qemu/ctype.h" #include "qemu/error-report.h" @@ -792,7 +791,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: