From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiNyl-0007NM-Dz for qemu-devel@nongnu.org; Tue, 11 Dec 2012 06:26:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiNye-0007VT-Bs for qemu-devel@nongnu.org; Tue, 11 Dec 2012 06:26:26 -0500 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:43283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiNye-0007V9-3G for qemu-devel@nongnu.org; Tue, 11 Dec 2012 06:26:20 -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:26:11 -0000 Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qBBBQ7Ib5177608 for ; Tue, 11 Dec 2012 11:26:07 GMT Received: from d06av12.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qBBBQEFW003659 for ; Tue, 11 Dec 2012 04:26:15 -0700 Message-ID: <50C71856.203@de.ibm.com> Date: Tue, 11 Dec 2012 12:26:14 +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> <50C715B7.4060006@de.ibm.com> <7AAFDE65-CD82-43B0-BBBF-153675EE35C3@suse.de> In-Reply-To: <7AAFDE65-CD82-43B0-BBBF-153675EE35C3@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 12:19, Alexander Graf wrote: > > On 11.12.2012, at 12:15, Christian Borntraeger wrote: > >> 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 = ""; >> } > > Then that's on purpose. Either we change the default for everyone or not at all. But checking for "" only in the s390 machine sounds off. Ok, makes sense.