* [Qemu-devel] [6242] Add "restrict" and "ip" option to "user" net option (Gleb Natapov)
@ 2009-01-08 19:26 Anthony Liguori
0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2009-01-08 19:26 UTC (permalink / raw)
To: qemu-devel
Revision: 6242
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6242
Author: aliguori
Date: 2009-01-08 19:26:22 +0000 (Thu, 08 Jan 2009)
Log Message:
-----------
Add "restrict" and "ip" option to "user" net option (Gleb Natapov)
Expose new slirp capabilities to user through a command line options.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Modified Paths:
--------------
trunk/net.c
Modified: trunk/net.c
===================================================================
--- trunk/net.c 2009-01-08 19:24:00 UTC (rev 6241)
+++ trunk/net.c 2009-01-08 19:26:22 UTC (rev 6242)
@@ -447,6 +447,8 @@
/* slirp network adapter */
static int slirp_inited;
+static int slirp_restrict;
+static char *slirp_ip;
static VLANClientState *slirp_vc;
int slirp_can_output(void)
@@ -483,7 +485,7 @@
{
if (!slirp_inited) {
slirp_inited = 1;
- slirp_init(0, NULL);
+ slirp_init(slirp_restrict, slirp_ip);
}
slirp_vc = qemu_new_vlan_client(vlan, model, name,
slirp_receive, NULL, NULL);
@@ -501,7 +503,7 @@
if (!slirp_inited) {
slirp_inited = 1;
- slirp_init(0, NULL);
+ slirp_init(slirp_restrict, slirp_ip);
}
p = redir_str;
@@ -587,7 +589,7 @@
if (!slirp_inited) {
slirp_inited = 1;
- slirp_init(0, NULL);
+ slirp_init(slirp_restrict, slirp_ip);
}
/* XXX: better tmp dir construction */
@@ -1554,6 +1556,12 @@
if (get_param_value(buf, sizeof(buf), "hostname", p)) {
pstrcpy(slirp_hostname, sizeof(slirp_hostname), buf);
}
+ if (get_param_value(buf, sizeof(buf), "restrict", p)) {
+ slirp_restrict = (buf[0] == 'y') ? 1 : 0;
+ }
+ if (get_param_value(buf, sizeof(buf), "ip", p)) {
+ slirp_ip = strdup(buf);
+ }
vlan->nb_host_devs++;
ret = net_slirp_init(vlan, device, name);
} else
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-01-08 19:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-08 19:26 [Qemu-devel] [6242] Add "restrict" and "ip" option to "user" net option (Gleb Natapov) Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).