From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqLBc-000452-86 for qemu-devel@nongnu.org; Thu, 07 May 2015 08:45:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqLBX-0002Mw-8v for qemu-devel@nongnu.org; Thu, 07 May 2015 08:45:56 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:60725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqLBX-0002Mm-0I for qemu-devel@nongnu.org; Thu, 07 May 2015 08:45:51 -0400 Message-ID: <554B5DC4.3070902@imgtec.com> Date: Thu, 7 May 2015 13:42:44 +0100 From: Leon Alrae MIME-Version: 1.0 References: <1430924229-20469-1-git-send-email-leon.alrae@imgtec.com> <1430924229-20469-5-git-send-email-leon.alrae@imgtec.com> <554B35D3.2050908@imgtec.com> <6DBEB618-3C16-4924-8C2C-1DA1405A3104@livius.net> <554B58C6.5010107@imgtec.com> <1DC3FF37-E92C-446C-9111-1F768D073EB5@livius.net> In-Reply-To: <1DC3FF37-E92C-446C-9111-1F768D073EB5@livius.net> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 4/4] semihosting: add --semihosting-config arg sub-argument List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liviu Ionescu Cc: peter.maydell@linaro.org, christopher.covington@linaro.org, qemu-devel@nongnu.org, matthew.fortune@imgtec.com On 07/05/2015 13:35, Liviu Ionescu wrote: > >> On 07 May 2015, at 15:21, Leon Alrae wrote: >> >> On 07/05/2015 12:50, Liviu Ionescu wrote: >>> >>>> On 07 May 2015, at 12:52, Leon Alrae wrote: >>>> >>>>> is it that difficult to count the "arg"s and correctly alloc the array? >>>> >>>> This probably would require going through the list twice >>> >>> the code to iterate is already there, for other options, you just need to add a branch to the existing case. >> >> Do you mean modifying QEMU option parser? > > not at all. > > option parsing is done anyway in two passes. the first pass is a short loop, used to identify nodeconfig & nouserconfig. the second pass is the big for(;;) loop. you can use this first pass to count the number of args, similarly as I did in my patch. > I think parsing -semihosting-config sub-options should happen inside "case QEMU_OPTION_semihosting_config", just to be consistent with other options. Leon