summaryrefslogtreecommitdiff
path: root/slirp/slirp.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2009-06-24 14:42:28 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-29 08:52:44 -0500
commitad196a9d0c14f681f010bb4b979030ec125ba976 (patch)
tree0655e9af27aee23adec993cdb971a8b8294bd27e /slirp/slirp.c
parent5db4af8bc8eb99333b0d2be1f88c943353361e50 (diff)
downloadqemu-ad196a9d0c14f681f010bb4b979030ec125ba976.tar.gz
slirp: Move smb, redir, tftp and bootp parameters and -net channel
So far a couple of slirp-related parameters were expressed via stand-alone command line options. This it inconsistent and unintuitive. Moreover, it prevents both dynamically reconfigured (host_net_add/ delete) and multi-instance slirp. This patch refactors the configuration by turning -smb, -redir, -tftp and -bootp as well as -net channel into options of "-net user". The old stand-alone command line options are still processed, but no longer advertised. This allows smooth migration of management applications to to the new syntax and also the extension of that syntax later in this series. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'slirp/slirp.c')
-rw-r--r--slirp/slirp.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/slirp/slirp.c b/slirp/slirp.c
index b3db74223a..b0a092c14c 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -171,7 +171,8 @@ static void slirp_cleanup(void)
static void slirp_state_save(QEMUFile *f, void *opaque);
static int slirp_state_load(QEMUFile *f, void *opaque, int version_id);
-void slirp_init(int restricted, const char *special_ip)
+void slirp_init(int restricted, const char *special_ip, const char *tftp_path,
+ const char *bootfile)
{
// debug_init("/tmp/slirp.log", DEBUG_DEFAULT);
@@ -203,6 +204,17 @@ void slirp_init(int restricted, const char *special_ip)
if (special_ip)
slirp_special_ip = special_ip;
+ qemu_free(tftp_prefix);
+ tftp_prefix = NULL;
+ if (tftp_path) {
+ tftp_prefix = qemu_strdup(tftp_path);
+ }
+ qemu_free(bootp_filename);
+ bootp_filename = NULL;
+ if (bootfile) {
+ bootp_filename = qemu_strdup(bootfile);
+ }
+
inet_aton(slirp_special_ip, &special_addr);
alias_addr.s_addr = special_addr.s_addr | htonl(CTL_ALIAS);
getouraddr();