From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiNo2-0002HE-0g for qemu-devel@nongnu.org; Tue, 11 Dec 2012 06:15:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiNnw-0004Tg-4g for qemu-devel@nongnu.org; Tue, 11 Dec 2012 06:15:21 -0500 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:56599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiNnv-0004T7-S5 for qemu-devel@nongnu.org; Tue, 11 Dec 2012 06:15:16 -0500 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 11 Dec 2012 11:15:03 -0000 Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qBBBEv7o44892334 for ; Tue, 11 Dec 2012 11:14:57 GMT Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qBBAQCkI003409 for ; Tue, 11 Dec 2012 05:26:12 -0500 Message-ID: <50C715B7.4060006@de.ibm.com> Date: Tue, 11 Dec 2012 12:15:03 +0100 From: Christian Borntraeger MIME-Version: 1.0 References: <1354888531-47836-1-git-send-email-jfrei@linux.vnet.ibm.com> <1354888531-47836-2-git-send-email-jfrei@linux.vnet.ibm.com> <014C9A5F-A2A2-47C8-AEF3-D17F56208090@suse.de> In-Reply-To: <014C9A5F-A2A2-47C8-AEF3-D17F56208090@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] s390: Fix empty kernel command line List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Cornelia Huck , Jens Freimann , Heinz Graalfs , qemu-devel , Einar Lueck On 11/12/12 11:34, Alexander Graf wrote: > > On 07.12.2012, at 14:55, Jens Freimann wrote: > >> From: Christian Borntraeger >> >> Since commit 967c0da73a7b0da186baba6632301d83644a570c >> vl.c: Avoid segfault when started with no arguments >> >> the user can specify a kernel without a command line. Lets not >> overwrite the default command line with \0 in that case. >> >> Signed-off-by: Christian Borntraeger >> Signed-off-by: Jens Freimann >> --- >> hw/s390-virtio.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c >> index ca1bb09..d77871a 100644 >> --- a/hw/s390-virtio.c >> +++ b/hw/s390-virtio.c >> @@ -290,7 +290,7 @@ static void s390_init(QEMUMachineInitArgs *args) >> stq_p(rom_ptr(INITRD_PARM_SIZE), initrd_size); >> } >> >> - if (rom_ptr(KERN_PARM_AREA)) { >> + if (rom_ptr(KERN_PARM_AREA) && strlen(kernel_cmdline)) { > > why strlen()? If no -append option was passed, kernel_cmdline should be NULL. If -append "" was passed, the user wants to command line to be overwritten with "\0". Nope. kernel_cmdline is always a valid pointer. vl.c: [..] if (!kernel_cmdline) { kernel_cmdline = ""; } [..]