ia64/xen-unstable

changeset 7903:0dd531d4af46

Merged.
author emellor@leeni.uk.xensource.com
date Fri Nov 18 14:30:47 2005 +0100 (2005-11-18)
parents eb3ecf6abe87 ad2720178268
children 5c954929bb0d
files
line diff
     1.1 --- a/.hgignore	Fri Nov 18 14:28:38 2005 +0100
     1.2 +++ b/.hgignore	Fri Nov 18 14:30:47 2005 +0100
     1.3 @@ -171,6 +171,7 @@
     1.4  ^tools/xentrace/tbctl$
     1.5  ^tools/xentrace/xenctx$
     1.6  ^tools/xentrace/xentrace$
     1.7 +^tools/xm-test/ramdisk/buildroot
     1.8  ^xen/BLOG$
     1.9  ^xen/TAGS$
    1.10  ^xen/arch/x86/asm-offsets\.s$
     2.1 --- a/docs/man/xm.pod.1	Fri Nov 18 14:28:38 2005 +0100
     2.2 +++ b/docs/man/xm.pod.1	Fri Nov 18 14:30:47 2005 +0100
     2.3 @@ -626,12 +626,62 @@ event.
     2.4  
     2.5  =item B<block-attach> I<domain-id> I<be-dev> I<fe-dev> I<mode> I<[bedomain-id]>
     2.6  
     2.7 -Create a new virtual block device
     2.8 +Create a new virtual block device.  This will trigger a hotplug event
     2.9 +for the guest.
    2.10 +
    2.11 +B<OPTIONS>
    2.12 +
    2.13 +=over 4
    2.14 +
    2.15 +=item I<domain-id>
    2.16 +
    2.17 +The domain id of the guest domain that the device will be attached to.
    2.18 +
    2.19 +=item I<be-dev>
    2.20 +
    2.21 +The device in the backend domain (usually domain 0) to be exported.
    2.22 +This can be specified as a physical partition (phy:sda7) or as a file
    2.23 +mounted as loopback (file://path/to/loop.iso).
    2.24 +
    2.25 +=item I<fe-dev>
    2.26 +
    2.27 +How the device should be presented to the guest domain.  It can be
    2.28 +specified as either a symbolic name, such as /dev/hdc, for common
    2.29 +devices, or by device id, such as 0x1400 (/dev/hdc device id in hex).
    2.30 +
    2.31 +=item I<mode>
    2.32 +
    2.33 +The access mode for the device from the guest domain.  Supported modes
    2.34 +are I<rw> (read/write) or I<ro> (read-only).
    2.35 +
    2.36 +=item I<bedomain-id>
    2.37 +
    2.38 +The back end domain hosting the device.  This defaults to domain 0.
    2.39 +
    2.40 +=back
    2.41 +
    2.42 +B<EXAMPLES>
    2.43 +
    2.44 +=over 4
    2.45 +
    2.46 +=item I<Mount an ISO as a Disk>
    2.47 +
    2.48 +xm block-attach guestdomain file://path/to/dsl-2.0RC2.iso /dev/hdc ro
    2.49 +
    2.50 +This will mount the dsl iso as /dev/hdc in the guestdomain as a read
    2.51 +only device.  This will probably not be detected as a cdrom by the
    2.52 +guest, but mounting /dev/hdc manually will work.
    2.53 +
    2.54 +=back
    2.55  
    2.56  =item B<block-detach> I<domain-id> I<devid>
    2.57  
    2.58 -Destroy a domain's virtual block device. DevId may either be a device
    2.59 -ID or the device name as mounted in the guest.
    2.60 +Destroy a domain's virtual block device. devid B<must> be the device
    2.61 +id given to the device by domain 0.  You will need to run I<xm
    2.62 +block-list> to determine that number.
    2.63 +
    2.64 +FIXME: this is currently B<broken>.  Even though a block device is
    2.65 +removed from domU, it appears to still be allocated in the domain 0.
    2.66  
    2.67  =item B<block-list> I<domain-id>
    2.68  
    2.69 @@ -722,7 +772,7 @@ Delete a vnet.
    2.70  
    2.71  =head1 SEE ALSO
    2.72  
    2.73 -B<xmdomain.cfg>(5)
    2.74 +B<xmdomain.cfg>(5), B<xentop>(1)
    2.75  
    2.76  BVT scheduling paper: K.J. Duda and D.R. Cheriton. Borrowed Virtual
    2.77  Time (BVT) scheduling: supporting latency-sensitive threads in a
     3.1 --- a/docs/man/xmdomain.cfg.pod.5	Fri Nov 18 14:28:38 2005 +0100
     3.2 +++ b/docs/man/xmdomain.cfg.pod.5	Fri Nov 18 14:30:47 2005 +0100
     3.3 @@ -1,6 +1,6 @@
     3.4  =head1 NAME
     3.5  
     3.6 -xmdomain.cfg - xm domain create config file format
     3.7 +xmdomain.cfg - xm domain config file format
     3.8  
     3.9  =head1 SYNOPSIS
    3.10  
    3.11 @@ -10,17 +10,22 @@ xmdomain.cfg - xm domain create config f
    3.12  
    3.13  =head1 DESCRIPTION
    3.14  
    3.15 -The xm(1) program uses python executable config files to define
    3.16 +The B<xm>(1) program uses python executable config files to define
    3.17  domains to create from scratch.  Each of these config files needs to
    3.18  contain a number of required options, and may specify many more.
    3.19  
    3.20 -Domain configuration files live in /etc/xen by default, though the
    3.21 -full path to the config file must be specified in the I<xm create>
    3.22 -command, so they can exist anywhere in the filesystem.
    3.23 +Domain configuration files live in /etc/xen by default, if you store
    3.24 +config files anywhere else the full path to the config file must be
    3.25 +specified in the I<xm create> command.
    3.26  
    3.27 -/etc/xen/auto is a special case however, as domain config files in
    3.28 -that directory will be started automatically at system boot if the
    3.29 -xendomain init script is enabled.
    3.30 +/etc/xen/auto is a special case.  Domain config files in that
    3.31 +directory will be started automatically at system boot if the
    3.32 +xendomain init script is enabled.  The contents of /etc/xen/auto
    3.33 +should be symlinks to files in /etc/xen to allow I<xm create> to be
    3.34 +used without full paths.
    3.35 +
    3.36 +Options are specified by I<name = value> statements in the
    3.37 +xmdomain.cfg files.
    3.38  
    3.39  =head1 OPTIONS
    3.40  
    3.41 @@ -29,50 +34,157 @@ file.
    3.42  
    3.43  =over 4
    3.44  
    3.45 -=item I<kernel>
    3.46 +=item B<kernel>
    3.47  
    3.48 -The kernel image used in the domain.
    3.49 +The kernel image for the domain.  The format of the parameter is the
    3.50 +fully qualified path to the kernel image file,
    3.51 +i.e. I</boot/vmlinuz-2.6.12-xenU>.
    3.52  
    3.53 -=item I<ramdisk>
    3.54 +
    3.55 +=item B<ramdisk>
    3.56  
    3.57 -The initial ramdisk to be used in the domain.  Default xen domU
    3.58 -kernels do not usually need a ramdisk.
    3.59 +The initial ramdisk for the domain.  The format of the parameter is
    3.60 +the fully qualified path to the initrd, i.e. I</boot/initrd.gz>.  On
    3.61 +many Linux distros you will not need a ramdisk if using the default
    3.62 +xen kernel.
    3.63  
    3.64 -=item I<memory>
    3.65 +=item B<memory>
    3.66  
    3.67 -The amount of memory, in megabytes to allocate to the domain when it
    3.68 +The amount of RAM, in megabytes, to allocate to the domain when it
    3.69  starts.  Allocating insufficient memory for a domain may produce
    3.70 -extremely bizarre behavior.
    3.71 +extremely bizarre behavior.  If there isn't enough free memory left on
    3.72 +the machine to fulfill this request, the domain will fail to start.
    3.73 +
    3.74 +Xen does not support overcommit of memory, so the total memory of all
    3.75 +guests (+ 64 MB needed for Xen) must be less than or equal to the
    3.76 +physical RAM in the machine.
    3.77 +
    3.78 +=item B<name>
    3.79 +
    3.80 +A unique name for the domain.  Attempting to create two domains with
    3.81 +the same name will cause an error.
    3.82 +
    3.83 +=item B<root>
    3.84  
    3.85 -=item I<name>
    3.86 +Specifies the root device for the domain.  This is required for Linux
    3.87 +domains, and possibly other OSes.
    3.88 +
    3.89 +=item B<nics>
    3.90  
    3.91 -A unique name for the domain.  You can not create 2 domains with the
    3.92 -same name.
    3.93 +The number of network interfaces allocated to the domain on boot.  It
    3.94 +defaults to 1.
    3.95 +
    3.96 +=item B<disk>
    3.97 +
    3.98 +An array of block device stanzas, in the form:
    3.99 +
   3.100 +    disk = [ "stanza1", "stanza2", ... ]
   3.101  
   3.102 -=item I<root>
   3.103 +Each stanza has 3 terms, seperated by commas,
   3.104 +"backend-dev,frontend-dev,mode".
   3.105 +
   3.106 +=over 4
   3.107 +
   3.108 +=item I<backend-dev>
   3.109  
   3.110 -Root stanza for the domain (required for Linux domains).
   3.111 +The device in the backend domain that will be exported to the guest
   3.112 +(frontend) domain.  Supported formats include:
   3.113 +
   3.114 +I<phy:device> - export the physical device listed.  The device can be
   3.115 +in symbolic form, as in sda7, or as the hex major/minor number, as in
   3.116 +0x301 (which is hda1).
   3.117  
   3.118 -=item I<disk>
   3.119 +I<file://path/to/file> - export the file listed as a loopback device.
   3.120 +This will take care of the loopback setup before exporting the device.
   3.121 +
   3.122 +=item I<frontend-dev>
   3.123  
   3.124 -An array of disk stanzas 
   3.125 +How the device should appear in the guest domain.  The device can be
   3.126 +in symbolic form, as in sda7, or as the hex major/minor number, as in
   3.127 +0x301 (which is hda1).
   3.128 +
   3.129 +=item I<mode>
   3.130 +
   3.131 +The access mode for the device.  There are currently 2 valid options,
   3.132 +I<r> (read-only), I<w> (read/write).
   3.133  
   3.134  =back
   3.135  
   3.136 -A bare minimal config file example might be as follows:
   3.137 +=item B<vif>
   3.138 +
   3.139 +An arrray of virtual interface stanzas in the form:
   3.140 +
   3.141 +    vif = [ "stanza1", "stanza2", ... ]
   3.142 +
   3.143 +Each stanza specifies a set of I<name = value> options separated by
   3.144 +commas, in the form: "name1=value1, name2=value2, ..."
   3.145 +
   3.146 +B<OPTIONS>
   3.147 +
   3.148 +=over 4
   3.149  
   3.150 -    kernel = "/boot/vmlinuz-2.6-xenU"
   3.151 -    memory = 128
   3.152 -    name = "MyLinux"      
   3.153 -    root = "/dev/hda1 ro"
   3.154 +=item I<bridge>
   3.155 +
   3.156 +The network bridge to be used for this device.  This is especially
   3.157 +needed if multiple bridges exist on the machine.
   3.158 +
   3.159 +=item I<mac>
   3.160 +
   3.161 +The MAC address for the virtual interface.  If mac is not specified,
   3.162 +one will be randomly chosen by xen with the 00:16:3e vendor id prefix.
   3.163 +
   3.164 +=back
   3.165 +
   3.166 +=back
   3.167  
   3.168  =head1 ADDITIONAL OPTIONS
   3.169  
   3.170 +The following options are also supported in the config file, though
   3.171 +are far more rarely used.
   3.172 +
   3.173  =over 4
   3.174  
   3.175 -=item I<builder>
   3.176 +=item B<builder>
   3.177 +
   3.178 +Which builder should be used to construct the domain.  This defaults
   3.179 +to the I<linux> if not specified, which is the builder for
   3.180 +paravirtualized Linux domains.
   3.181 +
   3.182 +=item B<cpu>
   3.183 +
   3.184 +Specifies which CPU the domain should be started on, where 0 specifies
   3.185 +the first cpu, 1 the second, and so on.  This defaults to -1, which
   3.186 +means Xen is free to pick which CPU to start on.
   3.187 +
   3.188 +=item B<extra>
   3.189 +
   3.190 +Extra information to append to the end of the kernel parameter line.
   3.191 +The format is a string, the contents of which can be anything that the
   3.192 +kernel supports.  For instance:
   3.193 +
   3.194 +    extra = "4"
   3.195  
   3.196 -=back 
   3.197 +Will cause the domain to boot to runlevel 4.
   3.198 +
   3.199 +=item B<nfs_server>
   3.200 +
   3.201 +The IP address of the NFS server to use as the root device for the
   3.202 +domain.  In order to do this you'll need to specify I<root=/dev/nfs>,
   3.203 +and specify I<nfs_root>.
   3.204 +
   3.205 +=item B<nfs_root>
   3.206 +
   3.207 +The directory on the NFS server to be used as the root filesystem.
   3.208 +Specified as a fully qualified path, i.e. I</full/path/to/root/dir>.
   3.209 +
   3.210 +=item B<vcpus>
   3.211 +
   3.212 +The number of virtual cpus to allocate to the domain.  In order to use
   3.213 +this the xen kernel must be compiled with SMP support.
   3.214 +
   3.215 +This defaults to 1, meaning running the domain as a UP.
   3.216 +
   3.217 +=back
   3.218  
   3.219  =head1 DOMAIN SHUTDOWN OPTIONS
   3.220  
   3.221 @@ -81,17 +193,17 @@ unplanned) under certain events.  The 3 
   3.222  
   3.223  =over 4
   3.224  
   3.225 -=item I<shutdown>
   3.226 +=item B<on_shutdown>
   3.227  
   3.228  Triggered on either an I<xm shutdown> or graceful shutdown from inside
   3.229  the DomU.
   3.230  
   3.231 -=item I<reboot>
   3.232 +=item B<on_reboot>
   3.233  
   3.234  Triggered on either an I<xm reboot> or graceful reboot from inside the
   3.235  DomU.
   3.236  
   3.237 -=item I<crash>
   3.238 +=item B<on_crash>
   3.239  
   3.240  Triggered when a DomU goes to the crashed state for any reason.
   3.241  
   3.242 @@ -101,23 +213,23 @@ All of them take one of 4 valid states l
   3.243  
   3.244  =over 4
   3.245  
   3.246 -=item I<destroy>
   3.247 +=item B<destroy>
   3.248  
   3.249  The domain will be cleaned up completely.  No attempt at respawning
   3.250  will occur.  This is what a typical shutdown would look like.
   3.251  
   3.252 -=item I<restart>
   3.253 +=item B<restart>
   3.254  
   3.255  The domain will be restarted with the same name as the old domain.
   3.256  This is what a typical reboot would look like.
   3.257  
   3.258 -=item I<preserve>
   3.259 +=item B<preserve>
   3.260  
   3.261  The domain will not be cleaned up at all.  This is often useful for
   3.262  crash state domains which ensures that enough evidence is to debug the
   3.263  real issue.
   3.264  
   3.265 -=item I<rename-restart>
   3.266 +=item B<rename-restart>
   3.267  
   3.268  The old domain will not be cleaned up, but will be renamed so a new
   3.269  domain can be restarted in it's place.  The old domain will be renamed with
   3.270 @@ -127,6 +239,39 @@ it holds, so that the new one may take t
   3.271  
   3.272  =back
   3.273  
   3.274 +=head1 EXAMPLES
   3.275 +
   3.276 +The following are quick examples of ways that domains might be
   3.277 +configured.  They should not be considered an exhaustive set.
   3.278 +
   3.279 +=over 4
   3.280 +
   3.281 +=item I<A Loopback File as Root>
   3.282 +
   3.283 +    kernel = "/boot/vmlinuz-2.6-xenU"
   3.284 +    memory = 128
   3.285 +    name = "MyLinux"      
   3.286 +    root = "/dev/hda1 ro"
   3.287 +    disk = [ "file:/var/xen/mylinux.img,hda1,w" ]
   3.288 +
   3.289 +This creates a domain called MyLinux with 128 MB of memory using a
   3.290 +default xen kernel, and the file /var/xen/mylinux.img loopback mounted
   3.291 +at hda1, which is the root filesystem.
   3.292 +
   3.293 +=item I<NFS Root>
   3.294 +
   3.295 +FIXME: write me
   3.296 +
   3.297 +=item I<LVM Root>
   3.298 +
   3.299 +FIXME: write me
   3.300 +
   3.301 +=item I<Two Networks>
   3.302 +
   3.303 +FIXME: write me
   3.304 +
   3.305 +=back
   3.306 +
   3.307  =head1 SEE ALSO
   3.308  
   3.309  B<xm>(1)
     4.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Fri Nov 18 14:28:38 2005 +0100
     4.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Fri Nov 18 14:30:47 2005 +0100
     4.3 @@ -37,16 +37,10 @@
     4.4  #include <asm-xen/balloon.h>
     4.5  #include <asm-xen/xen-public/memory.h>
     4.6  #include <linux/module.h>
     4.7 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     4.8  #include <linux/percpu.h>
     4.9  #include <asm/tlbflush.h>
    4.10 -#endif
    4.11  
    4.12 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
    4.13 -#define pte_offset_kernel pte_offset
    4.14 -#define pud_t pgd_t
    4.15 -#define pud_offset(d, va) d
    4.16 -#elif defined(CONFIG_X86_64)
    4.17 +#ifdef CONFIG_X86_64
    4.18  #define pmd_val_ma(v) (v).pmd
    4.19  #else
    4.20  #ifdef CONFIG_X86_PAE
     5.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Fri Nov 18 14:28:38 2005 +0100
     5.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Fri Nov 18 14:30:47 2005 +0100
     5.3 @@ -121,11 +121,7 @@ static void init_evtchn_cpu_bindings(voi
     5.4  
     5.5  /* Upcall to generic IRQ layer. */
     5.6  #ifdef CONFIG_X86
     5.7 -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
     5.8  extern fastcall unsigned int do_IRQ(struct pt_regs *regs);
     5.9 -#else
    5.10 -extern asmlinkage unsigned int do_IRQ(struct pt_regs *regs);
    5.11 -#endif
    5.12  #if defined (__i386__)
    5.13  #define IRQ_REG orig_eax
    5.14  #elif defined (__x86_64__)
     6.1 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Fri Nov 18 14:28:38 2005 +0100
     6.2 +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Fri Nov 18 14:30:47 2005 +0100
     6.3 @@ -91,7 +91,6 @@ static void balloon_process(void *unused
     6.4  static DECLARE_WORK(balloon_worker, balloon_process, NULL);
     6.5  static struct timer_list balloon_timer;
     6.6  
     6.7 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     6.8  /* Use the private and mapping fields of struct page as a list. */
     6.9  #define PAGE_TO_LIST(p) ((struct list_head *)&p->private)
    6.10  #define LIST_TO_PAGE(l)				\
    6.11 @@ -102,19 +101,6 @@ static struct timer_list balloon_timer;
    6.12  		p->mapping = NULL;		\
    6.13  		p->private = 0;			\
    6.14  	} while(0)
    6.15 -#else
    6.16 -/* There's a dedicated list field in struct page we can use.    */
    6.17 -#define PAGE_TO_LIST(p) ( &p->list )
    6.18 -#define LIST_TO_PAGE(l) ( list_entry(l, struct page, list) )
    6.19 -#define UNLIST_PAGE(p)  ( list_del(&p->list) )
    6.20 -#define pte_offset_kernel pte_offset
    6.21 -#define pud_t pgd_t
    6.22 -#define pud_offset(d, va) d
    6.23 -#define pud_none(d) 0
    6.24 -#define pud_bad(d) 0
    6.25 -#define subsys_initcall(_fn) __initcall(_fn)
    6.26 -#define pfn_to_page(_pfn) (mem_map + (_pfn))
    6.27 -#endif
    6.28  
    6.29  #define IPRINTK(fmt, args...) \
    6.30  	printk(KERN_INFO "xen_mem: " fmt, ##args)
     7.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Fri Nov 18 14:28:38 2005 +0100
     7.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Fri Nov 18 14:30:47 2005 +0100
     7.3 @@ -57,6 +57,7 @@
     7.4  
     7.5  #define BLKIF_STATE_DISCONNECTED 0
     7.6  #define BLKIF_STATE_CONNECTED    1
     7.7 +#define BLKIF_STATE_SUSPENDED    2
     7.8  
     7.9  #define MAXIMUM_OUTSTANDING_BLOCK_REQS \
    7.10      (BLKIF_MAX_SEGMENTS_PER_REQUEST * BLKIF_RING_SIZE)
    7.11 @@ -75,7 +76,7 @@ static irqreturn_t blkif_int(int irq, vo
    7.12  static void blkif_restart_queue(void *arg);
    7.13  static void blkif_recover(struct blkfront_info *);
    7.14  static void blkif_completion(struct blk_shadow *);
    7.15 -static void blkif_free(struct blkfront_info *);
    7.16 +static void blkif_free(struct blkfront_info *, int);
    7.17  
    7.18  
    7.19  /**
    7.20 @@ -144,7 +145,7 @@ static int blkfront_resume(struct xenbus
    7.21  
    7.22  	DPRINTK("blkfront_resume: %s\n", dev->nodename);
    7.23  
    7.24 -	blkif_free(info);
    7.25 +	blkif_free(info, 1);
    7.26  
    7.27  	err = talk_to_backend(dev, info);
    7.28  	if (!err)
    7.29 @@ -207,7 +208,7 @@ again:
    7.30  	if (message)
    7.31  		xenbus_dev_fatal(dev, err, "%s", message);
    7.32   destroy_blkring:
    7.33 -	blkif_free(info);
    7.34 +	blkif_free(info, 0);
    7.35   out:
    7.36  	return err;
    7.37  }
    7.38 @@ -252,7 +253,7 @@ static int setup_blkring(struct xenbus_d
    7.39  
    7.40  	return 0;
    7.41  fail:
    7.42 -	blkif_free(info);
    7.43 +	blkif_free(info, 0);
    7.44  	return err;
    7.45  }
    7.46  
    7.47 @@ -295,7 +296,8 @@ static void connect(struct blkfront_info
    7.48  	unsigned int binfo;
    7.49  	int err;
    7.50  
    7.51 -        if (info->connected == BLKIF_STATE_CONNECTED)
    7.52 +        if( (info->connected == BLKIF_STATE_CONNECTED) || 
    7.53 +	    (info->connected == BLKIF_STATE_SUSPENDED) ) 
    7.54  		return;
    7.55  
    7.56  	DPRINTK("blkfront.c:connect:%s.\n", info->xbdev->otherend);
    7.57 @@ -354,7 +356,7 @@ static int blkfront_remove(struct xenbus
    7.58  
    7.59  	DPRINTK("blkfront_remove: %s removed\n", dev->nodename);
    7.60  
    7.61 -	blkif_free(info);
    7.62 +	blkif_free(info, 0);
    7.63  
    7.64  	kfree(info);
    7.65  
    7.66 @@ -569,6 +571,7 @@ void do_blkif_request(request_queue_t *r
    7.67  			req->nr_sectors, req->buffer,
    7.68  			rq_data_dir(req) ? "write" : "read");
    7.69  
    7.70 +
    7.71  		blkdev_dequeue_request(req);
    7.72  		if (blkif_queue_request(req)) {
    7.73  			blk_requeue_request(rq, req);
    7.74 @@ -643,11 +646,12 @@ static irqreturn_t blkif_int(int irq, vo
    7.75  	return IRQ_HANDLED;
    7.76  }
    7.77  
    7.78 -static void blkif_free(struct blkfront_info *info)
    7.79 +static void blkif_free(struct blkfront_info *info, int suspend)
    7.80  {
    7.81  	/* Prevent new requests being issued until we fix things up. */
    7.82  	spin_lock_irq(&blkif_io_lock);
    7.83 -	info->connected = BLKIF_STATE_DISCONNECTED;
    7.84 +	info->connected = suspend ? 
    7.85 +		BLKIF_STATE_SUSPENDED : BLKIF_STATE_DISCONNECTED; 
    7.86  	spin_unlock_irq(&blkif_io_lock);
    7.87  
    7.88  	/* Free resources associated with old device channel. */
     8.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c	Fri Nov 18 14:28:38 2005 +0100
     8.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c	Fri Nov 18 14:30:47 2005 +0100
     8.3 @@ -128,12 +128,7 @@ static spinlock_t xencons_lock = SPIN_LO
     8.4  /* Common transmit-kick routine. */
     8.5  static void __xencons_tx_flush(void);
     8.6  
     8.7 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     8.8  static struct tty_driver *xencons_driver;
     8.9 -#else
    8.10 -static struct tty_driver xencons_driver;
    8.11 -#endif
    8.12 -
    8.13  
    8.14  /******************** Kernel console driver ********************************/
    8.15  
    8.16 @@ -170,18 +165,11 @@ static void kcons_write_dom0(
    8.17  	}
    8.18  }
    8.19  
    8.20 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    8.21  static struct tty_driver *kcons_device(struct console *c, int *index)
    8.22  {
    8.23  	*index = c->index;
    8.24  	return xencons_driver;
    8.25  }
    8.26 -#else
    8.27 -static kdev_t kcons_device(struct console *c)
    8.28 -{
    8.29 -	return MKDEV(TTY_MAJOR, (xc_mode == XC_SERIAL) ? 64 : 1);
    8.30 -}
    8.31 -#endif
    8.32  
    8.33  static struct console kcons_info = {
    8.34  	.device	= kcons_device,
    8.35 @@ -189,13 +177,8 @@ static struct console kcons_info = {
    8.36  	.index	= -1,
    8.37  };
    8.38  
    8.39 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    8.40  #define __RETCODE 0
    8.41  static int __init xen_console_init(void)
    8.42 -#else
    8.43 -#define __RETCODE
    8.44 -void xen_console_init(void)
    8.45 -#endif
    8.46  {
    8.47  	if (xen_init() < 0)
    8.48  		return __RETCODE;
    8.49 @@ -204,10 +187,8 @@ void xen_console_init(void)
    8.50  		if (xc_mode == XC_DEFAULT)
    8.51  			xc_mode = XC_SERIAL;
    8.52  		kcons_info.write = kcons_write_dom0;
    8.53 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    8.54  		if (xc_mode == XC_SERIAL)
    8.55  			kcons_info.flags |= CON_ENABLED;
    8.56 -#endif
    8.57  	} else {
    8.58  		if (xc_mode == XC_DEFAULT)
    8.59  			xc_mode = XC_TTY;
    8.60 @@ -237,9 +218,7 @@ void xen_console_init(void)
    8.61  
    8.62  	return __RETCODE;
    8.63  }
    8.64 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    8.65  console_initcall(xen_console_init);
    8.66 -#endif
    8.67  
    8.68  /*** Useful function for console debugging -- goes straight to Xen. ***/
    8.69  asmlinkage int xprintk(const char *fmt, ...)
    8.70 @@ -283,15 +262,8 @@ void xencons_force_flush(void)
    8.71  
    8.72  /******************** User-space console driver (/dev/console) ************/
    8.73  
    8.74 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    8.75  #define DRV(_d)         (_d)
    8.76  #define TTY_INDEX(_tty) ((_tty)->index)
    8.77 -#else
    8.78 -static int xencons_refcount;
    8.79 -static struct tty_struct *xencons_table[MAX_NR_CONSOLES];
    8.80 -#define DRV(_d)         (&(_d))
    8.81 -#define TTY_INDEX(_tty) (MINOR((_tty)->device) - xencons_driver.minor_start)
    8.82 -#endif
    8.83  
    8.84  static struct termios *xencons_termios[MAX_NR_CONSOLES];
    8.85  static struct termios *xencons_termios_locked[MAX_NR_CONSOLES];
    8.86 @@ -484,7 +456,6 @@ static inline int __xencons_put_char(int
    8.87  	return 1;
    8.88  }
    8.89  
    8.90 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    8.91  static int xencons_write(
    8.92  	struct tty_struct *tty,
    8.93  	const unsigned char *buf,
    8.94 @@ -509,42 +480,6 @@ static int xencons_write(
    8.95  
    8.96  	return i;
    8.97  }
    8.98 -#else
    8.99 -static int xencons_write(
   8.100 -	struct tty_struct *tty, 
   8.101 -	int from_user,
   8.102 -	const u_char *buf, 
   8.103 -	int count)
   8.104 -{
   8.105 -	int i;
   8.106 -	unsigned long flags;
   8.107 -
   8.108 -	if (from_user && verify_area(VERIFY_READ, buf, count))
   8.109 -		return -EINVAL;
   8.110 -
   8.111 -	if (TTY_INDEX(tty) != 0)
   8.112 -		return count;
   8.113 -
   8.114 -	spin_lock_irqsave(&xencons_lock, flags);
   8.115 -
   8.116 -	for (i = 0; i < count; i++) {
   8.117 -		char ch;
   8.118 -		if (from_user)
   8.119 -			__get_user(ch, buf + i);
   8.120 -		else
   8.121 -			ch = buf[i];
   8.122 -		if (!__xencons_put_char(ch))
   8.123 -			break;
   8.124 -	}
   8.125 -
   8.126 -	if (i != 0)
   8.127 -		__xencons_tx_flush();
   8.128 -
   8.129 -	spin_unlock_irqrestore(&xencons_lock, flags);
   8.130 -
   8.131 -	return i;
   8.132 -}
   8.133 -#endif
   8.134  
   8.135  static void xencons_put_char(struct tty_struct *tty, u_char ch)
   8.136  {
   8.137 @@ -629,7 +564,6 @@ static void xencons_close(struct tty_str
   8.138  	}
   8.139  }
   8.140  
   8.141 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
   8.142  static struct tty_operations xencons_ops = {
   8.143  	.open = xencons_open,
   8.144  	.close = xencons_close,
   8.145 @@ -685,7 +619,6 @@ const struct consw xennull_con = {
   8.146  	.con_scrolldelta =	DUMMY,
   8.147  };
   8.148  #endif
   8.149 -#endif
   8.150  
   8.151  static int __init xencons_init(void)
   8.152  {
   8.153 @@ -699,19 +632,10 @@ static int __init xencons_init(void)
   8.154  
   8.155  	xencons_ring_init();
   8.156  
   8.157 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
   8.158  	xencons_driver = alloc_tty_driver((xc_mode == XC_SERIAL) ? 
   8.159  					  1 : MAX_NR_CONSOLES);
   8.160  	if (xencons_driver == NULL)
   8.161  		return -ENOMEM;
   8.162 -#else
   8.163 -	memset(&xencons_driver, 0, sizeof(struct tty_driver));
   8.164 -	xencons_driver.magic       = TTY_DRIVER_MAGIC;
   8.165 -	xencons_driver.refcount    = &xencons_refcount;
   8.166 -	xencons_driver.table       = xencons_table;
   8.167 -	xencons_driver.num         =
   8.168 -		(xc_mode == XC_SERIAL) ? 1 : MAX_NR_CONSOLES;
   8.169 -#endif
   8.170  
   8.171  	DRV(xencons_driver)->major           = TTY_MAJOR;
   8.172  	DRV(xencons_driver)->type            = TTY_DRIVER_TYPE_SERIAL;
   8.173 @@ -735,37 +659,18 @@ static int __init xencons_init(void)
   8.174  		DRV(xencons_driver)->name_base   = xc_num;
   8.175  	}
   8.176  
   8.177 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
   8.178  	tty_set_operations(xencons_driver, &xencons_ops);
   8.179 -#else
   8.180 -	xencons_driver.open            = xencons_open;
   8.181 -	xencons_driver.close           = xencons_close;
   8.182 -	xencons_driver.write           = xencons_write;
   8.183 -	xencons_driver.write_room      = xencons_write_room;
   8.184 -	xencons_driver.put_char        = xencons_put_char;
   8.185 -	xencons_driver.flush_chars     = xencons_flush_chars;
   8.186 -	xencons_driver.chars_in_buffer = xencons_chars_in_buffer;
   8.187 -	xencons_driver.send_xchar      = xencons_send_xchar;
   8.188 -	xencons_driver.flush_buffer    = xencons_flush_buffer;
   8.189 -	xencons_driver.throttle        = xencons_throttle;
   8.190 -	xencons_driver.unthrottle      = xencons_unthrottle;
   8.191 -	xencons_driver.wait_until_sent = xencons_wait_until_sent;
   8.192 -#endif
   8.193  
   8.194  	if ((rc = tty_register_driver(DRV(xencons_driver))) != 0) {
   8.195  		printk("WARNING: Failed to register Xen virtual "
   8.196  		       "console driver as '%s%d'\n",
   8.197  		       DRV(xencons_driver)->name, DRV(xencons_driver)->name_base);
   8.198 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
   8.199  		put_tty_driver(xencons_driver);
   8.200  		xencons_driver = NULL;
   8.201 -#endif
   8.202  		return rc;
   8.203  	}
   8.204  
   8.205 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
   8.206  	tty_register_device(xencons_driver, 0, NULL);
   8.207 -#endif
   8.208  
   8.209  	if (xen_start_info->flags & SIF_INITDOMAIN) {
   8.210  		xencons_priv_irq = bind_virq_to_irqhandler(
     9.1 --- a/linux-2.6-xen-sparse/drivers/xen/evtchn/evtchn.c	Fri Nov 18 14:28:38 2005 +0100
     9.2 +++ b/linux-2.6-xen-sparse/drivers/xen/evtchn/evtchn.c	Fri Nov 18 14:30:47 2005 +0100
     9.3 @@ -436,9 +436,7 @@ static struct miscdevice evtchn_miscdev 
     9.4  	.minor        = EVTCHN_MINOR,
     9.5  	.name         = "evtchn",
     9.6  	.fops         = &evtchn_fops,
     9.7 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     9.8  	.devfs_name   = "misc/evtchn",
     9.9 -#endif
    9.10  };
    9.11  
    9.12  static int __init evtchn_init(void)
    10.1 --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Fri Nov 18 14:28:38 2005 +0100
    10.2 +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Fri Nov 18 14:30:47 2005 +0100
    10.3 @@ -32,11 +32,6 @@
    10.4  #include <asm-xen/xen-public/dom0_ops.h>
    10.5  #include <asm-xen/xen_proc.h>
    10.6  
    10.7 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
    10.8 -#define pud_t pgd_t
    10.9 -#define pud_offset(d, va) d
   10.10 -#endif
   10.11 -
   10.12  static struct proc_dir_entry *privcmd_intf;
   10.13  
   10.14  static int privcmd_ioctl(struct inode *inode, struct file *file,
    11.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypervisor.h	Fri Nov 18 14:28:38 2005 +0100
    11.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypervisor.h	Fri Nov 18 14:30:47 2005 +0100
    11.3 @@ -39,15 +39,11 @@
    11.4  #include <asm/ptrace.h>
    11.5  #include <asm/page.h>
    11.6  #if defined(__i386__)
    11.7 -# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    11.8  #  ifdef CONFIG_X86_PAE
    11.9  #   include <asm-generic/pgtable-nopud.h>
   11.10  #  else
   11.11  #   include <asm-generic/pgtable-nopmd.h>
   11.12  #  endif
   11.13 -# else
   11.14 -#  define pud_t pgd_t
   11.15 -# endif
   11.16  #endif
   11.17  
   11.18  extern shared_info_t *HYPERVISOR_shared_info;
   11.19 @@ -113,22 +109,6 @@ void xen_tlb_flush_mask(cpumask_t *mask)
   11.20  void xen_invlpg_mask(cpumask_t *mask, unsigned long ptr);
   11.21  #endif
   11.22  
   11.23 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
   11.24 -/* 
   11.25 -** XXX SMH: 2.4 doesn't have percpu.h (or support SMP guests) so just 
   11.26 -** include sufficient #defines to allow the below to build. 
   11.27 -*/
   11.28 -#define DEFINE_PER_CPU(type, name) \
   11.29 -    __typeof__(type) per_cpu__##name
   11.30 -
   11.31 -#define per_cpu(var, cpu)           (*((void)cpu, &per_cpu__##var))
   11.32 -#define __get_cpu_var(var)          per_cpu__##var
   11.33 -#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
   11.34 -
   11.35 -#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
   11.36 -#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
   11.37 -#endif /* linux < 2.6.0 */
   11.38 -
   11.39  /* Returns zero on success else negative errno. */
   11.40  int xen_create_contiguous_region(
   11.41      unsigned long vstart, unsigned int order, unsigned int address_bits);
    12.1 --- a/tools/ioemu/vl.c	Fri Nov 18 14:28:38 2005 +0100
    12.2 +++ b/tools/ioemu/vl.c	Fri Nov 18 14:30:47 2005 +0100
    12.3 @@ -137,7 +137,7 @@ int adlib_enabled = 1;
    12.4  int gus_enabled = 1;
    12.5  int pci_enabled = 1;
    12.6  int prep_enabled = 0;
    12.7 -int rtc_utc = 1;
    12.8 +int rtc_utc = 0;
    12.9  int cirrus_vga_enabled = 1;
   12.10  int vga_accelerate = 1;
   12.11  int graphic_width = 800;
    13.1 --- a/tools/libxc/xc_linux_save.c	Fri Nov 18 14:28:38 2005 +0100
    13.2 +++ b/tools/libxc/xc_linux_save.c	Fri Nov 18 14:30:47 2005 +0100
    13.3 @@ -729,6 +729,11 @@ int xc_linux_save(int xc_handle, int io_
    13.4  
    13.5      /* Domain is still running at this point */
    13.6  
    13.7 +    if (live && (pt_levels != 2)) {
    13.8 +        ERR("Live migration supported only for 32-bit non-pae");
    13.9 +        goto out;
   13.10 +    }
   13.11 +
   13.12      if (live) {
   13.13  
   13.14          if (xc_shadow_control(xc_handle, dom, 
    14.1 --- a/tools/python/xen/xm/main.py	Fri Nov 18 14:28:38 2005 +0100
    14.2 +++ b/tools/python/xen/xm/main.py	Fri Nov 18 14:30:47 2005 +0100
    14.3 @@ -40,26 +40,81 @@ from xen.xm.opts import *
    14.4  
    14.5  import console
    14.6  
    14.7 +# Strings for shorthelp
    14.8 +console_help = "console <DomId>                  Attach to domain DomId's console."
    14.9 +create_help =  """create [-c] <ConfigFile>
   14.10 +               [Name=Value]..       Create a domain based on Config File"""
   14.11 +destroy_help = "destroy <DomId>                  Terminate a domain immediately"
   14.12 +help_help =    "help                             Display this message"
   14.13 +list_help =    "list [--long] [DomId, ...]       List information about domains"
   14.14 +mem_max_help = "mem-max <DomId> <Mem>            Set maximum memory reservation for a domain"
   14.15 +mem_set_help = "mem-set <DomId> <Mem>            Adjust the current memory usage for a domain"
   14.16 +migrate_help = "migrate <DomId> <Host>           Migrate a domain to another machine"
   14.17 +pause_help =   "pause <DomId>                    Pause execution of a domain"
   14.18 +reboot_help =  "reboot <DomId> [-w][-a]          Reboot a domain"
   14.19 +restore_help = "restore <File>                   Create a domain from a saved state file"
   14.20 +save_help =    "save <DomId> <File>              Save domain state (and config) to file"
   14.21 +shutdown_help ="shutdown <DomId> [-w][-a][-R|-H] Shutdown a domain"
   14.22 +top_help =     "top                              Monitor system and domains in real-time"
   14.23 +unpause_help = "unpause <DomId>                  Unpause a paused domain"
   14.24 +
   14.25 +help_spacer = """
   14.26 +   """
   14.27 +
   14.28 +# Strings for longhelp
   14.29 +sysrq_help =   "sysrq   <DomId> <letter>         Send a sysrq to a domain"
   14.30 +domid_help =   "domid <DomName>                  Converts a domain name to a domain id"
   14.31 +domname_help = "domname <DomId>                  Convert a domain id to a domain name"
   14.32 +set_vcpus_help = """set-vcpus <DomId> <VCPUs>        Enable the specified number of VCPUs in a
   14.33 +                                    domain"""
   14.34 +vcpu_list_help = "vcpu-list <DomId>                List the VCPUs for a domain (or all domains)"
   14.35 +vcpu_pin_help = "vcpu-pin <DomId> <VCPU> <CPUs>   Set which cpus a VCPU can use" 
   14.36 +dmesg_help =   "dmesg [--clear]                  Read or clear Xen's message buffer"
   14.37 +info_help =    "info                             Get information about the xen host"
   14.38 +log_help = "log      Print the xend log"
   14.39 +sched_bvt_help = """sched-bvt <Parameters>           Set Borrowed Virtual Time scheduler
   14.40 +                                    parameters"""
   14.41 +sched_bvt_ctxallow_help = """sched-bvt-ctxallow <Allow>       Set the BVT scheduler context switch
   14.42 +                                    allowance"""
   14.43 +sched_sedf_help = "sched-sedf <Parameters>          Set simple EDF parameters"
   14.44 +block_attach_help = """block-attach <DomId> <BackDev> <FrontDev> <Mode>
   14.45 +                [BackDomId]         Create a new virtual block device"""
   14.46 +block_detach_help = """block-detach  <DomId> <DevId>    Destroy a domain's virtual block device,
   14.47 +                                    where <DevId> may either be the device ID
   14.48 +                                    or the device name as mounted in the guest"""
   14.49 +
   14.50 +block_list_help = "block-list <DomId>               List virtual block devices for a domain"
   14.51 +network_attach_help = """network-attach  <DomID> [script=<script>] [ip=<ip>] [mac=<mac>]
   14.52 +                           [bridge=<bridge>] [backend=<backDomID>]
   14.53 +                                    Create a new virtual network device """
   14.54 +network_detach_help = """network-detach  <DomId> <DevId>  Destroy a domain's virtual network
   14.55 +                                    device, where <DevId> is the device ID."""
   14.56 +
   14.57 +network_list_help = "network-list <DomId>             List virtual network interfaces for a domain"
   14.58 +vnet_list_help = "vnet-list [-l|--long]            list vnets"
   14.59 +vnet_create_help = "vnet-create <config>             create a vnet from a config file"
   14.60 +vnet_delete_help = "vnet-delete <vnetid>             delete a vnet"
   14.61 +
   14.62  
   14.63  shorthelp = """Usage: xm <subcommand> [args]
   14.64      Control, list, and manipulate Xen guest instances
   14.65  
   14.66 -xm common subcommands:
   14.67 -    console <DomId>         attach to console of DomId
   14.68 -    create <CfgFile>        create a domain based on Config File
   14.69 -    destroy <DomId>         terminate a domain immediately
   14.70 -    help                    display this message
   14.71 -    list [DomId, ...]       list information about domains
   14.72 -    mem-max <DomId> <Mem>   set the maximum memory reservation for a domain
   14.73 -    mem-set <DomId> <Mem>   adjust the current memory usage for a domain
   14.74 -    migrate <DomId> <Host>  migrate a domain to another machine
   14.75 -    pause <DomId>           pause execution of a domain
   14.76 -    reboot <DomId>          reboot a domain
   14.77 -    restore <File>          create a domain from a saved state file
   14.78 -    save <DomId> <File>     save domain state (and config) to file
   14.79 -    shutdown <DomId>        shutdown a domain
   14.80 -    top                     monitor system and domains in real-time
   14.81 -    unpause <DomId>         unpause a paused domain
   14.82 +xm common subcommands:"""  + help_spacer \
   14.83 ++ console_help + help_spacer \
   14.84 ++ create_help + help_spacer \
   14.85 ++ destroy_help + help_spacer \
   14.86 ++ help_help    + help_spacer \
   14.87 ++ list_help    + help_spacer \
   14.88 ++ mem_max_help + help_spacer \
   14.89 ++ mem_set_help + help_spacer \
   14.90 ++ migrate_help + help_spacer \
   14.91 ++ pause_help   + help_spacer \
   14.92 ++ reboot_help  + help_spacer \
   14.93 ++ restore_help + help_spacer \
   14.94 ++ save_help    + help_spacer \
   14.95 ++ shutdown_help + help_spacer \
   14.96 ++ top_help     + help_spacer \
   14.97 ++ unpause_help + """
   14.98  
   14.99  <DomName> can be substituted for <DomId> in xm subcommands.
  14.100  
  14.101 @@ -72,58 +127,51 @@ longhelp = """Usage: xm <subcommand> [ar
  14.102  
  14.103  xm full list of subcommands:
  14.104  
  14.105 -  Domain Commands:
  14.106 -    console <DomId>           attach to console of DomId
  14.107 -    create  <ConfigFile>      create a domain
  14.108 -    destroy <DomId>           terminate a domain immediately
  14.109 -    domid   <DomName>         convert a domain name to a domain id
  14.110 -    domname <DomId>           convert a domain id to a domain name
  14.111 -    list                      list information about domains
  14.112 -    mem-max <DomId> <Mem>     set domain maximum memory limit
  14.113 -    mem-set <DomId> <Mem>     set the domain's memory dynamically
  14.114 -    migrate <DomId> <Host>    migrate a domain to another machine
  14.115 -    pause   <DomId>           pause execution of a domain
  14.116 -    reboot   [-w|-a] <DomId>  reboot a domain
  14.117 -    restore <File>            create a domain from a saved state file
  14.118 -    save    <DomId> <File>    save domain state (and config) to file
  14.119 -    shutdown [-w|-a] <DomId>  shutdown a domain
  14.120 -    sysrq   <DomId> <letter>  send a sysrq to a domain
  14.121 -    unpause <DomId>           unpause a paused domain
  14.122 -    set-vcpus <DomId> <VCPUs> enable the specified number of VCPUs in a domain
  14.123 -    vcpu-list <DomId>         list the VCPUs for a domain
  14.124 -    vcpu-pin <DomId> <VCPU> <CPUs>    set which cpus a VCPU can use. 
  14.125 +  Domain Commands: """ + help_spacer \
  14.126 ++ console_help + help_spacer \
  14.127 ++ create_help + help_spacer \
  14.128 ++ destroy_help + help_spacer \
  14.129 ++ domid_help   + help_spacer \
  14.130 ++ domname_help   + help_spacer \
  14.131 ++ list_help    + help_spacer \
  14.132 ++ mem_max_help + help_spacer \
  14.133 ++ mem_set_help + help_spacer \
  14.134 ++ migrate_help + help_spacer \
  14.135 ++ pause_help   + help_spacer \
  14.136 ++ reboot_help  + help_spacer \
  14.137 ++ restore_help + help_spacer \
  14.138 ++ save_help    + help_spacer \
  14.139 ++ shutdown_help + help_spacer \
  14.140 ++ sysrq_help + help_spacer \
  14.141 ++ top_help     + help_spacer \
  14.142 ++ unpause_help + help_spacer \
  14.143 ++ set_vcpus_help + help_spacer \
  14.144 ++ vcpu_pin_help + """
  14.145  
  14.146 -  Xen Host Commands:
  14.147 -    dmesg   [--clear]         read or clear Xen's message buffer
  14.148 -    info                      get information about the xen host
  14.149 -    log                       print the xend log
  14.150 -    top                       monitor system and domains in real-time
  14.151 +   Xen Host Commands: """ + help_spacer \
  14.152 ++ dmesg_help + help_spacer \
  14.153 ++ info_help + help_spacer \
  14.154 ++ log_help  + help_spacer \
  14.155 ++ top_help  + """
  14.156  
  14.157 -  Scheduler Commands:
  14.158 -    sched-bvt <options>       set BVT scheduler parameters
  14.159 -    sched-bvt-ctxallow <Allow>
  14.160 -        Set the BVT scheduler context switch allowance
  14.161 -    sched-sedf <options>      set simple EDF parameters
  14.162 +  Scheduler Commands: """ + help_spacer \
  14.163 ++ sched_bvt_help + help_spacer \
  14.164 ++ sched_bvt_ctxallow_help + help_spacer \
  14.165 ++ sched_sedf_help + """
  14.166  
  14.167 -  Virtual Device Commands:
  14.168 -    block-attach  <DomId> <BackDev> <FrontDev> <Mode> [BackDomId]
  14.169 -        Create a new virtual block device 
  14.170 -    block-detach  <DomId> <DevId>  Destroy a domain's virtual block device,
  14.171 -                                   where <DevId> may either be the device ID
  14.172 -                                   or the device name as mounted in the guest.
  14.173 -    block-list    <DomId>          List virtual block devices for a domain
  14.174 +  Virtual Device Commands:"""  + help_spacer \
  14.175 ++ block_attach_help + help_spacer \
  14.176 ++ block_detach_help + help_spacer \
  14.177 ++ block_list_help + help_spacer \
  14.178 ++ network_attach_help + help_spacer \
  14.179 ++ network_detach_help + help_spacer \
  14.180 ++ network_limit_help + help_spacer \
  14.181 ++ network_list_help + """
  14.182  
  14.183 -    network-attach  <DomID> [script=<script>] [ip=<ip>] [mac=<mac>]
  14.184 -                            [bridge=<bridge>] [backend=<backDomID>]
  14.185 -        Create a new virtual network device 
  14.186 -    network-detach  <DomId> <DevId>  Destroy a domain's virtual network
  14.187 -                                     device, where <DevId> is the device ID.
  14.188 -    network-list    <DomId>        List virtual network interfaces for a domain
  14.189 -
  14.190 -  Vnet commands:
  14.191 -    vnet-list   [-l|--long]    list vnets
  14.192 -    vnet-create <config>       create a vnet from a config file
  14.193 -    vnet-delete <vnetid>       delete a vnet
  14.194 +  Vnet commands: """ + help_spacer \
  14.195 ++ vnet_list_help + help_spacer \
  14.196 ++ vnet_create_help + help_spacer \
  14.197 ++ vnet_delete_help + """
  14.198  
  14.199  <DomName> can be substituted for <DomId> in xm subcommands.
  14.200  
  14.201 @@ -131,6 +179,51 @@ For a short list of subcommands run 'xm 
  14.202  For more help on xm see the xm(1) man page
  14.203  For more help on xm create, see the xmdomain.cfg(5) man page"""
  14.204  
  14.205 +# array for xm help <command>
  14.206 +help = {
  14.207 +    "--long": longhelp,
  14.208 +    "console": console_help,
  14.209 +    "create": create_help,
  14.210 +    "destroy": destroy_help,
  14.211 +    "domid ": domid_help,
  14.212 +    "domname": domname_help,
  14.213 +    "list": list_help,
  14.214 +    "mem-max": mem_max_help,
  14.215 +    "mem-set": mem_set_help,
  14.216 +    "migrate": migrate_help,
  14.217 +    "pause": pause_help,
  14.218 +    "reboot": reboot_help,
  14.219 +    "restore": restore_help,
  14.220 +    "save":  save_help,
  14.221 +    "shutdown": shutdown_help,
  14.222 +    "sysrq": sysrq_help,
  14.223 +    "unpause": unpause_help,
  14.224 +    "set-vcpus": set_vcpus_help,
  14.225 +    "vcpu-list": vcpu_list_help,
  14.226 +    "vcpu-pin": vcpu_pin_help,
  14.227 +#  Xen Host Commands:
  14.228 +    "dmesg": dmesg_help,
  14.229 +    "info":  info_help,
  14.230 +    "log":   log_help,
  14.231 +    "top":  top_help,
  14.232 +#  Scheduler Commands:
  14.233 +    "sched-bvt": sched_bvt_help,
  14.234 +    "sched-bvt-ctxallow": sched_bvt_ctxallow_help,
  14.235 +    "sched-sedf":  sched_sedf_help,
  14.236 +
  14.237 +#  Virtual Device Commands:
  14.238 +    "block-attach": block_attach_help,
  14.239 +    "block-detach": block_detach_help,
  14.240 +    "block-list": block_list_help,
  14.241 +    "network-attach": network_attach_help,
  14.242 +    "network-detach": network_detach_help,
  14.243 +    "network-list":  network_list_help,
  14.244 +# Vnet commands:
  14.245 +    "vnet-list": vnet_list_help,
  14.246 +    "vnet-create": vnet_create_help,
  14.247 +    "vnet-delete": vnet_delete_help
  14.248 +   }
  14.249 +
  14.250  ####################################################################
  14.251  #
  14.252  #  Utility functions
  14.253 @@ -734,10 +827,6 @@ aliases = {
  14.254      "vbd-list": "block-list",
  14.255      }
  14.256  
  14.257 -help = {
  14.258 -    "--long": longhelp
  14.259 -   }
  14.260 -
  14.261  
  14.262  def xm_lookup_cmd(cmd):
  14.263      if commands.has_key(cmd):
  14.264 @@ -759,7 +848,7 @@ def deprecated(old,new):
  14.265  
  14.266  def usage(cmd=None):
  14.267      if help.has_key(cmd):
  14.268 -        print help[cmd]
  14.269 +        print "   " + help[cmd]
  14.270      else:
  14.271          print shorthelp
  14.272      sys.exit(1)
    15.1 --- a/tools/xm-test/Makefile.am	Fri Nov 18 14:28:38 2005 +0100
    15.2 +++ b/tools/xm-test/Makefile.am	Fri Nov 18 14:30:47 2005 +0100
    15.3 @@ -1,6 +1,9 @@
    15.4  SUBDIRS = ramdisk tests
    15.5  EXTRA_DIST = lib runtest.sh mkreport
    15.6  
    15.7 +existing:
    15.8 +	$(MAKE) -C ramdisk existing
    15.9 +
   15.10  # Remove any pyc's, CVS dirs, and prune the skel dirs
   15.11  dist-hook:
   15.12  	find $(distdir) -name '*~' -delete -print
    16.1 --- a/tools/xm-test/README	Fri Nov 18 14:28:38 2005 +0100
    16.2 +++ b/tools/xm-test/README	Fri Nov 18 14:30:47 2005 +0100
    16.3 @@ -45,11 +45,15 @@ special files, this process must be done
    16.4  NB: If you have the initrd.img from another installation of xm-test,
    16.5  you can copy it into the ramdisk directory to eliminate the need to
    16.6  rebuild it.  If you do this, there is no need to run 'make' again.
    16.7 -Simply copy the initrd.img file into ramdisk/ and then run the
    16.8 -runtest.sh script.  Note that in general, you should not attempt to
    16.9 -use a ramdisk from a previous minor version of xm-test (i.e., don't
   16.10 -use a ramdisk from 0.4.0 with 0.5.0.  0.5.0 should work for 0.5.3
   16.11 -though)
   16.12 +Simply copy the initrd-X.Y.img file into ramdisk/ and then run:
   16.13 +
   16.14 +   # make existing
   16.15 +
   16.16 +This will set up the link so that xm-test will use the existing
   16.17 +ramdisk.  Next, just run "runtest.sh" normally.  Note that in general,
   16.18 +you should not attempt to use a ramdisk from a previous minor version
   16.19 +of xm-test (i.e., don't use a ramdisk from 0.4.0 with 0.5.0.  0.5.0
   16.20 +should work for 0.5.3 though)
   16.21  
   16.22  
   16.23  Running
    17.1 --- a/tools/xm-test/configure.ac	Fri Nov 18 14:28:38 2005 +0100
    17.2 +++ b/tools/xm-test/configure.ac	Fri Nov 18 14:30:47 2005 +0100
    17.3 @@ -1,7 +1,7 @@
    17.4  # xm-test configure.ac input script
    17.5  
    17.6  # Basic header information
    17.7 -AC_INIT([xm-test], [0.5.0])
    17.8 +AC_INIT([xm-test], [0.6.0])
    17.9  AM_INIT_AUTOMAKE([1.7 foreign])
   17.10  
   17.11  # Check for dependencies
   17.12 @@ -65,5 +65,6 @@ AC_CONFIG_FILES([
   17.13      lib/XmTestLib/config.py
   17.14      ])
   17.15  
   17.16 +AC_OUTPUT
   17.17  
   17.18 -AC_OUTPUT
   17.19 +chmod a+x lib/XmTestReport/xmtest.py
    18.1 --- a/tools/xm-test/lib/XmTestReport/xmtest.py.in	Fri Nov 18 14:28:38 2005 +0100
    18.2 +++ b/tools/xm-test/lib/XmTestReport/xmtest.py.in	Fri Nov 18 14:30:47 2005 +0100
    18.3 @@ -1,3 +1,15 @@
    18.4  #!/usr/bin/python
    18.5  
    18.6  XM_TEST_VERSION = "@PACKAGE_VERSION@"
    18.7 +
    18.8 +if __name__ == "__main__":
    18.9 +    import re
   18.10 +
   18.11 +    match = re.match("^(\d+)\.(\d+)\.(\d+)$", XM_TEST_VERSION)
   18.12 +
   18.13 +    print "XM_TEST_VERSION=%s" % XM_TEST_VERSION
   18.14 +    if match:
   18.15 +        print "XM_TEST_MAJ=%s" % match.group(1)
   18.16 +        print "XM_TEST_MIN=%s" % match.group(2)
   18.17 +        print "XM_TEST_REV=%s" % match.group(3)
   18.18 +        
    19.1 --- a/tools/xm-test/ramdisk/Makefile.am	Fri Nov 18 14:28:38 2005 +0100
    19.2 +++ b/tools/xm-test/ramdisk/Makefile.am	Fri Nov 18 14:30:47 2005 +0100
    19.3 @@ -1,5 +1,5 @@
    19.4  
    19.5 -EXTRA_DIST = skel configs
    19.6 +EXTRA_DIST = skel configs patches
    19.7  
    19.8  BR_TAR = buildroot-20050823.tar.bz2
    19.9  BR_URL = http://buildroot.uclibc.org/downloads/snapshots/$(BR_TAR)
   19.10 @@ -9,6 +9,9 @@ BR_IMG = $(BR_SRC)/rootfs.i386.ext2
   19.11  
   19.12  BR_ROOT = build_i386/root
   19.13  
   19.14 +XMTEST_MAJ_VER = $(shell echo @PACKAGE_VERSION@ | perl -pe 's/(\d+)\.(\d+)\.\d+/\1.\2/')
   19.15 +XMTEST_VER_IMG = initrd-$(XMTEST_MAJ_VER).img
   19.16 +
   19.17  all: initrd.img
   19.18  
   19.19  $(BR_TAR):
   19.20 @@ -21,12 +24,21 @@ all: initrd.img
   19.21  	cp configs/buildroot $(BR_SRC)/.config
   19.22  	cp configs/busybox $(BR_SRC)/package/busybox/busybox.config
   19.23  	cp configs/uClibc $(BR_SRC)/toolchain/uClibc/uClibc.config
   19.24 +	(for i in patches/buildroot/*.patch; do \
   19.25 +	  cd $(BR_SRC) && patch -p1 <../$$i; done )
   19.26  	cd $(BR_SRC) && make oldconfig && make
   19.27  
   19.28 -initrd.img: $(BR_IMG)
   19.29 +$(XMTEST_VER_IMG): $(BR_IMG)
   19.30  	(cd skel; tar cf - .) | (cd $(BR_SRC)/$(BR_ROOT); tar xvf -)
   19.31  	cd $(BR_SRC) && make
   19.32 -	cp $(BR_IMG) initrd.img
   19.33 +	cp $(BR_IMG) initrd-$(XMTEST_MAJ_VER).img
   19.34 +
   19.35 +initrd.img: $(XMTEST_VER_IMG)
   19.36 +	ln -sf $(XMTEST_VER_IMG) initrd.img
   19.37 +
   19.38 +existing:
   19.39 +	@[ -f $(XMTEST_VER_IMG) ] && ln -sf $(XMTEST_VER_IMG) initrd.img || \
   19.40 +	echo Error, $(XMTEST_VER_IMG) not found
   19.41  
   19.42  clean-local: am_config_clean-local
   19.43  
    20.1 --- a/tools/xm-test/ramdisk/configs/buildroot	Fri Nov 18 14:28:38 2005 +0100
    20.2 +++ b/tools/xm-test/ramdisk/configs/buildroot	Fri Nov 18 14:30:47 2005 +0100
    20.3 @@ -225,6 +225,7 @@ BR2_PACKAGE_BUSYBOX_CONFIG="package/busy
    20.4  # BR2_PACKAGE_WIRELESS_TOOLS is not set
    20.5  # BR2_PACKAGE_XORG is not set
    20.6  # BR2_PACKAGE_ZLIB is not set
    20.7 +BR2_PACKAGE_HPING=y
    20.8  
    20.9  #
   20.10  # Target Options
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/tools/xm-test/ramdisk/patches/buildroot/hping.patch	Fri Nov 18 14:30:47 2005 +0100
    21.3 @@ -0,0 +1,67 @@
    21.4 +diff -Naur buildroot.orig/package/Config.in buildroot/package/Config.in
    21.5 +--- buildroot.orig/package/Config.in	2005-11-15 07:30:21.000000000 -0800
    21.6 ++++ buildroot/package/Config.in	2005-11-15 07:30:54.000000000 -0800
    21.7 +@@ -118,6 +118,6 @@
    21.8 + source "package/wireless-tools/Config.in"
    21.9 + source "package/xorg/Config.in"
   21.10 + source "package/zlib/Config.in"
   21.11 +-
   21.12 ++source "package/hping/Config.in"
   21.13 + 
   21.14 + endmenu
   21.15 +diff -Naur buildroot.orig/package/hping/Config.in buildroot/package/hping/Config.in
   21.16 +--- buildroot.orig/package/hping/Config.in	1969-12-31 16:00:00.000000000 -0800
   21.17 ++++ buildroot/package/hping/Config.in	2005-11-14 14:13:20.000000000 -0800
   21.18 +@@ -0,0 +1,5 @@
   21.19 ++config BR2_PACKAGE_HPING
   21.20 ++	bool "hping"
   21.21 ++	default y
   21.22 ++	help
   21.23 ++		This is the hping package
   21.24 +diff -Naur buildroot.orig/package/hping/hping.mk buildroot/package/hping/hping.mk
   21.25 +--- buildroot.orig/package/hping/hping.mk	1969-12-31 16:00:00.000000000 -0800
   21.26 ++++ buildroot/package/hping/hping.mk	2005-11-14 15:11:06.000000000 -0800
   21.27 +@@ -0,0 +1,43 @@
   21.28 ++# Taken from the buildroot examples
   21.29 ++
   21.30 ++HPING_VERSION = 2.0.0-rc3
   21.31 ++HPING_TBALL = hping$(HPING_VERSION).tar.gz
   21.32 ++HPING_URL = http://www.hping.org/$(HPING_TBALL)
   21.33 ++HPING_DIR = $(BUILD_DIR)/hping2-rc3
   21.34 ++HPING_TARGET_BINARY = usr/bin/hping
   21.35 ++HPING_BINARY = hping
   21.36 ++
   21.37 ++$(DL_DIR)/$(HPING_TBALL):
   21.38 ++	$(WGET) -P $(DL_DIR) $(HPING_URL)
   21.39 ++
   21.40 ++$(HPING_DIR)/.source: $(DL_DIR)/$(HPING_TBALL)
   21.41 ++	tar xzf $(DL_DIR)/$(HPING_TBALL) -C $(BUILD_DIR)
   21.42 ++	touch $(HPING_DIR)/.source
   21.43 ++
   21.44 ++$(HPING_DIR)/.configured: $(HPING_DIR)/.source
   21.45 ++	(cd $(HPING_DIR); \
   21.46 ++	./configure; )
   21.47 ++	cat $(HPING_DIR)/Makefile | grep -v './hping2 -v' > $(HPING_DIR)/foo
   21.48 ++	mv $(HPING_DIR)/foo $(HPING_DIR)/Makefile
   21.49 ++	touch $(HPING_DIR)/.configured 
   21.50 ++
   21.51 ++$(HPING_DIR)/$(HPING_BINARY): $(HPING_DIR)/.configured
   21.52 ++	$(MAKE) CC=$(TARGET_CC) -C $(HPING_DIR)
   21.53 ++
   21.54 ++$(TARGET_DIR)/$(HPING_TARGET_BINARY): $(HPING_DIR)/$(HPING_BINARY)
   21.55 ++	cp $(HPING_DIR)/hping2 $(TARGET_DIR)/bin
   21.56 ++
   21.57 ++hping: $(TARGET_DIR)/$(HPING_TARGET_BINARY)
   21.58 ++
   21.59 ++hping-clean:
   21.60 ++	$(MAKE) prefix=$(TARGET_DIR)/usr -C $(HPING_DIR) uninstall
   21.61 ++	-$(MAKE) -C $(HPING_DIR) clean
   21.62 ++
   21.63 ++hping-dirclean:
   21.64 ++	rm -Rf $(HPING_DIR)
   21.65 ++
   21.66 ++ifeq ($(strip $(BR2_PACKAGE_HPING)),y)
   21.67 ++TARGETS += hping
   21.68 ++endif
   21.69 ++
   21.70 ++
    22.1 --- a/tools/xm-test/runtest.sh	Fri Nov 18 14:28:38 2005 +0100
    22.2 +++ b/tools/xm-test/runtest.sh	Fri Nov 18 14:30:47 2005 +0100
    22.3 @@ -61,19 +61,31 @@ runnable_tests() {
    22.4      fi
    22.5  
    22.6      # See if the ramdisk has been built
    22.7 -    rdsize=$(stat -c %s ramdisk/initrd.img 2>/dev/null)
    22.8 +    rdsize=$(stat -Lc %s ramdisk/initrd.img 2>/dev/null)
    22.9      if [ -z "$rdsize" ] || [ $rdsize -le 16384 ]; then
   22.10  	echo "Cannot find a valid ramdisk.  You need to run \"make\" or"
   22.11  	echo "copy in a previously-built ramdisk to the ramdisk/ directory"
   22.12  	exit 1
   22.13      fi
   22.14  
   22.15 +    # Figure out the version of the ramdisk link and compare it
   22.16 +    # to what it should be as a cheap way of making sure we're
   22.17 +    # using the right version
   22.18 +    realrd=$(readlink ramdisk/initrd.img)
   22.19 +    eval $(./lib/XmTestReport/xmtest.py)
   22.20 +    rrdver="initrd-${XM_TEST_MAJ}.${XM_TEST_MIN}.img"
   22.21 +    if [ "$realrd" != "$rrdver" ]; then
   22.22 +	echo "Error: ramdisk/initrd.img is from an old version"
   22.23 +	echo "You need to build a ramdisk from at least ${XM_TEST_MAJ}.${XM_TEST_MIN}"
   22.24 +	exit 1
   22.25 +    fi
   22.26 +
   22.27      # See if xend is running
   22.28      if ! xm list >/dev/null 2>&1; then
   22.29  	echo "'xm list' failed: is xend running?"
   22.30  	exit 1
   22.31      fi
   22.32 -    
   22.33 +
   22.34  }
   22.35  
   22.36  # Get contact info if needed
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py	Fri Nov 18 14:30:47 2005 +0100
    23.3 @@ -0,0 +1,66 @@
    23.4 +#!/usr/bin/python
    23.5 +
    23.6 +# Copyright (C) International Business Machines Corp., 2005
    23.7 +# Author: Dan Smith <danms@us.ibm.com>
    23.8 +
    23.9 +from XmTestLib import *
   23.10 +
   23.11 +domain = XmTestDomain()
   23.12 +
   23.13 +try:
   23.14 +    domain.start()
   23.15 +except DomainError, e:
   23.16 +    FAIL(str(e))
   23.17 +
   23.18 +try:
   23.19 +    console = XmConsole(domain.getName())
   23.20 +except ConsoleError, e:
   23.21 +    FAIL(str(e))
   23.22 +
   23.23 +s, o = traceCommand("xm block-list %s" % domain.getName())
   23.24 +if s != 0:
   23.25 +    FAIL("block-list returned !0 when no devices attached")
   23.26 +if o:
   23.27 +    FAIL("block-list without devices reported something!")
   23.28 +
   23.29 +s, o = traceCommand("xm block-attach %s phy:/dev/ram0 hda1 w" % domain.getName())
   23.30 +if s != 0:
   23.31 +    FAIL("Unable to attach /dev/ram0->hda1")
   23.32 +
   23.33 +s, o = traceCommand("xm block-list %s" % domain.getName())
   23.34 +if s != 0:
   23.35 +    FAIL("block-list failed")
   23.36 +if not o.find("769"):
   23.37 +    FAIL("block-list didn't show the block device I just attached!")
   23.38 +
   23.39 +s, o = traceCommand("xm block-attach %s phy:/dev/ram1 hda2 w" % domain.getName())
   23.40 +if s != 0:
   23.41 +    FAIL("Unable to attach /dev/ram1->hda2")
   23.42 +
   23.43 +s, o = traceCommand("xm block-list %s" % domain.getName())
   23.44 +if s != 0:
   23.45 +    FAIL("block-list failed")
   23.46 +if not o.find("770"):
   23.47 +    FAIL("block-list didn't show the other block device I just attached!")
   23.48 +
   23.49 +s, o = traceCommand("xm block-detach %s 769" % domain.getName())
   23.50 +if s != 0:
   23.51 +    FAIL("block-destroy of hda1 failed")
   23.52 +
   23.53 +s, o = traceCommand("xm block-list %s" % domain.getName())
   23.54 +if s != 0:
   23.55 +    FAIL("block-list failed after detaching a device")
   23.56 +if o.find("769"):
   23.57 +    FAIL("hda1 still shown in block-list after detach!")
   23.58 +if not o.find("770"):
   23.59 +    FAIL("hda2 not shown after detach of hda1!")
   23.60 +
   23.61 +s, o = traceCommand("xm block-detach %s 770" % domain.getName())
   23.62 +if s != 0:
   23.63 +    FAIL("block-list failed after detaching another device")
   23.64 +if o.find("770"):
   23.65 +    FAIL("hda2 still shown in block-list after detach!")
   23.66 +if o:
   23.67 +    FAIL("block-list still shows something after all devices detached!")
   23.68 +    
   23.69 +
    24.1 --- a/tools/xm-test/tests/block-list/Makefile.am	Fri Nov 18 14:28:38 2005 +0100
    24.2 +++ b/tools/xm-test/tests/block-list/Makefile.am	Fri Nov 18 14:30:47 2005 +0100
    24.3 @@ -5,7 +5,8 @@ TESTS =	01_block-list_pos.test 	\
    24.4  	02_block-list_attachbd_pos.test \
    24.5  	03_block-list_anotherbd_pos.test \
    24.6  	04_block-list_nodb_pos.test \
    24.7 -	05_block-list_nonexist_neg.test
    24.8 +	05_block-list_nonexist_neg.test \
    24.9 +	06_block-list_checkremove_pos.test
   24.10  
   24.11  XFAIL_TESTS = 
   24.12  
    25.1 --- a/tools/xm-test/tests/create/15_create_smallmem_pos.py	Fri Nov 18 14:28:38 2005 +0100
    25.2 +++ b/tools/xm-test/tests/create/15_create_smallmem_pos.py	Fri Nov 18 14:30:47 2005 +0100
    25.3 @@ -7,7 +7,8 @@ from XmTestLib import *
    25.4  
    25.5  MEM = 16
    25.6  
    25.7 -domain = XmTestDomain(extraOpts={"memory":"%i" % MEM})
    25.8 +domain = XmTestDomain(extraOpts={"memory":"%i" % MEM,
    25.9 +                                 "extra" :"mem=%iM" % MEM})
   25.10  
   25.11  try:
   25.12      domain.start()
    26.1 --- a/xen/arch/x86/domain.c	Fri Nov 18 14:28:38 2005 +0100
    26.2 +++ b/xen/arch/x86/domain.c	Fri Nov 18 14:30:47 2005 +0100
    26.3 @@ -255,6 +255,9 @@ void arch_do_createdomain(struct vcpu *v
    26.4      struct domain *d = v->domain;
    26.5      l1_pgentry_t gdt_l1e;
    26.6      int vcpuid, pdpt_order;
    26.7 +#ifdef __x86_64__
    26.8 +    int i;
    26.9 +#endif
   26.10  
   26.11      if ( is_idle_task(d) )
   26.12          return;
    27.1 --- a/xen/include/xen/event.h	Fri Nov 18 14:28:38 2005 +0100
    27.2 +++ b/xen/include/xen/event.h	Fri Nov 18 14:30:47 2005 +0100
    27.3 @@ -60,7 +60,7 @@ extern void send_guest_pirq(struct domai
    27.4  
    27.5  /* Note: Bitwise operations result in fast code with no branches. */
    27.6  #define event_pending(v)                        \
    27.7 -    ((v)->vcpu_info->evtchn_upcall_pending &    \
    27.8 -     ~(v)->vcpu_info->evtchn_upcall_mask)
    27.9 +    (!!(v)->vcpu_info->evtchn_upcall_pending &  \
   27.10 +      !(v)->vcpu_info->evtchn_upcall_mask)
   27.11  
   27.12  #endif /* __XEN_EVENT_H__ */