From: Jeremy Katz Subject: Re: [PATCH] Guest boot loader support [2/2] Date: Thu, 14 Apr 2005 12:07:32 -0400 Message-ID: <1113494852.5078.114.camel@bree.local.net> References: <1113448377.5078.51.camel@bree.local.net> <425E61FF.8080809@hpl.hp.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <425E61FF.8080809@hpl.hp.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Mike Wray Cc: Ian Pratt , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Thu, 2005-04-14 at 13:28 +0100, Mike Wray wrote: > It looks like the code above is missing some brackets in the output: > shouldn't it be writing "(linux ..." instead of "linux ...", > and adding a closing ")"? Adding them causes problems with nesting inside the image. This is actually tied into the bit where I go to a string and back in the other patch. Given the way things are being passed around, we do actually hae to do the slightly round-about way instead of the most obvious. > It might be easier if you used lists for this: > > val = ['linux', ['kernel', fn]] > val.append(['ramdisk', fn]) > val.append(['args', img.args]) > os.write(fd, sxp.to_string(val)) > > This will take care of the brackets, and any string quoting needed. But adds a dependency on the sxp module. As it stands now, pygrub is pretty independent of any xen code. The biggest problem with adding such a dep is the path handling for where the sxp module lives. I guess I could be convinced if you really think it's better Jeremy