qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/5] target-arm: Add feature parsing to virt


From: Alex Bennée
Subject: Re: [Qemu-devel] [PATCH 2/5] target-arm: Add feature parsing to virt
Date: Tue, 20 Jan 2015 16:58:35 +0000

Greg Bellows <address@hidden> writes:

> Added machvirt parsing of feature keywords added to the -cpu command line
> option.  Parsing occurs during machine initialization.
>
> Signed-off-by: Greg Bellows <address@hidden>
> ---
>  hw/arm/virt.c | 21 +++++++++++++++++++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 2353440..cd192ae 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -573,12 +573,19 @@ static void machvirt_init(MachineState *machine)
>      MemoryRegion *ram = g_new(MemoryRegion, 1);
>      const char *cpu_model = machine->cpu_model;
>      VirtBoardInfo *vbi;
> +    char *cpuname, *features;
>  
>      if (!cpu_model) {
>          cpu_model = "cortex-a15";
>      }
>  
> -    vbi = find_machine_info(cpu_model);
> +    /* Separate the actual CPU model name from any appended features */
> +    cpuname = g_strdup(cpu_model);
> +    cpuname = strtok(cpuname, ",");
> +    /* Keep track of the features for later parsing */
> +    features = strtok(NULL, ",");
<snip>

OK having read the strtok man page a bit more closely the second time
I'm happy this doesn't leak. My more-gliby request is a matter of
personal taste.

-- 
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]