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: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v4 1/6] pc: Don't prematurely explode QEMUMachineInitArgs
Date: Mon, 19 Aug 2013 11:09:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Laszlo Ersek <address@hidden> writes:

> 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.

Precedence:

db4ff6f hw/realview.c: Don't prematurely explode QEMUMachineInitArgs
1b523b5 hw/versatilepb: Don't prematurely explode QEMUMachineInitArgs

> 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>

Thanks!



reply via email to

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