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; }