qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 1/6] pc: Don't prematurely explode QEMUMachin


From: Laszlo Ersek
Subject: Re: [Qemu-devel] [PATCH v4 1/6] pc: Don't prematurely explode QEMUMachineInitArgs
Date: Sat, 17 Aug 2013 12:07:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130806 Thunderbird/17.0.8

On 08/16/13 13:13, address@hidden wrote:

>  static void pc_init_isa(QEMUMachineInitArgs *args)
>  {
> -    ram_addr_t ram_size = args->ram_size;
> -    const char *cpu_model = args->cpu_model;
> -    const char *kernel_filename = args->kernel_filename;
> -    const char *kernel_cmdline = args->kernel_cmdline;
> -    const char *initrd_filename = args->initrd_filename;
> -    const char *boot_device = args->boot_device;
>      has_pci_info = false;
> -    if (cpu_model == NULL)
> -        cpu_model = "486";
> +    if (!args->cpu_model) {
> +        args->cpu_model = "486";
> +    }

This modifies *args.

IIUC, args here points to the "args" auto variable in main().
"args.cpu_model" is initialized from the standalone "cpu_model"
variable. That one in turn is either NULL, or points to a command line
argument. Ie. "args.cpu_model" is never expected to be freed, and the
underlying char array is not expected to be modified. OK.

Reviewed-by: Laszlo Ersek <address@hidden>




reply via email to

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