[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/15] target-i386: introduce apic-id property
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH 04/15] target-i386: introduce apic-id property |
Date: |
Thu, 25 Apr 2013 17:36:45 -0300 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Apr 25, 2013 at 04:05:26PM +0200, Igor Mammedov wrote:
[...]
> +static void x86_cpuid_set_apic_id(Object *obj, Visitor *v, void *opaque,
> + const char *name, Error **errp)
> +{
> + X86CPU *cpu = X86_CPU(obj);
> + const int64_t min = 0;
> + const int64_t max = UINT32_MAX;
> + Error *error = NULL;
> + int64_t value;
> +
> + visit_type_int(v, &value, name, &error);
> + if (error) {
> + error_propagate(errp, error);
> + return;
> + }
> + if (value < min || value > max) {
> + error_setg(&error, "Property %s.%s doesn't take value %" PRId64
> + " (minimum: %" PRId64 ", maximum: %" PRId64 ")" ,
> + object_get_typename(obj), name, value, min, max);
> + error_propagate(errp, error);
> + return;
> + }
Why you copied and pasted the string from
QERR_PROPERTY_VALUE_OUT_OF_RANGE, instead of simply using the define
like in the other property setters?
The rest of the patch looks good to me.
--
Eduardo
- [Qemu-devel] [PATCH 00/15 v6 for 1.5] target-i386: CPU hot-add with cpu-add QMP command, Igor Mammedov, 2013/04/25
- Re: [Qemu-devel] [PATCH 04/15] target-i386: introduce apic-id property, Eduardo Habkost, 2013/04/26
- Re: [Qemu-devel] [PATCH 04/15] target-i386: introduce apic-id property, Andreas Färber, 2013/04/26
- [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id one CPU is realized, Igor Mammedov, 2013/04/26
- Re: [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id one CPU is realized, Andreas Färber, 2013/04/26
- Re: [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id one CPU is realized, Igor Mammedov, 2013/04/26
- [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id once CPU is realized, Igor Mammedov, 2013/04/26
- Re: [Qemu-devel] [PATCH] target-i386: Do not allow to set apic-id once CPU is realized, Andreas Färber, 2013/04/27