diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2009-06-24 14:42:28 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-06-29 08:52:44 -0500 |
commit | ad196a9d0c14f681f010bb4b979030ec125ba976 (patch) | |
tree | 0655e9af27aee23adec993cdb971a8b8294bd27e /slirp | |
parent | 5db4af8bc8eb99333b0d2be1f88c943353361e50 (diff) | |
download | qemu-ad196a9d0c14f681f010bb4b979030ec125ba976.zip qemu-ad196a9d0c14f681f010bb4b979030ec125ba976.tar.gz qemu-ad196a9d0c14f681f010bb4b979030ec125ba976.tar.bz2 |
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')
-rw-r--r-- | slirp/bootp.c | 2 | ||||
-rw-r--r-- | slirp/libslirp.h | 5 | ||||
-rw-r--r-- | slirp/main.h | 2 | ||||
-rw-r--r-- | slirp/slirp.c | 14 | ||||
-rw-r--r-- | slirp/tftp.c | 2 |
5 files changed, 19 insertions, 6 deletions
diff --git a/slirp/bootp.c b/slirp/bootp.c index 4e0082d..a2fd734 100644 --- a/slirp/bootp.c +++ b/slirp/bootp.c @@ -38,7 +38,7 @@ typedef struct { static BOOTPClient bootp_clients[NB_ADDR]; -const char *bootp_filename; +char *bootp_filename; static const uint8_t rfc1533_cookie[] = { RFC1533_COOKIE }; diff --git a/slirp/libslirp.h b/slirp/libslirp.h index c04f3a2..7dee34b 100644 --- a/slirp/libslirp.h +++ b/slirp/libslirp.h @@ -5,7 +5,8 @@ extern "C" { #endif -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); void slirp_select_fill(int *pnfds, fd_set *readfds, fd_set *writefds, fd_set *xfds); @@ -24,9 +25,7 @@ int slirp_redir(int is_udp, int host_port, int slirp_add_exec(int do_pty, const void *args, int addr_low_byte, int guest_port); -extern const char *tftp_prefix; extern char slirp_hostname[33]; -extern const char *bootp_filename; void slirp_stats(void); void slirp_socket_recv(int addr_low_byte, int guest_port, const uint8_t *buf, diff --git a/slirp/main.h b/slirp/main.h index ed51385..89e722f 100644 --- a/slirp/main.h +++ b/slirp/main.h @@ -46,6 +46,8 @@ extern int tcp_keepintvl; extern uint8_t client_ethaddr[6]; extern const char *slirp_special_ip; extern int slirp_restrict; +extern char *tftp_prefix; +extern char *bootp_filename; #define PROTO_SLIP 0x1 #ifdef USE_PPP 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(); diff --git a/slirp/tftp.c b/slirp/tftp.c index 4ad5504..7cb095f 100644 --- a/slirp/tftp.c +++ b/slirp/tftp.c @@ -37,7 +37,7 @@ struct tftp_session { static struct tftp_session tftp_sessions[TFTP_SESSIONS_MAX]; -const char *tftp_prefix; +char *tftp_prefix; static void tftp_session_update(struct tftp_session *spt) { |