From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBLSu-0004ZN-MV for qemu-devel@nongnu.org; Mon, 19 Aug 2013 05:09:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBLSo-0004vD-Nv for qemu-devel@nongnu.org; Mon, 19 Aug 2013 05:09:32 -0400 From: Markus Armbruster References: <1376651630-9151-1-git-send-email-armbru@redhat.com> <1376651630-9151-2-git-send-email-armbru@redhat.com> <520F4B7A.1060401@redhat.com> Date: Mon, 19 Aug 2013 11:09:18 +0200 In-Reply-To: <520F4B7A.1060401@redhat.com> (Laszlo Ersek's message of "Sat, 17 Aug 2013 12:07:54 +0200") Message-ID: <874namf3nl.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v4 1/6] pc: Don't prematurely explode QEMUMachineInitArgs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: aliguori@us.ibm.com, mjt@tls.msk.ru, qemu-devel@nongnu.org, agraf@suse.de, blauwirbel@gmail.com, qemu-ppc@nongnu.org, aviksil@linux.vnet.ibm.com Laszlo Ersek writes: > On 08/16/13 13:13, armbru@redhat.com 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 Thanks!