* [Qemu-devel] [PATCH] Do not redefine DEFAULT_NETWORK_{, DOWN_}SCRIPT
@ 2008-06-12 17:24 Ian Jackson
2008-06-12 18:40 ` Anthony Liguori
0 siblings, 1 reply; 4+ messages in thread
From: Ian Jackson @ 2008-06-12 17:24 UTC (permalink / raw)
To: qemu-devel
With this change it is possible to change the default network script
with a change to CPPFLAGS or a suitable config.h, for example
-DDEFAULT_NETWORK_SCRIPT='"/path/to/some/script/of/mine/ifup"' \
-DDEFAULT_NETWORK_DOWN_SCRIPT='"/path/to/some/script/of/mine/ifdown"'
My patch assumes that you'll want to override both defaults, or
neither.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
vl.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/vl.c b/vl.c
index f1d92c1..229b536 100644
--- a/vl.c
+++ b/vl.c
@@ -131,8 +131,10 @@ int inet_aton(const char *cp, struct in_addr *ia);
#include "exec-all.h"
+#ifndef DEFAULT_NETWORK_SCRIPT
#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
+#endif
#ifdef __sun__
#define SMBD_COMMAND "/usr/sfw/sbin/smbd"
#else
--
1.4.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [Qemu-devel] [PATCH] Do not redefine DEFAULT_NETWORK_{, DOWN_}SCRIPT
2008-06-12 17:24 [Qemu-devel] [PATCH] Do not redefine DEFAULT_NETWORK_{, DOWN_}SCRIPT Ian Jackson
@ 2008-06-12 18:40 ` Anthony Liguori
2008-06-13 9:27 ` Ian Jackson
2008-06-13 11:24 ` Ian Jackson
0 siblings, 2 replies; 4+ messages in thread
From: Anthony Liguori @ 2008-06-12 18:40 UTC (permalink / raw)
To: qemu-devel
Ian Jackson wrote:
> With this change it is possible to change the default network script
> with a change to CPPFLAGS or a suitable config.h, for example
> -DDEFAULT_NETWORK_SCRIPT='"/path/to/some/script/of/mine/ifup"' \
> -DDEFAULT_NETWORK_DOWN_SCRIPT='"/path/to/some/script/of/mine/ifdown"'
>
This is a good idea, but I think it should be something that is
specified in ./configure.
Regards,
Anthony Liguori
> My patch assumes that you'll want to override both defaults, or
> neither.
>
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
>
> ---
> vl.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index f1d92c1..229b536 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -131,8 +131,10 @@ int inet_aton(const char *cp, struct in_addr *ia);
>
> #include "exec-all.h"
>
> +#ifndef DEFAULT_NETWORK_SCRIPT
> #define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup"
> #define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown"
> +#endif
> #ifdef __sun__
> #define SMBD_COMMAND "/usr/sfw/sbin/smbd"
> #else
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Qemu-devel] [PATCH] Do not redefine DEFAULT_NETWORK_{, DOWN_}SCRIPT
2008-06-12 18:40 ` Anthony Liguori
@ 2008-06-13 9:27 ` Ian Jackson
2008-06-13 11:24 ` Ian Jackson
1 sibling, 0 replies; 4+ messages in thread
From: Ian Jackson @ 2008-06-13 9:27 UTC (permalink / raw)
To: qemu-devel
Anthony Liguori writes ("Re: [Qemu-devel] [PATCH] Do not redefine DEFAULT_NETWORK_{, DOWN_}SCRIPT"):
> Ian Jackson wrote:
> > With this change it is possible to change the default network script
> > with a change to CPPFLAGS or a suitable config.h, for example
> > -DDEFAULT_NETWORK_SCRIPT='"/path/to/some/script/of/mine/ifup"' \
> > -DDEFAULT_NETWORK_DOWN_SCRIPT='"/path/to/some/script/of/mine/ifdown"'
> >
>
> This is a good idea, but I think it should be something that is
> specified in ./configure.
Yes, I agree that ./configure should be able to provide a setting for
this. I'll follow up with a patch which does that.
Ian.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Qemu-devel] [PATCH] Do not redefine DEFAULT_NETWORK_{, DOWN_}SCRIPT
2008-06-12 18:40 ` Anthony Liguori
2008-06-13 9:27 ` Ian Jackson
@ 2008-06-13 11:24 ` Ian Jackson
1 sibling, 0 replies; 4+ messages in thread
From: Ian Jackson @ 2008-06-13 11:24 UTC (permalink / raw)
To: qemu-devel
Anthony Liguori writes ("Re: [Qemu-devel] [PATCH] Do not redefine DEFAULT_NETWORK_{, DOWN_}SCRIPT"):
> This is a good idea, but I think it should be something that is
> specified in ./configure.
In the attached patch, you can specify this as an argument to
./configure, --network-scripts=ifup,ifdown.
You need my previous patch too to avoid redefinition.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
configure | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/configure b/configure
index c1ab850..0b9cbb2 100755
--- a/configure
+++ b/configure
@@ -331,6 +331,10 @@ for opt do
;;
--disable-curses) curses="no"
;;
+ --network-scripts=*) network_scripts="$optarg"
+ ;;
+ --network-script-ifup=*) network_script_ifup="$optarg"
+ ;;
*) echo "ERROR: unknown option $opt"; show_help="yes"
;;
esac
@@ -430,6 +434,7 @@ echo " --enable-linux-user enable all linux usermode emulation targets"
echo " --disable-linux-user disable all linux usermode emulation targets"
echo " --enable-darwin-user enable all darwin usermode emulation targets"
echo " --disable-darwin-user disable all darwin usermode emulation targets"
+echo " --network-scripts=IFUP,IFDOWN use IFUP, IFDOWN for networking setup"
echo " --fmod-lib path to FMOD library"
echo " --fmod-inc path to FMOD includes"
echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
@@ -1100,6 +1105,15 @@ if [ "$bsd" = "yes" ] ; then
echo "#define _BSD 1" >> $config_h
fi
+if [ "x$network_scripts" != x ]; then
+ cat >>$config_h <<END
+#define DEFAULT_NETWORK_SCRIPT "${network_scripts%,*}"
+#define DEFAULT_NETWORK_DOWN_SCRIPT "${network_scripts#*,}"
+END
+else
+ echo >>$config_h "/* DEFAULT_NETWORK_[DOWN_]SCRIPT not set */"
+fi
+
echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h
tools=
--
1.4.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-06-13 11:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-12 17:24 [Qemu-devel] [PATCH] Do not redefine DEFAULT_NETWORK_{, DOWN_}SCRIPT Ian Jackson
2008-06-12 18:40 ` Anthony Liguori
2008-06-13 9:27 ` Ian Jackson
2008-06-13 11:24 ` Ian Jackson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.