From nobody Sat Nov 23 23:48:48 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=1728572321; cv=none; d=zohomail.com; s=zohoarc; b=dLpC40Ag1jAI/sgyRnPZSpEnd2AIAO1qzRXQO57lDkqGyukPJ7/F+sT+rwhs53iWCZGklVyxn+viaU6ELuVl4s+wYvOZDXyHowk50Uh4A627CknqKJlOeQ88ZofOdTzkIxZgplLwB4HX+PDL4xy4PxHpeL1PBE0svVjt+CG1Tgc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728572321; 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=Li2Sm2Ismsiz0NLAQRECSw0eiQnpi5hJa2fc3A/5670FDTSqfe44r8UOKut7aL46yyEs1vO2jXmlUihFjsdRHKEYDQEwND/HTRyjXTTMmzZwMFG/sheQcRA4NPQW9N9pmikozxhtnl5WrTpM/xUFAftzbDwAqonc7iLD4jJPcE0= 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 1728572321962873.1556202560843; Thu, 10 Oct 2024 07:58:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syuau-0002y6-NY; Thu, 10 Oct 2024 10:56:49 -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 1syuas-0002wA-7Q for qemu-devel@nongnu.org; Thu, 10 Oct 2024 10:56:46 -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 1syuap-0002k9-BE for qemu-devel@nongnu.org; Thu, 10 Oct 2024 10:56:45 -0400 Received: from mx-prod-mc-03.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-294-PEWYlac8OtaFJChAh8jl5g-1; Thu, 10 Oct 2024 10:56:37 -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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2E2511956048; Thu, 10 Oct 2024 14:56:35 +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 B2180300019F; Thu, 10 Oct 2024 14:56:33 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 4CEA521E691E; Thu, 10 Oct 2024 16:56:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728572202; 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=PlvSFp5C73p81WDD23dbKLEIWzIVHOBYUmRSsZr65uuLJwaaVkLelcXvMeAY4BWWsjRFBI 2XYFrXx5dnSjJSZWhogVJXKbFIZiL1BoJWlSnpQFrUSogKb+YujHwh5o4aQ6wrlN4Beg7w 4wxPiV04lRn1OLJNFlyI4svyMlvmYf0= X-MC-Unique: PEWYlac8OtaFJChAh8jl5g-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 Subject: [PATCH 1/7] error: Drop superfluous #include "qapi/qmp/qerror.h" Date: Thu, 10 Oct 2024 16:56:24 +0200 Message-ID: <20241010145630.985335-2-armbru@redhat.com> In-Reply-To: <20241010145630.985335-1-armbru@redhat.com> References: <20241010145630.985335-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: 1728572323705116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrang=C3=A9 --- 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:48:48 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=1728572305; cv=none; d=zohomail.com; s=zohoarc; b=CnZlYy8QNHoYjaoaQty6Sxbm5edGwG8I/FK83tWY/F+Vd6M7QAZuv1/fBMvNZWclpY5hD7EWJaZ3sCqMDWhYQWJ1CQ0lPvwJ0F8ctOF3xylPGIGCJVJ/f1eSFCFjLsBNqct16tvmsV8C2VYtsvmv4zGujUgYkvu6YA7VKg4UW4Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728572305; 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=lzEFNEr1Mc6nh52xhAztA3OjkgJ0Kc715oAkXw1j1RoLLDi++JNCv+4Oif1IO9ahphHfym0q7mXcvqUGRsaBjhiEKhxxgShm/vWQPy0Bz6Df4CrlfhWoeAbNVqnKelJLcOIRv4EwYUrHQIbRQWMTS03LOR1c8fuwL7ZlttJl0sw= 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 1728572305127584.2405683289321; Thu, 10 Oct 2024 07:58:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syuav-0002yS-Vb; Thu, 10 Oct 2024 10:56:50 -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 1syuas-0002wC-9k for qemu-devel@nongnu.org; Thu, 10 Oct 2024 10:56:46 -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 1syuap-0002jk-RD for qemu-devel@nongnu.org; Thu, 10 Oct 2024 10:56:45 -0400 Received: from mx-prod-mc-03.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-302-IZG4ZeO_PSeYYIcN1n1S7Q-1; Thu, 10 Oct 2024 10:56:38 -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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D1AC21955F3E; Thu, 10 Oct 2024 14:56:36 +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 850FC1956089; Thu, 10 Oct 2024 14:56:35 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5072C21E692E; Thu, 10 Oct 2024 16:56:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728572201; 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=RgOQ7i8YWyUtDVcCshf3pwqvdEm4U7ZRafwuSskVIS7/l2rlvs65ce+ghRe8+dXi5x48OJ 6Lg9mRbT73vY9RE1+sJ1OfgnYiiLfFFo0gcL1SSYjCqYq6rmR9PNYTSA1v1PUp2OtD9hwZ Z5acvQPp+1Mua79jryCnydol5jSpTgk= X-MC-Unique: IZG4ZeO_PSeYYIcN1n1S7Q-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 Subject: [PATCH 2/7] block: Improve errors about block sizes Date: Thu, 10 Oct 2024 16:56:25 +0200 Message-ID: <20241010145630.985335-3-armbru@redhat.com> In-Reply-To: <20241010145630.985335-1-armbru@redhat.com> References: <20241010145630.985335-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=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: 1728572305690116600 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 Reviewed-by: Daniel P. Berrang=C3=A9 --- 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:48:48 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=1728572294; cv=none; d=zohomail.com; s=zohoarc; b=AVM9/0BfFeY0tPk4/4h2SKd/l1Qa8QAKLFl0kqTDaIX1ov/ZHd/XNRe/k+RMOSg2WiuNgWSdpmauHRyGeDuFrYJHJ6hQ6Sj9//mfhDiDElWRkd9iR9iOu72bF20RPqqJUdgygQSHRC7xJ/0sSnTSmXH7kJmL7BxXboA4tEHJfFI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728572294; 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=YJviq2LFnWolLW3fZQnV8a+fE/DQ8T1WL4EzAwIc3zRNBBSzhUOrJQvHco/gXFKsU7M1Tz5KNW33hip/7WFNBfLqaympAlkYScqjT5TS7D1H598b/CRmAnGtni+WPoTdG6HA3TFliPwsqTl8n38Kj66ah5sWgaWAsLVRb4tckHU= 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 1728572294789808.8306172655994; Thu, 10 Oct 2024 07:58:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syuaz-00031J-MG; Thu, 10 Oct 2024 10:56: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 1syuat-0002xk-TE for qemu-devel@nongnu.org; Thu, 10 Oct 2024 10:56:48 -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 1syuas-0002kF-85 for qemu-devel@nongnu.org; Thu, 10 Oct 2024 10:56:47 -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-621-E---ApenPOCOzXSwfhKuSw-1; Thu, 10 Oct 2024 10:56:37 -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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4EB7219560AF; Thu, 10 Oct 2024 14:56:36 +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 D2FE330001A0; Thu, 10 Oct 2024 14:56:34 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 53B0E21E6939; Thu, 10 Oct 2024 16:56:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728572203; 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=CvsU8b6CxEIdGFH6DU7AjRTYnOrcMqIoZg1LnF4+NwfBEegMbj10/C5yEXWEdGO84u7crh pSGsmMmI08vHhA8RL0ya56QNt4BANagylEThnnnWWXtMCHHQ5Siq/FvW0jo1yOx5nTNnAK BwR/9qop2VEevEDIw24hlY1H4bqlrbs= X-MC-Unique: E---ApenPOCOzXSwfhKuSw-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 Subject: [PATCH 3/7] block: Adjust check_block_size() signature Date: Thu, 10 Oct 2024 16:56:26 +0200 Message-ID: <20241010145630.985335-4-armbru@redhat.com> In-Reply-To: <20241010145630.985335-1-armbru@redhat.com> References: <20241010145630.985335-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.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: 1728572295650116600 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: Daniel P. Berrang=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:48:48 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=1728572266; cv=none; d=zohomail.com; s=zohoarc; b=CRG2nuhcXgRzBR59nQ9t6uD/NkGasS4+9t08bRki38h0sTCUedpa0L5KKwpga71gfJsXffp1Xh+u9oSxC2v4M/PZqaPV73kKzb4WjlAEm19zliQjuDbxYgp30f97bq9Alq0pUL3esE2kqBL237o4vOpaiB7S8wWSZCTRYrH1nN8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728572266; 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=lp341gE5AEB1X9InS6vzxwFSt+sabArHeK8SLDvX+fw=; b=ne7ktvtbLP4FSws4alvAs0Oc9HwgSap9W5MpcLKizxnBjrEASenopI9FAzIhqtajFUpSHB8uci01LG6Zgzj/7rawEf1jEI21B232moR43SjkXopI2VIuhbvOaL+hIMtLW1i9I5tJWczBO3I3nSSG2oqpGdtC5hmHbOyrXKRd/+c= 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 172857226689023.717170867030973; Thu, 10 Oct 2024 07: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 1syub0-000325-Mz; Thu, 10 Oct 2024 10: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 1syuaw-0002zY-Q1 for qemu-devel@nongnu.org; Thu, 10 Oct 2024 10:56:51 -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 1syuav-0002m4-5L for qemu-devel@nongnu.org; Thu, 10 Oct 2024 10:56:50 -0400 Received: from mx-prod-mc-03.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-131-3XDkPId5NA2CmSioqKbeEg-1; Thu, 10 Oct 2024 10:56:42 -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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AE9851955F3F; Thu, 10 Oct 2024 14:56:40 +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 F329B300019E; Thu, 10 Oct 2024 14:56:34 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 56F5B21E6889; Thu, 10 Oct 2024 16:56:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728572207; 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=lp341gE5AEB1X9InS6vzxwFSt+sabArHeK8SLDvX+fw=; b=aHWlJttkxFIS5dRyumbQIX4IMisGCgDBx7W2l+/yEgaAGh4e1ddgg2aD+hTom0MhuI8IC0 ueKpV+u+I354JL0SxMjee/C/zCGQ7bFCF2VLxi1GQ2FvHC4Em56IEi1c83MvUxQJMI7ELp lqFfJkPq6hS8yAk8sGrQzkTaHLbjvg8= X-MC-Unique: 3XDkPId5NA2CmSioqKbeEg-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 Subject: [PATCH 4/7] target/i386/cpu: Avoid mixing signed and unsigned in property setters Date: Thu, 10 Oct 2024 16:56:27 +0200 Message-ID: <20241010145630.985335-5-armbru@redhat.com> In-Reply-To: <20241010145630.985335-1-armbru@redhat.com> References: <20241010145630.985335-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.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: 1728572267741116600 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. 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 try draining this swamp today. Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrang=C3=A9 --- 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:48:48 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=1728572244; cv=none; d=zohomail.com; s=zohoarc; b=RuQ83UxZvmYBOS/CkZXgyrNnDuQH7mcDUEngFv1QL+T8BdG26FHt8wezpn5UIh/FWZOD04a4qYYVx+8kKQcXHfRjKtnMDG6e/kRHA3tI1F+E2V+gpUkH+vM9FmQxFyJ9aO5XtnARo6jDWDHcPpNfIWQOfkhXKMNbo+AWS3ataoo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728572244; 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=XBfZZa0Bj0Ph0CoBbr6Ixqccz4iCxg/EHl3zIVDQ5rs=; b=g7QtBEdyDU8ncVWj9+HGGdGmjvG7SqKbKSvPSZjArn16kVDszJ2rSkzmbYCmv80evvUlWDynJEA7aZNG1lwyo1niQ9+H5BN+nhjGPRXd9TnUcXRhPqa6PqwnOaqvuRVyNBXv9z9yvzLw8XpWM7XatwsxYL7owFWxn86vsPljvEw= 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 1728572244132694.8911697856668; Thu, 10 Oct 2024 07:57:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syuaw-0002yd-4f; Thu, 10 Oct 2024 10:56:50 -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 1syuat-0002xS-Es for qemu-devel@nongnu.org; Thu, 10 Oct 2024 10:56: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 1syuap-0002kH-Sd for qemu-devel@nongnu.org; Thu, 10 Oct 2024 10:56:47 -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-446-wluui7mPPWCFqOfaDpkekQ-1; Thu, 10 Oct 2024 10:56:40 -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 8C0901956046; Thu, 10 Oct 2024 14:56:38 +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 483EB1956052; Thu, 10 Oct 2024 14:56:38 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5A3D721E688F; Thu, 10 Oct 2024 16:56:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728572203; 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=XBfZZa0Bj0Ph0CoBbr6Ixqccz4iCxg/EHl3zIVDQ5rs=; b=eQLbALx3Tt/XpkBRNTFOCxL6D6lDBmdGIVYTpvb3A1MtIIgS2cgw14Cql+XfPyMBq+0Kux bnYRljHLXgimKpt81/GCqQeAS/iUYn4hzwxlvN8y0bKqCzWR0Lj4yKbyXa6QTBGjADr8Ro 2GIJTYifIy4eanDAcfAjBCjapLPMHSI= X-MC-Unique: wluui7mPPWCFqOfaDpkekQ-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 Subject: [PATCH 5/7] target/i386/cpu: Improve errors for out of bounds property values Date: Thu, 10 Oct 2024 16:56:28 +0200 Message-ID: <20241010145630.985335-6-armbru@redhat.com> In-Reply-To: <20241010145630.985335-1-armbru@redhat.com> References: <20241010145630.985335-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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.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: 1728572245488116600 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: Daniel P. Berrang=C3=A9 --- 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:48:48 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=1728572327; cv=none; d=zohomail.com; s=zohoarc; b=GjNpf84Jrd3fbQwRHuu3Oq7bPCiQJR9F5XwRiOHDiXowF6ROdLw0rqIEcHS3gV29Z8R221+/e1lgCHNDfgzQn6jvKXB8qvWOEAOpYj8JflP42A1Yje7eFsCS7L8odSsqf+qLCCO/y2lYi/BM2Za7Wabs3Z6oWHwoMDuHb628rfk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728572327; 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=C7FaVE6EH7XBkqNtCES1SEsciaiaJFdQ2HrRn+cpnCI=; b=QEfv2r6p25Ex4fnXEMhxlhBUIjFufWmYp31LeyvY8cXlzCxTeIvRu+kHL6jda6IdzUZXHkZ817r+QL4aYmOyvO42pkyW8/tI24r1+1BI0jyaokS+CnGPR/mRLc4hQYzC1tT/32lLnFzka1DYA5rMRvaVEFLd4eaOEvuBxc7T+x8= 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 1728572327923525.3244534740795; Thu, 10 Oct 2024 07:58:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syuay-000312-EP; Thu, 10 Oct 2024 10:56:52 -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 1syuau-0002xz-9t for qemu-devel@nongnu.org; Thu, 10 Oct 2024 10:56: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 1syuas-0002l5-JO for qemu-devel@nongnu.org; Thu, 10 Oct 2024 10:56:48 -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-92-M3_oXUhNO36Q7tdffFsZxA-1; Thu, 10 Oct 2024 10:56:41 -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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 36E5E1956096; Thu, 10 Oct 2024 14:56:40 +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 F2F0D19560A3; Thu, 10 Oct 2024 14:56:37 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 5DCDC21E6891; Thu, 10 Oct 2024 16:56:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728572205; 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=C7FaVE6EH7XBkqNtCES1SEsciaiaJFdQ2HrRn+cpnCI=; b=feX5gCw71G5fDq3vyj/+fiOoD7JADWoYEoM6tXzZoyNA8tiLam/4FO6ZL/NBa6uyVcAoC5 HDqDXHvEJDDq5UF4LRCDde7VdHqnbdKkPTuw8Sy2y5eCffZBAjfEsMx+fO3ArEud9H2RXc wNwX9VT29GR6j1tDSc2SMkmimOGU63o= X-MC-Unique: M3_oXUhNO36Q7tdffFsZxA-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 Subject: [PATCH 6/7] hw/intc/openpic: Improve errors for out of bounds property values Date: Thu, 10 Oct 2024 16:56:29 +0200 Message-ID: <20241010145630.985335-7-armbru@redhat.com> In-Reply-To: <20241010145630.985335-1-armbru@redhat.com> References: <20241010145630.985335-1-armbru@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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.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: 1728572329810116600 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: Daniel P. Berrang=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:48:48 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=1728572294; cv=none; d=zohomail.com; s=zohoarc; b=UL4BZl9Wvrr14Y5EisZ5JOPId97Cjy4u4pFnPFvZjSbfAk0ZL+4AunukNcUsrz7CAuPC+pjGf0QZw3ixNs6Yd8Ucfz0vBlxiVWi95aSogxKOhZLVJm2hSXFsLGZQ430WRU14X7tnGFxYDEzHEKixtzG0d0CyDCOK3t/0nEd2oVU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728572294; 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=4bjmF6CYmZjE9cPmoyqAUls739GZG2d/1BmyjWCH8Tg=; b=DEyfJhd0NR5o60OMDNn3Hy+z7AMCyLuD9e9aJ1oWwx31fsrnA0tOFxA4lCxfSWp1Q6+Cf8rwjc3kNCgNYNIyKI/vQZlE9gQll0O0ojcZoPA4SvO2kL1ChrhxN0yT1dnRJ1RX0537Vr3ab/xHI/44rmXKKqz6IwtsITaKeWLh5Rs= 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 1728572294698792.2104063944922; Thu, 10 Oct 2024 07:58:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syuav-0002yC-5c; Thu, 10 Oct 2024 10:56:49 -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 1syuat-0002xM-CE for qemu-devel@nongnu.org; Thu, 10 Oct 2024 10:56:47 -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 1syuar-0002kT-FL for qemu-devel@nongnu.org; Thu, 10 Oct 2024 10:56:47 -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-39-GZk7sbpUNziDwe617KwSTg-1; Thu, 10 Oct 2024 10:56:41 -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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 681161955D9B; Thu, 10 Oct 2024 14:56:40 +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 26349195607C; Thu, 10 Oct 2024 14:56:40 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 60F7921E68B2; Thu, 10 Oct 2024 16:56:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728572204; 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=4bjmF6CYmZjE9cPmoyqAUls739GZG2d/1BmyjWCH8Tg=; b=ZP6OPjzEysohsXmZbZ3ddjRdsyaFpgbNZOPrxHIKdngq6nvn2+CeYx/VF7771/qIVTnL+N QbhLchT3L+1TzrDatt3Vx7MLNO9yodwt1EeUGeTc4vz1EiFiv7gwUn5wt5q7PkYEi3L3sL eb30c+w6fGn6EccpffPL7sqT7DztToc= X-MC-Unique: GZk7sbpUNziDwe617KwSTg-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 Subject: [PATCH 7/7] qerror: QERR_PROPERTY_VALUE_OUT_OF_RANGE is no longer used, drop Date: Thu, 10 Oct 2024 16:56:30 +0200 Message-ID: <20241010145630.985335-8-armbru@redhat.com> In-Reply-To: <20241010145630.985335-1-armbru@redhat.com> References: <20241010145630.985335-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=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: 1728572295568116600 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrang=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