ia64/xen-unstable

changeset 7722:4aeb53ba2890

Merge latest xen-unstable into xen-ia64-unstable
author djm@kirby.fc.hp.com
date Thu Nov 10 08:34:09 2005 -0600 (2005-11-10)
parents 214bd6a0ed27 136b2d20dc81
children 9be9bc0b0f11
files linux-2.6-xen-sparse/drivers/xen/blkback/interface.c xen/arch/ia64/Rules.mk
line diff
     1.1 --- a/.hgignore	Thu Nov 10 08:18:25 2005 -0600
     1.2 +++ b/.hgignore	Thu Nov 10 08:34:09 2005 -0600
     1.3 @@ -17,9 +17,9 @@
     1.4  ^docs/.*\.pdf$
     1.5  ^docs/.*\.ps$
     1.6  ^docs/.*\.toc$
     1.7 +^docs/api/.*$
     1.8  ^docs/figs/xenserver\.eps$
     1.9  ^docs/html/.*$
    1.10 -^docs/api/.*$
    1.11  ^docs/interface/WARNINGS$
    1.12  ^docs/interface/images\.pl$
    1.13  ^docs/interface/images\.tex$
    1.14 @@ -47,9 +47,9 @@
    1.15  ^extras/mini-os/h/xen-public$
    1.16  ^extras/mini-os/mini-os\..*$
    1.17  ^install/.*$
    1.18 +^linux-[^/]*-xen/.*$
    1.19  ^linux-[^/]*-xen0/.*$
    1.20  ^linux-[^/]*-xenU/.*$
    1.21 -^linux-[^/]*-xen/.*$
    1.22  ^linux-[^/]*\.patch$
    1.23  ^mkddbxen$
    1.24  ^netbsd-[^/]*-tools/.*$
    1.25 @@ -62,6 +62,7 @@
    1.26  ^patches/tmp/.*$
    1.27  ^pristine-.*$
    1.28  ^ref-.*$
    1.29 +^tools/.*/TAGS$
    1.30  ^tools/.*/build/lib.*/.*\.py$
    1.31  ^tools/blktap/Makefile\.smh$
    1.32  ^tools/blktap/blkcow$
    1.33 @@ -71,37 +72,37 @@
    1.34  ^tools/blktap/blkgnbd$
    1.35  ^tools/blktap/blkimg$
    1.36  ^tools/blktap/bstest$
    1.37 -^tools/blktap/vdi\.dot$
    1.38 -^tools/blktap/vdi\.ps$
    1.39 +^tools/blktap/parallax/blockstored$
    1.40 +^tools/blktap/parallax/parallax$
    1.41  ^tools/blktap/parallax/vdi_create$
    1.42  ^tools/blktap/parallax/vdi_fill$
    1.43  ^tools/blktap/parallax/vdi_list$
    1.44  ^tools/blktap/parallax/vdi_snap$
    1.45 +^tools/blktap/parallax/vdi_snap_delete$
    1.46  ^tools/blktap/parallax/vdi_snap_list$
    1.47 -^tools/blktap/parallax/vdi_snap_delete$
    1.48  ^tools/blktap/parallax/vdi_tree$
    1.49  ^tools/blktap/parallax/vdi_validate$
    1.50 -^tools/blktap/parallax/parallax$
    1.51 -^tools/blktap/parallax/blockstored$
    1.52  ^tools/blktap/ublkback/ublkback$
    1.53 +^tools/blktap/vdi\.dot$
    1.54 +^tools/blktap/vdi\.ps$
    1.55  ^tools/blktap/xen/.*$
    1.56  ^tools/check/\..*$
    1.57 +^tools/console/xenconsole$
    1.58  ^tools/console/xenconsoled$
    1.59 -^tools/console/xenconsole$
    1.60 +^tools/debugger/gdb/gdb-6\.2\.1-linux-i386-xen/.*$
    1.61 +^tools/debugger/gdb/gdb-6\.2\.1/.*$
    1.62  ^tools/debugger/gdb/gdb-6\.2\.1\.tar\.bz2$
    1.63 -^tools/debugger/gdb/gdb-6\.2\.1/.*$
    1.64 -^tools/debugger/gdb/gdb-6\.2\.1-linux-i386-xen/.*$
    1.65 -^tools/debugger/pdb/pdb$
    1.66 +^tools/debugger/pdb/._bcdi/.*$
    1.67  ^tools/debugger/pdb/linux-[0-9.]*-module/.*\.ko$
    1.68  ^tools/debugger/pdb/linux-[0-9.]*-module/.*\.mod.c$
    1.69 +^tools/debugger/pdb/linux-[0-9.]*-module/.tmp_versions/.*$
    1.70  ^tools/debugger/pdb/linux-[0-9.]*-module/\..*\.cmd$
    1.71 -^tools/debugger/pdb/linux-[0-9.]*-module/.tmp_versions/.*$
    1.72 -^tools/debugger/pdb/._bcdi/.*$
    1.73 -^tools/firmware/acpi/acpigen$
    1.74 +^tools/debugger/pdb/pdb$
    1.75 +^tools/firmware/.*/biossums$
    1.76  ^tools/firmware/.*\.bin$
    1.77  ^tools/firmware/.*\.sym$
    1.78 -^tools/firmware/.*/biossums$
    1.79  ^tools/firmware/.*bios/.*bios.*\.txt$
    1.80 +^tools/firmware/acpi/acpigen$
    1.81  ^tools/firmware/rombios/BIOS-bochs-latest$
    1.82  ^tools/firmware/rombios/_rombios_\.c$
    1.83  ^tools/firmware/rombios/rombios\.s$
    1.84 @@ -120,20 +121,20 @@
    1.85  ^tools/libxc/xen/.*$
    1.86  ^tools/misc/cpuperf/cpuperf-perfcntr$
    1.87  ^tools/misc/cpuperf/cpuperf-xen$
    1.88 +^tools/misc/lomount/lomount$
    1.89  ^tools/misc/mbootpack/bin2c$
    1.90  ^tools/misc/mbootpack/bootsect$
    1.91  ^tools/misc/mbootpack/bzimage_header\.c$
    1.92  ^tools/misc/mbootpack/mbootpack$
    1.93  ^tools/misc/mbootpack/setup$
    1.94  ^tools/misc/miniterm/miniterm$
    1.95 -^tools/misc/lomount/lomount$
    1.96  ^tools/misc/xc_shadow$
    1.97  ^tools/misc/xen_cpuperf$
    1.98  ^tools/misc/xenperf$
    1.99 +^tools/pygrub/build/.*$
   1.100 +^tools/python/build/.*$
   1.101  ^tools/security/secpol_tool$
   1.102  ^tools/security/xen/.*$
   1.103 -^tools/pygrub/build/.*$
   1.104 -^tools/python/build/.*$
   1.105  ^tools/tests/test_x86_emulator$
   1.106  ^tools/vnet/gc$
   1.107  ^tools/vnet/gc.*/.*$
   1.108 @@ -141,8 +142,8 @@
   1.109  ^tools/vnet/vnet-module/\..*\.cmd$
   1.110  ^tools/vnet/vnet-module/\.tmp_versions/.*$
   1.111  ^tools/vnet/vnet-module/vnet_module\.mod\..*$
   1.112 +^tools/vtpm/tpm_emulator-.*\.tar\.gz$
   1.113  ^tools/vtpm/tpm_emulator/.*$
   1.114 -^tools/vtpm/tpm_emulator-.*\.tar\.gz$
   1.115  ^tools/vtpm/vtpm/.*$
   1.116  ^tools/vtpm_manager/manager/vtpm_managerd$
   1.117  ^tools/xcutils/xc_restore$
   1.118 @@ -150,13 +151,13 @@
   1.119  ^tools/xenstat/xentop/xentop$
   1.120  ^tools/xenstore/testsuite/tmp/.*$
   1.121  ^tools/xenstore/xen$
   1.122 -^tools/xenstore/xenstored$
   1.123 -^tools/xenstore/xenstored_test$
   1.124  ^tools/xenstore/xenstore-exists$
   1.125  ^tools/xenstore/xenstore-list$
   1.126  ^tools/xenstore/xenstore-read$
   1.127  ^tools/xenstore/xenstore-rm$
   1.128  ^tools/xenstore/xenstore-write$
   1.129 +^tools/xenstore/xenstored$
   1.130 +^tools/xenstore/xenstored_test$
   1.131  ^tools/xenstore/xs_crashme$
   1.132  ^tools/xenstore/xs_random$
   1.133  ^tools/xenstore/xs_stress$
     2.1 --- a/linux-2.6-xen-sparse/arch/xen/Kconfig	Thu Nov 10 08:18:25 2005 -0600
     2.2 +++ b/linux-2.6-xen-sparse/arch/xen/Kconfig	Thu Nov 10 08:34:09 2005 -0600
     2.3 @@ -94,7 +94,7 @@ config XEN_TPMDEV_CLOSE_IF_VTPM_FAILS
     2.4            Say Y if you want this feature.
     2.5  
     2.6  config XEN_BLKDEV_FRONTEND
     2.7 -	bool "Block-device frontend driver"
     2.8 +	tristate "Block-device frontend driver"
     2.9  	default y
    2.10  	help
    2.11  	  The block-device frontend driver allows the kernel to access block
    2.12 @@ -103,7 +103,7 @@ config XEN_BLKDEV_FRONTEND
    2.13  	  (domain 0), then you almost certainly want to say Y here.
    2.14  
    2.15  config XEN_NETDEV_FRONTEND
    2.16 -	bool "Network-device frontend driver"
    2.17 +	tristate "Network-device frontend driver"
    2.18  	default y
    2.19  	help
    2.20  	  The network-device frontend driver allows the kernel to access
    2.21 @@ -173,6 +173,10 @@ endchoice
    2.22  
    2.23  endmenu
    2.24  
    2.25 +config HAVE_ARCH_ALLOC_SKB
    2.26 +	bool
    2.27 +	default y
    2.28 +
    2.29  config HAVE_ARCH_DEV_ALLOC_SKB
    2.30  	bool
    2.31  	default y
     3.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32	Thu Nov 10 08:18:25 2005 -0600
     3.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32	Thu Nov 10 08:34:09 2005 -0600
     3.3 @@ -1,7 +1,7 @@
     3.4  #
     3.5  # Automatically generated make config: don't edit
     3.6 -# Linux kernel version: 2.6.12-xen0
     3.7 -# Wed Aug  3 09:54:56 2005
     3.8 +# Linux kernel version: 2.6.12.6-xen0
     3.9 +# Mon Nov  7 17:22:05 2005
    3.10  #
    3.11  CONFIG_XEN=y
    3.12  CONFIG_ARCH_XEN=y
    3.13 @@ -25,6 +25,7 @@ CONFIG_XEN_NETDEV_FRONTEND=y
    3.14  CONFIG_XEN_SCRUB_PAGES=y
    3.15  CONFIG_XEN_X86=y
    3.16  # CONFIG_XEN_X86_64 is not set
    3.17 +CONFIG_HAVE_ARCH_ALLOC_SKB=y
    3.18  CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
    3.19  
    3.20  #
    3.21 @@ -151,11 +152,9 @@ CONFIG_X86_IO_APIC=y
    3.22  CONFIG_X86_UP_APIC=y
    3.23  CONFIG_X86_UP_IOAPIC=y
    3.24  CONFIG_PCI=y
    3.25 -# CONFIG_PCI_GOBIOS is not set
    3.26  # CONFIG_PCI_GOMMCONFIG is not set
    3.27  # CONFIG_PCI_GODIRECT is not set
    3.28  CONFIG_PCI_GOANY=y
    3.29 -CONFIG_PCI_BIOS=y
    3.30  CONFIG_PCI_DIRECT=y
    3.31  CONFIG_PCI_MMCONFIG=y
    3.32  # CONFIG_PCIEPORTBUS is not set
    3.33 @@ -540,7 +539,7 @@ CONFIG_IP_NF_MATCH_IPRANGE=m
    3.34  # CONFIG_IP_NF_MATCH_STATE is not set
    3.35  # CONFIG_IP_NF_MATCH_CONNTRACK is not set
    3.36  # CONFIG_IP_NF_MATCH_OWNER is not set
    3.37 -CONFIG_IP_NF_MATCH_PHYSDEV=y
    3.38 +CONFIG_IP_NF_MATCH_PHYSDEV=m
    3.39  # CONFIG_IP_NF_MATCH_ADDRTYPE is not set
    3.40  # CONFIG_IP_NF_MATCH_REALM is not set
    3.41  # CONFIG_IP_NF_MATCH_SCTP is not set
     4.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64	Thu Nov 10 08:18:25 2005 -0600
     4.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64	Thu Nov 10 08:34:09 2005 -0600
     4.3 @@ -1,7 +1,7 @@
     4.4  #
     4.5  # Automatically generated make config: don't edit
     4.6 -# Linux kernel version: 2.6.12.4-xen0
     4.7 -# Mon Aug 15 18:57:19 2005
     4.8 +# Linux kernel version: 2.6.12.6-xen0
     4.9 +# Mon Nov  7 17:24:18 2005
    4.10  #
    4.11  CONFIG_XEN=y
    4.12  CONFIG_ARCH_XEN=y
    4.13 @@ -25,6 +25,7 @@ CONFIG_XEN_NETDEV_FRONTEND=y
    4.14  CONFIG_XEN_SCRUB_PAGES=y
    4.15  # CONFIG_XEN_X86 is not set
    4.16  CONFIG_XEN_X86_64=y
    4.17 +CONFIG_HAVE_ARCH_ALLOC_SKB=y
    4.18  CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
    4.19  
    4.20  #
    4.21 @@ -92,6 +93,7 @@ CONFIG_X86_GOOD_APIC=y
    4.22  # CONFIG_PREEMPT is not set
    4.23  CONFIG_MICROCODE=y
    4.24  # CONFIG_X86_CPUID is not set
    4.25 +CONFIG_SWIOTLB=y
    4.26  # CONFIG_NUMA is not set
    4.27  # CONFIG_MTRR is not set
    4.28  CONFIG_X86_LOCAL_APIC=y
    4.29 @@ -122,7 +124,6 @@ CONFIG_X86_XEN_GENAPIC=y
    4.30  # CONFIG_X86_MSR is not set
    4.31  # CONFIG_GART_IOMMU is not set
    4.32  CONFIG_DUMMY_IOMMU=y
    4.33 -CONFIG_SWIOTLB=y
    4.34  # CONFIG_X86_MCE is not set
    4.35  
    4.36  #
    4.37 @@ -480,7 +481,7 @@ CONFIG_IP_NF_MATCH_IPRANGE=m
    4.38  # CONFIG_IP_NF_MATCH_STATE is not set
    4.39  # CONFIG_IP_NF_MATCH_CONNTRACK is not set
    4.40  # CONFIG_IP_NF_MATCH_OWNER is not set
    4.41 -CONFIG_IP_NF_MATCH_PHYSDEV=y
    4.42 +CONFIG_IP_NF_MATCH_PHYSDEV=m
    4.43  # CONFIG_IP_NF_MATCH_ADDRTYPE is not set
    4.44  # CONFIG_IP_NF_MATCH_REALM is not set
    4.45  # CONFIG_IP_NF_MATCH_SCTP is not set
     5.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32	Thu Nov 10 08:18:25 2005 -0600
     5.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32	Thu Nov 10 08:34:09 2005 -0600
     5.3 @@ -22,6 +22,7 @@ CONFIG_XEN_NETDEV_FRONTEND=y
     5.4  CONFIG_XEN_SCRUB_PAGES=y
     5.5  CONFIG_XEN_X86=y
     5.6  # CONFIG_XEN_X86_64 is not set
     5.7 +CONFIG_HAVE_ARCH_ALLOC_SKB=y
     5.8  CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     5.9  
    5.10  #
     6.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64	Thu Nov 10 08:18:25 2005 -0600
     6.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64	Thu Nov 10 08:34:09 2005 -0600
     6.3 @@ -22,6 +22,7 @@ CONFIG_XEN_NETDEV_FRONTEND=y
     6.4  CONFIG_XEN_SCRUB_PAGES=y
     6.5  # CONFIG_XEN_X86 is not set
     6.6  CONFIG_XEN_X86_64=y
     6.7 +CONFIG_HAVE_ARCH_ALLOC_SKB=y
     6.8  CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     6.9  
    6.10  #
     7.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32	Thu Nov 10 08:18:25 2005 -0600
     7.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32	Thu Nov 10 08:34:09 2005 -0600
     7.3 @@ -25,6 +25,7 @@ CONFIG_XEN_NETDEV_FRONTEND=y
     7.4  CONFIG_XEN_SCRUB_PAGES=y
     7.5  CONFIG_XEN_X86=y
     7.6  # CONFIG_XEN_X86_64 is not set
     7.7 +CONFIG_HAVE_ARCH_ALLOC_SKB=y
     7.8  CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     7.9  
    7.10  #
     8.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_64	Thu Nov 10 08:18:25 2005 -0600
     8.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_64	Thu Nov 10 08:34:09 2005 -0600
     8.3 @@ -25,6 +25,7 @@ CONFIG_XEN_NETDEV_FRONTEND=y
     8.4  CONFIG_XEN_SCRUB_PAGES=y
     8.5  # CONFIG_XEN_X86 is not set
     8.6  CONFIG_XEN_X86_64=y
     8.7 +CONFIG_HAVE_ARCH_ALLOC_SKB=y
     8.8  CONFIG_HAVE_ARCH_DEV_ALLOC_SKB=y
     8.9  
    8.10  #
     9.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Thu Nov 10 08:18:25 2005 -0600
     9.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Thu Nov 10 08:34:09 2005 -0600
     9.3 @@ -152,8 +152,11 @@ void *dma_alloc_coherent(struct device *
     9.4  	ret = (void *)vstart;
     9.5  
     9.6  	if (ret != NULL) {
     9.7 -		xen_create_contiguous_region(vstart, order);
     9.8 -
     9.9 +		/* NB. Hardcode 31 address bits for now: aacraid limitation. */
    9.10 +		if (xen_create_contiguous_region(vstart, order, 31) != 0) {
    9.11 +			free_pages(vstart, order);
    9.12 +			return NULL;
    9.13 +		}
    9.14  		memset(ret, 0, size);
    9.15  		*dma_handle = virt_to_bus(ret);
    9.16  	}
    10.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/smp.c	Thu Nov 10 08:18:25 2005 -0600
    10.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/smp.c	Thu Nov 10 08:34:09 2005 -0600
    10.3 @@ -127,13 +127,13 @@ static inline int __prepare_ICR2 (unsign
    10.4  	return SET_APIC_DEST_FIELD(mask);
    10.5  }
    10.6  
    10.7 -DECLARE_PER_CPU(int, ipi_to_evtchn[NR_IPIS]);
    10.8 +DECLARE_PER_CPU(int, ipi_to_irq[NR_IPIS]);
    10.9  
   10.10  static inline void __send_IPI_one(unsigned int cpu, int vector)
   10.11  {
   10.12 -	int evtchn = per_cpu(ipi_to_evtchn, cpu)[vector];
   10.13 -	BUG_ON(evtchn < 0);
   10.14 -	notify_remote_via_evtchn(evtchn);
   10.15 +	int irq = per_cpu(ipi_to_irq, cpu)[vector];
   10.16 +	BUG_ON(irq < 0);
   10.17 +	notify_remote_via_irq(irq);
   10.18  }
   10.19  
   10.20  void __send_IPI_shortcut(unsigned int shortcut, int vector)
    11.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c	Thu Nov 10 08:18:25 2005 -0600
    11.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c	Thu Nov 10 08:34:09 2005 -0600
    11.3 @@ -117,6 +117,7 @@ void
    11.4  swiotlb_init_with_default_size (size_t default_size)
    11.5  {
    11.6  	unsigned long i, bytes;
    11.7 +	int rc;
    11.8  
    11.9  	if (!iotlb_nslabs) {
   11.10  		iotlb_nslabs = (default_size >> IO_TLB_SHIFT);
   11.11 @@ -137,8 +138,10 @@ swiotlb_init_with_default_size (size_t d
   11.12  		      "Use dom0_mem Xen boot parameter to reserve\n"
   11.13  		      "some DMA memory (e.g., dom0_mem=-128M).\n");
   11.14  
   11.15 -	xen_create_contiguous_region(
   11.16 -		(unsigned long)iotlb_virt_start, get_order(bytes));
   11.17 +	/* Hardcode 31 address bits for now: aacraid limitation. */
   11.18 +	rc = xen_create_contiguous_region(
   11.19 +		(unsigned long)iotlb_virt_start, get_order(bytes), 31);
   11.20 +	BUG_ON(rc);
   11.21  
   11.22  	/*
   11.23  	 * Allocate and initialize the free list array.  This array is used
    12.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Thu Nov 10 08:18:25 2005 -0600
    12.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Thu Nov 10 08:34:09 2005 -0600
    12.3 @@ -748,10 +748,19 @@ static void __init hpet_time_init(void)
    12.4  /* Dynamically-mapped IRQ. */
    12.5  DEFINE_PER_CPU(int, timer_irq);
    12.6  
    12.7 -static struct irqaction irq_timer = {
    12.8 -	timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer0",
    12.9 -	NULL, NULL
   12.10 -};
   12.11 +extern void (*late_time_init)(void);
   12.12 +static void setup_cpu0_timer_irq(void)
   12.13 +{
   12.14 +	per_cpu(timer_irq, 0) =
   12.15 +		bind_virq_to_irqhandler(
   12.16 +			VIRQ_TIMER,
   12.17 +			0,
   12.18 +			timer_interrupt,
   12.19 +			SA_INTERRUPT,
   12.20 +			"timer0",
   12.21 +			NULL);
   12.22 +	BUG_ON(per_cpu(timer_irq, 0) < 0);
   12.23 +}
   12.24  
   12.25  void __init time_init(void)
   12.26  {
   12.27 @@ -785,8 +794,8 @@ void __init time_init(void)
   12.28  	rdtscll(vxtime.last_tsc);
   12.29  #endif
   12.30  
   12.31 -	per_cpu(timer_irq, 0) = bind_virq_to_irq(VIRQ_TIMER, 0);
   12.32 -	(void)setup_irq(per_cpu(timer_irq, 0), &irq_timer);
   12.33 +	/* Cannot request_irq() until kmem is initialised. */
   12.34 +	late_time_init = setup_cpu0_timer_irq;
   12.35  }
   12.36  
   12.37  /* Convert jiffies to system time. */
   12.38 @@ -865,17 +874,22 @@ void local_setup_timer(unsigned int cpu)
   12.39  			per_cpu(shadow_time, cpu).system_timestamp;
   12.40  	} while (read_seqretry(&xtime_lock, seq));
   12.41  
   12.42 -	per_cpu(timer_irq, cpu) = bind_virq_to_irq(VIRQ_TIMER, cpu);
   12.43  	sprintf(timer_name[cpu], "timer%d", cpu);
   12.44 -	BUG_ON(request_irq(per_cpu(timer_irq, cpu), timer_interrupt,
   12.45 -	                   SA_INTERRUPT, timer_name[cpu], NULL));
   12.46 +	per_cpu(timer_irq, cpu) =
   12.47 +		bind_virq_to_irqhandler(
   12.48 +			VIRQ_TIMER,
   12.49 +			cpu,
   12.50 +			timer_interrupt,
   12.51 +			SA_INTERRUPT,
   12.52 +			timer_name[cpu],
   12.53 +			NULL);
   12.54 +	BUG_ON(per_cpu(timer_irq, cpu) < 0);
   12.55  }
   12.56  
   12.57  void local_teardown_timer(unsigned int cpu)
   12.58  {
   12.59  	BUG_ON(cpu == 0);
   12.60 -	free_irq(per_cpu(timer_irq, cpu), NULL);
   12.61 -	unbind_virq_from_irq(VIRQ_TIMER, cpu);
   12.62 +	unbind_from_irqhandler(per_cpu(timer_irq, cpu), NULL);
   12.63  }
   12.64  #endif
   12.65  
    13.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Thu Nov 10 08:18:25 2005 -0600
    13.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c	Thu Nov 10 08:34:09 2005 -0600
    13.3 @@ -314,7 +314,8 @@ static void contiguous_bitmap_clear(
    13.4  }
    13.5  
    13.6  /* Ensure multi-page extents are contiguous in machine memory. */
    13.7 -void xen_create_contiguous_region(unsigned long vstart, unsigned int order)
    13.8 +int xen_create_contiguous_region(
    13.9 +	unsigned long vstart, unsigned int order, unsigned int address_bits)
   13.10  {
   13.11  	pgd_t         *pgd; 
   13.12  	pud_t         *pud; 
   13.13 @@ -349,9 +350,10 @@ void xen_create_contiguous_region(unsign
   13.14  
   13.15  	/* 2. Get a new contiguous memory extent. */
   13.16  	reservation.extent_order = order;
   13.17 -	reservation.address_bits = 31; /* aacraid limitation */
   13.18 -	BUG_ON(HYPERVISOR_memory_op(
   13.19 -		XENMEM_increase_reservation, &reservation) != 1);
   13.20 +	reservation.address_bits = address_bits;
   13.21 +	if (HYPERVISOR_memory_op(XENMEM_increase_reservation,
   13.22 +				 &reservation) != 1)
   13.23 +		goto fail;
   13.24  
   13.25  	/* 3. Map the new extent in place of old pages. */
   13.26  	for (i = 0; i < (1<<order); i++) {
   13.27 @@ -367,6 +369,28 @@ void xen_create_contiguous_region(unsign
   13.28  	contiguous_bitmap_set(__pa(vstart) >> PAGE_SHIFT, 1UL << order);
   13.29  
   13.30  	balloon_unlock(flags);
   13.31 +
   13.32 +	return 0;
   13.33 +
   13.34 + fail:
   13.35 +	reservation.extent_order = 0;
   13.36 +	reservation.address_bits = 0;
   13.37 +
   13.38 +	for (i = 0; i < (1<<order); i++) {
   13.39 +		BUG_ON(HYPERVISOR_memory_op(
   13.40 +			XENMEM_increase_reservation, &reservation) != 1);
   13.41 +		BUG_ON(HYPERVISOR_update_va_mapping(
   13.42 +			vstart + (i*PAGE_SIZE),
   13.43 +			pfn_pte_ma(mfn, PAGE_KERNEL), 0));
   13.44 +		xen_machphys_update(mfn, (__pa(vstart)>>PAGE_SHIFT)+i);
   13.45 +		phys_to_machine_mapping[(__pa(vstart)>>PAGE_SHIFT)+i] = mfn;
   13.46 +	}
   13.47 +
   13.48 +	flush_tlb_all();
   13.49 +
   13.50 +	balloon_unlock(flags);
   13.51 +
   13.52 +	return -ENOMEM;
   13.53  }
   13.54  
   13.55  void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order)
    14.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Thu Nov 10 08:18:25 2005 -0600
    14.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c	Thu Nov 10 08:34:09 2005 -0600
    14.3 @@ -279,8 +279,9 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
    14.4  	unsigned long flags;
    14.5  
    14.6  #ifdef CONFIG_X86_PAE
    14.7 -	/* this gives us a page below 4GB */
    14.8 -	xen_create_contiguous_region((unsigned long)pgd, 0);
    14.9 +	/* Ensure pgd resides below 4GB. */
   14.10 +	int rc = xen_create_contiguous_region((unsigned long)pgd, 0, 32);
   14.11 +	BUG_ON(rc);
   14.12  #endif
   14.13  
   14.14  	if (!HAVE_SHARED_KERNEL_PMD)
    15.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Thu Nov 10 08:18:25 2005 -0600
    15.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Thu Nov 10 08:34:09 2005 -0600
    15.3 @@ -52,16 +52,29 @@ static spinlock_t irq_mapping_update_loc
    15.4  
    15.5  /* IRQ <-> event-channel mappings. */
    15.6  static int evtchn_to_irq[NR_EVENT_CHANNELS];
    15.7 -static int irq_to_evtchn[NR_IRQS];
    15.8 +
    15.9 +/* Packed IRQ information: binding type, sub-type index, and event channel. */
   15.10 +static u32 irq_info[NR_IRQS];
   15.11 +/* Binding types. */
   15.12 +enum { IRQT_UNBOUND, IRQT_PIRQ, IRQT_VIRQ, IRQT_IPI, IRQT_EVTCHN };
   15.13 +/* Constructor for packed IRQ information. */
   15.14 +#define mk_irq_info(type, index, evtchn)				\
   15.15 +	(((u32)(type) << 24) | ((u32)(index) << 16) | (u32)(evtchn))
   15.16 +/* Convenient shorthand for packed representation of an unbound IRQ. */
   15.17 +#define IRQ_UNBOUND	mk_irq_info(IRQT_UNBOUND, 0, 0)
   15.18 +/* Accessor macros for packed IRQ information. */
   15.19 +#define evtchn_from_irq(irq) ((u16)(irq_info[irq]))
   15.20 +#define index_from_irq(irq)  ((u8)(irq_info[irq] >> 16))
   15.21 +#define type_from_irq(irq)   ((u8)(irq_info[irq] >> 24))
   15.22  
   15.23  /* IRQ <-> VIRQ mapping. */
   15.24  DEFINE_PER_CPU(int, virq_to_irq[NR_VIRQS]);
   15.25  
   15.26 -/* evtchn <-> IPI mapping. */
   15.27 +/* IRQ <-> IPI mapping. */
   15.28  #ifndef NR_IPIS
   15.29  #define NR_IPIS 1 
   15.30  #endif
   15.31 -DEFINE_PER_CPU(int, ipi_to_evtchn[NR_IPIS]);
   15.32 +DEFINE_PER_CPU(int, ipi_to_irq[NR_IPIS]);
   15.33  
   15.34  /* Reference counts for bindings to IRQs. */
   15.35  static int irq_bindcount[NR_IRQS];
   15.36 @@ -93,6 +106,8 @@ static void init_evtchn_cpu_bindings(voi
   15.37  	memset(cpu_evtchn_mask[0], ~0, sizeof(cpu_evtchn_mask[0]));
   15.38  }
   15.39  
   15.40 +#define cpu_from_evtchn(evtchn)		(cpu_evtchn[evtchn])
   15.41 +
   15.42  #else
   15.43  
   15.44  #define active_evtchns(cpu,sh,idx)		\
   15.45 @@ -100,6 +115,7 @@ static void init_evtchn_cpu_bindings(voi
   15.46  	 ~(sh)->evtchn_mask[idx])
   15.47  #define bind_evtchn_to_cpu(chn,cpu)	((void)0)
   15.48  #define init_evtchn_cpu_bindings()	((void)0)
   15.49 +#define cpu_from_evtchn(evtchn)		(0)
   15.50  
   15.51  #endif
   15.52  
   15.53 @@ -121,7 +137,8 @@ extern asmlinkage unsigned int do_IRQ(st
   15.54  } while (0)
   15.55  #endif
   15.56  
   15.57 -#define VALID_EVTCHN(_chn) ((_chn) >= 0)
   15.58 +/* Xen will never allocate port zero for any purpose. */
   15.59 +#define VALID_EVTCHN(chn)	((chn) != 0)
   15.60  
   15.61  /*
   15.62   * Force a proper event-channel callback from Xen after clearing the
   15.63 @@ -179,7 +196,26 @@ static int find_unbound_irq(void)
   15.64  	return irq;
   15.65  }
   15.66  
   15.67 -int bind_virq_to_irq(int virq, int cpu)
   15.68 +static int bind_evtchn_to_irq(unsigned int evtchn)
   15.69 +{
   15.70 +	int irq;
   15.71 +
   15.72 +	spin_lock(&irq_mapping_update_lock);
   15.73 +
   15.74 +	if ((irq = evtchn_to_irq[evtchn]) == -1) {
   15.75 +		irq = find_unbound_irq();
   15.76 +		evtchn_to_irq[evtchn] = irq;
   15.77 +		irq_info[irq] = mk_irq_info(IRQT_EVTCHN, 0, evtchn);
   15.78 +	}
   15.79 +
   15.80 +	irq_bindcount[irq]++;
   15.81 +
   15.82 +	spin_unlock(&irq_mapping_update_lock);
   15.83 +    
   15.84 +	return irq;
   15.85 +}
   15.86 +
   15.87 +static int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
   15.88  {
   15.89  	evtchn_op_t op = { .cmd = EVTCHNOP_bind_virq };
   15.90  	int evtchn, irq;
   15.91 @@ -194,7 +230,7 @@ int bind_virq_to_irq(int virq, int cpu)
   15.92  
   15.93  		irq = find_unbound_irq();
   15.94  		evtchn_to_irq[evtchn] = irq;
   15.95 -		irq_to_evtchn[irq]    = evtchn;
   15.96 +		irq_info[irq] = mk_irq_info(IRQT_VIRQ, virq, evtchn);
   15.97  
   15.98  		per_cpu(virq_to_irq, cpu)[virq] = irq;
   15.99  
  15.100 @@ -207,59 +243,26 @@ int bind_virq_to_irq(int virq, int cpu)
  15.101      
  15.102  	return irq;
  15.103  }
  15.104 -EXPORT_SYMBOL(bind_virq_to_irq);
  15.105  
  15.106 -void unbind_virq_from_irq(int virq, int cpu)
  15.107 -{
  15.108 -	evtchn_op_t op = { .cmd = EVTCHNOP_close };
  15.109 -	int irq    = per_cpu(virq_to_irq, cpu)[virq];
  15.110 -	int evtchn = irq_to_evtchn[irq];
  15.111 -
  15.112 -	spin_lock(&irq_mapping_update_lock);
  15.113 -
  15.114 -	if (--irq_bindcount[irq] == 0) {
  15.115 -		op.u.close.port = evtchn;
  15.116 -		BUG_ON(HYPERVISOR_event_channel_op(&op) != 0);
  15.117 -
  15.118 -		/*
  15.119 -		 * This is a slight hack. Interdomain ports can be allocated 
  15.120 -		 * directly by userspace, and at that point they get bound by 
  15.121 -		 * Xen to vcpu 0. We therefore need to make sure that if we get
  15.122 -		 * an event on an event channel we don't know about vcpu 0 
  15.123 -		 * handles it. Binding channels to vcpu 0 when closing them
  15.124 -		 * achieves this.
  15.125 -		 */
  15.126 -		bind_evtchn_to_cpu(evtchn, 0);
  15.127 -		evtchn_to_irq[evtchn] = -1;
  15.128 -		irq_to_evtchn[irq]    = -1;
  15.129 -		per_cpu(virq_to_irq, cpu)[virq] = -1;
  15.130 -	}
  15.131 -
  15.132 -	spin_unlock(&irq_mapping_update_lock);
  15.133 -}
  15.134 -EXPORT_SYMBOL(unbind_virq_from_irq);
  15.135 -
  15.136 -int bind_ipi_to_irq(int ipi, int cpu)
  15.137 +static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu)
  15.138  {
  15.139  	evtchn_op_t op = { .cmd = EVTCHNOP_bind_ipi };
  15.140  	int evtchn, irq;
  15.141  
  15.142  	spin_lock(&irq_mapping_update_lock);
  15.143  
  15.144 -	if ((evtchn = per_cpu(ipi_to_evtchn, cpu)[ipi]) == -1) {
  15.145 +	if ((irq = per_cpu(ipi_to_irq, cpu)[ipi]) == -1) {
  15.146  		op.u.bind_ipi.vcpu = cpu;
  15.147  		BUG_ON(HYPERVISOR_event_channel_op(&op) != 0);
  15.148  		evtchn = op.u.bind_ipi.port;
  15.149  
  15.150  		irq = find_unbound_irq();
  15.151  		evtchn_to_irq[evtchn] = irq;
  15.152 -		irq_to_evtchn[irq]    = evtchn;
  15.153 +		irq_info[irq] = mk_irq_info(IRQT_IPI, ipi, evtchn);
  15.154  
  15.155 -		per_cpu(ipi_to_evtchn, cpu)[ipi] = evtchn;
  15.156 +		per_cpu(ipi_to_irq, cpu)[ipi] = irq;
  15.157  
  15.158  		bind_evtchn_to_cpu(evtchn, cpu);
  15.159 -	} else {
  15.160 -		irq = evtchn_to_irq[evtchn];
  15.161  	}
  15.162  
  15.163  	irq_bindcount[irq]++;
  15.164 @@ -268,63 +271,36 @@ int bind_ipi_to_irq(int ipi, int cpu)
  15.165  
  15.166  	return irq;
  15.167  }
  15.168 -EXPORT_SYMBOL(bind_ipi_to_irq);
  15.169  
  15.170 -void unbind_ipi_from_irq(int ipi, int cpu)
  15.171 +static void unbind_from_irq(unsigned int irq)
  15.172  {
  15.173  	evtchn_op_t op = { .cmd = EVTCHNOP_close };
  15.174 -	int evtchn = per_cpu(ipi_to_evtchn, cpu)[ipi];
  15.175 -	int irq    = evtchn_to_irq[evtchn];
  15.176 +	int evtchn = evtchn_from_irq(irq);
  15.177  
  15.178  	spin_lock(&irq_mapping_update_lock);
  15.179  
  15.180 -	if (--irq_bindcount[irq] == 0) {
  15.181 +	if ((--irq_bindcount[irq] == 0) && VALID_EVTCHN(evtchn)) {
  15.182  		op.u.close.port = evtchn;
  15.183  		BUG_ON(HYPERVISOR_event_channel_op(&op) != 0);
  15.184  
  15.185 -		/* See comments in unbind_virq_from_irq */
  15.186 -		bind_evtchn_to_cpu(evtchn, 0);
  15.187 -		evtchn_to_irq[evtchn] = -1;
  15.188 -		irq_to_evtchn[irq]    = -1;
  15.189 -		per_cpu(ipi_to_evtchn, cpu)[ipi] = -1;
  15.190 -	}
  15.191 -
  15.192 -	spin_unlock(&irq_mapping_update_lock);
  15.193 -}
  15.194 -EXPORT_SYMBOL(unbind_ipi_from_irq);
  15.195 -
  15.196 -static int bind_evtchn_to_irq(unsigned int evtchn)
  15.197 -{
  15.198 -	int irq;
  15.199 -
  15.200 -	spin_lock(&irq_mapping_update_lock);
  15.201 +		switch (type_from_irq(irq)) {
  15.202 +		case IRQT_VIRQ:
  15.203 +			per_cpu(virq_to_irq, cpu_from_evtchn(evtchn))
  15.204 +				[index_from_irq(irq)] = -1;
  15.205 +			break;
  15.206 +		case IRQT_IPI:
  15.207 +			per_cpu(ipi_to_irq, cpu_from_evtchn(evtchn))
  15.208 +				[index_from_irq(irq)] = -1;
  15.209 +			break;
  15.210 +		default:
  15.211 +			break;
  15.212 +		}
  15.213  
  15.214 -	if ((irq = evtchn_to_irq[evtchn]) == -1) {
  15.215 -		irq = find_unbound_irq();
  15.216 -		evtchn_to_irq[evtchn] = irq;
  15.217 -		irq_to_evtchn[irq]    = evtchn;
  15.218 -	}
  15.219 -
  15.220 -	irq_bindcount[irq]++;
  15.221 -
  15.222 -	spin_unlock(&irq_mapping_update_lock);
  15.223 -    
  15.224 -	return irq;
  15.225 -}
  15.226 -
  15.227 -static void unbind_evtchn_from_irq(unsigned int irq)
  15.228 -{
  15.229 -	evtchn_op_t op = { .cmd = EVTCHNOP_close };
  15.230 -	int evtchn = irq_to_evtchn[irq];
  15.231 -
  15.232 -	spin_lock(&irq_mapping_update_lock);
  15.233 -
  15.234 -	if ((--irq_bindcount[irq] == 0) && (evtchn != -1)) {
  15.235 -		op.u.close.port = evtchn;
  15.236 -		BUG_ON(HYPERVISOR_event_channel_op(&op) != 0);
  15.237 +		/* Closed ports are implicitly re-bound to VCPU0. */
  15.238 +		bind_evtchn_to_cpu(evtchn, 0);
  15.239  
  15.240  		evtchn_to_irq[evtchn] = -1;
  15.241 -		irq_to_evtchn[irq]    = -1;
  15.242 +		irq_info[irq] = IRQ_UNBOUND;
  15.243  	}
  15.244  
  15.245  	spin_unlock(&irq_mapping_update_lock);
  15.246 @@ -343,7 +319,7 @@ int bind_evtchn_to_irqhandler(
  15.247  	irq = bind_evtchn_to_irq(evtchn);
  15.248  	retval = request_irq(irq, handler, irqflags, devname, dev_id);
  15.249  	if (retval != 0) {
  15.250 -		unbind_evtchn_from_irq(irq);
  15.251 +		unbind_from_irq(irq);
  15.252  		return retval;
  15.253  	}
  15.254  
  15.255 @@ -351,12 +327,56 @@ int bind_evtchn_to_irqhandler(
  15.256  }
  15.257  EXPORT_SYMBOL(bind_evtchn_to_irqhandler);
  15.258  
  15.259 -void unbind_evtchn_from_irqhandler(unsigned int irq, void *dev_id)
  15.260 +int bind_virq_to_irqhandler(
  15.261 +	unsigned int virq,
  15.262 +	unsigned int cpu,
  15.263 +	irqreturn_t (*handler)(int, void *, struct pt_regs *),
  15.264 +	unsigned long irqflags,
  15.265 +	const char *devname,
  15.266 +	void *dev_id)
  15.267 +{
  15.268 +	unsigned int irq;
  15.269 +	int retval;
  15.270 +
  15.271 +	irq = bind_virq_to_irq(virq, cpu);
  15.272 +	retval = request_irq(irq, handler, irqflags, devname, dev_id);
  15.273 +	if (retval != 0) {
  15.274 +		unbind_from_irq(irq);
  15.275 +		return retval;
  15.276 +	}
  15.277 +
  15.278 +	return irq;
  15.279 +}
  15.280 +EXPORT_SYMBOL(bind_virq_to_irqhandler);
  15.281 +
  15.282 +int bind_ipi_to_irqhandler(
  15.283 +	unsigned int ipi,
  15.284 +	unsigned int cpu,
  15.285 +	irqreturn_t (*handler)(int, void *, struct pt_regs *),
  15.286 +	unsigned long irqflags,
  15.287 +	const char *devname,
  15.288 +	void *dev_id)
  15.289 +{
  15.290 +	unsigned int irq;
  15.291 +	int retval;
  15.292 +
  15.293 +	irq = bind_ipi_to_irq(ipi, cpu);
  15.294 +	retval = request_irq(irq, handler, irqflags, devname, dev_id);
  15.295 +	if (retval != 0) {
  15.296 +		unbind_from_irq(irq);
  15.297 +		return retval;
  15.298 +	}
  15.299 +
  15.300 +	return irq;
  15.301 +}
  15.302 +EXPORT_SYMBOL(bind_ipi_to_irqhandler);
  15.303 +
  15.304 +void unbind_from_irqhandler(unsigned int irq, void *dev_id)
  15.305  {
  15.306  	free_irq(irq, dev_id);
  15.307 -	unbind_evtchn_from_irq(irq);
  15.308 +	unbind_from_irq(irq);
  15.309  }
  15.310 -EXPORT_SYMBOL(unbind_evtchn_from_irqhandler);
  15.311 +EXPORT_SYMBOL(unbind_from_irqhandler);
  15.312  
  15.313  #ifdef CONFIG_SMP
  15.314  static void do_nothing_function(void *ign)
  15.315 @@ -371,7 +391,8 @@ static void rebind_irq_to_cpu(unsigned i
  15.316  	int evtchn;
  15.317  
  15.318  	spin_lock(&irq_mapping_update_lock);
  15.319 -	evtchn = irq_to_evtchn[irq];
  15.320 +
  15.321 +	evtchn = evtchn_from_irq(irq);
  15.322  	if (!VALID_EVTCHN(evtchn)) {
  15.323  		spin_unlock(&irq_mapping_update_lock);
  15.324  		return;
  15.325 @@ -418,7 +439,7 @@ static void set_affinity_irq(unsigned ir
  15.326  
  15.327  static unsigned int startup_dynirq(unsigned int irq)
  15.328  {
  15.329 -	int evtchn = irq_to_evtchn[irq];
  15.330 +	int evtchn = evtchn_from_irq(irq);
  15.331  
  15.332  	if (VALID_EVTCHN(evtchn))
  15.333  		unmask_evtchn(evtchn);
  15.334 @@ -427,7 +448,7 @@ static unsigned int startup_dynirq(unsig
  15.335  
  15.336  static void shutdown_dynirq(unsigned int irq)
  15.337  {
  15.338 -	int evtchn = irq_to_evtchn[irq];
  15.339 +	int evtchn = evtchn_from_irq(irq);
  15.340  
  15.341  	if (VALID_EVTCHN(evtchn))
  15.342  		mask_evtchn(evtchn);
  15.343 @@ -435,7 +456,7 @@ static void shutdown_dynirq(unsigned int
  15.344  
  15.345  static void enable_dynirq(unsigned int irq)
  15.346  {
  15.347 -	int evtchn = irq_to_evtchn[irq];
  15.348 +	int evtchn = evtchn_from_irq(irq);
  15.349  
  15.350  	if (VALID_EVTCHN(evtchn))
  15.351  		unmask_evtchn(evtchn);
  15.352 @@ -443,7 +464,7 @@ static void enable_dynirq(unsigned int i
  15.353  
  15.354  static void disable_dynirq(unsigned int irq)
  15.355  {
  15.356 -	int evtchn = irq_to_evtchn[irq];
  15.357 +	int evtchn = evtchn_from_irq(irq);
  15.358  
  15.359  	if (VALID_EVTCHN(evtchn))
  15.360  		mask_evtchn(evtchn);
  15.361 @@ -451,7 +472,7 @@ static void disable_dynirq(unsigned int 
  15.362  
  15.363  static void ack_dynirq(unsigned int irq)
  15.364  {
  15.365 -	int evtchn = irq_to_evtchn[irq];
  15.366 +	int evtchn = evtchn_from_irq(irq);
  15.367  
  15.368  	if (VALID_EVTCHN(evtchn)) {
  15.369  		mask_evtchn(evtchn);
  15.370 @@ -461,7 +482,7 @@ static void ack_dynirq(unsigned int irq)
  15.371  
  15.372  static void end_dynirq(unsigned int irq)
  15.373  {
  15.374 -	int evtchn = irq_to_evtchn[irq];
  15.375 +	int evtchn = evtchn_from_irq(irq);
  15.376  
  15.377  	if (VALID_EVTCHN(evtchn) && !(irq_desc[irq].status & IRQ_DISABLED))
  15.378  		unmask_evtchn(evtchn);
  15.379 @@ -507,7 +528,7 @@ static inline void pirq_query_unmask(int
  15.380  static unsigned int startup_pirq(unsigned int irq)
  15.381  {
  15.382  	evtchn_op_t op = { .cmd = EVTCHNOP_bind_pirq };
  15.383 -	int evtchn = irq_to_evtchn[irq];
  15.384 +	int evtchn = evtchn_from_irq(irq);
  15.385  
  15.386  	if (VALID_EVTCHN(evtchn))
  15.387  		goto out;
  15.388 @@ -527,7 +548,7 @@ static unsigned int startup_pirq(unsigne
  15.389  
  15.390  	bind_evtchn_to_cpu(evtchn, 0);
  15.391  	evtchn_to_irq[evtchn] = irq;
  15.392 -	irq_to_evtchn[irq]    = evtchn;
  15.393 +	irq_info[irq] = mk_irq_info(IRQT_PIRQ, irq, evtchn);
  15.394  
  15.395   out:
  15.396  	unmask_evtchn(evtchn);
  15.397 @@ -539,7 +560,7 @@ static unsigned int startup_pirq(unsigne
  15.398  static void shutdown_pirq(unsigned int irq)
  15.399  {
  15.400  	evtchn_op_t op = { .cmd = EVTCHNOP_close };
  15.401 -	int evtchn = irq_to_evtchn[irq];
  15.402 +	int evtchn = evtchn_from_irq(irq);
  15.403  
  15.404  	if (!VALID_EVTCHN(evtchn))
  15.405  		return;
  15.406 @@ -551,12 +572,12 @@ static void shutdown_pirq(unsigned int i
  15.407  
  15.408  	bind_evtchn_to_cpu(evtchn, 0);
  15.409  	evtchn_to_irq[evtchn] = -1;
  15.410 -	irq_to_evtchn[irq]    = -1;
  15.411 +	irq_info[irq] = IRQ_UNBOUND;
  15.412  }
  15.413  
  15.414  static void enable_pirq(unsigned int irq)
  15.415  {
  15.416 -	int evtchn = irq_to_evtchn[irq];
  15.417 +	int evtchn = evtchn_from_irq(irq);
  15.418  
  15.419  	if (VALID_EVTCHN(evtchn)) {
  15.420  		unmask_evtchn(evtchn);
  15.421 @@ -566,7 +587,7 @@ static void enable_pirq(unsigned int irq
  15.422  
  15.423  static void disable_pirq(unsigned int irq)
  15.424  {
  15.425 -	int evtchn = irq_to_evtchn[irq];
  15.426 +	int evtchn = evtchn_from_irq(irq);
  15.427  
  15.428  	if (VALID_EVTCHN(evtchn))
  15.429  		mask_evtchn(evtchn);
  15.430 @@ -574,7 +595,7 @@ static void disable_pirq(unsigned int ir
  15.431  
  15.432  static void ack_pirq(unsigned int irq)
  15.433  {
  15.434 -	int evtchn = irq_to_evtchn[irq];
  15.435 +	int evtchn = evtchn_from_irq(irq);
  15.436  
  15.437  	if (VALID_EVTCHN(evtchn)) {
  15.438  		mask_evtchn(evtchn);
  15.439 @@ -584,7 +605,7 @@ static void ack_pirq(unsigned int irq)
  15.440  
  15.441  static void end_pirq(unsigned int irq)
  15.442  {
  15.443 -	int evtchn = irq_to_evtchn[irq];
  15.444 +	int evtchn = evtchn_from_irq(irq);
  15.445  
  15.446  	if (VALID_EVTCHN(evtchn) && !(irq_desc[irq].status & IRQ_DISABLED)) {
  15.447  		unmask_evtchn(evtchn);
  15.448 @@ -605,7 +626,7 @@ static struct hw_interrupt_type pirq_typ
  15.449  
  15.450  void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
  15.451  {
  15.452 -	int evtchn = irq_to_evtchn[i];
  15.453 +	int evtchn = evtchn_from_irq(i);
  15.454  	shared_info_t *s = HYPERVISOR_shared_info;
  15.455  	if (!VALID_EVTCHN(evtchn))
  15.456  		return;
  15.457 @@ -615,7 +636,7 @@ void hw_resend_irq(struct hw_interrupt_t
  15.458  
  15.459  void notify_remote_via_irq(int irq)
  15.460  {
  15.461 -	int evtchn = irq_to_evtchn[irq];
  15.462 +	int evtchn = evtchn_from_irq(irq);
  15.463  
  15.464  	if (VALID_EVTCHN(evtchn))
  15.465  		notify_remote_via_evtchn(evtchn);
  15.466 @@ -635,25 +656,29 @@ void irq_resume(void)
  15.467  
  15.468  	/* Check that no PIRQs are still bound. */
  15.469  	for (pirq = 0; pirq < NR_PIRQS; pirq++)
  15.470 -		BUG_ON(irq_to_evtchn[pirq_to_irq(pirq)] != -1);
  15.471 +		BUG_ON(irq_info[pirq_to_irq(pirq)] != IRQ_UNBOUND);
  15.472  
  15.473  	/* Secondary CPUs must have no VIRQ or IPI bindings. */
  15.474  	for (cpu = 1; cpu < NR_CPUS; cpu++) {
  15.475  		for (virq = 0; virq < NR_VIRQS; virq++)
  15.476  			BUG_ON(per_cpu(virq_to_irq, cpu)[virq] != -1);
  15.477  		for (ipi = 0; ipi < NR_IPIS; ipi++)
  15.478 -			BUG_ON(per_cpu(ipi_to_evtchn, cpu)[ipi] != -1);
  15.479 +			BUG_ON(per_cpu(ipi_to_irq, cpu)[ipi] != -1);
  15.480  	}
  15.481  
  15.482 -	/* No IRQ -> event-channel mappings. */
  15.483 +	/* No IRQ <-> event-channel mappings. */
  15.484  	for (irq = 0; irq < NR_IRQS; irq++)
  15.485 -		irq_to_evtchn[irq] = -1;
  15.486 +		irq_info[irq] &= ~0xFFFF; /* zap event-channel binding */
  15.487 +	for (evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++)
  15.488 +		evtchn_to_irq[evtchn] = -1;
  15.489  
  15.490  	/* Primary CPU: rebind VIRQs automatically. */
  15.491  	for (virq = 0; virq < NR_VIRQS; virq++) {
  15.492  		if ((irq = per_cpu(virq_to_irq, 0)[virq]) == -1)
  15.493  			continue;
  15.494  
  15.495 +		BUG_ON(irq_info[irq] != mk_irq_info(IRQT_VIRQ, virq, 0));
  15.496 +
  15.497  		/* Get a new binding from Xen. */
  15.498  		memset(&op, 0, sizeof(op));
  15.499  		op.cmd              = EVTCHNOP_bind_virq;
  15.500 @@ -664,7 +689,7 @@ void irq_resume(void)
  15.501          
  15.502  		/* Record the new mapping. */
  15.503  		evtchn_to_irq[evtchn] = irq;
  15.504 -		irq_to_evtchn[irq]    = evtchn;
  15.505 +		irq_info[irq] = mk_irq_info(IRQT_VIRQ, virq, evtchn);
  15.506  
  15.507  		/* Ready for use. */
  15.508  		unmask_evtchn(evtchn);
  15.509 @@ -672,11 +697,10 @@ void irq_resume(void)
  15.510  
  15.511  	/* Primary CPU: rebind IPIs automatically. */
  15.512  	for (ipi = 0; ipi < NR_IPIS; ipi++) {
  15.513 -		if ((evtchn = per_cpu(ipi_to_evtchn, 0)[ipi]) == -1)
  15.514 +		if ((irq = per_cpu(ipi_to_irq, 0)[ipi]) == -1)
  15.515  			continue;
  15.516  
  15.517 -		irq = evtchn_to_irq[evtchn];
  15.518 -		evtchn_to_irq[evtchn] = -1;
  15.519 +		BUG_ON(irq_info[irq] != mk_irq_info(IRQT_IPI, ipi, 0));
  15.520  
  15.521  		/* Get a new binding from Xen. */
  15.522  		memset(&op, 0, sizeof(op));
  15.523 @@ -687,18 +711,11 @@ void irq_resume(void)
  15.524          
  15.525  		/* Record the new mapping. */
  15.526  		evtchn_to_irq[evtchn] = irq;
  15.527 -		irq_to_evtchn[irq]    = evtchn;
  15.528 +		irq_info[irq] = mk_irq_info(IRQT_IPI, ipi, evtchn);
  15.529  
  15.530  		/* Ready for use. */
  15.531  		unmask_evtchn(evtchn);
  15.532  	}
  15.533 -
  15.534 -	/* Remove defunct event-channel -> IRQ mappings. */
  15.535 -	for (evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++) {
  15.536 -		if ((evtchn_to_irq[evtchn] != -1) &&
  15.537 -		    (irq_to_evtchn[evtchn_to_irq[evtchn]] == -1))
  15.538 -			evtchn_to_irq[evtchn] = -1;
  15.539 -	}
  15.540  }
  15.541  
  15.542  void __init init_IRQ(void)
  15.543 @@ -717,7 +734,7 @@ void __init init_IRQ(void)
  15.544  		for (i = 0; i < NR_VIRQS; i++)
  15.545  			per_cpu(virq_to_irq, cpu)[i] = -1;
  15.546  		for (i = 0; i < NR_IPIS; i++)
  15.547 -			per_cpu(ipi_to_evtchn, cpu)[i] = -1;
  15.548 +			per_cpu(ipi_to_irq, cpu)[i] = -1;
  15.549  	}
  15.550  
  15.551  	/* No event-channel -> IRQ mappings. */
  15.552 @@ -728,7 +745,7 @@ void __init init_IRQ(void)
  15.553  
  15.554  	/* No IRQ -> event-channel mappings. */
  15.555  	for (i = 0; i < NR_IRQS; i++)
  15.556 -		irq_to_evtchn[i] = -1;
  15.557 +		irq_info[i] = IRQ_UNBOUND;
  15.558  
  15.559  	/* Dynamic IRQ space is currently unbound. Zero the refcnts. */
  15.560  	for (i = 0; i < NR_DYNIRQS; i++) {
    16.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c	Thu Nov 10 08:18:25 2005 -0600
    16.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c	Thu Nov 10 08:34:09 2005 -0600
    16.3 @@ -43,6 +43,7 @@ EXPORT_SYMBOL(gnttab_free_grant_referenc
    16.4  EXPORT_SYMBOL(gnttab_free_grant_reference);
    16.5  EXPORT_SYMBOL(gnttab_claim_grant_reference);
    16.6  EXPORT_SYMBOL(gnttab_release_grant_reference);
    16.7 +EXPORT_SYMBOL(gnttab_request_free_callback);
    16.8  EXPORT_SYMBOL(gnttab_grant_foreign_access_ref);
    16.9  EXPORT_SYMBOL(gnttab_grant_foreign_transfer_ref);
   16.10  
   16.11 @@ -337,53 +338,7 @@ gnttab_request_free_callback(struct gntt
   16.12  #ifdef CONFIG_PROC_FS
   16.13  
   16.14  static struct proc_dir_entry *grant_pde;
   16.15 -
   16.16 -static int
   16.17 -grant_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
   16.18 -	    unsigned long data)
   16.19 -{
   16.20 -	int                     ret;
   16.21 -	privcmd_hypercall_t     hypercall;
   16.22 -
   16.23 -	/*
   16.24 -	 * XXX Need safety checks here if using for anything other
   16.25 -	 *     than debugging.
   16.26 -	 */
   16.27 -	return -ENOSYS;
   16.28 -
   16.29 -	if ( cmd != IOCTL_PRIVCMD_HYPERCALL )
   16.30 -		return -ENOSYS;
   16.31 -
   16.32 -	if ( copy_from_user(&hypercall, (void *)data, sizeof(hypercall)) )
   16.33 -		return -EFAULT;
   16.34 -
   16.35 -	if ( hypercall.op != __HYPERVISOR_grant_table_op )
   16.36 -		return -ENOSYS;
   16.37 -
   16.38 -#ifdef __ia64__
   16.39 -	ret = HYPERVISOR_grant_table_op(hypercall.arg[0], (void *)hypercall.arg[1], hypercall.arg[2]);
   16.40 -#else
   16.41 -	/* hypercall-invoking asm taken from privcmd.c */
   16.42 -	__asm__ __volatile__ (
   16.43 -		"pushl %%ebx; pushl %%ecx; pushl %%edx; "
   16.44 -		"pushl %%esi; pushl %%edi; "
   16.45 -		"movl  4(%%eax),%%ebx ;"
   16.46 -		"movl  8(%%eax),%%ecx ;"
   16.47 -		"movl 12(%%eax),%%edx ;"
   16.48 -		"movl 16(%%eax),%%esi ;"
   16.49 -		"movl 20(%%eax),%%edi ;"
   16.50 -		"movl   (%%eax),%%eax ;"
   16.51 -		TRAP_INSTR "; "
   16.52 -		"popl %%edi; popl %%esi; popl %%edx; popl %%ecx; popl %%ebx"
   16.53 -		: "=a" (ret) : "0" (&hypercall) : "memory" );
   16.54 -#endif
   16.55 -
   16.56 -	return ret;
   16.57 -}
   16.58 -
   16.59 -static struct file_operations grant_file_ops = {
   16.60 -	ioctl:  grant_ioctl,
   16.61 -};
   16.62 +static struct file_operations grant_file_ops;
   16.63  
   16.64  static int
   16.65  grant_read(char *page, char **start, off_t off, int count, int *eof,
    17.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c	Thu Nov 10 08:18:25 2005 -0600
    17.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c	Thu Nov 10 08:34:09 2005 -0600
    17.3 @@ -20,6 +20,37 @@
    17.4  #define MAX_SKBUFF_ORDER 2
    17.5  static kmem_cache_t *skbuff_order_cachep[MAX_SKBUFF_ORDER + 1];
    17.6  
    17.7 +static struct {
    17.8 +	int size;
    17.9 +	kmem_cache_t *cachep;
   17.10 +} skbuff_small[] = { { 512, NULL }, { 2048, NULL } };
   17.11 +
   17.12 +struct sk_buff *alloc_skb(unsigned int length, int gfp_mask)
   17.13 +{
   17.14 +	int order, i;
   17.15 +	kmem_cache_t *cachep;
   17.16 +
   17.17 +	length = SKB_DATA_ALIGN(length) + sizeof(struct skb_shared_info);
   17.18 +
   17.19 +	if (length <= skbuff_small[ARRAY_SIZE(skbuff_small)-1].size) {
   17.20 +		for (i = 0; skbuff_small[i].size < length; i++)
   17.21 +			continue;
   17.22 +		cachep = skbuff_small[i].cachep;
   17.23 +	} else {
   17.24 +		order = get_order(length);
   17.25 +		if (order > MAX_SKBUFF_ORDER) {
   17.26 +			printk(KERN_ALERT "Attempt to allocate order %d "
   17.27 +			       "skbuff. Increase MAX_SKBUFF_ORDER.\n", order);
   17.28 +			return NULL;
   17.29 +		}
   17.30 +		cachep = skbuff_order_cachep[order];
   17.31 +	}
   17.32 +
   17.33 +	length -= sizeof(struct skb_shared_info);
   17.34 +
   17.35 +	return alloc_skb_from_cache(cachep, length, gfp_mask);
   17.36 +}
   17.37 +
   17.38  struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask)
   17.39  {
   17.40  	struct sk_buff *skb;
   17.41 @@ -48,8 +79,10 @@ static void skbuff_ctor(void *buf, kmem_
   17.42  	while (skbuff_order_cachep[order] != cachep)
   17.43  		order++;
   17.44  
   17.45 +	/* Do our best to allocate contiguous memory but fall back to IOMMU. */
   17.46  	if (order != 0)
   17.47 -		xen_create_contiguous_region((unsigned long)buf, order);
   17.48 +		(void)xen_create_contiguous_region(
   17.49 +			(unsigned long)buf, order, 0);
   17.50  
   17.51  	scrub_pages(buf, 1 << order);
   17.52  }
   17.53 @@ -68,8 +101,20 @@ static void skbuff_dtor(void *buf, kmem_
   17.54  static int __init skbuff_init(void)
   17.55  {
   17.56  	static char name[MAX_SKBUFF_ORDER + 1][20];
   17.57 +	static char small_name[ARRAY_SIZE(skbuff_small)][20];
   17.58  	unsigned long size;
   17.59 -	int order;
   17.60 +	int i, order;
   17.61 +
   17.62 +	for (i = 0; i < ARRAY_SIZE(skbuff_small); i++) {
   17.63 +		size = skbuff_small[i].size;
   17.64 +		sprintf(small_name[i], "xen-skb-%lu", size);
   17.65 +		/*
   17.66 +		 * No ctor/dtor: objects do not span page boundaries, and they
   17.67 +		 * are only used on transmit path so no need for scrubbing.
   17.68 +		 */
   17.69 +		skbuff_small[i].cachep = kmem_cache_create(
   17.70 +			small_name[i], size, size, 0, NULL, NULL);
   17.71 +	}
   17.72  
   17.73  	for (order = 0; order <= MAX_SKBUFF_ORDER; order++) {
   17.74  		size = PAGE_SIZE << order;
   17.75 @@ -82,7 +127,7 @@ static int __init skbuff_init(void)
   17.76  
   17.77  	return 0;
   17.78  }
   17.79 -__initcall(skbuff_init);
   17.80 +core_initcall(skbuff_init);
   17.81  
   17.82  EXPORT_SYMBOL(__dev_alloc_skb);
   17.83  
    18.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c	Thu Nov 10 08:18:25 2005 -0600
    18.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c	Thu Nov 10 08:34:09 2005 -0600
    18.3 @@ -87,18 +87,27 @@ void __init smp_alloc_memory(void)
    18.4  
    18.5  static void xen_smp_intr_init(unsigned int cpu)
    18.6  {
    18.7 +	sprintf(resched_name[cpu], "resched%d", cpu);
    18.8  	per_cpu(resched_irq, cpu) =
    18.9 -		bind_ipi_to_irq(RESCHEDULE_VECTOR, cpu);
   18.10 -	sprintf(resched_name[cpu], "resched%d", cpu);
   18.11 -	BUG_ON(request_irq(per_cpu(resched_irq, cpu), smp_reschedule_interrupt,
   18.12 -	                   SA_INTERRUPT, resched_name[cpu], NULL));
   18.13 +		bind_ipi_to_irqhandler(
   18.14 +			RESCHEDULE_VECTOR,
   18.15 +			cpu,
   18.16 +			smp_reschedule_interrupt,
   18.17 +			SA_INTERRUPT,
   18.18 +			resched_name[cpu],
   18.19 +			NULL);
   18.20 +	BUG_ON(per_cpu(resched_irq, cpu) < 0);
   18.21  
   18.22 +	sprintf(callfunc_name[cpu], "callfunc%d", cpu);
   18.23  	per_cpu(callfunc_irq, cpu) =
   18.24 -		bind_ipi_to_irq(CALL_FUNCTION_VECTOR, cpu);
   18.25 -	sprintf(callfunc_name[cpu], "callfunc%d", cpu);
   18.26 -	BUG_ON(request_irq(per_cpu(callfunc_irq, cpu),
   18.27 -	                   smp_call_function_interrupt,
   18.28 -	                   SA_INTERRUPT, callfunc_name[cpu], NULL));
   18.29 +		bind_ipi_to_irqhandler(
   18.30 +			CALL_FUNCTION_VECTOR,
   18.31 +			cpu,
   18.32 +			smp_call_function_interrupt,
   18.33 +			SA_INTERRUPT,
   18.34 +			callfunc_name[cpu],
   18.35 +			NULL);
   18.36 +	BUG_ON(per_cpu(callfunc_irq, cpu) < 0);
   18.37  
   18.38  	if (cpu != 0)
   18.39  		local_setup_timer(cpu);
   18.40 @@ -110,11 +119,8 @@ static void xen_smp_intr_exit(unsigned i
   18.41  	if (cpu != 0)
   18.42  		local_teardown_timer(cpu);
   18.43  
   18.44 -	free_irq(per_cpu(resched_irq, cpu), NULL);
   18.45 -	unbind_ipi_from_irq(RESCHEDULE_VECTOR, cpu);
   18.46 -
   18.47 -	free_irq(per_cpu(callfunc_irq, cpu), NULL);
   18.48 -	unbind_ipi_from_irq(CALL_FUNCTION_VECTOR, cpu);
   18.49 +	unbind_from_irqhandler(per_cpu(resched_irq, cpu), NULL);
   18.50 +	unbind_from_irqhandler(per_cpu(callfunc_irq, cpu), NULL);
   18.51  }
   18.52  #endif
   18.53  
    19.1 --- a/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/genapic_xen.c	Thu Nov 10 08:18:25 2005 -0600
    19.2 +++ b/linux-2.6-xen-sparse/arch/xen/x86_64/kernel/genapic_xen.c	Thu Nov 10 08:34:09 2005 -0600
    19.3 @@ -27,13 +27,13 @@
    19.4  #endif
    19.5  #include <asm-xen/evtchn.h>
    19.6  
    19.7 -DECLARE_PER_CPU(int, ipi_to_evtchn[NR_IPIS]);
    19.8 +DECLARE_PER_CPU(int, ipi_to_irq[NR_IPIS]);
    19.9  
   19.10  static inline void __send_IPI_one(unsigned int cpu, int vector)
   19.11  {
   19.12 -	int evtchn = per_cpu(ipi_to_evtchn, cpu)[vector];
   19.13 -	BUG_ON(evtchn < 0);
   19.14 -	notify_remote_via_evtchn(evtchn);
   19.15 +	int irq = per_cpu(ipi_to_irq, cpu)[vector];
   19.16 +	BUG_ON(irq < 0);
   19.17 +	notify_remote_via_irq(irq);
   19.18  }
   19.19  
   19.20  void xen_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest)
    20.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c	Thu Nov 10 08:18:25 2005 -0600
    20.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/interface.c	Thu Nov 10 08:34:09 2005 -0600
    20.3 @@ -125,7 +125,7 @@ static void free_blkif(void *arg)
    20.4  	if (!blkif->irq)
    20.5  		return;
    20.6  
    20.7 -	unbind_evtchn_from_irqhandler(blkif->irq, blkif);
    20.8 +	unbind_from_irqhandler(blkif->irq, blkif);
    20.9  	blkif->irq = 0;
   20.10  
   20.11  	vbd_free(&blkif->vbd);
    21.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/Makefile	Thu Nov 10 08:18:25 2005 -0600
    21.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/Makefile	Thu Nov 10 08:34:09 2005 -0600
    21.3 @@ -1,3 +1,5 @@
    21.4  
    21.5 -obj-y	:= blkfront.o vbd.o
    21.6 +obj-$(CONFIG_XEN_BLKDEV_FRONTEND)	:= xenblk.o
    21.7  
    21.8 +xenblk-objs := blkfront.o vbd.o
    21.9 +
    22.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Thu Nov 10 08:18:25 2005 -0600
    22.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Thu Nov 10 08:34:09 2005 -0600
    22.3 @@ -358,7 +358,7 @@ static void blkif_free(struct blkfront_i
    22.4  		info->ring.sring = NULL;
    22.5  	}
    22.6  	if (info->irq)
    22.7 -		unbind_evtchn_from_irqhandler(info->irq, info); 
    22.8 +		unbind_from_irqhandler(info->irq, info); 
    22.9  	info->evtchn = info->irq = 0;
   22.10  }
   22.11  
   22.12 @@ -641,6 +641,7 @@ static int blkfront_probe(struct xenbus_
   22.13  	info->vdevice = vdevice;
   22.14  	info->connected = BLKIF_STATE_DISCONNECTED;
   22.15  	info->mi = NULL;
   22.16 + 	info->gd = NULL;
   22.17  	INIT_WORK(&info->work, blkif_restart_queue, (void *)info);
   22.18  
   22.19  	info->shadow_free = 0;
    23.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h	Thu Nov 10 08:18:25 2005 -0600
    23.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h	Thu Nov 10 08:34:09 2005 -0600
    23.3 @@ -116,6 +116,7 @@ struct blkfront_info
    23.4  	/* We watch the backend */
    23.5  	struct xenbus_watch watch;
    23.6  	dev_t dev;
    23.7 + 	struct gendisk *gd;
    23.8  	int vdevice;
    23.9  	blkif_vdev_t handle;
   23.10  	int connected;
    24.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Thu Nov 10 08:18:25 2005 -0600
    24.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Thu Nov 10 08:34:09 2005 -0600
    24.3 @@ -259,6 +259,7 @@ xlvbd_alloc_gendisk(int minor, blkif_sec
    24.4  		gd->flags |= GENHD_FL_CD;
    24.5  
    24.6  	add_disk(gd);
    24.7 +	info->gd = gd;
    24.8  
    24.9  	return 0;
   24.10  
   24.11 @@ -292,22 +293,19 @@ void
   24.12  xlvbd_del(struct blkfront_info *info)
   24.13  {
   24.14  	struct block_device *bd;
   24.15 -	struct gendisk *gd;
   24.16 -	int unused;
   24.17 -	request_queue_t *rq;
   24.18  
   24.19  	bd = bdget(info->dev);
   24.20  	if (bd == NULL)
   24.21  		return;
   24.22  
   24.23 -	gd = get_gendisk(info->dev, &unused);
   24.24 -	rq = gd->queue;
   24.25 +	if (info->gd == NULL)
   24.26 +		return;
   24.27  
   24.28 -	del_gendisk(gd);
   24.29 -	put_disk(gd);
   24.30 +	del_gendisk(info->gd);
   24.31 +	put_disk(info->gd);
   24.32  	xlbd_put_major_info(info->mi);
   24.33  	info->mi = NULL;
   24.34 -	blk_cleanup_queue(rq);
   24.35 +	blk_cleanup_queue(info->rq);
   24.36  
   24.37  	bdput(bd);
   24.38  }
    25.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/interface.c	Thu Nov 10 08:18:25 2005 -0600
    25.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/interface.c	Thu Nov 10 08:34:09 2005 -0600
    25.3 @@ -113,7 +113,7 @@ static void free_blkif(void *arg)
    25.4  	blkif_t *blkif = (blkif_t *)arg;
    25.5  
    25.6  	if (blkif->irq)
    25.7 -		unbind_evtchn_from_irqhandler(blkif->irq, blkif);
    25.8 +		unbind_from_irqhandler(blkif->irq, blkif);
    25.9  
   25.10  	if (blkif->blk_ring.sring) {
   25.11  		unmap_frontend_page(blkif);
    26.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c	Thu Nov 10 08:18:25 2005 -0600
    26.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c	Thu Nov 10 08:34:09 2005 -0600
    26.3 @@ -771,15 +771,14 @@ static int __init xencons_init(void)
    26.4  #endif
    26.5  
    26.6  	if (xen_start_info->flags & SIF_INITDOMAIN) {
    26.7 -#ifdef __ia64__
    26.8 -		xencons_priv_irq = bind_virq_to_evtchn(VIRQ_CONSOLE);
    26.9 -		bind_evtchn_to_irqhandler(xencons_priv_irq,
   26.10 -				xencons_priv_interrupt, 0, "console", NULL);
   26.11 -#else
   26.12 -		xencons_priv_irq = bind_virq_to_irq(VIRQ_CONSOLE, 0);
   26.13 -		(void)request_irq(xencons_priv_irq,
   26.14 -				  xencons_priv_interrupt, 0, "console", NULL);
   26.15 -#endif
   26.16 +		xencons_priv_irq = bind_virq_to_irqhandler(
   26.17 +			VIRQ_CONSOLE,
   26.18 +			0,
   26.19 +			xencons_priv_interrupt,
   26.20 +			0,
   26.21 +			"console",
   26.22 +			NULL);
   26.23 +		BUG_ON(xencons_priv_irq < 0);
   26.24  	} else {
   26.25  		xencons_ring_register_receiver(xencons_rx);
   26.26  	}
    27.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c	Thu Nov 10 08:18:25 2005 -0600
    27.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c	Thu Nov 10 08:34:09 2005 -0600
    27.3 @@ -86,7 +86,7 @@ int xencons_ring_init(void)
    27.4  	int err;
    27.5  
    27.6  	if (xencons_irq)
    27.7 -		unbind_evtchn_from_irqhandler(xencons_irq, NULL);
    27.8 +		unbind_from_irqhandler(xencons_irq, NULL);
    27.9  	xencons_irq = 0;
   27.10  
   27.11  	if (!xen_start_info->console_evtchn)
    28.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/interface.c	Thu Nov 10 08:18:25 2005 -0600
    28.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/interface.c	Thu Nov 10 08:34:09 2005 -0600
    28.3 @@ -241,7 +241,7 @@ static void free_netif_callback(void *ar
    28.4  	if (!netif->irq)
    28.5  		return;
    28.6  
    28.7 -	unbind_evtchn_from_irqhandler(netif->irq, netif);
    28.8 +	unbind_from_irqhandler(netif->irq, netif);
    28.9  	netif->irq = 0;
   28.10  
   28.11  	unregister_netdev(netif->dev);
    29.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/loopback.c	Thu Nov 10 08:18:25 2005 -0600
    29.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/loopback.c	Thu Nov 10 08:34:09 2005 -0600
    29.3 @@ -29,7 +29,7 @@
    29.4  #include <linux/skbuff.h>
    29.5  #include <net/dst.h>
    29.6  
    29.7 -static int nloopbacks = 1;
    29.8 +static int nloopbacks = 8;
    29.9  module_param(nloopbacks, int, 0);
   29.10  MODULE_PARM_DESC(nloopbacks, "Number of netback-loopback devices to create");
   29.11  
    30.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Thu Nov 10 08:18:25 2005 -0600
    30.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Thu Nov 10 08:34:09 2005 -0600
    30.3 @@ -822,9 +822,13 @@ static int __init netback_init(void)
    30.4  
    30.5  	netif_xenbus_init();
    30.6  
    30.7 -	(void)request_irq(bind_virq_to_irq(VIRQ_DEBUG, 0),
    30.8 -			  netif_be_dbg, SA_SHIRQ, 
    30.9 -			  "net-be-dbg", &netif_be_dbg);
   30.10 +	(void)bind_virq_to_irqhandler(
   30.11 +		VIRQ_DEBUG,
   30.12 +		0,
   30.13 +		netif_be_dbg,
   30.14 +		SA_SHIRQ, 
   30.15 +		"net-be-dbg",
   30.16 +		&netif_be_dbg);
   30.17  
   30.18  	return 0;
   30.19  }
    31.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/Makefile	Thu Nov 10 08:18:25 2005 -0600
    31.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/Makefile	Thu Nov 10 08:34:09 2005 -0600
    31.3 @@ -1,2 +1,4 @@
    31.4  
    31.5 -obj-y	:= netfront.o
    31.6 +obj-$(CONFIG_XEN_NETDEV_FRONTEND)	:= xennet.o
    31.7 +
    31.8 +xennet-objs := netfront.o
    32.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Nov 10 08:18:25 2005 -0600
    32.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Nov 10 08:34:09 2005 -0600
    32.3 @@ -1049,7 +1049,7 @@ static void netif_free(struct netfront_i
    32.4  	info->rx = NULL;
    32.5  
    32.6  	if (info->irq)
    32.7 -		unbind_evtchn_from_irqhandler(info->irq, info->netdev);
    32.8 +		unbind_from_irqhandler(info->irq, info->netdev);
    32.9  	info->evtchn = info->irq = 0;
   32.10  }
   32.11  
    33.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmback/interface.c	Thu Nov 10 08:18:25 2005 -0600
    33.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmback/interface.c	Thu Nov 10 08:34:09 2005 -0600
    33.3 @@ -162,7 +162,7 @@ static void
    33.4  	tpmif_t *tpmif = (tpmif_t *) arg;
    33.5  
    33.6  	if (tpmif->irq)
    33.7 -		unbind_evtchn_from_irqhandler(tpmif->irq, tpmif);
    33.8 +		unbind_from_irqhandler(tpmif->irq, tpmif);
    33.9  
   33.10  	if (tpmif->tx) {
   33.11  		unmap_frontend_page(tpmif);
    34.1 --- a/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c	Thu Nov 10 08:18:25 2005 -0600
    34.2 +++ b/linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c	Thu Nov 10 08:34:09 2005 -0600
    34.3 @@ -300,7 +300,7 @@ static void destroy_tpmring(struct tpmfr
    34.4  	}
    34.5  
    34.6  	if (tp->irq)
    34.7 -		unbind_evtchn_from_irqhandler(tp->irq, NULL);
    34.8 +		unbind_from_irqhandler(tp->irq, NULL);
    34.9  	tp->evtchn = tp->irq = 0;
   34.10  }
   34.11  
    35.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c	Thu Nov 10 08:18:25 2005 -0600
    35.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c	Thu Nov 10 08:34:09 2005 -0600
    35.3 @@ -177,7 +177,7 @@ int xb_init_comms(void)
    35.4  	int err;
    35.5  
    35.6  	if (xenbus_irq)
    35.7 -		unbind_evtchn_from_irqhandler(xenbus_irq, &xb_waitq);
    35.8 +		unbind_from_irqhandler(xenbus_irq, &xb_waitq);
    35.9  
   35.10  	err = bind_evtchn_to_irqhandler(
   35.11  		xen_start_info->store_evtchn, wake_waiting,
    36.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypervisor.h	Thu Nov 10 08:18:25 2005 -0600
    36.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypervisor.h	Thu Nov 10 08:34:09 2005 -0600
    36.3 @@ -129,8 +129,11 @@ void xen_invlpg_mask(cpumask_t *mask, un
    36.4  #define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
    36.5  #endif /* linux < 2.6.0 */
    36.6  
    36.7 -void xen_create_contiguous_region(unsigned long vstart, unsigned int order);
    36.8 -void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order);
    36.9 +/* Returns zero on success else negative errno. */
   36.10 +int xen_create_contiguous_region(
   36.11 +    unsigned long vstart, unsigned int order, unsigned int address_bits);
   36.12 +void xen_destroy_contiguous_region(
   36.13 +    unsigned long vstart, unsigned int order);
   36.14  
   36.15  #include <asm/hypercall.h>
   36.16  
    37.1 --- a/linux-2.6-xen-sparse/include/asm-xen/evtchn.h	Thu Nov 10 08:18:25 2005 -0600
    37.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/evtchn.h	Thu Nov 10 08:34:09 2005 -0600
    37.3 @@ -43,29 +43,41 @@
    37.4   * LOW-LEVEL DEFINITIONS
    37.5   */
    37.6  
    37.7 -/* Dynamically bind a VIRQ source to Linux IRQ space. */
    37.8 -extern int  bind_virq_to_irq(int virq, int cpu);
    37.9 -extern void unbind_virq_from_irq(int virq, int cpu);
   37.10 -
   37.11 -/* Dynamically bind an IPI source to Linux IRQ space. */
   37.12 -extern int  bind_ipi_to_irq(int ipi, int cpu);
   37.13 -extern void unbind_ipi_from_irq(int ipi, int cpu);
   37.14 -
   37.15  /*
   37.16 - * Dynamically bind an event-channel port to an IRQ-like callback handler.
   37.17 + * Dynamically bind an event source to an IRQ-like callback handler.
   37.18   * On some platforms this may not be implemented via the Linux IRQ subsystem.
   37.19   * The IRQ argument passed to the callback handler is the same as returned
   37.20   * from the bind call. It may not correspond to a Linux IRQ number.
   37.21 - * BIND:   Returns IRQ or error.
   37.22 + * Returns IRQ or negative errno.
   37.23   * UNBIND: Takes IRQ to unbind from; automatically closes the event channel.
   37.24   */
   37.25 -extern int  bind_evtchn_to_irqhandler(
   37.26 +extern int bind_evtchn_to_irqhandler(
   37.27  	unsigned int evtchn,
   37.28  	irqreturn_t (*handler)(int, void *, struct pt_regs *),
   37.29  	unsigned long irqflags,
   37.30  	const char *devname,
   37.31  	void *dev_id);
   37.32 -extern void unbind_evtchn_from_irqhandler(unsigned int irq, void *dev_id);
   37.33 +extern int bind_virq_to_irqhandler(
   37.34 +	unsigned int virq,
   37.35 +	unsigned int cpu,
   37.36 +	irqreturn_t (*handler)(int, void *, struct pt_regs *),
   37.37 +	unsigned long irqflags,
   37.38 +	const char *devname,
   37.39 +	void *dev_id);
   37.40 +extern int bind_ipi_to_irqhandler(
   37.41 +	unsigned int ipi,
   37.42 +	unsigned int cpu,
   37.43 +	irqreturn_t (*handler)(int, void *, struct pt_regs *),
   37.44 +	unsigned long irqflags,
   37.45 +	const char *devname,
   37.46 +	void *dev_id);
   37.47 +
   37.48 +/*
   37.49 + * Common unbind function for all event sources. Takes IRQ to unbind from.
   37.50 + * Automatically closes the underlying event channel (even for bindings
   37.51 + * made with bind_evtchn_to_irqhandler()).
   37.52 + */
   37.53 +extern void unbind_from_irqhandler(unsigned int irq, void *dev_id);
   37.54  
   37.55  /*
   37.56   * Unlike notify_remote_via_evtchn(), this is safe to use across
    38.1 --- a/linux-2.6-xen-sparse/net/core/skbuff.c	Thu Nov 10 08:18:25 2005 -0600
    38.2 +++ b/linux-2.6-xen-sparse/net/core/skbuff.c	Thu Nov 10 08:34:09 2005 -0600
    38.3 @@ -129,6 +129,7 @@ void skb_under_panic(struct sk_buff *skb
    38.4   *	Buffers may only be allocated from interrupts using a @gfp_mask of
    38.5   *	%GFP_ATOMIC.
    38.6   */
    38.7 +#ifndef CONFIG_HAVE_ARCH_ALLOC_SKB
    38.8  struct sk_buff *alloc_skb(unsigned int size, int gfp_mask)
    38.9  {
   38.10  	struct sk_buff *skb;
   38.11 @@ -166,6 +167,7 @@ nodata:
   38.12  	skb = NULL;
   38.13  	goto out;
   38.14  }
   38.15 +#endif /* !CONFIG_HAVE_ARCH_ALLOC_SKB */
   38.16  
   38.17  /**
   38.18   *	alloc_skb_from_cache	-	allocate a network buffer
    39.1 --- a/tools/examples/Makefile	Thu Nov 10 08:18:25 2005 -0600
    39.2 +++ b/tools/examples/Makefile	Thu Nov 10 08:34:09 2005 -0600
    39.3 @@ -26,14 +26,14 @@ XEN_SCRIPTS += network-route vif-route
    39.4  XEN_SCRIPTS += network-nat vif-nat
    39.5  XEN_SCRIPTS += block
    39.6  XEN_SCRIPTS += block-enbd block-nbd
    39.7 -XEN_SCRIPTS += xen-script-common.sh
    39.8 -XEN_SCRIPTS += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
    39.9 -XEN_SCRIPTS += block-common.sh
   39.10 +XEN_SCRIPT_DATA = xen-script-common.sh
   39.11 +XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
   39.12 +XEN_SCRIPT_DATA += block-common.sh
   39.13  
   39.14  XEN_HOTPLUG_DIR = /etc/hotplug
   39.15  XEN_HOTPLUG_SCRIPTS = xen-backend.agent
   39.16  
   39.17 -UDEV_RULES_DIR = /etc/udev/rules.d
   39.18 +UDEV_RULES_DIR = /etc/udev
   39.19  UDEV_RULES = xen-backend.rules
   39.20  
   39.21  DI = $(shell readlink -f $(DISTDIR))
   39.22 @@ -77,6 +77,10 @@ install-scripts:
   39.23  	    do \
   39.24  	    $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
   39.25  	done
   39.26 +	for i in $(XEN_SCRIPT_DATA); \
   39.27 +	    do \
   39.28 +	    $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
   39.29 +	done
   39.30  
   39.31  install-hotplug:
   39.32  	[ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
   39.33 @@ -88,10 +92,12 @@ install-hotplug:
   39.34  
   39.35  install-udev:
   39.36  	[ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
   39.37 -		$(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)
   39.38 +		$(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d
   39.39  	for i in $(UDEV_RULES); \
   39.40  	    do \
   39.41 -	    $(INSTALL_PROG) $$i $(DESTDIR)$(UDEV_RULES_DIR); \
   39.42 +	    $(INSTALL_DATA) $$i $(DESTDIR)$(UDEV_RULES_DIR); \
   39.43 +	    ( cd $(DESTDIR)$(UDEV_RULES_DIR)/rules.d ; \
   39.44 +	        ln -sf ../$$i . ) \
   39.45  	done
   39.46  
   39.47  clean:
    40.1 --- a/tools/examples/README	Thu Nov 10 08:18:25 2005 -0600
    40.2 +++ b/tools/examples/README	Thu Nov 10 08:34:09 2005 -0600
    40.3 @@ -9,20 +9,29 @@ If you write a useful script and would l
    40.4  send it (preferably with a little summary to go in this file) to
    40.5  <xen-devel@lists.sourceforge.net> so we can add it to this directory.
    40.6  
    40.7 +block               - called by xen-backend.agent to bind/unbind dev  
    40.8 +block-common.sh     - sourced by block, block-*
    40.9  block-enbd          - binds/unbinds network block devices
   40.10 -block-file          - binds/unbinds file to loopback device
   40.11 -mem-map.sxp         - memory map xend configuration file.
   40.12 -network             - default network setup script called by xend at startup.
   40.13 -network-route       - default xen network start/stop script.
   40.14 -network-nat         - default xen network start/stop script when using NAT.
   40.15 -vif-bridge          - default virtual network interface setup script.
   40.16 -vif-route           - default xen virtual network start/stop script
   40.17 -vif-nat             - configures vif in routed-nat mode.
   40.18 -xend-config.sxp     - default xend configuration file.
   40.19 -xmexample1          - example configuration script for 'xm create'.
   40.20 -xmexample2          - a more complex configuration script for 'xm create'.
   40.21 +block-nbd           - binds/unbinds network block devices
   40.22 +network-bridge      - xen network start/stop script when using bridging
   40.23 +network-nat         - xen network start/stop script when using NAT
   40.24 +network-route       - xen network start/stop script when using routing
   40.25 +vif-bridge          - virtual network start/stop script in bridged mode
   40.26 +vif-common.sh       - sourced by vif-bridge 
   40.27 +vif-nat             - xen virtual network start/stop script in NAT mode 
   40.28 +vif-route           - xen virtual network start/stop script in routed mode
   40.29 +xen-backend.agent   - calls block, vif-* scripts to add, remove, hotplug 
   40.30 +                      devices  
   40.31 +xen-backend.rules   - hotplug script rules
   40.32 +xend-config.sxp     - default xend configuration file
   40.33 +xen-hotplug-common.sh - sourced by vif-common.sh
   40.34 +xen-network-common.sh - sourced by vif-common.sh
   40.35 +xen-script-common.sh  - sourced by network-bridge, xen-hotplug-common.sh
   40.36 +xmexample1          - example configuration script for 'xm create'
   40.37 +xmexample2          - a more complex configuration script for 'xm create'
   40.38  xmexample3          - an advanced configuration script for 'xm create' 
   40.39 -                      that utilizes the vmid.
   40.40 +                      that utilizes the vmid
   40.41 +xmexample.nbd       - configuration script that uses NBD filesystems
   40.42  xmexample.vmx       - a configuration script for creating a vmx domain with
   40.43 -                      'xm create'.
   40.44 -
   40.45 +                      'xm create'
   40.46 +xmexample.vti       - a configuration script for creating a domain on vti
    41.1 --- a/tools/examples/network-bridge	Thu Nov 10 08:18:25 2005 -0600
    41.2 +++ b/tools/examples/network-bridge	Thu Nov 10 08:34:09 2005 -0600
    41.3 @@ -200,7 +200,9 @@ op_start () {
    41.4  Link $vdev is missing.
    41.5  This may be because you have reached the limit of the number of interfaces
    41.6  that the loopback driver supports.  If the loopback driver is a module, you
    41.7 -may raise this limit by passing it as a parameter (nloopbacks=<N>).
    41.8 +may raise this limit by passing it as a parameter (nloopbacks=<N>); if the
    41.9 +driver is compiled statically into the kernel, then you may set the parameter
   41.10 +using loopback.nloopbacks=<N> on the domain 0 kernel command line.
   41.11  " >&2
   41.12          exit 1
   41.13      fi
    42.1 --- a/tools/examples/xmexample.vti	Thu Nov 10 08:18:25 2005 -0600
    42.2 +++ b/tools/examples/xmexample.vti	Thu Nov 10 08:34:09 2005 -0600
    42.3 @@ -26,6 +26,9 @@ name = "ExampleVMXDomain"
    42.4  # Which CPU to start domain on? 
    42.5  #cpu = -1   # leave to Xen to pick
    42.6  
    42.7 +# Disable vif for now
    42.8 +nics=0
    42.9 +
   42.10  # Optionally define mac and/or bridge for the network interfaces.
   42.11  # Random MACs are assigned if not given.
   42.12  #vif = [ 'mac=aa:00:00:00:00:11, bridge=xen-br0' ]
    43.1 --- a/tools/ioemu/ia64_intrinsic.h	Thu Nov 10 08:18:25 2005 -0600
    43.2 +++ b/tools/ioemu/ia64_intrinsic.h	Thu Nov 10 08:34:09 2005 -0600
    43.3 @@ -236,6 +236,7 @@ u64_t _InterlockedCompareExchange64_acq(
    43.4  #define __ia64_fc(addr)	asm volatile ("fc %0" :: "r"(addr) : "memory")
    43.5  #define ia64_sync_i()	asm volatile (";; sync.i" ::: "memory")
    43.6  
    43.7 +register unsigned long ia64_r13 asm ("r13") __attribute_used__;
    43.8  #define __ia64_getreg(regnum)							\
    43.9  ({										\
   43.10  	uint64_t ia64_intri_res;							\
    44.1 --- a/tools/ioemu/target-i386-dm/Makefile	Thu Nov 10 08:18:25 2005 -0600
    44.2 +++ b/tools/ioemu/target-i386-dm/Makefile	Thu Nov 10 08:34:09 2005 -0600
    44.3 @@ -188,7 +188,7 @@ endif
    44.4  #########################################################
    44.5  
    44.6  DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
    44.7 -LIBS+=-lm -L../../libxc -lxenctrl
    44.8 +LIBS+=-lm -L../../libxc -lxenctrl -lxenguest
    44.9  ifndef CONFIG_USER_ONLY
   44.10  LIBS+=-lz
   44.11  endif
    45.1 --- a/tools/ioemu/vl.c	Thu Nov 10 08:18:25 2005 -0600
    45.2 +++ b/tools/ioemu/vl.c	Thu Nov 10 08:34:09 2005 -0600
    45.3 @@ -523,8 +523,8 @@ int64_t cpu_get_real_ticks(void)
    45.4  
    45.5  #elif defined(__ia64__)
    45.6  #include "ia64_intrinsic.h"
    45.7 -#define cpu_get_reak_ticks()	\
    45.8 -    ia64_getreg(_IA64_REG_AR_ITC)
    45.9 +#define cpu_get_real_ticks()	\
   45.10 +	__ia64_getreg(_IA64_REG_AR_ITC)
   45.11  
   45.12  #else
   45.13  #error unsupported CPU
    46.1 --- a/tools/libxc/Makefile	Thu Nov 10 08:18:25 2005 -0600
    46.2 +++ b/tools/libxc/Makefile	Thu Nov 10 08:34:09 2005 -0600
    46.3 @@ -13,7 +13,6 @@ XEN_ROOT = ../..
    46.4  include $(XEN_ROOT)/tools/Rules.mk
    46.5  
    46.6  SRCS       :=
    46.7 -BUILD_SRCS :=
    46.8  SRCS       += xc_bvtsched.c
    46.9  SRCS       += xc_core.c
   46.10  SRCS       += xc_domain.c
   46.11 @@ -24,25 +23,27 @@ SRCS       += xc_physdev.c
   46.12  SRCS       += xc_private.c
   46.13  SRCS       += xc_sedf.c
   46.14  SRCS       += xc_tbuf.c
   46.15 +
   46.16 +ifeq ($(XEN_TARGET_ARCH),x86_32)
   46.17 +SRCS       += xc_ptrace.c
   46.18 +SRCS       += xc_ptrace_core.c
   46.19 +endif
   46.20 +
   46.21 +BUILD_SRCS :=
   46.22  BUILD_SRCS += xc_linux_build.c
   46.23  BUILD_SRCS += xc_load_bin.c
   46.24  BUILD_SRCS += xc_load_elf.c
   46.25 +BUILD_SRCS += xg_private.c
   46.26  
   46.27  ifeq ($(XEN_TARGET_ARCH),ia64)
   46.28  BUILD_SRCS += xc_ia64_stubs.c
   46.29  else
   46.30 -ifeq ($(XEN_TARGET_ARCH),x86_32)
   46.31 -SRCS       += xc_ptrace.c
   46.32 -SRCS       += xc_ptrace_core.c
   46.33 -endif
   46.34  BUILD_SRCS += xc_load_aout9.c
   46.35  BUILD_SRCS += xc_linux_restore.c
   46.36  BUILD_SRCS += xc_linux_save.c
   46.37  BUILD_SRCS += xc_vmx_build.c
   46.38  endif
   46.39  
   46.40 -BUILD_SRCS += xg_private.c
   46.41 -
   46.42  CFLAGS   += -Wall
   46.43  CFLAGS   += -Werror
   46.44  CFLAGS   += -O3
   46.45 @@ -105,7 +106,7 @@ install: build
   46.46  .PHONY: TAGS clean rpm install all
   46.47  
   46.48  TAGS:
   46.49 -	etags -t $(SRCS) *.h
   46.50 +	etags -t *.c *.h
   46.51  
   46.52  clean:
   46.53  	rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen
    47.1 --- a/tools/libxc/xc_linux_build.c	Thu Nov 10 08:18:25 2005 -0600
    47.2 +++ b/tools/libxc/xc_linux_build.c	Thu Nov 10 08:34:09 2005 -0600
    47.3 @@ -351,7 +351,7 @@ static int setup_guest(int xc_handle,
    47.4          xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, page_array[0]);
    47.5      memset(start_info, 0, sizeof(*start_info));
    47.6      rc = xc_version(xc_handle, XENVER_version, NULL);
    47.7 -    sprintf(start_info->magic, "Xen-%i.%i", rc >> 16, rc & (0xFFFF));
    47.8 +    sprintf(start_info->magic, "xen-%i.%i", rc >> 16, rc & (0xFFFF));
    47.9      start_info->flags        = flags;
   47.10      start_info->store_mfn    = nr_pages - 2;
   47.11      start_info->store_evtchn = store_evtchn;
   47.12 @@ -549,11 +549,10 @@ static int setup_guest(int xc_handle,
   47.13          rc = setup_pg_tables_pae(xc_handle, dom, ctxt,
   47.14                                   dsi.v_start, v_end,
   47.15                                   page_array, vpt_start, vpt_end);
   47.16 -    else {
   47.17 +    else
   47.18          rc = setup_pg_tables(xc_handle, dom, ctxt,
   47.19                               dsi.v_start, v_end,
   47.20                               page_array, vpt_start, vpt_end);
   47.21 -    }
   47.22  #endif
   47.23  #if defined(__x86_64__)
   47.24      rc = setup_pg_tables_64(xc_handle, dom, ctxt,
   47.25 @@ -627,7 +626,7 @@ static int setup_guest(int xc_handle,
   47.26          page_array[(vstartinfo_start-dsi.v_start)>>PAGE_SHIFT]);
   47.27      memset(start_info, 0, sizeof(*start_info));
   47.28      rc = xc_version(xc_handle, XENVER_version, NULL);
   47.29 -    sprintf(start_info->magic, "Xen-%i.%i", rc >> 16, rc & (0xFFFF));
   47.30 +    sprintf(start_info->magic, "xen-%i.%i", rc >> 16, rc & (0xFFFF));
   47.31      start_info->nr_pages     = nr_pages;
   47.32      start_info->shared_info  = shared_info_frame << PAGE_SHIFT;
   47.33      start_info->flags        = flags;
   47.34 @@ -671,8 +670,10 @@ static int setup_guest(int xc_handle,
   47.35      return 0;
   47.36  
   47.37   error_out:
   47.38 -    free(mmu);
   47.39 -    free(page_array);
   47.40 +    if ( mmu != NULL )
   47.41 +        free(mmu);
   47.42 +    if ( page_array != NULL )
   47.43 +        free(page_array);
   47.44      return -1;
   47.45  }
   47.46  #endif
   47.47 @@ -726,7 +727,7 @@ int xc_linux_build(int xc_handle,
   47.48  
   47.49      if ( mlock(&st_ctxt, sizeof(st_ctxt) ) )
   47.50      {   
   47.51 -        PERROR("xc_linux_build: ctxt mlock failed");
   47.52 +        PERROR("%s: ctxt mlock failed", __func__);
   47.53          return 1;
   47.54      }
   47.55  
   47.56 @@ -767,7 +768,8 @@ int xc_linux_build(int xc_handle,
   47.57          close(initrd_fd);
   47.58      if ( initrd_gfd )
   47.59          gzclose(initrd_gfd);
   47.60 -    free(image);
   47.61 +    if ( image != NULL )
   47.62 +        free(image);
   47.63  
   47.64  #ifdef __ia64__
   47.65      /* based on new_thread in xen/arch/ia64/domain.c */
   47.66 @@ -781,7 +783,7 @@ int xc_linux_build(int xc_handle,
   47.67      /* currently done by hypervisor, should move here */
   47.68      /* ctxt->regs.r28 = dom_fw_setup(); */
   47.69      ctxt->vcpu.privregs = 0;
   47.70 -    ctxt->sys_pgnr = nr_pages - 3;
   47.71 +    ctxt->sys_pgnr = 3;
   47.72      i = 0; /* silence unused variable warning */
   47.73  #else /* x86 */
   47.74      /*
   47.75 @@ -856,7 +858,8 @@ int xc_linux_build(int xc_handle,
   47.76          gzclose(initrd_gfd);
   47.77      else if ( initrd_fd >= 0 )
   47.78          close(initrd_fd);
   47.79 -    free(image);
   47.80 +    if ( image != NULL )
   47.81 +        free(image);
   47.82  
   47.83      return -1;
   47.84  }
    48.1 --- a/tools/libxc/xc_linux_restore.c	Thu Nov 10 08:18:25 2005 -0600
    48.2 +++ b/tools/libxc/xc_linux_restore.c	Thu Nov 10 08:34:09 2005 -0600
    48.3 @@ -8,32 +8,30 @@
    48.4  
    48.5  #include <stdlib.h>
    48.6  #include <unistd.h>
    48.7 +
    48.8  #include "xg_private.h"
    48.9 -#include <xenctrl.h>
   48.10 -#include <xen/memory.h>
   48.11 +#include "xg_save_restore.h"
   48.12 +
   48.13 +
   48.14  
   48.15 -#define MAX_BATCH_SIZE 1024
   48.16 +/* max mfn of the whole machine */
   48.17 +static uint32_t max_mfn; 
   48.18  
   48.19 -#define DEBUG 0
   48.20 +/* virtual starting address of the hypervisor */
   48.21 +static uint32_t hvirt_start; 
   48.22  
   48.23 -#if 1
   48.24 -#define ERR(_f, _a...) do { fprintf ( stderr, _f , ## _a ); fflush(stderr); } while(0)
   48.25 -#else
   48.26 -#define ERR(_f, _a...) ((void)0)
   48.27 -#endif
   48.28 +/* #levels of page tables used by the currrent guest */
   48.29 +static uint32_t pt_levels; 
   48.30 +
   48.31 +/* total number of pages used by the current guest */
   48.32 +static unsigned long max_pfn;
   48.33  
   48.34 -#if DEBUG
   48.35 -#define DPRINTF(_f, _a...) do { fprintf ( stdout, _f , ## _a ); fflush(stdout); } while (0)
   48.36 -#else
   48.37 -#define DPRINTF(_f, _a...) ((void)0)
   48.38 -#endif
   48.39 +/* Live mapping of the table mapping each PFN to its current MFN. */
   48.40 +static unsigned long *live_p2m = NULL;
   48.41  
   48.42 -#define PROGRESS 0
   48.43 -#if PROGRESS
   48.44 -#define PPRINTF(_f, _a...) fprintf ( stderr, _f , ## _a ); fflush(stderr)
   48.45 -#else
   48.46 -#define PPRINTF(_f, _a...)
   48.47 -#endif
   48.48 +/* A table mapping each PFN to its new MFN. */
   48.49 +static unsigned long *p2m = NULL;
   48.50 +
   48.51  
   48.52  static ssize_t
   48.53  read_exact(int fd, void *buf, size_t count)
   48.54 @@ -45,24 +43,93 @@ read_exact(int fd, void *buf, size_t cou
   48.55          s = read(fd, &b[r], count - r);
   48.56          if ((s == -1) && (errno == EINTR))
   48.57              continue;
   48.58 -        if (s <= 0)
   48.59 +        if (s <= 0) { 
   48.60              break;
   48.61 +        } 
   48.62          r += s;
   48.63      }
   48.64  
   48.65 -    return r;
   48.66 +    return (r == count) ? 1 : 0; 
   48.67  }
   48.68  
   48.69 -int xc_linux_restore(int xc_handle, int io_fd, uint32_t dom, unsigned long nr_pfns,
   48.70 +
   48.71 +/*
   48.72 +** In the state file (or during transfer), all page-table pages are 
   48.73 +** converted into a 'canonical' form where references to actual mfns 
   48.74 +** are replaced with references to the corresponding pfns. 
   48.75 +** This function inverts that operation, replacing the pfn values with 
   48.76 +** the (now known) appropriate mfn values. 
   48.77 +*/
   48.78 +int uncanonicalize_pagetable(unsigned long type, void *page) 
   48.79 +{ 
   48.80 +    int i, pte_last, xen_start, xen_end; 
   48.81 +    unsigned long pfn; 
   48.82 +    uint64_t pte; 
   48.83 +
   48.84 +    /* 
   48.85 +    ** We need to determine which entries in this page table hold
   48.86 +    ** reserved hypervisor mappings. This depends on the current
   48.87 +    ** page table type as well as the number of paging levels. 
   48.88 +    */
   48.89 +    xen_start = xen_end = pte_last = PAGE_SIZE / ((pt_levels == 2)? 4 : 8); 
   48.90 +    
   48.91 +    if (pt_levels == 2 && type == L2TAB)
   48.92 +        xen_start = (hvirt_start >> L2_PAGETABLE_SHIFT); 
   48.93 +
   48.94 +    if (pt_levels == 3 && type == L3TAB) 
   48.95 +        xen_start = L3_PAGETABLE_ENTRIES_PAE; 
   48.96 +
   48.97 +
   48.98 +    /* Now iterate through the page table, uncanonicalizing each PTE */
   48.99 +    for(i = 0; i < pte_last; i++) { 
  48.100 +        
  48.101 +        if(pt_levels == 2) 
  48.102 +            pte = ((uint32_t *)page)[i]; 
  48.103 +        else 
  48.104 +            pte = ((uint64_t *)page)[i]; 
  48.105 +        
  48.106 +        if(i >= xen_start && i < xen_end) 
  48.107 +            pte = 0; 
  48.108 +        
  48.109 +        if(pte & _PAGE_PRESENT) { 
  48.110 +            
  48.111 +            pfn = pte >> PAGE_SHIFT; 
  48.112 +            
  48.113 +            if(pfn >= max_pfn) { 
  48.114 +                ERR("Frame number in type %lu page table is out of range: "
  48.115 +                    "i=%d pfn=0x%lx max_pfn=%lu", 
  48.116 +                    type >> 28, i, pfn, max_pfn);
  48.117 +                return 0; 
  48.118 +            } 
  48.119 +            
  48.120 +            
  48.121 +            if(type == L1TAB) 
  48.122 +                pte &= (PAGE_SIZE - 1) & ~(_PAGE_GLOBAL | _PAGE_PAT);
  48.123 +            else 
  48.124 +                pte &= (PAGE_SIZE - 1) & ~(_PAGE_GLOBAL | _PAGE_PSE);
  48.125 +            
  48.126 +            pte |= p2m[pfn] << PAGE_SHIFT;
  48.127 +            
  48.128 +            if(pt_levels == 2) 
  48.129 +                ((uint32_t *)page)[i] = (uint32_t)pte; 
  48.130 +            else 
  48.131 +                ((uint64_t *)page)[i] = (uint64_t)pte; 
  48.132 +        }
  48.133 +    }
  48.134 +    
  48.135 +    return 1; 
  48.136 +}
  48.137 +
  48.138 +int xc_linux_restore(int xc_handle, int io_fd, 
  48.139 +                     uint32_t dom, unsigned long nr_pfns, 
  48.140                       unsigned int store_evtchn, unsigned long *store_mfn,
  48.141                       unsigned int console_evtchn, unsigned long *console_mfn)
  48.142  {
  48.143      dom0_op_t op;
  48.144 -    int rc = 1, i, n, k;
  48.145 -    unsigned long mfn, pfn, xpfn;
  48.146 +    int rc = 1, i, n;
  48.147 +    unsigned long mfn, pfn; 
  48.148      unsigned int prev_pc, this_pc;
  48.149      int verify = 0;
  48.150 -    int err;
  48.151  
  48.152      /* The new domain's shared-info frame number. */
  48.153      unsigned long shared_info_frame;
  48.154 @@ -72,29 +139,21 @@ int xc_linux_restore(int xc_handle, int 
  48.155      /* A copy of the CPU context of the guest. */
  48.156      vcpu_guest_context_t ctxt;
  48.157  
  48.158 -    /* A table containg the type of each PFN (/not/ MFN!). */
  48.159 +    /* A table containing the type of each PFN (/not/ MFN!). */
  48.160      unsigned long *pfn_type = NULL;
  48.161  
  48.162      /* A table of MFNs to map in the current region */
  48.163      unsigned long *region_mfn = NULL;
  48.164  
  48.165      /* A temporary mapping, and a copy, of one frame of guest memory. */
  48.166 -    unsigned long *ppage = NULL;
  48.167 +    unsigned long *page = NULL;
  48.168  
  48.169      /* A copy of the pfn-to-mfn table frame list. */
  48.170 -    unsigned long pfn_to_mfn_frame_list[1024];
  48.171 -
  48.172 -    /* A table mapping each PFN to its new MFN. */
  48.173 -    unsigned long *pfn_to_mfn_table = NULL;
  48.174 -
  48.175 -    /* used by mapper for updating the domain's copy of the table */
  48.176 -    unsigned long *live_pfn_to_mfn_table = NULL;
  48.177 +    unsigned long *p2m_frame_list = NULL; 
  48.178  
  48.179      /* A temporary mapping of the guest's start_info page. */
  48.180      start_info_t *start_info;
  48.181  
  48.182 -    int pt_levels = 2; /* XXX auto-detect this */
  48.183 -
  48.184      char *region_base;
  48.185  
  48.186      xc_mmu_t *mmu = NULL;
  48.187 @@ -102,37 +161,60 @@ int xc_linux_restore(int xc_handle, int 
  48.188      /* used by debug verify code */
  48.189      unsigned long buf[PAGE_SIZE/sizeof(unsigned long)];
  48.190  
  48.191 -#define MAX_PIN_BATCH 1024
  48.192      struct mmuext_op pin[MAX_PIN_BATCH];
  48.193      unsigned int nr_pins = 0;
  48.194  
  48.195 -    DPRINTF("xc_linux_restore start: nr_pfns = %lx\n", nr_pfns);
  48.196 +
  48.197 +    max_pfn = nr_pfns; 
  48.198 +
  48.199 +    DPRINTF("xc_linux_restore start: max_pfn = %lx\n", max_pfn);
  48.200 +
  48.201 +
  48.202 +    if(!get_platform_info(xc_handle, dom, 
  48.203 +                          &max_mfn, &hvirt_start, &pt_levels)) {
  48.204 +        ERR("Unable to get platform info."); 
  48.205 +        return 1;
  48.206 +    }
  48.207 +
  48.208  
  48.209      if (mlock(&ctxt, sizeof(ctxt))) {
  48.210 -        /* needed for when we do the build dom0 op, 
  48.211 -           but might as well do early */
  48.212 +        /* needed for build dom0 op, but might as well do early */
  48.213          ERR("Unable to mlock ctxt");
  48.214          return 1;
  48.215      }
  48.216  
  48.217 -    if (read_exact(io_fd, pfn_to_mfn_frame_list, PAGE_SIZE) != PAGE_SIZE) {
  48.218 -        ERR("read pfn_to_mfn_frame_list failed");
  48.219 +
  48.220 +    /* Only have to worry about vcpu 0 even for SMP */
  48.221 +    if (xc_domain_get_vcpu_context( xc_handle, dom, 0, &ctxt)) {
  48.222 +        ERR("Could not get vcpu context");
  48.223          goto out;
  48.224      }
  48.225  
  48.226 +    
  48.227 +    /* Read the saved P2M frame list */
  48.228 +    if(!(p2m_frame_list = malloc(P2M_FL_SIZE))) { 
  48.229 +        ERR("Couldn't allocate p2m_frame_list array");
  48.230 +        goto out;
  48.231 +    }
  48.232 +    
  48.233 +    if (!read_exact(io_fd, p2m_frame_list, P2M_FL_SIZE)) { 
  48.234 +        ERR("read p2m_frame_list failed");
  48.235 +        goto out;
  48.236 +    }
  48.237 +
  48.238 +    
  48.239      /* We want zeroed memory so use calloc rather than malloc. */
  48.240 -    pfn_to_mfn_table = calloc(4, nr_pfns);
  48.241 -    pfn_type = calloc(4, nr_pfns);    
  48.242 -    region_mfn = calloc(4, MAX_BATCH_SIZE);
  48.243 +    p2m        = calloc(sizeof(unsigned long), max_pfn); 
  48.244 +    pfn_type   = calloc(sizeof(unsigned long), max_pfn);    
  48.245 +    region_mfn = calloc(sizeof(unsigned long), MAX_BATCH_SIZE);
  48.246  
  48.247 -    if ((pfn_to_mfn_table == NULL) || (pfn_type == NULL) || 
  48.248 -        (region_mfn == NULL)) {
  48.249 +    if ((p2m == NULL) || (pfn_type == NULL) || (region_mfn == NULL)) {
  48.250          ERR("memory alloc failed");
  48.251          errno = ENOMEM;
  48.252          goto out;
  48.253      }
  48.254      
  48.255 -    if (mlock(region_mfn, 4 * MAX_BATCH_SIZE)) {
  48.256 +    if (mlock(region_mfn, sizeof(unsigned long) * MAX_BATCH_SIZE)) {
  48.257          ERR("Could not mlock region_mfn");
  48.258          goto out;
  48.259      }
  48.260 @@ -146,35 +228,30 @@ int xc_linux_restore(int xc_handle, int 
  48.261      }
  48.262      shared_info_frame = op.u.getdomaininfo.shared_info_frame;
  48.263  
  48.264 -    err = xc_domain_setmaxmem(xc_handle, dom, nr_pfns * PAGE_SIZE / 1024);
  48.265 -    if (err != 0) {
  48.266 +    if(xc_domain_setmaxmem(xc_handle, dom, PFN_TO_KB(max_pfn)) != 0) { 
  48.267          errno = ENOMEM;
  48.268          goto out;
  48.269      }
  48.270 -
  48.271 -    err = xc_domain_memory_increase_reservation(xc_handle, dom,
  48.272 -                                                nr_pfns, 0, 0, NULL);
  48.273 -    if (err != 0) {
  48.274 -        ERR("Failed to increase reservation by %lx\n", 
  48.275 -            nr_pfns * PAGE_SIZE / 1024); 
  48.276 +    
  48.277 +    if(xc_domain_memory_increase_reservation(
  48.278 +           xc_handle, dom, max_pfn, 0, 0, NULL) != 0) { 
  48.279 +        ERR("Failed to increase reservation by %lx KB\n", max_pfn); 
  48.280          errno = ENOMEM;
  48.281          goto out;
  48.282      }
  48.283  
  48.284      /* Build the pfn-to-mfn table. We choose MFN ordering returned by Xen. */
  48.285 -    if (xc_get_pfn_list(xc_handle, dom, pfn_to_mfn_table, nr_pfns) !=
  48.286 -        nr_pfns) {
  48.287 +    if (xc_get_pfn_list(xc_handle, dom, p2m, max_pfn) != max_pfn) {
  48.288          ERR("Did not read correct number of frame numbers for new dom");
  48.289          goto out;
  48.290      }
  48.291 -
  48.292 -    mmu = xc_init_mmu_updates(xc_handle, dom);
  48.293 -    if (mmu == NULL) {
  48.294 +    
  48.295 +    if(!(mmu = xc_init_mmu_updates(xc_handle, dom))) { 
  48.296          ERR("Could not initialise for MMU updates");
  48.297          goto out;
  48.298      }
  48.299  
  48.300 -    DPRINTF("Reloading memory pages:   0%%");
  48.301 +    DPRINTF("Reloading memory pages:   0%%\n");
  48.302  
  48.303      /*
  48.304       * Now simply read each saved frame into its new machine frame.
  48.305 @@ -183,258 +260,229 @@ int xc_linux_restore(int xc_handle, int 
  48.306      prev_pc = 0;
  48.307  
  48.308      n = 0;
  48.309 -    while ( 1 )
  48.310 -    {
  48.311 +    while (1) { 
  48.312 +
  48.313          int j;
  48.314          unsigned long region_pfn_type[MAX_BATCH_SIZE];
  48.315  
  48.316 -        this_pc = (n * 100) / nr_pfns;
  48.317 +        this_pc = (n * 100) / max_pfn;
  48.318          if ( (this_pc - prev_pc) >= 5 )
  48.319          {
  48.320              PPRINTF("\b\b\b\b%3d%%", this_pc);
  48.321              prev_pc = this_pc;
  48.322          }
  48.323  
  48.324 -        if ( read_exact(io_fd, &j, sizeof(int)) != sizeof(int) )
  48.325 -        {
  48.326 +        if (!read_exact(io_fd, &j, sizeof(int))) { 
  48.327              ERR("Error when reading batch size");
  48.328              goto out;
  48.329          }
  48.330  
  48.331          PPRINTF("batch %d\n",j);
  48.332   
  48.333 -        if ( j == -1 )
  48.334 -        {
  48.335 +        if (j == -1) {
  48.336              verify = 1;
  48.337 -            printf("Entering page verify mode\n");
  48.338 +            fprintf(stderr, "Entering page verify mode\n");
  48.339              continue;
  48.340          }
  48.341  
  48.342 -        if ( j == 0 )
  48.343 +        if (j == 0)
  48.344              break;  /* our work here is done */
  48.345  
  48.346 -        if ( j > MAX_BATCH_SIZE )
  48.347 -        {
  48.348 +        if (j > MAX_BATCH_SIZE) { 
  48.349              ERR("Max batch size exceeded. Giving up.");
  48.350              goto out;
  48.351          }
  48.352   
  48.353 -        if ( read_exact(io_fd, region_pfn_type, j*sizeof(unsigned long)) !=
  48.354 -             j*sizeof(unsigned long) ) {
  48.355 +        if (!read_exact(io_fd, region_pfn_type, j*sizeof(unsigned long))) { 
  48.356              ERR("Error when reading region pfn types");
  48.357              goto out;
  48.358          }
  48.359  
  48.360 -        for ( i = 0; i < j; i++ )
  48.361 -        {
  48.362 -            if ( (region_pfn_type[i] & LTAB_MASK) == XTAB)
  48.363 -            {
  48.364 +        for (i = 0; i < j; i++) { 
  48.365 +
  48.366 +            if ((region_pfn_type[i] & LTAB_MASK) == XTAB)
  48.367                  region_mfn[i] = 0; /* we know map will fail, but don't care */
  48.368 -            }
  48.369 -            else
  48.370 -            {  
  48.371 -                pfn = region_pfn_type[i] & ~LTAB_MASK;
  48.372 -                region_mfn[i] = pfn_to_mfn_table[pfn];
  48.373 -            }          
  48.374 +            else 
  48.375 +                region_mfn[i] = p2m[region_pfn_type[i] & ~LTAB_MASK]; 
  48.376 +
  48.377          }
  48.378   
  48.379 -        if ( (region_base = xc_map_foreign_batch( xc_handle, dom, 
  48.380 -                                                  PROT_WRITE,
  48.381 -                                                  region_mfn,
  48.382 -                                                  j )) == 0 )
  48.383 -        {
  48.384 +        if (!(region_base = xc_map_foreign_batch(
  48.385 +                  xc_handle, dom, PROT_WRITE, region_mfn, j))) {  
  48.386              ERR("map batch failed");
  48.387              goto out;
  48.388          }
  48.389  
  48.390          for ( i = 0; i < j; i++ )
  48.391          {
  48.392 -            unsigned long *ppage;
  48.393 +            void *page;
  48.394 +            unsigned long pagetype; 
  48.395  
  48.396 -            pfn = region_pfn_type[i] & ~LTAB_MASK;
  48.397 +            pfn      = region_pfn_type[i] & ~LTAB_MASK;
  48.398 +            pagetype = region_pfn_type[i] & LTAB_MASK; 
  48.399  
  48.400 -            if ( (region_pfn_type[i] & LTAB_MASK) == XTAB) continue;
  48.401 -
  48.402 -            if (pfn>nr_pfns)
  48.403 -            {
  48.404 +            if (pagetype == XTAB) 
  48.405 +                /* a bogus/unmapped page: skip it */
  48.406 +                continue;
  48.407 +            
  48.408 +            if (pfn > max_pfn) {
  48.409                  ERR("pfn out of range");
  48.410                  goto out;
  48.411              }
  48.412  
  48.413 -            region_pfn_type[i] &= LTAB_MASK;
  48.414 +            pfn_type[pfn] = pagetype; 
  48.415  
  48.416 -            pfn_type[pfn] = region_pfn_type[i];
  48.417 -
  48.418 -            mfn = pfn_to_mfn_table[pfn];
  48.419 +            mfn = p2m[pfn];
  48.420  
  48.421 -            if ( verify )
  48.422 -                ppage = (unsigned long*) buf;  /* debug case */
  48.423 -            else
  48.424 -                ppage = (unsigned long*) (region_base + i*PAGE_SIZE);
  48.425 +            /* In verify mode, we use a copy; otherwise we work in place */
  48.426 +            page = verify ? (void *)buf : (region_base + i*PAGE_SIZE); 
  48.427  
  48.428 -            if ( read_exact(io_fd, ppage, PAGE_SIZE) != PAGE_SIZE )
  48.429 -            {
  48.430 -                ERR("Error when reading pagetable page");
  48.431 +            if (!read_exact(io_fd, page, PAGE_SIZE)) { 
  48.432 +                ERR("Error when reading page (type was %lx)", pagetype);
  48.433                  goto out;
  48.434              }
  48.435  
  48.436 -            switch( region_pfn_type[i] & LTABTYPE_MASK )
  48.437 -            {
  48.438 -            case 0:
  48.439 -                break;
  48.440 -
  48.441 -            case L1TAB:
  48.442 -            {
  48.443 -                for ( k = 0; k < 1024; k++ ) 
  48.444 -                {
  48.445 -                    if ( ppage[k] & _PAGE_PRESENT ) 
  48.446 -                    {
  48.447 -                        xpfn = ppage[k] >> PAGE_SHIFT;
  48.448 -                        if ( xpfn >= nr_pfns )
  48.449 -                        {
  48.450 -                            ERR("Frame number in type %lu page "
  48.451 -                                "table is out of range. i=%d k=%d "
  48.452 -                                "pfn=0x%lx nr_pfns=%lu", 
  48.453 -                                region_pfn_type[i]>>28, i, 
  48.454 -                                k, xpfn, nr_pfns);
  48.455 -                            goto out;
  48.456 -                        }
  48.457 -
  48.458 -                        ppage[k] &= (PAGE_SIZE - 1) & 
  48.459 -                            ~(_PAGE_GLOBAL | _PAGE_PAT);
  48.460 -                        ppage[k] |= pfn_to_mfn_table[xpfn] << PAGE_SHIFT;
  48.461 -                    }
  48.462 -                }
  48.463 -            }
  48.464 -            break;
  48.465 +            pagetype &= LTABTYPE_MASK; 
  48.466  
  48.467 -            case L2TAB:
  48.468 -            {
  48.469 -                for ( k = 0; 
  48.470 -                      k < (HYPERVISOR_VIRT_START>>L2_PAGETABLE_SHIFT); 
  48.471 -                      k++ )
  48.472 -                {
  48.473 -                    if ( ppage[k] & _PAGE_PRESENT )
  48.474 -                    {
  48.475 -                        xpfn = ppage[k] >> PAGE_SHIFT;
  48.476 +            if(pagetype >= L1TAB && pagetype <= L4TAB) { 
  48.477 +                
  48.478 +                /* 
  48.479 +                ** A page table page - need to 'uncanonicalize' it, i.e. 
  48.480 +                ** replace all the references to pfns with the corresponding 
  48.481 +                ** mfns for the new domain. 
  48.482 +                */ 
  48.483 +                if(!uncanonicalize_pagetable(pagetype, page))
  48.484 +                    goto out; 
  48.485  
  48.486 -                        if ( xpfn >= nr_pfns )
  48.487 -                        {
  48.488 -                            ERR("Frame number in type %lu page"
  48.489 -                                " table is out of range. i=%d k=%d "
  48.490 -                                "pfn=%lu nr_pfns=%lu",
  48.491 -                                region_pfn_type[i]>>28, i, k, 
  48.492 -                                xpfn, nr_pfns);
  48.493 -                            goto out;
  48.494 -                        }
  48.495 +            } else if(pagetype != NOTAB) { 
  48.496  
  48.497 -                        ppage[k] &= (PAGE_SIZE - 1) & 
  48.498 -                            ~(_PAGE_GLOBAL | _PAGE_PSE);
  48.499 -                        ppage[k] |= pfn_to_mfn_table[xpfn] << PAGE_SHIFT;
  48.500 -                    }
  48.501 -                }
  48.502 -            }
  48.503 -            break;
  48.504 -
  48.505 -            default:
  48.506 -                ERR("Bogus page type %lx page table is "
  48.507 -                    "out of range. i=%d nr_pfns=%lu", 
  48.508 -                    region_pfn_type[i], i, nr_pfns);
  48.509 +                ERR("Bogus page type %lx page table is out of range: "
  48.510 +                    "i=%d max_pfn=%lu", pagetype, i, max_pfn);
  48.511                  goto out;
  48.512  
  48.513 -            } /* end of page type switch statement */
  48.514 +            } 
  48.515 +
  48.516 +
  48.517  
  48.518 -            if ( verify )
  48.519 -            {
  48.520 -                int res = memcmp(buf, (region_base + i*PAGE_SIZE), PAGE_SIZE );
  48.521 -                if ( res )
  48.522 -                {
  48.523 +            if (verify) {
  48.524 +
  48.525 +                int res = memcmp(buf, (region_base + i*PAGE_SIZE), PAGE_SIZE);
  48.526 +
  48.527 +                if (res) { 
  48.528 +
  48.529                      int v;
  48.530 -                    printf("************** pfn=%lx type=%lx gotcs=%08lx "
  48.531 -                           "actualcs=%08lx\n", pfn, pfn_type[pfn], 
  48.532 -                           csum_page(region_base + i*PAGE_SIZE), 
  48.533 -                           csum_page(buf));
  48.534 -                    for ( v = 0; v < 4; v++ )
  48.535 -                    {
  48.536 -                        unsigned long *p = (unsigned long *)
  48.537 +
  48.538 +                    DPRINTF("************** pfn=%lx type=%lx gotcs=%08lx "
  48.539 +                            "actualcs=%08lx\n", pfn, pfn_type[pfn], 
  48.540 +                            csum_page(region_base + i*PAGE_SIZE), 
  48.541 +                            csum_page(buf));
  48.542 +
  48.543 +                    for (v = 0; v < 4; v++) {
  48.544 +                        
  48.545 +                        unsigned long *p = (unsigned long *) 
  48.546                              (region_base + i*PAGE_SIZE);
  48.547 -                        if ( buf[v] != p[v] )
  48.548 -                            printf("    %d: %08lx %08lx\n",
  48.549 -                                   v, buf[v], p[v] );
  48.550 +                        if (buf[v] != p[v])
  48.551 +                            DPRINTF("    %d: %08lx %08lx\n", v, buf[v], p[v]);
  48.552                      }
  48.553                  }
  48.554              }
  48.555  
  48.556 -            if ( xc_add_mmu_update(xc_handle, mmu,
  48.557 -                                   (mfn<<PAGE_SHIFT) | MMU_MACHPHYS_UPDATE,
  48.558 -                                   pfn) )
  48.559 -            {
  48.560 -                printf("machpys mfn=%ld pfn=%ld\n",mfn,pfn);
  48.561 +            if (xc_add_mmu_update(xc_handle, mmu, 
  48.562 +                                  (mfn << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE,
  48.563 +                                  pfn)) {
  48.564 +                ERR("machpys mfn=%ld pfn=%ld", mfn, pfn);
  48.565                  goto out;
  48.566              }
  48.567 -
  48.568          } /* end of 'batch' for loop */
  48.569  
  48.570 -        munmap( region_base, j*PAGE_SIZE );
  48.571 -        n+=j; /* crude stats */
  48.572 +        munmap(region_base, j*PAGE_SIZE);
  48.573 +        n+= j; /* crude stats */
  48.574      }
  48.575  
  48.576      DPRINTF("Received all pages\n");
  48.577  
  48.578 -    if ( pt_levels == 3 )
  48.579 -    {
  48.580 +    if (pt_levels == 3) {
  48.581 +
  48.582          /* Get all PGDs below 4GB. */
  48.583 -        for ( i = 0; i < nr_pfns; i++ )
  48.584 -        {
  48.585 -            if ( ((pfn_type[i] & LTABTYPE_MASK) == L3TAB) &&
  48.586 -                 (pfn_to_mfn_table[i] > 0xfffffUL) )
  48.587 -            {
  48.588 -                unsigned long new_mfn = xc_make_page_below_4G(
  48.589 -                    xc_handle, dom, pfn_to_mfn_table[i]);
  48.590 -                if ( new_mfn == 0 )
  48.591 -                {
  48.592 -                    fprintf(stderr, "Couldn't get a page below 4GB :-(\n");
  48.593 +        for (i = 0; i < max_pfn; i++) {
  48.594 +            
  48.595 +            if (((pfn_type[i] & LTABTYPE_MASK)==L3TAB) && (p2m[i]>0xfffffUL)) {
  48.596 +
  48.597 +                unsigned long new_mfn; 
  48.598 +
  48.599 +                if (!(new_mfn=xc_make_page_below_4G(xc_handle, dom, p2m[i]))) {
  48.600 +                    ERR("Couldn't get a page below 4GB :-(");
  48.601                      goto out;
  48.602                  }
  48.603 -                pfn_to_mfn_table[i] = new_mfn;
  48.604 -                if ( xc_add_mmu_update(
  48.605 -                    xc_handle, mmu, (new_mfn << PAGE_SHIFT) |
  48.606 -                    MMU_MACHPHYS_UPDATE, i) )
  48.607 -                {
  48.608 -                    fprintf(stderr, "Couldn't m2p on PAE root pgdir\n");
  48.609 +                
  48.610 +                p2m[i] = new_mfn;
  48.611 +                if (xc_add_mmu_update(
  48.612 +                        xc_handle, mmu, 
  48.613 +                        (new_mfn << PAGE_SHIFT) | MMU_MACHPHYS_UPDATE, i)) {
  48.614 +                    ERR("Couldn't m2p on PAE root pgdir");
  48.615                      goto out;
  48.616                  }
  48.617              }
  48.618          }
  48.619 +        
  48.620      }
  48.621  
  48.622 -    if ( xc_finish_mmu_updates(xc_handle, mmu) )
  48.623 +
  48.624 +    if (xc_finish_mmu_updates(xc_handle, mmu)) { 
  48.625 +        ERR("Error doing finish_mmu_updates()"); 
  48.626          goto out;
  48.627 +    } 
  48.628  
  48.629      /*
  48.630       * Pin page tables. Do this after writing to them as otherwise Xen
  48.631       * will barf when doing the type-checking.
  48.632       */
  48.633 -    for ( i = 0; i < nr_pfns; i++ )
  48.634 -    {
  48.635 +    for (i = 0; i < max_pfn; i++) {
  48.636 +
  48.637          if ( (pfn_type[i] & LPINTAB) == 0 )
  48.638              continue;
  48.639 -        if ( pfn_type[i] == (L1TAB|LPINTAB) )
  48.640 +        
  48.641 +        switch(pfn_type[i]) { 
  48.642 +
  48.643 +        case (L1TAB|LPINTAB): 
  48.644              pin[nr_pins].cmd = MMUEXT_PIN_L1_TABLE;
  48.645 -        else /* pfn_type[i] == (L2TAB|LPINTAB) */
  48.646 +            break; 
  48.647 +            
  48.648 +        case (L2TAB|LPINTAB): 
  48.649              pin[nr_pins].cmd = MMUEXT_PIN_L2_TABLE;
  48.650 -        pin[nr_pins].arg1.mfn = pfn_to_mfn_table[i];
  48.651 -        if ( ++nr_pins == MAX_PIN_BATCH )
  48.652 -        {
  48.653 -            if ( xc_mmuext_op(xc_handle, pin, nr_pins, dom) < 0 )
  48.654 +            break; 
  48.655 +            
  48.656 +        case (L3TAB|LPINTAB): 
  48.657 +            pin[nr_pins].cmd = MMUEXT_PIN_L3_TABLE;
  48.658 +            break; 
  48.659 +
  48.660 +        case (L4TAB|LPINTAB):
  48.661 +            pin[nr_pins].cmd = MMUEXT_PIN_L4_TABLE;
  48.662 +            break; 
  48.663 +            
  48.664 +        default: 
  48.665 +            continue; 
  48.666 +        }
  48.667 +
  48.668 +        pin[nr_pins].arg1.mfn = p2m[i];
  48.669 +        
  48.670 +        if (++nr_pins == MAX_PIN_BATCH) {
  48.671 +            if (xc_mmuext_op(xc_handle, pin, nr_pins, dom) < 0) { 
  48.672 +                ERR("Failed to pin batch of %d page tables", nr_pins); 
  48.673                  goto out;
  48.674 +            } 
  48.675 +            DPRINTF("successfully pinned batch of %d page tables", nr_pins); 
  48.676              nr_pins = 0;
  48.677          }
  48.678      }
  48.679 -
  48.680 -    if ( (nr_pins != 0) &&
  48.681 -         (xc_mmuext_op(xc_handle, pin, nr_pins, dom) < 0) )
  48.682 -        goto out;
  48.683 +    
  48.684 +    if (nr_pins != 0) { 
  48.685 +        if((rc = xc_mmuext_op(xc_handle, pin, nr_pins, dom)) < 0) { 
  48.686 +            ERR("Failed (2) to pin batch of %d page tables", nr_pins); 
  48.687 +            DPRINTF("rc is %d\n", rc); 
  48.688 +            goto out;
  48.689 +        }
  48.690 +    }
  48.691  
  48.692      DPRINTF("\b\b\b\b100%%\n");
  48.693      DPRINTF("Memory reloaded.\n");
  48.694 @@ -445,111 +493,115 @@ int xc_linux_restore(int xc_handle, int 
  48.695          unsigned long *pfntab;
  48.696          int rc;
  48.697  
  48.698 -        if ( read_exact(io_fd, &count, sizeof(count)) != sizeof(count) )
  48.699 -        {
  48.700 +        if (!read_exact(io_fd, &count, sizeof(count))) { 
  48.701              ERR("Error when reading pfn count");
  48.702              goto out;
  48.703          }
  48.704  
  48.705 -        pfntab = malloc( sizeof(unsigned int) * count );
  48.706 -        if ( pfntab == NULL )
  48.707 -        {
  48.708 +        if(!(pfntab = malloc(sizeof(unsigned long) * count))) { 
  48.709              ERR("Out of memory");
  48.710              goto out;
  48.711          }
  48.712 -
  48.713 -        if ( read_exact(io_fd, pfntab, sizeof(unsigned int)*count) !=
  48.714 -             sizeof(unsigned int)*count )
  48.715 -        {
  48.716 +        
  48.717 +        if (!read_exact(io_fd, pfntab, sizeof(unsigned long)*count)) { 
  48.718              ERR("Error when reading pfntab");
  48.719              goto out;
  48.720          }
  48.721  
  48.722 -        for ( i = 0; i < count; i++ )
  48.723 -        {
  48.724 +        for (i = 0; i < count; i++) {
  48.725 +
  48.726              unsigned long pfn = pfntab[i];
  48.727 -            pfntab[i]=pfn_to_mfn_table[pfn];
  48.728 -            pfn_to_mfn_table[pfn] = 0x80000001;  // not in pmap
  48.729 +
  48.730 +            if(pfn > max_pfn) 
  48.731 +                /* shouldn't happen - continue optimistically */
  48.732 +                continue; 
  48.733 +
  48.734 +            pfntab[i] = p2m[pfn];   
  48.735 +            p2m[pfn]  = INVALID_P2M_ENTRY; // not in pseudo-physical map 
  48.736          }
  48.737 +        
  48.738 +        if (count > 0) {
  48.739  
  48.740 -        if ( count > 0 )
  48.741 -        {
  48.742              struct xen_memory_reservation reservation = {
  48.743                  .extent_start = pfntab,
  48.744                  .nr_extents   = count,
  48.745                  .extent_order = 0,
  48.746                  .domid        = dom
  48.747              };
  48.748 -            if ( (rc = xc_memory_op(xc_handle,
  48.749 -                                    XENMEM_decrease_reservation,
  48.750 -                                    &reservation)) != count )
  48.751 -            {
  48.752 -                ERR("Could not decrease reservation : %d",rc);
  48.753 +
  48.754 +            if ((rc = xc_memory_op(xc_handle, XENMEM_decrease_reservation,
  48.755 +                                   &reservation)) != count) { 
  48.756 +                ERR("Could not decrease reservation : %d", rc);
  48.757                  goto out;
  48.758 -            }
  48.759 -            else
  48.760 -            {
  48.761 -                printf("Decreased reservation by %d pages\n", count);
  48.762 -            }
  48.763 +            } else
  48.764 +                DPRINTF("Decreased reservation by %d pages\n", count);
  48.765          } 
  48.766      }
  48.767  
  48.768 -    if ( read_exact(io_fd, &ctxt,            sizeof(ctxt)) != sizeof(ctxt) ||
  48.769 -         read_exact(io_fd, shared_info_page, PAGE_SIZE) != PAGE_SIZE )
  48.770 -    {
  48.771 +    if (!read_exact(io_fd, &ctxt, sizeof(ctxt)) || 
  48.772 +        !read_exact(io_fd, shared_info_page, PAGE_SIZE)) { 
  48.773          ERR("Error when reading ctxt or shared info page");
  48.774          goto out;
  48.775      }
  48.776  
  48.777      /* Uncanonicalise the suspend-record frame number and poke resume rec. */
  48.778      pfn = ctxt.user_regs.edx;
  48.779 -    if ( (pfn >= nr_pfns) || (pfn_type[pfn] != NOTAB) )
  48.780 -    {
  48.781 +    if ((pfn >= max_pfn) || (pfn_type[pfn] != NOTAB)) {
  48.782          ERR("Suspend record frame number is bad");
  48.783          goto out;
  48.784      }
  48.785 -    ctxt.user_regs.edx = mfn = pfn_to_mfn_table[pfn];
  48.786 +    ctxt.user_regs.edx = mfn = p2m[pfn];
  48.787      start_info = xc_map_foreign_range(
  48.788          xc_handle, dom, PAGE_SIZE, PROT_READ | PROT_WRITE, mfn);
  48.789 -    start_info->nr_pages    = nr_pfns;
  48.790 +    start_info->nr_pages    = max_pfn;
  48.791      start_info->shared_info = shared_info_frame << PAGE_SHIFT;
  48.792      start_info->flags       = 0;
  48.793 -    *store_mfn = start_info->store_mfn   =
  48.794 -        pfn_to_mfn_table[start_info->store_mfn];
  48.795 -    start_info->store_evtchn = store_evtchn;
  48.796 -    *console_mfn = start_info->console_mfn   =
  48.797 -        pfn_to_mfn_table[start_info->console_mfn];
  48.798 -    start_info->console_evtchn = console_evtchn;
  48.799 +    *store_mfn = start_info->store_mfn       = p2m[start_info->store_mfn];
  48.800 +    start_info->store_evtchn                 = store_evtchn;
  48.801 +    *console_mfn = start_info->console_mfn   = p2m[start_info->console_mfn];
  48.802 +    start_info->console_evtchn               = console_evtchn;
  48.803      munmap(start_info, PAGE_SIZE);
  48.804  
  48.805      /* Uncanonicalise each GDT frame number. */
  48.806 -    if ( ctxt.gdt_ents > 8192 )
  48.807 -    {
  48.808 +    if (ctxt.gdt_ents > 8192) {
  48.809          ERR("GDT entry count out of range");
  48.810          goto out;
  48.811      }
  48.812  
  48.813 -    for ( i = 0; i < ctxt.gdt_ents; i += 512 )
  48.814 -    {
  48.815 +    for (i = 0; i < ctxt.gdt_ents; i += 512) {
  48.816          pfn = ctxt.gdt_frames[i];
  48.817 -        if ( (pfn >= nr_pfns) || (pfn_type[pfn] != NOTAB) )
  48.818 -        {
  48.819 +        if ((pfn >= max_pfn) || (pfn_type[pfn] != NOTAB)) {
  48.820              ERR("GDT frame number is bad");
  48.821              goto out;
  48.822          }
  48.823 -        ctxt.gdt_frames[i] = pfn_to_mfn_table[pfn];
  48.824 +        ctxt.gdt_frames[i] = p2m[pfn];
  48.825      }
  48.826  
  48.827      /* Uncanonicalise the page table base pointer. */
  48.828      pfn = ctxt.ctrlreg[3] >> PAGE_SHIFT;
  48.829 -    if ( (pfn >= nr_pfns) || ((pfn_type[pfn]&LTABTYPE_MASK) != L2TAB) )
  48.830 -    {
  48.831 -        printf("PT base is bad. pfn=%lu nr=%lu type=%08lx %08lx\n",
  48.832 -               pfn, nr_pfns, pfn_type[pfn], (unsigned long)L2TAB);
  48.833 +
  48.834 +    if (pfn >= max_pfn) {
  48.835 +        DPRINTF("PT base is bad: pfn=%lu max_pfn=%lu type=%08lx\n",
  48.836 +                pfn, max_pfn, pfn_type[pfn]); 
  48.837          ERR("PT base is bad.");
  48.838          goto out;
  48.839      }
  48.840 -    ctxt.ctrlreg[3] = pfn_to_mfn_table[pfn] << PAGE_SHIFT;
  48.841 +
  48.842 +    if ((pt_levels == 2) && ((pfn_type[pfn]&LTABTYPE_MASK) != L2TAB)) { 
  48.843 +        DPRINTF("PT base is bad. pfn=%lu nr=%lu type=%08lx %08lx\n",
  48.844 +                pfn, max_pfn, pfn_type[pfn], (unsigned long)L2TAB);
  48.845 +        ERR("PT base is bad.");
  48.846 +        goto out;
  48.847 +    }
  48.848 +
  48.849 +    if ((pt_levels == 3) && ((pfn_type[pfn]&LTABTYPE_MASK) != L3TAB)) { 
  48.850 +        DPRINTF("PT base is bad. pfn=%lu nr=%lu type=%08lx %08lx\n",
  48.851 +                pfn, max_pfn, pfn_type[pfn], (unsigned long)L3TAB);
  48.852 +        ERR("PT base is bad.");
  48.853 +        goto out;
  48.854 +    }
  48.855 +    
  48.856 +    ctxt.ctrlreg[3] = p2m[pfn] << PAGE_SHIFT;
  48.857  
  48.858      /* clear any pending events and the selector */
  48.859      memset(&(shared_info->evtchn_pending[0]), 0,
  48.860 @@ -558,40 +610,31 @@ int xc_linux_restore(int xc_handle, int 
  48.861          shared_info->vcpu_data[i].evtchn_pending_sel = 0;
  48.862  
  48.863      /* Copy saved contents of shared-info page. No checking needed. */
  48.864 -    ppage = xc_map_foreign_range(
  48.865 +    page = xc_map_foreign_range(
  48.866          xc_handle, dom, PAGE_SIZE, PROT_WRITE, shared_info_frame);
  48.867 -    memcpy(ppage, shared_info, sizeof(shared_info_t));
  48.868 -    munmap(ppage, PAGE_SIZE);
  48.869 -
  48.870 +    memcpy(page, shared_info, sizeof(shared_info_t));
  48.871 +    munmap(page, PAGE_SIZE);
  48.872 +    
  48.873      /* Uncanonicalise the pfn-to-mfn table frame-number list. */
  48.874 -    for ( i = 0; i < (nr_pfns+1023)/1024; i++ )
  48.875 -    {
  48.876 -        unsigned long pfn, mfn;
  48.877 -
  48.878 -        pfn = pfn_to_mfn_frame_list[i];
  48.879 -        if ( (pfn >= nr_pfns) || (pfn_type[pfn] != NOTAB) )
  48.880 -        {
  48.881 +    for (i = 0; i < P2M_FL_ENTRIES; i++) {
  48.882 +        pfn = p2m_frame_list[i];
  48.883 +        if ((pfn >= max_pfn) || (pfn_type[pfn] != NOTAB)) {
  48.884              ERR("PFN-to-MFN frame number is bad");
  48.885              goto out;
  48.886          }
  48.887 -        mfn = pfn_to_mfn_table[pfn];
  48.888 -        pfn_to_mfn_frame_list[i] = mfn;
  48.889 +
  48.890 +        p2m_frame_list[i] = p2m[pfn];
  48.891      }
  48.892      
  48.893 -    if ( (live_pfn_to_mfn_table = 
  48.894 -          xc_map_foreign_batch(xc_handle, dom, 
  48.895 -                               PROT_WRITE,
  48.896 -                               pfn_to_mfn_frame_list,
  48.897 -                               (nr_pfns+1023)/1024 )) == 0 )
  48.898 -    {
  48.899 -        ERR("Couldn't map pfn_to_mfn table");
  48.900 +    /* Copy the P2M we've constructed to the 'live' P2M */
  48.901 +    if (!(live_p2m = xc_map_foreign_batch(xc_handle, dom, PROT_WRITE, 
  48.902 +                                          p2m_frame_list, P2M_FL_ENTRIES))) {
  48.903 +        ERR("Couldn't map p2m table");
  48.904          goto out;
  48.905      }
  48.906  
  48.907 -    memcpy(live_pfn_to_mfn_table, pfn_to_mfn_table, 
  48.908 -           nr_pfns*sizeof(unsigned long) );
  48.909 -
  48.910 -    munmap(live_pfn_to_mfn_table, ((nr_pfns+1023)/1024)*PAGE_SIZE);
  48.911 +    memcpy(live_p2m, p2m, P2M_SIZE); 
  48.912 +    munmap(live_p2m, P2M_SIZE); 
  48.913  
  48.914      /*
  48.915       * Safety checking of saved context:
  48.916 @@ -605,25 +648,23 @@ int xc_linux_restore(int xc_handle, int 
  48.917       *  8. debugregs are checked by Xen.
  48.918       *  9. callback code selectors need checking.
  48.919       */
  48.920 -    for ( i = 0; i < 256; i++ )
  48.921 -    {
  48.922 +    for ( i = 0; i < 256; i++ ) {
  48.923          ctxt.trap_ctxt[i].vector = i;
  48.924 -        if ( (ctxt.trap_ctxt[i].cs & 3) == 0 )
  48.925 +        if ((ctxt.trap_ctxt[i].cs & 3) == 0)
  48.926              ctxt.trap_ctxt[i].cs = FLAT_KERNEL_CS;
  48.927      }
  48.928 -    if ( (ctxt.kernel_ss & 3) == 0 )
  48.929 +    if ((ctxt.kernel_ss & 3) == 0)
  48.930          ctxt.kernel_ss = FLAT_KERNEL_DS;
  48.931  #if defined(__i386__)
  48.932 -    if ( (ctxt.event_callback_cs & 3) == 0 )
  48.933 +    if ((ctxt.event_callback_cs & 3) == 0)
  48.934          ctxt.event_callback_cs = FLAT_KERNEL_CS;
  48.935 -    if ( (ctxt.failsafe_callback_cs & 3) == 0 )
  48.936 +    if ((ctxt.failsafe_callback_cs & 3) == 0)
  48.937          ctxt.failsafe_callback_cs = FLAT_KERNEL_CS;
  48.938  #endif
  48.939 -    if ( ((ctxt.ldt_base & (PAGE_SIZE - 1)) != 0) ||
  48.940 -         (ctxt.ldt_ents > 8192) ||
  48.941 -         (ctxt.ldt_base > HYPERVISOR_VIRT_START) ||
  48.942 -         ((ctxt.ldt_base + ctxt.ldt_ents*8) > HYPERVISOR_VIRT_START) )
  48.943 -    {
  48.944 +    if (((ctxt.ldt_base & (PAGE_SIZE - 1)) != 0) ||
  48.945 +        (ctxt.ldt_ents > 8192) ||
  48.946 +        (ctxt.ldt_base > hvirt_start) ||
  48.947 +        ((ctxt.ldt_base + ctxt.ldt_ents*8) > hvirt_start)) {
  48.948          ERR("Bad LDT base or size");
  48.949          goto out;
  48.950      }
  48.951 @@ -636,8 +677,7 @@ int xc_linux_restore(int xc_handle, int 
  48.952      op.u.setdomaininfo.ctxt   = &ctxt;
  48.953      rc = xc_dom0_op(xc_handle, &op);
  48.954  
  48.955 -    if ( rc != 0 )
  48.956 -    {
  48.957 +    if (rc != 0) {
  48.958          ERR("Couldn't build the domain");
  48.959          goto out;
  48.960      }
  48.961 @@ -646,9 +686,10 @@ int xc_linux_restore(int xc_handle, int 
  48.962      if ( (rc != 0) && (dom != 0) )
  48.963          xc_domain_destroy(xc_handle, dom);
  48.964      free(mmu);
  48.965 -    free(pfn_to_mfn_table);
  48.966 +    free(p2m);
  48.967      free(pfn_type);
  48.968  
  48.969      DPRINTF("Restore exit with rc=%d\n", rc);
  48.970 +
  48.971      return rc;
  48.972  }
    49.1 --- a/tools/libxc/xc_linux_save.c	Thu Nov 10 08:18:25 2005 -0600
    49.2 +++ b/tools/libxc/xc_linux_save.c	Thu Nov 10 08:34:09 2005 -0600
    49.3 @@ -13,10 +13,7 @@
    49.4  #include <sys/time.h>
    49.5  
    49.6  #include "xg_private.h"
    49.7 -
    49.8 -#define BATCH_SIZE 1024   /* 1024 pages (4MB) at a time */
    49.9 -
   49.10 -#define MAX_MBIT_RATE 500
   49.11 +#include "xg_save_restore.h"
   49.12  
   49.13  /*
   49.14  ** Default values for important tuning parameters. Can override by passing
   49.15 @@ -25,75 +22,77 @@
   49.16  ** XXX SMH: should consider if want to be able to override MAX_MBIT_RATE too. 
   49.17  ** 
   49.18  */
   49.19 -#define DEF_MAX_ITERS   29   /* limit us to 30 times round loop */ 
   49.20 -#define DEF_MAX_FACTOR   3   /* never send more than 3x nr_pfns */
   49.21 +#define DEF_MAX_ITERS   29   /* limit us to 30 times round loop   */ 
   49.22 +#define DEF_MAX_FACTOR   3   /* never send more than 3x nr_pfns   */
   49.23 +
   49.24  
   49.25 -/* Flags to control behaviour of xc_linux_save */
   49.26 -#define XCFLAGS_LIVE      1
   49.27 -#define XCFLAGS_DEBUG     2
   49.28 +/* max mfn of the whole machine */
   49.29 +static uint32_t max_mfn; 
   49.30  
   49.31 -#define DEBUG 0
   49.32 +/* virtual starting address of the hypervisor */
   49.33 +static uint32_t hvirt_start; 
   49.34  
   49.35 -#if 1
   49.36 -#define ERR(_f, _a...) do { fprintf(stderr, _f "\n" , ## _a); fflush(stderr); } while (0)
   49.37 -#else
   49.38 -#define ERR(_f, _a...) ((void)0)
   49.39 -#endif
   49.40 +/* #levels of page tables used by the currrent guest */
   49.41 +static uint32_t pt_levels; 
   49.42 +
   49.43 +/* total number of pages used by the current guest */
   49.44 +static unsigned long max_pfn;
   49.45  
   49.46 -#if DEBUG
   49.47 -#define DPRINTF(_f, _a...) fprintf ( stderr, _f , ## _a )
   49.48 -#else
   49.49 -#define DPRINTF(_f, _a...) ((void)0)
   49.50 -#endif
   49.51 +/* Live mapping of the table mapping each PFN to its current MFN. */
   49.52 +static unsigned long *live_p2m = NULL;
   49.53  
   49.54 -#define PROGRESS 0
   49.55 -#if PROGRESS
   49.56 -#define PPRINTF(_f, _a...) fprintf ( stderr, _f , ## _a )
   49.57 -#else
   49.58 -#define PPRINTF(_f, _a...)
   49.59 -#endif
   49.60 +/* Live mapping of system MFN to PFN table. */
   49.61 +static unsigned long *live_m2p = NULL;
   49.62 +
   49.63  
   49.64  /*
   49.65   * Returns TRUE if the given machine frame number has a unique mapping
   49.66   * in the guest's pseudophysical map.
   49.67   */
   49.68 -
   49.69 -#define MFN_IS_IN_PSEUDOPHYS_MAP(_mfn)                                    \
   49.70 -    (((_mfn) < (1024*1024)) &&                                            \
   49.71 -     ((live_mfn_to_pfn_table[_mfn] < nr_pfns) &&                         \
   49.72 -       (live_pfn_to_mfn_table[live_mfn_to_pfn_table[_mfn]] == (_mfn))))
   49.73 -
   49.74 +#define MFN_IS_IN_PSEUDOPHYS_MAP(_mfn)          \
   49.75 +(((_mfn) < (max_mfn)) &&                        \
   49.76 + ((live_m2p[_mfn] < (max_pfn)) &&               \
   49.77 +  (live_p2m[live_m2p[_mfn]] == (_mfn))))
   49.78 +    
   49.79   
   49.80  /* Returns TRUE if MFN is successfully converted to a PFN. */
   49.81 -#define translate_mfn_to_pfn(_pmfn)            \
   49.82 -({                                             \
   49.83 -    unsigned long mfn = *(_pmfn);              \
   49.84 -    int _res = 1;                              \
   49.85 -    if ( !MFN_IS_IN_PSEUDOPHYS_MAP(mfn) )      \
   49.86 -        _res = 0;                              \
   49.87 -    else                                       \
   49.88 -        *(_pmfn) = live_mfn_to_pfn_table[mfn]; \
   49.89 -    _res;                                      \
   49.90 +#define translate_mfn_to_pfn(_pmfn)                             \
   49.91 +({                                                              \
   49.92 +    unsigned long mfn = *(_pmfn);                               \
   49.93 +    int _res = 1;                                               \
   49.94 +    if ( !MFN_IS_IN_PSEUDOPHYS_MAP(mfn) )                       \
   49.95 +        _res = 0;                                               \
   49.96 +    else                                                        \
   49.97 +        *(_pmfn) = live_m2p[mfn];                               \
   49.98 +    _res;                                                       \
   49.99  })
  49.100  
  49.101 -#define is_mapped(pfn) (!((pfn) & 0x80000000UL))
  49.102 +/* 
  49.103 +** During (live) save/migrate, we maintain a number of bitmaps to track 
  49.104 +** which pages we have to send, to fixup, and to skip. 
  49.105 +*/
  49.106 +
  49.107 +#define BITS_PER_LONG (sizeof(unsigned long) * 8) 
  49.108 +#define BITMAP_SIZE   ((max_pfn + BITS_PER_LONG - 1) / BITS_PER_LONG)
  49.109  
  49.110 -static inline int test_bit ( int nr, volatile void * addr)
  49.111 +#define BITMAP_ENTRY(_nr,_bmap) \
  49.112 +   ((unsigned long *)(_bmap))[(_nr)/BITS_PER_LONG]
  49.113 +
  49.114 +#define BITMAP_SHIFT(_nr) ((_nr) % BITS_PER_LONG)
  49.115 +
  49.116 +static inline int test_bit (int nr, volatile void * addr)
  49.117  {
  49.118 -    return (((unsigned long*)addr)[nr/(sizeof(unsigned long)*8)] >> 
  49.119 -            (nr % (sizeof(unsigned long)*8))) & 1;
  49.120 +    return (BITMAP_ENTRY(nr, addr) >> BITMAP_SHIFT(nr)) & 1; 
  49.121  }
  49.122  
  49.123 -static inline void clear_bit ( int nr, volatile void * addr)
  49.124 +static inline void clear_bit (int nr, volatile void * addr)
  49.125  {
  49.126 -    ((unsigned long*)addr)[nr/(sizeof(unsigned long)*8)] &= 
  49.127 -        ~(1 << (nr % (sizeof(unsigned long)*8) ) );
  49.128 +    BITMAP_ENTRY(nr, addr) &= ~(1 << BITMAP_SHIFT(nr)); 
  49.129  }
  49.130  
  49.131  static inline void set_bit ( int nr, volatile void * addr)
  49.132  {
  49.133 -    ((unsigned long*)addr)[nr/(sizeof(unsigned long)*8)] |= 
  49.134 -        (1 << (nr % (sizeof(unsigned long)*8) ) );
  49.135 +    BITMAP_ENTRY(nr, addr) |= (1 << BITMAP_SHIFT(nr)); 
  49.136  }
  49.137  
  49.138  /* Returns the hamming weight (i.e. the number of bits set) in a N-bit word */
  49.139 @@ -142,102 +141,106 @@ static inline int permute( int i, int nr
  49.140  
  49.141      do { i = ((i>>(order_nr-10)) | ( i<<10 ) ) & ((1<<order_nr)-1); }
  49.142      while ( i >= nr ); /* this won't ever loop if nr is a power of 2 */
  49.143 -
  49.144 +    
  49.145      return i;
  49.146  }
  49.147  
  49.148 -static long long tv_to_us( struct timeval *new )
  49.149 +
  49.150 +
  49.151 +
  49.152 +static uint64_t tv_to_us(struct timeval *new)
  49.153  {
  49.154      return (new->tv_sec * 1000000) + new->tv_usec;
  49.155  }
  49.156  
  49.157 -static long long llgettimeofday( void )
  49.158 +static uint64_t llgettimeofday(void)
  49.159  {
  49.160      struct timeval now;
  49.161      gettimeofday(&now, NULL);
  49.162      return tv_to_us(&now);
  49.163  }
  49.164  
  49.165 -static long long tv_delta( struct timeval *new, struct timeval *old )
  49.166 +static uint64_t tv_delta(struct timeval *new, struct timeval *old)
  49.167  {
  49.168      return ((new->tv_sec - old->tv_sec)*1000000 ) + 
  49.169          (new->tv_usec - old->tv_usec);
  49.170  }
  49.171  
  49.172  
  49.173 -#define START_MBIT_RATE 0 //ioctxt->resource
  49.174 +#ifdef ADAPTIVE_SAVE
  49.175 +
  49.176 +
  49.177 +/*
  49.178 +** We control the rate at which we transmit (or save) to minimize impact
  49.179 +** on running domains (including the target if we're doing live migrate). 
  49.180 +*/
  49.181  
  49.182 -static int mbit_rate, ombit_rate = 0;
  49.183 -static int burst_time_us = -1;
  49.184 +#define MAX_MBIT_RATE    500      /* maximum transmit rate for migrate */
  49.185 +#define START_MBIT_RATE  100      /* initial transmit rate for migrate */
  49.186 +
  49.187  
  49.188 -#define MBIT_RATE mbit_rate
  49.189 +/* Scaling factor to convert between a rate (in Mb/s) and time (in usecs) */
  49.190 +#define RATE_TO_BTU      781250
  49.191 +
  49.192 +/* Amount in bytes we allow ourselves to send in a burst */
  49.193  #define BURST_BUDGET (100*1024)
  49.194  
  49.195 -/* 
  49.196 -   1000000/((100)*1024*1024/8/(100*1024))
  49.197 -   7812
  49.198 -   1000000/((100)*1024/8/(100))
  49.199 -   7812
  49.200 -   1000000/((100)*128/(100))
  49.201 -   7812
  49.202 -   100000000/((100)*128)
  49.203 -   7812
  49.204 -   100000000/128
  49.205 -   781250
  49.206 - */
  49.207 -#define RATE_TO_BTU 781250
  49.208 -#define BURST_TIME_US burst_time_us
  49.209 +
  49.210 +/* We keep track of the current and previous transmission rate */
  49.211 +static int mbit_rate, ombit_rate = 0;
  49.212 +
  49.213 +/* Have we reached the maximum transmission rate? */
  49.214 +#define RATE_IS_MAX() (mbit_rate == MAX_MBIT_RATE) 
  49.215 +
  49.216  
  49.217 -static int
  49.218 -ratewrite(int io_fd, void *buf, int n)
  49.219 +static inline void initialize_mbit_rate() 
  49.220 +{
  49.221 +    mbit_rate = START_MBIT_RATE;
  49.222 +}
  49.223 +
  49.224 +
  49.225 +static int ratewrite(int io_fd, void *buf, int n)
  49.226  {
  49.227      static int budget = 0;
  49.228 +    static int burst_time_us = -1;
  49.229      static struct timeval last_put = { 0 };
  49.230      struct timeval now;
  49.231      struct timespec delay;
  49.232      long long delta;
  49.233  
  49.234 -    if ( START_MBIT_RATE == 0 )
  49.235 +    if (START_MBIT_RATE == 0)
  49.236          return write(io_fd, buf, n);
  49.237      
  49.238      budget -= n;
  49.239 -    if ( budget < 0 )
  49.240 -    {
  49.241 -        if ( MBIT_RATE != ombit_rate )
  49.242 -        {
  49.243 -            BURST_TIME_US = RATE_TO_BTU / MBIT_RATE;
  49.244 -            ombit_rate = MBIT_RATE;
  49.245 +    if (budget < 0) {
  49.246 +        if (mbit_rate != ombit_rate) {
  49.247 +            burst_time_us = RATE_TO_BTU / mbit_rate;
  49.248 +            ombit_rate = mbit_rate;
  49.249              DPRINTF("rate limit: %d mbit/s burst budget %d slot time %d\n",
  49.250 -                    MBIT_RATE, BURST_BUDGET, BURST_TIME_US);
  49.251 +                    mbit_rate, BURST_BUDGET, burst_time_us);
  49.252          }
  49.253 -        if ( last_put.tv_sec == 0 )
  49.254 -        {
  49.255 +        if (last_put.tv_sec == 0) {
  49.256              budget += BURST_BUDGET;
  49.257              gettimeofday(&last_put, NULL);
  49.258 -        }
  49.259 -        else
  49.260 -        {
  49.261 -            while ( budget < 0 )
  49.262 -            {
  49.263 +        } else {
  49.264 +            while (budget < 0) {
  49.265                  gettimeofday(&now, NULL);
  49.266                  delta = tv_delta(&now, &last_put);
  49.267 -                while ( delta > BURST_TIME_US )
  49.268 -                {
  49.269 +                while (delta > burst_time_us) {
  49.270                      budget += BURST_BUDGET;
  49.271 -                    last_put.tv_usec += BURST_TIME_US;
  49.272 -                    if ( last_put.tv_usec > 1000000 )
  49.273 -                    {
  49.274 +                    last_put.tv_usec += burst_time_us;
  49.275 +                    if (last_put.tv_usec > 1000000) {
  49.276                          last_put.tv_usec -= 1000000;
  49.277                          last_put.tv_sec++;
  49.278                      }
  49.279 -                    delta -= BURST_TIME_US;
  49.280 +                    delta -= burst_time_us;
  49.281                  }
  49.282 -                if ( budget > 0 )
  49.283 +                if (budget > 0)
  49.284                      break;
  49.285                  delay.tv_sec = 0;
  49.286 -                delay.tv_nsec = 1000 * (BURST_TIME_US - delta);
  49.287 -                while ( delay.tv_nsec > 0 )
  49.288 -                    if ( nanosleep(&delay, &delay) == 0 )
  49.289 +                delay.tv_nsec = 1000 * (burst_time_us - delta);
  49.290 +                while (delay.tv_nsec > 0)
  49.291 +                    if (nanosleep(&delay, &delay) == 0)
  49.292                          break;
  49.293              }
  49.294          }
  49.295 @@ -245,35 +248,52 @@ ratewrite(int io_fd, void *buf, int n)
  49.296      return write(io_fd, buf, n);
  49.297  }
  49.298  
  49.299 -static int print_stats( int xc_handle, uint32_t domid, 
  49.300 -                        int pages_sent, xc_shadow_control_stats_t *stats,
  49.301 -                        int print )
  49.302 +#else /* ! ADAPTIVE SAVE */
  49.303 +
  49.304 +#define RATE_IS_MAX() (0) 
  49.305 +#define ratewrite(_io_fd, _buf, _n) write((_io_fd), (_buf), (_n)) 
  49.306 +#define initialize_mbit_rate() 
  49.307 +
  49.308 +#endif
  49.309 +
  49.310 +
  49.311 +static inline ssize_t write_exact(int fd, void *buf, size_t count)
  49.312 +{
  49.313 +    if(write(fd, buf, count) != count) 
  49.314 +        return 0; 
  49.315 +    return 1; 
  49.316 +} 
  49.317 +
  49.318 +
  49.319 +
  49.320 +static int print_stats(int xc_handle, uint32_t domid, int pages_sent, 
  49.321 +                       xc_shadow_control_stats_t *stats, int print)
  49.322  {
  49.323      static struct timeval wall_last;
  49.324      static long long      d0_cpu_last;
  49.325      static long long      d1_cpu_last;
  49.326 -
  49.327 +    
  49.328      struct timeval        wall_now;
  49.329      long long             wall_delta;
  49.330      long long             d0_cpu_now, d0_cpu_delta;
  49.331      long long             d1_cpu_now, d1_cpu_delta;
  49.332 -
  49.333 +    
  49.334      gettimeofday(&wall_now, NULL);
  49.335 -
  49.336 +    
  49.337      d0_cpu_now = xc_domain_get_cpu_usage(xc_handle, 0, /* FIXME */ 0)/1000;
  49.338      d1_cpu_now = xc_domain_get_cpu_usage(xc_handle, domid, /* FIXME */ 0)/1000;
  49.339  
  49.340      if ( (d0_cpu_now == -1) || (d1_cpu_now == -1) ) 
  49.341          fprintf(stderr, "ARRHHH!!\n");
  49.342 -
  49.343 +    
  49.344      wall_delta = tv_delta(&wall_now,&wall_last)/1000;
  49.345 -
  49.346 -    if ( wall_delta == 0 ) wall_delta = 1;
  49.347 +    
  49.348 +    if (wall_delta == 0) wall_delta = 1;
  49.349 +    
  49.350 +    d0_cpu_delta = (d0_cpu_now - d0_cpu_last)/1000;
  49.351 +    d1_cpu_delta = (d1_cpu_now - d1_cpu_last)/1000;
  49.352  
  49.353 -    d0_cpu_delta  = (d0_cpu_now - d0_cpu_last)/1000;
  49.354 -    d1_cpu_delta  = (d1_cpu_now - d1_cpu_last)/1000;
  49.355 -
  49.356 -    if ( print )
  49.357 +    if (print)
  49.358          fprintf(stderr,
  49.359                  "delta %lldms, dom0 %d%%, target %d%%, sent %dMb/s, "
  49.360                  "dirtied %dMb/s %" PRId32 " pages\n",
  49.361 @@ -284,23 +304,25 @@ static int print_stats( int xc_handle, u
  49.362                  (int)((stats->dirty_count*PAGE_SIZE)/(wall_delta*(1000/8))),
  49.363                  stats->dirty_count);
  49.364  
  49.365 -    if ( ((stats->dirty_count*PAGE_SIZE)/(wall_delta*(1000/8))) > mbit_rate )
  49.366 -    {
  49.367 +#ifdef ADAPTIVE_SAVE    
  49.368 +    if (((stats->dirty_count*PAGE_SIZE)/(wall_delta*(1000/8))) > mbit_rate) {
  49.369          mbit_rate = (int)((stats->dirty_count*PAGE_SIZE)/(wall_delta*(1000/8)))
  49.370              + 50;
  49.371          if (mbit_rate > MAX_MBIT_RATE)
  49.372              mbit_rate = MAX_MBIT_RATE;
  49.373      }
  49.374 -
  49.375 -    d0_cpu_last  = d0_cpu_now;
  49.376 -    d1_cpu_last  = d1_cpu_now;
  49.377 -    wall_last = wall_now; 
  49.378 +#endif
  49.379 +    
  49.380 +    d0_cpu_last = d0_cpu_now;
  49.381 +    d1_cpu_last = d1_cpu_now;
  49.382 +    wall_last   = wall_now; 
  49.383  
  49.384      return 0;
  49.385  }
  49.386  
  49.387 -static int analysis_phase( int xc_handle, uint32_t domid, 
  49.388 -                           int nr_pfns, unsigned long *arr, int runs )
  49.389 +
  49.390 +static int analysis_phase(int xc_handle, uint32_t domid, int max_pfn, 
  49.391 +                          unsigned long *arr, int runs)
  49.392  {
  49.393      long long start, now;
  49.394      xc_shadow_control_stats_t stats;
  49.395 @@ -308,22 +330,18 @@ static int analysis_phase( int xc_handle
  49.396  
  49.397      start = llgettimeofday();
  49.398  
  49.399 -    for ( j = 0; j < runs; j++ )
  49.400 -    {
  49.401 +    for (j = 0; j < runs; j++) {
  49.402          int i;
  49.403 -
  49.404 -        xc_shadow_control( xc_handle, domid, 
  49.405 -                           DOM0_SHADOW_CONTROL_OP_CLEAN,
  49.406 -                           arr, nr_pfns, NULL);
  49.407 +        
  49.408 +        xc_shadow_control(xc_handle, domid, DOM0_SHADOW_CONTROL_OP_CLEAN,
  49.409 +                          arr, max_pfn, NULL);
  49.410          fprintf(stderr, "#Flush\n");
  49.411 -        for ( i = 0; i < 40; i++ )
  49.412 -        {     
  49.413 +        for ( i = 0; i < 40; i++ ) {     
  49.414              usleep(50000);     
  49.415              now = llgettimeofday();
  49.416 -            xc_shadow_control( xc_handle, domid, 
  49.417 -                               DOM0_SHADOW_CONTROL_OP_PEEK,
  49.418 -                               NULL, 0, &stats);
  49.419 -
  49.420 +            xc_shadow_control(xc_handle, domid, DOM0_SHADOW_CONTROL_OP_PEEK,
  49.421 +                              NULL, 0, &stats);
  49.422 +            
  49.423              fprintf(stderr, "now= %lld faults= %" PRId32 " dirty= %" PRId32
  49.424                      " dirty_net= %" PRId32 " dirty_block= %" PRId32"\n", 
  49.425                      ((now-start)+500)/1000, 
  49.426 @@ -331,7 +349,7 @@ static int analysis_phase( int xc_handle
  49.427                      stats.dirty_net_count, stats.dirty_block_count);
  49.428          }
  49.429      }
  49.430 -
  49.431 +    
  49.432      return -1;
  49.433  }
  49.434  
  49.435 @@ -345,67 +363,150 @@ static int suspend_and_state(int xc_hand
  49.436  
  49.437      printf("suspend\n");
  49.438      fflush(stdout);
  49.439 -    if ( fgets(ans, sizeof(ans), stdin) == NULL )
  49.440 -    {
  49.441 +    if (fgets(ans, sizeof(ans), stdin) == NULL) {
  49.442          ERR("failed reading suspend reply");
  49.443          return -1;
  49.444      }
  49.445 -    if ( strncmp(ans, "done\n", 5) )
  49.446 -    {
  49.447 +    if (strncmp(ans, "done\n", 5)) {
  49.448          ERR("suspend reply incorrect: %s", ans);
  49.449          return -1;
  49.450      }
  49.451  
  49.452   retry:
  49.453  
  49.454 -    if ( xc_domain_getinfo(xc_handle, dom, 1, info) != 1)
  49.455 -    {
  49.456 +    if (xc_domain_getinfo(xc_handle, dom, 1, info) != 1) {
  49.457          ERR("Could not get domain info");
  49.458          return -1;
  49.459      }
  49.460  
  49.461 -    if ( xc_domain_get_vcpu_context(xc_handle, dom, 0 /* XXX */, 
  49.462 -                                    ctxt) )
  49.463 -    {
  49.464 +    if ( xc_domain_get_vcpu_context(xc_handle, dom, 0 /* XXX */, ctxt)) 
  49.465          ERR("Could not get vcpu context");
  49.466 -    }
  49.467 +
  49.468  
  49.469 -    if ( info->shutdown && info->shutdown_reason == SHUTDOWN_suspend )
  49.470 -    {
  49.471 +    if (info->shutdown && info->shutdown_reason == SHUTDOWN_suspend)
  49.472          return 0; // success
  49.473 -    }
  49.474  
  49.475 -    if ( info->paused )
  49.476 -    {
  49.477 +    if (info->paused) {
  49.478          // try unpausing domain, wait, and retest 
  49.479          xc_domain_unpause( xc_handle, dom );
  49.480 -
  49.481 +        
  49.482          ERR("Domain was paused. Wait and re-test.");
  49.483          usleep(10000);  // 10ms
  49.484 -
  49.485 +        
  49.486          goto retry;
  49.487      }
  49.488  
  49.489  
  49.490 -    if( ++i < 100 )
  49.491 -    {
  49.492 +    if( ++i < 100 ) {
  49.493          ERR("Retry suspend domain.");
  49.494          usleep(10000);  // 10ms 
  49.495          goto retry;
  49.496      }
  49.497 -
  49.498 +    
  49.499      ERR("Unable to suspend domain.");
  49.500  
  49.501      return -1;
  49.502  }
  49.503  
  49.504 +
  49.505 +/*
  49.506 +** During transfer (or in the state file), all page-table pages must be  
  49.507 +** converted into a 'canonical' form where references to actual mfns 
  49.508 +** are replaced with references to the corresponding pfns. 
  49.509 +**
  49.510 +** This function performs the appropriate conversion, taking into account 
  49.511 +** which entries do not require canonicalization (in particular, those 
  49.512 +** entries which map the virtual address reserved for the hypervisor). 
  49.513 +*/
  49.514 +void canonicalize_pagetable(unsigned long type, unsigned long pfn, 
  49.515 +                             const void *spage, void *dpage) 
  49.516 +{ 
  49.517 +    
  49.518 +    int i, pte_last, xen_start, xen_end;
  49.519 +    uint64_t pte;
  49.520 +
  49.521 +    /* 
  49.522 +    ** We need to determine which entries in this page table hold
  49.523 +    ** reserved hypervisor mappings. This depends on the current
  49.524 +    ** page table type as well as the number of paging levels. 
  49.525 +    */
  49.526 +    xen_start = xen_end = pte_last = PAGE_SIZE / ((pt_levels == 2)? 4 : 8); 
  49.527 +    
  49.528 +    if (pt_levels == 2 && type == L2TAB)
  49.529 +        xen_start = (hvirt_start >> L2_PAGETABLE_SHIFT); 
  49.530 +
  49.531 +    if (pt_levels == 3 && type == L3TAB) 
  49.532 +        xen_start = L3_PAGETABLE_ENTRIES_PAE; 
  49.533 +        
  49.534 +    /* 
  49.535 +    ** in PAE only the L2 mapping the top 1GB contains Xen mappings. 
  49.536 +    ** We can spot this by looking for the guest linear mapping which
  49.537 +    ** Xen always ensures is present in that L2. Guests must ensure 
  49.538 +    ** that this check will fail for other L2s. 
  49.539 +    */
  49.540 +    if (pt_levels == 3 && type == L2TAB) {
  49.541 +
  49.542 +/* XXX index of the L2 entry in PAE mode which holds the guest LPT */
  49.543 +#define PAE_GLPT_L2ENTRY (495) 
  49.544 +        pte = ((uint64_t*)spage)[PAE_GLPT_L2ENTRY]; 
  49.545 +
  49.546 +        if(((pte >> PAGE_SHIFT) & 0x0fffffff) == live_p2m[pfn])
  49.547 +            xen_start = (hvirt_start >> L2_PAGETABLE_SHIFT_PAE) & 0x1ff; 
  49.548 +    }
  49.549 +
  49.550 +    /* Now iterate through the page table, canonicalizing each PTE */
  49.551 +    for (i = 0; i < pte_last; i++ ) {
  49.552 +
  49.553 +        unsigned long pfn, mfn; 
  49.554 +        
  49.555 +        if (pt_levels == 2)
  49.556 +            pte = ((uint32_t*)spage)[i];
  49.557 +        else
  49.558 +            pte = ((uint64_t*)spage)[i];
  49.559 +        
  49.560 +        if (i >= xen_start && i < xen_end)
  49.561 +            pte = 0;
  49.562 +        
  49.563 +        if (pte & _PAGE_PRESENT) {
  49.564 +            
  49.565 +            mfn = (pte >> PAGE_SHIFT) & 0xfffffff;      
  49.566 +            pfn = live_m2p[mfn];
  49.567 +            
  49.568 +            if (!MFN_IS_IN_PSEUDOPHYS_MAP(mfn)) {
  49.569 +                /* I don't think this should ever happen */
  49.570 +                DPRINTF("FNI: [%08lx,%d] pte=%llx,"
  49.571 +                        " mfn=%08lx, pfn=%08lx [mfn]=%08lx\n",
  49.572 +                        type, i, (unsigned long long)pte, mfn, 
  49.573 +                        live_m2p[mfn],
  49.574 +                        (live_m2p[mfn] < max_pfn) ? 
  49.575 +                        live_p2m[live_m2p[mfn]] : 0xdeadbeaf);
  49.576 +                
  49.577 +                pfn = 0; /* be suspicious */
  49.578 +            }
  49.579 +            
  49.580 +            pte &= 0xffffff0000000fffULL;
  49.581 +            pte |= (uint64_t)pfn << PAGE_SHIFT;
  49.582 +        }
  49.583 +        
  49.584 +        if (pt_levels == 2)
  49.585 +            ((uint32_t*)dpage)[i] = pte;
  49.586 +        else
  49.587 +            ((uint64_t*)dpage)[i] = pte;		       
  49.588 +        
  49.589 +    } 
  49.590 +    
  49.591 +    return; 
  49.592 +}
  49.593 +
  49.594 +
  49.595 +
  49.596 +
  49.597  int xc_linux_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters, 
  49.598                    uint32_t max_factor, uint32_t flags)
  49.599  {
  49.600      xc_dominfo_t info;
  49.601  
  49.602 -    int rc = 1, i, j, k, last_iter, iter = 0;
  49.603 -    unsigned long mfn;
  49.604 +    int rc = 1, i, j, last_iter, iter = 0;
  49.605      int live  = (flags & XCFLAGS_LIVE); 
  49.606      int debug = (flags & XCFLAGS_DEBUG); 
  49.607      int sent_last_iter, skip_this_iter;
  49.608 @@ -421,18 +522,16 @@ int xc_linux_save(int xc_handle, int io_
  49.609      unsigned long *pfn_batch = NULL;
  49.610  
  49.611      /* A temporary mapping, and a copy, of one frame of guest memory. */
  49.612 -    unsigned long page[1024];
  49.613 +    char page[PAGE_SIZE]; 
  49.614 +
  49.615 +    /* Double and single indirect references to the live P2M table */
  49.616 +    unsigned long *live_p2m_frame_list_list = NULL;
  49.617 +    unsigned long *live_p2m_frame_list = NULL;
  49.618  
  49.619      /* A copy of the pfn-to-mfn table frame list. */
  49.620 -    unsigned long *live_pfn_to_mfn_frame_list_list = NULL;
  49.621 -    unsigned long *live_pfn_to_mfn_frame_list = NULL;
  49.622 -    unsigned long pfn_to_mfn_frame_list[1024];
  49.623 +    unsigned long *p2m_frame_list = NULL;
  49.624  
  49.625 -    /* Live mapping of the table mapping each PFN to its current MFN. */
  49.626 -    unsigned long *live_pfn_to_mfn_table = NULL;
  49.627 -    /* Live mapping of system MFN to PFN table. */
  49.628 -    unsigned long *live_mfn_to_pfn_table = NULL;
  49.629 -    unsigned long mfn_to_pfn_table_start_mfn;
  49.630 +    unsigned long m2p_start_mfn;
  49.631      
  49.632      /* Live mapping of shared info structure */
  49.633      shared_info_t *live_shinfo = NULL;
  49.634 @@ -440,10 +539,9 @@ int xc_linux_save(int xc_handle, int io_
  49.635      /* base of the region in which domain memory is mapped */
  49.636      unsigned char *region_base = NULL;
  49.637  
  49.638 -    /* number of pages we're dealing with */
  49.639 -    unsigned long nr_pfns;
  49.640  
  49.641 -    /* power of 2 order of nr_pfns */
  49.642 +    
  49.643 +    /* power of 2 order of max_pfn */
  49.644      int order_nr; 
  49.645  
  49.646      /* bitmap of pages:
  49.647 @@ -454,207 +552,197 @@ int xc_linux_save(int xc_handle, int io_
  49.648      
  49.649      xc_shadow_control_stats_t stats;
  49.650  
  49.651 -    int needed_to_fix = 0;
  49.652 -    int total_sent    = 0;
  49.653 -
  49.654 -    MBIT_RATE = START_MBIT_RATE;
  49.655 +    unsigned long needed_to_fix = 0;
  49.656 +    unsigned long total_sent    = 0;
  49.657  
  49.658  
  49.659      /* If no explicit control parameters given, use defaults */
  49.660 -    if( !max_iters ) 
  49.661 +    if(!max_iters) 
  49.662          max_iters = DEF_MAX_ITERS; 
  49.663 -    if( !max_factor ) 
  49.664 +    if(!max_factor) 
  49.665          max_factor = DEF_MAX_FACTOR; 
  49.666 +    
  49.667 +    initialize_mbit_rate(); 
  49.668 +
  49.669 +    DPRINTF("xc_linux_save start DOM%u live=%s\n", dom, live ? 
  49.670 +            "true" : "false"); 
  49.671  
  49.672 -
  49.673 -    DPRINTF("xc_linux_save start DOM%u live=%s\n", dom, live?"true":"false"); 
  49.674 +    if(!get_platform_info(xc_handle, dom, 
  49.675 +                          &max_mfn, &hvirt_start, &pt_levels)) {
  49.676 +        ERR("Unable to get platform info."); 
  49.677 +        return 1;
  49.678 +    }
  49.679  
  49.680 -    if ( mlock(&ctxt, sizeof(ctxt)) ) 
  49.681 -    {
  49.682 +    if (xc_domain_getinfo(xc_handle, dom, 1, &info) != 1) {
  49.683 +        ERR("Could not get domain info");
  49.684 +        return 1; 
  49.685 +    }
  49.686 +
  49.687 +    if (mlock(&ctxt, sizeof(ctxt))) {
  49.688          ERR("Unable to mlock ctxt");
  49.689          return 1;
  49.690      }
  49.691      
  49.692 -    if ( xc_domain_getinfo(xc_handle, dom, 1, &info) != 1 )
  49.693 -    {
  49.694 -        ERR("Could not get domain info");
  49.695 -        goto out;
  49.696 -    }
  49.697 -    if ( xc_domain_get_vcpu_context(xc_handle, dom, /* FIXME */ 0, &ctxt) )
  49.698 -    {
  49.699 +    /* Only have to worry about vcpu 0 even for SMP */
  49.700 +    if (xc_domain_get_vcpu_context(xc_handle, dom, 0, &ctxt)) {
  49.701          ERR("Could not get vcpu context");
  49.702          goto out;
  49.703      }
  49.704      shared_info_frame = info.shared_info_frame;
  49.705  
  49.706      /* A cheesy test to see whether the domain contains valid state. */
  49.707 -    if ( ctxt.ctrlreg[3] == 0 )
  49.708 +    if (ctxt.ctrlreg[3] == 0)
  49.709      {
  49.710          ERR("Domain is not in a valid Linux guest OS state");
  49.711          goto out;
  49.712      }
  49.713 -    
  49.714 -    nr_pfns = info.max_memkb >> (PAGE_SHIFT - 10);
  49.715 -
  49.716 -    /* cheesy sanity check */
  49.717 -    if ( nr_pfns > 1024*1024 )
  49.718 -    {
  49.719 -        ERR("Invalid state record -- pfn count out of range: %lu", nr_pfns);
  49.720 +  
  49.721 +   /* cheesy sanity check */
  49.722 +    if ((info.max_memkb >> (PAGE_SHIFT - 10)) > max_mfn) {
  49.723 +        ERR("Invalid state record -- pfn count out of range: %lu", 
  49.724 +            (info.max_memkb >> (PAGE_SHIFT - 10))); 
  49.725          goto out;
  49.726 -    }
  49.727 -
  49.728 +     }
  49.729 + 
  49.730      /* Map the shared info frame */
  49.731 -    live_shinfo = xc_map_foreign_range(
  49.732 -        xc_handle, dom, PAGE_SIZE, PROT_READ, shared_info_frame);
  49.733 -    if ( !live_shinfo )
  49.734 -    {
  49.735 +    if(!(live_shinfo = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE, 
  49.736 +                                            PROT_READ, shared_info_frame))) {
  49.737          ERR("Couldn't map live_shinfo");
  49.738          goto out;
  49.739      }
  49.740  
  49.741 -    live_pfn_to_mfn_frame_list_list = xc_map_foreign_range(
  49.742 -        xc_handle, dom,
  49.743 -        PAGE_SIZE, PROT_READ, live_shinfo->arch.pfn_to_mfn_frame_list_list);
  49.744 +    max_pfn = live_shinfo->arch.max_pfn;
  49.745  
  49.746 -    if (!live_pfn_to_mfn_frame_list_list){
  49.747 -        ERR("Couldn't map pfn_to_mfn_frame_list_list");
  49.748 +    live_p2m_frame_list_list = 
  49.749 +        xc_map_foreign_range(xc_handle, dom, PAGE_SIZE, PROT_READ, 
  49.750 +                             live_shinfo->arch.pfn_to_mfn_frame_list_list);
  49.751 +
  49.752 +    if (!live_p2m_frame_list_list) {
  49.753 +        ERR("Couldn't map p2m_frame_list_list");
  49.754          goto out;
  49.755      }
  49.756  
  49.757 -    live_pfn_to_mfn_frame_list = 
  49.758 -        xc_map_foreign_batch(xc_handle, dom, 
  49.759 -                             PROT_READ,
  49.760 -                             live_pfn_to_mfn_frame_list_list,
  49.761 -                             (nr_pfns+(1024*1024)-1)/(1024*1024) );
  49.762 -
  49.763 -    if ( !live_pfn_to_mfn_frame_list)
  49.764 -    {
  49.765 -        ERR("Couldn't map pfn_to_mfn_frame_list");
  49.766 +    live_p2m_frame_list = 
  49.767 +        xc_map_foreign_batch(xc_handle, dom, PROT_READ,
  49.768 +                             live_p2m_frame_list_list,
  49.769 +                             P2M_FLL_ENTRIES); 
  49.770 +    
  49.771 +    if (!live_p2m_frame_list) {
  49.772 +        ERR("Couldn't map p2m_frame_list");
  49.773          goto out;
  49.774      }
  49.775  
  49.776 -
  49.777      /* Map all the frames of the pfn->mfn table. For migrate to succeed, 
  49.778         the guest must not change which frames are used for this purpose. 
  49.779         (its not clear why it would want to change them, and we'll be OK
  49.780         from a safety POV anyhow. */
  49.781  
  49.782 -    live_pfn_to_mfn_table = xc_map_foreign_batch(xc_handle, dom, 
  49.783 -                                                 PROT_READ,
  49.784 -                                                 live_pfn_to_mfn_frame_list,
  49.785 -                                                 (nr_pfns+1023)/1024 );  
  49.786 -    if ( !live_pfn_to_mfn_table )
  49.787 -    {
  49.788 -        ERR("Couldn't map pfn_to_mfn table");
  49.789 +    live_p2m = xc_map_foreign_batch(xc_handle, dom, PROT_READ,
  49.790 +                                    live_p2m_frame_list,
  49.791 +                                    P2M_FL_ENTRIES); 
  49.792 +
  49.793 +    if (!live_p2m) {
  49.794 +        ERR("Couldn't map p2m table");
  49.795          goto out;
  49.796      }
  49.797  
  49.798      /* Setup the mfn_to_pfn table mapping */
  49.799 -    mfn_to_pfn_table_start_mfn = xc_get_m2p_start_mfn( xc_handle );
  49.800 -
  49.801 -    live_mfn_to_pfn_table = 
  49.802 -        xc_map_foreign_range(xc_handle, DOMID_XEN, 
  49.803 -                             PAGE_SIZE*1024, PROT_READ, 
  49.804 -                             mfn_to_pfn_table_start_mfn );
  49.805 +    m2p_start_mfn = xc_get_m2p_start_mfn(xc_handle);
  49.806 +    live_m2p      = xc_map_foreign_range(xc_handle, DOMID_XEN, M2P_SIZE, 
  49.807 +                                         PROT_READ, m2p_start_mfn);
  49.808 +    
  49.809 +    /* Get a local copy fo the live_P2M_frame_list */
  49.810 +    if(!(p2m_frame_list = malloc(P2M_FL_SIZE))) { 
  49.811 +        ERR("Couldn't allocate p2m_frame_list array");
  49.812 +        goto out;
  49.813 +    }
  49.814 +    memcpy(p2m_frame_list, live_p2m_frame_list, P2M_FL_SIZE); 
  49.815  
  49.816      /* Canonicalise the pfn-to-mfn table frame-number list. */
  49.817 -    memcpy( pfn_to_mfn_frame_list, live_pfn_to_mfn_frame_list, PAGE_SIZE );
  49.818 -
  49.819 -    for ( i = 0; i < nr_pfns; i += 1024 )
  49.820 -    {
  49.821 -        if ( !translate_mfn_to_pfn(&pfn_to_mfn_frame_list[i/1024]) )
  49.822 -        {
  49.823 +    for (i = 0; i < max_pfn; i += ulpp) {
  49.824 +        if (!translate_mfn_to_pfn(&p2m_frame_list[i/ulpp])) { 
  49.825              ERR("Frame# in pfn-to-mfn frame list is not in pseudophys");
  49.826              goto out;
  49.827          }
  49.828      }
  49.829  
  49.830 -
  49.831      /* Domain is still running at this point */
  49.832  
  49.833 -    if ( live )
  49.834 -    {
  49.835 -        if ( xc_shadow_control( xc_handle, dom, 
  49.836 -                                DOM0_SHADOW_CONTROL_OP_ENABLE_LOGDIRTY,
  49.837 -                                NULL, 0, NULL ) < 0 )
  49.838 -        {
  49.839 +    if (live) {
  49.840 +
  49.841 +        if (xc_shadow_control(xc_handle, dom, 
  49.842 +                              DOM0_SHADOW_CONTROL_OP_ENABLE_LOGDIRTY,
  49.843 +                              NULL, 0, NULL ) < 0) { 
  49.844              ERR("Couldn't enable shadow mode");
  49.845              goto out;
  49.846          }
  49.847 -
  49.848 +        
  49.849          last_iter = 0;
  49.850 -    } 
  49.851 -    else
  49.852 -    {
  49.853 +        
  49.854 +    } else {
  49.855 +        
  49.856          /* This is a non-live suspend. Issue the call back to get the
  49.857             domain suspended */
  49.858 -
  49.859 +        
  49.860          last_iter = 1;
  49.861 -
  49.862 -        if ( suspend_and_state( xc_handle, io_fd, dom, &info, &ctxt) )
  49.863 -        {
  49.864 +        
  49.865 +        if (suspend_and_state( xc_handle, io_fd, dom, &info, &ctxt)) {
  49.866              ERR("Domain appears not to have suspended");
  49.867              goto out;
  49.868          }
  49.869 -
  49.870 +        
  49.871      }
  49.872 -    sent_last_iter = 1<<20; /* 4GB of pages */
  49.873  
  49.874 -    /* calculate the power of 2 order of nr_pfns, e.g.
  49.875 +#if 0
  49.876 +    sent_last_iter = 0xFFFFFFFF; /* Pretend we sent a /lot/ last time */
  49.877 +#else
  49.878 +    sent_last_iter = 1 << 20; 
  49.879 +#endif
  49.880 +
  49.881 +
  49.882 +    /* calculate the power of 2 order of max_pfn, e.g.
  49.883         15->4 16->4 17->5 */
  49.884 -    for ( i = nr_pfns-1, order_nr = 0; i ; i >>= 1, order_nr++ )
  49.885 +    for (i = max_pfn-1, order_nr = 0; i ; i >>= 1, order_nr++)
  49.886          continue;
  49.887  
  49.888 -    /* Setup to_send bitmap */
  49.889 -    {
  49.890 -        /* size these for a maximal 4GB domain, to make interaction
  49.891 -           with balloon driver easier. It's only user space memory,
  49.892 -           ater all... (3x 128KB) */
  49.893 -
  49.894 -        int sz = ( 1<<20 ) / 8;
  49.895 - 
  49.896 -        to_send = malloc( sz );
  49.897 -        to_fix  = calloc( 1, sz );
  49.898 -        to_skip = malloc( sz );
  49.899 +#undef BITMAP_SIZE
  49.900 +#define BITMAP_SIZE ((1<<20)/8) 
  49.901  
  49.902 -        if ( !to_send || !to_fix || !to_skip )
  49.903 -        {
  49.904 -            ERR("Couldn't allocate to_send array");
  49.905 -            goto out;
  49.906 -        }
  49.907 -
  49.908 -        memset(to_send, 0xff, sz);
  49.909 +    /* Setup to_send / to_fix and to_skip bitmaps */
  49.910 +    to_send = malloc(BITMAP_SIZE); 
  49.911 +    to_fix  = calloc(1, BITMAP_SIZE); 
  49.912 +    to_skip = malloc(BITMAP_SIZE); 
  49.913 +    
  49.914 +    if (!to_send || !to_fix || !to_skip) {
  49.915 +        ERR("Couldn't allocate to_send array");
  49.916 +        goto out;
  49.917 +    }
  49.918 +    
  49.919 +    memset(to_send, 0xff, BITMAP_SIZE);
  49.920  
  49.921 -        if ( mlock(to_send, sz) )
  49.922 -        {
  49.923 -            ERR("Unable to mlock to_send");
  49.924 -            return 1;
  49.925 -        }
  49.926 -
  49.927 -        /* (to fix is local only) */
  49.928 -
  49.929 -        if ( mlock(to_skip, sz) )
  49.930 -        {
  49.931 -            ERR("Unable to mlock to_skip");
  49.932 -            return 1;
  49.933 -        }
  49.934 -
  49.935 +    if (mlock(to_send, BITMAP_SIZE)) {
  49.936 +        ERR("Unable to mlock to_send");
  49.937 +        return 1;
  49.938      }
  49.939  
  49.940 -    analysis_phase( xc_handle, dom, nr_pfns, to_skip, 0 );
  49.941 +    /* (to fix is local only) */
  49.942 +    if (mlock(to_skip, BITMAP_SIZE)) {
  49.943 +        ERR("Unable to mlock to_skip");
  49.944 +        return 1;
  49.945 +    }
  49.946 +        
  49.947 +    analysis_phase(xc_handle, dom, max_pfn, to_skip, 0);
  49.948  
  49.949      /* We want zeroed memory so use calloc rather than malloc. */
  49.950 -    pfn_type = calloc(BATCH_SIZE, sizeof(unsigned long));
  49.951 -    pfn_batch = calloc(BATCH_SIZE, sizeof(unsigned long));
  49.952 +    pfn_type  = calloc(MAX_BATCH_SIZE, sizeof(unsigned long));
  49.953 +    pfn_batch = calloc(MAX_BATCH_SIZE, sizeof(unsigned long));
  49.954  
  49.955 -    if ( (pfn_type == NULL) || (pfn_batch == NULL) )
  49.956 -    {
  49.957 +    if ((pfn_type == NULL) || (pfn_batch == NULL)) {
  49.958          errno = ENOMEM;
  49.959          goto out;
  49.960      }
  49.961  
  49.962 -    if ( mlock(pfn_type, BATCH_SIZE * sizeof(unsigned long)) )
  49.963 -    {
  49.964 +    if (mlock(pfn_type, MAX_BATCH_SIZE * sizeof(unsigned long))) {
  49.965          ERR("Unable to mlock");
  49.966          goto out;
  49.967      }
  49.968 @@ -663,46 +751,40 @@ int xc_linux_save(int xc_handle, int io_
  49.969      /*
  49.970       * Quick belt and braces sanity check.
  49.971       */
  49.972 -#if DEBUG
  49.973      {
  49.974          int err=0;
  49.975 -        for ( i = 0; i < nr_pfns; i++ )
  49.976 -        {
  49.977 -            mfn = live_pfn_to_mfn_table[i];
  49.978 -     
  49.979 -            if( (live_mfn_to_pfn_table[mfn] != i) && (mfn != 0xffffffffUL) )
  49.980 -            {
  49.981 -                fprintf(stderr, "i=0x%x mfn=%lx live_mfn_to_pfn_table=%lx\n",
  49.982 -                        i,mfn,live_mfn_to_pfn_table[mfn]);
  49.983 +        unsigned long mfn; 
  49.984 +        for (i = 0; i < max_pfn; i++) {
  49.985 +
  49.986 +            mfn = live_p2m[i];
  49.987 +            if((live_m2p[mfn] != i) && (mfn != 0xffffffffUL)) { 
  49.988 +                DPRINTF("i=0x%x mfn=%lx live_m2p=%lx\n", i, 
  49.989 +                        mfn, live_m2p[mfn]);
  49.990                  err++;
  49.991              }
  49.992          }
  49.993 -        fprintf(stderr, "Had %d unexplained entries in p2m table\n",err);
  49.994 +        DPRINTF("Had %d unexplained entries in p2m table\n", err);
  49.995      }
  49.996 -#endif
  49.997  
  49.998  
  49.999      /* Start writing out the saved-domain record. */
 49.1000  
 49.1001 -    if ( write(io_fd, &nr_pfns, sizeof(unsigned long)) !=
 49.1002 -         sizeof(unsigned long) )
 49.1003 -    {
 49.1004 -        ERR("write: nr_pfns");
 49.1005 +    if(!write_exact(io_fd, &max_pfn, sizeof(unsigned long))) { 
 49.1006 +        ERR("write: max_pfn");
 49.1007          goto out;
 49.1008      }
 49.1009  
 49.1010 -    if ( write(io_fd, pfn_to_mfn_frame_list, PAGE_SIZE) != PAGE_SIZE )
 49.1011 -    {
 49.1012 -        ERR("write: pfn_to_mfn_frame_list");
 49.1013 +    if(!write_exact(io_fd, p2m_frame_list, P2M_FL_SIZE)) { 
 49.1014 +        ERR("write: p2m_frame_list");
 49.1015          goto out;
 49.1016      }
 49.1017 -
 49.1018 -    print_stats( xc_handle, dom, 0, &stats, 0 );
 49.1019 +    
 49.1020 +    print_stats(xc_handle, dom, 0, &stats, 0);
 49.1021  
 49.1022      /* Now write out each data page, canonicalising page tables as we go... */
 49.1023 -    
 49.1024 -    for ( ; ; )
 49.1025 -    {
 49.1026 +
 49.1027 +    while(1) {
 49.1028 +
 49.1029          unsigned int prev_pc, sent_this_iter, N, batch;
 49.1030  
 49.1031          iter++;
 49.1032 @@ -713,24 +795,20 @@ int xc_linux_save(int xc_handle, int io_
 49.1033  
 49.1034          DPRINTF("Saving memory pages: iter %d   0%%", iter);
 49.1035  
 49.1036 -        while ( N < nr_pfns )
 49.1037 -        {
 49.1038 -            unsigned int this_pc = (N * 100) / nr_pfns;
 49.1039 +        while( N < max_pfn ){
 49.1040  
 49.1041 -            if ( (this_pc - prev_pc) >= 5 )
 49.1042 -            {
 49.1043 +            unsigned int this_pc = (N * 100) / max_pfn;
 49.1044 +
 49.1045 +            if ((this_pc - prev_pc) >= 5) {
 49.1046                  DPRINTF("\b\b\b\b%3d%%", this_pc);
 49.1047                  prev_pc = this_pc;
 49.1048              }
 49.1049 -
 49.1050 +            
 49.1051              /* slightly wasteful to peek the whole array evey time, 
 49.1052                 but this is fast enough for the moment. */
 49.1053 -
 49.1054 -            if ( !last_iter && 
 49.1055 -                 xc_shadow_control(xc_handle, dom, 
 49.1056 -                                   DOM0_SHADOW_CONTROL_OP_PEEK,
 49.1057 -                                   to_skip, nr_pfns, NULL) != nr_pfns )
 49.1058 -            {
 49.1059 +            if (!last_iter && xc_shadow_control(
 49.1060 +                    xc_handle, dom, DOM0_SHADOW_CONTROL_OP_PEEK,
 49.1061 +                    to_skip, max_pfn, NULL) != max_pfn) {
 49.1062                  ERR("Error peeking shadow bitmap");
 49.1063                  goto out;
 49.1064              }
 49.1065 @@ -738,219 +816,168 @@ int xc_linux_save(int xc_handle, int io_
 49.1066  
 49.1067              /* load pfn_type[] with the mfn of all the pages we're doing in
 49.1068                 this batch. */
 49.1069 -
 49.1070 -            for ( batch = 0; batch < BATCH_SIZE && N < nr_pfns ; N++ )
 49.1071 -            {
 49.1072 -                int n = permute(N, nr_pfns, order_nr );
 49.1073 +            for (batch = 0; batch < MAX_BATCH_SIZE && N < max_pfn ; N++) {
 49.1074  
 49.1075 -                if ( 0 && debug ) {
 49.1076 -                    fprintf(stderr,"%d pfn= %08lx mfn= %08lx %d  "
 49.1077 -                            " [mfn]= %08lx\n",
 49.1078 -                            iter, (unsigned long)n, live_pfn_to_mfn_table[n],
 49.1079 -                            test_bit(n,to_send),
 49.1080 -                            live_mfn_to_pfn_table[live_pfn_to_mfn_table[n]&
 49.1081 -                                                 0xFFFFF]);
 49.1082 -                }
 49.1083 +                int n = permute(N, max_pfn, order_nr);
 49.1084  
 49.1085 -                if ( !last_iter && 
 49.1086 -                     test_bit(n, to_send) && 
 49.1087 -                     test_bit(n, to_skip) ) {
 49.1088 +                if (debug) {
 49.1089 +                    DPRINTF("%d pfn= %08lx mfn= %08lx %d  [mfn]= %08lx\n",
 49.1090 +                            iter, (unsigned long)n, live_p2m[n],
 49.1091 +                            test_bit(n, to_send), 
 49.1092 +                            live_m2p[live_p2m[n]&0xFFFFF]);
 49.1093 +                }
 49.1094 +                
 49.1095 +                if (!last_iter && test_bit(n, to_send)&& test_bit(n, to_skip)) 
 49.1096                      skip_this_iter++; /* stats keeping */
 49.1097 -                }
 49.1098  
 49.1099 -                if ( !((test_bit(n, to_send) && !test_bit(n, to_skip)) ||
 49.1100 -                       (test_bit(n, to_send) && last_iter) ||
 49.1101 -                       (test_bit(n, to_fix)  && last_iter)) ) {
 49.1102 +                if (!((test_bit(n, to_send) && !test_bit(n, to_skip)) ||
 49.1103 +                      (test_bit(n, to_send) && last_iter) ||
 49.1104 +                      (test_bit(n, to_fix)  && last_iter)))
 49.1105                      continue;
 49.1106 -                }
 49.1107  
 49.1108 -                /* we get here if:
 49.1109 -                   1. page is marked to_send & hasn't already been re-dirtied
 49.1110 -                   2. (ignore to_skip in last iteration)
 49.1111 -                   3. add in pages that still need fixup (net bufs)
 49.1112 +                /* 
 49.1113 +                ** we get here if:
 49.1114 +                **  1. page is marked to_send & hasn't already been re-dirtied
 49.1115 +                **  2. (ignore to_skip in last iteration)
 49.1116 +                **  3. add in pages that still need fixup (net bufs)
 49.1117                  */
 49.1118    
 49.1119                  pfn_batch[batch] = n;
 49.1120 -                pfn_type[batch] = live_pfn_to_mfn_table[n];
 49.1121 +                pfn_type[batch]  = live_p2m[n];
 49.1122  
 49.1123 -                if( ! is_mapped(pfn_type[batch]) )
 49.1124 -                {
 49.1125 +                if(!is_mapped(pfn_type[batch])) {
 49.1126 +
 49.1127                      /* not currently in pusedo-physical map -- set bit
 49.1128                         in to_fix that we must send this page in last_iter
 49.1129                         unless its sent sooner anyhow */
 49.1130  
 49.1131 -                    set_bit( n, to_fix );
 49.1132 -                    if( iter>1 )
 49.1133 +                    set_bit(n, to_fix);
 49.1134 +                    if(iter > 1)
 49.1135                          DPRINTF("netbuf race: iter %d, pfn %x. mfn %lx\n",
 49.1136 -                                iter,n,pfn_type[batch]);
 49.1137 +                                iter, n, pfn_type[batch]);
 49.1138                      continue;
 49.1139                  }
 49.1140  
 49.1141 -                if ( last_iter && 
 49.1142 -                     test_bit(n, to_fix) && 
 49.1143 -                     !test_bit(n, to_send) )
 49.1144 -                {
 49.1145 +                if(last_iter && test_bit(n, to_fix) && !test_bit(n, to_send)) {
 49.1146                      needed_to_fix++;
 49.1147                      DPRINTF("Fix! iter %d, pfn %x. mfn %lx\n",
 49.1148                              iter,n,pfn_type[batch]);
 49.1149                  }
 49.1150  
 49.1151                  clear_bit(n, to_fix); 
 49.1152 -
 49.1153 +                
 49.1154                  batch++;
 49.1155              }
 49.1156       
 49.1157 -            if ( batch == 0 )
 49.1158 +            if (batch == 0)
 49.1159                  goto skip; /* vanishingly unlikely... */
 49.1160        
 49.1161 -            if ( (region_base = xc_map_foreign_batch(xc_handle, dom, 
 49.1162 -                                                     PROT_READ,
 49.1163 -                                                     pfn_type,
 49.1164 -                                                     batch)) == 0 ){
 49.1165 +            if ((region_base = xc_map_foreign_batch(
 49.1166 +                     xc_handle, dom, PROT_READ, pfn_type, batch)) == 0) { 
 49.1167                  ERR("map batch failed");
 49.1168                  goto out;
 49.1169              }
 49.1170       
 49.1171 -            if ( xc_get_pfn_type_batch(xc_handle, dom, batch, pfn_type) ){
 49.1172 +            if (xc_get_pfn_type_batch(xc_handle, dom, batch, pfn_type)) {
 49.1173                  ERR("get_pfn_type_batch failed");
 49.1174                  goto out;
 49.1175              }
 49.1176       
 49.1177 -            for ( j = 0; j < batch; j++ )
 49.1178 -            {
 49.1179 -                if ( (pfn_type[j] & LTAB_MASK) == XTAB )
 49.1180 -                {
 49.1181 -                    DPRINTF("type fail: page %i mfn %08lx\n",j,pfn_type[j]);
 49.1182 +            for (j = 0; j < batch; j++) {
 49.1183 +
 49.1184 +                if ((pfn_type[j] & LTAB_MASK) == XTAB) {
 49.1185 +                    DPRINTF("type fail: page %i mfn %08lx\n", j, pfn_type[j]);
 49.1186                      continue;
 49.1187                  }
 49.1188    
 49.1189 -                if ( 0 && debug )
 49.1190 +                if (debug) 
 49.1191                      fprintf(stderr, "%d pfn= %08lx mfn= %08lx [mfn]= %08lx"
 49.1192                              " sum= %08lx\n",
 49.1193                              iter, 
 49.1194                              (pfn_type[j] & LTAB_MASK) | pfn_batch[j],
 49.1195                              pfn_type[j],
 49.1196 -                            live_mfn_to_pfn_table[pfn_type[j]&(~LTAB_MASK)],
 49.1197 +                            live_m2p[pfn_type[j]&(~LTAB_MASK)],
 49.1198                              csum_page(region_base + (PAGE_SIZE*j)));
 49.1199 -
 49.1200 +                
 49.1201                  /* canonicalise mfn->pfn */
 49.1202                  pfn_type[j] = (pfn_type[j] & LTAB_MASK) | pfn_batch[j];
 49.1203              }
 49.1204  
 49.1205 -            if ( write(io_fd, &batch, sizeof(int)) != sizeof(int) )
 49.1206 -            {
 49.1207 +            if(!write_exact(io_fd, &batch, sizeof(unsigned int))) { 
 49.1208                  ERR("Error when writing to state file (2)");
 49.1209                  goto out;
 49.1210              }
 49.1211  
 49.1212 -            if ( write(io_fd, pfn_type, sizeof(unsigned long)*j) !=
 49.1213 -                 (sizeof(unsigned long) * j) )
 49.1214 -            {
 49.1215 +            if(!write_exact(io_fd, pfn_type, sizeof(unsigned long)*j)) { 
 49.1216                  ERR("Error when writing to state file (3)");
 49.1217                  goto out;
 49.1218              }
 49.1219 -     
 49.1220 +            
 49.1221              /* entering this loop, pfn_type is now in pfns (Not mfns) */
 49.1222 -            for ( j = 0; j < batch; j++ )
 49.1223 -            {
 49.1224 +            for (j = 0; j < batch; j++) {
 49.1225 +                
 49.1226 +                unsigned long pfn      = pfn_type[j] & ~LTAB_MASK; 
 49.1227 +                unsigned long pagetype = pfn_type[j] & LTAB_MASK; 
 49.1228 +                void *spage            = (void *) region_base + (PAGE_SIZE*j); 
 49.1229 +
 49.1230 +
 49.1231                  /* write out pages in batch */
 49.1232 -                if ( (pfn_type[j] & LTAB_MASK) == XTAB )
 49.1233 -                {
 49.1234 -                    DPRINTF("SKIP BOGUS page %i mfn %08lx\n",j,pfn_type[j]);
 49.1235 +                if (pagetype == XTAB) {
 49.1236 +                    DPRINTF("SKIP BOGUS page %i mfn %08lx\n", j, pfn_type[j]);
 49.1237                      continue;
 49.1238                  }
 49.1239 -  
 49.1240 -                if ( ((pfn_type[j] & LTABTYPE_MASK) == L1TAB) || 
 49.1241 -                     ((pfn_type[j] & LTABTYPE_MASK) == L2TAB) ){
 49.1242 -                    memcpy(page, region_base + (PAGE_SIZE*j), PAGE_SIZE);
 49.1243 -      
 49.1244 -                    for ( k = 0; 
 49.1245 -                          k < (((pfn_type[j] & LTABTYPE_MASK) == L2TAB) ? 
 49.1246 -                               (HYPERVISOR_VIRT_START >> L2_PAGETABLE_SHIFT) :
 49.1247 -                               1024); 
 49.1248 -                          k++ )
 49.1249 -                    {
 49.1250 -                        unsigned long pfn;
 49.1251  
 49.1252 -                        if ( !(page[k] & _PAGE_PRESENT) )
 49.1253 -                            continue;
 49.1254 -                        
 49.1255 -                        mfn = page[k] >> PAGE_SHIFT;      
 49.1256 -                        pfn = live_mfn_to_pfn_table[mfn];
 49.1257 -
 49.1258 -                        if ( !MFN_IS_IN_PSEUDOPHYS_MAP(mfn) )
 49.1259 -                        {
 49.1260 -                            /* I don't think this should ever happen */
 49.1261 -                            fprintf(stderr, "FNI %d : [%08lx,%d] pte=%08lx, "
 49.1262 -                                    "mfn=%08lx, pfn=%08lx [mfn]=%08lx\n",
 49.1263 -                                    j, pfn_type[j], k,
 49.1264 -                                    page[k], mfn, live_mfn_to_pfn_table[mfn],
 49.1265 -                                    (live_mfn_to_pfn_table[mfn]<nr_pfns)? 
 49.1266 -                                    live_pfn_to_mfn_table[
 49.1267 -                                        live_mfn_to_pfn_table[mfn]] : 
 49.1268 -                                    0xdeadbeef);
 49.1269 -
 49.1270 -                            pfn = 0; /* be suspicious */
 49.1271 -                        }
 49.1272 -
 49.1273 -                        page[k] &= PAGE_SIZE - 1;
 49.1274 -                        page[k] |= pfn << PAGE_SHIFT;
 49.1275 -   
 49.1276 -#if 0
 49.1277 -                        fprintf(stderr,
 49.1278 -                                "L%d i=%d pfn=%d mfn=%d k=%d pte=%08lx "
 49.1279 -                                "xpfn=%d\n",
 49.1280 -                                pfn_type[j]>>28,
 49.1281 -                                j,i,mfn,k,page[k],page[k]>>PAGE_SHIFT);
 49.1282 -#endif     
 49.1283 -   
 49.1284 -                    } /* end of page table rewrite for loop */
 49.1285 -      
 49.1286 +                pagetype &= LTABTYPE_MASK; 
 49.1287 +                
 49.1288 +                if (pagetype >= L1TAB && pagetype <= L4TAB) {
 49.1289 +                    
 49.1290 +                    /* We have a pagetable page: need to rewrite it. */
 49.1291 +                    canonicalize_pagetable(pagetype, pfn, spage, page); 
 49.1292 +                    
 49.1293                      if (ratewrite(io_fd, page, PAGE_SIZE) != PAGE_SIZE) {
 49.1294                          ERR("Error when writing to state file (4)");
 49.1295                          goto out;
 49.1296                      }
 49.1297 -      
 49.1298 -                }  /* end of it's a PT page */ else {  /* normal page */
 49.1299 +                    
 49.1300 +                }  else {  
 49.1301  
 49.1302 -                    if ( ratewrite(io_fd, region_base + (PAGE_SIZE*j), 
 49.1303 -                                   PAGE_SIZE) != PAGE_SIZE )
 49.1304 -                    {
 49.1305 +                    /* We have a normal page: just write it directly. */
 49.1306 +                    if (ratewrite(io_fd, spage, PAGE_SIZE) != PAGE_SIZE) {
 49.1307                          ERR("Error when writing to state file (5)");
 49.1308                          goto out;
 49.1309                      }
 49.1310                  }
 49.1311              } /* end of the write out for this batch */
 49.1312 -     
 49.1313 +            
 49.1314              sent_this_iter += batch;
 49.1315 -
 49.1316 +            
 49.1317          } /* end of this while loop for this iteration */
 49.1318 -
 49.1319 +        
 49.1320          munmap(region_base, batch*PAGE_SIZE);
 49.1321 -
 49.1322 -    skip: 
 49.1323 -
 49.1324 +        
 49.1325 +      skip: 
 49.1326 +        
 49.1327          total_sent += sent_this_iter;
 49.1328  
 49.1329          DPRINTF("\r %d: sent %d, skipped %d, ", 
 49.1330                  iter, sent_this_iter, skip_this_iter );
 49.1331  
 49.1332 -        if ( last_iter ) {
 49.1333 +        if (last_iter) {
 49.1334              print_stats( xc_handle, dom, sent_this_iter, &stats, 1);
 49.1335  
 49.1336 -            DPRINTF("Total pages sent= %d (%.2fx)\n", 
 49.1337 -                    total_sent, ((float)total_sent)/nr_pfns );
 49.1338 -            DPRINTF("(of which %d were fixups)\n", needed_to_fix  );
 49.1339 +            DPRINTF("Total pages sent= %ld (%.2fx)\n", 
 49.1340 +                    total_sent, ((float)total_sent)/max_pfn );
 49.1341 +            DPRINTF("(of which %ld were fixups)\n", needed_to_fix  );
 49.1342          }       
 49.1343  
 49.1344          if (last_iter && debug){
 49.1345              int minusone = -1;
 49.1346 -            memset( to_send, 0xff, (nr_pfns+8)/8 );
 49.1347 +            memset( to_send, 0xff, (max_pfn+8)/8 );
 49.1348              debug = 0;
 49.1349              fprintf(stderr, "Entering debug resend-all mode\n");
 49.1350      
 49.1351              /* send "-1" to put receiver into debug mode */
 49.1352 -            if (write(io_fd, &minusone, sizeof(int)) != sizeof(int)) {
 49.1353 +            if(!write_exact(io_fd, &minusone, sizeof(int))) { 
 49.1354                  ERR("Error when writing to state file (6)");
 49.1355                  goto out;
 49.1356              }
 49.1357 @@ -958,42 +985,40 @@ int xc_linux_save(int xc_handle, int io_
 49.1358              continue;
 49.1359          }
 49.1360  
 49.1361 -        if ( last_iter ) break; 
 49.1362 +        if (last_iter) break; 
 49.1363 +
 49.1364 +        if (live) {
 49.1365 +
 49.1366  
 49.1367 -        if ( live )
 49.1368 -        {
 49.1369 -            if ( 
 49.1370 -                ( ( sent_this_iter > sent_last_iter ) &&
 49.1371 -                  (mbit_rate == MAX_MBIT_RATE ) ) ||
 49.1372 -                (iter >= max_iters) || 
 49.1373 -                (sent_this_iter+skip_this_iter < 50) || 
 49.1374 -                (total_sent > nr_pfns*max_factor) )
 49.1375 -            {
 49.1376 +            if( 
 49.1377 +                ((sent_this_iter > sent_last_iter) && RATE_IS_MAX()) ||
 49.1378 +                (iter >= max_iters) ||
 49.1379 +                (sent_this_iter+skip_this_iter < 50) ||
 49.1380 +                (total_sent > max_pfn*max_factor) ) { 
 49.1381 +
 49.1382                  DPRINTF("Start last iteration\n");
 49.1383                  last_iter = 1;
 49.1384 -
 49.1385 -                if ( suspend_and_state( xc_handle, io_fd, dom, &info, &ctxt) )
 49.1386 -                {
 49.1387 +                
 49.1388 +                if (suspend_and_state(xc_handle, io_fd, dom, &info, &ctxt)) {
 49.1389                      ERR("Domain appears not to have suspended");
 49.1390                      goto out;
 49.1391                  }
 49.1392 -
 49.1393 -                DPRINTF("SUSPEND shinfo %08lx eip %08u edx %08u\n",
 49.1394 -                        info.shared_info_frame,
 49.1395 -                        ctxt.user_regs.eip, ctxt.user_regs.edx);
 49.1396 +                
 49.1397 +                DPRINTF("SUSPEND shinfo %08lx eip %08lx edx %08lx\n", 
 49.1398 +                        info.shared_info_frame, 
 49.1399 +                        (unsigned long)ctxt.user_regs.eip, 
 49.1400 +                        (unsigned long)ctxt.user_regs.edx);
 49.1401              } 
 49.1402 -
 49.1403 -            if ( xc_shadow_control( xc_handle, dom, 
 49.1404 -                                    DOM0_SHADOW_CONTROL_OP_CLEAN,
 49.1405 -                                    to_send, nr_pfns, &stats ) != nr_pfns ) 
 49.1406 -            {
 49.1407 +            
 49.1408 +            if (xc_shadow_control(xc_handle, dom, DOM0_SHADOW_CONTROL_OP_CLEAN,
 49.1409 +                                  to_send, max_pfn, &stats ) != max_pfn) {  
 49.1410                  ERR("Error flushing shadow PT");
 49.1411                  goto out;
 49.1412              }
 49.1413  
 49.1414              sent_last_iter = sent_this_iter;
 49.1415  
 49.1416 -            print_stats( xc_handle, dom, sent_this_iter, &stats, 1);
 49.1417 +            print_stats(xc_handle, dom, sent_this_iter, &stats, 1);
 49.1418       
 49.1419          }
 49.1420  
 49.1421 @@ -1005,9 +1030,10 @@ int xc_linux_save(int xc_handle, int io_
 49.1422      /* Success! */
 49.1423      rc = 0;
 49.1424      
 49.1425 +    /* ^^^^^^ XXX SMH: hmm.. not sure that's really success! */
 49.1426 +    
 49.1427      /* Zero terminate */
 49.1428 -    if ( write(io_fd, &rc, sizeof(int)) != sizeof(int) )
 49.1429 -    {
 49.1430 +    if (!write_exact(io_fd, &rc, sizeof(int))) { 
 49.1431          ERR("Error when writing to state file (6)");
 49.1432          goto out;
 49.1433      }
 49.1434 @@ -1015,84 +1041,76 @@ int xc_linux_save(int xc_handle, int io_
 49.1435      /* Send through a list of all the PFNs that were not in map at the close */
 49.1436      {
 49.1437          unsigned int i,j;
 49.1438 -        unsigned int pfntab[1024];
 49.1439 +        unsigned long pfntab[1024]; 
 49.1440  
 49.1441 -        for ( i = 0, j = 0; i < nr_pfns; i++ )
 49.1442 -            if ( !is_mapped(live_pfn_to_mfn_table[i]) )
 49.1443 +        for ( i = 0, j = 0; i < max_pfn; i++ ) {
 49.1444 +            if ( ! is_mapped(live_p2m[i]) )
 49.1445                  j++;
 49.1446 +        }
 49.1447  
 49.1448 -        if ( write(io_fd, &j, sizeof(unsigned int)) != sizeof(unsigned int) )
 49.1449 -        {
 49.1450 +        if(!write_exact(io_fd, &j, sizeof(unsigned int))) { 
 49.1451              ERR("Error when writing to state file (6a)");
 49.1452              goto out;
 49.1453 -        } 
 49.1454 +        }	
 49.1455 +        
 49.1456 +        for ( i = 0, j = 0; i < max_pfn; ) {
 49.1457  
 49.1458 -        for ( i = 0, j = 0; i < nr_pfns; )
 49.1459 -        {
 49.1460 -            if ( !is_mapped(live_pfn_to_mfn_table[i]) )
 49.1461 -            {
 49.1462 +            if (!is_mapped(live_p2m[i]))
 49.1463                  pfntab[j++] = i;
 49.1464 -            }
 49.1465 +
 49.1466              i++;
 49.1467 -            if ( j == 1024 || i == nr_pfns )
 49.1468 -            {
 49.1469 -                if ( write(io_fd, &pfntab, sizeof(unsigned long)*j) !=
 49.1470 -                     (sizeof(unsigned long) * j) )
 49.1471 -                {
 49.1472 +            if (j == 1024 || i == max_pfn) {
 49.1473 +                if(!write_exact(io_fd, &pfntab, sizeof(unsigned long)*j)) { 
 49.1474                      ERR("Error when writing to state file (6b)");
 49.1475                      goto out;
 49.1476                  } 
 49.1477                  j = 0;
 49.1478              }
 49.1479          }
 49.1480 +
 49.1481      }
 49.1482 -
 49.1483 +    
 49.1484      /* Canonicalise the suspend-record frame number. */
 49.1485 -    if ( !translate_mfn_to_pfn(&ctxt.user_regs.edx) )
 49.1486 -    {
 49.1487 +    if ( !translate_mfn_to_pfn(&ctxt.user_regs.edx) ){
 49.1488          ERR("Suspend record is not in range of pseudophys map");
 49.1489          goto out;
 49.1490      }
 49.1491  
 49.1492      /* Canonicalise each GDT frame number. */
 49.1493 -    for ( i = 0; i < ctxt.gdt_ents; i += 512 )
 49.1494 -    {
 49.1495 -        if ( !translate_mfn_to_pfn(&ctxt.gdt_frames[i]) ) 
 49.1496 -        {
 49.1497 +    for ( i = 0; i < ctxt.gdt_ents; i += 512 ) {
 49.1498 +        if ( !translate_mfn_to_pfn(&ctxt.gdt_frames[i]) ) {
 49.1499              ERR("GDT frame is not in range of pseudophys map");
 49.1500              goto out;
 49.1501          }
 49.1502      }
 49.1503  
 49.1504      /* Canonicalise the page table base pointer. */
 49.1505 -    if ( !MFN_IS_IN_PSEUDOPHYS_MAP(ctxt.ctrlreg[3] >> PAGE_SHIFT) )
 49.1506 -    {
 49.1507 +    if ( !MFN_IS_IN_PSEUDOPHYS_MAP(ctxt.ctrlreg[3] >> PAGE_SHIFT) ) {
 49.1508          ERR("PT base is not in range of pseudophys map");
 49.1509          goto out;
 49.1510      }
 49.1511 -    ctxt.ctrlreg[3] = live_mfn_to_pfn_table[ctxt.ctrlreg[3] >> PAGE_SHIFT] <<
 49.1512 +    ctxt.ctrlreg[3] = live_m2p[ctxt.ctrlreg[3] >> PAGE_SHIFT] <<
 49.1513          PAGE_SHIFT;
 49.1514  
 49.1515 -    if ( write(io_fd, &ctxt, sizeof(ctxt)) != sizeof(ctxt) ||
 49.1516 -         write(io_fd, live_shinfo, PAGE_SIZE) != PAGE_SIZE)
 49.1517 -    {
 49.1518 +    if (!write_exact(io_fd, &ctxt, sizeof(ctxt)) ||
 49.1519 +        !write_exact(io_fd, live_shinfo, PAGE_SIZE)) { 
 49.1520          ERR("Error when writing to state file (1)");
 49.1521          goto out;
 49.1522      }
 49.1523 -
 49.1524 +    
 49.1525   out:
 49.1526  
 49.1527 -    if ( live_shinfo )
 49.1528 +    if (live_shinfo)
 49.1529          munmap(live_shinfo, PAGE_SIZE);
 49.1530 -
 49.1531 -    if ( live_pfn_to_mfn_frame_list ) 
 49.1532 -        munmap(live_pfn_to_mfn_frame_list, PAGE_SIZE);
 49.1533 +    
 49.1534 +    if (live_p2m_frame_list) 
 49.1535 +        munmap(live_p2m_frame_list, P2M_FLL_ENTRIES * PAGE_SIZE); 
 49.1536  
 49.1537 -    if ( live_pfn_to_mfn_table ) 
 49.1538 -        munmap(live_pfn_to_mfn_table, nr_pfns*4);
 49.1539 +    if(live_p2m) 
 49.1540 +        munmap(live_p2m, P2M_SIZE); 
 49.1541  
 49.1542 -    if ( live_mfn_to_pfn_table ) 
 49.1543 -        munmap(live_mfn_to_pfn_table, PAGE_SIZE*1024);
 49.1544 +    if(live_m2p) 
 49.1545 +        munmap(live_m2p, M2P_SIZE); 
 49.1546  
 49.1547      free(pfn_type);
 49.1548      free(pfn_batch);
 49.1549 @@ -1101,6 +1119,7 @@ int xc_linux_save(int xc_handle, int io_
 49.1550      free(to_skip);
 49.1551  
 49.1552      DPRINTF("Save exit rc=%d\n",rc);
 49.1553 +
 49.1554      return !!rc;
 49.1555  }
 49.1556  
    50.1 --- a/tools/libxc/xenctrl.h	Thu Nov 10 08:18:25 2005 -0600
    50.2 +++ b/tools/libxc/xenctrl.h	Thu Nov 10 08:34:09 2005 -0600
    50.3 @@ -17,6 +17,7 @@
    50.4  #include <xen/event_channel.h>
    50.5  #include <xen/sched.h>
    50.6  #include <xen/sched_ctl.h>
    50.7 +#include <xen/memory.h>
    50.8  #include <xen/acm.h>
    50.9  
   50.10  #ifdef __ia64__
    51.1 --- a/tools/libxc/xg_private.h	Thu Nov 10 08:18:25 2005 -0600
    51.2 +++ b/tools/libxc/xg_private.h	Thu Nov 10 08:34:09 2005 -0600
    51.3 @@ -11,8 +11,10 @@
    51.4  #include <sys/stat.h>
    51.5  
    51.6  #include "xenctrl.h"
    51.7 +#include "xenguest.h" 
    51.8  
    51.9  #include <xen/linux/privcmd.h>
   51.10 +#include <xen/memory.h>
   51.11  
   51.12  char *xc_read_kernel_image(const char *filename, unsigned long *size);
   51.13  unsigned long csum_page (void * page);
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/tools/libxc/xg_save_restore.h	Thu Nov 10 08:34:09 2005 -0600
    52.3 @@ -0,0 +1,124 @@
    52.4 +/*
    52.5 +** xg_save_restore.h
    52.6 +** 
    52.7 +** Defintions and utilities for save / restore. 
    52.8 +*/
    52.9 +
   52.10 +#define DEBUG    1
   52.11 +#define PROGRESS 0
   52.12 +
   52.13 +#define ERR(_f, _a...) do {                     \
   52.14 +    fprintf(stderr, _f "\n" , ## _a);           \
   52.15 +    fflush(stderr); }                           \
   52.16 +while (0)
   52.17 +
   52.18 +#if DEBUG
   52.19 +#define DPRINTF(_f, _a...) fprintf(stderr, _f , ## _a)
   52.20 +#else
   52.21 +#define DPRINTF(_f, _a...) ((void)0)
   52.22 +#endif
   52.23 +
   52.24 +
   52.25 +#if PROGRESS
   52.26 +#define PPRINTF(_f, _a...) fprintf(stderr, _f , ## _a)
   52.27 +#else
   52.28 +#define PPRINTF(_f, _a...)
   52.29 +#endif
   52.30 +
   52.31 +
   52.32 +/*
   52.33 +** We process save/restore/migrate in batches of pages; the below 
   52.34 +** determines how many pages we (at maximum) deal with in each batch. 
   52.35 +*/
   52.36 +#define MAX_BATCH_SIZE 1024   /* up to 1024 pages (4MB) at a time */
   52.37 +
   52.38 +/* When pinning page tables at the end of restore, we also use batching. */
   52.39 +#define MAX_PIN_BATCH  1024
   52.40 +
   52.41 +
   52.42 +
   52.43 +/*
   52.44 +** Determine various platform information required for save/restore, in 
   52.45 +** particular: 
   52.46 +**
   52.47 +**    - the maximum MFN on this machine, used to compute the size of 
   52.48 +**      the M2P table; 
   52.49 +** 
   52.50 +**    - the starting virtual address of the the hypervisor; we use this 
   52.51 +**      to determine which parts of guest address space(s) do and don't 
   52.52 +**      require canonicalization during save/restore; and 
   52.53 +** 
   52.54 +**    - the number of page-table levels for save/ restore. This should 
   52.55 +**      be a property of the domain, but for the moment we just read it 
   52.56 +**      from the hypervisor.
   52.57 +**
   52.58 +** Returns 1 on success, 0 on failure. 
   52.59 +*/
   52.60 +static int get_platform_info(int xc_handle, uint32_t dom, 
   52.61 +                             /* OUT */ uint32_t *max_mfn,  
   52.62 +                             /* OUT */ uint32_t *hvirt_start, 
   52.63 +                             /* OUT */ uint32_t *pt_levels)
   52.64 +    
   52.65 +{ 
   52.66 +    xen_capabilities_info_t xen_caps = "";
   52.67 +    xen_parameters_info_t xen_parms;
   52.68 +    xc_physinfo_t physinfo;
   52.69 +    
   52.70 +    if (xc_physinfo(xc_handle, &physinfo) != 0) 
   52.71 +        return 0;
   52.72 +    
   52.73 +    if (xc_version(xc_handle, XENVER_parameters, &xen_parms) != 0)
   52.74 +        return 0;
   52.75 +    
   52.76 +    if (xc_version(xc_handle, XENVER_capabilities, &xen_caps) != 0)
   52.77 +        return 0;
   52.78 +
   52.79 +    *max_mfn =     physinfo.total_pages;
   52.80 +    *hvirt_start = xen_parms.virt_start;
   52.81 +
   52.82 +    if (strstr(xen_caps, "xen-3.0-x86_64"))
   52.83 +        *pt_levels = 4;
   52.84 +    else if (strstr(xen_caps, "xen-3.0-x86_32p"))
   52.85 +        *pt_levels = 3; 
   52.86 +    else if (strstr(xen_caps, "xen-3.0-x86_32"))
   52.87 +        *pt_levels = 2; 
   52.88 +    else 
   52.89 +        return 0; 
   52.90 +    
   52.91 +    return 1;
   52.92 +} 
   52.93 +
   52.94 +
   52.95 +/* 
   52.96 +** Save/restore deal with the mfn_to_pfn (M2P) and pfn_to_mfn (P2M) tables. 
   52.97 +** The M2P simply holds the corresponding PFN, while the top bit of a P2M
   52.98 +** entry tell us whether or not the the PFN is currently mapped.
   52.99 +*/
  52.100 +
  52.101 +#define PFN_TO_KB(_pfn) ((_pfn) * PAGE_SIZE / 1024)
  52.102 +#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
  52.103 +
  52.104 +/* Size in bytes of the M2P and P2M (both rounded up to nearest PAGE_SIZE) */
  52.105 +#define M2P_SIZE ROUNDUP((max_mfn * sizeof(unsigned long)), PAGE_SHIFT) 
  52.106 +#define P2M_SIZE ROUNDUP((max_pfn * sizeof(unsigned long)), PAGE_SHIFT) 
  52.107 +
  52.108 +
  52.109 +/* Number of unsigned longs in a page */
  52.110 +#define ulpp            (PAGE_SIZE/sizeof(unsigned long))
  52.111 +
  52.112 +/* Number of entries in the pfn_to_mfn_frame_list */
  52.113 +#define P2M_FL_ENTRIES  (((max_pfn)+ulpp-1)/ulpp)
  52.114 +
  52.115 +/* Size in bytes of the pfn_to_mfn_frame_list     */
  52.116 +#define P2M_FL_SIZE     ((P2M_FL_ENTRIES)*sizeof(unsigned long))
  52.117 +
  52.118 +/* Number of entries in the pfn_to_mfn_frame_list_list */
  52.119 +#define P2M_FLL_ENTRIES (((max_pfn)+(ulpp*ulpp)-1)/(ulpp*ulpp))
  52.120 +
  52.121 +/* Returns TRUE if the PFN is currently mapped */
  52.122 +#define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL))
  52.123 +
  52.124 +#define INVALID_P2M_ENTRY   (~0UL) 
  52.125 +
  52.126 +
  52.127 +
    53.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Thu Nov 10 08:18:25 2005 -0600
    53.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Thu Nov 10 08:34:09 2005 -0600
    53.3 @@ -342,6 +342,7 @@ static PyObject *pyxc_domain_getinfo(PyO
    53.4                                    "ssidref",   info[i].ssidref,
    53.5                                    "shutdown_reason", info[i].shutdown_reason);
    53.6          PyDict_SetItemString(info_dict, "handle", pyhandle);
    53.7 +        Py_DECREF(pyhandle);
    53.8          PyList_SetItem(list, i, info_dict);
    53.9      }
   53.10  
   53.11 @@ -388,7 +389,7 @@ static PyObject *pyxc_vcpu_getinfo(PyObj
   53.12          cpumap >>= 1;
   53.13      }
   53.14      PyDict_SetItemString(info_dict, "cpumap", cpulist);
   53.15 -
   53.16 +    Py_DECREF(cpulist);
   53.17      return info_dict;
   53.18  }
   53.19  
    54.1 --- a/tools/python/xen/xend/XendCheckpoint.py	Thu Nov 10 08:18:25 2005 -0600
    54.2 +++ b/tools/python/xen/xend/XendCheckpoint.py	Thu Nov 10 08:34:09 2005 -0600
    54.3 @@ -209,9 +209,9 @@ def forkHelper(cmd, fd, inputHandler, cl
    54.4          raise XendError("%s failed" % string.join(cmd))
    54.5  
    54.6  
    54.7 -def slurp(file):
    54.8 +def slurp(infile):
    54.9      while 1:
   54.10 -        line = file.readline()
   54.11 +        line = infile.readline()
   54.12          if line == "":
   54.13              break
   54.14          else:
    55.1 --- a/tools/python/xen/xend/XendClient.py	Thu Nov 10 08:18:25 2005 -0600
    55.2 +++ b/tools/python/xen/xend/XendClient.py	Thu Nov 10 08:34:09 2005 -0600
    55.3 @@ -220,6 +220,10 @@ class Xend:
    55.4      def xend_domain(self, id):
    55.5          return self.xendGet(self.domainurl(id))
    55.6  
    55.7 +    def xend_domain_wait_for_devices(self, id):
    55.8 +        return self.xendPost(self.domainurl(id),
    55.9 +                             {'op'      : 'wait_for_devices' })
   55.10 +
   55.11      def xend_domain_unpause(self, id):
   55.12          return self.xendPost(self.domainurl(id),
   55.13                               {'op'      : 'unpause' })
    56.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Nov 10 08:18:25 2005 -0600
    56.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Thu Nov 10 08:34:09 2005 -0600
    56.3 @@ -90,6 +90,8 @@ ZOMBIE_PREFIX = 'Zombie-'
    56.4  """Minimum time between domain restarts in seconds."""
    56.5  MINIMUM_RESTART_TIME = 20
    56.6  
    56.7 +RESTART_IN_PROGRESS = 'xend/restart_in_progress'
    56.8 +
    56.9  
   56.10  xc = xen.lowlevel.xc.new()
   56.11  xroot = XendRoot.instance()
   56.12 @@ -111,6 +113,8 @@ ROUNDTRIPPING_CONFIG_ENTRIES = [
   56.13          ('vcpus',        int),
   56.14          ('vcpu_avail',   int),
   56.15          ('cpu_weight',   float),
   56.16 +        ('memory',       int),
   56.17 +        ('maxmem',       int),
   56.18          ('bootloader',   str),
   56.19          ('on_poweroff',  str),
   56.20          ('on_reboot',    str),
   56.21 @@ -254,10 +258,6 @@ def parseConfig(config):
   56.22      for e in ROUNDTRIPPING_CONFIG_ENTRIES:
   56.23          result[e[0]] = get_cfg(e[0], e[1])
   56.24  
   56.25 -    result['memory']    = get_cfg('memory',    int)
   56.26 -    result['mem_kb']    = get_cfg('mem_kb',    int)
   56.27 -    result['maxmem']    = get_cfg('maxmem',    int)
   56.28 -    result['maxmem_kb'] = get_cfg('maxmem_kb', int)
   56.29      result['cpu']       = get_cfg('cpu',       int)
   56.30      result['image']     = get_cfg('image')
   56.31  
   56.32 @@ -392,11 +392,23 @@ class XendDomainInfo:
   56.33                    ("on_reboot",    str),
   56.34                    ("on_crash",     str),
   56.35                    ("image",        str),
   56.36 +                  ("memory",       int),
   56.37 +                  ("maxmem",       int),
   56.38                    ("vcpus",        int),
   56.39                    ("vcpu_avail",   int),
   56.40                    ("start_time", float))
   56.41  
   56.42 -        from_store = self.gatherVm(*params)
   56.43 +        try:
   56.44 +            from_store = self.gatherVm(*params)
   56.45 +        except ValueError, exn:
   56.46 +            # One of the int/float entries in params has a corresponding store
   56.47 +            # entry that is invalid.  We recover, because older versions of
   56.48 +            # Xend may have put the entry there (memory/target, for example),
   56.49 +            # but this is in general a bad situation to have reached.
   56.50 +            log.exception(
   56.51 +                "Store corrupted at %s!  Domain %d's configuration may be "
   56.52 +                "affected.", self.vmpath, self.domid)
   56.53 +            return
   56.54  
   56.55          map(lambda x, y: useIfNeeded(x[0], y), params, from_store)
   56.56  
   56.57 @@ -430,6 +442,9 @@ class XendDomainInfo:
   56.58              self.info['vcpus'] = int(self.info['vcpus'])
   56.59  
   56.60              defaultInfo('vcpu_avail',   lambda: (1 << self.info['vcpus']) - 1)
   56.61 +
   56.62 +            defaultInfo('memory',       lambda: 0)
   56.63 +            defaultInfo('maxmem',       lambda: 0)
   56.64              defaultInfo('bootloader',   lambda: None)
   56.65              defaultInfo('backend',      lambda: [])
   56.66              defaultInfo('device',       lambda: [])
   56.67 @@ -440,66 +455,12 @@ class XendDomainInfo:
   56.68              if isinstance(self.info['image'], str):
   56.69                  self.info['image'] = sxp.from_string(self.info['image'])
   56.70  
   56.71 -            # Internally, we keep only maxmem_KiB, and not maxmem or maxmem_kb
   56.72 -            # (which come from outside, and are in MiB and KiB respectively).
   56.73 -            # This means that any maxmem or maxmem_kb settings here have come
   56.74 -            # from outside, and maxmem_KiB must be updated to reflect them.
   56.75 -            # If we have both maxmem and maxmem_kb and these are not
   56.76 -            # consistent, then this is an error, as we've no way to tell which
   56.77 -            # one takes precedence.
   56.78 -
   56.79 -            # Exactly the same thing applies to memory_KiB, memory, and
   56.80 -            # mem_kb.
   56.81 -
   56.82 -            def discard_negatives(name):
   56.83 -                if self.infoIsSet(name) and self.info[name] < 0:
   56.84 -                    del self.info[name]
   56.85 +            if self.info['memory'] == 0:
   56.86 +                if self.infoIsSet('mem_kb'):
   56.87 +                    self.info['memory'] = (self.info['mem_kb'] + 1023) / 1024
   56.88  
   56.89 -            def valid_KiB_(mb_name, kb_name):
   56.90 -                discard_negatives(kb_name)
   56.91 -                discard_negatives(mb_name)
   56.92 -                
   56.93 -                if self.infoIsSet(kb_name):
   56.94 -                    if self.infoIsSet(mb_name):
   56.95 -                        mb = self.info[mb_name]
   56.96 -                        kb = self.info[kb_name]
   56.97 -                        if mb * 1024 == kb:
   56.98 -                            return kb
   56.99 -                        else:
  56.100 -                            raise VmError(
  56.101 -                                'Inconsistent %s / %s settings: %s / %s' %
  56.102 -                                (mb_name, kb_name, mb, kb))
  56.103 -                    else:
  56.104 -                        return self.info[kb_name]
  56.105 -                elif self.infoIsSet(mb_name):
  56.106 -                    return self.info[mb_name] * 1024
  56.107 -                else:
  56.108 -                    return None
  56.109 -
  56.110 -            def valid_KiB(mb_name, kb_name):
  56.111 -                result = valid_KiB_(mb_name, kb_name)
  56.112 -                if result is None or result < 0:
  56.113 -                    raise VmError('Invalid %s / %s: %s' %
  56.114 -                                  (mb_name, kb_name, result))
  56.115 -                else:
  56.116 -                    return result
  56.117 -
  56.118 -            def delIf(name):
  56.119 -                if name in self.info:
  56.120 -                    del self.info[name]
  56.121 -
  56.122 -            self.info['memory_KiB'] = valid_KiB('memory', 'mem_kb')
  56.123 -            delIf('memory')
  56.124 -            delIf('mem_kb')
  56.125 -            self.info['maxmem_KiB'] = valid_KiB_('maxmem', 'maxmem_kb')
  56.126 -            delIf('maxmem')
  56.127 -            delIf('maxmem_kb')
  56.128 -
  56.129 -            if not self.info['maxmem_KiB']:
  56.130 -                self.info['maxmem_KiB'] = 1 << 30
  56.131 -
  56.132 -            if self.info['maxmem_KiB'] > self.info['memory_KiB']:
  56.133 -                self.info['maxmem_KiB'] = self.info['memory_KiB']
  56.134 +            if self.info['maxmem'] < self.info['memory']:
  56.135 +                self.info['maxmem'] = self.info['memory']
  56.136  
  56.137              for (n, c) in self.info['device']:
  56.138                  if not n or not c or n not in controllerClasses:
  56.139 @@ -574,17 +535,14 @@ class XendDomainInfo:
  56.140  
  56.141      def storeVmDetails(self):
  56.142          to_store = {
  56.143 -            'uuid':               self.info['uuid'],
  56.144 -
  56.145 -            # XXX
  56.146 -            'memory/target':      str(self.info['memory_KiB'])
  56.147 +            'uuid':               self.info['uuid']
  56.148              }
  56.149  
  56.150          if self.infoIsSet('image'):
  56.151              to_store['image'] = sxp.to_string(self.info['image'])
  56.152  
  56.153 -        for k in ['name', 'ssidref', 'on_poweroff', 'on_reboot', 'on_crash',
  56.154 -                  'vcpus', 'vcpu_avail']:
  56.155 +        for k in ['name', 'ssidref', 'memory', 'maxmem', 'on_poweroff',
  56.156 +                  'on_reboot', 'on_crash', 'vcpus', 'vcpu_avail']:
  56.157              if self.infoIsSet(k):
  56.158                  to_store[k] = str(self.info[k])
  56.159  
  56.160 @@ -599,7 +557,7 @@ class XendDomainInfo:
  56.161              'vm':                 self.vmpath,
  56.162              'name':               self.info['name'],
  56.163              'console/limit':      str(xroot.get_console_limit() * 1024),
  56.164 -            'memory/target':      str(self.info['memory_KiB'])
  56.165 +            'memory/target':      str(self.info['memory'] * 1024)
  56.166              }
  56.167  
  56.168          def f(n, v):
  56.169 @@ -680,8 +638,8 @@ class XendDomainInfo:
  56.170          return self.info['ssidref']
  56.171  
  56.172      def getMemoryTarget(self):
  56.173 -        """Get this domain's target memory size, in KiB."""
  56.174 -        return self.info['memory_KiB']
  56.175 +        """Get this domain's target memory size, in KB."""
  56.176 +        return self.info['memory'] * 1024
  56.177  
  56.178  
  56.179      def refreshShutdown(self, xeninfo = None):
  56.180 @@ -829,10 +787,9 @@ class XendDomainInfo:
  56.181          """Set the memory target of this domain.
  56.182          @param target In MiB.
  56.183          """
  56.184 -        # Internally we use KiB, but the command interface uses MiB.
  56.185 -        t = target << 10
  56.186 -        self.info['memory_KiB'] = t
  56.187 -        self.storeDom("memory/target", t)
  56.188 +        self.info['memory'] = target
  56.189 +        self.storeVm("memory", target)
  56.190 +        self.storeDom("memory/target", target << 10)
  56.191  
  56.192  
  56.193      def update(self, info = None):
  56.194 @@ -881,7 +838,7 @@ class XendDomainInfo:
  56.195          s = "<domain"
  56.196          s += " id=" + str(self.domid)
  56.197          s += " name=" + self.info['name']
  56.198 -        s += " memory=" + str(self.info['memory_KiB'] / 1024)
  56.199 +        s += " memory=" + str(self.info['memory'])
  56.200          s += " ssidref=" + str(self.info['ssidref'])
  56.201          s += ">"
  56.202          return s
  56.203 @@ -895,6 +852,14 @@ class XendDomainInfo:
  56.204          return self.getDeviceController(deviceClass).createDevice(devconfig)
  56.205  
  56.206  
  56.207 +    def waitForDevices_(self, deviceClass):
  56.208 +        return self.getDeviceController(deviceClass).waitForDevices()
  56.209 +
  56.210 +
  56.211 +    def waitForDevice(self, deviceClass, devid):
  56.212 +        return self.getDeviceController(deviceClass).waitForDevice(devid)
  56.213 +
  56.214 +
  56.215      def reconfigureDevice(self, deviceClass, devid, devconfig):
  56.216          return self.getDeviceController(deviceClass).reconfigureDevice(
  56.217              devid, devconfig)
  56.218 @@ -927,15 +892,12 @@ class XendDomainInfo:
  56.219  
  56.220      def sxpr(self):
  56.221          sxpr = ['domain',
  56.222 -                ['domid',   self.domid],
  56.223 -                ['memory',  self.info['memory_KiB'] / 1024]]
  56.224 +                ['domid',   self.domid]]
  56.225  
  56.226          for e in ROUNDTRIPPING_CONFIG_ENTRIES:
  56.227              if self.infoIsSet(e[0]):
  56.228                  sxpr.append([e[0], self.info[e[0]]])
  56.229          
  56.230 -        sxpr.append(['maxmem', self.info['maxmem_KiB'] / 1024])
  56.231 -
  56.232          if self.infoIsSet('image'):
  56.233              sxpr.append(['image', self.info['image']])
  56.234  
  56.235 @@ -1076,9 +1038,8 @@ class XendDomainInfo:
  56.236  
  56.237  
  56.238      def initDomain(self):
  56.239 -        log.debug('XendDomainInfo.initDomain: %s %s %s',
  56.240 +        log.debug('XendDomainInfo.initDomain: %s %s',
  56.241                    self.domid,
  56.242 -                  self.info['memory_KiB'],
  56.243                    self.info['cpu_weight'])
  56.244  
  56.245          if not self.infoIsSet('image'):
  56.246 @@ -1093,7 +1054,7 @@ class XendDomainInfo:
  56.247  
  56.248          xc.domain_setcpuweight(self.domid, self.info['cpu_weight'])
  56.249  
  56.250 -        m = self.image.getDomainMemory(self.info['memory_KiB'])
  56.251 +        m = self.image.getDomainMemory(self.info['memory'] * 1024)
  56.252          xc.domain_setmaxmem(self.domid, maxmem_kb = m)
  56.253          xc.domain_memory_increase_reservation(self.domid, m, 0, 0)
  56.254  
  56.255 @@ -1230,6 +1191,15 @@ class XendDomainInfo:
  56.256              self.image.createDeviceModel()
  56.257  
  56.258  
  56.259 +    def waitForDevices(self):
  56.260 +        """Wait for this domain's configured devices to connect.
  56.261 +
  56.262 +        @raise: VmError if any device fails to initialise.
  56.263 +        """
  56.264 +        for c in controllerClasses:
  56.265 +            self.waitForDevices_(c)
  56.266 +
  56.267 +
  56.268      def device_create(self, dev_config):
  56.269          """Create a new device.
  56.270  
  56.271 @@ -1237,6 +1207,7 @@ class XendDomainInfo:
  56.272          """
  56.273          dev_type = sxp.name(dev_config)
  56.274          devid = self.createDevice(dev_type, dev_config)
  56.275 +        self.waitForDevice(dev_type, devid)
  56.276  #        self.config.append(['device', dev.getConfig()])
  56.277          return self.getDeviceController(dev_type).sxpr(devid)
  56.278  
  56.279 @@ -1269,14 +1240,14 @@ class XendDomainInfo:
  56.280  
  56.281          config = self.sxpr()
  56.282  
  56.283 -        if self.readVm('xend/restart_in_progress'):
  56.284 +        if self.readVm(RESTART_IN_PROGRESS):
  56.285              log.error('Xend failed during restart of domain %d.  '
  56.286                        'Refusing to restart to avoid loops.',
  56.287                        self.domid)
  56.288              self.destroy()
  56.289              return
  56.290  
  56.291 -        self.writeVm('xend/restart_in_progress', 'True')
  56.292 +        self.writeVm(RESTART_IN_PROGRESS, 'True')
  56.293  
  56.294          now = time.time()
  56.295          rst = self.readVm('xend/previous_restart_time')
  56.296 @@ -1298,26 +1269,28 @@ class XendDomainInfo:
  56.297                  self.preserveForRestart()
  56.298              else:
  56.299                  self.destroyDomain()
  56.300 -                
  56.301 +
  56.302 +            # new_dom's VM will be the same as this domain's VM, except where
  56.303 +            # the rename flag has instructed us to call preserveForRestart.
  56.304 +            # In that case, it is important that we remove the
  56.305 +            # RESTART_IN_PROGRESS node from the new domain, not the old one,
  56.306 +            # once the new one is available.
  56.307 +
  56.308 +            new_dom = None
  56.309              try:
  56.310                  xd = get_component('xen.xend.XendDomain')
  56.311                  new_dom = xd.domain_create(config)
  56.312 -                try:
  56.313 -                    new_dom.unpause()
  56.314 -                except:
  56.315 -                    new_dom.destroy()
  56.316 -                    raise
  56.317 +                new_dom.unpause()
  56.318 +                new_dom.removeVm(RESTART_IN_PROGRESS)
  56.319              except:
  56.320 -                log.exception('Failed to restart domain %d.', self.domid)
  56.321 -        finally:
  56.322 -            # new_dom's VM will be the same as this domain's VM, except where
  56.323 -            # the rename flag has instructed us to call preserveForRestart.
  56.324 -            # In that case, it is important that we use new_dom.removeVm, not
  56.325 -            # self.removeVm.
  56.326 -            new_dom.removeVm('xend/restart_in_progress')
  56.327 -            
  56.328 -        # self.configure_bootloader()
  56.329 -        #        self.exportToDB()
  56.330 +                if new_dom:
  56.331 +                    new_dom.removeVm(RESTART_IN_PROGRESS)
  56.332 +                    new_dom.destroy()
  56.333 +                else:
  56.334 +                    self.removeVm(RESTART_IN_PROGRESS)
  56.335 +                raise
  56.336 +        except:
  56.337 +            log.exception('Failed to restart domain %d.', self.domid)
  56.338  
  56.339  
  56.340      def preserveForRestart(self):
    57.1 --- a/tools/python/xen/xend/image.py	Thu Nov 10 08:18:25 2005 -0600
    57.2 +++ b/tools/python/xen/xend/image.py	Thu Nov 10 08:34:09 2005 -0600
    57.3 @@ -24,6 +24,7 @@ import xen.lowlevel.xc
    57.4  from xen.xend import sxp
    57.5  from xen.xend.XendError import VmError
    57.6  from xen.xend.XendLogging import log
    57.7 +from xen.xend.server.netif import randomMAC
    57.8  
    57.9  
   57.10  xc = xen.lowlevel.xc.new()
   57.11 @@ -276,6 +277,8 @@ class VmxImageHandler(ImageHandler):
   57.12                 ret.append("%s" % vbdparam)
   57.13              if name == 'vif':
   57.14                 mac = sxp.child_value(info, 'mac')
   57.15 +               if mac == None:
   57.16 +                   mac = randomMAC()
   57.17                 ret.append("-macaddr")
   57.18                 ret.append("%s" % mac)
   57.19              if name == 'vtpm':
    58.1 --- a/tools/python/xen/xend/server/DevController.py	Thu Nov 10 08:18:25 2005 -0600
    58.2 +++ b/tools/python/xen/xend/server/DevController.py	Thu Nov 10 08:34:09 2005 -0600
    58.3 @@ -62,6 +62,18 @@ class DevController:
    58.4  
    58.5          self.writeDetails(config, devid, back, front)
    58.6  
    58.7 +        return devid
    58.8 +
    58.9 +
   58.10 +    def waitForDevices(self):
   58.11 +        log.debug("Waiting for devices %s.", self.deviceClass)
   58.12 +        
   58.13 +        return map(self.waitForDevice, self.deviceIDs())
   58.14 +
   58.15 +
   58.16 +    def waitForDevice(self, devid):
   58.17 +        log.debug("Waiting for %s.", devid)
   58.18 +        
   58.19          status, fn_ret = self.waitForBackend(devid)
   58.20          if status:
   58.21              self.destroyDevice(devid)
   58.22 @@ -74,7 +86,6 @@ class DevController:
   58.23              raise VmError( ("Device %s (%s) could not be connected. "
   58.24                              "Backend device not found!") 
   58.25                              % (devid, self.deviceClass))
   58.26 -        return devid
   58.27  
   58.28  
   58.29      def reconfigureDevice(self, devid, config):
   58.30 @@ -122,10 +133,11 @@ class DevController:
   58.31          specified device.  This would be suitable for giving to {@link
   58.32          #createDevice} in order to recreate that device."""
   58.33  
   58.34 -        backdomid = int(xstransact.Read(self.frontendPath(devid),
   58.35 -                                        "backend-id"))
   58.36 -
   58.37 -        return [self.deviceClass, ['backend', backdomid]]
   58.38 +        backdomid = xstransact.Read(self.frontendPath(devid), "backend-id")
   58.39 +        if backdomid is None:
   58.40 +            raise VmError("Device %s not connected" % devid)
   58.41 +        
   58.42 +        return [self.deviceClass, ['backend', int(backdomid)]]
   58.43  
   58.44  
   58.45      def sxprs(self):
   58.46 @@ -200,7 +212,10 @@ class DevController:
   58.47      def readBackend(self, devid, *args):
   58.48          frontpath = self.frontendPath(devid)
   58.49          backpath = xstransact.Read(frontpath, "backend")
   58.50 -        return xstransact.Read(backpath, *args)
   58.51 +        if backpath:
   58.52 +            return xstransact.Read(backpath, *args)
   58.53 +        else:
   58.54 +            raise VmError("Device %s not connected" % devid)
   58.55  
   58.56  
   58.57      def deviceIDs(self):
   58.58 @@ -242,6 +257,8 @@ class DevController:
   58.59          frontpath = self.frontendPath(devid)
   58.60          backpath  = self.backendPath(backdom, devid)
   58.61          
   58.62 +        xstransact.Remove(backpath, HOTPLUG_STATUS_NODE)
   58.63 +
   58.64          frontDetails.update({
   58.65              'backend' : backpath,
   58.66              'backend-id' : "%i" % backdom.getDomid()
   58.67 @@ -266,7 +283,10 @@ class DevController:
   58.68          ev = Event()
   58.69  
   58.70          def hotplugStatus():
   58.71 -            status = self.readBackend(devid, HOTPLUG_STATUS_NODE)
   58.72 +            try:
   58.73 +                status = self.readBackend(devid, HOTPLUG_STATUS_NODE)
   58.74 +            except VmError:
   58.75 +                status = "died"
   58.76              if status is not None:
   58.77                  watch.xs.unwatch(backpath, watch)
   58.78                  hotplugStatus.value = status
   58.79 @@ -276,14 +296,16 @@ class DevController:
   58.80          frontpath = self.frontendPath(devid)
   58.81          backpath = xstransact.Read(frontpath, "backend")
   58.82  
   58.83 -        watch = xswatch(backpath, hotplugStatus)
   58.84 +        if backpath:
   58.85 +            watch = xswatch(backpath, hotplugStatus)
   58.86  
   58.87 -        ev.wait(DEVICE_CREATE_TIMEOUT)
   58.88 -        if ev.isSet():
   58.89 -            return (0, hotplugStatus.value)
   58.90 +            ev.wait(DEVICE_CREATE_TIMEOUT)
   58.91 +            if ev.isSet():
   58.92 +                return (0, hotplugStatus.value)
   58.93 +            else:
   58.94 +                return (-1, hotplugStatus.value)
   58.95          else:
   58.96 -            return (-1, hotplugStatus.value)
   58.97 -
   58.98 +            return (-1, "missing")
   58.99  
  58.100  
  58.101      def backendPath(self, backdom, devid):
    59.1 --- a/tools/python/xen/xend/server/SrvDomain.py	Thu Nov 10 08:18:25 2005 -0600
    59.2 +++ b/tools/python/xen/xend/server/SrvDomain.py	Thu Nov 10 08:34:09 2005 -0600
    59.3 @@ -13,13 +13,13 @@
    59.4  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    59.5  #============================================================================
    59.6  # Copyright (C) 2004, 2005 Mike Wray <mike.wray@hp.com>
    59.7 +# Copyright (C) 2005 Xensource Ltd
    59.8  #============================================================================
    59.9  
   59.10  from xen.web import http
   59.11  
   59.12  from xen.xend import sxp
   59.13  from xen.xend import XendDomain
   59.14 -from xen.xend import PrettyPrint
   59.15  from xen.xend.Args import FormFn
   59.16  
   59.17  from xen.web.SrvDir import SrvDir
   59.18 @@ -33,7 +33,7 @@ class SrvDomain(SrvDir):
   59.19          self.dom = dom
   59.20          self.xd = XendDomain.instance()
   59.21  
   59.22 -    def op_configure(self, op, req):
   59.23 +    def op_configure(self, _, req):
   59.24          """Configure an existing domain.
   59.25          Configure is unusual in that it requires a domain id,
   59.26          not a domain name.
   59.27 @@ -43,11 +43,11 @@ class SrvDomain(SrvDir):
   59.28                       ['config', 'sxpr']])
   59.29          return fn(req.args, {'dom': self.dom.domid})
   59.30  
   59.31 -    def op_unpause(self, op, req):
   59.32 +    def op_unpause(self, _1, _2):
   59.33          val = self.xd.domain_unpause(self.dom.domid)
   59.34          return val
   59.35          
   59.36 -    def op_pause(self, op, req):
   59.37 +    def op_pause(self, _1, _2):
   59.38          val = self.xd.domain_pause(self.dom.domid)
   59.39          return val
   59.40  
   59.41 @@ -55,15 +55,19 @@ class SrvDomain(SrvDir):
   59.42          req.setResponseCode(http.ACCEPTED)
   59.43          req.setHeader("Location", "%s/.." % req.prePathURL())
   59.44  
   59.45 -    def op_shutdown(self, op, req):
   59.46 +    def op_shutdown(self, _, req):
   59.47          self.acceptCommand(req)
   59.48          return self.dom.shutdown(req.args['reason'][0])
   59.49  
   59.50 -    def op_sysrq(self, op, req):
   59.51 +    def op_sysrq(self, _, req):
   59.52          self.acceptCommand(req)
   59.53          return self.dom.send_sysrq(int(req.args['key'][0]))
   59.54  
   59.55 -    def op_destroy(self, op, req):
   59.56 +    def op_wait_for_devices(self, _, req):
   59.57 +        self.acceptCommand(req)
   59.58 +        return self.dom.waitForDevices()
   59.59 +
   59.60 +    def op_destroy(self, _, req):
   59.61          self.acceptCommand(req)
   59.62          return self.xd.domain_destroy(self.dom.domid)
   59.63  
   59.64 @@ -71,13 +75,13 @@ class SrvDomain(SrvDir):
   59.65          self.acceptCommand(req)
   59.66          return req.threadRequest(self.do_save, op, req)
   59.67  
   59.68 -    def do_save(self, op, req):
   59.69 +    def do_save(self, _, req):
   59.70          return self.xd.domain_save(self.dom.domid, req.args['file'][0])
   59.71  
   59.72      def op_migrate(self, op, req):
   59.73          return req.threadRequest(self.do_migrate, op, req)
   59.74      
   59.75 -    def do_migrate(self, op, req):
   59.76 +    def do_migrate(self, _, req):
   59.77          fn = FormFn(self.xd.domain_migrate,
   59.78                      [['dom',         'int'],
   59.79                       ['destination', 'str'],
   59.80 @@ -85,7 +89,7 @@ class SrvDomain(SrvDir):
   59.81                       ['resource',    'int']])
   59.82          return fn(req.args, {'dom': self.dom.domid})
   59.83  
   59.84 -    def op_pincpu(self, op, req):
   59.85 +    def op_pincpu(self, _, req):
   59.86          fn = FormFn(self.xd.domain_pincpu,
   59.87                      [['dom', 'int'],
   59.88                       ['vcpu', 'int'],
   59.89 @@ -93,7 +97,7 @@ class SrvDomain(SrvDir):
   59.90          val = fn(req.args, {'dom': self.dom.domid})
   59.91          return val
   59.92  
   59.93 -    def op_cpu_bvt_set(self, op, req):
   59.94 +    def op_cpu_bvt_set(self, _, req):
   59.95          fn = FormFn(self.xd.domain_cpu_bvt_set,
   59.96                      [['dom',       'int'],
   59.97                       ['mcuadv',    'int'],
   59.98 @@ -105,14 +109,14 @@ class SrvDomain(SrvDir):
   59.99          return val
  59.100      
  59.101      
  59.102 -    def op_cpu_sedf_get(self, op, req):
  59.103 +    def op_cpu_sedf_get(self, _, req):
  59.104          fn = FormFn(self.xd.domain_cpu_sedf_get,
  59.105                      [['dom', 'int']])
  59.106          val = fn(req.args, {'dom': self.dom.domid})
  59.107          return val
  59.108  
  59.109  
  59.110 -    def op_cpu_sedf_set(self, op, req):
  59.111 +    def op_cpu_sedf_set(self, _, req):
  59.112          fn = FormFn(self.xd.domain_cpu_sedf_set,
  59.113                      [['dom', 'int'],
  59.114                       ['period', 'int'],
  59.115 @@ -123,7 +127,7 @@ class SrvDomain(SrvDir):
  59.116          val = fn(req.args, {'dom': self.dom.domid})
  59.117          return val
  59.118  
  59.119 -    def op_maxmem_set(self, op, req):
  59.120 +    def op_maxmem_set(self, _, req):
  59.121          fn = FormFn(self.xd.domain_maxmem_set,
  59.122                      [['dom',    'int'],
  59.123                       ['memory', 'int']])
  59.124 @@ -135,35 +139,35 @@ class SrvDomain(SrvDir):
  59.125          return FormFn(fn, args)(req.args)
  59.126  
  59.127  
  59.128 -    def op_mem_target_set(self, op, req):
  59.129 +    def op_mem_target_set(self, _, req):
  59.130          return self.call(self.dom.setMemoryTarget,
  59.131                           [['target', 'int']],
  59.132                           req)
  59.133  
  59.134 -    def op_devices(self, op, req):
  59.135 +    def op_devices(self, _, req):
  59.136          return self.call(self.dom.getDeviceSxprs,
  59.137                           [['type', 'str']],
  59.138                           req)
  59.139  
  59.140 -    def op_device_create(self, op, req):
  59.141 +    def op_device_create(self, _, req):
  59.142          return self.call(self.dom.device_create,
  59.143                           [['config', 'sxpr']],
  59.144                           req)
  59.145  
  59.146 -    def op_device_destroy(self, op, req):
  59.147 +    def op_device_destroy(self, _, req):
  59.148          return self.call(self.dom.destroyDevice,
  59.149                           [['type', 'str'],
  59.150                            ['dev',  'str']],
  59.151                           req)
  59.152                  
  59.153 -    def op_device_configure(self, op, req):
  59.154 +    def op_device_configure(self, _, req):
  59.155          return self.call(self.dom.device_configure,
  59.156                           [['config', 'sxpr'],
  59.157                            ['dev',    'str']],
  59.158                           req)
  59.159  
  59.160  
  59.161 -    def op_vif_limit_set(self, op, req):
  59.162 +    def op_vif_limit_set(self, _, req):
  59.163          fn = FormFn(self.xd.domain_vif_limit_set,
  59.164                      [['dom',    'int'],
  59.165                       ['vif',    'int'],
  59.166 @@ -172,7 +176,7 @@ class SrvDomain(SrvDir):
  59.167          val = fn(req.args, {'dom': self.dom.domid})
  59.168          return val
  59.169  
  59.170 -    def op_set_vcpus(self, op, req):
  59.171 +    def op_set_vcpus(self, _, req):
  59.172          return self.call(self.dom.setVCpuCount,
  59.173                           [['vcpus', 'int']],
  59.174                           req)
    60.1 --- a/tools/python/xen/xend/server/params.py	Thu Nov 10 08:18:25 2005 -0600
    60.2 +++ b/tools/python/xen/xend/server/params.py	Thu Nov 10 08:34:09 2005 -0600
    60.3 @@ -44,8 +44,3 @@ XEND_DEBUG_LOG     = '/var/log/xend-debu
    60.4  XEND_USER          = 'root'
    60.5  XEND_DEBUG         = getenv("XEND_DEBUG",     0, conv=int)
    60.6  XEND_DAEMONIZE     = getenv("XEND_DAEMONIZE", not XEND_DEBUG, conv=int)
    60.7 -
    60.8 -XENSTORED_PID_FILE = '/var/run/xenstored.pid'
    60.9 -XENSTORED_RUN_DIR  = '/var/run/xenstored'
   60.10 -XENSTORED_LIB_DIR  = '/var/lib/xenstored'
   60.11 -XENSTORED_DEBUG    = getenv("XENSTORED_DEBUG", 0, conv=int)
    61.1 --- a/tools/python/xen/xend/xenstore/xstransact.py	Thu Nov 10 08:18:25 2005 -0600
    61.2 +++ b/tools/python/xen/xend/xenstore/xstransact.py	Thu Nov 10 08:34:09 2005 -0600
    61.3 @@ -74,7 +74,7 @@ class xstransact:
    61.4                                 ('%s, while writing %s : %s' %
    61.5                                  (ex.args[1], path, str(data))))
    61.6  
    61.7 -    def write(self, *args, **opts):
    61.8 +    def write(self, *args):
    61.9          if len(args) == 0:
   61.10              raise TypeError
   61.11          if isinstance(args[0], dict):
   61.12 @@ -235,11 +235,11 @@ class xstransact:
   61.13  
   61.14      Read = classmethod(Read)
   61.15  
   61.16 -    def Write(cls, path, *args, **opts):
   61.17 +    def Write(cls, path, *args):
   61.18          while True:
   61.19              t = cls(path)
   61.20              try:
   61.21 -                t.write(*args, **opts)
   61.22 +                t.write(*args)
   61.23                  if t.commit():
   61.24                      return
   61.25              except:
    62.1 --- a/tools/python/xen/xm/create.py	Thu Nov 10 08:18:25 2005 -0600
    62.2 +++ b/tools/python/xen/xm/create.py	Thu Nov 10 08:34:09 2005 -0600
    62.3 @@ -756,7 +756,7 @@ def choose_vnc_display():
    62.4  vncpid = None
    62.5  
    62.6  def spawn_vnc(display):
    62.7 -    vncargs = (["vncviewer" + "-log", "*:stdout:0",
    62.8 +    vncargs = (["vncviewer", "-log", "*:stdout:0",
    62.9              "-listen", "%d" % (VNC_BASE_PORT + display) ])
   62.10      global vncpid    
   62.11      vncpid = os.spawnvp(os.P_NOWAIT, "vncviewer", vncargs)
   62.12 @@ -815,6 +815,10 @@ def make_domain(opts, config):
   62.13  
   62.14      dom = sxp.child_value(dominfo, 'name')
   62.15  
   62.16 +    if server.xend_domain_wait_for_devices(dom) < 0:
   62.17 +        server.xend_domain_destroy(dom)
   62.18 +        err("Device creation failed for domain %s" % dom)
   62.19 +
   62.20      if not opts.vals.paused:
   62.21          if server.xend_domain_unpause(dom) < 0:
   62.22              server.xend_domain_destroy(dom)
    63.1 --- a/tools/xenstore/Makefile	Thu Nov 10 08:18:25 2005 -0600
    63.2 +++ b/tools/xenstore/Makefile	Thu Nov 10 08:34:09 2005 -0600
    63.3 @@ -77,7 +77,7 @@ libxenstore.so: xs.opic xs_lib.opic
    63.4  clean: testsuite-clean
    63.5  	rm -f *.o *.opic *.so
    63.6  	rm -f xenstored xs_random xs_stress xs_crashme
    63.7 -	rm -f xs_test xenstored_test xs_tdb_dump
    63.8 +	rm -f xs_test xenstored_test xs_tdb_dump xsls $(CLIENTS)
    63.9  	$(RM) $(PROG_DEP)
   63.10  
   63.11  print-dir:
    64.1 --- a/tools/xm-test/Makefile.in	Thu Nov 10 08:18:25 2005 -0600
    64.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.3 @@ -1,578 +0,0 @@
    64.4 -# Makefile.in generated by automake 1.9.5 from Makefile.am.
    64.5 -# @configure_input@
    64.6 -
    64.7 -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
    64.8 -# 2003, 2004, 2005  Free Software Foundation, Inc.
    64.9 -# This Makefile.in is free software; the Free Software Foundation
   64.10 -# gives unlimited permission to copy and/or distribute it,
   64.11 -# with or without modifications, as long as this notice is preserved.
   64.12 -
   64.13 -# This program is distributed in the hope that it will be useful,
   64.14 -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
   64.15 -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   64.16 -# PARTICULAR PURPOSE.
   64.17 -
   64.18 -@SET_MAKE@
   64.19 -srcdir = @srcdir@
   64.20 -top_srcdir = @top_srcdir@
   64.21 -VPATH = @srcdir@
   64.22 -pkgdatadir = $(datadir)/@PACKAGE@
   64.23 -pkglibdir = $(libdir)/@PACKAGE@
   64.24 -pkgincludedir = $(includedir)/@PACKAGE@
   64.25 -top_builddir = .
   64.26 -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
   64.27 -INSTALL = @INSTALL@
   64.28 -install_sh_DATA = $(install_sh) -c -m 644
   64.29 -install_sh_PROGRAM = $(install_sh) -c
   64.30 -install_sh_SCRIPT = $(install_sh) -c
   64.31 -INSTALL_HEADER = $(INSTALL_DATA)
   64.32 -transform = $(program_transform_name)
   64.33 -NORMAL_INSTALL = :
   64.34 -PRE_INSTALL = :
   64.35 -POST_INSTALL = :
   64.36 -NORMAL_UNINSTALL = :
   64.37 -PRE_UNINSTALL = :
   64.38 -POST_UNINSTALL = :
   64.39 -subdir = .
   64.40 -DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
   64.41 -	$(srcdir)/Makefile.in $(top_srcdir)/configure \
   64.42 -	$(top_srcdir)/lib/XmTestLib/config.py.in \
   64.43 -	$(top_srcdir)/lib/XmTestReport/xmtest.py.in COPYING ChangeLog \
   64.44 -	TODO install-sh missing
   64.45 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
   64.46 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac
   64.47 -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
   64.48 -	$(ACLOCAL_M4)
   64.49 -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
   64.50 - configure.lineno configure.status.lineno
   64.51 -mkinstalldirs = $(install_sh) -d
   64.52 -CONFIG_CLEAN_FILES = lib/XmTestReport/xmtest.py \
   64.53 -	lib/XmTestLib/config.py
   64.54 -SOURCES =
   64.55 -DIST_SOURCES =
   64.56 -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
   64.57 -	html-recursive info-recursive install-data-recursive \
   64.58 -	install-exec-recursive install-info-recursive \
   64.59 -	install-recursive installcheck-recursive installdirs-recursive \
   64.60 -	pdf-recursive ps-recursive uninstall-info-recursive \
   64.61 -	uninstall-recursive
   64.62 -ETAGS = etags
   64.63 -CTAGS = ctags
   64.64 -DIST_SUBDIRS = $(SUBDIRS)
   64.65 -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
   64.66 -distdir = $(PACKAGE)-$(VERSION)
   64.67 -top_distdir = $(distdir)
   64.68 -am__remove_distdir = \
   64.69 -  { test ! -d $(distdir) \
   64.70 -    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
   64.71 -         && rm -fr $(distdir); }; }
   64.72 -DIST_ARCHIVES = $(distdir).tar.gz
   64.73 -GZIP_ENV = --best
   64.74 -distuninstallcheck_listfiles = find . -type f -print
   64.75 -distcleancheck_listfiles = find . -type f -print
   64.76 -ACLOCAL = @ACLOCAL@
   64.77 -AMDEP_FALSE = @AMDEP_FALSE@
   64.78 -AMDEP_TRUE = @AMDEP_TRUE@
   64.79 -AMTAR = @AMTAR@
   64.80 -AUTOCONF = @AUTOCONF@
   64.81 -AUTOHEADER = @AUTOHEADER@
   64.82 -AUTOMAKE = @AUTOMAKE@
   64.83 -AWK = @AWK@
   64.84 -CC = @CC@
   64.85 -CCDEPMODE = @CCDEPMODE@
   64.86 -CFLAGS = @CFLAGS@
   64.87 -CPPFLAGS = @CPPFLAGS@
   64.88 -CYGPATH_W = @CYGPATH_W@
   64.89 -DEFS = @DEFS@
   64.90 -DEPDIR = @DEPDIR@
   64.91 -ECHO_C = @ECHO_C@
   64.92 -ECHO_N = @ECHO_N@
   64.93 -ECHO_T = @ECHO_T@
   64.94 -ENABLE_VMX = @ENABLE_VMX@
   64.95 -EXEEXT = @EXEEXT@
   64.96 -INSTALL_DATA = @INSTALL_DATA@
   64.97 -INSTALL_PROGRAM = @INSTALL_PROGRAM@
   64.98 -INSTALL_SCRIPT = @INSTALL_SCRIPT@
   64.99 -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  64.100 -LDFLAGS = @LDFLAGS@
  64.101 -LEX = @LEX@
  64.102 -LEXLIB = @LEXLIB@
  64.103 -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
  64.104 -LIBOBJS = @LIBOBJS@
  64.105 -LIBS = @LIBS@
  64.106 -LTLIBOBJS = @LTLIBOBJS@
  64.107 -MAKEINFO = @MAKEINFO@
  64.108 -OBJEXT = @OBJEXT@
  64.109 -PACKAGE = @PACKAGE@
  64.110 -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
  64.111 -PACKAGE_NAME = @PACKAGE_NAME@
  64.112 -PACKAGE_STRING = @PACKAGE_STRING@
  64.113 -PACKAGE_TARNAME = @PACKAGE_TARNAME@
  64.114 -PACKAGE_VERSION = @PACKAGE_VERSION@
  64.115 -PATH_SEPARATOR = @PATH_SEPARATOR@
  64.116 -SET_MAKE = @SET_MAKE@
  64.117 -SHELL = @SHELL@
  64.118 -STRIP = @STRIP@
  64.119 -TENV = @TENV@
  64.120 -VERSION = @VERSION@
  64.121 -YACC = @YACC@
  64.122 -ac_ct_CC = @ac_ct_CC@
  64.123 -ac_ct_STRIP = @ac_ct_STRIP@
  64.124 -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
  64.125 -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
  64.126 -am__include = @am__include@
  64.127 -am__leading_dot = @am__leading_dot@
  64.128 -am__quote = @am__quote@
  64.129 -am__tar = @am__tar@
  64.130 -am__untar = @am__untar@
  64.131 -bindir = @bindir@
  64.132 -build_alias = @build_alias@
  64.133 -datadir = @datadir@
  64.134 -exec_prefix = @exec_prefix@
  64.135 -host_alias = @host_alias@
  64.136 -includedir = @includedir@
  64.137 -infodir = @infodir@
  64.138 -install_sh = @install_sh@
  64.139 -libdir = @libdir@
  64.140 -libexecdir = @libexecdir@
  64.141 -localstatedir = @localstatedir@
  64.142 -mandir = @mandir@
  64.143 -mkdir_p = @mkdir_p@
  64.144 -oldincludedir = @oldincludedir@
  64.145 -prefix = @prefix@
  64.146 -program_transform_name = @program_transform_name@
  64.147 -sbindir = @sbindir@
  64.148 -sharedstatedir = @sharedstatedir@
  64.149 -sysconfdir = @sysconfdir@
  64.150 -target_alias = @target_alias@
  64.151 -SUBDIRS = ramdisk tests
  64.152 -EXTRA_DIST = lib runtest.sh mkreport
  64.153 -all: all-recursive
  64.154 -
  64.155 -.SUFFIXES:
  64.156 -am--refresh:
  64.157 -	@:
  64.158 -$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
  64.159 -	@for dep in $?; do \
  64.160 -	  case '$(am__configure_deps)' in \
  64.161 -	    *$$dep*) \
  64.162 -	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
  64.163 -	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
  64.164 -		&& exit 0; \
  64.165 -	      exit 1;; \
  64.166 -	  esac; \
  64.167 -	done; \
  64.168 -	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
  64.169 -	cd $(top_srcdir) && \
  64.170 -	  $(AUTOMAKE) --foreign  Makefile
  64.171 -.PRECIOUS: Makefile
  64.172 -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  64.173 -	@case '$?' in \
  64.174 -	  *config.status*) \
  64.175 -	    echo ' $(SHELL) ./config.status'; \
  64.176 -	    $(SHELL) ./config.status;; \
  64.177 -	  *) \
  64.178 -	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
  64.179 -	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
  64.180 -	esac;
  64.181 -
  64.182 -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
  64.183 -	$(SHELL) ./config.status --recheck
  64.184 -
  64.185 -$(top_srcdir)/configure:  $(am__configure_deps)
  64.186 -	cd $(srcdir) && $(AUTOCONF)
  64.187 -$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
  64.188 -	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
  64.189 -lib/XmTestReport/xmtest.py: $(top_builddir)/config.status $(top_srcdir)/lib/XmTestReport/xmtest.py.in
  64.190 -	cd $(top_builddir) && $(SHELL) ./config.status $@
  64.191 -lib/XmTestLib/config.py: $(top_builddir)/config.status $(top_srcdir)/lib/XmTestLib/config.py.in
  64.192 -	cd $(top_builddir) && $(SHELL) ./config.status $@
  64.193 -uninstall-info-am:
  64.194 -
  64.195 -# This directory's subdirectories are mostly independent; you can cd
  64.196 -# into them and run `make' without going through this Makefile.
  64.197 -# To change the values of `make' variables: instead of editing Makefiles,
  64.198 -# (1) if the variable is set in `config.status', edit `config.status'
  64.199 -#     (which will cause the Makefiles to be regenerated when you run `make');
  64.200 -# (2) otherwise, pass the desired values on the `make' command line.
  64.201 -$(RECURSIVE_TARGETS):
  64.202 -	@failcom='exit 1'; \
  64.203 -	for f in x $$MAKEFLAGS; do \
  64.204 -	  case $$f in \
  64.205 -	    *=* | --[!k]*);; \
  64.206 -	    *k*) failcom='fail=yes';; \
  64.207 -	  esac; \
  64.208 -	done; \
  64.209 -	dot_seen=no; \
  64.210 -	target=`echo $@ | sed s/-recursive//`; \
  64.211 -	list='$(SUBDIRS)'; for subdir in $$list; do \
  64.212 -	  echo "Making $$target in $$subdir"; \
  64.213 -	  if test "$$subdir" = "."; then \
  64.214 -	    dot_seen=yes; \
  64.215 -	    local_target="$$target-am"; \
  64.216 -	  else \
  64.217 -	    local_target="$$target"; \
  64.218 -	  fi; \
  64.219 -	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
  64.220 -	  || eval $$failcom; \
  64.221 -	done; \
  64.222 -	if test "$$dot_seen" = "no"; then \
  64.223 -	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
  64.224 -	fi; test -z "$$fail"
  64.225 -
  64.226 -mostlyclean-recursive clean-recursive distclean-recursive \
  64.227 -maintainer-clean-recursive:
  64.228 -	@failcom='exit 1'; \
  64.229 -	for f in x $$MAKEFLAGS; do \
  64.230 -	  case $$f in \
  64.231 -	    *=* | --[!k]*);; \
  64.232 -	    *k*) failcom='fail=yes';; \
  64.233 -	  esac; \
  64.234 -	done; \
  64.235 -	dot_seen=no; \
  64.236 -	case "$@" in \
  64.237 -	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
  64.238 -	  *) list='$(SUBDIRS)' ;; \
  64.239 -	esac; \
  64.240 -	rev=''; for subdir in $$list; do \
  64.241 -	  if test "$$subdir" = "."; then :; else \
  64.242 -	    rev="$$subdir $$rev"; \
  64.243 -	  fi; \
  64.244 -	done; \
  64.245 -	rev="$$rev ."; \
  64.246 -	target=`echo $@ | sed s/-recursive//`; \
  64.247 -	for subdir in $$rev; do \
  64.248 -	  echo "Making $$target in $$subdir"; \
  64.249 -	  if test "$$subdir" = "."; then \
  64.250 -	    local_target="$$target-am"; \
  64.251 -	  else \
  64.252 -	    local_target="$$target"; \
  64.253 -	  fi; \
  64.254 -	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
  64.255 -	  || eval $$failcom; \
  64.256 -	done && test -z "$$fail"
  64.257 -tags-recursive:
  64.258 -	list='$(SUBDIRS)'; for subdir in $$list; do \
  64.259 -	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
  64.260 -	done
  64.261 -ctags-recursive:
  64.262 -	list='$(SUBDIRS)'; for subdir in $$list; do \
  64.263 -	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
  64.264 -	done
  64.265 -
  64.266 -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
  64.267 -	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
  64.268 -	unique=`for i in $$list; do \
  64.269 -	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  64.270 -	  done | \
  64.271 -	  $(AWK) '    { files[$$0] = 1; } \
  64.272 -	       END { for (i in files) print i; }'`; \
  64.273 -	mkid -fID $$unique
  64.274 -tags: TAGS
  64.275 -
  64.276 -TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  64.277 -		$(TAGS_FILES) $(LISP)
  64.278 -	tags=; \
  64.279 -	here=`pwd`; \
  64.280 -	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
  64.281 -	  include_option=--etags-include; \
  64.282 -	  empty_fix=.; \
  64.283 -	else \
  64.284 -	  include_option=--include; \
  64.285 -	  empty_fix=; \
  64.286 -	fi; \
  64.287 -	list='$(SUBDIRS)'; for subdir in $$list; do \
  64.288 -	  if test "$$subdir" = .; then :; else \
  64.289 -	    test ! -f $$subdir/TAGS || \
  64.290 -	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
  64.291 -	  fi; \
  64.292 -	done; \
  64.293 -	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
  64.294 -	unique=`for i in $$list; do \
  64.295 -	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  64.296 -	  done | \
  64.297 -	  $(AWK) '    { files[$$0] = 1; } \
  64.298 -	       END { for (i in files) print i; }'`; \
  64.299 -	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
  64.300 -	  test -n "$$unique" || unique=$$empty_fix; \
  64.301 -	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
  64.302 -	    $$tags $$unique; \
  64.303 -	fi
  64.304 -ctags: CTAGS
  64.305 -CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
  64.306 -		$(TAGS_FILES) $(LISP)
  64.307 -	tags=; \
  64.308 -	here=`pwd`; \
  64.309 -	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
  64.310 -	unique=`for i in $$list; do \
  64.311 -	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  64.312 -	  done | \
  64.313 -	  $(AWK) '    { files[$$0] = 1; } \
  64.314 -	       END { for (i in files) print i; }'`; \
  64.315 -	test -z "$(CTAGS_ARGS)$$tags$$unique" \
  64.316 -	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
  64.317 -	     $$tags $$unique
  64.318 -
  64.319 -GTAGS:
  64.320 -	here=`$(am__cd) $(top_builddir) && pwd` \
  64.321 -	  && cd $(top_srcdir) \
  64.322 -	  && gtags -i $(GTAGS_ARGS) $$here
  64.323 -
  64.324 -distclean-tags:
  64.325 -	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
  64.326 -
  64.327 -distdir: $(DISTFILES)
  64.328 -	$(am__remove_distdir)
  64.329 -	mkdir $(distdir)
  64.330 -	$(mkdir_p) $(distdir)/lib/XmTestLib $(distdir)/lib/XmTestReport
  64.331 -	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
  64.332 -	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
  64.333 -	list='$(DISTFILES)'; for file in $$list; do \
  64.334 -	  case $$file in \
  64.335 -	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
  64.336 -	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
  64.337 -	  esac; \
  64.338 -	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
  64.339 -	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
  64.340 -	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
  64.341 -	    dir="/$$dir"; \
  64.342 -	    $(mkdir_p) "$(distdir)$$dir"; \
  64.343 -	  else \
  64.344 -	    dir=''; \
  64.345 -	  fi; \
  64.346 -	  if test -d $$d/$$file; then \
  64.347 -	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
  64.348 -	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
  64.349 -	    fi; \
  64.350 -	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
  64.351 -	  else \
  64.352 -	    test -f $(distdir)/$$file \
  64.353 -	    || cp -p $$d/$$file $(distdir)/$$file \
  64.354 -	    || exit 1; \
  64.355 -	  fi; \
  64.356 -	done
  64.357 -	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
  64.358 -	  if test "$$subdir" = .; then :; else \
  64.359 -	    test -d "$(distdir)/$$subdir" \
  64.360 -	    || $(mkdir_p) "$(distdir)/$$subdir" \
  64.361 -	    || exit 1; \
  64.362 -	    distdir=`$(am__cd) $(distdir) && pwd`; \
  64.363 -	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
  64.364 -	    (cd $$subdir && \
  64.365 -	      $(MAKE) $(AM_MAKEFLAGS) \
  64.366 -	        top_distdir="$$top_distdir" \
  64.367 -	        distdir="$$distdir/$$subdir" \
  64.368 -	        distdir) \
  64.369 -	      || exit 1; \
  64.370 -	  fi; \
  64.371 -	done
  64.372 -	$(MAKE) $(AM_MAKEFLAGS) \
  64.373 -	  top_distdir="$(top_distdir)" distdir="$(distdir)" \
  64.374 -	  dist-hook
  64.375 -	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
  64.376 -	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
  64.377 -	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
  64.378 -	  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
  64.379 -	|| chmod -R a+r $(distdir)
  64.380 -dist-gzip: distdir
  64.381 -	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
  64.382 -	$(am__remove_distdir)
  64.383 -
  64.384 -dist-bzip2: distdir
  64.385 -	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
  64.386 -	$(am__remove_distdir)
  64.387 -
  64.388 -dist-tarZ: distdir
  64.389 -	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
  64.390 -	$(am__remove_distdir)
  64.391 -
  64.392 -dist-shar: distdir
  64.393 -	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
  64.394 -	$(am__remove_distdir)
  64.395 -
  64.396 -dist-zip: distdir
  64.397 -	-rm -f $(distdir).zip
  64.398 -	zip -rq $(distdir).zip $(distdir)
  64.399 -	$(am__remove_distdir)
  64.400 -
  64.401 -dist dist-all: distdir
  64.402 -	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
  64.403 -	$(am__remove_distdir)
  64.404 -
  64.405 -# This target untars the dist file and tries a VPATH configuration.  Then
  64.406 -# it guarantees that the distribution is self-contained by making another
  64.407 -# tarfile.
  64.408 -distcheck: dist
  64.409 -	case '$(DIST_ARCHIVES)' in \
  64.410 -	*.tar.gz*) \
  64.411 -	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
  64.412 -	*.tar.bz2*) \
  64.413 -	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
  64.414 -	*.tar.Z*) \
  64.415 -	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
  64.416 -	*.shar.gz*) \
  64.417 -	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
  64.418 -	*.zip*) \
  64.419 -	  unzip $(distdir).zip ;;\
  64.420 -	esac
  64.421 -	chmod -R a-w $(distdir); chmod a+w $(distdir)
  64.422 -	mkdir $(distdir)/_build
  64.423 -	mkdir $(distdir)/_inst
  64.424 -	chmod a-w $(distdir)
  64.425 -	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
  64.426 -	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
  64.427 -	  && cd $(distdir)/_build \
  64.428 -	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
  64.429 -	    $(DISTCHECK_CONFIGURE_FLAGS) \
  64.430 -	  && $(MAKE) $(AM_MAKEFLAGS) \
  64.431 -	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
  64.432 -	  && $(MAKE) $(AM_MAKEFLAGS) check \
  64.433 -	  && $(MAKE) $(AM_MAKEFLAGS) install \
  64.434 -	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
  64.435 -	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
  64.436 -	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
  64.437 -	        distuninstallcheck \
  64.438 -	  && chmod -R a-w "$$dc_install_base" \
  64.439 -	  && ({ \
  64.440 -	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
  64.441 -	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
  64.442 -	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
  64.443 -	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
  64.444 -	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
  64.445 -	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
  64.446 -	  && rm -rf "$$dc_destdir" \
  64.447 -	  && $(MAKE) $(AM_MAKEFLAGS) dist \
  64.448 -	  && rm -rf $(DIST_ARCHIVES) \
  64.449 -	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
  64.450 -	$(am__remove_distdir)
  64.451 -	@(echo "$(distdir) archives ready for distribution: "; \
  64.452 -	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
  64.453 -	  sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
  64.454 -distuninstallcheck:
  64.455 -	@cd $(distuninstallcheck_dir) \
  64.456 -	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
  64.457 -	   || { echo "ERROR: files left after uninstall:" ; \
  64.458 -	        if test -n "$(DESTDIR)"; then \
  64.459 -	          echo "  (check DESTDIR support)"; \
  64.460 -	        fi ; \
  64.461 -	        $(distuninstallcheck_listfiles) ; \
  64.462 -	        exit 1; } >&2
  64.463 -distcleancheck: distclean
  64.464 -	@if test '$(srcdir)' = . ; then \
  64.465 -	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
  64.466 -	  exit 1 ; \
  64.467 -	fi
  64.468 -	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
  64.469 -	  || { echo "ERROR: files left in build directory after distclean:" ; \
  64.470 -	       $(distcleancheck_listfiles) ; \
  64.471 -	       exit 1; } >&2
  64.472 -check-am: all-am
  64.473 -check: check-recursive
  64.474 -all-am: Makefile
  64.475 -installdirs: installdirs-recursive
  64.476 -installdirs-am:
  64.477 -install: install-recursive
  64.478 -install-exec: install-exec-recursive
  64.479 -install-data: install-data-recursive
  64.480 -uninstall: uninstall-recursive
  64.481 -
  64.482 -install-am: all-am
  64.483 -	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
  64.484 -
  64.485 -installcheck: installcheck-recursive
  64.486 -install-strip:
  64.487 -	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
  64.488 -	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
  64.489 -	  `test -z '$(STRIP)' || \
  64.490 -	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
  64.491 -mostlyclean-generic:
  64.492 -
  64.493 -clean-generic:
  64.494 -
  64.495 -distclean-generic:
  64.496 -	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
  64.497 -
  64.498 -maintainer-clean-generic:
  64.499 -	@echo "This command is intended for maintainers to use"
  64.500 -	@echo "it deletes files that may require special tools to rebuild."
  64.501 -clean: clean-recursive
  64.502 -
  64.503 -clean-am: clean-generic mostlyclean-am
  64.504 -
  64.505 -distclean: distclean-recursive
  64.506 -	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
  64.507 -	-rm -f Makefile
  64.508 -distclean-am: clean-am distclean-generic distclean-tags
  64.509 -
  64.510 -dvi: dvi-recursive
  64.511 -
  64.512 -dvi-am:
  64.513 -
  64.514 -html: html-recursive
  64.515 -
  64.516 -info: info-recursive
  64.517 -
  64.518 -info-am:
  64.519 -
  64.520 -install-data-am:
  64.521 -
  64.522 -install-exec-am:
  64.523 -
  64.524 -install-info: install-info-recursive
  64.525 -
  64.526 -install-man:
  64.527 -
  64.528 -installcheck-am:
  64.529 -
  64.530 -maintainer-clean: maintainer-clean-recursive
  64.531 -	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
  64.532 -	-rm -rf $(top_srcdir)/autom4te.cache
  64.533 -	-rm -f Makefile
  64.534 -maintainer-clean-am: distclean-am maintainer-clean-generic
  64.535 -
  64.536 -mostlyclean: mostlyclean-recursive
  64.537 -
  64.538 -mostlyclean-am: mostlyclean-generic
  64.539 -
  64.540 -pdf: pdf-recursive
  64.541 -
  64.542 -pdf-am:
  64.543 -
  64.544 -ps: ps-recursive
  64.545 -
  64.546 -ps-am:
  64.547 -
  64.548 -uninstall-am: uninstall-info-am
  64.549 -
  64.550 -uninstall-info: uninstall-info-recursive
  64.551 -
  64.552 -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
  64.553 -	check-am clean clean-generic clean-recursive ctags \
  64.554 -	ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \
  64.555 -	dist-shar dist-tarZ dist-zip distcheck distclean \
  64.556 -	distclean-generic distclean-recursive distclean-tags \
  64.557 -	distcleancheck distdir distuninstallcheck dvi dvi-am html \
  64.558 -	html-am info info-am install install-am install-data \
  64.559 -	install-data-am install-exec install-exec-am install-info \
  64.560 -	install-info-am install-man install-strip installcheck \
  64.561 -	installcheck-am installdirs installdirs-am maintainer-clean \
  64.562 -	maintainer-clean-generic maintainer-clean-recursive \
  64.563 -	mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
  64.564 -	pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
  64.565 -	uninstall-info-am
  64.566 -
  64.567 -
  64.568 -# Remove any pyc's, CVS dirs, and prune the skel dirs
  64.569 -dist-hook:
  64.570 -	find $(distdir) -name '*~' -delete -print
  64.571 -	find $(distdir) -name '*.pyc' -delete -print
  64.572 -	for i in Root Repository Entries; do \
  64.573 -	  find $(distdir) -name $$i -delete ;\
  64.574 -	done
  64.575 -	find $(distdir) -name CVS -delete
  64.576 -	find $(distdir) -name '*.test' -delete
  64.577 -	cd $(distdir)/ramdisk/skel && find . -empty -delete
  64.578 -	chmod a+x $(distdir)/runtest.sh
  64.579 -# Tell versions [3.59,3.63) of GNU make to not export all variables.
  64.580 -# Otherwise a system limit (for SysV at least) may be exceeded.
  64.581 -.NOEXPORT:
    65.1 --- a/tools/xm-test/README	Thu Nov 10 08:18:25 2005 -0600
    65.2 +++ b/tools/xm-test/README	Thu Nov 10 08:34:09 2005 -0600
    65.3 @@ -25,6 +25,10 @@ The directory structure is:
    65.4     |
    65.5     +-/utils: Utility scripts for ramdisk building
    65.6  
    65.7 +Reports are posted here:
    65.8 +
    65.9 +   http://xmtest.dague.org
   65.10 +
   65.11  
   65.12  Building
   65.13  ========
   65.14 @@ -61,6 +65,10 @@ Additionally, the script will submit you
   65.15  team for trend analysis.  This helps us determine the level of success
   65.16  people "out there" are having with different versions of Xen.
   65.17  
   65.18 +Note: you should generally run xm-test with a minimum of memory
   65.19 +allocated to Dom0.  More memory available for allocation to DomUs
   65.20 +means a more rigorous test.
   65.21 +
   65.22  If you wish to run xm-test in an automated batch environment, you can
   65.23  run the script with the "-b" flag, which will try to prevent it from
   65.24  asking any questions interactively.  You should run it manually at
    66.1 --- a/tools/xm-test/aclocal.m4	Thu Nov 10 08:18:25 2005 -0600
    66.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.3 @@ -1,850 +0,0 @@
    66.4 -# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
    66.5 -
    66.6 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
    66.7 -# 2005  Free Software Foundation, Inc.
    66.8 -# This file is free software; the Free Software Foundation
    66.9 -# gives unlimited permission to copy and/or distribute it,
   66.10 -# with or without modifications, as long as this notice is preserved.
   66.11 -
   66.12 -# This program is distributed in the hope that it will be useful,
   66.13 -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
   66.14 -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   66.15 -# PARTICULAR PURPOSE.
   66.16 -
   66.17 -# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
   66.18 -#
   66.19 -# This file is free software; the Free Software Foundation
   66.20 -# gives unlimited permission to copy and/or distribute it,
   66.21 -# with or without modifications, as long as this notice is preserved.
   66.22 -
   66.23 -# AM_AUTOMAKE_VERSION(VERSION)
   66.24 -# ----------------------------
   66.25 -# Automake X.Y traces this macro to ensure aclocal.m4 has been
   66.26 -# generated from the m4 files accompanying Automake X.Y.
   66.27 -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
   66.28 -
   66.29 -# AM_SET_CURRENT_AUTOMAKE_VERSION
   66.30 -# -------------------------------
   66.31 -# Call AM_AUTOMAKE_VERSION so it can be traced.
   66.32 -# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
   66.33 -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
   66.34 -	 [AM_AUTOMAKE_VERSION([1.9.5])])
   66.35 -
   66.36 -# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
   66.37 -
   66.38 -# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
   66.39 -#
   66.40 -# This file is free software; the Free Software Foundation
   66.41 -# gives unlimited permission to copy and/or distribute it,
   66.42 -# with or without modifications, as long as this notice is preserved.
   66.43 -
   66.44 -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
   66.45 -# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
   66.46 -# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
   66.47 -#
   66.48 -# Of course, Automake must honor this variable whenever it calls a
   66.49 -# tool from the auxiliary directory.  The problem is that $srcdir (and
   66.50 -# therefore $ac_aux_dir as well) can be either absolute or relative,
   66.51 -# depending on how configure is run.  This is pretty annoying, since
   66.52 -# it makes $ac_aux_dir quite unusable in subdirectories: in the top
   66.53 -# source directory, any form will work fine, but in subdirectories a
   66.54 -# relative path needs to be adjusted first.
   66.55 -#
   66.56 -# $ac_aux_dir/missing
   66.57 -#    fails when called from a subdirectory if $ac_aux_dir is relative
   66.58 -# $top_srcdir/$ac_aux_dir/missing
   66.59 -#    fails if $ac_aux_dir is absolute,
   66.60 -#    fails when called from a subdirectory in a VPATH build with
   66.61 -#          a relative $ac_aux_dir
   66.62 -#
   66.63 -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
   66.64 -# are both prefixed by $srcdir.  In an in-source build this is usually
   66.65 -# harmless because $srcdir is `.', but things will broke when you
   66.66 -# start a VPATH build or use an absolute $srcdir.
   66.67 -#
   66.68 -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
   66.69 -# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
   66.70 -#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
   66.71 -# and then we would define $MISSING as
   66.72 -#   MISSING="\${SHELL} $am_aux_dir/missing"
   66.73 -# This will work as long as MISSING is not called from configure, because
   66.74 -# unfortunately $(top_srcdir) has no meaning in configure.
   66.75 -# However there are other variables, like CC, which are often used in
   66.76 -# configure, and could therefore not use this "fixed" $ac_aux_dir.
   66.77 -#
   66.78 -# Another solution, used here, is to always expand $ac_aux_dir to an
   66.79 -# absolute PATH.  The drawback is that using absolute paths prevent a
   66.80 -# configured tree to be moved without reconfiguration.
   66.81 -
   66.82 -AC_DEFUN([AM_AUX_DIR_EXPAND],
   66.83 -[dnl Rely on autoconf to set up CDPATH properly.
   66.84 -AC_PREREQ([2.50])dnl
   66.85 -# expand $ac_aux_dir to an absolute path
   66.86 -am_aux_dir=`cd $ac_aux_dir && pwd`
   66.87 -])
   66.88 -
   66.89 -# AM_CONDITIONAL                                            -*- Autoconf -*-
   66.90 -
   66.91 -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
   66.92 -# Free Software Foundation, Inc.
   66.93 -#
   66.94 -# This file is free software; the Free Software Foundation
   66.95 -# gives unlimited permission to copy and/or distribute it,
   66.96 -# with or without modifications, as long as this notice is preserved.
   66.97 -
   66.98 -# serial 7
   66.99 -
  66.100 -# AM_CONDITIONAL(NAME, SHELL-CONDITION)
  66.101 -# -------------------------------------
  66.102 -# Define a conditional.
  66.103 -AC_DEFUN([AM_CONDITIONAL],
  66.104 -[AC_PREREQ(2.52)dnl
  66.105 - ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
  66.106 -	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
  66.107 -AC_SUBST([$1_TRUE])
  66.108 -AC_SUBST([$1_FALSE])
  66.109 -if $2; then
  66.110 -  $1_TRUE=
  66.111 -  $1_FALSE='#'
  66.112 -else
  66.113 -  $1_TRUE='#'
  66.114 -  $1_FALSE=
  66.115 -fi
  66.116 -AC_CONFIG_COMMANDS_PRE(
  66.117 -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
  66.118 -  AC_MSG_ERROR([[conditional "$1" was never defined.
  66.119 -Usually this means the macro was only invoked conditionally.]])
  66.120 -fi])])
  66.121 -
  66.122 -
  66.123 -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
  66.124 -# Free Software Foundation, Inc.
  66.125 -#
  66.126 -# This file is free software; the Free Software Foundation
  66.127 -# gives unlimited permission to copy and/or distribute it,
  66.128 -# with or without modifications, as long as this notice is preserved.
  66.129 -
  66.130 -# serial 8
  66.131 -
  66.132 -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
  66.133 -# written in clear, in which case automake, when reading aclocal.m4,
  66.134 -# will think it sees a *use*, and therefore will trigger all it's
  66.135 -# C support machinery.  Also note that it means that autoscan, seeing
  66.136 -# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
  66.137 -
  66.138 -
  66.139 -# _AM_DEPENDENCIES(NAME)
  66.140 -# ----------------------
  66.141 -# See how the compiler implements dependency checking.
  66.142 -# NAME is "CC", "CXX", "GCJ", or "OBJC".
  66.143 -# We try a few techniques and use that to set a single cache variable.
  66.144 -#
  66.145 -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
  66.146 -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
  66.147 -# dependency, and given that the user is not expected to run this macro,
  66.148 -# just rely on AC_PROG_CC.
  66.149 -AC_DEFUN([_AM_DEPENDENCIES],
  66.150 -[AC_REQUIRE([AM_SET_DEPDIR])dnl
  66.151 -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
  66.152 -AC_REQUIRE([AM_MAKE_INCLUDE])dnl
  66.153 -AC_REQUIRE([AM_DEP_TRACK])dnl
  66.154 -
  66.155 -ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
  66.156 -       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
  66.157 -       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
  66.158 -       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
  66.159 -                   [depcc="$$1"   am_compiler_list=])
  66.160 -
  66.161 -AC_CACHE_CHECK([dependency style of $depcc],
  66.162 -               [am_cv_$1_dependencies_compiler_type],
  66.163 -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
  66.164 -  # We make a subdir and do the tests there.  Otherwise we can end up
  66.165 -  # making bogus files that we don't know about and never remove.  For
  66.166 -  # instance it was reported that on HP-UX the gcc test will end up
  66.167 -  # making a dummy file named `D' -- because `-MD' means `put the output
  66.168 -  # in D'.
  66.169 -  mkdir conftest.dir
  66.170 -  # Copy depcomp to subdir because otherwise we won't find it if we're
  66.171 -  # using a relative directory.
  66.172 -  cp "$am_depcomp" conftest.dir
  66.173 -  cd conftest.dir
  66.174 -  # We will build objects and dependencies in a subdirectory because
  66.175 -  # it helps to detect inapplicable dependency modes.  For instance
  66.176 -  # both Tru64's cc and ICC support -MD to output dependencies as a
  66.177 -  # side effect of compilation, but ICC will put the dependencies in
  66.178 -  # the current directory while Tru64 will put them in the object
  66.179 -  # directory.
  66.180 -  mkdir sub
  66.181 -
  66.182 -  am_cv_$1_dependencies_compiler_type=none
  66.183 -  if test "$am_compiler_list" = ""; then
  66.184 -     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
  66.185 -  fi
  66.186 -  for depmode in $am_compiler_list; do
  66.187 -    # Setup a source with many dependencies, because some compilers
  66.188 -    # like to wrap large dependency lists on column 80 (with \), and
  66.189 -    # we should not choose a depcomp mode which is confused by this.
  66.190 -    #
  66.191 -    # We need to recreate these files for each test, as the compiler may
  66.192 -    # overwrite some of them when testing with obscure command lines.
  66.193 -    # This happens at least with the AIX C compiler.
  66.194 -    : > sub/conftest.c
  66.195 -    for i in 1 2 3 4 5 6; do
  66.196 -      echo '#include "conftst'$i'.h"' >> sub/conftest.c
  66.197 -      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
  66.198 -      # Solaris 8's {/usr,}/bin/sh.
  66.199 -      touch sub/conftst$i.h
  66.200 -    done
  66.201 -    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
  66.202 -
  66.203 -    case $depmode in
  66.204 -    nosideeffect)
  66.205 -      # after this tag, mechanisms are not by side-effect, so they'll
  66.206 -      # only be used when explicitly requested
  66.207 -      if test "x$enable_dependency_tracking" = xyes; then
  66.208 -	continue
  66.209 -      else
  66.210 -	break
  66.211 -      fi
  66.212 -      ;;
  66.213 -    none) break ;;
  66.214 -    esac
  66.215 -    # We check with `-c' and `-o' for the sake of the "dashmstdout"
  66.216 -    # mode.  It turns out that the SunPro C++ compiler does not properly
  66.217 -    # handle `-M -o', and we need to detect this.
  66.218 -    if depmode=$depmode \
  66.219 -       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
  66.220 -       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
  66.221 -       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
  66.222 -         >/dev/null 2>conftest.err &&
  66.223 -       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
  66.224 -       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
  66.225 -       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
  66.226 -      # icc doesn't choke on unknown options, it will just issue warnings
  66.227 -      # or remarks (even with -Werror).  So we grep stderr for any message
  66.228 -      # that says an option was ignored or not supported.
  66.229 -      # When given -MP, icc 7.0 and 7.1 complain thusly:
  66.230 -      #   icc: Command line warning: ignoring option '-M'; no argument required
  66.231 -      # The diagnosis changed in icc 8.0:
  66.232 -      #   icc: Command line remark: option '-MP' not supported
  66.233 -      if (grep 'ignoring option' conftest.err ||
  66.234 -          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
  66.235 -        am_cv_$1_dependencies_compiler_type=$depmode
  66.236 -        break
  66.237 -      fi
  66.238 -    fi
  66.239 -  done
  66.240 -
  66.241 -  cd ..
  66.242 -  rm -rf conftest.dir
  66.243 -else
  66.244 -  am_cv_$1_dependencies_compiler_type=none
  66.245 -fi
  66.246 -])
  66.247 -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
  66.248 -AM_CONDITIONAL([am__fastdep$1], [
  66.249 -  test "x$enable_dependency_tracking" != xno \
  66.250 -  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
  66.251 -])
  66.252 -
  66.253 -
  66.254 -# AM_SET_DEPDIR
  66.255 -# -------------
  66.256 -# Choose a directory name for dependency files.
  66.257 -# This macro is AC_REQUIREd in _AM_DEPENDENCIES
  66.258 -AC_DEFUN([AM_SET_DEPDIR],
  66.259 -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  66.260 -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
  66.261 -])
  66.262 -
  66.263 -
  66.264 -# AM_DEP_TRACK
  66.265 -# ------------
  66.266 -AC_DEFUN([AM_DEP_TRACK],
  66.267 -[AC_ARG_ENABLE(dependency-tracking,
  66.268 -[  --disable-dependency-tracking  speeds up one-time build
  66.269 -  --enable-dependency-tracking   do not reject slow dependency extractors])
  66.270 -if test "x$enable_dependency_tracking" != xno; then
  66.271 -  am_depcomp="$ac_aux_dir/depcomp"
  66.272 -  AMDEPBACKSLASH='\'
  66.273 -fi
  66.274 -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
  66.275 -AC_SUBST([AMDEPBACKSLASH])
  66.276 -])
  66.277 -
  66.278 -# Generate code to set up dependency tracking.              -*- Autoconf -*-
  66.279 -
  66.280 -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
  66.281 -# Free Software Foundation, Inc.
  66.282 -#
  66.283 -# This file is free software; the Free Software Foundation
  66.284 -# gives unlimited permission to copy and/or distribute it,
  66.285 -# with or without modifications, as long as this notice is preserved.
  66.286 -
  66.287 -#serial 3
  66.288 -
  66.289 -# _AM_OUTPUT_DEPENDENCY_COMMANDS
  66.290 -# ------------------------------
  66.291 -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
  66.292 -[for mf in $CONFIG_FILES; do
  66.293 -  # Strip MF so we end up with the name of the file.
  66.294 -  mf=`echo "$mf" | sed -e 's/:.*$//'`
  66.295 -  # Check whether this is an Automake generated Makefile or not.
  66.296 -  # We used to match only the files named `Makefile.in', but
  66.297 -  # some people rename them; so instead we look at the file content.
  66.298 -  # Grep'ing the first line is not enough: some people post-process
  66.299 -  # each Makefile.in and add a new line on top of each file to say so.
  66.300 -  # So let's grep whole file.
  66.301 -  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
  66.302 -    dirpart=`AS_DIRNAME("$mf")`
  66.303 -  else
  66.304 -    continue
  66.305 -  fi
  66.306 -  # Extract the definition of DEPDIR, am__include, and am__quote
  66.307 -  # from the Makefile without running `make'.
  66.308 -  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
  66.309 -  test -z "$DEPDIR" && continue
  66.310 -  am__include=`sed -n 's/^am__include = //p' < "$mf"`
  66.311 -  test -z "am__include" && continue
  66.312 -  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
  66.313 -  # When using ansi2knr, U may be empty or an underscore; expand it
  66.314 -  U=`sed -n 's/^U = //p' < "$mf"`
  66.315 -  # Find all dependency output files, they are included files with
  66.316 -  # $(DEPDIR) in their names.  We invoke sed twice because it is the
  66.317 -  # simplest approach to changing $(DEPDIR) to its actual value in the
  66.318 -  # expansion.
  66.319 -  for file in `sed -n "
  66.320 -    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
  66.321 -       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
  66.322 -    # Make sure the directory exists.
  66.323 -    test -f "$dirpart/$file" && continue
  66.324 -    fdir=`AS_DIRNAME(["$file"])`
  66.325 -    AS_MKDIR_P([$dirpart/$fdir])
  66.326 -    # echo "creating $dirpart/$file"
  66.327 -    echo '# dummy' > "$dirpart/$file"
  66.328 -  done
  66.329 -done
  66.330 -])# _AM_OUTPUT_DEPENDENCY_COMMANDS
  66.331 -
  66.332 -
  66.333 -# AM_OUTPUT_DEPENDENCY_COMMANDS
  66.334 -# -----------------------------
  66.335 -# This macro should only be invoked once -- use via AC_REQUIRE.
  66.336 -#
  66.337 -# This code is only required when automatic dependency tracking
  66.338 -# is enabled.  FIXME.  This creates each `.P' file that we will
  66.339 -# need in order to bootstrap the dependency handling code.
  66.340 -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
  66.341 -[AC_CONFIG_COMMANDS([depfiles],
  66.342 -     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
  66.343 -     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
  66.344 -])
  66.345 -
  66.346 -# Do all the work for Automake.                             -*- Autoconf -*-
  66.347 -
  66.348 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
  66.349 -# Free Software Foundation, Inc.
  66.350 -#
  66.351 -# This file is free software; the Free Software Foundation
  66.352 -# gives unlimited permission to copy and/or distribute it,
  66.353 -# with or without modifications, as long as this notice is preserved.
  66.354 -
  66.355 -# serial 12
  66.356 -
  66.357 -# This macro actually does too much.  Some checks are only needed if
  66.358 -# your package does certain things.  But this isn't really a big deal.
  66.359 -
  66.360 -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
  66.361 -# AM_INIT_AUTOMAKE([OPTIONS])
  66.362 -# -----------------------------------------------
  66.363 -# The call with PACKAGE and VERSION arguments is the old style
  66.364 -# call (pre autoconf-2.50), which is being phased out.  PACKAGE
  66.365 -# and VERSION should now be passed to AC_INIT and removed from
  66.366 -# the call to AM_INIT_AUTOMAKE.
  66.367 -# We support both call styles for the transition.  After
  66.368 -# the next Automake release, Autoconf can make the AC_INIT
  66.369 -# arguments mandatory, and then we can depend on a new Autoconf
  66.370 -# release and drop the old call support.
  66.371 -AC_DEFUN([AM_INIT_AUTOMAKE],
  66.372 -[AC_PREREQ([2.58])dnl
  66.373 -dnl Autoconf wants to disallow AM_ names.  We explicitly allow
  66.374 -dnl the ones we care about.
  66.375 -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
  66.376 -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
  66.377 -AC_REQUIRE([AC_PROG_INSTALL])dnl
  66.378 -# test to see if srcdir already configured
  66.379 -if test "`cd $srcdir && pwd`" != "`pwd`" &&
  66.380 -   test -f $srcdir/config.status; then
  66.381 -  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  66.382 -fi
  66.383 -
  66.384 -# test whether we have cygpath
  66.385 -if test -z "$CYGPATH_W"; then
  66.386 -  if (cygpath --version) >/dev/null 2>/dev/null; then
  66.387 -    CYGPATH_W='cygpath -w'
  66.388 -  else
  66.389 -    CYGPATH_W=echo
  66.390 -  fi
  66.391 -fi
  66.392 -AC_SUBST([CYGPATH_W])
  66.393 -
  66.394 -# Define the identity of the package.
  66.395 -dnl Distinguish between old-style and new-style calls.
  66.396 -m4_ifval([$2],
  66.397 -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  66.398 - AC_SUBST([PACKAGE], [$1])dnl
  66.399 - AC_SUBST([VERSION], [$2])],
  66.400 -[_AM_SET_OPTIONS([$1])dnl
  66.401 - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  66.402 - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
  66.403 -
  66.404 -_AM_IF_OPTION([no-define],,
  66.405 -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
  66.406 - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
  66.407 -
  66.408 -# Some tools Automake needs.
  66.409 -AC_REQUIRE([AM_SANITY_CHECK])dnl
  66.410 -AC_REQUIRE([AC_ARG_PROGRAM])dnl
  66.411 -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
  66.412 -AM_MISSING_PROG(AUTOCONF, autoconf)
  66.413 -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
  66.414 -AM_MISSING_PROG(AUTOHEADER, autoheader)
  66.415 -AM_MISSING_PROG(MAKEINFO, makeinfo)
  66.416 -AM_PROG_INSTALL_SH
  66.417 -AM_PROG_INSTALL_STRIP
  66.418 -AC_REQUIRE([AM_PROG_MKDIR_P])dnl
  66.419 -# We need awk for the "check" target.  The system "awk" is bad on
  66.420 -# some platforms.
  66.421 -AC_REQUIRE([AC_PROG_AWK])dnl
  66.422 -AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  66.423 -AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  66.424 -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
  66.425 -              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
  66.426 -	      		     [_AM_PROG_TAR([v7])])])
  66.427 -_AM_IF_OPTION([no-dependencies],,
  66.428 -[AC_PROVIDE_IFELSE([AC_PROG_CC],
  66.429 -                  [_AM_DEPENDENCIES(CC)],
  66.430 -                  [define([AC_PROG_CC],
  66.431 -                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
  66.432 -AC_PROVIDE_IFELSE([AC_PROG_CXX],
  66.433 -                  [_AM_DEPENDENCIES(CXX)],
  66.434 -                  [define([AC_PROG_CXX],
  66.435 -                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
  66.436 -])
  66.437 -])
  66.438 -
  66.439 -
  66.440 -# When config.status generates a header, we must update the stamp-h file.
  66.441 -# This file resides in the same directory as the config header
  66.442 -# that is generated.  The stamp files are numbered to have different names.
  66.443 -
  66.444 -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
  66.445 -# loop where config.status creates the headers, so we can generate
  66.446 -# our stamp files there.
  66.447 -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
  66.448 -[# Compute $1's index in $config_headers.
  66.449 -_am_stamp_count=1
  66.450 -for _am_header in $config_headers :; do
  66.451 -  case $_am_header in
  66.452 -    $1 | $1:* )
  66.453 -      break ;;
  66.454 -    * )
  66.455 -      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  66.456 -  esac
  66.457 -done
  66.458 -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
  66.459 -
  66.460 -# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
  66.461 -#
  66.462 -# This file is free software; the Free Software Foundation
  66.463 -# gives unlimited permission to copy and/or distribute it,
  66.464 -# with or without modifications, as long as this notice is preserved.
  66.465 -
  66.466 -# AM_PROG_INSTALL_SH
  66.467 -# ------------------
  66.468 -# Define $install_sh.
  66.469 -AC_DEFUN([AM_PROG_INSTALL_SH],
  66.470 -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  66.471 -install_sh=${install_sh-"$am_aux_dir/install-sh"}
  66.472 -AC_SUBST(install_sh)])
  66.473 -
  66.474 -# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
  66.475 -#
  66.476 -# This file is free software; the Free Software Foundation
  66.477 -# gives unlimited permission to copy and/or distribute it,
  66.478 -# with or without modifications, as long as this notice is preserved.
  66.479 -
  66.480 -# serial 2
  66.481 -
  66.482 -# Check whether the underlying file-system supports filenames
  66.483 -# with a leading dot.  For instance MS-DOS doesn't.
  66.484 -AC_DEFUN([AM_SET_LEADING_DOT],
  66.485 -[rm -rf .tst 2>/dev/null
  66.486 -mkdir .tst 2>/dev/null
  66.487 -if test -d .tst; then
  66.488 -  am__leading_dot=.
  66.489 -else
  66.490 -  am__leading_dot=_
  66.491 -fi
  66.492 -rmdir .tst 2>/dev/null
  66.493 -AC_SUBST([am__leading_dot])])
  66.494 -
  66.495 -# Check to see how 'make' treats includes.	            -*- Autoconf -*-
  66.496 -
  66.497 -# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
  66.498 -#
  66.499 -# This file is free software; the Free Software Foundation
  66.500 -# gives unlimited permission to copy and/or distribute it,
  66.501 -# with or without modifications, as long as this notice is preserved.
  66.502 -
  66.503 -# serial 3
  66.504 -
  66.505 -# AM_MAKE_INCLUDE()
  66.506 -# -----------------
  66.507 -# Check to see how make treats includes.
  66.508 -AC_DEFUN([AM_MAKE_INCLUDE],
  66.509 -[am_make=${MAKE-make}
  66.510 -cat > confinc << 'END'
  66.511 -am__doit:
  66.512 -	@echo done
  66.513 -.PHONY: am__doit
  66.514 -END
  66.515 -# If we don't find an include directive, just comment out the code.
  66.516 -AC_MSG_CHECKING([for style of include used by $am_make])
  66.517 -am__include="#"
  66.518 -am__quote=
  66.519 -_am_result=none
  66.520 -# First try GNU make style include.
  66.521 -echo "include confinc" > confmf
  66.522 -# We grep out `Entering directory' and `Leaving directory'
  66.523 -# messages which can occur if `w' ends up in MAKEFLAGS.
  66.524 -# In particular we don't look at `^make:' because GNU make might
  66.525 -# be invoked under some other name (usually "gmake"), in which
  66.526 -# case it prints its new name instead of `make'.
  66.527 -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
  66.528 -   am__include=include
  66.529 -   am__quote=
  66.530 -   _am_result=GNU
  66.531 -fi
  66.532 -# Now try BSD make style include.
  66.533 -if test "$am__include" = "#"; then
  66.534 -   echo '.include "confinc"' > confmf
  66.535 -   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
  66.536 -      am__include=.include
  66.537 -      am__quote="\""
  66.538 -      _am_result=BSD
  66.539 -   fi
  66.540 -fi
  66.541 -AC_SUBST([am__include])
  66.542 -AC_SUBST([am__quote])
  66.543 -AC_MSG_RESULT([$_am_result])
  66.544 -rm -f confinc confmf
  66.545 -])
  66.546 -
  66.547 -# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
  66.548 -
  66.549 -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
  66.550 -# Free Software Foundation, Inc.
  66.551 -#
  66.552 -# This file is free software; the Free Software Foundation
  66.553 -# gives unlimited permission to copy and/or distribute it,
  66.554 -# with or without modifications, as long as this notice is preserved.
  66.555 -
  66.556 -# serial 4
  66.557 -
  66.558 -# AM_MISSING_PROG(NAME, PROGRAM)
  66.559 -# ------------------------------
  66.560 -AC_DEFUN([AM_MISSING_PROG],
  66.561 -[AC_REQUIRE([AM_MISSING_HAS_RUN])
  66.562 -$1=${$1-"${am_missing_run}$2"}
  66.563 -AC_SUBST($1)])
  66.564 -
  66.565 -
  66.566 -# AM_MISSING_HAS_RUN
  66.567 -# ------------------
  66.568 -# Define MISSING if not defined so far and test if it supports --run.
  66.569 -# If it does, set am_missing_run to use it, otherwise, to nothing.
  66.570 -AC_DEFUN([AM_MISSING_HAS_RUN],
  66.571 -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  66.572 -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
  66.573 -# Use eval to expand $SHELL
  66.574 -if eval "$MISSING --run true"; then
  66.575 -  am_missing_run="$MISSING --run "
  66.576 -else
  66.577 -  am_missing_run=
  66.578 -  AC_MSG_WARN([`missing' script is too old or missing])
  66.579 -fi
  66.580 -])
  66.581 -
  66.582 -# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
  66.583 -#
  66.584 -# This file is free software; the Free Software Foundation
  66.585 -# gives unlimited permission to copy and/or distribute it,
  66.586 -# with or without modifications, as long as this notice is preserved.
  66.587 -
  66.588 -# AM_PROG_MKDIR_P
  66.589 -# ---------------
  66.590 -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
  66.591 -#
  66.592 -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
  66.593 -# created by `make install' are always world readable, even if the
  66.594 -# installer happens to have an overly restrictive umask (e.g. 077).
  66.595 -# This was a mistake.  There are at least two reasons why we must not
  66.596 -# use `-m 0755':
  66.597 -#   - it causes special bits like SGID to be ignored,
  66.598 -#   - it may be too restrictive (some setups expect 775 directories).
  66.599 -#
  66.600 -# Do not use -m 0755 and let people choose whatever they expect by
  66.601 -# setting umask.
  66.602 -#
  66.603 -# We cannot accept any implementation of `mkdir' that recognizes `-p'.
  66.604 -# Some implementations (such as Solaris 8's) are not thread-safe: if a
  66.605 -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
  66.606 -# concurrently, both version can detect that a/ is missing, but only
  66.607 -# one can create it and the other will error out.  Consequently we
  66.608 -# restrict ourselves to GNU make (using the --version option ensures
  66.609 -# this.)
  66.610 -AC_DEFUN([AM_PROG_MKDIR_P],
  66.611 -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
  66.612 -  # We used to keeping the `.' as first argument, in order to
  66.613 -  # allow $(mkdir_p) to be used without argument.  As in
  66.614 -  #   $(mkdir_p) $(somedir)
  66.615 -  # where $(somedir) is conditionally defined.  However this is wrong
  66.616 -  # for two reasons:
  66.617 -  #  1. if the package is installed by a user who cannot write `.'
  66.618 -  #     make install will fail,
  66.619 -  #  2. the above comment should most certainly read
  66.620 -  #     $(mkdir_p) $(DESTDIR)$(somedir)
  66.621 -  #     so it does not work when $(somedir) is undefined and
  66.622 -  #     $(DESTDIR) is not.
  66.623 -  #  To support the latter case, we have to write
  66.624 -  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
  66.625 -  #  so the `.' trick is pointless.
  66.626 -  mkdir_p='mkdir -p --'
  66.627 -else
  66.628 -  # On NextStep and OpenStep, the `mkdir' command does not
  66.629 -  # recognize any option.  It will interpret all options as
  66.630 -  # directories to create, and then abort because `.' already
  66.631 -  # exists.
  66.632 -  for d in ./-p ./--version;
  66.633 -  do
  66.634 -    test -d $d && rmdir $d
  66.635 -  done
  66.636 -  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
  66.637 -  if test -f "$ac_aux_dir/mkinstalldirs"; then
  66.638 -    mkdir_p='$(mkinstalldirs)'
  66.639 -  else
  66.640 -    mkdir_p='$(install_sh) -d'
  66.641 -  fi
  66.642 -fi
  66.643 -AC_SUBST([mkdir_p])])
  66.644 -
  66.645 -# Helper functions for option handling.                     -*- Autoconf -*-
  66.646 -
  66.647 -# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
  66.648 -#
  66.649 -# This file is free software; the Free Software Foundation
  66.650 -# gives unlimited permission to copy and/or distribute it,
  66.651 -# with or without modifications, as long as this notice is preserved.
  66.652 -
  66.653 -# serial 3
  66.654 -
  66.655 -# _AM_MANGLE_OPTION(NAME)
  66.656 -# -----------------------
  66.657 -AC_DEFUN([_AM_MANGLE_OPTION],
  66.658 -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
  66.659 -
  66.660 -# _AM_SET_OPTION(NAME)
  66.661 -# ------------------------------
  66.662 -# Set option NAME.  Presently that only means defining a flag for this option.
  66.663 -AC_DEFUN([_AM_SET_OPTION],
  66.664 -[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
  66.665 -
  66.666 -# _AM_SET_OPTIONS(OPTIONS)
  66.667 -# ----------------------------------
  66.668 -# OPTIONS is a space-separated list of Automake options.
  66.669 -AC_DEFUN([_AM_SET_OPTIONS],
  66.670 -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
  66.671 -
  66.672 -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
  66.673 -# -------------------------------------------
  66.674 -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  66.675 -AC_DEFUN([_AM_IF_OPTION],
  66.676 -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
  66.677 -
  66.678 -# Check to make sure that the build environment is sane.    -*- Autoconf -*-
  66.679 -
  66.680 -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
  66.681 -# Free Software Foundation, Inc.
  66.682 -#
  66.683 -# This file is free software; the Free Software Foundation
  66.684 -# gives unlimited permission to copy and/or distribute it,
  66.685 -# with or without modifications, as long as this notice is preserved.
  66.686 -
  66.687 -# serial 4
  66.688 -
  66.689 -# AM_SANITY_CHECK
  66.690 -# ---------------
  66.691 -AC_DEFUN([AM_SANITY_CHECK],
  66.692 -[AC_MSG_CHECKING([whether build environment is sane])
  66.693 -# Just in case
  66.694 -sleep 1
  66.695 -echo timestamp > conftest.file
  66.696 -# Do `set' in a subshell so we don't clobber the current shell's
  66.697 -# arguments.  Must try -L first in case configure is actually a
  66.698 -# symlink; some systems play weird games with the mod time of symlinks
  66.699 -# (eg FreeBSD returns the mod time of the symlink's containing
  66.700 -# directory).
  66.701 -if (
  66.702 -   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
  66.703 -   if test "$[*]" = "X"; then
  66.704 -      # -L didn't work.
  66.705 -      set X `ls -t $srcdir/configure conftest.file`
  66.706 -   fi
  66.707 -   rm -f conftest.file
  66.708 -   if test "$[*]" != "X $srcdir/configure conftest.file" \
  66.709 -      && test "$[*]" != "X conftest.file $srcdir/configure"; then
  66.710 -
  66.711 -      # If neither matched, then we have a broken ls.  This can happen
  66.712 -      # if, for instance, CONFIG_SHELL is bash and it inherits a
  66.713 -      # broken ls alias from the environment.  This has actually
  66.714 -      # happened.  Such a system could not be considered "sane".
  66.715 -      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
  66.716 -alias in your environment])
  66.717 -   fi
  66.718 -
  66.719 -   test "$[2]" = conftest.file
  66.720 -   )
  66.721 -then
  66.722 -   # Ok.
  66.723 -   :
  66.724 -else
  66.725 -   AC_MSG_ERROR([newly created file is older than distributed files!
  66.726 -Check your system clock])
  66.727 -fi
  66.728 -AC_MSG_RESULT(yes)])
  66.729 -
  66.730 -# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
  66.731 -#
  66.732 -# This file is free software; the Free Software Foundation
  66.733 -# gives unlimited permission to copy and/or distribute it,
  66.734 -# with or without modifications, as long as this notice is preserved.
  66.735 -
  66.736 -# AM_PROG_INSTALL_STRIP
  66.737 -# ---------------------
  66.738 -# One issue with vendor `install' (even GNU) is that you can't
  66.739 -# specify the program used to strip binaries.  This is especially
  66.740 -# annoying in cross-compiling environments, where the build's strip
  66.741 -# is unlikely to handle the host's binaries.
  66.742 -# Fortunately install-sh will honor a STRIPPROG variable, so we
  66.743 -# always use install-sh in `make install-strip', and initialize
  66.744 -# STRIPPROG with the value of the STRIP variable (set by the user).
  66.745 -AC_DEFUN([AM_PROG_INSTALL_STRIP],
  66.746 -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  66.747 -# Installed binaries are usually stripped using `strip' when the user
  66.748 -# run `make install-strip'.  However `strip' might not be the right
  66.749 -# tool to use in cross-compilation environments, therefore Automake
  66.750 -# will honor the `STRIP' environment variable to overrule this program.
  66.751 -dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
  66.752 -if test "$cross_compiling" != no; then
  66.753 -  AC_CHECK_TOOL([STRIP], [strip], :)
  66.754 -fi
  66.755 -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
  66.756 -AC_SUBST([INSTALL_STRIP_PROGRAM])])
  66.757 -
  66.758 -# Check how to create a tarball.                            -*- Autoconf -*-
  66.759 -
  66.760 -# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
  66.761 -#
  66.762 -# This file is free software; the Free Software Foundation
  66.763 -# gives unlimited permission to copy and/or distribute it,
  66.764 -# with or without modifications, as long as this notice is preserved.
  66.765 -
  66.766 -# serial 2
  66.767 -
  66.768 -# _AM_PROG_TAR(FORMAT)
  66.769 -# --------------------
  66.770 -# Check how to create a tarball in format FORMAT.
  66.771 -# FORMAT should be one of `v7', `ustar', or `pax'.
  66.772 -#
  66.773 -# Substitute a variable $(am__tar) that is a command
  66.774 -# writing to stdout a FORMAT-tarball containing the directory
  66.775 -# $tardir.
  66.776 -#     tardir=directory && $(am__tar) > result.tar
  66.777 -#
  66.778 -# Substitute a variable $(am__untar) that extract such
  66.779 -# a tarball read from stdin.
  66.780 -#     $(am__untar) < result.tar
  66.781 -AC_DEFUN([_AM_PROG_TAR],
  66.782 -[# Always define AMTAR for backward compatibility.
  66.783 -AM_MISSING_PROG([AMTAR], [tar])
  66.784 -m4_if([$1], [v7],
  66.785 -     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
  66.786 -     [m4_case([$1], [ustar],, [pax],,
  66.787 -              [m4_fatal([Unknown tar format])])
  66.788 -AC_MSG_CHECKING([how to create a $1 tar archive])
  66.789 -# Loop over all known methods to create a tar archive until one works.
  66.790 -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
  66.791 -_am_tools=${am_cv_prog_tar_$1-$_am_tools}
  66.792 -# Do not fold the above two line into one, because Tru64 sh and
  66.793 -# Solaris sh will not grok spaces in the rhs of `-'.
  66.794 -for _am_tool in $_am_tools
  66.795 -do
  66.796 -  case $_am_tool in
  66.797 -  gnutar)
  66.798 -    for _am_tar in tar gnutar gtar;
  66.799 -    do
  66.800 -      AM_RUN_LOG([$_am_tar --version]) && break
  66.801 -    done
  66.802 -    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
  66.803 -    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
  66.804 -    am__untar="$_am_tar -xf -"
  66.805 -    ;;
  66.806 -  plaintar)
  66.807 -    # Must skip GNU tar: if it does not support --format= it doesn't create
  66.808 -    # ustar tarball either.
  66.809 -    (tar --version) >/dev/null 2>&1 && continue
  66.810 -    am__tar='tar chf - "$$tardir"'
  66.811 -    am__tar_='tar chf - "$tardir"'
  66.812 -    am__untar='tar xf -'
  66.813 -    ;;
  66.814 -  pax)
  66.815 -    am__tar='pax -L -x $1 -w "$$tardir"'
  66.816 -    am__tar_='pax -L -x $1 -w "$tardir"'
  66.817 -    am__untar='pax -r'
  66.818 -    ;;
  66.819 -  cpio)
  66.820 -    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
  66.821 -    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
  66.822 -    am__untar='cpio -i -H $1 -d'
  66.823 -    ;;
  66.824 -  none)
  66.825 -    am__tar=false
  66.826 -    am__tar_=false
  66.827 -    am__untar=false
  66.828 -    ;;
  66.829 -  esac
  66.830 -
  66.831 -  # If the value was cached, stop now.  We just wanted to have am__tar
  66.832 -  # and am__untar set.
  66.833 -  test -n "${am_cv_prog_tar_$1}" && break
  66.834 -
  66.835 -  # tar/untar a dummy directory, and stop if the command works
  66.836 -  rm -rf conftest.dir
  66.837 -  mkdir conftest.dir
  66.838 -  echo GrepMe > conftest.dir/file
  66.839 -  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
  66.840 -  rm -rf conftest.dir
  66.841 -  if test -s conftest.tar; then
  66.842 -    AM_RUN_LOG([$am__untar <conftest.tar])
  66.843 -    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
  66.844 -  fi
  66.845 -done
  66.846 -rm -rf conftest.dir
  66.847 -
  66.848 -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
  66.849 -AC_MSG_RESULT([$am_cv_prog_tar_$1])])
  66.850 -AC_SUBST([am__tar])
  66.851 -AC_SUBST([am__untar])
  66.852 -]) # _AM_PROG_TAR
  66.853 -
    67.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.2 +++ b/tools/xm-test/autogen	Thu Nov 10 08:34:09 2005 -0600
    67.3 @@ -0,0 +1,9 @@
    67.4 +#! /bin/sh -ex
    67.5 +
    67.6 +# if libtool is ever added, turn this on
    67.7 +# libtoolize --copy --force --automake
    67.8 +aclocal
    67.9 +automake --add-missing --copy --foreign
   67.10 +autoconf
   67.11 +chmod a+x runtest.sh
   67.12 +
    68.1 --- a/tools/xm-test/configure	Thu Nov 10 08:18:25 2005 -0600
    68.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.3 @@ -1,4364 +0,0 @@
    68.4 -#! /bin/sh
    68.5 -# Guess values for system-dependent variables and create Makefiles.
    68.6 -# Generated by GNU Autoconf 2.59 for xm-test 0.4.0.
    68.7 -#
    68.8 -# Copyright (C) 2003 Free Software Foundation, Inc.
    68.9 -# This configure script is free software; the Free Software Foundation
   68.10 -# gives unlimited permission to copy, distribute and modify it.
   68.11 -## --------------------- ##
   68.12 -## M4sh Initialization.  ##
   68.13 -## --------------------- ##
   68.14 -
   68.15 -# Be Bourne compatible
   68.16 -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   68.17 -  emulate sh
   68.18 -  NULLCMD=:
   68.19 -  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   68.20 -  # is contrary to our usage.  Disable this feature.
   68.21 -  alias -g '${1+"$@"}'='"$@"'
   68.22 -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   68.23 -  set -o posix
   68.24 -fi
   68.25 -DUALCASE=1; export DUALCASE # for MKS sh
   68.26 -
   68.27 -# Support unset when possible.
   68.28 -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   68.29 -  as_unset=unset
   68.30 -else
   68.31 -  as_unset=false
   68.32 -fi
   68.33 -
   68.34 -
   68.35 -# Work around bugs in pre-3.0 UWIN ksh.
   68.36 -$as_unset ENV MAIL MAILPATH
   68.37 -PS1='$ '
   68.38 -PS2='> '
   68.39 -PS4='+ '
   68.40 -
   68.41 -# NLS nuisances.
   68.42 -for as_var in \
   68.43 -  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
   68.44 -  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
   68.45 -  LC_TELEPHONE LC_TIME
   68.46 -do
   68.47 -  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
   68.48 -    eval $as_var=C; export $as_var
   68.49 -  else
   68.50 -    $as_unset $as_var
   68.51 -  fi
   68.52 -done
   68.53 -
   68.54 -# Required to use basename.
   68.55 -if expr a : '\(a\)' >/dev/null 2>&1; then
   68.56 -  as_expr=expr
   68.57 -else
   68.58 -  as_expr=false
   68.59 -fi
   68.60 -
   68.61 -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
   68.62 -  as_basename=basename
   68.63 -else
   68.64 -  as_basename=false
   68.65 -fi
   68.66 -
   68.67 -
   68.68 -# Name of the executable.
   68.69 -as_me=`$as_basename "$0" ||
   68.70 -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
   68.71 -	 X"$0" : 'X\(//\)$' \| \
   68.72 -	 X"$0" : 'X\(/\)$' \| \
   68.73 -	 .     : '\(.\)' 2>/dev/null ||
   68.74 -echo X/"$0" |
   68.75 -    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
   68.76 -  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
   68.77 -  	  /^X\/\(\/\).*/{ s//\1/; q; }
   68.78 -  	  s/.*/./; q'`
   68.79 -
   68.80 -
   68.81 -# PATH needs CR, and LINENO needs CR and PATH.
   68.82 -# Avoid depending upon Character Ranges.
   68.83 -as_cr_letters='abcdefghijklmnopqrstuvwxyz'
   68.84 -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
   68.85 -as_cr_Letters=$as_cr_letters$as_cr_LETTERS
   68.86 -as_cr_digits='0123456789'
   68.87 -as_cr_alnum=$as_cr_Letters$as_cr_digits
   68.88 -
   68.89 -# The user is always right.
   68.90 -if test "${PATH_SEPARATOR+set}" != set; then
   68.91 -  echo "#! /bin/sh" >conf$$.sh
   68.92 -  echo  "exit 0"   >>conf$$.sh
   68.93 -  chmod +x conf$$.sh
   68.94 -  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
   68.95 -    PATH_SEPARATOR=';'
   68.96 -  else
   68.97 -    PATH_SEPARATOR=:
   68.98 -  fi
   68.99 -  rm -f conf$$.sh
  68.100 -fi
  68.101 -
  68.102 -
  68.103 -  as_lineno_1=$LINENO
  68.104 -  as_lineno_2=$LINENO
  68.105 -  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  68.106 -  test "x$as_lineno_1" != "x$as_lineno_2" &&
  68.107 -  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
  68.108 -  # Find who we are.  Look in the path if we contain no path at all
  68.109 -  # relative or not.
  68.110 -  case $0 in
  68.111 -    *[\\/]* ) as_myself=$0 ;;
  68.112 -    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  68.113 -for as_dir in $PATH
  68.114 -do
  68.115 -  IFS=$as_save_IFS
  68.116 -  test -z "$as_dir" && as_dir=.
  68.117 -  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
  68.118 -done
  68.119 -
  68.120 -       ;;
  68.121 -  esac
  68.122 -  # We did not find ourselves, most probably we were run as `sh COMMAND'
  68.123 -  # in which case we are not to be found in the path.
  68.124 -  if test "x$as_myself" = x; then
  68.125 -    as_myself=$0
  68.126 -  fi
  68.127 -  if test ! -f "$as_myself"; then
  68.128 -    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
  68.129 -   { (exit 1); exit 1; }; }
  68.130 -  fi
  68.131 -  case $CONFIG_SHELL in
  68.132 -  '')
  68.133 -    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  68.134 -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
  68.135 -do
  68.136 -  IFS=$as_save_IFS
  68.137 -  test -z "$as_dir" && as_dir=.
  68.138 -  for as_base in sh bash ksh sh5; do
  68.139 -	 case $as_dir in
  68.140 -	 /*)
  68.141 -	   if ("$as_dir/$as_base" -c '
  68.142 -  as_lineno_1=$LINENO
  68.143 -  as_lineno_2=$LINENO
  68.144 -  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  68.145 -  test "x$as_lineno_1" != "x$as_lineno_2" &&
  68.146 -  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
  68.147 -	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
  68.148 -	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
  68.149 -	     CONFIG_SHELL=$as_dir/$as_base
  68.150 -	     export CONFIG_SHELL
  68.151 -	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
  68.152 -	   fi;;
  68.153 -	 esac
  68.154 -       done
  68.155 -done
  68.156 -;;
  68.157 -  esac
  68.158 -
  68.159 -  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
  68.160 -  # uniformly replaced by the line number.  The first 'sed' inserts a
  68.161 -  # line-number line before each line; the second 'sed' does the real
  68.162 -  # work.  The second script uses 'N' to pair each line-number line
  68.163 -  # with the numbered line, and appends trailing '-' during
  68.164 -  # substitution so that $LINENO is not a special case at line end.
  68.165 -  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
  68.166 -  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
  68.167 -  sed '=' <$as_myself |
  68.168 -    sed '
  68.169 -      N
  68.170 -      s,$,-,
  68.171 -      : loop
  68.172 -      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
  68.173 -      t loop
  68.174 -      s,-$,,
  68.175 -      s,^['$as_cr_digits']*\n,,
  68.176 -    ' >$as_me.lineno &&
  68.177 -  chmod +x $as_me.lineno ||
  68.178 -    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
  68.179 -   { (exit 1); exit 1; }; }
  68.180 -
  68.181 -  # Don't try to exec as it changes $[0], causing all sort of problems
  68.182 -  # (the dirname of $[0] is not the place where we might find the
  68.183 -  # original and so on.  Autoconf is especially sensible to this).
  68.184 -  . ./$as_me.lineno
  68.185 -  # Exit status is that of the last command.
  68.186 -  exit
  68.187 -}
  68.188 -
  68.189 -
  68.190 -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  68.191 -  *c*,-n*) ECHO_N= ECHO_C='
  68.192 -' ECHO_T='	' ;;
  68.193 -  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
  68.194 -  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
  68.195 -esac
  68.196 -
  68.197 -if expr a : '\(a\)' >/dev/null 2>&1; then
  68.198 -  as_expr=expr
  68.199 -else
  68.200 -  as_expr=false
  68.201 -fi
  68.202 -
  68.203 -rm -f conf$$ conf$$.exe conf$$.file
  68.204 -echo >conf$$.file
  68.205 -if ln -s conf$$.file conf$$ 2>/dev/null; then
  68.206 -  # We could just check for DJGPP; but this test a) works b) is more generic
  68.207 -  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
  68.208 -  if test -f conf$$.exe; then
  68.209 -    # Don't use ln at all; we don't have any links
  68.210 -    as_ln_s='cp -p'
  68.211 -  else
  68.212 -    as_ln_s='ln -s'
  68.213 -  fi
  68.214 -elif ln conf$$.file conf$$ 2>/dev/null; then
  68.215 -  as_ln_s=ln
  68.216 -else
  68.217 -  as_ln_s='cp -p'
  68.218 -fi
  68.219 -rm -f conf$$ conf$$.exe conf$$.file
  68.220 -
  68.221 -if mkdir -p . 2>/dev/null; then
  68.222 -  as_mkdir_p=:
  68.223 -else
  68.224 -  test -d ./-p && rmdir ./-p
  68.225 -  as_mkdir_p=false
  68.226 -fi
  68.227 -
  68.228 -as_executable_p="test -f"
  68.229 -
  68.230 -# Sed expression to map a string onto a valid CPP name.
  68.231 -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
  68.232 -
  68.233 -# Sed expression to map a string onto a valid variable name.
  68.234 -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
  68.235 -
  68.236 -
  68.237 -# IFS
  68.238 -# We need space, tab and new line, in precisely that order.
  68.239 -as_nl='
  68.240 -'
  68.241 -IFS=" 	$as_nl"
  68.242 -
  68.243 -# CDPATH.
  68.244 -$as_unset CDPATH
  68.245 -
  68.246 -
  68.247 -# Name of the host.
  68.248 -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
  68.249 -# so uname gets run too.
  68.250 -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
  68.251 -
  68.252 -exec 6>&1
  68.253 -
  68.254 -#
  68.255 -# Initializations.
  68.256 -#
  68.257 -ac_default_prefix=/usr/local
  68.258 -ac_config_libobj_dir=.
  68.259 -cross_compiling=no
  68.260 -subdirs=
  68.261 -MFLAGS=
  68.262 -MAKEFLAGS=
  68.263 -SHELL=${CONFIG_SHELL-/bin/sh}
  68.264 -
  68.265 -# Maximum number of lines to put in a shell here document.
  68.266 -# This variable seems obsolete.  It should probably be removed, and
  68.267 -# only ac_max_sed_lines should be used.
  68.268 -: ${ac_max_here_lines=38}
  68.269 -
  68.270 -# Identity of this package.
  68.271 -PACKAGE_NAME='xm-test'
  68.272 -PACKAGE_TARNAME='xm-test'
  68.273 -PACKAGE_VERSION='0.4.0'
  68.274 -PACKAGE_STRING='xm-test 0.4.0'
  68.275 -PACKAGE_BUGREPORT=''
  68.276 -
  68.277 -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE ENABLE_VMX TENV YACC LEX LEXLIB LEX_OUTPUT_ROOT LIBOBJS LTLIBOBJS'
  68.278 -ac_subst_files=''
  68.279 -
  68.280 -# Initialize some variables set by options.
  68.281 -ac_init_help=
  68.282 -ac_init_version=false
  68.283 -# The variables have the same names as the options, with
  68.284 -# dashes changed to underlines.
  68.285 -cache_file=/dev/null
  68.286 -exec_prefix=NONE
  68.287 -no_create=
  68.288 -no_recursion=
  68.289 -prefix=NONE
  68.290 -program_prefix=NONE
  68.291 -program_suffix=NONE
  68.292 -program_transform_name=s,x,x,
  68.293 -silent=
  68.294 -site=
  68.295 -srcdir=
  68.296 -verbose=
  68.297 -x_includes=NONE
  68.298 -x_libraries=NONE
  68.299 -
  68.300 -# Installation directory options.
  68.301 -# These are left unexpanded so users can "make install exec_prefix=/foo"
  68.302 -# and all the variables that are supposed to be based on exec_prefix
  68.303 -# by default will actually change.
  68.304 -# Use braces instead of parens because sh, perl, etc. also accept them.
  68.305 -bindir='${exec_prefix}/bin'
  68.306 -sbindir='${exec_prefix}/sbin'
  68.307 -libexecdir='${exec_prefix}/libexec'
  68.308 -datadir='${prefix}/share'
  68.309 -sysconfdir='${prefix}/etc'
  68.310 -sharedstatedir='${prefix}/com'
  68.311 -localstatedir='${prefix}/var'
  68.312 -libdir='${exec_prefix}/lib'
  68.313 -includedir='${prefix}/include'
  68.314 -oldincludedir='/usr/include'
  68.315 -infodir='${prefix}/info'
  68.316 -mandir='${prefix}/man'
  68.317 -
  68.318 -ac_prev=
  68.319 -for ac_option
  68.320 -do
  68.321 -  # If the previous option needs an argument, assign it.
  68.322 -  if test -n "$ac_prev"; then
  68.323 -    eval "$ac_prev=\$ac_option"
  68.324 -    ac_prev=
  68.325 -    continue
  68.326 -  fi
  68.327 -
  68.328 -  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
  68.329 -
  68.330 -  # Accept the important Cygnus configure options, so we can diagnose typos.
  68.331 -
  68.332 -  case $ac_option in
  68.333 -
  68.334 -  -bindir | --bindir | --bindi | --bind | --bin | --bi)
  68.335 -    ac_prev=bindir ;;
  68.336 -  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
  68.337 -    bindir=$ac_optarg ;;
  68.338 -
  68.339 -  -build | --build | --buil | --bui | --bu)
  68.340 -    ac_prev=build_alias ;;
  68.341 -  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
  68.342 -    build_alias=$ac_optarg ;;
  68.343 -
  68.344 -  -cache-file | --cache-file | --cache-fil | --cache-fi \
  68.345 -  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
  68.346 -    ac_prev=cache_file ;;
  68.347 -  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  68.348 -  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
  68.349 -    cache_file=$ac_optarg ;;
  68.350 -
  68.351 -  --config-cache | -C)
  68.352 -    cache_file=config.cache ;;
  68.353 -
  68.354 -  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
  68.355 -    ac_prev=datadir ;;
  68.356 -  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
  68.357 -  | --da=*)
  68.358 -    datadir=$ac_optarg ;;
  68.359 -
  68.360 -  -disable-* | --disable-*)
  68.361 -    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
  68.362 -    # Reject names that are not valid shell variable names.
  68.363 -    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
  68.364 -      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
  68.365 -   { (exit 1); exit 1; }; }
  68.366 -    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
  68.367 -    eval "enable_$ac_feature=no" ;;
  68.368 -
  68.369 -  -enable-* | --enable-*)
  68.370 -    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
  68.371 -    # Reject names that are not valid shell variable names.
  68.372 -    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
  68.373 -      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
  68.374 -   { (exit 1); exit 1; }; }
  68.375 -    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
  68.376 -    case $ac_option in
  68.377 -      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
  68.378 -      *) ac_optarg=yes ;;
  68.379 -    esac
  68.380 -    eval "enable_$ac_feature='$ac_optarg'" ;;
  68.381 -
  68.382 -  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  68.383 -  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  68.384 -  | --exec | --exe | --ex)
  68.385 -    ac_prev=exec_prefix ;;
  68.386 -  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  68.387 -  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  68.388 -  | --exec=* | --exe=* | --ex=*)
  68.389 -    exec_prefix=$ac_optarg ;;
  68.390 -
  68.391 -  -gas | --gas | --ga | --g)
  68.392 -    # Obsolete; use --with-gas.
  68.393 -    with_gas=yes ;;
  68.394 -
  68.395 -  -help | --help | --hel | --he | -h)
  68.396 -    ac_init_help=long ;;
  68.397 -  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
  68.398 -    ac_init_help=recursive ;;
  68.399 -  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
  68.400 -    ac_init_help=short ;;
  68.401 -
  68.402 -  -host | --host | --hos | --ho)
  68.403 -    ac_prev=host_alias ;;
  68.404 -  -host=* | --host=* | --hos=* | --ho=*)
  68.405 -    host_alias=$ac_optarg ;;
  68.406 -
  68.407 -  -includedir | --includedir | --includedi | --included | --include \
  68.408 -  | --includ | --inclu | --incl | --inc)
  68.409 -    ac_prev=includedir ;;
  68.410 -  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  68.411 -  | --includ=* | --inclu=* | --incl=* | --inc=*)
  68.412 -    includedir=$ac_optarg ;;
  68.413 -
  68.414 -  -infodir | --infodir | --infodi | --infod | --info | --inf)
  68.415 -    ac_prev=infodir ;;
  68.416 -  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
  68.417 -    infodir=$ac_optarg ;;
  68.418 -
  68.419 -  -libdir | --libdir | --libdi | --libd)
  68.420 -    ac_prev=libdir ;;
  68.421 -  -libdir=* | --libdir=* | --libdi=* | --libd=*)
  68.422 -    libdir=$ac_optarg ;;
  68.423 -
  68.424 -  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  68.425 -  | --libexe | --libex | --libe)
  68.426 -    ac_prev=libexecdir ;;
  68.427 -  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  68.428 -  | --libexe=* | --libex=* | --libe=*)
  68.429 -    libexecdir=$ac_optarg ;;
  68.430 -
  68.431 -  -localstatedir | --localstatedir | --localstatedi | --localstated \
  68.432 -  | --localstate | --localstat | --localsta | --localst \
  68.433 -  | --locals | --local | --loca | --loc | --lo)
  68.434 -    ac_prev=localstatedir ;;
  68.435 -  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  68.436 -  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
  68.437 -  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
  68.438 -    localstatedir=$ac_optarg ;;
  68.439 -
  68.440 -  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
  68.441 -    ac_prev=mandir ;;
  68.442 -  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
  68.443 -    mandir=$ac_optarg ;;
  68.444 -
  68.445 -  -nfp | --nfp | --nf)
  68.446 -    # Obsolete; use --without-fp.
  68.447 -    with_fp=no ;;
  68.448 -
  68.449 -  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  68.450 -  | --no-cr | --no-c | -n)
  68.451 -    no_create=yes ;;
  68.452 -
  68.453 -  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  68.454 -  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
  68.455 -    no_recursion=yes ;;
  68.456 -
  68.457 -  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  68.458 -  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  68.459 -  | --oldin | --oldi | --old | --ol | --o)
  68.460 -    ac_prev=oldincludedir ;;
  68.461 -  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  68.462 -  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  68.463 -  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
  68.464 -    oldincludedir=$ac_optarg ;;
  68.465 -
  68.466 -  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  68.467 -    ac_prev=prefix ;;
  68.468 -  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  68.469 -    prefix=$ac_optarg ;;
  68.470 -
  68.471 -  -program-prefix | --program-prefix | --program-prefi | --program-pref \
  68.472 -  | --program-pre | --program-pr | --program-p)
  68.473 -    ac_prev=program_prefix ;;
  68.474 -  -program-prefix=* | --program-prefix=* | --program-prefi=* \
  68.475 -  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
  68.476 -    program_prefix=$ac_optarg ;;
  68.477 -
  68.478 -  -program-suffix | --program-suffix | --program-suffi | --program-suff \
  68.479 -  | --program-suf | --program-su | --program-s)
  68.480 -    ac_prev=program_suffix ;;
  68.481 -  -program-suffix=* | --program-suffix=* | --program-suffi=* \
  68.482 -  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
  68.483 -    program_suffix=$ac_optarg ;;
  68.484 -
  68.485 -  -program-transform-name | --program-transform-name \
  68.486 -  | --program-transform-nam | --program-transform-na \
  68.487 -  | --program-transform-n | --program-transform- \
  68.488 -  | --program-transform | --program-transfor \
  68.489 -  | --program-transfo | --program-transf \
  68.490 -  | --program-trans | --program-tran \
  68.491 -  | --progr-tra | --program-tr | --program-t)
  68.492 -    ac_prev=program_transform_name ;;
  68.493 -  -program-transform-name=* | --program-transform-name=* \
  68.494 -  | --program-transform-nam=* | --program-transform-na=* \
  68.495 -  | --program-transform-n=* | --program-transform-=* \
  68.496 -  | --program-transform=* | --program-transfor=* \
  68.497 -  | --program-transfo=* | --program-transf=* \
  68.498 -  | --program-trans=* | --program-tran=* \
  68.499 -  | --progr-tra=* | --program-tr=* | --program-t=*)
  68.500 -    program_transform_name=$ac_optarg ;;
  68.501 -
  68.502 -  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  68.503 -  | -silent | --silent | --silen | --sile | --sil)
  68.504 -    silent=yes ;;
  68.505 -
  68.506 -  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
  68.507 -    ac_prev=sbindir ;;
  68.508 -  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  68.509 -  | --sbi=* | --sb=*)
  68.510 -    sbindir=$ac_optarg ;;
  68.511 -
  68.512 -  -sharedstatedir | --sharedstatedir | --sharedstatedi \
  68.513 -  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
  68.514 -  | --sharedst | --shareds | --shared | --share | --shar \
  68.515 -  | --sha | --sh)
  68.516 -    ac_prev=sharedstatedir ;;
  68.517 -  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  68.518 -  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  68.519 -  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  68.520 -  | --sha=* | --sh=*)
  68.521 -    sharedstatedir=$ac_optarg ;;
  68.522 -
  68.523 -  -site | --site | --sit)
  68.524 -    ac_prev=site ;;
  68.525 -  -site=* | --site=* | --sit=*)
  68.526 -    site=$ac_optarg ;;
  68.527 -
  68.528 -  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  68.529 -    ac_prev=srcdir ;;
  68.530 -  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  68.531 -    srcdir=$ac_optarg ;;
  68.532 -
  68.533 -  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
  68.534 -  | --syscon | --sysco | --sysc | --sys | --sy)
  68.535 -    ac_prev=sysconfdir ;;
  68.536 -  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
  68.537 -  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
  68.538 -    sysconfdir=$ac_optarg ;;
  68.539 -
  68.540 -  -target | --target | --targe | --targ | --tar | --ta | --t)
  68.541 -    ac_prev=target_alias ;;
  68.542 -  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  68.543 -    target_alias=$ac_optarg ;;
  68.544 -
  68.545 -  -v | -verbose | --verbose | --verbos | --verbo | --verb)
  68.546 -    verbose=yes ;;
  68.547 -
  68.548 -  -version | --version | --versio | --versi | --vers | -V)
  68.549 -    ac_init_version=: ;;
  68.550 -
  68.551 -  -with-* | --with-*)
  68.552 -    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
  68.553 -    # Reject names that are not valid shell variable names.
  68.554 -    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
  68.555 -      { echo "$as_me: error: invalid package name: $ac_package" >&2
  68.556 -   { (exit 1); exit 1; }; }
  68.557 -    ac_package=`echo $ac_package| sed 's/-/_/g'`
  68.558 -    case $ac_option in
  68.559 -      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
  68.560 -      *) ac_optarg=yes ;;
  68.561 -    esac
  68.562 -    eval "with_$ac_package='$ac_optarg'" ;;
  68.563 -
  68.564 -  -without-* | --without-*)
  68.565 -    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
  68.566 -    # Reject names that are not valid shell variable names.
  68.567 -    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
  68.568 -      { echo "$as_me: error: invalid package name: $ac_package" >&2
  68.569 -   { (exit 1); exit 1; }; }
  68.570 -    ac_package=`echo $ac_package | sed 's/-/_/g'`
  68.571 -    eval "with_$ac_package=no" ;;
  68.572 -
  68.573 -  --x)
  68.574 -    # Obsolete; use --with-x.
  68.575 -    with_x=yes ;;
  68.576 -
  68.577 -  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  68.578 -  | --x-incl | --x-inc | --x-in | --x-i)
  68.579 -    ac_prev=x_includes ;;
  68.580 -  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  68.581 -  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
  68.582 -    x_includes=$ac_optarg ;;
  68.583 -
  68.584 -  -x-libraries | --x-libraries | --x-librarie | --x-librari \
  68.585 -  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
  68.586 -    ac_prev=x_libraries ;;
  68.587 -  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  68.588 -  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
  68.589 -    x_libraries=$ac_optarg ;;
  68.590 -
  68.591 -  -*) { echo "$as_me: error: unrecognized option: $ac_option
  68.592 -Try \`$0 --help' for more information." >&2
  68.593 -   { (exit 1); exit 1; }; }
  68.594 -    ;;
  68.595 -
  68.596 -  *=*)
  68.597 -    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
  68.598 -    # Reject names that are not valid shell variable names.
  68.599 -    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
  68.600 -      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
  68.601 -   { (exit 1); exit 1; }; }
  68.602 -    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
  68.603 -    eval "$ac_envvar='$ac_optarg'"
  68.604 -    export $ac_envvar ;;
  68.605 -
  68.606 -  *)
  68.607 -    # FIXME: should be removed in autoconf 3.0.
  68.608 -    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
  68.609 -    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
  68.610 -      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
  68.611 -    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
  68.612 -    ;;
  68.613 -
  68.614 -  esac
  68.615 -done
  68.616 -
  68.617 -if test -n "$ac_prev"; then
  68.618 -  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
  68.619 -  { echo "$as_me: error: missing argument to $ac_option" >&2
  68.620 -   { (exit 1); exit 1; }; }
  68.621 -fi
  68.622 -
  68.623 -# Be sure to have absolute paths.
  68.624 -for ac_var in exec_prefix prefix
  68.625 -do
  68.626 -  eval ac_val=$`echo $ac_var`
  68.627 -  case $ac_val in
  68.628 -    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
  68.629 -    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
  68.630 -   { (exit 1); exit 1; }; };;
  68.631 -  esac
  68.632 -done
  68.633 -
  68.634 -# Be sure to have absolute paths.
  68.635 -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
  68.636 -	      localstatedir libdir includedir oldincludedir infodir mandir
  68.637 -do
  68.638 -  eval ac_val=$`echo $ac_var`
  68.639 -  case $ac_val in
  68.640 -    [\\/$]* | ?:[\\/]* ) ;;
  68.641 -    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
  68.642 -   { (exit 1); exit 1; }; };;
  68.643 -  esac
  68.644 -done
  68.645 -
  68.646 -# There might be people who depend on the old broken behavior: `$host'
  68.647 -# used to hold the argument of --host etc.
  68.648 -# FIXME: To remove some day.
  68.649 -build=$build_alias
  68.650 -host=$host_alias
  68.651 -target=$target_alias
  68.652 -
  68.653 -# FIXME: To remove some day.
  68.654 -if test "x$host_alias" != x; then
  68.655 -  if test "x$build_alias" = x; then
  68.656 -    cross_compiling=maybe
  68.657 -    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
  68.658 -    If a cross compiler is detected then cross compile mode will be used." >&2
  68.659 -  elif test "x$build_alias" != "x$host_alias"; then
  68.660 -    cross_compiling=yes
  68.661 -  fi
  68.662 -fi
  68.663 -
  68.664 -ac_tool_prefix=
  68.665 -test -n "$host_alias" && ac_tool_prefix=$host_alias-
  68.666 -
  68.667 -test "$silent" = yes && exec 6>/dev/null
  68.668 -
  68.669 -
  68.670 -# Find the source files, if location was not specified.
  68.671 -if test -z "$srcdir"; then
  68.672 -  ac_srcdir_defaulted=yes
  68.673 -  # Try the directory containing this script, then its parent.
  68.674 -  ac_confdir=`(dirname "$0") 2>/dev/null ||
  68.675 -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
  68.676 -	 X"$0" : 'X\(//\)[^/]' \| \
  68.677 -	 X"$0" : 'X\(//\)$' \| \
  68.678 -	 X"$0" : 'X\(/\)' \| \
  68.679 -	 .     : '\(.\)' 2>/dev/null ||
  68.680 -echo X"$0" |
  68.681 -    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  68.682 -  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  68.683 -  	  /^X\(\/\/\)$/{ s//\1/; q; }
  68.684 -  	  /^X\(\/\).*/{ s//\1/; q; }
  68.685 -  	  s/.*/./; q'`
  68.686 -  srcdir=$ac_confdir
  68.687 -  if test ! -r $srcdir/$ac_unique_file; then
  68.688 -    srcdir=..
  68.689 -  fi
  68.690 -else
  68.691 -  ac_srcdir_defaulted=no
  68.692 -fi
  68.693 -if test ! -r $srcdir/$ac_unique_file; then
  68.694 -  if test "$ac_srcdir_defaulted" = yes; then
  68.695 -    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
  68.696 -   { (exit 1); exit 1; }; }
  68.697 -  else
  68.698 -    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
  68.699 -   { (exit 1); exit 1; }; }
  68.700 -  fi
  68.701 -fi
  68.702 -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
  68.703 -  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
  68.704 -   { (exit 1); exit 1; }; }
  68.705 -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
  68.706 -ac_env_build_alias_set=${build_alias+set}
  68.707 -ac_env_build_alias_value=$build_alias
  68.708 -ac_cv_env_build_alias_set=${build_alias+set}
  68.709 -ac_cv_env_build_alias_value=$build_alias
  68.710 -ac_env_host_alias_set=${host_alias+set}
  68.711 -ac_env_host_alias_value=$host_alias
  68.712 -ac_cv_env_host_alias_set=${host_alias+set}
  68.713 -ac_cv_env_host_alias_value=$host_alias
  68.714 -ac_env_target_alias_set=${target_alias+set}
  68.715 -ac_env_target_alias_value=$target_alias
  68.716 -ac_cv_env_target_alias_set=${target_alias+set}
  68.717 -ac_cv_env_target_alias_value=$target_alias
  68.718 -ac_env_CC_set=${CC+set}
  68.719 -ac_env_CC_value=$CC
  68.720 -ac_cv_env_CC_set=${CC+set}
  68.721 -ac_cv_env_CC_value=$CC
  68.722 -ac_env_CFLAGS_set=${CFLAGS+set}
  68.723 -ac_env_CFLAGS_value=$CFLAGS
  68.724 -ac_cv_env_CFLAGS_set=${CFLAGS+set}
  68.725 -ac_cv_env_CFLAGS_value=$CFLAGS
  68.726 -ac_env_LDFLAGS_set=${LDFLAGS+set}
  68.727 -ac_env_LDFLAGS_value=$LDFLAGS
  68.728 -ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
  68.729 -ac_cv_env_LDFLAGS_value=$LDFLAGS
  68.730 -ac_env_CPPFLAGS_set=${CPPFLAGS+set}
  68.731 -ac_env_CPPFLAGS_value=$CPPFLAGS
  68.732 -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
  68.733 -ac_cv_env_CPPFLAGS_value=$CPPFLAGS
  68.734 -
  68.735 -#
  68.736 -# Report the --help message.
  68.737 -#
  68.738 -if test "$ac_init_help" = "long"; then
  68.739 -  # Omit some internal or obsolete options to make the list less imposing.
  68.740 -  # This message is too long to be a string in the A/UX 3.1 sh.
  68.741 -  cat <<_ACEOF
  68.742 -\`configure' configures xm-test 0.4.0 to adapt to many kinds of systems.
  68.743 -
  68.744 -Usage: $0 [OPTION]... [VAR=VALUE]...
  68.745 -
  68.746 -To assign environment variables (e.g., CC, CFLAGS...), specify them as
  68.747 -VAR=VALUE.  See below for descriptions of some of the useful variables.
  68.748 -
  68.749 -Defaults for the options are specified in brackets.
  68.750 -
  68.751 -Configuration:
  68.752 -  -h, --help              display this help and exit
  68.753 -      --help=short        display options specific to this package
  68.754 -      --help=recursive    display the short help of all the included packages
  68.755 -  -V, --version           display version information and exit
  68.756 -  -q, --quiet, --silent   do not print \`checking...' messages
  68.757 -      --cache-file=FILE   cache test results in FILE [disabled]
  68.758 -  -C, --config-cache      alias for \`--cache-file=config.cache'
  68.759 -  -n, --no-create         do not create output files
  68.760 -      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
  68.761 -
  68.762 -_ACEOF
  68.763 -
  68.764 -  cat <<_ACEOF
  68.765 -Installation directories:
  68.766 -  --prefix=PREFIX         install architecture-independent files in PREFIX
  68.767 -			  [$ac_default_prefix]
  68.768 -  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
  68.769 -			  [PREFIX]
  68.770 -
  68.771 -By default, \`make install' will install all the files in
  68.772 -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
  68.773 -an installation prefix other than \`$ac_default_prefix' using \`--prefix',
  68.774 -for instance \`--prefix=\$HOME'.
  68.775 -
  68.776 -For better control, use the options below.
  68.777 -
  68.778 -Fine tuning of the installation directories:
  68.779 -  --bindir=DIR           user executables [EPREFIX/bin]
  68.780 -  --sbindir=DIR          system admin executables [EPREFIX/sbin]
  68.781 -  --libexecdir=DIR       program executables [EPREFIX/libexec]
  68.782 -  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
  68.783 -  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
  68.784 -  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
  68.785 -  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
  68.786 -  --libdir=DIR           object code libraries [EPREFIX/lib]
  68.787 -  --includedir=DIR       C header files [PREFIX/include]
  68.788 -  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
  68.789 -  --infodir=DIR          info documentation [PREFIX/info]
  68.790 -  --mandir=DIR           man documentation [PREFIX/man]
  68.791 -_ACEOF
  68.792 -
  68.793 -  cat <<\_ACEOF
  68.794 -
  68.795 -Program names:
  68.796 -  --program-prefix=PREFIX            prepend PREFIX to installed program names
  68.797 -  --program-suffix=SUFFIX            append SUFFIX to installed program names
  68.798 -  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
  68.799 -_ACEOF
  68.800 -fi
  68.801 -
  68.802 -if test -n "$ac_init_help"; then
  68.803 -  case $ac_init_help in
  68.804 -     short | recursive ) echo "Configuration of xm-test 0.4.0:";;
  68.805 -   esac
  68.806 -  cat <<\_ACEOF
  68.807 -
  68.808 -Optional Features:
  68.809 -  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  68.810 -  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  68.811 -  --disable-dependency-tracking  speeds up one-time build
  68.812 -  --enable-dependency-tracking   do not reject slow dependency extractors
  68.813 -  --enable-vmx-support           use block devices instead of ramdisks
  68.814 -
  68.815 -Some influential environment variables:
  68.816 -  CC          C compiler command
  68.817 -  CFLAGS      C compiler flags
  68.818 -  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
  68.819 -              nonstandard directory <lib dir>
  68.820 -  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
  68.821 -              headers in a nonstandard directory <include dir>
  68.822 -
  68.823 -Use these variables to override the choices made by `configure' or to help
  68.824 -it to find libraries and programs with nonstandard names/locations.
  68.825 -
  68.826 -_ACEOF
  68.827 -fi
  68.828 -
  68.829 -if test "$ac_init_help" = "recursive"; then
  68.830 -  # If there are subdirs, report their specific --help.
  68.831 -  ac_popdir=`pwd`
  68.832 -  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
  68.833 -    test -d $ac_dir || continue
  68.834 -    ac_builddir=.
  68.835 -
  68.836 -if test "$ac_dir" != .; then
  68.837 -  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  68.838 -  # A "../" for each directory in $ac_dir_suffix.
  68.839 -  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
  68.840 -else
  68.841 -  ac_dir_suffix= ac_top_builddir=
  68.842 -fi
  68.843 -
  68.844 -case $srcdir in
  68.845 -  .)  # No --srcdir option.  We are building in place.
  68.846 -    ac_srcdir=.
  68.847 -    if test -z "$ac_top_builddir"; then
  68.848 -       ac_top_srcdir=.
  68.849 -    else
  68.850 -       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
  68.851 -    fi ;;
  68.852 -  [\\/]* | ?:[\\/]* )  # Absolute path.
  68.853 -    ac_srcdir=$srcdir$ac_dir_suffix;
  68.854 -    ac_top_srcdir=$srcdir ;;
  68.855 -  *) # Relative path.
  68.856 -    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
  68.857 -    ac_top_srcdir=$ac_top_builddir$srcdir ;;
  68.858 -esac
  68.859 -
  68.860 -# Do not use `cd foo && pwd` to compute absolute paths, because
  68.861 -# the directories may not exist.
  68.862 -case `pwd` in
  68.863 -.) ac_abs_builddir="$ac_dir";;
  68.864 -*)
  68.865 -  case "$ac_dir" in
  68.866 -  .) ac_abs_builddir=`pwd`;;
  68.867 -  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
  68.868 -  *) ac_abs_builddir=`pwd`/"$ac_dir";;
  68.869 -  esac;;
  68.870 -esac
  68.871 -case $ac_abs_builddir in
  68.872 -.) ac_abs_top_builddir=${ac_top_builddir}.;;
  68.873 -*)
  68.874 -  case ${ac_top_builddir}. in
  68.875 -  .) ac_abs_top_builddir=$ac_abs_builddir;;
  68.876 -  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
  68.877 -  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
  68.878 -  esac;;
  68.879 -esac
  68.880 -case $ac_abs_builddir in
  68.881 -.) ac_abs_srcdir=$ac_srcdir;;
  68.882 -*)
  68.883 -  case $ac_srcdir in
  68.884 -  .) ac_abs_srcdir=$ac_abs_builddir;;
  68.885 -  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
  68.886 -  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
  68.887 -  esac;;
  68.888 -esac
  68.889 -case $ac_abs_builddir in
  68.890 -.) ac_abs_top_srcdir=$ac_top_srcdir;;
  68.891 -*)
  68.892 -  case $ac_top_srcdir in
  68.893 -  .) ac_abs_top_srcdir=$ac_abs_builddir;;
  68.894 -  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
  68.895 -  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
  68.896 -  esac;;
  68.897 -esac
  68.898 -
  68.899 -    cd $ac_dir
  68.900 -    # Check for guested configure; otherwise get Cygnus style configure.
  68.901 -    if test -f $ac_srcdir/configure.gnu; then
  68.902 -      echo
  68.903 -      $SHELL $ac_srcdir/configure.gnu  --help=recursive
  68.904 -    elif test -f $ac_srcdir/configure; then
  68.905 -      echo
  68.906 -      $SHELL $ac_srcdir/configure  --help=recursive
  68.907 -    elif test -f $ac_srcdir/configure.ac ||
  68.908 -	   test -f $ac_srcdir/configure.in; then
  68.909 -      echo
  68.910 -      $ac_configure --help
  68.911 -    else
  68.912 -      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
  68.913 -    fi
  68.914 -    cd $ac_popdir
  68.915 -  done
  68.916 -fi
  68.917 -
  68.918 -test -n "$ac_init_help" && exit 0
  68.919 -if $ac_init_version; then
  68.920 -  cat <<\_ACEOF
  68.921 -xm-test configure 0.4.0
  68.922 -generated by GNU Autoconf 2.59
  68.923 -
  68.924 -Copyright (C) 2003 Free Software Foundation, Inc.
  68.925 -This configure script is free software; the Free Software Foundation
  68.926 -gives unlimited permission to copy, distribute and modify it.
  68.927 -_ACEOF
  68.928 -  exit 0
  68.929 -fi
  68.930 -exec 5>config.log
  68.931 -cat >&5 <<_ACEOF
  68.932 -This file contains any messages produced by compilers while
  68.933 -running configure, to aid debugging if configure makes a mistake.
  68.934 -
  68.935 -It was created by xm-test $as_me 0.4.0, which was
  68.936 -generated by GNU Autoconf 2.59.  Invocation command line was
  68.937 -
  68.938 -  $ $0 $@
  68.939 -
  68.940 -_ACEOF
  68.941 -{
  68.942 -cat <<_ASUNAME
  68.943 -## --------- ##
  68.944 -## Platform. ##
  68.945 -## --------- ##
  68.946 -
  68.947 -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
  68.948 -uname -m = `(uname -m) 2>/dev/null || echo unknown`
  68.949 -uname -r = `(uname -r) 2>/dev/null || echo unknown`
  68.950 -uname -s = `(uname -s) 2>/dev/null || echo unknown`
  68.951 -uname -v = `(uname -v) 2>/dev/null || echo unknown`
  68.952 -
  68.953 -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
  68.954 -/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
  68.955 -
  68.956 -/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
  68.957 -/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
  68.958 -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
  68.959 -hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
  68.960 -/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
  68.961 -/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
  68.962 -/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
  68.963 -
  68.964 -_ASUNAME
  68.965 -
  68.966 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  68.967 -for as_dir in $PATH
  68.968 -do
  68.969 -  IFS=$as_save_IFS
  68.970 -  test -z "$as_dir" && as_dir=.
  68.971 -  echo "PATH: $as_dir"
  68.972 -done
  68.973 -
  68.974 -} >&5
  68.975 -
  68.976 -cat >&5 <<_ACEOF
  68.977 -
  68.978 -
  68.979 -## ----------- ##
  68.980 -## Core tests. ##
  68.981 -## ----------- ##
  68.982 -
  68.983 -_ACEOF
  68.984 -
  68.985 -
  68.986 -# Keep a trace of the command line.
  68.987 -# Strip out --no-create and --no-recursion so they do not pile up.
  68.988 -# Strip out --silent because we don't want to record it for future runs.
  68.989 -# Also quote any args containing shell meta-characters.
  68.990 -# Make two passes to allow for proper duplicate-argument suppression.
  68.991 -ac_configure_args=
  68.992 -ac_configure_args0=
  68.993 -ac_configure_args1=
  68.994 -ac_sep=
  68.995 -ac_must_keep_next=false
  68.996 -for ac_pass in 1 2
  68.997 -do
  68.998 -  for ac_arg
  68.999 -  do
 68.1000 -    case $ac_arg in
 68.1001 -    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
 68.1002 -    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
 68.1003 -    | -silent | --silent | --silen | --sile | --sil)
 68.1004 -      continue ;;
 68.1005 -    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
 68.1006 -      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
 68.1007 -    esac
 68.1008 -    case $ac_pass in
 68.1009 -    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
 68.1010 -    2)
 68.1011 -      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
 68.1012 -      if test $ac_must_keep_next = true; then
 68.1013 -	ac_must_keep_next=false # Got value, back to normal.
 68.1014 -      else
 68.1015 -	case $ac_arg in
 68.1016 -	  *=* | --config-cache | -C | -disable-* | --disable-* \
 68.1017 -	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
 68.1018 -	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
 68.1019 -	  | -with-* | --with-* | -without-* | --without-* | --x)
 68.1020 -	    case "$ac_configure_args0 " in
 68.1021 -	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
 68.1022 -	    esac
 68.1023 -	    ;;
 68.1024 -	  -* ) ac_must_keep_next=true ;;
 68.1025 -	esac
 68.1026 -      fi
 68.1027 -      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
 68.1028 -      # Get rid of the leading space.
 68.1029 -      ac_sep=" "
 68.1030 -      ;;
 68.1031 -    esac
 68.1032 -  done
 68.1033 -done
 68.1034 -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
 68.1035 -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
 68.1036 -
 68.1037 -# When interrupted or exit'd, cleanup temporary files, and complete
 68.1038 -# config.log.  We remove comments because anyway the quotes in there
 68.1039 -# would cause problems or look ugly.
 68.1040 -# WARNING: Be sure not to use single quotes in there, as some shells,
 68.1041 -# such as our DU 5.0 friend, will then `close' the trap.
 68.1042 -trap 'exit_status=$?
 68.1043 -  # Save into config.log some information that might help in debugging.
 68.1044 -  {
 68.1045 -    echo
 68.1046 -
 68.1047 -    cat <<\_ASBOX
 68.1048 -## ---------------- ##
 68.1049 -## Cache variables. ##
 68.1050 -## ---------------- ##
 68.1051 -_ASBOX
 68.1052 -    echo
 68.1053 -    # The following way of writing the cache mishandles newlines in values,
 68.1054 -{
 68.1055 -  (set) 2>&1 |
 68.1056 -    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
 68.1057 -    *ac_space=\ *)
 68.1058 -      sed -n \
 68.1059 -	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
 68.1060 -	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
 68.1061 -      ;;
 68.1062 -    *)
 68.1063 -      sed -n \
 68.1064 -	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
 68.1065 -      ;;
 68.1066 -    esac;
 68.1067 -}
 68.1068 -    echo
 68.1069 -
 68.1070 -    cat <<\_ASBOX
 68.1071 -## ----------------- ##
 68.1072 -## Output variables. ##
 68.1073 -## ----------------- ##
 68.1074 -_ASBOX
 68.1075 -    echo
 68.1076 -    for ac_var in $ac_subst_vars
 68.1077 -    do
 68.1078 -      eval ac_val=$`echo $ac_var`
 68.1079 -      echo "$ac_var='"'"'$ac_val'"'"'"
 68.1080 -    done | sort
 68.1081 -    echo
 68.1082 -
 68.1083 -    if test -n "$ac_subst_files"; then
 68.1084 -      cat <<\_ASBOX
 68.1085 -## ------------- ##
 68.1086 -## Output files. ##
 68.1087 -## ------------- ##
 68.1088 -_ASBOX
 68.1089 -      echo
 68.1090 -      for ac_var in $ac_subst_files
 68.1091 -      do
 68.1092 -	eval ac_val=$`echo $ac_var`
 68.1093 -	echo "$ac_var='"'"'$ac_val'"'"'"
 68.1094 -      done | sort
 68.1095 -      echo
 68.1096 -    fi
 68.1097 -
 68.1098 -    if test -s confdefs.h; then
 68.1099 -      cat <<\_ASBOX
 68.1100 -## ----------- ##
 68.1101 -## confdefs.h. ##
 68.1102 -## ----------- ##
 68.1103 -_ASBOX
 68.1104 -      echo
 68.1105 -      sed "/^$/d" confdefs.h | sort
 68.1106 -      echo
 68.1107 -    fi
 68.1108 -    test "$ac_signal" != 0 &&
 68.1109 -      echo "$as_me: caught signal $ac_signal"
 68.1110 -    echo "$as_me: exit $exit_status"
 68.1111 -  } >&5
 68.1112 -  rm -f core *.core &&
 68.1113 -  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
 68.1114 -    exit $exit_status
 68.1115 -     ' 0
 68.1116 -for ac_signal in 1 2 13 15; do
 68.1117 -  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
 68.1118 -done
 68.1119 -ac_signal=0
 68.1120 -
 68.1121 -# confdefs.h avoids OS command line length limits that DEFS can exceed.
 68.1122 -rm -rf conftest* confdefs.h
 68.1123 -# AIX cpp loses on an empty file, so make sure it contains at least a newline.
 68.1124 -echo >confdefs.h
 68.1125 -
 68.1126 -# Predefined preprocessor variables.
 68.1127 -
 68.1128 -cat >>confdefs.h <<_ACEOF
 68.1129 -#define PACKAGE_NAME "$PACKAGE_NAME"
 68.1130 -_ACEOF
 68.1131 -
 68.1132 -
 68.1133 -cat >>confdefs.h <<_ACEOF
 68.1134 -#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
 68.1135 -_ACEOF
 68.1136 -
 68.1137 -
 68.1138 -cat >>confdefs.h <<_ACEOF
 68.1139 -#define PACKAGE_VERSION "$PACKAGE_VERSION"
 68.1140 -_ACEOF
 68.1141 -
 68.1142 -
 68.1143 -cat >>confdefs.h <<_ACEOF
 68.1144 -#define PACKAGE_STRING "$PACKAGE_STRING"
 68.1145 -_ACEOF
 68.1146 -
 68.1147 -
 68.1148 -cat >>confdefs.h <<_ACEOF
 68.1149 -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
 68.1150 -_ACEOF
 68.1151 -
 68.1152 -
 68.1153 -# Let the site file select an alternate cache file if it wants to.
 68.1154 -# Prefer explicitly selected file to automatically selected ones.
 68.1155 -if test -z "$CONFIG_SITE"; then
 68.1156 -  if test "x$prefix" != xNONE; then
 68.1157 -    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
 68.1158 -  else
 68.1159 -    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
 68.1160 -  fi
 68.1161 -fi
 68.1162 -for ac_site_file in $CONFIG_SITE; do
 68.1163 -  if test -r "$ac_site_file"; then
 68.1164 -    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
 68.1165 -echo "$as_me: loading site script $ac_site_file" >&6;}
 68.1166 -    sed 's/^/| /' "$ac_site_file" >&5
 68.1167 -    . "$ac_site_file"
 68.1168 -  fi
 68.1169 -done
 68.1170 -
 68.1171 -if test -r "$cache_file"; then
 68.1172 -  # Some versions of bash will fail to source /dev/null (special
 68.1173 -  # files actually), so we avoid doing that.
 68.1174 -  if test -f "$cache_file"; then
 68.1175 -    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
 68.1176 -echo "$as_me: loading cache $cache_file" >&6;}
 68.1177 -    case $cache_file in
 68.1178 -      [\\/]* | ?:[\\/]* ) . $cache_file;;
 68.1179 -      *)                      . ./$cache_file;;
 68.1180 -    esac
 68.1181 -  fi
 68.1182 -else
 68.1183 -  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
 68.1184 -echo "$as_me: creating cache $cache_file" >&6;}
 68.1185 -  >$cache_file
 68.1186 -fi
 68.1187 -
 68.1188 -# Check that the precious variables saved in the cache have kept the same
 68.1189 -# value.
 68.1190 -ac_cache_corrupted=false
 68.1191 -for ac_var in `(set) 2>&1 |
 68.1192 -	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
 68.1193 -  eval ac_old_set=\$ac_cv_env_${ac_var}_set
 68.1194 -  eval ac_new_set=\$ac_env_${ac_var}_set
 68.1195 -  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
 68.1196 -  eval ac_new_val="\$ac_env_${ac_var}_value"
 68.1197 -  case $ac_old_set,$ac_new_set in
 68.1198 -    set,)
 68.1199 -      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
 68.1200 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
 68.1201 -      ac_cache_corrupted=: ;;
 68.1202 -    ,set)
 68.1203 -      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
 68.1204 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
 68.1205 -      ac_cache_corrupted=: ;;
 68.1206 -    ,);;
 68.1207 -    *)
 68.1208 -      if test "x$ac_old_val" != "x$ac_new_val"; then
 68.1209 -	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
 68.1210 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
 68.1211 -	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
 68.1212 -echo "$as_me:   former value:  $ac_old_val" >&2;}
 68.1213 -	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
 68.1214 -echo "$as_me:   current value: $ac_new_val" >&2;}
 68.1215 -	ac_cache_corrupted=:
 68.1216 -      fi;;
 68.1217 -  esac
 68.1218 -  # Pass precious variables to config.status.
 68.1219 -  if test "$ac_new_set" = set; then
 68.1220 -    case $ac_new_val in
 68.1221 -    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
 68.1222 -      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
 68.1223 -    *) ac_arg=$ac_var=$ac_new_val ;;
 68.1224 -    esac
 68.1225 -    case " $ac_configure_args " in
 68.1226 -      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
 68.1227 -      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
 68.1228 -    esac
 68.1229 -  fi
 68.1230 -done
 68.1231 -if $ac_cache_corrupted; then
 68.1232 -  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
 68.1233 -echo "$as_me: error: changes in the environment can compromise the build" >&2;}
 68.1234 -  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
 68.1235 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
 68.1236 -   { (exit 1); exit 1; }; }
 68.1237 -fi
 68.1238 -
 68.1239 -ac_ext=c
 68.1240 -ac_cpp='$CPP $CPPFLAGS'
 68.1241 -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 68.1242 -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 68.1243 -ac_compiler_gnu=$ac_cv_c_compiler_gnu
 68.1244 -
 68.1245 -
 68.1246 -
 68.1247 -
 68.1248 -
 68.1249 -
 68.1250 -
 68.1251 -
 68.1252 -
 68.1253 -
 68.1254 -
 68.1255 -
 68.1256 -
 68.1257 -
 68.1258 -
 68.1259 -
 68.1260 -
 68.1261 -
 68.1262 -
 68.1263 -
 68.1264 -
 68.1265 -
 68.1266 -
 68.1267 -
 68.1268 -
 68.1269 -
 68.1270 -
 68.1271 -am__api_version="1.9"
 68.1272 -ac_aux_dir=
 68.1273 -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
 68.1274 -  if test -f $ac_dir/install-sh; then
 68.1275 -    ac_aux_dir=$ac_dir
 68.1276 -    ac_install_sh="$ac_aux_dir/install-sh -c"
 68.1277 -    break
 68.1278 -  elif test -f $ac_dir/install.sh; then
 68.1279 -    ac_aux_dir=$ac_dir
 68.1280 -    ac_install_sh="$ac_aux_dir/install.sh -c"
 68.1281 -    break
 68.1282 -  elif test -f $ac_dir/shtool; then
 68.1283 -    ac_aux_dir=$ac_dir
 68.1284 -    ac_install_sh="$ac_aux_dir/shtool install -c"
 68.1285 -    break
 68.1286 -  fi
 68.1287 -done
 68.1288 -if test -z "$ac_aux_dir"; then
 68.1289 -  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
 68.1290 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
 68.1291 -   { (exit 1); exit 1; }; }
 68.1292 -fi
 68.1293 -ac_config_guess="$SHELL $ac_aux_dir/config.guess"
 68.1294 -ac_config_sub="$SHELL $ac_aux_dir/config.sub"
 68.1295 -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
 68.1296 -
 68.1297 -# Find a good install program.  We prefer a C program (faster),
 68.1298 -# so one script is as good as another.  But avoid the broken or
 68.1299 -# incompatible versions:
 68.1300 -# SysV /etc/install, /usr/sbin/install
 68.1301 -# SunOS /usr/etc/install
 68.1302 -# IRIX /sbin/install
 68.1303 -# AIX /bin/install
 68.1304 -# AmigaOS /C/install, which installs bootblocks on floppy discs
 68.1305 -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
 68.1306 -# AFS /usr/afsws/bin/install, which mishandles nonexistent args
 68.1307 -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 68.1308 -# OS/2's system install, which has a completely different semantic
 68.1309 -# ./install, which can be erroneously created by make from ./install.sh.
 68.1310 -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
 68.1311 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
 68.1312 -if test -z "$INSTALL"; then
 68.1313 -if test "${ac_cv_path_install+set}" = set; then
 68.1314 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.1315 -else
 68.1316 -  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 68.1317 -for as_dir in $PATH
 68.1318 -do
 68.1319 -  IFS=$as_save_IFS
 68.1320 -  test -z "$as_dir" && as_dir=.
 68.1321 -  # Account for people who put trailing slashes in PATH elements.
 68.1322 -case $as_dir/ in
 68.1323 -  ./ | .// | /cC/* | \
 68.1324 -  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
 68.1325 -  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
 68.1326 -  /usr/ucb/* ) ;;
 68.1327 -  *)
 68.1328 -    # OSF1 and SCO ODT 3.0 have their own names for install.
 68.1329 -    # Don't use installbsd from OSF since it installs stuff as root
 68.1330 -    # by default.
 68.1331 -    for ac_prog in ginstall scoinst install; do
 68.1332 -      for ac_exec_ext in '' $ac_executable_extensions; do
 68.1333 -	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 68.1334 -	  if test $ac_prog = install &&
 68.1335 -	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 68.1336 -	    # AIX install.  It has an incompatible calling convention.
 68.1337 -	    :
 68.1338 -	  elif test $ac_prog = install &&
 68.1339 -	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 68.1340 -	    # program-specific install script used by HP pwplus--don't use.
 68.1341 -	    :
 68.1342 -	  else
 68.1343 -	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
 68.1344 -	    break 3
 68.1345 -	  fi
 68.1346 -	fi
 68.1347 -      done
 68.1348 -    done
 68.1349 -    ;;
 68.1350 -esac
 68.1351 -done
 68.1352 -
 68.1353 -
 68.1354 -fi
 68.1355 -  if test "${ac_cv_path_install+set}" = set; then
 68.1356 -    INSTALL=$ac_cv_path_install
 68.1357 -  else
 68.1358 -    # As a last resort, use the slow shell script.  We don't cache a
 68.1359 -    # path for INSTALL within a source directory, because that will
 68.1360 -    # break other packages using the cache if that directory is
 68.1361 -    # removed, or if the path is relative.
 68.1362 -    INSTALL=$ac_install_sh
 68.1363 -  fi
 68.1364 -fi
 68.1365 -echo "$as_me:$LINENO: result: $INSTALL" >&5
 68.1366 -echo "${ECHO_T}$INSTALL" >&6
 68.1367 -
 68.1368 -# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 68.1369 -# It thinks the first close brace ends the variable substitution.
 68.1370 -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
 68.1371 -
 68.1372 -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 68.1373 -
 68.1374 -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 68.1375 -
 68.1376 -echo "$as_me:$LINENO: checking whether build environment is sane" >&5
 68.1377 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
 68.1378 -# Just in case
 68.1379 -sleep 1
 68.1380 -echo timestamp > conftest.file
 68.1381 -# Do `set' in a subshell so we don't clobber the current shell's
 68.1382 -# arguments.  Must try -L first in case configure is actually a
 68.1383 -# symlink; some systems play weird games with the mod time of symlinks
 68.1384 -# (eg FreeBSD returns the mod time of the symlink's containing
 68.1385 -# directory).
 68.1386 -if (
 68.1387 -   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
 68.1388 -   if test "$*" = "X"; then
 68.1389 -      # -L didn't work.
 68.1390 -      set X `ls -t $srcdir/configure conftest.file`
 68.1391 -   fi
 68.1392 -   rm -f conftest.file
 68.1393 -   if test "$*" != "X $srcdir/configure conftest.file" \
 68.1394 -      && test "$*" != "X conftest.file $srcdir/configure"; then
 68.1395 -
 68.1396 -      # If neither matched, then we have a broken ls.  This can happen
 68.1397 -      # if, for instance, CONFIG_SHELL is bash and it inherits a
 68.1398 -      # broken ls alias from the environment.  This has actually
 68.1399 -      # happened.  Such a system could not be considered "sane".
 68.1400 -      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
 68.1401 -alias in your environment" >&5
 68.1402 -echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
 68.1403 -alias in your environment" >&2;}
 68.1404 -   { (exit 1); exit 1; }; }
 68.1405 -   fi
 68.1406 -
 68.1407 -   test "$2" = conftest.file
 68.1408 -   )
 68.1409 -then
 68.1410 -   # Ok.
 68.1411 -   :
 68.1412 -else
 68.1413 -   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
 68.1414 -Check your system clock" >&5
 68.1415 -echo "$as_me: error: newly created file is older than distributed files!
 68.1416 -Check your system clock" >&2;}
 68.1417 -   { (exit 1); exit 1; }; }
 68.1418 -fi
 68.1419 -echo "$as_me:$LINENO: result: yes" >&5
 68.1420 -echo "${ECHO_T}yes" >&6
 68.1421 -test "$program_prefix" != NONE &&
 68.1422 -  program_transform_name="s,^,$program_prefix,;$program_transform_name"
 68.1423 -# Use a double $ so make ignores it.
 68.1424 -test "$program_suffix" != NONE &&
 68.1425 -  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
 68.1426 -# Double any \ or $.  echo might interpret backslashes.
 68.1427 -# By default was `s,x,x', remove it if useless.
 68.1428 -cat <<\_ACEOF >conftest.sed
 68.1429 -s/[\\$]/&&/g;s/;s,x,x,$//
 68.1430 -_ACEOF
 68.1431 -program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
 68.1432 -rm conftest.sed
 68.1433 -
 68.1434 -# expand $ac_aux_dir to an absolute path
 68.1435 -am_aux_dir=`cd $ac_aux_dir && pwd`
 68.1436 -
 68.1437 -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
 68.1438 -# Use eval to expand $SHELL
 68.1439 -if eval "$MISSING --run true"; then
 68.1440 -  am_missing_run="$MISSING --run "
 68.1441 -else
 68.1442 -  am_missing_run=
 68.1443 -  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
 68.1444 -echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
 68.1445 -fi
 68.1446 -
 68.1447 -if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
 68.1448 -  # We used to keeping the `.' as first argument, in order to
 68.1449 -  # allow $(mkdir_p) to be used without argument.  As in
 68.1450 -  #   $(mkdir_p) $(somedir)
 68.1451 -  # where $(somedir) is conditionally defined.  However this is wrong
 68.1452 -  # for two reasons:
 68.1453 -  #  1. if the package is installed by a user who cannot write `.'
 68.1454 -  #     make install will fail,
 68.1455 -  #  2. the above comment should most certainly read
 68.1456 -  #     $(mkdir_p) $(DESTDIR)$(somedir)
 68.1457 -  #     so it does not work when $(somedir) is undefined and
 68.1458 -  #     $(DESTDIR) is not.
 68.1459 -  #  To support the latter case, we have to write
 68.1460 -  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
 68.1461 -  #  so the `.' trick is pointless.
 68.1462 -  mkdir_p='mkdir -p --'
 68.1463 -else
 68.1464 -  # On NextStep and OpenStep, the `mkdir' command does not
 68.1465 -  # recognize any option.  It will interpret all options as
 68.1466 -  # directories to create, and then abort because `.' already
 68.1467 -  # exists.
 68.1468 -  for d in ./-p ./--version;
 68.1469 -  do
 68.1470 -    test -d $d && rmdir $d
 68.1471 -  done
 68.1472 -  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
 68.1473 -  if test -f "$ac_aux_dir/mkinstalldirs"; then
 68.1474 -    mkdir_p='$(mkinstalldirs)'
 68.1475 -  else
 68.1476 -    mkdir_p='$(install_sh) -d'
 68.1477 -  fi
 68.1478 -fi
 68.1479 -
 68.1480 -for ac_prog in gawk mawk nawk awk
 68.1481 -do
 68.1482 -  # Extract the first word of "$ac_prog", so it can be a program name with args.
 68.1483 -set dummy $ac_prog; ac_word=$2
 68.1484 -echo "$as_me:$LINENO: checking for $ac_word" >&5
 68.1485 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 68.1486 -if test "${ac_cv_prog_AWK+set}" = set; then
 68.1487 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.1488 -else
 68.1489 -  if test -n "$AWK"; then
 68.1490 -  ac_cv_prog_AWK="$AWK" # Let the user override the test.
 68.1491 -else
 68.1492 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 68.1493 -for as_dir in $PATH
 68.1494 -do
 68.1495 -  IFS=$as_save_IFS
 68.1496 -  test -z "$as_dir" && as_dir=.
 68.1497 -  for ac_exec_ext in '' $ac_executable_extensions; do
 68.1498 -  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 68.1499 -    ac_cv_prog_AWK="$ac_prog"
 68.1500 -    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 68.1501 -    break 2
 68.1502 -  fi
 68.1503 -done
 68.1504 -done
 68.1505 -
 68.1506 -fi
 68.1507 -fi
 68.1508 -AWK=$ac_cv_prog_AWK
 68.1509 -if test -n "$AWK"; then
 68.1510 -  echo "$as_me:$LINENO: result: $AWK" >&5
 68.1511 -echo "${ECHO_T}$AWK" >&6
 68.1512 -else
 68.1513 -  echo "$as_me:$LINENO: result: no" >&5
 68.1514 -echo "${ECHO_T}no" >&6
 68.1515 -fi
 68.1516 -
 68.1517 -  test -n "$AWK" && break
 68.1518 -done
 68.1519 -
 68.1520 -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
 68.1521 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
 68.1522 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
 68.1523 -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
 68.1524 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.1525 -else
 68.1526 -  cat >conftest.make <<\_ACEOF
 68.1527 -all:
 68.1528 -	@echo 'ac_maketemp="$(MAKE)"'
 68.1529 -_ACEOF
 68.1530 -# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
 68.1531 -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
 68.1532 -if test -n "$ac_maketemp"; then
 68.1533 -  eval ac_cv_prog_make_${ac_make}_set=yes
 68.1534 -else
 68.1535 -  eval ac_cv_prog_make_${ac_make}_set=no
 68.1536 -fi
 68.1537 -rm -f conftest.make
 68.1538 -fi
 68.1539 -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
 68.1540 -  echo "$as_me:$LINENO: result: yes" >&5
 68.1541 -echo "${ECHO_T}yes" >&6
 68.1542 -  SET_MAKE=
 68.1543 -else
 68.1544 -  echo "$as_me:$LINENO: result: no" >&5
 68.1545 -echo "${ECHO_T}no" >&6
 68.1546 -  SET_MAKE="MAKE=${MAKE-make}"
 68.1547 -fi
 68.1548 -
 68.1549 -rm -rf .tst 2>/dev/null
 68.1550 -mkdir .tst 2>/dev/null
 68.1551 -if test -d .tst; then
 68.1552 -  am__leading_dot=.
 68.1553 -else
 68.1554 -  am__leading_dot=_
 68.1555 -fi
 68.1556 -rmdir .tst 2>/dev/null
 68.1557 -
 68.1558 -# test to see if srcdir already configured
 68.1559 -if test "`cd $srcdir && pwd`" != "`pwd`" &&
 68.1560 -   test -f $srcdir/config.status; then
 68.1561 -  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
 68.1562 -echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
 68.1563 -   { (exit 1); exit 1; }; }
 68.1564 -fi
 68.1565 -
 68.1566 -# test whether we have cygpath
 68.1567 -if test -z "$CYGPATH_W"; then
 68.1568 -  if (cygpath --version) >/dev/null 2>/dev/null; then
 68.1569 -    CYGPATH_W='cygpath -w'
 68.1570 -  else
 68.1571 -    CYGPATH_W=echo
 68.1572 -  fi
 68.1573 -fi
 68.1574 -
 68.1575 -
 68.1576 -# Define the identity of the package.
 68.1577 - PACKAGE='xm-test'
 68.1578 - VERSION='0.4.0'
 68.1579 -
 68.1580 -
 68.1581 -cat >>confdefs.h <<_ACEOF
 68.1582 -#define PACKAGE "$PACKAGE"
 68.1583 -_ACEOF
 68.1584 -
 68.1585 -
 68.1586 -cat >>confdefs.h <<_ACEOF
 68.1587 -#define VERSION "$VERSION"
 68.1588 -_ACEOF
 68.1589 -
 68.1590 -# Some tools Automake needs.
 68.1591 -
 68.1592 -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
 68.1593 -
 68.1594 -
 68.1595 -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
 68.1596 -
 68.1597 -
 68.1598 -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
 68.1599 -
 68.1600 -
 68.1601 -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 68.1602 -
 68.1603 -
 68.1604 -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 68.1605 -
 68.1606 -install_sh=${install_sh-"$am_aux_dir/install-sh"}
 68.1607 -
 68.1608 -# Installed binaries are usually stripped using `strip' when the user
 68.1609 -# run `make install-strip'.  However `strip' might not be the right
 68.1610 -# tool to use in cross-compilation environments, therefore Automake
 68.1611 -# will honor the `STRIP' environment variable to overrule this program.
 68.1612 -if test "$cross_compiling" != no; then
 68.1613 -  if test -n "$ac_tool_prefix"; then
 68.1614 -  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 68.1615 -set dummy ${ac_tool_prefix}strip; ac_word=$2
 68.1616 -echo "$as_me:$LINENO: checking for $ac_word" >&5
 68.1617 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 68.1618 -if test "${ac_cv_prog_STRIP+set}" = set; then
 68.1619 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.1620 -else
 68.1621 -  if test -n "$STRIP"; then
 68.1622 -  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
 68.1623 -else
 68.1624 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 68.1625 -for as_dir in $PATH
 68.1626 -do
 68.1627 -  IFS=$as_save_IFS
 68.1628 -  test -z "$as_dir" && as_dir=.
 68.1629 -  for ac_exec_ext in '' $ac_executable_extensions; do
 68.1630 -  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 68.1631 -    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
 68.1632 -    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 68.1633 -    break 2
 68.1634 -  fi
 68.1635 -done
 68.1636 -done
 68.1637 -
 68.1638 -fi
 68.1639 -fi
 68.1640 -STRIP=$ac_cv_prog_STRIP
 68.1641 -if test -n "$STRIP"; then
 68.1642 -  echo "$as_me:$LINENO: result: $STRIP" >&5
 68.1643 -echo "${ECHO_T}$STRIP" >&6
 68.1644 -else
 68.1645 -  echo "$as_me:$LINENO: result: no" >&5
 68.1646 -echo "${ECHO_T}no" >&6
 68.1647 -fi
 68.1648 -
 68.1649 -fi
 68.1650 -if test -z "$ac_cv_prog_STRIP"; then
 68.1651 -  ac_ct_STRIP=$STRIP
 68.1652 -  # Extract the first word of "strip", so it can be a program name with args.
 68.1653 -set dummy strip; ac_word=$2
 68.1654 -echo "$as_me:$LINENO: checking for $ac_word" >&5
 68.1655 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 68.1656 -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
 68.1657 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.1658 -else
 68.1659 -  if test -n "$ac_ct_STRIP"; then
 68.1660 -  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
 68.1661 -else
 68.1662 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 68.1663 -for as_dir in $PATH
 68.1664 -do
 68.1665 -  IFS=$as_save_IFS
 68.1666 -  test -z "$as_dir" && as_dir=.
 68.1667 -  for ac_exec_ext in '' $ac_executable_extensions; do
 68.1668 -  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 68.1669 -    ac_cv_prog_ac_ct_STRIP="strip"
 68.1670 -    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 68.1671 -    break 2
 68.1672 -  fi
 68.1673 -done
 68.1674 -done
 68.1675 -
 68.1676 -  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
 68.1677 -fi
 68.1678 -fi
 68.1679 -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
 68.1680 -if test -n "$ac_ct_STRIP"; then
 68.1681 -  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
 68.1682 -echo "${ECHO_T}$ac_ct_STRIP" >&6
 68.1683 -else
 68.1684 -  echo "$as_me:$LINENO: result: no" >&5
 68.1685 -echo "${ECHO_T}no" >&6
 68.1686 -fi
 68.1687 -
 68.1688 -  STRIP=$ac_ct_STRIP
 68.1689 -else
 68.1690 -  STRIP="$ac_cv_prog_STRIP"
 68.1691 -fi
 68.1692 -
 68.1693 -fi
 68.1694 -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
 68.1695 -
 68.1696 -# We need awk for the "check" target.  The system "awk" is bad on
 68.1697 -# some platforms.
 68.1698 -# Always define AMTAR for backward compatibility.
 68.1699 -
 68.1700 -AMTAR=${AMTAR-"${am_missing_run}tar"}
 68.1701 -
 68.1702 -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 68.1703 -
 68.1704 -
 68.1705 -
 68.1706 -
 68.1707 -
 68.1708 -
 68.1709 -# Check for dependencies
 68.1710 -ac_ext=c
 68.1711 -ac_cpp='$CPP $CPPFLAGS'
 68.1712 -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 68.1713 -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 68.1714 -ac_compiler_gnu=$ac_cv_c_compiler_gnu
 68.1715 -if test -n "$ac_tool_prefix"; then
 68.1716 -  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 68.1717 -set dummy ${ac_tool_prefix}gcc; ac_word=$2
 68.1718 -echo "$as_me:$LINENO: checking for $ac_word" >&5
 68.1719 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 68.1720 -if test "${ac_cv_prog_CC+set}" = set; then
 68.1721 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.1722 -else
 68.1723 -  if test -n "$CC"; then
 68.1724 -  ac_cv_prog_CC="$CC" # Let the user override the test.
 68.1725 -else
 68.1726 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 68.1727 -for as_dir in $PATH
 68.1728 -do
 68.1729 -  IFS=$as_save_IFS
 68.1730 -  test -z "$as_dir" && as_dir=.
 68.1731 -  for ac_exec_ext in '' $ac_executable_extensions; do
 68.1732 -  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 68.1733 -    ac_cv_prog_CC="${ac_tool_prefix}gcc"
 68.1734 -    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 68.1735 -    break 2
 68.1736 -  fi
 68.1737 -done
 68.1738 -done
 68.1739 -
 68.1740 -fi
 68.1741 -fi
 68.1742 -CC=$ac_cv_prog_CC
 68.1743 -if test -n "$CC"; then
 68.1744 -  echo "$as_me:$LINENO: result: $CC" >&5
 68.1745 -echo "${ECHO_T}$CC" >&6
 68.1746 -else
 68.1747 -  echo "$as_me:$LINENO: result: no" >&5
 68.1748 -echo "${ECHO_T}no" >&6
 68.1749 -fi
 68.1750 -
 68.1751 -fi
 68.1752 -if test -z "$ac_cv_prog_CC"; then
 68.1753 -  ac_ct_CC=$CC
 68.1754 -  # Extract the first word of "gcc", so it can be a program name with args.
 68.1755 -set dummy gcc; ac_word=$2
 68.1756 -echo "$as_me:$LINENO: checking for $ac_word" >&5
 68.1757 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 68.1758 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
 68.1759 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.1760 -else
 68.1761 -  if test -n "$ac_ct_CC"; then
 68.1762 -  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 68.1763 -else
 68.1764 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 68.1765 -for as_dir in $PATH
 68.1766 -do
 68.1767 -  IFS=$as_save_IFS
 68.1768 -  test -z "$as_dir" && as_dir=.
 68.1769 -  for ac_exec_ext in '' $ac_executable_extensions; do
 68.1770 -  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 68.1771 -    ac_cv_prog_ac_ct_CC="gcc"
 68.1772 -    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 68.1773 -    break 2
 68.1774 -  fi
 68.1775 -done
 68.1776 -done
 68.1777 -
 68.1778 -fi
 68.1779 -fi
 68.1780 -ac_ct_CC=$ac_cv_prog_ac_ct_CC
 68.1781 -if test -n "$ac_ct_CC"; then
 68.1782 -  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
 68.1783 -echo "${ECHO_T}$ac_ct_CC" >&6
 68.1784 -else
 68.1785 -  echo "$as_me:$LINENO: result: no" >&5
 68.1786 -echo "${ECHO_T}no" >&6
 68.1787 -fi
 68.1788 -
 68.1789 -  CC=$ac_ct_CC
 68.1790 -else
 68.1791 -  CC="$ac_cv_prog_CC"
 68.1792 -fi
 68.1793 -
 68.1794 -if test -z "$CC"; then
 68.1795 -  if test -n "$ac_tool_prefix"; then
 68.1796 -  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 68.1797 -set dummy ${ac_tool_prefix}cc; ac_word=$2
 68.1798 -echo "$as_me:$LINENO: checking for $ac_word" >&5
 68.1799 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 68.1800 -if test "${ac_cv_prog_CC+set}" = set; then
 68.1801 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.1802 -else
 68.1803 -  if test -n "$CC"; then
 68.1804 -  ac_cv_prog_CC="$CC" # Let the user override the test.
 68.1805 -else
 68.1806 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 68.1807 -for as_dir in $PATH
 68.1808 -do
 68.1809 -  IFS=$as_save_IFS
 68.1810 -  test -z "$as_dir" && as_dir=.
 68.1811 -  for ac_exec_ext in '' $ac_executable_extensions; do
 68.1812 -  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 68.1813 -    ac_cv_prog_CC="${ac_tool_prefix}cc"
 68.1814 -    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 68.1815 -    break 2
 68.1816 -  fi
 68.1817 -done
 68.1818 -done
 68.1819 -
 68.1820 -fi
 68.1821 -fi
 68.1822 -CC=$ac_cv_prog_CC
 68.1823 -if test -n "$CC"; then
 68.1824 -  echo "$as_me:$LINENO: result: $CC" >&5
 68.1825 -echo "${ECHO_T}$CC" >&6
 68.1826 -else
 68.1827 -  echo "$as_me:$LINENO: result: no" >&5
 68.1828 -echo "${ECHO_T}no" >&6
 68.1829 -fi
 68.1830 -
 68.1831 -fi
 68.1832 -if test -z "$ac_cv_prog_CC"; then
 68.1833 -  ac_ct_CC=$CC
 68.1834 -  # Extract the first word of "cc", so it can be a program name with args.
 68.1835 -set dummy cc; ac_word=$2
 68.1836 -echo "$as_me:$LINENO: checking for $ac_word" >&5
 68.1837 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 68.1838 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
 68.1839 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.1840 -else
 68.1841 -  if test -n "$ac_ct_CC"; then
 68.1842 -  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 68.1843 -else
 68.1844 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 68.1845 -for as_dir in $PATH
 68.1846 -do
 68.1847 -  IFS=$as_save_IFS
 68.1848 -  test -z "$as_dir" && as_dir=.
 68.1849 -  for ac_exec_ext in '' $ac_executable_extensions; do
 68.1850 -  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 68.1851 -    ac_cv_prog_ac_ct_CC="cc"
 68.1852 -    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 68.1853 -    break 2
 68.1854 -  fi
 68.1855 -done
 68.1856 -done
 68.1857 -
 68.1858 -fi
 68.1859 -fi
 68.1860 -ac_ct_CC=$ac_cv_prog_ac_ct_CC
 68.1861 -if test -n "$ac_ct_CC"; then
 68.1862 -  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
 68.1863 -echo "${ECHO_T}$ac_ct_CC" >&6
 68.1864 -else
 68.1865 -  echo "$as_me:$LINENO: result: no" >&5
 68.1866 -echo "${ECHO_T}no" >&6
 68.1867 -fi
 68.1868 -
 68.1869 -  CC=$ac_ct_CC
 68.1870 -else
 68.1871 -  CC="$ac_cv_prog_CC"
 68.1872 -fi
 68.1873 -
 68.1874 -fi
 68.1875 -if test -z "$CC"; then
 68.1876 -  # Extract the first word of "cc", so it can be a program name with args.
 68.1877 -set dummy cc; ac_word=$2
 68.1878 -echo "$as_me:$LINENO: checking for $ac_word" >&5
 68.1879 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 68.1880 -if test "${ac_cv_prog_CC+set}" = set; then
 68.1881 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.1882 -else
 68.1883 -  if test -n "$CC"; then
 68.1884 -  ac_cv_prog_CC="$CC" # Let the user override the test.
 68.1885 -else
 68.1886 -  ac_prog_rejected=no
 68.1887 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 68.1888 -for as_dir in $PATH
 68.1889 -do
 68.1890 -  IFS=$as_save_IFS
 68.1891 -  test -z "$as_dir" && as_dir=.
 68.1892 -  for ac_exec_ext in '' $ac_executable_extensions; do
 68.1893 -  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 68.1894 -    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
 68.1895 -       ac_prog_rejected=yes
 68.1896 -       continue
 68.1897 -     fi
 68.1898 -    ac_cv_prog_CC="cc"
 68.1899 -    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 68.1900 -    break 2
 68.1901 -  fi
 68.1902 -done
 68.1903 -done
 68.1904 -
 68.1905 -if test $ac_prog_rejected = yes; then
 68.1906 -  # We found a bogon in the path, so make sure we never use it.
 68.1907 -  set dummy $ac_cv_prog_CC
 68.1908 -  shift
 68.1909 -  if test $# != 0; then
 68.1910 -    # We chose a different compiler from the bogus one.
 68.1911 -    # However, it has the same basename, so the bogon will be chosen
 68.1912 -    # first if we set CC to just the basename; use the full file name.
 68.1913 -    shift
 68.1914 -    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
 68.1915 -  fi
 68.1916 -fi
 68.1917 -fi
 68.1918 -fi
 68.1919 -CC=$ac_cv_prog_CC
 68.1920 -if test -n "$CC"; then
 68.1921 -  echo "$as_me:$LINENO: result: $CC" >&5
 68.1922 -echo "${ECHO_T}$CC" >&6
 68.1923 -else
 68.1924 -  echo "$as_me:$LINENO: result: no" >&5
 68.1925 -echo "${ECHO_T}no" >&6
 68.1926 -fi
 68.1927 -
 68.1928 -fi
 68.1929 -if test -z "$CC"; then
 68.1930 -  if test -n "$ac_tool_prefix"; then
 68.1931 -  for ac_prog in cl
 68.1932 -  do
 68.1933 -    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 68.1934 -set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 68.1935 -echo "$as_me:$LINENO: checking for $ac_word" >&5
 68.1936 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 68.1937 -if test "${ac_cv_prog_CC+set}" = set; then
 68.1938 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.1939 -else
 68.1940 -  if test -n "$CC"; then
 68.1941 -  ac_cv_prog_CC="$CC" # Let the user override the test.
 68.1942 -else
 68.1943 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 68.1944 -for as_dir in $PATH
 68.1945 -do
 68.1946 -  IFS=$as_save_IFS
 68.1947 -  test -z "$as_dir" && as_dir=.
 68.1948 -  for ac_exec_ext in '' $ac_executable_extensions; do
 68.1949 -  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 68.1950 -    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
 68.1951 -    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 68.1952 -    break 2
 68.1953 -  fi
 68.1954 -done
 68.1955 -done
 68.1956 -
 68.1957 -fi
 68.1958 -fi
 68.1959 -CC=$ac_cv_prog_CC
 68.1960 -if test -n "$CC"; then
 68.1961 -  echo "$as_me:$LINENO: result: $CC" >&5
 68.1962 -echo "${ECHO_T}$CC" >&6
 68.1963 -else
 68.1964 -  echo "$as_me:$LINENO: result: no" >&5
 68.1965 -echo "${ECHO_T}no" >&6
 68.1966 -fi
 68.1967 -
 68.1968 -    test -n "$CC" && break
 68.1969 -  done
 68.1970 -fi
 68.1971 -if test -z "$CC"; then
 68.1972 -  ac_ct_CC=$CC
 68.1973 -  for ac_prog in cl
 68.1974 -do
 68.1975 -  # Extract the first word of "$ac_prog", so it can be a program name with args.
 68.1976 -set dummy $ac_prog; ac_word=$2
 68.1977 -echo "$as_me:$LINENO: checking for $ac_word" >&5
 68.1978 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 68.1979 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
 68.1980 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.1981 -else
 68.1982 -  if test -n "$ac_ct_CC"; then
 68.1983 -  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 68.1984 -else
 68.1985 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 68.1986 -for as_dir in $PATH
 68.1987 -do
 68.1988 -  IFS=$as_save_IFS
 68.1989 -  test -z "$as_dir" && as_dir=.
 68.1990 -  for ac_exec_ext in '' $ac_executable_extensions; do
 68.1991 -  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 68.1992 -    ac_cv_prog_ac_ct_CC="$ac_prog"
 68.1993 -    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 68.1994 -    break 2
 68.1995 -  fi
 68.1996 -done
 68.1997 -done
 68.1998 -
 68.1999 -fi
 68.2000 -fi
 68.2001 -ac_ct_CC=$ac_cv_prog_ac_ct_CC
 68.2002 -if test -n "$ac_ct_CC"; then
 68.2003 -  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
 68.2004 -echo "${ECHO_T}$ac_ct_CC" >&6
 68.2005 -else
 68.2006 -  echo "$as_me:$LINENO: result: no" >&5
 68.2007 -echo "${ECHO_T}no" >&6
 68.2008 -fi
 68.2009 -
 68.2010 -  test -n "$ac_ct_CC" && break
 68.2011 -done
 68.2012 -
 68.2013 -  CC=$ac_ct_CC
 68.2014 -fi
 68.2015 -
 68.2016 -fi
 68.2017 -
 68.2018 -
 68.2019 -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
 68.2020 -See \`config.log' for more details." >&5
 68.2021 -echo "$as_me: error: no acceptable C compiler found in \$PATH
 68.2022 -See \`config.log' for more details." >&2;}
 68.2023 -   { (exit 1); exit 1; }; }
 68.2024 -
 68.2025 -# Provide some information about the compiler.
 68.2026 -echo "$as_me:$LINENO:" \
 68.2027 -     "checking for C compiler version" >&5
 68.2028 -ac_compiler=`set X $ac_compile; echo $2`
 68.2029 -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
 68.2030 -  (eval $ac_compiler --version </dev/null >&5) 2>&5
 68.2031 -  ac_status=$?
 68.2032 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2033 -  (exit $ac_status); }
 68.2034 -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
 68.2035 -  (eval $ac_compiler -v </dev/null >&5) 2>&5
 68.2036 -  ac_status=$?
 68.2037 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2038 -  (exit $ac_status); }
 68.2039 -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
 68.2040 -  (eval $ac_compiler -V </dev/null >&5) 2>&5
 68.2041 -  ac_status=$?
 68.2042 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2043 -  (exit $ac_status); }
 68.2044 -
 68.2045 -cat >conftest.$ac_ext <<_ACEOF
 68.2046 -/* confdefs.h.  */
 68.2047 -_ACEOF
 68.2048 -cat confdefs.h >>conftest.$ac_ext
 68.2049 -cat >>conftest.$ac_ext <<_ACEOF
 68.2050 -/* end confdefs.h.  */
 68.2051 -
 68.2052 -int
 68.2053 -main ()
 68.2054 -{
 68.2055 -
 68.2056 -  ;
 68.2057 -  return 0;
 68.2058 -}
 68.2059 -_ACEOF
 68.2060 -ac_clean_files_save=$ac_clean_files
 68.2061 -ac_clean_files="$ac_clean_files a.out a.exe b.out"
 68.2062 -# Try to create an executable without -o first, disregard a.out.
 68.2063 -# It will help us diagnose broken compilers, and finding out an intuition
 68.2064 -# of exeext.
 68.2065 -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
 68.2066 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
 68.2067 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 68.2068 -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
 68.2069 -  (eval $ac_link_default) 2>&5
 68.2070 -  ac_status=$?
 68.2071 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2072 -  (exit $ac_status); }; then
 68.2073 -  # Find the output, starting from the most likely.  This scheme is
 68.2074 -# not robust to junk in `.', hence go to wildcards (a.*) only as a last
 68.2075 -# resort.
 68.2076 -
 68.2077 -# Be careful to initialize this variable, since it used to be cached.
 68.2078 -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
 68.2079 -ac_cv_exeext=
 68.2080 -# b.out is created by i960 compilers.
 68.2081 -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
 68.2082 -do
 68.2083 -  test -f "$ac_file" || continue
 68.2084 -  case $ac_file in
 68.2085 -    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
 68.2086 -	;;
 68.2087 -    conftest.$ac_ext )
 68.2088 -	# This is the source file.
 68.2089 -	;;
 68.2090 -    [ab].out )
 68.2091 -	# We found the default executable, but exeext='' is most
 68.2092 -	# certainly right.
 68.2093 -	break;;
 68.2094 -    *.* )
 68.2095 -	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 68.2096 -	# FIXME: I believe we export ac_cv_exeext for Libtool,
 68.2097 -	# but it would be cool to find out if it's true.  Does anybody
 68.2098 -	# maintain Libtool? --akim.
 68.2099 -	export ac_cv_exeext
 68.2100 -	break;;
 68.2101 -    * )
 68.2102 -	break;;
 68.2103 -  esac
 68.2104 -done
 68.2105 -else
 68.2106 -  echo "$as_me: failed program was:" >&5
 68.2107 -sed 's/^/| /' conftest.$ac_ext >&5
 68.2108 -
 68.2109 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
 68.2110 -See \`config.log' for more details." >&5
 68.2111 -echo "$as_me: error: C compiler cannot create executables
 68.2112 -See \`config.log' for more details." >&2;}
 68.2113 -   { (exit 77); exit 77; }; }
 68.2114 -fi
 68.2115 -
 68.2116 -ac_exeext=$ac_cv_exeext
 68.2117 -echo "$as_me:$LINENO: result: $ac_file" >&5
 68.2118 -echo "${ECHO_T}$ac_file" >&6
 68.2119 -
 68.2120 -# Check the compiler produces executables we can run.  If not, either
 68.2121 -# the compiler is broken, or we cross compile.
 68.2122 -echo "$as_me:$LINENO: checking whether the C compiler works" >&5
 68.2123 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
 68.2124 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 68.2125 -# If not cross compiling, check that we can run a simple program.
 68.2126 -if test "$cross_compiling" != yes; then
 68.2127 -  if { ac_try='./$ac_file'
 68.2128 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2129 -  (eval $ac_try) 2>&5
 68.2130 -  ac_status=$?
 68.2131 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2132 -  (exit $ac_status); }; }; then
 68.2133 -    cross_compiling=no
 68.2134 -  else
 68.2135 -    if test "$cross_compiling" = maybe; then
 68.2136 -	cross_compiling=yes
 68.2137 -    else
 68.2138 -	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
 68.2139 -If you meant to cross compile, use \`--host'.
 68.2140 -See \`config.log' for more details." >&5
 68.2141 -echo "$as_me: error: cannot run C compiled programs.
 68.2142 -If you meant to cross compile, use \`--host'.
 68.2143 -See \`config.log' for more details." >&2;}
 68.2144 -   { (exit 1); exit 1; }; }
 68.2145 -    fi
 68.2146 -  fi
 68.2147 -fi
 68.2148 -echo "$as_me:$LINENO: result: yes" >&5
 68.2149 -echo "${ECHO_T}yes" >&6
 68.2150 -
 68.2151 -rm -f a.out a.exe conftest$ac_cv_exeext b.out
 68.2152 -ac_clean_files=$ac_clean_files_save
 68.2153 -# Check the compiler produces executables we can run.  If not, either
 68.2154 -# the compiler is broken, or we cross compile.
 68.2155 -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
 68.2156 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
 68.2157 -echo "$as_me:$LINENO: result: $cross_compiling" >&5
 68.2158 -echo "${ECHO_T}$cross_compiling" >&6
 68.2159 -
 68.2160 -echo "$as_me:$LINENO: checking for suffix of executables" >&5
 68.2161 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
 68.2162 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 68.2163 -  (eval $ac_link) 2>&5
 68.2164 -  ac_status=$?
 68.2165 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2166 -  (exit $ac_status); }; then
 68.2167 -  # If both `conftest.exe' and `conftest' are `present' (well, observable)
 68.2168 -# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
 68.2169 -# work properly (i.e., refer to `conftest.exe'), while it won't with
 68.2170 -# `rm'.
 68.2171 -for ac_file in conftest.exe conftest conftest.*; do
 68.2172 -  test -f "$ac_file" || continue
 68.2173 -  case $ac_file in
 68.2174 -    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
 68.2175 -    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 68.2176 -	  export ac_cv_exeext
 68.2177 -	  break;;
 68.2178 -    * ) break;;
 68.2179 -  esac
 68.2180 -done
 68.2181 -else
 68.2182 -  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
 68.2183 -See \`config.log' for more details." >&5
 68.2184 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
 68.2185 -See \`config.log' for more details." >&2;}
 68.2186 -   { (exit 1); exit 1; }; }
 68.2187 -fi
 68.2188 -
 68.2189 -rm -f conftest$ac_cv_exeext
 68.2190 -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
 68.2191 -echo "${ECHO_T}$ac_cv_exeext" >&6
 68.2192 -
 68.2193 -rm -f conftest.$ac_ext
 68.2194 -EXEEXT=$ac_cv_exeext
 68.2195 -ac_exeext=$EXEEXT
 68.2196 -echo "$as_me:$LINENO: checking for suffix of object files" >&5
 68.2197 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
 68.2198 -if test "${ac_cv_objext+set}" = set; then
 68.2199 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.2200 -else
 68.2201 -  cat >conftest.$ac_ext <<_ACEOF
 68.2202 -/* confdefs.h.  */
 68.2203 -_ACEOF
 68.2204 -cat confdefs.h >>conftest.$ac_ext
 68.2205 -cat >>conftest.$ac_ext <<_ACEOF
 68.2206 -/* end confdefs.h.  */
 68.2207 -
 68.2208 -int
 68.2209 -main ()
 68.2210 -{
 68.2211 -
 68.2212 -  ;
 68.2213 -  return 0;
 68.2214 -}
 68.2215 -_ACEOF
 68.2216 -rm -f conftest.o conftest.obj
 68.2217 -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 68.2218 -  (eval $ac_compile) 2>&5
 68.2219 -  ac_status=$?
 68.2220 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2221 -  (exit $ac_status); }; then
 68.2222 -  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
 68.2223 -  case $ac_file in
 68.2224 -    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
 68.2225 -    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
 68.2226 -       break;;
 68.2227 -  esac
 68.2228 -done
 68.2229 -else
 68.2230 -  echo "$as_me: failed program was:" >&5
 68.2231 -sed 's/^/| /' conftest.$ac_ext >&5
 68.2232 -
 68.2233 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
 68.2234 -See \`config.log' for more details." >&5
 68.2235 -echo "$as_me: error: cannot compute suffix of object files: cannot compile
 68.2236 -See \`config.log' for more details." >&2;}
 68.2237 -   { (exit 1); exit 1; }; }
 68.2238 -fi
 68.2239 -
 68.2240 -rm -f conftest.$ac_cv_objext conftest.$ac_ext
 68.2241 -fi
 68.2242 -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
 68.2243 -echo "${ECHO_T}$ac_cv_objext" >&6
 68.2244 -OBJEXT=$ac_cv_objext
 68.2245 -ac_objext=$OBJEXT
 68.2246 -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
 68.2247 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
 68.2248 -if test "${ac_cv_c_compiler_gnu+set}" = set; then
 68.2249 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.2250 -else
 68.2251 -  cat >conftest.$ac_ext <<_ACEOF
 68.2252 -/* confdefs.h.  */
 68.2253 -_ACEOF
 68.2254 -cat confdefs.h >>conftest.$ac_ext
 68.2255 -cat >>conftest.$ac_ext <<_ACEOF
 68.2256 -/* end confdefs.h.  */
 68.2257 -
 68.2258 -int
 68.2259 -main ()
 68.2260 -{
 68.2261 -#ifndef __GNUC__
 68.2262 -       choke me
 68.2263 -#endif
 68.2264 -
 68.2265 -  ;
 68.2266 -  return 0;
 68.2267 -}
 68.2268 -_ACEOF
 68.2269 -rm -f conftest.$ac_objext
 68.2270 -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 68.2271 -  (eval $ac_compile) 2>conftest.er1
 68.2272 -  ac_status=$?
 68.2273 -  grep -v '^ *+' conftest.er1 >conftest.err
 68.2274 -  rm -f conftest.er1
 68.2275 -  cat conftest.err >&5
 68.2276 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2277 -  (exit $ac_status); } &&
 68.2278 -	 { ac_try='test -z "$ac_c_werror_flag"
 68.2279 -			 || test ! -s conftest.err'
 68.2280 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2281 -  (eval $ac_try) 2>&5
 68.2282 -  ac_status=$?
 68.2283 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2284 -  (exit $ac_status); }; } &&
 68.2285 -	 { ac_try='test -s conftest.$ac_objext'
 68.2286 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2287 -  (eval $ac_try) 2>&5
 68.2288 -  ac_status=$?
 68.2289 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2290 -  (exit $ac_status); }; }; then
 68.2291 -  ac_compiler_gnu=yes
 68.2292 -else
 68.2293 -  echo "$as_me: failed program was:" >&5
 68.2294 -sed 's/^/| /' conftest.$ac_ext >&5
 68.2295 -
 68.2296 -ac_compiler_gnu=no
 68.2297 -fi
 68.2298 -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 68.2299 -ac_cv_c_compiler_gnu=$ac_compiler_gnu
 68.2300 -
 68.2301 -fi
 68.2302 -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
 68.2303 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
 68.2304 -GCC=`test $ac_compiler_gnu = yes && echo yes`
 68.2305 -ac_test_CFLAGS=${CFLAGS+set}
 68.2306 -ac_save_CFLAGS=$CFLAGS
 68.2307 -CFLAGS="-g"
 68.2308 -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
 68.2309 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
 68.2310 -if test "${ac_cv_prog_cc_g+set}" = set; then
 68.2311 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.2312 -else
 68.2313 -  cat >conftest.$ac_ext <<_ACEOF
 68.2314 -/* confdefs.h.  */
 68.2315 -_ACEOF
 68.2316 -cat confdefs.h >>conftest.$ac_ext
 68.2317 -cat >>conftest.$ac_ext <<_ACEOF
 68.2318 -/* end confdefs.h.  */
 68.2319 -
 68.2320 -int
 68.2321 -main ()
 68.2322 -{
 68.2323 -
 68.2324 -  ;
 68.2325 -  return 0;
 68.2326 -}
 68.2327 -_ACEOF
 68.2328 -rm -f conftest.$ac_objext
 68.2329 -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 68.2330 -  (eval $ac_compile) 2>conftest.er1
 68.2331 -  ac_status=$?
 68.2332 -  grep -v '^ *+' conftest.er1 >conftest.err
 68.2333 -  rm -f conftest.er1
 68.2334 -  cat conftest.err >&5
 68.2335 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2336 -  (exit $ac_status); } &&
 68.2337 -	 { ac_try='test -z "$ac_c_werror_flag"
 68.2338 -			 || test ! -s conftest.err'
 68.2339 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2340 -  (eval $ac_try) 2>&5
 68.2341 -  ac_status=$?
 68.2342 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2343 -  (exit $ac_status); }; } &&
 68.2344 -	 { ac_try='test -s conftest.$ac_objext'
 68.2345 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2346 -  (eval $ac_try) 2>&5
 68.2347 -  ac_status=$?
 68.2348 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2349 -  (exit $ac_status); }; }; then
 68.2350 -  ac_cv_prog_cc_g=yes
 68.2351 -else
 68.2352 -  echo "$as_me: failed program was:" >&5
 68.2353 -sed 's/^/| /' conftest.$ac_ext >&5
 68.2354 -
 68.2355 -ac_cv_prog_cc_g=no
 68.2356 -fi
 68.2357 -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 68.2358 -fi
 68.2359 -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
 68.2360 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
 68.2361 -if test "$ac_test_CFLAGS" = set; then
 68.2362 -  CFLAGS=$ac_save_CFLAGS
 68.2363 -elif test $ac_cv_prog_cc_g = yes; then
 68.2364 -  if test "$GCC" = yes; then
 68.2365 -    CFLAGS="-g -O2"
 68.2366 -  else
 68.2367 -    CFLAGS="-g"
 68.2368 -  fi
 68.2369 -else
 68.2370 -  if test "$GCC" = yes; then
 68.2371 -    CFLAGS="-O2"
 68.2372 -  else
 68.2373 -    CFLAGS=
 68.2374 -  fi
 68.2375 -fi
 68.2376 -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
 68.2377 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
 68.2378 -if test "${ac_cv_prog_cc_stdc+set}" = set; then
 68.2379 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.2380 -else
 68.2381 -  ac_cv_prog_cc_stdc=no
 68.2382 -ac_save_CC=$CC
 68.2383 -cat >conftest.$ac_ext <<_ACEOF
 68.2384 -/* confdefs.h.  */
 68.2385 -_ACEOF
 68.2386 -cat confdefs.h >>conftest.$ac_ext
 68.2387 -cat >>conftest.$ac_ext <<_ACEOF
 68.2388 -/* end confdefs.h.  */
 68.2389 -#include <stdarg.h>
 68.2390 -#include <stdio.h>
 68.2391 -#include <sys/types.h>
 68.2392 -#include <sys/stat.h>
 68.2393 -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 68.2394 -struct buf { int x; };
 68.2395 -FILE * (*rcsopen) (struct buf *, struct stat *, int);
 68.2396 -static char *e (p, i)
 68.2397 -     char **p;
 68.2398 -     int i;
 68.2399 -{
 68.2400 -  return p[i];
 68.2401 -}
 68.2402 -static char *f (char * (*g) (char **, int), char **p, ...)
 68.2403 -{
 68.2404 -  char *s;
 68.2405 -  va_list v;
 68.2406 -  va_start (v,p);
 68.2407 -  s = g (p, va_arg (v,int));
 68.2408 -  va_end (v);
 68.2409 -  return s;
 68.2410 -}
 68.2411 -
 68.2412 -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
 68.2413 -   function prototypes and stuff, but not '\xHH' hex character constants.
 68.2414 -   These don't provoke an error unfortunately, instead are silently treated
 68.2415 -   as 'x'.  The following induces an error, until -std1 is added to get
 68.2416 -   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
 68.2417 -   array size at least.  It's necessary to write '\x00'==0 to get something
 68.2418 -   that's true only with -std1.  */
 68.2419 -int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 68.2420 -
 68.2421 -int test (int i, double x);
 68.2422 -struct s1 {int (*f) (int a);};
 68.2423 -struct s2 {int (*f) (double a);};
 68.2424 -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
 68.2425 -int argc;
 68.2426 -char **argv;
 68.2427 -int
 68.2428 -main ()
 68.2429 -{
 68.2430 -return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
 68.2431 -  ;
 68.2432 -  return 0;
 68.2433 -}
 68.2434 -_ACEOF
 68.2435 -# Don't try gcc -ansi; that turns off useful extensions and
 68.2436 -# breaks some systems' header files.
 68.2437 -# AIX			-qlanglvl=ansi
 68.2438 -# Ultrix and OSF/1	-std1
 68.2439 -# HP-UX 10.20 and later	-Ae
 68.2440 -# HP-UX older versions	-Aa -D_HPUX_SOURCE
 68.2441 -# SVR4			-Xc -D__EXTENSIONS__
 68.2442 -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 68.2443 -do
 68.2444 -  CC="$ac_save_CC $ac_arg"
 68.2445 -  rm -f conftest.$ac_objext
 68.2446 -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 68.2447 -  (eval $ac_compile) 2>conftest.er1
 68.2448 -  ac_status=$?
 68.2449 -  grep -v '^ *+' conftest.er1 >conftest.err
 68.2450 -  rm -f conftest.er1
 68.2451 -  cat conftest.err >&5
 68.2452 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2453 -  (exit $ac_status); } &&
 68.2454 -	 { ac_try='test -z "$ac_c_werror_flag"
 68.2455 -			 || test ! -s conftest.err'
 68.2456 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2457 -  (eval $ac_try) 2>&5
 68.2458 -  ac_status=$?
 68.2459 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2460 -  (exit $ac_status); }; } &&
 68.2461 -	 { ac_try='test -s conftest.$ac_objext'
 68.2462 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2463 -  (eval $ac_try) 2>&5
 68.2464 -  ac_status=$?
 68.2465 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2466 -  (exit $ac_status); }; }; then
 68.2467 -  ac_cv_prog_cc_stdc=$ac_arg
 68.2468 -break
 68.2469 -else
 68.2470 -  echo "$as_me: failed program was:" >&5
 68.2471 -sed 's/^/| /' conftest.$ac_ext >&5
 68.2472 -
 68.2473 -fi
 68.2474 -rm -f conftest.err conftest.$ac_objext
 68.2475 -done
 68.2476 -rm -f conftest.$ac_ext conftest.$ac_objext
 68.2477 -CC=$ac_save_CC
 68.2478 -
 68.2479 -fi
 68.2480 -
 68.2481 -case "x$ac_cv_prog_cc_stdc" in
 68.2482 -  x|xno)
 68.2483 -    echo "$as_me:$LINENO: result: none needed" >&5
 68.2484 -echo "${ECHO_T}none needed" >&6 ;;
 68.2485 -  *)
 68.2486 -    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
 68.2487 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
 68.2488 -    CC="$CC $ac_cv_prog_cc_stdc" ;;
 68.2489 -esac
 68.2490 -
 68.2491 -# Some people use a C++ compiler to compile C.  Since we use `exit',
 68.2492 -# in C++ we need to declare it.  In case someone uses the same compiler
 68.2493 -# for both compiling C and C++ we need to have the C++ compiler decide
 68.2494 -# the declaration of exit, since it's the most demanding environment.
 68.2495 -cat >conftest.$ac_ext <<_ACEOF
 68.2496 -#ifndef __cplusplus
 68.2497 -  choke me
 68.2498 -#endif
 68.2499 -_ACEOF
 68.2500 -rm -f conftest.$ac_objext
 68.2501 -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 68.2502 -  (eval $ac_compile) 2>conftest.er1
 68.2503 -  ac_status=$?
 68.2504 -  grep -v '^ *+' conftest.er1 >conftest.err
 68.2505 -  rm -f conftest.er1
 68.2506 -  cat conftest.err >&5
 68.2507 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2508 -  (exit $ac_status); } &&
 68.2509 -	 { ac_try='test -z "$ac_c_werror_flag"
 68.2510 -			 || test ! -s conftest.err'
 68.2511 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2512 -  (eval $ac_try) 2>&5
 68.2513 -  ac_status=$?
 68.2514 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2515 -  (exit $ac_status); }; } &&
 68.2516 -	 { ac_try='test -s conftest.$ac_objext'
 68.2517 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2518 -  (eval $ac_try) 2>&5
 68.2519 -  ac_status=$?
 68.2520 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2521 -  (exit $ac_status); }; }; then
 68.2522 -  for ac_declaration in \
 68.2523 -   '' \
 68.2524 -   'extern "C" void std::exit (int) throw (); using std::exit;' \
 68.2525 -   'extern "C" void std::exit (int); using std::exit;' \
 68.2526 -   'extern "C" void exit (int) throw ();' \
 68.2527 -   'extern "C" void exit (int);' \
 68.2528 -   'void exit (int);'
 68.2529 -do
 68.2530 -  cat >conftest.$ac_ext <<_ACEOF
 68.2531 -/* confdefs.h.  */
 68.2532 -_ACEOF
 68.2533 -cat confdefs.h >>conftest.$ac_ext
 68.2534 -cat >>conftest.$ac_ext <<_ACEOF
 68.2535 -/* end confdefs.h.  */
 68.2536 -$ac_declaration
 68.2537 -#include <stdlib.h>
 68.2538 -int
 68.2539 -main ()
 68.2540 -{
 68.2541 -exit (42);
 68.2542 -  ;
 68.2543 -  return 0;
 68.2544 -}
 68.2545 -_ACEOF
 68.2546 -rm -f conftest.$ac_objext
 68.2547 -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 68.2548 -  (eval $ac_compile) 2>conftest.er1
 68.2549 -  ac_status=$?
 68.2550 -  grep -v '^ *+' conftest.er1 >conftest.err
 68.2551 -  rm -f conftest.er1
 68.2552 -  cat conftest.err >&5
 68.2553 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2554 -  (exit $ac_status); } &&
 68.2555 -	 { ac_try='test -z "$ac_c_werror_flag"
 68.2556 -			 || test ! -s conftest.err'
 68.2557 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2558 -  (eval $ac_try) 2>&5
 68.2559 -  ac_status=$?
 68.2560 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2561 -  (exit $ac_status); }; } &&
 68.2562 -	 { ac_try='test -s conftest.$ac_objext'
 68.2563 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2564 -  (eval $ac_try) 2>&5
 68.2565 -  ac_status=$?
 68.2566 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2567 -  (exit $ac_status); }; }; then
 68.2568 -  :
 68.2569 -else
 68.2570 -  echo "$as_me: failed program was:" >&5
 68.2571 -sed 's/^/| /' conftest.$ac_ext >&5
 68.2572 -
 68.2573 -continue
 68.2574 -fi
 68.2575 -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 68.2576 -  cat >conftest.$ac_ext <<_ACEOF
 68.2577 -/* confdefs.h.  */
 68.2578 -_ACEOF
 68.2579 -cat confdefs.h >>conftest.$ac_ext
 68.2580 -cat >>conftest.$ac_ext <<_ACEOF
 68.2581 -/* end confdefs.h.  */
 68.2582 -$ac_declaration
 68.2583 -int
 68.2584 -main ()
 68.2585 -{
 68.2586 -exit (42);
 68.2587 -  ;
 68.2588 -  return 0;
 68.2589 -}
 68.2590 -_ACEOF
 68.2591 -rm -f conftest.$ac_objext
 68.2592 -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
 68.2593 -  (eval $ac_compile) 2>conftest.er1
 68.2594 -  ac_status=$?
 68.2595 -  grep -v '^ *+' conftest.er1 >conftest.err
 68.2596 -  rm -f conftest.er1
 68.2597 -  cat conftest.err >&5
 68.2598 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2599 -  (exit $ac_status); } &&
 68.2600 -	 { ac_try='test -z "$ac_c_werror_flag"
 68.2601 -			 || test ! -s conftest.err'
 68.2602 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2603 -  (eval $ac_try) 2>&5
 68.2604 -  ac_status=$?
 68.2605 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2606 -  (exit $ac_status); }; } &&
 68.2607 -	 { ac_try='test -s conftest.$ac_objext'
 68.2608 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2609 -  (eval $ac_try) 2>&5
 68.2610 -  ac_status=$?
 68.2611 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2612 -  (exit $ac_status); }; }; then
 68.2613 -  break
 68.2614 -else
 68.2615 -  echo "$as_me: failed program was:" >&5
 68.2616 -sed 's/^/| /' conftest.$ac_ext >&5
 68.2617 -
 68.2618 -fi
 68.2619 -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 68.2620 -done
 68.2621 -rm -f conftest*
 68.2622 -if test -n "$ac_declaration"; then
 68.2623 -  echo '#ifdef __cplusplus' >>confdefs.h
 68.2624 -  echo $ac_declaration      >>confdefs.h
 68.2625 -  echo '#endif'             >>confdefs.h
 68.2626 -fi
 68.2627 -
 68.2628 -else
 68.2629 -  echo "$as_me: failed program was:" >&5
 68.2630 -sed 's/^/| /' conftest.$ac_ext >&5
 68.2631 -
 68.2632 -fi
 68.2633 -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 68.2634 -ac_ext=c
 68.2635 -ac_cpp='$CPP $CPPFLAGS'
 68.2636 -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 68.2637 -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 68.2638 -ac_compiler_gnu=$ac_cv_c_compiler_gnu
 68.2639 -DEPDIR="${am__leading_dot}deps"
 68.2640 -
 68.2641 -          ac_config_commands="$ac_config_commands depfiles"
 68.2642 -
 68.2643 -
 68.2644 -am_make=${MAKE-make}
 68.2645 -cat > confinc << 'END'
 68.2646 -am__doit:
 68.2647 -	@echo done
 68.2648 -.PHONY: am__doit
 68.2649 -END
 68.2650 -# If we don't find an include directive, just comment out the code.
 68.2651 -echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
 68.2652 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
 68.2653 -am__include="#"
 68.2654 -am__quote=
 68.2655 -_am_result=none
 68.2656 -# First try GNU make style include.
 68.2657 -echo "include confinc" > confmf
 68.2658 -# We grep out `Entering directory' and `Leaving directory'
 68.2659 -# messages which can occur if `w' ends up in MAKEFLAGS.
 68.2660 -# In particular we don't look at `^make:' because GNU make might
 68.2661 -# be invoked under some other name (usually "gmake"), in which
 68.2662 -# case it prints its new name instead of `make'.
 68.2663 -if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
 68.2664 -   am__include=include
 68.2665 -   am__quote=
 68.2666 -   _am_result=GNU
 68.2667 -fi
 68.2668 -# Now try BSD make style include.
 68.2669 -if test "$am__include" = "#"; then
 68.2670 -   echo '.include "confinc"' > confmf
 68.2671 -   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
 68.2672 -      am__include=.include
 68.2673 -      am__quote="\""
 68.2674 -      _am_result=BSD
 68.2675 -   fi
 68.2676 -fi
 68.2677 -
 68.2678 -
 68.2679 -echo "$as_me:$LINENO: result: $_am_result" >&5
 68.2680 -echo "${ECHO_T}$_am_result" >&6
 68.2681 -rm -f confinc confmf
 68.2682 -
 68.2683 -# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
 68.2684 -if test "${enable_dependency_tracking+set}" = set; then
 68.2685 -  enableval="$enable_dependency_tracking"
 68.2686 -
 68.2687 -fi;
 68.2688 -if test "x$enable_dependency_tracking" != xno; then
 68.2689 -  am_depcomp="$ac_aux_dir/depcomp"
 68.2690 -  AMDEPBACKSLASH='\'
 68.2691 -fi
 68.2692 -
 68.2693 -
 68.2694 -if test "x$enable_dependency_tracking" != xno; then
 68.2695 -  AMDEP_TRUE=
 68.2696 -  AMDEP_FALSE='#'
 68.2697 -else
 68.2698 -  AMDEP_TRUE='#'
 68.2699 -  AMDEP_FALSE=
 68.2700 -fi
 68.2701 -
 68.2702 -
 68.2703 -
 68.2704 -
 68.2705 -depcc="$CC"   am_compiler_list=
 68.2706 -
 68.2707 -echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
 68.2708 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
 68.2709 -if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
 68.2710 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.2711 -else
 68.2712 -  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
 68.2713 -  # We make a subdir and do the tests there.  Otherwise we can end up
 68.2714 -  # making bogus files that we don't know about and never remove.  For
 68.2715 -  # instance it was reported that on HP-UX the gcc test will end up
 68.2716 -  # making a dummy file named `D' -- because `-MD' means `put the output
 68.2717 -  # in D'.
 68.2718 -  mkdir conftest.dir
 68.2719 -  # Copy depcomp to subdir because otherwise we won't find it if we're
 68.2720 -  # using a relative directory.
 68.2721 -  cp "$am_depcomp" conftest.dir
 68.2722 -  cd conftest.dir
 68.2723 -  # We will build objects and dependencies in a subdirectory because
 68.2724 -  # it helps to detect inapplicable dependency modes.  For instance
 68.2725 -  # both Tru64's cc and ICC support -MD to output dependencies as a
 68.2726 -  # side effect of compilation, but ICC will put the dependencies in
 68.2727 -  # the current directory while Tru64 will put them in the object
 68.2728 -  # directory.
 68.2729 -  mkdir sub
 68.2730 -
 68.2731 -  am_cv_CC_dependencies_compiler_type=none
 68.2732 -  if test "$am_compiler_list" = ""; then
 68.2733 -     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
 68.2734 -  fi
 68.2735 -  for depmode in $am_compiler_list; do
 68.2736 -    # Setup a source with many dependencies, because some compilers
 68.2737 -    # like to wrap large dependency lists on column 80 (with \), and
 68.2738 -    # we should not choose a depcomp mode which is confused by this.
 68.2739 -    #
 68.2740 -    # We need to recreate these files for each test, as the compiler may
 68.2741 -    # overwrite some of them when testing with obscure command lines.
 68.2742 -    # This happens at least with the AIX C compiler.
 68.2743 -    : > sub/conftest.c
 68.2744 -    for i in 1 2 3 4 5 6; do
 68.2745 -      echo '#include "conftst'$i'.h"' >> sub/conftest.c
 68.2746 -      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
 68.2747 -      # Solaris 8's {/usr,}/bin/sh.
 68.2748 -      touch sub/conftst$i.h
 68.2749 -    done
 68.2750 -    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 68.2751 -
 68.2752 -    case $depmode in
 68.2753 -    nosideeffect)
 68.2754 -      # after this tag, mechanisms are not by side-effect, so they'll
 68.2755 -      # only be used when explicitly requested
 68.2756 -      if test "x$enable_dependency_tracking" = xyes; then
 68.2757 -	continue
 68.2758 -      else
 68.2759 -	break
 68.2760 -      fi
 68.2761 -      ;;
 68.2762 -    none) break ;;
 68.2763 -    esac
 68.2764 -    # We check with `-c' and `-o' for the sake of the "dashmstdout"
 68.2765 -    # mode.  It turns out that the SunPro C++ compiler does not properly
 68.2766 -    # handle `-M -o', and we need to detect this.
 68.2767 -    if depmode=$depmode \
 68.2768 -       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
 68.2769 -       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
 68.2770 -       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
 68.2771 -         >/dev/null 2>conftest.err &&
 68.2772 -       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
 68.2773 -       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
 68.2774 -       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
 68.2775 -      # icc doesn't choke on unknown options, it will just issue warnings
 68.2776 -      # or remarks (even with -Werror).  So we grep stderr for any message
 68.2777 -      # that says an option was ignored or not supported.
 68.2778 -      # When given -MP, icc 7.0 and 7.1 complain thusly:
 68.2779 -      #   icc: Command line warning: ignoring option '-M'; no argument required
 68.2780 -      # The diagnosis changed in icc 8.0:
 68.2781 -      #   icc: Command line remark: option '-MP' not supported
 68.2782 -      if (grep 'ignoring option' conftest.err ||
 68.2783 -          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
 68.2784 -        am_cv_CC_dependencies_compiler_type=$depmode
 68.2785 -        break
 68.2786 -      fi
 68.2787 -    fi
 68.2788 -  done
 68.2789 -
 68.2790 -  cd ..
 68.2791 -  rm -rf conftest.dir
 68.2792 -else
 68.2793 -  am_cv_CC_dependencies_compiler_type=none
 68.2794 -fi
 68.2795 -
 68.2796 -fi
 68.2797 -echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
 68.2798 -echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
 68.2799 -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 68.2800 -
 68.2801 -
 68.2802 -
 68.2803 -if
 68.2804 -  test "x$enable_dependency_tracking" != xno \
 68.2805 -  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
 68.2806 -  am__fastdepCC_TRUE=
 68.2807 -  am__fastdepCC_FALSE='#'
 68.2808 -else
 68.2809 -  am__fastdepCC_TRUE='#'
 68.2810 -  am__fastdepCC_FALSE=
 68.2811 -fi
 68.2812 -
 68.2813 -
 68.2814 -#AC_PROG_INSTALL
 68.2815 -
 68.2816 -# Right now, we can assume that the lib/ and ramdisk/ directories
 68.2817 -# are two levels above the tests
 68.2818 -TESTLIB=../../lib
 68.2819 -RD_PATH=../../ramdisk
 68.2820 -TENV="PYTHONPATH=$PYTHONPATH:$TESTLIB:/usr/lib/python RD_PATH=$RD_PATH"
 68.2821 -
 68.2822 -# Check whether --enable-vmx-support or --disable-vmx-support was given.
 68.2823 -if test "${enable_vmx_support+set}" = set; then
 68.2824 -  enableval="$enable_vmx_support"
 68.2825 -
 68.2826 -		ENABLE_VMX=True
 68.2827 -
 68.2828 -else
 68.2829 -
 68.2830 -		ENABLE_VMX=False
 68.2831 -
 68.2832 -fi;
 68.2833 -
 68.2834 -
 68.2835 -
 68.2836 -
 68.2837 -
 68.2838 -
 68.2839 -for ac_prog in 'bison -y' byacc
 68.2840 -do
 68.2841 -  # Extract the first word of "$ac_prog", so it can be a program name with args.
 68.2842 -set dummy $ac_prog; ac_word=$2
 68.2843 -echo "$as_me:$LINENO: checking for $ac_word" >&5
 68.2844 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 68.2845 -if test "${ac_cv_prog_YACC+set}" = set; then
 68.2846 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.2847 -else
 68.2848 -  if test -n "$YACC"; then
 68.2849 -  ac_cv_prog_YACC="$YACC" # Let the user override the test.
 68.2850 -else
 68.2851 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 68.2852 -for as_dir in $PATH
 68.2853 -do
 68.2854 -  IFS=$as_save_IFS
 68.2855 -  test -z "$as_dir" && as_dir=.
 68.2856 -  for ac_exec_ext in '' $ac_executable_extensions; do
 68.2857 -  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 68.2858 -    ac_cv_prog_YACC="$ac_prog"
 68.2859 -    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 68.2860 -    break 2
 68.2861 -  fi
 68.2862 -done
 68.2863 -done
 68.2864 -
 68.2865 -fi
 68.2866 -fi
 68.2867 -YACC=$ac_cv_prog_YACC
 68.2868 -if test -n "$YACC"; then
 68.2869 -  echo "$as_me:$LINENO: result: $YACC" >&5
 68.2870 -echo "${ECHO_T}$YACC" >&6
 68.2871 -else
 68.2872 -  echo "$as_me:$LINENO: result: no" >&5
 68.2873 -echo "${ECHO_T}no" >&6
 68.2874 -fi
 68.2875 -
 68.2876 -  test -n "$YACC" && break
 68.2877 -done
 68.2878 -test -n "$YACC" || YACC="yacc"
 68.2879 -
 68.2880 -
 68.2881 -for ac_prog in flex lex
 68.2882 -do
 68.2883 -  # Extract the first word of "$ac_prog", so it can be a program name with args.
 68.2884 -set dummy $ac_prog; ac_word=$2
 68.2885 -echo "$as_me:$LINENO: checking for $ac_word" >&5
 68.2886 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 68.2887 -if test "${ac_cv_prog_LEX+set}" = set; then
 68.2888 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.2889 -else
 68.2890 -  if test -n "$LEX"; then
 68.2891 -  ac_cv_prog_LEX="$LEX" # Let the user override the test.
 68.2892 -else
 68.2893 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 68.2894 -for as_dir in $PATH
 68.2895 -do
 68.2896 -  IFS=$as_save_IFS
 68.2897 -  test -z "$as_dir" && as_dir=.
 68.2898 -  for ac_exec_ext in '' $ac_executable_extensions; do
 68.2899 -  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
 68.2900 -    ac_cv_prog_LEX="$ac_prog"
 68.2901 -    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 68.2902 -    break 2
 68.2903 -  fi
 68.2904 -done
 68.2905 -done
 68.2906 -
 68.2907 -fi
 68.2908 -fi
 68.2909 -LEX=$ac_cv_prog_LEX
 68.2910 -if test -n "$LEX"; then
 68.2911 -  echo "$as_me:$LINENO: result: $LEX" >&5
 68.2912 -echo "${ECHO_T}$LEX" >&6
 68.2913 -else
 68.2914 -  echo "$as_me:$LINENO: result: no" >&5
 68.2915 -echo "${ECHO_T}no" >&6
 68.2916 -fi
 68.2917 -
 68.2918 -  test -n "$LEX" && break
 68.2919 -done
 68.2920 -test -n "$LEX" || LEX=":"
 68.2921 -
 68.2922 -if test -z "$LEXLIB"
 68.2923 -then
 68.2924 -  echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5
 68.2925 -echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6
 68.2926 -if test "${ac_cv_lib_fl_yywrap+set}" = set; then
 68.2927 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.2928 -else
 68.2929 -  ac_check_lib_save_LIBS=$LIBS
 68.2930 -LIBS="-lfl  $LIBS"
 68.2931 -cat >conftest.$ac_ext <<_ACEOF
 68.2932 -/* confdefs.h.  */
 68.2933 -_ACEOF
 68.2934 -cat confdefs.h >>conftest.$ac_ext
 68.2935 -cat >>conftest.$ac_ext <<_ACEOF
 68.2936 -/* end confdefs.h.  */
 68.2937 -
 68.2938 -/* Override any gcc2 internal prototype to avoid an error.  */
 68.2939 -#ifdef __cplusplus
 68.2940 -extern "C"
 68.2941 -#endif
 68.2942 -/* We use char because int might match the return type of a gcc2
 68.2943 -   builtin and then its argument prototype would still apply.  */
 68.2944 -char yywrap ();
 68.2945 -int
 68.2946 -main ()
 68.2947 -{
 68.2948 -yywrap ();
 68.2949 -  ;
 68.2950 -  return 0;
 68.2951 -}
 68.2952 -_ACEOF
 68.2953 -rm -f conftest.$ac_objext conftest$ac_exeext
 68.2954 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 68.2955 -  (eval $ac_link) 2>conftest.er1
 68.2956 -  ac_status=$?
 68.2957 -  grep -v '^ *+' conftest.er1 >conftest.err
 68.2958 -  rm -f conftest.er1
 68.2959 -  cat conftest.err >&5
 68.2960 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2961 -  (exit $ac_status); } &&
 68.2962 -	 { ac_try='test -z "$ac_c_werror_flag"
 68.2963 -			 || test ! -s conftest.err'
 68.2964 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2965 -  (eval $ac_try) 2>&5
 68.2966 -  ac_status=$?
 68.2967 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2968 -  (exit $ac_status); }; } &&
 68.2969 -	 { ac_try='test -s conftest$ac_exeext'
 68.2970 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.2971 -  (eval $ac_try) 2>&5
 68.2972 -  ac_status=$?
 68.2973 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.2974 -  (exit $ac_status); }; }; then
 68.2975 -  ac_cv_lib_fl_yywrap=yes
 68.2976 -else
 68.2977 -  echo "$as_me: failed program was:" >&5
 68.2978 -sed 's/^/| /' conftest.$ac_ext >&5
 68.2979 -
 68.2980 -ac_cv_lib_fl_yywrap=no
 68.2981 -fi
 68.2982 -rm -f conftest.err conftest.$ac_objext \
 68.2983 -      conftest$ac_exeext conftest.$ac_ext
 68.2984 -LIBS=$ac_check_lib_save_LIBS
 68.2985 -fi
 68.2986 -echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5
 68.2987 -echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6
 68.2988 -if test $ac_cv_lib_fl_yywrap = yes; then
 68.2989 -  LEXLIB="-lfl"
 68.2990 -else
 68.2991 -  echo "$as_me:$LINENO: checking for yywrap in -ll" >&5
 68.2992 -echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6
 68.2993 -if test "${ac_cv_lib_l_yywrap+set}" = set; then
 68.2994 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.2995 -else
 68.2996 -  ac_check_lib_save_LIBS=$LIBS
 68.2997 -LIBS="-ll  $LIBS"
 68.2998 -cat >conftest.$ac_ext <<_ACEOF
 68.2999 -/* confdefs.h.  */
 68.3000 -_ACEOF
 68.3001 -cat confdefs.h >>conftest.$ac_ext
 68.3002 -cat >>conftest.$ac_ext <<_ACEOF
 68.3003 -/* end confdefs.h.  */
 68.3004 -
 68.3005 -/* Override any gcc2 internal prototype to avoid an error.  */
 68.3006 -#ifdef __cplusplus
 68.3007 -extern "C"
 68.3008 -#endif
 68.3009 -/* We use char because int might match the return type of a gcc2
 68.3010 -   builtin and then its argument prototype would still apply.  */
 68.3011 -char yywrap ();
 68.3012 -int
 68.3013 -main ()
 68.3014 -{
 68.3015 -yywrap ();
 68.3016 -  ;
 68.3017 -  return 0;
 68.3018 -}
 68.3019 -_ACEOF
 68.3020 -rm -f conftest.$ac_objext conftest$ac_exeext
 68.3021 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 68.3022 -  (eval $ac_link) 2>conftest.er1
 68.3023 -  ac_status=$?
 68.3024 -  grep -v '^ *+' conftest.er1 >conftest.err
 68.3025 -  rm -f conftest.er1
 68.3026 -  cat conftest.err >&5
 68.3027 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.3028 -  (exit $ac_status); } &&
 68.3029 -	 { ac_try='test -z "$ac_c_werror_flag"
 68.3030 -			 || test ! -s conftest.err'
 68.3031 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.3032 -  (eval $ac_try) 2>&5
 68.3033 -  ac_status=$?
 68.3034 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.3035 -  (exit $ac_status); }; } &&
 68.3036 -	 { ac_try='test -s conftest$ac_exeext'
 68.3037 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.3038 -  (eval $ac_try) 2>&5
 68.3039 -  ac_status=$?
 68.3040 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.3041 -  (exit $ac_status); }; }; then
 68.3042 -  ac_cv_lib_l_yywrap=yes
 68.3043 -else
 68.3044 -  echo "$as_me: failed program was:" >&5
 68.3045 -sed 's/^/| /' conftest.$ac_ext >&5
 68.3046 -
 68.3047 -ac_cv_lib_l_yywrap=no
 68.3048 -fi
 68.3049 -rm -f conftest.err conftest.$ac_objext \
 68.3050 -      conftest$ac_exeext conftest.$ac_ext
 68.3051 -LIBS=$ac_check_lib_save_LIBS
 68.3052 -fi
 68.3053 -echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5
 68.3054 -echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6
 68.3055 -if test $ac_cv_lib_l_yywrap = yes; then
 68.3056 -  LEXLIB="-ll"
 68.3057 -fi
 68.3058 -
 68.3059 -fi
 68.3060 -
 68.3061 -fi
 68.3062 -
 68.3063 -if test "x$LEX" != "x:"; then
 68.3064 -  echo "$as_me:$LINENO: checking lex output file root" >&5
 68.3065 -echo $ECHO_N "checking lex output file root... $ECHO_C" >&6
 68.3066 -if test "${ac_cv_prog_lex_root+set}" = set; then
 68.3067 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.3068 -else
 68.3069 -  # The minimal lex program is just a single line: %%.  But some broken lexes
 68.3070 -# (Solaris, I think it was) want two %% lines, so accommodate them.
 68.3071 -cat >conftest.l <<_ACEOF
 68.3072 -%%
 68.3073 -%%
 68.3074 -_ACEOF
 68.3075 -{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5
 68.3076 -  (eval $LEX conftest.l) 2>&5
 68.3077 -  ac_status=$?
 68.3078 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.3079 -  (exit $ac_status); }
 68.3080 -if test -f lex.yy.c; then
 68.3081 -  ac_cv_prog_lex_root=lex.yy
 68.3082 -elif test -f lexyy.c; then
 68.3083 -  ac_cv_prog_lex_root=lexyy
 68.3084 -else
 68.3085 -  { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
 68.3086 -echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
 68.3087 -   { (exit 1); exit 1; }; }
 68.3088 -fi
 68.3089 -fi
 68.3090 -echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
 68.3091 -echo "${ECHO_T}$ac_cv_prog_lex_root" >&6
 68.3092 -rm -f conftest.l
 68.3093 -LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 68.3094 -
 68.3095 -echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
 68.3096 -echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6
 68.3097 -if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
 68.3098 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 68.3099 -else
 68.3100 -  # POSIX says lex can declare yytext either as a pointer or an array; the
 68.3101 -# default is implementation-dependent. Figure out which it is, since
 68.3102 -# not all implementations provide the %pointer and %array declarations.
 68.3103 -ac_cv_prog_lex_yytext_pointer=no
 68.3104 -echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
 68.3105 -ac_save_LIBS=$LIBS
 68.3106 -LIBS="$LIBS $LEXLIB"
 68.3107 -cat >conftest.$ac_ext <<_ACEOF
 68.3108 -`cat $LEX_OUTPUT_ROOT.c`
 68.3109 -_ACEOF
 68.3110 -rm -f conftest.$ac_objext conftest$ac_exeext
 68.3111 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 68.3112 -  (eval $ac_link) 2>conftest.er1
 68.3113 -  ac_status=$?
 68.3114 -  grep -v '^ *+' conftest.er1 >conftest.err
 68.3115 -  rm -f conftest.er1
 68.3116 -  cat conftest.err >&5
 68.3117 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.3118 -  (exit $ac_status); } &&
 68.3119 -	 { ac_try='test -z "$ac_c_werror_flag"
 68.3120 -			 || test ! -s conftest.err'
 68.3121 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.3122 -  (eval $ac_try) 2>&5
 68.3123 -  ac_status=$?
 68.3124 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.3125 -  (exit $ac_status); }; } &&
 68.3126 -	 { ac_try='test -s conftest$ac_exeext'
 68.3127 -  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
 68.3128 -  (eval $ac_try) 2>&5
 68.3129 -  ac_status=$?
 68.3130 -  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 68.3131 -  (exit $ac_status); }; }; then
 68.3132 -  ac_cv_prog_lex_yytext_pointer=yes
 68.3133 -else
 68.3134 -  echo "$as_me: failed program was:" >&5
 68.3135 -sed 's/^/| /' conftest.$ac_ext >&5
 68.3136 -
 68.3137 -fi
 68.3138 -rm -f conftest.err conftest.$ac_objext \
 68.3139 -      conftest$ac_exeext conftest.$ac_ext
 68.3140 -LIBS=$ac_save_LIBS
 68.3141 -rm -f "${LEX_OUTPUT_ROOT}.c"
 68.3142 -
 68.3143 -fi
 68.3144 -echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
 68.3145 -echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6
 68.3146 -if test $ac_cv_prog_lex_yytext_pointer = yes; then
 68.3147 -
 68.3148 -cat >>confdefs.h <<\_ACEOF
 68.3149 -#define YYTEXT_POINTER 1
 68.3150 -_ACEOF
 68.3151 -
 68.3152 -fi
 68.3153 -
 68.3154 -fi
 68.3155 -
 68.3156 -# basic build files
 68.3157 -                                                                                                                                                                                                                                                                                                                      ac_config_files="$ac_config_files Makefile ramdisk/Makefile tests/Makefile tests/block-list/Makefile tests/block-create/Makefile tests/block-destroy/Makefile tests/console/Makefile tests/create/Makefile tests/destroy/Makefile tests/dmesg/Makefile tests/domid/Makefile tests/domname/Makefile tests/help/Makefile tests/info/Makefile tests/list/Makefile tests/memmax/Makefile tests/memset/Makefile tests/migrate/Makefile tests/pause/Makefile tests/reboot/Makefile tests/restore/Makefile tests/save/Makefile tests/sedf/Makefile tests/shutdown/Makefile tests/sysrq/Makefile tests/unpause/Makefile tests/vcpu-pin/Makefile tests/vcpu-disable/Makefile tests/enforce_dom0_cpus/Makefile lib/XmTestReport/xmtest.py lib/XmTestLib/config.py"
 68.3158 -
 68.3159 -
 68.3160 -
 68.3161 -cat >confcache <<\_ACEOF
 68.3162 -# This file is a shell script that caches the results of configure
 68.3163 -# tests run on this system so they can be shared between configure
 68.3164 -# scripts and configure runs, see configure's option --config-cache.
 68.3165 -# It is not useful on other systems.  If it contains results you don't
 68.3166 -# want to keep, you may remove or edit it.
 68.3167 -#
 68.3168 -# config.status only pays attention to the cache file if you give it
 68.3169 -# the --recheck option to rerun configure.
 68.3170 -#
 68.3171 -# `ac_cv_env_foo' variables (set or unset) will be overridden when
 68.3172 -# loading this file, other *unset* `ac_cv_foo' will be assigned the
 68.3173 -# following values.
 68.3174 -
 68.3175 -_ACEOF
 68.3176 -
 68.3177 -# The following way of writing the cache mishandles newlines in values,
 68.3178 -# but we know of no workaround that is simple, portable, and efficient.
 68.3179 -# So, don't put newlines in cache variables' values.
 68.3180 -# Ultrix sh set writes to stderr and can't be redirected directly,
 68.3181 -# and sets the high bit in the cache file unless we assign to the vars.
 68.3182 -{
 68.3183 -  (set) 2>&1 |
 68.3184 -    case `(ac_space=' '; set | grep ac_space) 2>&1` in
 68.3185 -    *ac_space=\ *)
 68.3186 -      # `set' does not quote correctly, so add quotes (double-quote
 68.3187 -      # substitution turns \\\\ into \\, and sed turns \\ into \).
 68.3188 -      sed -n \
 68.3189 -	"s/'/'\\\\''/g;