slirp: Enable multiple instances

Once again this was a long journey to reach the destination: Allow to
instantiate slirp multiple times. But as in the past, the journey was
worthwhile, cleaning up, fixing and enhancing various parts of the user
space network stack along the way.

What is this particular change good for? Multiple slirps instances
allow separated user space networks for guests with multiple NICs. This
is already possible, but without any slirp support for the second
network, ie. without a chance to talk to that network from the host via
IP. We have a legacy guest system here that benefits from this slirp
enhancement, allowing us to run both of its NICs purely over
unprivileged user space IP stacks.

Another benefit of this patch is that it simply removes an artificial
restriction of the configuration space qemu is providing, avoiding
another source of surprises that users may face when playing with
possible setups.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Jan Kiszka 2009-06-24 14:42:31 +02:00 committed by Anthony Liguori
parent ad0d8c4c32
commit b1c99fcdf5
3 changed files with 37 additions and 27 deletions

View file

@ -185,6 +185,8 @@ int inet_aton _P((const char *cp, struct in_addr *ia));
#include "debug.h"
#include "sys-queue.h"
#include "libslirp.h"
#include "ip.h"
#include "tcp.h"
@ -207,6 +209,8 @@ int inet_aton _P((const char *cp, struct in_addr *ia));
#include "tftp.h"
struct Slirp {
TAILQ_ENTRY(Slirp) entry;
/* virtual network configuration */
struct in_addr vnetwork_addr;
struct in_addr vnetwork_mask;