[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] target-i386: use visit_type_suffixed_int()
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] target-i386: use visit_type_suffixed_int() to parse tsc_freq property value |
Date: |
Wed, 12 Dec 2012 16:16:47 -0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Dec 10, 2012 at 10:33:07PM +0100, Igor Mammedov wrote:
> Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Like I said in the previous patch, maybe it would be nice to have a
visit_type_frequency() helper, to hide the specific details/parameters
required to parse frequency values.
> ---
> v3:
> - s/visit_type_unit_suffixed_int/visit_type_suffixed_int/
> v2:
> - replace visit_type_freq() with visit_type_unit_suffixed_int()
> in x86_cpuid_set_tsc_freq()
> ---
> target-i386/cpu.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index 7be3ad8..18adff4 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -1194,8 +1194,9 @@ static void x86_cpuid_set_tsc_freq(Object *obj, Visitor
> *v, void *opaque,
> const int64_t min = 0;
> const int64_t max = INT64_MAX;
> int64_t value;
> + const int kHz_factor = 1000;
>
> - visit_type_int(v, &value, name, errp);
> + visit_type_suffixed_int(v, &value, name, kHz_factor, errp);
> if (error_is_set(errp)) {
> return;
> }
> --
> 1.7.11.7
>
>
--
Eduardo