From nobody Sat Nov 23 23:03:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728572535; cv=none; d=zohomail.com; s=zohoarc; b=V8iZAH7cIirdQ9k2RzxO4WL1jrz4f0TP973b6GoxMN6FtSUrYpRKo5cy8W/mhueLmp4lkvb4Tix/HmeZ0DZBkVQFGIB3RdgANyz3m2l0HgjgN5dGVtbEYhzXhGFexeBPPLCNjs87fPfjreavIRxVWE8t24pe3SNKgyL9J++L+Cw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728572535; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tbTxFKTc7FOmFJue3XENbry9tNShHeglELKqzrahlAc=; b=OPXbNlL72phrbvjqwO/YC7RJqqgDhFgC8xbe6Fml3uySJQ+clWVUMcNKJo20l/leAr11sxcCs0dE7c+VW0D/H6E31PDuK6tDyEwOqPsNAxrev18C2De8O3nJIwCPNJKNezJUAoxEvBrQ+DoQ9BTjFsztLT2FAS5cUstF6SWAf04= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728572535573292.24698077563494; Thu, 10 Oct 2024 08:02:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syuft-0000RD-Ut; Thu, 10 Oct 2024 11:01:58 -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 1syufs-0000Qm-Gv for qemu-devel@nongnu.org; Thu, 10 Oct 2024 11:01:56 -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 1syufr-0003G7-5H for qemu-devel@nongnu.org; Thu, 10 Oct 2024 11:01:56 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-630-QRCaD69uOymdtQrVX6K_8g-1; Thu, 10 Oct 2024 11:01:50 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4D5021955DC4; Thu, 10 Oct 2024 15:01:48 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.47]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0039E1956089; Thu, 10 Oct 2024 15:01:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 19A1121E691E; Thu, 10 Oct 2024 17:01:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728572514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tbTxFKTc7FOmFJue3XENbry9tNShHeglELKqzrahlAc=; b=gnO+qRzZzfly2nyM+keAQt3jINf0dGUBM9BKuznX7yD1S08rLOGUlH+FDeuQdN2WrOyUe3 CU7qxBHc6EX4ZS1V3xGZ904Td0xl9s5cIpwySfHctal/UJpT7u1gkwXaw8BZDmVIAdu2S7 3d9AIK4BeRW4iSNGeSfpLkdGgATPPFQ= X-MC-Unique: QRCaD69uOymdtQrVX6K_8g-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: xieyongji@bytedance.com, kwolf@redhat.com, hreitz@redhat.com, Coiby.Xu@gmail.com, pbonzini@redhat.com, berrange@redhat.com, eduardo@habkost.net, mark.cave-ayland@ilande.co.uk, michael.roth@amd.com, kkostiuk@redhat.com, qemu-block@nongnu.org, philmd@linaro.org Subject: [PATCH v2 1/7] error: Drop superfluous #include "qapi/qmp/qerror.h" Date: Thu, 10 Oct 2024 17:01:38 +0200 Message-ID: <20241010150144.986655-2-armbru@redhat.com> In-Reply-To: <20241010150144.986655-1-armbru@redhat.com> References: <20241010150144.986655-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1728572537156116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster --- qga/commands-bsd.c | 1 - qga/commands-linux.c | 1 - qga/commands-posix.c | 1 - 3 files changed, 3 deletions(-) diff --git a/qga/commands-bsd.c b/qga/commands-bsd.c index 9ce48af311..94ff6fee6a 100644 --- a/qga/commands-bsd.c +++ b/qga/commands-bsd.c @@ -12,7 +12,6 @@ =20 #include "qemu/osdep.h" #include "qga-qapi-commands.h" -#include "qapi/qmp/qerror.h" #include "qapi/error.h" #include "qemu/queue.h" #include "commands-common.h" diff --git a/qga/commands-linux.c b/qga/commands-linux.c index 51d5e3d927..9b1746b24f 100644 --- a/qga/commands-linux.c +++ b/qga/commands-linux.c @@ -15,7 +15,6 @@ #include "qapi/error.h" #include "qga-qapi-commands.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "commands-common.h" #include "cutils.h" #include diff --git a/qga/commands-posix.c b/qga/commands-posix.c index c2bd0b4316..389c5eeb5d 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -18,7 +18,6 @@ #include #include "qga-qapi-commands.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qemu/host-utils.h" #include "qemu/sockets.h" #include "qemu/base64.h" --=20 2.46.0 From nobody Sat Nov 23 23:03:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728572574; cv=none; d=zohomail.com; s=zohoarc; b=XfuzemCM/7Upw+9QENBocrweUKthKyFbbnEMD3fCM85Pg9meJyeIq51qbKtaoVMJGNwc+c5lfl2opUCZFG9T1xnWS3OQb+era+iBp1jBSTphC0BFAkzWHBc6J1rZroip/5TBp4CgJpeu4suWjxGMmk50TVln2ZaNWVyfT2u8CIg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728572574; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bk4xte5W5tm8S9sgv3z4qkfh3Dfy23pC+ZOBftEffqo=; b=PfcTW+2DbQ0jW/2N5Ac1w+qGD/GFCHF6S/G5o8bkg1v84cG6Ior19eksyalKhjypB95pROqxJccUJLNAg53EEM7CqQzjUfvUJdjPJUYkOFMh/47qN/AECrYPuLCbut9Xyqk+TDchHg8EMFdBmq6UzZHLHtNcpK35KjE1y+j3JXE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 172857257444660.08478945632737; Thu, 10 Oct 2024 08:02:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syufw-0000T3-QB; Thu, 10 Oct 2024 11:02:00 -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 1syuft-0000R3-9p for qemu-devel@nongnu.org; Thu, 10 Oct 2024 11:01:57 -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 1syufr-0003GC-RA for qemu-devel@nongnu.org; Thu, 10 Oct 2024 11:01:57 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-642-ubvjaxwyN06MMzrLNnbI5A-1; Thu, 10 Oct 2024 11:01:51 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 585F31955D45; Thu, 10 Oct 2024 15:01:48 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.47]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EF5E8300019F; Thu, 10 Oct 2024 15:01:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1D08121E692E; Thu, 10 Oct 2024 17:01:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728572514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bk4xte5W5tm8S9sgv3z4qkfh3Dfy23pC+ZOBftEffqo=; b=KX2+hcYGB+iv0g83M95AxJEU8ShPQztvyaOkb1weJRkO/oNwzkhXfVfVbRkttteqqf7IV6 PZmgANenI2nO+qTa1ej+uUMXltwQrokepkSEUrp8n4XTPYpWuFvS4Ok0g4FhxY7PEzxbKb 8lCRkhjVNlHk5VFxj5vmYJmyKnthJ6Y= X-MC-Unique: ubvjaxwyN06MMzrLNnbI5A-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: xieyongji@bytedance.com, kwolf@redhat.com, hreitz@redhat.com, Coiby.Xu@gmail.com, pbonzini@redhat.com, berrange@redhat.com, eduardo@habkost.net, mark.cave-ayland@ilande.co.uk, michael.roth@amd.com, kkostiuk@redhat.com, qemu-block@nongnu.org, philmd@linaro.org Subject: [PATCH v2 2/7] block: Improve errors about block sizes Date: Thu, 10 Oct 2024 17:01:39 +0200 Message-ID: <20241010150144.986655-3-armbru@redhat.com> In-Reply-To: <20241010150144.986655-1-armbru@redhat.com> References: <20241010150144.986655-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1728572575378116600 Content-Type: text/plain; charset="utf-8" Block sizes need to be a power of two between 512 and an arbitrary limit, currently 2MiB. Commit 5937835ac4c factored block size checking out of set_blocksize() into new check_block_size(), for reuse in block/export/. Its two error messages are okay for the original purpose: $ qemu-system-x86_64 -device ide-hd,physical_block_size=3D1 qemu-system-x86_64: -device ide-hd,physical_block_size=3D1: Property .p= hysical_block_size doesn't take value 1 (minimum: 512, maximum: 2097152) $ qemu-system-x86_64 -device ide-hd,physical_block_size=3D513 qemu-system-x86_64: -device ide-hd,physical_block_size=3D513: Property = .physical_block_size doesn't take value '513', it's not a power of 2 They're mildly off for block exports: $ qemu-storage-daemon --blockdev node-name=3Dnod0,driver=3Dfile,filenam= e=3Dfoo.img --export type=3Dvduse-blk,id=3Dexp0,node-name=3Dnod0,name=3Dfoo= ,logical-block-size=3D1 qemu-storage-daemon: --export type=3Dvduse-blk,id=3Dexp0,node-name=3Dno= d0,name=3Dfoo,logical-block-size=3D1: Property exp0.logical-block-size does= n't take value 1 (minimum: 512, maximum: 2097152) The error message talks about a property. CLI options like --export don't have properties, they have parameters. Replace the two error messages by a single one that's okay for both purposes. Looks like this: qemu-storage-daemon: --export type=3Dvduse-blk,id=3Dexp0,node-name=3Dno= d0,name=3Dfoo,logical-block-size=3D1: parameter logical-block-size must be = a power of 2 between 512 and 2097152 Signed-off-by: Markus Armbruster --- util/block-helpers.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/util/block-helpers.c b/util/block-helpers.c index c4851432f5..fb5de348e2 100644 --- a/util/block-helpers.c +++ b/util/block-helpers.c @@ -10,7 +10,6 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "block-helpers.h" =20 /** @@ -28,19 +27,16 @@ void check_block_size(const char *id, const char *name, int64_t value, Error **errp) { - /* value of 0 means "unset" */ - if (value && (value < MIN_BLOCK_SIZE || value > MAX_BLOCK_SIZE)) { - error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, - id, name, value, MIN_BLOCK_SIZE, MAX_BLOCK_SIZE); + if (!value) { + /* unset */ return; } =20 - /* We rely on power-of-2 blocksizes for bitmasks */ - if ((value & (value - 1)) !=3D 0) { + if (value < MIN_BLOCK_SIZE || value > MAX_BLOCK_SIZE + || (value & (value - 1))) { error_setg(errp, - "Property %s.%s doesn't take value '%" PRId64 - "', it's not a power of 2", - id, name, value); - return; + "parameter %s must be a power of 2 between %" PRId64 + " and %" PRId64, + name, MIN_BLOCK_SIZE, MAX_BLOCK_SIZE); } } --=20 2.46.0 From nobody Sat Nov 23 23:03:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728572574; cv=none; d=zohomail.com; s=zohoarc; b=QbtU7r/BjSo5C43PER19sE+qfhrt9AMQlQ/so/HYRoDv5GYP6ojphjY2aUHvi1WCq3qWyJHtBwYkA0hw4Df51tHrY1pLjFJ0NxZPj5xl8bNw6dsa7V09xCHYRDjk4p2nqu/ObVIKtH6L20nigq6wbhtokGotIMcdH++MALbIDHE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728572574; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PVEUJyQZMZrL03B4GG214+HyOIS9oNeVffRSjCBO6R8=; b=LZPalGA8kTtbk6cDOsHOjCjMlzlpOdyZbH2x2zP+lzz6j3gmyGLbkhXjs/doexmXzrUmxhDxiJ3TP/6GFe41t7y9ZG2W2d++mYvWYP4PRV+JHHfcdhnGLYUEYb5SzeVA3jhem4WD9Kkvm+0+rTZ0LpJztQWY5cmc+WIkYJvqAkg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728572574167954.6796462590219; Thu, 10 Oct 2024 08:02:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syufz-0000VJ-1g; Thu, 10 Oct 2024 11:02:03 -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 1syufw-0000Sr-Ce for qemu-devel@nongnu.org; Thu, 10 Oct 2024 11:02:00 -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 1syufu-0003Gn-Of for qemu-devel@nongnu.org; Thu, 10 Oct 2024 11:02:00 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-549-Lc-woig3PpuU3vn5fhXb5A-1; Thu, 10 Oct 2024 11:01:53 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A49E11956046; Thu, 10 Oct 2024 15:01:51 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.47]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 49C40195607C; Thu, 10 Oct 2024 15:01:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2065121E6939; Thu, 10 Oct 2024 17:01:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728572517; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PVEUJyQZMZrL03B4GG214+HyOIS9oNeVffRSjCBO6R8=; b=DzALqG1sTisFSat3LifIC3RZf8rEoyLSWgq60HFNPzQjWEp41Bv6eXFJCQ47sH7ykDL1R0 +rpMrvgNRrlj2eim8WVeNTHQycVvn7z6y+aBPUeLliUcZnZ60psoVE7UzWinjZcJI01sjd /ZGfcRWx3LWImsDHuer5nw5qY446XWE= X-MC-Unique: Lc-woig3PpuU3vn5fhXb5A-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: xieyongji@bytedance.com, kwolf@redhat.com, hreitz@redhat.com, Coiby.Xu@gmail.com, pbonzini@redhat.com, berrange@redhat.com, eduardo@habkost.net, mark.cave-ayland@ilande.co.uk, michael.roth@amd.com, kkostiuk@redhat.com, qemu-block@nongnu.org, philmd@linaro.org Subject: [PATCH v2 3/7] block: Adjust check_block_size() signature Date: Thu, 10 Oct 2024 17:01:40 +0200 Message-ID: <20241010150144.986655-4-armbru@redhat.com> In-Reply-To: <20241010150144.986655-1-armbru@redhat.com> References: <20241010150144.986655-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1728572575426116600 Content-Type: text/plain; charset="utf-8" Parameter @id is no longer used, drop. Return a bool to indicate success / failure, as recommended by qapi/error.h. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- util/block-helpers.h | 3 +-- block/export/vduse-blk.c | 7 ++----- block/export/vhost-user-blk-server.c | 6 +----- hw/core/qdev-properties-system.c | 6 +----- util/block-helpers.c | 10 ++++++---- 5 files changed, 11 insertions(+), 21 deletions(-) diff --git a/util/block-helpers.h b/util/block-helpers.h index b53295a529..838b0825f6 100644 --- a/util/block-helpers.h +++ b/util/block-helpers.h @@ -13,7 +13,6 @@ #define MAX_BLOCK_SIZE (2 * MiB) #define MAX_BLOCK_SIZE_STR "2 MiB" =20 -void check_block_size(const char *id, const char *name, int64_t value, - Error **errp); +bool check_block_size(const char *name, int64_t value, Error **errp); =20 #endif /* BLOCK_HELPERS_H */ diff --git a/block/export/vduse-blk.c b/block/export/vduse-blk.c index 172f73cef4..bd852e538d 100644 --- a/block/export/vduse-blk.c +++ b/block/export/vduse-blk.c @@ -273,7 +273,6 @@ static int vduse_blk_exp_create(BlockExport *exp, Block= ExportOptions *opts, uint64_t logical_block_size =3D VIRTIO_BLK_SECTOR_SIZE; uint16_t num_queues =3D VDUSE_DEFAULT_NUM_QUEUE; uint16_t queue_size =3D VDUSE_DEFAULT_QUEUE_SIZE; - Error *local_err =3D NULL; struct virtio_blk_config config =3D { 0 }; uint64_t features; int i, ret; @@ -297,10 +296,8 @@ static int vduse_blk_exp_create(BlockExport *exp, Bloc= kExportOptions *opts, =20 if (vblk_opts->has_logical_block_size) { logical_block_size =3D vblk_opts->logical_block_size; - check_block_size(exp->id, "logical-block-size", logical_block_size, - &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!check_block_size("logical-block-size", logical_block_size, + errp)) { return -EINVAL; } } diff --git a/block/export/vhost-user-blk-server.c b/block/export/vhost-user= -blk-server.c index 50c358e8cd..d9d2014d9b 100644 --- a/block/export/vhost-user-blk-server.c +++ b/block/export/vhost-user-blk-server.c @@ -319,7 +319,6 @@ static int vu_blk_exp_create(BlockExport *exp, BlockExp= ortOptions *opts, { VuBlkExport *vexp =3D container_of(exp, VuBlkExport, export); BlockExportOptionsVhostUserBlk *vu_opts =3D &opts->u.vhost_user_blk; - Error *local_err =3D NULL; uint64_t logical_block_size; uint16_t num_queues =3D VHOST_USER_BLK_NUM_QUEUES_DEFAULT; =20 @@ -330,10 +329,7 @@ static int vu_blk_exp_create(BlockExport *exp, BlockEx= portOptions *opts, } else { logical_block_size =3D VIRTIO_BLK_SECTOR_SIZE; } - check_block_size(exp->id, "logical-block-size", logical_block_size, - &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!check_block_size("logical-block-size", logical_block_size, errp))= { return -EINVAL; } =20 diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 60bcd821de..35deef05f3 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -588,18 +588,14 @@ const PropertyInfo qdev_prop_losttickpolicy =3D { static void set_blocksize(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { - DeviceState *dev =3D DEVICE(obj); Property *prop =3D opaque; uint32_t *ptr =3D object_field_prop_ptr(obj, prop); uint64_t value; - Error *local_err =3D NULL; =20 if (!visit_type_size(v, name, &value, errp)) { return; } - check_block_size(dev->id ? : "", name, value, &local_err); - if (local_err) { - error_propagate(errp, local_err); + if (!check_block_size(name, value, errp)) { return; } *ptr =3D value; diff --git a/util/block-helpers.c b/util/block-helpers.c index fb5de348e2..052b4e1476 100644 --- a/util/block-helpers.c +++ b/util/block-helpers.c @@ -14,7 +14,6 @@ =20 /** * check_block_size: - * @id: The unique ID of the object * @name: The name of the property being validated * @value: The block size in bytes * @errp: A pointer to an area to store an error @@ -23,13 +22,14 @@ * 1. At least MIN_BLOCK_SIZE * 2. No larger than MAX_BLOCK_SIZE * 3. A power of 2 + * + * Returns: true on success, false on failure */ -void check_block_size(const char *id, const char *name, int64_t value, - Error **errp) +bool check_block_size(const char *name, int64_t value, Error **errp) { if (!value) { /* unset */ - return; + return true; } =20 if (value < MIN_BLOCK_SIZE || value > MAX_BLOCK_SIZE @@ -38,5 +38,7 @@ void check_block_size(const char *id, const char *name, i= nt64_t value, "parameter %s must be a power of 2 between %" PRId64 " and %" PRId64, name, MIN_BLOCK_SIZE, MAX_BLOCK_SIZE); + return false; } + return true; } --=20 2.46.0 From nobody Sat Nov 23 23:03:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728572589; cv=none; d=zohomail.com; s=zohoarc; b=bcN/kWX/VJ4NzWsoVlh+2OfXcnB8pAQhh+vxT+4XfAeXjKtU/lml9JUjA++R+hivEQbKkAU7KYw3L63ArOtqTwYT5PYNlM8IQdccutVk7czNPoy8ahiCF/avr/h/dvKIlZwdP/7axqjbDjjManmHHUykmlImczluhfe2NbA4edk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728572589; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gAw+2NQ4ikWFRbywE3WC4Ki03RY+8I1v+TV8iF2QbR8=; b=DsUR9IJn1jGDnOon0wq/SqvJq9AVUTcpewfMmcOuHR/GJ8l3oTSmxsr+CdxmRqLmqTHpNDg8uqlQXbDRMen0BlWRWjHlqDZC6cE2pLfDhASenWvee00TTQAYjYvbfq72LOwo0RS2lQmihyKWSPVewS9G+VGB3PK2G0ny9cVgJ70= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728572589371768.0593361773057; Thu, 10 Oct 2024 08:03:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syufx-0000T8-1L; Thu, 10 Oct 2024 11:02:01 -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 1syufu-0000S8-Oh for qemu-devel@nongnu.org; Thu, 10 Oct 2024 11:01:58 -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 1syuft-0003GY-61 for qemu-devel@nongnu.org; Thu, 10 Oct 2024 11:01:58 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-642--1MtEDoeNCKQVJ59mvYIPg-1; Thu, 10 Oct 2024 11:01:51 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4965D1955E7A; Thu, 10 Oct 2024 15:01:48 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.47]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E88AB19560AE; Thu, 10 Oct 2024 15:01:46 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2381C21E6889; Thu, 10 Oct 2024 17:01:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728572516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gAw+2NQ4ikWFRbywE3WC4Ki03RY+8I1v+TV8iF2QbR8=; b=hJ4kacrXc9m6qNVB3e7vVtJwTVrgquuVKYSVL0gMrfPLP8fXNul0aokbztVO9IEo/ChX8q XWjOLaMVD+fBfdOS8frAXWAyp4eTv95DsE1WbozEiDcdB14H1DH9Y/ettEbIowNqzjb2z8 f93Pav4pNp28U3GxLh4FWgTo4N4YaIo= X-MC-Unique: -1MtEDoeNCKQVJ59mvYIPg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: xieyongji@bytedance.com, kwolf@redhat.com, hreitz@redhat.com, Coiby.Xu@gmail.com, pbonzini@redhat.com, berrange@redhat.com, eduardo@habkost.net, mark.cave-ayland@ilande.co.uk, michael.roth@amd.com, kkostiuk@redhat.com, qemu-block@nongnu.org, philmd@linaro.org Subject: [PATCH v2 4/7] target/i386/cpu: Avoid mixing signed and unsigned in property setters Date: Thu, 10 Oct 2024 17:01:41 +0200 Message-ID: <20241010150144.986655-5-armbru@redhat.com> In-Reply-To: <20241010150144.986655-1-armbru@redhat.com> References: <20241010150144.986655-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1728572591517116600 Content-Type: text/plain; charset="utf-8" Properties "family", "model", and "stepping" are visited as signed integers. They are backed by bits in CPUX86State member @cpuid_version. The code to extract and insert these bits mixes signed and unsigned. Not actually wrong, but avoiding such mixing is good practice. Visit them as unsigned integers instead. This adds a few mildly ugly cast in arguments of error_setg(). The next commit will get rid of them again. Property "tsc-frequency" is also visited as signed integer. The value ultimately flows into the kernel, where it is 31 bits unsigned. The QEMU code freely mixes int, uint32_t, int64_t. I elect not to attempt draining this swamp today. Signed-off-by: Markus Armbruster Reviewed-by: Igor Mammedov --- target/i386/cpu.c | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index ff227a8c5c..4f8fa60432 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5433,13 +5433,13 @@ static void x86_cpuid_version_get_family(Object *ob= j, Visitor *v, { X86CPU *cpu =3D X86_CPU(obj); CPUX86State *env =3D &cpu->env; - int64_t value; + uint64_t value; =20 value =3D (env->cpuid_version >> 8) & 0xf; if (value =3D=3D 0xf) { value +=3D (env->cpuid_version >> 20) & 0xff; } - visit_type_int(v, name, &value, errp); + visit_type_uint64(v, name, &value, errp); } =20 static void x86_cpuid_version_set_family(Object *obj, Visitor *v, @@ -5448,16 +5448,15 @@ static void x86_cpuid_version_set_family(Object *ob= j, Visitor *v, { X86CPU *cpu =3D X86_CPU(obj); CPUX86State *env =3D &cpu->env; - const int64_t min =3D 0; - const int64_t max =3D 0xff + 0xf; - int64_t value; + const uint64_t max =3D 0xff + 0xf; + uint64_t value; =20 - if (!visit_type_int(v, name, &value, errp)) { + if (!visit_type_uint64(v, name, &value, errp)) { return; } - if (value < min || value > max) { + if (value > max) { error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "", - name ? name : "null", value, min, max); + name ? name : "null", value, (int64_t)0, (int64_t)max); return; } =20 @@ -5475,11 +5474,11 @@ static void x86_cpuid_version_get_model(Object *obj= , Visitor *v, { X86CPU *cpu =3D X86_CPU(obj); CPUX86State *env =3D &cpu->env; - int64_t value; + uint64_t value; =20 value =3D (env->cpuid_version >> 4) & 0xf; value |=3D ((env->cpuid_version >> 16) & 0xf) << 4; - visit_type_int(v, name, &value, errp); + visit_type_uint64(v, name, &value, errp); } =20 static void x86_cpuid_version_set_model(Object *obj, Visitor *v, @@ -5488,16 +5487,15 @@ static void x86_cpuid_version_set_model(Object *obj= , Visitor *v, { X86CPU *cpu =3D X86_CPU(obj); CPUX86State *env =3D &cpu->env; - const int64_t min =3D 0; - const int64_t max =3D 0xff; - int64_t value; + const uint64_t max =3D 0xff; + uint64_t value; =20 - if (!visit_type_int(v, name, &value, errp)) { + if (!visit_type_uint64(v, name, &value, errp)) { return; } - if (value < min || value > max) { + if (value > max) { error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "", - name ? name : "null", value, min, max); + name ? name : "null", value, (int64_t)0, (int64_t)max); return; } =20 @@ -5511,10 +5509,10 @@ static void x86_cpuid_version_get_stepping(Object *= obj, Visitor *v, { X86CPU *cpu =3D X86_CPU(obj); CPUX86State *env =3D &cpu->env; - int64_t value; + uint64_t value; =20 value =3D env->cpuid_version & 0xf; - visit_type_int(v, name, &value, errp); + visit_type_uint64(v, name, &value, errp); } =20 static void x86_cpuid_version_set_stepping(Object *obj, Visitor *v, @@ -5523,16 +5521,15 @@ static void x86_cpuid_version_set_stepping(Object *= obj, Visitor *v, { X86CPU *cpu =3D X86_CPU(obj); CPUX86State *env =3D &cpu->env; - const int64_t min =3D 0; - const int64_t max =3D 0xf; - int64_t value; + const uint64_t max =3D 0xf; + uint64_t value; =20 - if (!visit_type_int(v, name, &value, errp)) { + if (!visit_type_uint64(v, name, &value, errp)) { return; } - if (value < min || value > max) { + if (value > max) { error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "", - name ? name : "null", value, min, max); + name ? name : "null", value, (int64_t)0, (int64_t)max); return; } =20 --=20 2.46.0 From nobody Sat Nov 23 23:03:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728579417; cv=none; d=zohomail.com; s=zohoarc; b=b73GcUKWRwSs3ix2UybEms9Ux2T0uHtw4CEVSweXdG4T/l5n0Dgy1zVrhMz/0Lvsb8pBLk8/Gc4g1IwUxpK36KE5q6XeNDFsci75pbwwYrAOkc5AUhpBOuh/F7WJINMO/paxZGQy0TkKXIdy7XNioaFXoSM7a15was/Gk7EVa0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728579417; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XBfZZa0Bj0Ph0CoBbr6Ixqccz4iCxg/EHl3zIVDQ5rs=; b=GZhrw+NdP54kdgWOe02L2L9oVlO/gMhStMCg8hwos2le2FLDFqwhNjBbgj93iMw3SWtz5BdFDOmb6wfjGC+keWPnx6YnEhdJe07rilIsKANmJwop+vEsgh/43d7UyzKY6f7U1pDDfHaIvGIPm/42ZZKmIZDJM9zBYndy1m6q6NA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728579417800295.6011320599829; Thu, 10 Oct 2024 09:56:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sywS9-0008B2-Ez; Thu, 10 Oct 2024 12:55:53 -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 1sywS5-0008Ae-R1 for qemu-devel@nongnu.org; Thu, 10 Oct 2024 12:55:50 -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 1sywS4-0000ZN-3B for qemu-devel@nongnu.org; Thu, 10 Oct 2024 12:55:49 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-435-CkX644gYOJ-XsMse0WtW4g-1; Thu, 10 Oct 2024 12:55:43 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6F7871955EA8; Thu, 10 Oct 2024 16:55:41 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.47]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D95F419560AD; Thu, 10 Oct 2024 16:55:40 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 9132921E6A28; Thu, 10 Oct 2024 18:55:37 +0200 (CEST) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 26CB621E688F; Thu, 10 Oct 2024 17:01:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728579346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=XBfZZa0Bj0Ph0CoBbr6Ixqccz4iCxg/EHl3zIVDQ5rs=; b=XrJG1zLgpUc+pXjGtLI7Dm3MmcApP0OnIX4JYBm8+ENTEo5FVshYMfsA5768kCEa7mWR/t sMNU+B1rmkzHyIwMFwMW9tsc0PWKSkX8q5zDQ9I/8Jrbg7Mlymm1Jc0pralCkHROAs/PSm oLwTouSvu6Y1x2kPs6q1B4Y1FRii6hE= X-MC-Unique: CkX644gYOJ-XsMse0WtW4g-1 Resent-To: michael.roth@amd.com, xieyongji@bytedance.com, Coiby.Xu@gmail.com, eduardo@habkost.net, mark.cave-ayland@ilande.co.uk, philmd@linaro.org, qemu-block@nongnu.org, qemu-devel@nongnu.org Resent-From: Markus Armbruster Resent-Date: Thu, 10 Oct 2024 18:55:37 +0200 Resent-Message-ID: <87ttdjhp86.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Thu Oct 10 17:01:44 2024 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: xieyongji@bytedance.com, kwolf@redhat.com, hreitz@redhat.com, Coiby.Xu@gmail.com, pbonzini@redhat.com, berrange@redhat.com, eduardo@habkost.net, mark.cave-ayland@ilande.co.uk, michael.roth@amd.com, kkostiuk@redhat.com, qemu-block@nongnu.org, philmd@linaro.org Subject: [PATCH v2 5/7] target/i386/cpu: Improve errors for out of bounds property values Date: Thu, 10 Oct 2024 17:01:42 +0200 Message-ID: <20241010150144.986655-6-armbru@redhat.com> In-Reply-To: <20241010150144.986655-1-armbru@redhat.com> References: <20241010150144.986655-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Lines: 89 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1728579419601116600 Content-Type: text/plain; charset="utf-8" The error message for a "stepping" value that is out of bounds is a bit odd: $ qemu-system-x86_64 -cpu qemu64,stepping=3D16 qemu-system-x86_64: can't apply global qemu64-x86_64-cpu.stepping=3D16:= Property .stepping doesn't take value 16 (minimum: 0, maximum: 15) The "can't apply global" part is an unfortunate artifact of -cpu's implementation. Left for another day. The remainder feels overly verbose. Change it to qemu64-x86_64-cpu: can't apply global qemu64-x86_64-cpu.stepping=3D16: = parameter 'stepping' can be at most 15 Likewise for "family", "model", and "tsc-frequency". Signed-off-by: Markus Armbruster Reviewed-by: Igor Mammedov --- target/i386/cpu.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 4f8fa60432..de2c7041c5 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -31,7 +31,6 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qapi/qapi-visit-machine.h" -#include "qapi/qmp/qerror.h" #include "standard-headers/asm-x86/kvm_para.h" #include "hw/qdev-properties.h" #include "hw/i386/topology.h" @@ -5455,8 +5454,8 @@ static void x86_cpuid_version_set_family(Object *obj,= Visitor *v, return; } if (value > max) { - error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "", - name ? name : "null", value, (int64_t)0, (int64_t)max); + error_setg(errp, "parameter '%s' can be at most %" PRIu64, + name ? name : "null", max); return; } =20 @@ -5494,8 +5493,8 @@ static void x86_cpuid_version_set_model(Object *obj, = Visitor *v, return; } if (value > max) { - error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "", - name ? name : "null", value, (int64_t)0, (int64_t)max); + error_setg(errp, "parameter '%s' can be at most %" PRIu64, + name ? name : "null", max); return; } =20 @@ -5528,8 +5527,8 @@ static void x86_cpuid_version_set_stepping(Object *ob= j, Visitor *v, return; } if (value > max) { - error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "", - name ? name : "null", value, (int64_t)0, (int64_t)max); + error_setg(errp, "parameter '%s' can be at most %" PRIu64, + name ? name : "null", max); return; } =20 @@ -5623,16 +5622,15 @@ static void x86_cpuid_set_tsc_freq(Object *obj, Vis= itor *v, const char *name, void *opaque, Error **errp) { X86CPU *cpu =3D X86_CPU(obj); - const int64_t min =3D 0; const int64_t max =3D INT64_MAX; int64_t value; =20 if (!visit_type_int(v, name, &value, errp)) { return; } - if (value < min || value > max) { - error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "", - name ? name : "null", value, min, max); + if (value < 0 || value > max) { + error_setg(errp, "parameter '%s' can be at most %" PRId64, + name ? name : "null", max); return; } =20 --=20 2.46.0 From nobody Sat Nov 23 23:03:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728579433; cv=none; d=zohomail.com; s=zohoarc; b=AuoPr5K+fkYaKe2+L8OsHcYQeMwMKKMEAp5tOfqPr2Y29XMgiCN0kf3FEDN8VbgRO+8CYC/i3g0pxM2yfJsMlICpX/yM7A8dJc8mvisyvLHWi3JD0hneZgOKc6nX4TF59ruWo3mkmV78COhG3YCaSvG9Co599Fov6QSwz4djYF4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728579433; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=C7FaVE6EH7XBkqNtCES1SEsciaiaJFdQ2HrRn+cpnCI=; b=luM5ri2C6eb+38oRWjs4KBPVw2E2W5pBgVbDCG8rtEfA3e1OeKT7yuqFkJDunxyiGWFY54EmMW5iXJn8N0eBLoxw1iWV8TD54ThyWiPf+YcyiqlGyyLWCVbflDlNVd8+/z1Q8yr8mnyUERuYrkLMuExbL8sWXVmB3eHX2wYddFY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 172857943303550.822251488940196; Thu, 10 Oct 2024 09:57:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sywT8-000072-SI; Thu, 10 Oct 2024 12:56:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sywSx-00005l-IV for qemu-devel@nongnu.org; Thu, 10 Oct 2024 12:56:45 -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 1sywSw-0000bf-1U for qemu-devel@nongnu.org; Thu, 10 Oct 2024 12:56:43 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-41-tkyQmQZ_MfugpRkVWi_pMg-1; Thu, 10 Oct 2024 12:56:34 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A7EA31956046; Thu, 10 Oct 2024 16:56:32 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.47]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2DB3919560A3; Thu, 10 Oct 2024 16:56:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4636121E6A28; Thu, 10 Oct 2024 18:56:28 +0200 (CEST) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2A00D21E6891; Thu, 10 Oct 2024 17:01:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728579400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=C7FaVE6EH7XBkqNtCES1SEsciaiaJFdQ2HrRn+cpnCI=; b=dOL66Uim9ltqNoyR6cseJzFYnHwp7od1hD8ll8fg5uUhOkhV14XHQgvVEe8pocEcM02jIY GQZ6iiOllXiUfctVh8j+dkUkTCGr4Dk5zaUxXPrLYkDLDLs3nZBDBnKoFl0p1gSs4JSLyW /biGwjyQVdDFLPtGf3y1cHmbZSwnh3E= X-MC-Unique: tkyQmQZ_MfugpRkVWi_pMg-1 Resent-To: michael.roth@amd.com, xieyongji@bytedance.com, Coiby.Xu@gmail.com, eduardo@habkost.net, mark.cave-ayland@ilande.co.uk, philmd@linaro.org, qemu-block@nongnu.org, qemu-devel@nongnu.org Resent-From: Markus Armbruster Resent-Date: Thu, 10 Oct 2024 18:56:28 +0200 Resent-Message-ID: <87plo7hp6r.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Thu Oct 10 17:01:44 2024 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: xieyongji@bytedance.com, kwolf@redhat.com, hreitz@redhat.com, Coiby.Xu@gmail.com, pbonzini@redhat.com, berrange@redhat.com, eduardo@habkost.net, mark.cave-ayland@ilande.co.uk, michael.roth@amd.com, kkostiuk@redhat.com, qemu-block@nongnu.org, philmd@linaro.org Subject: [PATCH v2 6/7] hw/intc/openpic: Improve errors for out of bounds property values Date: Thu, 10 Oct 2024 17:01:43 +0200 Message-ID: <20241010150144.986655-7-armbru@redhat.com> In-Reply-To: <20241010150144.986655-1-armbru@redhat.com> References: <20241010150144.986655-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Lines: 37 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1728579433315116600 Content-Type: text/plain; charset="utf-8" The error message doesn't matter much, as the "openpic" device isn't user-creatable. But it's the last use of QERR_PROPERTY_VALUE_OUT_OF_RANGE, which has to go. Change the message just like the previous commit did for x86 CPUs. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/intc/openpic.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c index 32bd880dfa..cd3d87768e 100644 --- a/hw/intc/openpic.c +++ b/hw/intc/openpic.c @@ -41,7 +41,6 @@ #include "hw/pci/msi.h" #include "qapi/error.h" #include "qemu/bitops.h" -#include "qapi/qmp/qerror.h" #include "qemu/module.h" #include "qemu/timer.h" #include "qemu/error-report.h" @@ -1535,9 +1534,7 @@ static void openpic_realize(DeviceState *dev, Error *= *errp) }; =20 if (opp->nb_cpus > MAX_CPU) { - error_setg(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, - TYPE_OPENPIC, "nb_cpus", (uint64_t)opp->nb_cpus, - (uint64_t)0, (uint64_t)MAX_CPU); + error_setg(errp, "property 'nb_cpus' can be at most %d", MAX_CPU); return; } =20 --=20 2.46.0 From nobody Sat Nov 23 23:03:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728579466; cv=none; d=zohomail.com; s=zohoarc; b=nrtbJ8+6/Tk2cVbOPCQkh7D14huVRj7DL+fi2dxAFxYQx9RB0A2lxlJyl+1kA/1gtDrGLzVBZFJxSXNHzxtrgV4oZvQZcWC1EY7nRqYjqX+XGa9c9oKtkab759yDQk2nVSNMRhleLa3O+BDKNQ9LK/yNq8ys0fRcJpqNmFO3C2M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728579466; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Date:Resent-To:References:Resent-Message-ID:Resent-From:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4bjmF6CYmZjE9cPmoyqAUls739GZG2d/1BmyjWCH8Tg=; b=ZyoL+hB7B6WVilhsX9uUEoJwvSo/j+Iy2ARW9HqQqHev2cy4ad3cmd0CI8oBkf+IeShKlMBXFwHy/OTzgZBeEHq7pKY3+HdpF07heGm86ikHSvSzNwoOQDj5LD+S33dxJB36OCYArBa7gZn77ZVVrPZ5OUmNaPZVRA3FpqKygNo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1728579466893559.8220638987298; Thu, 10 Oct 2024 09:57:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sywTV-0000f3-TH; Thu, 10 Oct 2024 12:57: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 1sywTU-0000eP-DQ for qemu-devel@nongnu.org; Thu, 10 Oct 2024 12:57:16 -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 1sywTS-0000f5-W8 for qemu-devel@nongnu.org; Thu, 10 Oct 2024 12:57:16 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-193-5M4ONwWwMCGBW-YvWyASpg-1; Thu, 10 Oct 2024 12:57:09 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A8AF41956088; Thu, 10 Oct 2024 16:57:05 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.192.47]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2FBEC195607C; Thu, 10 Oct 2024 16:57:05 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F1E1A21E6A28; Thu, 10 Oct 2024 18:57:01 +0200 (CEST) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2D1EF21E68B2; Thu, 10 Oct 2024 17:01:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728579434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-to: resent-from:resent-message-id:in-reply-to:in-reply-to: references:references; bh=4bjmF6CYmZjE9cPmoyqAUls739GZG2d/1BmyjWCH8Tg=; b=Etw0Oaycj+qfEQKZNK65TL8YXdP2CbbspmOf4maUEsxND6upiQAGWb0PC58KzTQD2UCUb2 MTT1VzH3iBodRCgAs+X/HlF6s1HHebB7d9YyCia50Mj6uNj1+S4a/3PHQkB+9j/CVkYe/Z NHzQKgik2id8V4dowQGj29S1SOqC1iA= X-MC-Unique: 5M4ONwWwMCGBW-YvWyASpg-1 Resent-To: michael.roth@amd.com, xieyongji@bytedance.com, Coiby.Xu@gmail.com, eduardo@habkost.net, mark.cave-ayland@ilande.co.uk, philmd@linaro.org, qemu-block@nongnu.org, qemu-devel@nongnu.org Resent-From: Markus Armbruster Resent-Date: Thu, 10 Oct 2024 18:57:01 +0200 Resent-Message-ID: <87ldyvhp5u.fsf@pond.sub.org> X-From-Line: armbru@redhat.com Thu Oct 10 17:01:44 2024 X-Original-To: armbru From: Markus Armbruster To: qemu-devel@nongnu.org Cc: xieyongji@bytedance.com, kwolf@redhat.com, hreitz@redhat.com, Coiby.Xu@gmail.com, pbonzini@redhat.com, berrange@redhat.com, eduardo@habkost.net, mark.cave-ayland@ilande.co.uk, michael.roth@amd.com, kkostiuk@redhat.com, qemu-block@nongnu.org, philmd@linaro.org Subject: [PATCH v2 7/7] qerror: QERR_PROPERTY_VALUE_OUT_OF_RANGE is no longer used, drop Date: Thu, 10 Oct 2024 17:01:44 +0200 Message-ID: <20241010150144.986655-8-armbru@redhat.com> In-Reply-To: <20241010150144.986655-1-armbru@redhat.com> References: <20241010150144.986655-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Lines: 21 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.149, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1728579467443116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/qapi/qmp/qerror.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 101c1141b9..d1db6f18cd 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -23,7 +23,4 @@ #define QERR_MISSING_PARAMETER \ "Parameter '%s' is missing" =20 -#define QERR_PROPERTY_VALUE_OUT_OF_RANGE \ - "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", = maximum: %" PRId64 ")" - #endif /* QERROR_H */ --=20 2.46.0