From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6ugy-0003J2-Kd for qemu-devel@nongnu.org; Thu, 12 Jun 2008 17:50:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6ugw-0003HK-Ow for qemu-devel@nongnu.org; Thu, 12 Jun 2008 17:50:48 -0400 Received: from [199.232.76.173] (port=53551 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6ugw-0003HC-L4 for qemu-devel@nongnu.org; Thu, 12 Jun 2008 17:50:46 -0400 Received: from yw-out-1718.google.com ([74.125.46.155]:42198) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K6ugw-0006fD-89 for qemu-devel@nongnu.org; Thu, 12 Jun 2008 17:50:46 -0400 Received: by yw-out-1718.google.com with SMTP id 6so2443104ywa.82 for ; Thu, 12 Jun 2008 14:50:38 -0700 (PDT) Message-ID: <48519A19.8080803@codemonkey.ws> Date: Thu, 12 Jun 2008 16:50:17 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] New scriptarg=... -net parameter allows passing of an argument References: <18513.23567.23400.891876@mariner.uk.xensource.com> <48516D47.6080005@codemonkey.ws> <4851948E.4070300@qumranet.com> In-Reply-To: <4851948E.4070300@qumranet.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Avi Kivity wrote: > Anthony Liguori wrote: >> Ian Jackson wrote: >>> Previously, network scripts would have to do all of their work based >>> only on the script name and interface name. If the script's behaviour >>> is supposed to be different for different network interfaces this >>> might involve constructing a special script for each interface with >>> the associated need to delete it etc. >>> >> >> env args should get passed down to the script although I can see an >> argument for being able to specify this in -net. My only suggestion >> would be to use an env arg instead of "$2" as it will make it easier >> to extend in the future. > > Environment variables are global, whereas scriptarg is per-interface. > Consider the case where scriptarg denotes the bridge name we want the > interface to attach to. Right, what I'm suggesting is that scriptarg=... use an environmental variable (for instance, named SCRIPTARG) when executing the actual script instead of passing it as the second parameter. It's nicer IMHO because it extends well to passing more data to the script (like whatever the -name parameter is). I was originally going to suggest arbitrary ,key=value be passed by default as environmental variables like QEMU_key=value but I think that would get too complicated given the current code. Regards, Anthony Liguori