ia64/xen-unstable

changeset 17234:14b2319d6126

stubdom: support save/restore by passing the -loadvm parameter,
letting the stubdomain access the save area, and having it watch the
correct xenstore node.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 18 11:27:36 2008 +0000 (2008-03-18)
parents 3d6d042144d7
children b543b4b759ba
files stubdom/README stubdom/stubdom-dm tools/ioemu/xenstore.c
line diff
     1.1 --- a/stubdom/README	Tue Mar 18 11:27:05 2008 +0000
     1.2 +++ b/stubdom/README	Tue Mar 18 11:27:36 2008 +0000
     1.3 @@ -78,6 +78,8 @@ To run
     1.4  
     1.5  mkdir -p /exports/usr/share/qemu
     1.6  ln -s /usr/share/qemu/keymaps /exports/usr/share/qemu
     1.7 +mkdir -p /exports/var/lib
     1.8 +ln -s /var/lib/xen /exports/var/lib
     1.9  /usr/sbin/fs-backend &
    1.10  
    1.11  xm create hvmconfig
     2.1 --- a/stubdom/stubdom-dm	Tue Mar 18 11:27:05 2008 +0000
     2.2 +++ b/stubdom/stubdom-dm	Tue Mar 18 11:27:36 2008 +0000
     2.3 @@ -14,18 +14,30 @@ domid=
     2.4  domname=
     2.5  vncviewer=0
     2.6  vncpid=
     2.7 +extra=
     2.8  while [ "$#" -gt 0 ];
     2.9  do
    2.10      if [ "$#" -ge 2 ];
    2.11      then
    2.12  	case "$1" in
    2.13 -	    -d) domid=$2; shift ;;
    2.14 -	    -domain-name) domname=$2; shift ;;
    2.15 +	    -d)
    2.16 +                domid=$2;
    2.17 +                extra="$extra -d $domid";
    2.18 +                shift
    2.19 +                ;;
    2.20 +	    -domain-name)
    2.21 +                domname=$2;
    2.22 +                shift
    2.23 +                ;;
    2.24  	    -vnc)
    2.25  		ip=${2%:*};
    2.26  		vnc_port=${2#*:};
    2.27  		shift
    2.28  		;;
    2.29 +            -loadvm)
    2.30 +                extra="$extra -loadvm $2";
    2.31 +                shift
    2.32 +                ;;
    2.33  	esac
    2.34      fi
    2.35      case "$1" in
    2.36 @@ -60,7 +72,7 @@ do
    2.37  	sleep 1
    2.38  done
    2.39  
    2.40 -creation="xm create -c stubdom-$domname target=$domid memory=32"
    2.41 +creation="xm create -c stubdom-$domname target=$domid memory=32 extra=\"$extra\""
    2.42  
    2.43  (while true ; do sleep 60 ; done) | $creation &
    2.44  #xterm -geometry +0+0 -e /bin/sh -c "$creation ; echo ; echo press ENTER to shut down ; read" &
     3.1 --- a/tools/ioemu/xenstore.c	Tue Mar 18 11:27:05 2008 +0000
     3.2 +++ b/tools/ioemu/xenstore.c	Tue Mar 18 11:27:36 2008 +0000
     3.3 @@ -81,7 +81,7 @@ static void waitForDevice(char *fn)
     3.4  
     3.5  #define DIRECT_PCI_STR_LEN 160
     3.6  char direct_pci_str[DIRECT_PCI_STR_LEN];
     3.7 -void xenstore_parse_domain_config(int domid)
     3.8 +void xenstore_parse_domain_config(int hvm_domid)
     3.9  {
    3.10      char **e = NULL;
    3.11      char *buf = NULL, *path;
    3.12 @@ -100,7 +100,7 @@ void xenstore_parse_domain_config(int do
    3.13          return;
    3.14      }
    3.15  
    3.16 -    path = xs_get_domain_path(xsh, domid);
    3.17 +    path = xs_get_domain_path(xsh, hvm_domid);
    3.18      if (path == NULL) {
    3.19          fprintf(logfile, "xs_get_domain_path() error\n");
    3.20          goto out;