[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH v4 1/6] pc: Don't prematurely explode
From: |
Laszlo Ersek |
Subject: |
Re: [Qemu-ppc] [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>
- [Qemu-ppc] [PATCH v4 0/6] Clean up bogus default boot order, armbru, 2013/08/16
- [Qemu-ppc] [PATCH v4 4/6] ppc: Don't explode QEMUMachineInitArgs into local variables needlessly, armbru, 2013/08/16
- [Qemu-ppc] [PATCH v4 1/6] pc: Don't prematurely explode QEMUMachineInitArgs, armbru, 2013/08/16
- [Qemu-ppc] [PATCH v4 3/6] sun4: Don't prematurely explode QEMUMachineInitArgs, armbru, 2013/08/16
- [Qemu-ppc] [PATCH v4 2/6] pc: Don't explode QEMUMachineInitArgs into local variables needlessly, armbru, 2013/08/16
- [Qemu-ppc] [PATCH v4 6/6] hw: Clean up bogus default boot order, armbru, 2013/08/16