qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] New scriptarg=... -net parameter allows passing


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] New scriptarg=... -net parameter allows passing of an argument
Date: Thu, 12 Jun 2008 16:50:17 -0500
User-agent: Thunderbird 2.0.0.14 (X11/20080501)

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]