From: Markus Armbruster <armbru@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org, 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: Re: [PATCH v2 6/7] hw/intc/openpic: Improve errors for out of bounds property values
Date: Thu, 17 Oct 2024 08:21:44 +0200 [thread overview]
Message-ID: <87bjzj6yh3.fsf@pond.sub.org> (raw)
In-Reply-To: <db943e63-4968-4cb6-885b-3cd479ba8962@linaro.org> ("Philippe Mathieu-Daudé"'s message of "Thu, 10 Oct 2024 14:40:28 -0300")
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> On 10/10/24 12:01, Markus Armbruster wrote:
>> 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 <armbru@redhat.com>
>> ---
>> 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)
>> };
>>
>> 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;
>> }
>>
>
> As another cleanup we could convert MAX_CPU to unsigned.
Existing uses are all fine as is. Perhaps the maintainer has a
preference.
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Thanks!
next prev parent reply other threads:[~2024-10-17 6:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-10 15:01 [PATCH v2 0/7] error: Eliminate QERR_PROPERTY_VALUE_OUT_OF_RANGE Markus Armbruster
2024-10-10 15:01 ` [PATCH v2 1/7] error: Drop superfluous #include "qapi/qmp/qerror.h" Markus Armbruster
2024-10-10 15:01 ` [PATCH v2 2/7] block: Improve errors about block sizes Markus Armbruster
2024-10-10 15:01 ` [PATCH v2 3/7] block: Adjust check_block_size() signature Markus Armbruster
2024-10-10 16:38 ` Philippe Mathieu-Daudé
2024-10-10 15:01 ` [PATCH v2 4/7] target/i386/cpu: Avoid mixing signed and unsigned in property setters Markus Armbruster
2024-10-11 12:23 ` Igor Mammedov
2024-10-10 15:01 ` [PATCH v2 5/7] target/i386/cpu: Improve errors for out of bounds property values Markus Armbruster
2024-10-10 17:38 ` Philippe Mathieu-Daudé
2024-10-10 19:25 ` Markus Armbruster
2024-10-11 15:11 ` Philippe Mathieu-Daudé
2024-10-15 4:45 ` Markus Armbruster
2024-10-11 12:24 ` Igor Mammedov
2024-10-10 15:01 ` [PATCH v2 6/7] hw/intc/openpic: " Markus Armbruster
2024-10-10 17:40 ` Philippe Mathieu-Daudé
2024-10-17 6:21 ` Markus Armbruster [this message]
2024-10-10 15:01 ` [PATCH v2 7/7] qerror: QERR_PROPERTY_VALUE_OUT_OF_RANGE is no longer used, drop Markus Armbruster
2024-10-10 17:41 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bjzj6yh3.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=Coiby.Xu@gmail.com \
--cc=berrange@redhat.com \
--cc=eduardo@habkost.net \
--cc=hreitz@redhat.com \
--cc=kkostiuk@redhat.com \
--cc=kwolf@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=michael.roth@amd.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=xieyongji@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.