From patchwork Wed Oct 4 17:31:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 729304 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a4e:0:b0:31d:da82:a3b4 with SMTP id v14csp477963wrs; Wed, 4 Oct 2023 10:33:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwM/ajgrKMO2mLCK2qmBO4C9jbtObWsj3xDfG8mUYCO2gDEZ7mBH5MbXCZukV6/w6bUplk X-Received: by 2002:ac8:4e4c:0:b0:418:d18:56ae with SMTP id e12-20020ac84e4c000000b004180d1856aemr3807782qtw.25.1696440806952; Wed, 04 Oct 2023 10:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696440806; cv=none; d=google.com; s=arc-20160816; b=ZRoQfjP4XNFDkNLJkP2tHYgbqf8ocii21QPGEm5+WJ/iV+k3Q5eeSYZNgzPlTFC9cm SDnSU88W0tRMRTvjpIQrdt6d9wGYI1rHxTvVdOOhc9usD/rzQfm0aThyyM/pO2+hR0PP xCFQbWGmCEw1al/T2xFtRivO4URVXcX34XjHWZR1v8M7xiefQ2P7hOYMQ6uOZ/nqMFHJ 61RNQyURA4yaGCeculeA5gkPFMNZIka9Ml1frJov97nrzBdGALig209wQBsVTXHOuzAj WazETQE94i7BiJnXj6lPzgyX8+DVhnPTAywy/7Wa9l/Vs4hZwq3WBIDDzwPptrSs5HF9 u32A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4tlfU+e5P66No2dfLjlw3nceh1BAOvyaTo2g5TESIX0=; fh=oHEdkhsElIlHZq+OoxO3ntU5X/1K0tW0XTlEfT0ZwCc=; b=LAIWh58BCBasr7RH4LdQ+TBSZYhOiyCH3eSTO5fg3lRV8Yrn53dGlo7BLzLpZ1doJn OihAB0vFFzfnuMVfnhO/6uaSfyJ1KzS0ZlgUvGQNNE/e8ETki+6XvGc46MNFw7iKAv4v XtpCWLhdW59tUgb+hbIIFxPSPjsYpiSUwA6tBwEV0LdIq3pwrFFl7gcJ/07mnS3EdXsB U2iYB3zrf/63xnqnJxIVgzzk84hVhNi1AOSVqFMUQA28l8N94LD8XGTZ5V66agfDf2TX fy66We2H75rygNxG52JlfCPYHncFJEjns4h0v0tB2/uHJQcekKu6TwDDaK9TVz7TKGZg q7xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fbTjUTTw; 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 g10-20020ac8580a000000b0041811ab1c0bsi1626745qtg.531.2023.10.04.10.33.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 10:33:26 -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=fbTjUTTw; 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 1qo5jj-0003JQ-K3; Wed, 04 Oct 2023 13:32:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qo5jd-0003D9-DJ for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:34 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qo5jb-0000yQ-Ab for qemu-devel@nongnu.org; Wed, 04 Oct 2023 13:32:33 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3215f19a13aso97798f8f.3 for ; Wed, 04 Oct 2023 10:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696440749; x=1697045549; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4tlfU+e5P66No2dfLjlw3nceh1BAOvyaTo2g5TESIX0=; b=fbTjUTTwnb1isW0M5J9DD8eMgHw+UZqumH3fg+8XPQmpPKdQB8XaGN+9ofhial+yNf Oj/nGAvU9Woe702khrsVN39GszY+nIGkpd5+bkhftJ7V8xBzhaV47x4wbpIsef7MyO5I tfTBMfS8NXK5gXcRh4HDHn4af74au+RedR6iRwXnvF2RPYbF+YhAUC2PIqletZo2IxLu eqiQwRGL3QiM4uKa6dwThg+fql621CM8lvP8+Djnqk5wmwsj6fiAabpoMp17R63ziAHn rRzmIJzYmo5+VkJXFNq5iOiMUeSOw81KFuqb9rEcFlnnCU27PBfWrVq6eOPi3xlWuZrW ir4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696440749; x=1697045549; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4tlfU+e5P66No2dfLjlw3nceh1BAOvyaTo2g5TESIX0=; b=BZ1w6FnvlXmblkkJ1P/2ht6oAhWwqYE6TLJn2pgcBOb/3rZeSRZ/S4uNgw+OLMbHNs kBq4OJhVJ5Uwb3HcqS2gmaphJtiskbc4A5jZdA5PyBoG4nMSfdy7j13wgWaK7lkK60y1 c3tnorjEiHrCZaL1qhaSoAsQKmeQH5ZNLuvTicArDmnBmcalRtbSqucGVPIs2fW9z42M st0hfaynV2W2XN/YdRlZDCfU1NXVKrxTalbVXmYYEDOeWPRtIXQzjyE9dgYnAj56BnKS q6QWtQSJPKoHAZp/rzC4ebpBaZNgh59kExo6NW0WApnSkbncBed1JEVuxI8Y+G9iet4F zGZQ== X-Gm-Message-State: AOJu0YyGPeLfAWkHh7qxan9vguZcVP+A4FOrq8tsmCPTNKRNWgzOApqa jiGU7/XXJEWvjx3aSBxDgQ0sAGPTZSSNeLXqR34= X-Received: by 2002:a5d:60d1:0:b0:321:7052:6406 with SMTP id x17-20020a5d60d1000000b0032170526406mr2778244wrt.12.1696440749298; Wed, 04 Oct 2023 10:32:29 -0700 (PDT) Received: from m1x-phil.lan (5ep85-h01-176-173-163-52.dslam.bbox.fr. [176.173.163.52]) by smtp.gmail.com with ESMTPSA id y6-20020adff6c6000000b0031c6581d55esm4448332wrp.91.2023.10.04.10.32.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 04 Oct 2023 10:32:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Markus Armbruster Cc: qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost Subject: [PATCH 04/21] qapi: Inline and remove QERR_DEVICE_NO_HOTPLUG definition Date: Wed, 4 Oct 2023 19:31:39 +0200 Message-ID: <20231004173158.42591-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004173158.42591-1-philmd@linaro.org> References: <20231004173158.42591-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Address the comment added in commit 4629ed1e98 ("qerror: Finally unused, clean up"), from 2015: /* * These macros will go away, please don't use * in new code, and do not add new ones! */ Mechanical transformation using sed, manually removing the definition in include/qapi/qmp/qerror.h. Signed-off-by: Philippe Mathieu-Daudé --- include/qapi/qmp/qerror.h | 3 --- hw/core/qdev.c | 3 ++- softmmu/qdev-monitor.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index daa889809b..e93211085a 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -17,9 +17,6 @@ * add new ones! */ -#define QERR_DEVICE_NO_HOTPLUG \ - "Device '%s' does not support hotplugging" - #define QERR_INVALID_PARAMETER \ "Invalid parameter '%s'" diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 43d863b0c5..9b62e0573d 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -479,7 +479,8 @@ static void device_set_realized(Object *obj, bool value, Error **errp) static int unattached_count; if (dev->hotplugged && !dc->hotpluggable) { - error_setg(errp, QERR_DEVICE_NO_HOTPLUG, object_get_typename(obj)); + error_setg(errp, "Device '%s' does not support hotplugging", + object_get_typename(obj)); return; } diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 3a9740dcbd..a964bd80df 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -911,7 +911,7 @@ void qdev_unplug(DeviceState *dev, Error **errp) } if (!dc->hotpluggable) { - error_setg(errp, QERR_DEVICE_NO_HOTPLUG, + error_setg(errp, "Device '%s' does not support hotplugging", object_get_typename(OBJECT(dev))); return; }