ia64/xen-unstable

changeset 19570:855e2f5ddb67

stubdom: drop lwip support

Network support is still provided the same way: using the tap
interface, created in qemu using netfront.
The lwip stack is still available to avoid additional compilation
issues.
However the stubdom is not going to have its own vif anymore,
this means that the only vnc server supported is the one in dom0.
You can still enable the vnc server in a stubdom at compile time, if
you want so.

Probably the most important change caused by this patch to xen users
is that you don't have to specify two vif in the stubdom config file
anymore, but just one:

-vif = [ '', 'ip=10.0.1.1,mac=aa:00:00:12:23:34']
+vif = ['ip=10.0.1.1,mac=aa:00:00:12:23:34']

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Apr 23 12:19:14 2009 +0100 (2009-04-23)
parents 4eef30c14a14
children 3ccd0f0dba5b
files extras/mini-os/lib/sys.c extras/mini-os/main.c extras/mini-os/netfront.c stubdom/README
line diff
     1.1 --- a/extras/mini-os/lib/sys.c	Thu Apr 23 10:11:33 2009 +0100
     1.2 +++ b/extras/mini-os/lib/sys.c	Thu Apr 23 12:19:14 2009 +0100
     1.3 @@ -677,7 +677,7 @@ static int select_poll(int nfds, fd_set 
     1.4  {
     1.5      int i, n = 0;
     1.6  #ifdef HAVE_LWIP
     1.7 -    int sock_n, sock_nfds = 0;
     1.8 +    int sock_n = 0, sock_nfds = 0;
     1.9      fd_set sock_readfds, sock_writefds, sock_exceptfds;
    1.10      struct timeval timeout = { .tv_sec = 0, .tv_usec = 0};
    1.11  #endif
    1.12 @@ -711,12 +711,14 @@ static int select_poll(int nfds, fd_set 
    1.13  	    }
    1.14  	}
    1.15      }
    1.16 -    DEBUG("lwip_select(");
    1.17 -    dump_set(nfds, &sock_readfds, &sock_writefds, &sock_exceptfds, &timeout);
    1.18 -    DEBUG("); -> ");
    1.19 -    sock_n = lwip_select(sock_nfds, &sock_readfds, &sock_writefds, &sock_exceptfds, &timeout);
    1.20 -    dump_set(nfds, &sock_readfds, &sock_writefds, &sock_exceptfds, &timeout);
    1.21 -    DEBUG("\n");
    1.22 +    if (sock_nfds > 0) {
    1.23 +        DEBUG("lwip_select(");
    1.24 +        dump_set(nfds, &sock_readfds, &sock_writefds, &sock_exceptfds, &timeout);
    1.25 +        DEBUG("); -> ");
    1.26 +        sock_n = lwip_select(sock_nfds, &sock_readfds, &sock_writefds, &sock_exceptfds, &timeout);
    1.27 +        dump_set(nfds, &sock_readfds, &sock_writefds, &sock_exceptfds, &timeout);
    1.28 +        DEBUG("\n");
    1.29 +    }
    1.30  #endif
    1.31  
    1.32      /* Then see others as well. */
     2.1 --- a/extras/mini-os/main.c	Thu Apr 23 10:11:33 2009 +0100
     2.2 +++ b/extras/mini-os/main.c	Thu Apr 23 12:19:14 2009 +0100
     2.3 @@ -62,7 +62,7 @@ static void call_main(void *p)
     2.4  
     2.5  #ifndef CONFIG_GRUB
     2.6      sparse((unsigned long) &__app_bss_start, &__app_bss_end - &__app_bss_start);
     2.7 -#ifdef HAVE_LWIP
     2.8 +#if defined(HAVE_LWIP) && !defined(CONFIG_QEMU)
     2.9      start_networking();
    2.10  #endif
    2.11      init_fs_frontend();
     3.1 --- a/extras/mini-os/netfront.c	Thu Apr 23 10:11:33 2009 +0100
     3.2 +++ b/extras/mini-os/netfront.c	Thu Apr 23 12:19:14 2009 +0100
     3.3 @@ -306,11 +306,16 @@ struct netfront_dev *init_netfront(char 
     3.4      int retry=0;
     3.5      int i;
     3.6      char* msg;
     3.7 -    char* nodename = _nodename ? _nodename : "device/vif/0";
     3.8 +    char nodename[256];
     3.9 +    char path[256];
    3.10 +    struct netfront_dev *dev;
    3.11 +    static int netfrontends = 0;
    3.12  
    3.13 -    struct netfront_dev *dev;
    3.14 -
    3.15 -    char path[strlen(nodename) + 1 + 10 + 1];
    3.16 +    if (!_nodename)
    3.17 +        snprintf(nodename, sizeof(nodename), "device/vif/%d", netfrontends);
    3.18 +    else
    3.19 +        strncpy(nodename, _nodename, strlen(nodename));
    3.20 +    netfrontends++;
    3.21  
    3.22      if (!thenetif_rx)
    3.23  	thenetif_rx = netif_rx;
     4.1 --- a/stubdom/README	Thu Apr 23 10:11:33 2009 +0100
     4.2 +++ b/stubdom/README	Thu Apr 23 12:19:14 2009 +0100
     4.3 @@ -31,11 +31,10 @@ Create /etc/xen/hvmconfig-dm (where "hvm
     4.4  guest) with
     4.5  
     4.6  kernel = "/usr/lib/xen/boot/ioemu-stubdom.gz"
     4.7 -vif = [ '', 'ip=10.0.1.1,mac=aa:00:00:12:23:34']
     4.8 +vif = ['ip=10.0.1.1,mac=aa:00:00:12:23:34']
     4.9  disk = [  'file:/tmp/install.iso,hdc:cdrom,r', 'phy:/dev/sda6,hda,w', 'file:/tmp/test,hdb,r' ]
    4.10  
    4.11  where
    4.12 -- the first vif ('') is reserved for VNC (see below)
    4.13  - 'ip=10.0.1.1,mac= etc...' is the same net configuration as in the hvmconfig
    4.14  script,
    4.15  - and disk = is the same block configuration as in the hvmconfig script.
    4.16 @@ -43,7 +42,7 @@ script,
    4.17  Display Configuration
    4.18  =====================
    4.19  
    4.20 -There are three posibilities
    4.21 +There are two possibilities
    4.22  
    4.23  * Using SDL
    4.24  
    4.25 @@ -61,18 +60,6 @@ vfb = [ 'type=sdl' ]
    4.26  
    4.27  vfb = [ 'type=sdl, opengl=0' ]
    4.28  
    4.29 -* Using a VNC server in the stub domain
    4.30 -
    4.31 -  - In hvmconfig, set vnclisten to "172.30.206.1" for instance.  Do not use a
    4.32 -host name as Mini-OS does not have a name resolver.  Do not use 127.0.0.1 since
    4.33 -then you will not be able to connect to it.
    4.34 -
    4.35 -vnc = 1
    4.36 -vnclisten = "172.30.206.1"
    4.37 -
    4.38 -  - In hvmconfig-dm, fill the reserved vif with the same IP, for instance:
    4.39 -
    4.40 -vif = [ 'ip=172.30.206.1', 'ip=10.0.1.1,mac=aa:00:00:12:23:34']
    4.41  
    4.42  * Using a VNC server in dom0
    4.43