From ad196a9d0c14f681f010bb4b979030ec125ba976 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Wed, 24 Jun 2009 14:42:28 +0200 Subject: 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 Signed-off-by: Anthony Liguori --- slirp/slirp.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'slirp/slirp.c') diff --git a/slirp/slirp.c b/slirp/slirp.c index b3db742..b0a092c 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(); -- cgit v1.1