direct-io.hg

changeset 6854:b35215021b32

Merge with latest xen-unstable
author djm@kirby.fc.hp.com
date Tue Sep 13 10:14:16 2005 -0600 (2005-09-13)
parents d4d880fcef28 e7c7196fa329
children 5cd24dd33033
files .hgignore Config.mk Makefile buildconfigs/Rules.mk buildconfigs/mk.linux-2.6-xen buildconfigs/mk.linux-2.6-xen0 buildconfigs/mk.linux-2.6-xenU docs/Doxyfile docs/Doxyfilter docs/Makefile docs/misc/vtpm.txt docs/pythfilter.py docs/src/user.tex extras/mini-os/Makefile extras/mini-os/README extras/mini-os/domain_config extras/mini-os/events.c extras/mini-os/include/ctype.h extras/mini-os/include/err.h extras/mini-os/include/errno-base.h extras/mini-os/include/errno.h extras/mini-os/include/events.h extras/mini-os/include/fcntl.h extras/mini-os/include/hypervisor.h extras/mini-os/include/lib.h extras/mini-os/include/list.h extras/mini-os/include/mm.h extras/mini-os/include/os.h extras/mini-os/include/sched.h extras/mini-os/include/semaphore.h extras/mini-os/include/time.h extras/mini-os/include/traps.h extras/mini-os/include/types.h extras/mini-os/include/wait.h extras/mini-os/include/xenbus.h extras/mini-os/include/xmalloc.h extras/mini-os/kernel.c extras/mini-os/lib/printf.c extras/mini-os/lib/string.c extras/mini-os/lib/xmalloc.c extras/mini-os/mm.c extras/mini-os/sched.c extras/mini-os/time.c extras/mini-os/traps.c extras/mini-os/xenbus/Makefile extras/mini-os/xenbus/xenbus_comms.c extras/mini-os/xenbus/xenbus_comms.h extras/mini-os/xenbus/xenbus_xs.c linux-2.4-xen-sparse/Makefile linux-2.4-xen-sparse/arch/xen/Makefile linux-2.4-xen-sparse/arch/xen/boot/Makefile linux-2.4-xen-sparse/arch/xen/config.in linux-2.4-xen-sparse/arch/xen/defconfig-xen0 linux-2.4-xen-sparse/arch/xen/defconfig-xenU linux-2.4-xen-sparse/arch/xen/drivers/balloon/Makefile linux-2.4-xen-sparse/arch/xen/drivers/blkif/Makefile linux-2.4-xen-sparse/arch/xen/drivers/blkif/backend/Makefile linux-2.4-xen-sparse/arch/xen/drivers/blkif/frontend/Makefile linux-2.4-xen-sparse/arch/xen/drivers/blkif/frontend/common.h linux-2.4-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c linux-2.4-xen-sparse/arch/xen/drivers/console/Makefile linux-2.4-xen-sparse/arch/xen/drivers/dom0/Makefile linux-2.4-xen-sparse/arch/xen/drivers/evtchn/Makefile linux-2.4-xen-sparse/arch/xen/drivers/netif/Makefile linux-2.4-xen-sparse/arch/xen/drivers/netif/backend/Makefile linux-2.4-xen-sparse/arch/xen/drivers/netif/frontend/Makefile linux-2.4-xen-sparse/arch/xen/kernel/Makefile linux-2.4-xen-sparse/arch/xen/kernel/entry.S linux-2.4-xen-sparse/arch/xen/kernel/head.S linux-2.4-xen-sparse/arch/xen/kernel/i386_ksyms.c linux-2.4-xen-sparse/arch/xen/kernel/irq.c linux-2.4-xen-sparse/arch/xen/kernel/ldt.c linux-2.4-xen-sparse/arch/xen/kernel/pci-pc.c linux-2.4-xen-sparse/arch/xen/kernel/process.c linux-2.4-xen-sparse/arch/xen/kernel/setup.c linux-2.4-xen-sparse/arch/xen/kernel/signal.c linux-2.4-xen-sparse/arch/xen/kernel/time.c linux-2.4-xen-sparse/arch/xen/kernel/traps.c linux-2.4-xen-sparse/arch/xen/lib/Makefile linux-2.4-xen-sparse/arch/xen/lib/delay.c linux-2.4-xen-sparse/arch/xen/mm/Makefile linux-2.4-xen-sparse/arch/xen/mm/fault.c linux-2.4-xen-sparse/arch/xen/mm/init.c linux-2.4-xen-sparse/arch/xen/mm/ioremap.c linux-2.4-xen-sparse/arch/xen/vmlinux.lds linux-2.4-xen-sparse/drivers/block/ll_rw_blk.c linux-2.4-xen-sparse/drivers/char/Makefile linux-2.4-xen-sparse/drivers/char/mem.c linux-2.4-xen-sparse/drivers/char/tty_io.c linux-2.4-xen-sparse/drivers/scsi/aic7xxx/Makefile linux-2.4-xen-sparse/include/asm-xen/bugs.h linux-2.4-xen-sparse/include/asm-xen/desc.h linux-2.4-xen-sparse/include/asm-xen/fixmap.h linux-2.4-xen-sparse/include/asm-xen/highmem.h linux-2.4-xen-sparse/include/asm-xen/hw_irq.h linux-2.4-xen-sparse/include/asm-xen/io.h linux-2.4-xen-sparse/include/asm-xen/irq.h linux-2.4-xen-sparse/include/asm-xen/keyboard.h linux-2.4-xen-sparse/include/asm-xen/mmu_context.h linux-2.4-xen-sparse/include/asm-xen/module.h linux-2.4-xen-sparse/include/asm-xen/page.h linux-2.4-xen-sparse/include/asm-xen/pci.h linux-2.4-xen-sparse/include/asm-xen/pgalloc.h linux-2.4-xen-sparse/include/asm-xen/pgtable-2level.h linux-2.4-xen-sparse/include/asm-xen/pgtable.h linux-2.4-xen-sparse/include/asm-xen/processor.h linux-2.4-xen-sparse/include/asm-xen/queues.h linux-2.4-xen-sparse/include/asm-xen/segment.h linux-2.4-xen-sparse/include/asm-xen/smp.h linux-2.4-xen-sparse/include/asm-xen/system.h linux-2.4-xen-sparse/include/asm-xen/vga.h linux-2.4-xen-sparse/include/asm-xen/xor.h linux-2.4-xen-sparse/include/linux/blk.h linux-2.4-xen-sparse/include/linux/highmem.h linux-2.4-xen-sparse/include/linux/irq.h linux-2.4-xen-sparse/include/linux/mm.h linux-2.4-xen-sparse/include/linux/sched.h linux-2.4-xen-sparse/include/linux/skbuff.h linux-2.4-xen-sparse/include/linux/timer.h linux-2.4-xen-sparse/kernel/time.c linux-2.4-xen-sparse/kernel/timer.c linux-2.4-xen-sparse/mkbuildtree linux-2.4-xen-sparse/mm/highmem.c linux-2.4-xen-sparse/mm/memory.c linux-2.4-xen-sparse/mm/mprotect.c linux-2.4-xen-sparse/mm/mremap.c linux-2.4-xen-sparse/mm/page_alloc.c linux-2.4-xen-sparse/net/core/skbuff.c linux-2.6-xen-sparse/arch/xen/Kconfig linux-2.6-xen-sparse/arch/xen/Kconfig.drivers linux-2.6-xen-sparse/arch/xen/Makefile linux-2.6-xen-sparse/arch/xen/boot/Makefile linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32 linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_64 linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32 linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_64 linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_32 linux-2.6-xen-sparse/arch/xen/configs/xen_defconfig_x86_64 linux-2.6-xen-sparse/arch/xen/i386/Kconfig linux-2.6-xen-sparse/arch/xen/i386/Makefile linux-2.6-xen-sparse/arch/xen/i386/kernel/Makefile linux-2.6-xen-sparse/arch/xen/i386/kernel/acpi/Makefile linux-2.6-xen-sparse/arch/xen/i386/kernel/acpi/boot.c linux-2.6-xen-sparse/arch/xen/i386/kernel/apic.c linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/Makefile linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/common.c linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/Makefile linux-2.6-xen-sparse/arch/xen/i386/kernel/cpu/mtrr/main.c linux-2.6-xen-sparse/arch/xen/i386/kernel/entry.S linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S linux-2.6-xen-sparse/arch/xen/i386/kernel/i386_ksyms.c linux-2.6-xen-sparse/arch/xen/i386/kernel/init_task.c linux-2.6-xen-sparse/arch/xen/i386/kernel/io_apic.c linux-2.6-xen-sparse/arch/xen/i386/kernel/ioport.c linux-2.6-xen-sparse/arch/xen/i386/kernel/irq.c linux-2.6-xen-sparse/arch/xen/i386/kernel/ldt.c linux-2.6-xen-sparse/arch/xen/i386/kernel/microcode.c linux-2.6-xen-sparse/arch/xen/i386/kernel/mpparse.c linux-2.6-xen-sparse/arch/xen/i386/kernel/pci-dma.c linux-2.6-xen-sparse/arch/xen/i386/kernel/process.c linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c linux-2.6-xen-sparse/arch/xen/i386/kernel/signal.c linux-2.6-xen-sparse/arch/xen/i386/kernel/smp.c linux-2.6-xen-sparse/arch/xen/i386/kernel/smpboot.c linux-2.6-xen-sparse/arch/xen/i386/kernel/swiotlb.c linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c linux-2.6-xen-sparse/arch/xen/i386/kernel/traps.c linux-2.6-xen-sparse/arch/xen/i386/kernel/vsyscall.S linux-2.6-xen-sparse/arch/xen/i386/mach-default/Makefile linux-2.6-xen-sparse/arch/xen/i386/mm/Makefile linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c linux-2.6-xen-sparse/arch/xen/i386/mm/highmem.c linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c linux-2.6-xen-sparse/arch/xen/i386/mm/init.c linux-2.6-xen-sparse/arch/xen/i386/mm/ioremap.c linux-2.6-xen-sparse/arch/xen/i386/mm/pgtable.c linux-2.6-xen-sparse/arch/xen/i386/pci/Makefile linux-2.6-xen-sparse/arch/xen/i386/pci/irq.c linux-2.6-xen-sparse/arch/xen/kernel/Makefile linux-2.6-xen-sparse/arch/xen/kernel/devmem.c linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c linux-2.6-xen-sparse/arch/xen/kernel/fixup.c linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c linux-2.6-xen-sparse/arch/xen/kernel/reboot.c linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c linux-2.6-xen-sparse/arch/xen/kernel/smp.c linux-2.6-xen-sparse/arch/xen/kernel/xen_proc.c linux-2.6-xen-sparse/arch/xen/x86_64/Kconfig linux-2.6-xen-sparse/arch/xen/x86_64/Makefile linux-2.6-xen-sparse/arch/xen/x86_64/ia32/Makefile linux-2.6-xen-sparse/arch/xen/x86_64/ia32/ia32entry.S linux-2.6-xen-sparse/arch/xen/x86_64/ia32/syscall32.c linux-2.6-xen-sparse/arch/xen/x86_64/ia32/vsyscall-int80.S linux-2.6-xen-sparse/arch/xen/x86_64/kernel/Makefile linux-2.6-xen-sparse/arch/xen/x86_64/kernel/acpi/Makefile linux-2.6-xen-sparse/arch/xen/x86_64/kernel/apic.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/e820.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/early_printk.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/entry.S linux-2.6-xen-sparse/arch/xen/x86_64/kernel/genapic.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/genapic_xen.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head.S linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head64.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/io_apic.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/ioport.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/irq.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/ldt.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/mpparse.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/pci-nommu.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/process.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/setup64.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/signal.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smp.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/smpboot.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/traps.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/vsyscall.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/x8664_ksyms.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/xen_entry.S linux-2.6-xen-sparse/arch/xen/x86_64/mm/Makefile linux-2.6-xen-sparse/arch/xen/x86_64/mm/fault.c linux-2.6-xen-sparse/arch/xen/x86_64/mm/init.c linux-2.6-xen-sparse/arch/xen/x86_64/mm/pageattr.c linux-2.6-xen-sparse/arch/xen/x86_64/pci/Makefile linux-2.6-xen-sparse/arch/xen/x86_64/pci/Makefile-BUS linux-2.6-xen-sparse/drivers/Makefile linux-2.6-xen-sparse/drivers/acpi/tables.c linux-2.6-xen-sparse/drivers/char/mem.c linux-2.6-xen-sparse/drivers/char/tpm/Kconfig.domU linux-2.6-xen-sparse/drivers/char/tpm/Makefile linux-2.6-xen-sparse/drivers/char/tpm/tpm.c linux-2.6-xen-sparse/drivers/char/tpm/tpm.h linux-2.6-xen-sparse/drivers/char/tpm/tpm_atmel.c linux-2.6-xen-sparse/drivers/char/tpm/tpm_nopci.c linux-2.6-xen-sparse/drivers/char/tpm/tpm_nopci.h linux-2.6-xen-sparse/drivers/char/tpm/tpm_nsc.c linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c linux-2.6-xen-sparse/drivers/char/tty_io.c linux-2.6-xen-sparse/drivers/xen/Makefile linux-2.6-xen-sparse/drivers/xen/balloon/Makefile linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c linux-2.6-xen-sparse/drivers/xen/blkback/Makefile linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c linux-2.6-xen-sparse/drivers/xen/blkback/common.h linux-2.6-xen-sparse/drivers/xen/blkback/interface.c linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c linux-2.6-xen-sparse/drivers/xen/blkfront/Kconfig linux-2.6-xen-sparse/drivers/xen/blkfront/Makefile linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c linux-2.6-xen-sparse/drivers/xen/blkfront/block.h linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c linux-2.6-xen-sparse/drivers/xen/blktap/Makefile linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c linux-2.6-xen-sparse/drivers/xen/blktap/blktap.h linux-2.6-xen-sparse/drivers/xen/blktap/common.h linux-2.6-xen-sparse/drivers/xen/blktap/interface.c linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c linux-2.6-xen-sparse/drivers/xen/console/Makefile linux-2.6-xen-sparse/drivers/xen/console/console.c linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.c linux-2.6-xen-sparse/drivers/xen/console/xencons_ring.h linux-2.6-xen-sparse/drivers/xen/evtchn/Makefile linux-2.6-xen-sparse/drivers/xen/evtchn/evtchn.c linux-2.6-xen-sparse/drivers/xen/netback/Makefile linux-2.6-xen-sparse/drivers/xen/netback/common.h linux-2.6-xen-sparse/drivers/xen/netback/interface.c linux-2.6-xen-sparse/drivers/xen/netback/loopback.c linux-2.6-xen-sparse/drivers/xen/netback/netback.c linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c linux-2.6-xen-sparse/drivers/xen/netfront/Kconfig linux-2.6-xen-sparse/drivers/xen/netfront/Makefile linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6-xen-sparse/drivers/xen/privcmd/Makefile linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c linux-2.6-xen-sparse/drivers/xen/tpmback/Makefile linux-2.6-xen-sparse/drivers/xen/tpmback/common.h linux-2.6-xen-sparse/drivers/xen/tpmback/interface.c linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c linux-2.6-xen-sparse/drivers/xen/tpmfront/Makefile linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.c linux-2.6-xen-sparse/drivers/xen/tpmfront/tpmfront.h linux-2.6-xen-sparse/drivers/xen/usbback/common.h linux-2.6-xen-sparse/drivers/xen/usbback/control.c linux-2.6-xen-sparse/drivers/xen/usbback/interface.c linux-2.6-xen-sparse/drivers/xen/usbback/usbback.c linux-2.6-xen-sparse/drivers/xen/usbfront/usbfront.c linux-2.6-xen-sparse/drivers/xen/usbfront/xhci.h linux-2.6-xen-sparse/drivers/xen/xenbus/Makefile linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.h linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c linux-2.6-xen-sparse/include/asm-generic/pgtable.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/agp.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/desc.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/dma-mapping.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/fixmap.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/floppy.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/highmem.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/hw_irq.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypercall.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/io.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/kmap_types.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/mach-xen/irq_vectors.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_pre.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/mach-xen/smpboot_hooks.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/mmu.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/mmu_context.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/page.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/param.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pci.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgalloc.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-2level.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable-3level.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/pgtable.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/processor.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/ptrace.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/scatterlist.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/segment.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/setup.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/spinlock.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/swiotlb.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/synch_bitops.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/tlbflush.h linux-2.6-xen-sparse/include/asm-xen/asm-i386/vga.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/arch_hooks.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/bootsetup.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/desc.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/dma-mapping.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/fixmap.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/floppy.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hw_irq.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypercall.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/io.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/irq.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/io_ports.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/irq_vectors.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/mach_timer.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/setup_arch_post.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/setup_arch_pre.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mach-xen/smpboot_hooks.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mmu.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/mmu_context.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/page.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/param.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pci.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgalloc.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/pgtable.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/processor.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/ptrace.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/segment.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/smp.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/synch_bitops.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/timer.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/tlbflush.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/vga.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/xor.h linux-2.6-xen-sparse/include/asm-xen/balloon.h linux-2.6-xen-sparse/include/asm-xen/evtchn.h linux-2.6-xen-sparse/include/asm-xen/foreign_page.h linux-2.6-xen-sparse/include/asm-xen/gnttab.h linux-2.6-xen-sparse/include/asm-xen/hypervisor.h linux-2.6-xen-sparse/include/asm-xen/linux-public/privcmd.h linux-2.6-xen-sparse/include/asm-xen/queues.h linux-2.6-xen-sparse/include/asm-xen/xen_proc.h linux-2.6-xen-sparse/include/asm-xen/xenbus.h linux-2.6-xen-sparse/include/linux/gfp.h linux-2.6-xen-sparse/include/linux/highmem.h linux-2.6-xen-sparse/include/linux/irq.h linux-2.6-xen-sparse/include/linux/mm.h linux-2.6-xen-sparse/include/linux/skbuff.h linux-2.6-xen-sparse/include/linux/tpmfe.h linux-2.6-xen-sparse/kernel/irq/manage.c linux-2.6-xen-sparse/mkbuildtree linux-2.6-xen-sparse/mm/highmem.c linux-2.6-xen-sparse/mm/memory.c linux-2.6-xen-sparse/mm/mmap.c linux-2.6-xen-sparse/mm/page_alloc.c linux-2.6-xen-sparse/net/core/dev.c linux-2.6-xen-sparse/net/core/skbuff.c patches/linux-2.6.12/i386-cpu-hotplug-updated-for-mm.patch patches/linux-2.6.12/net-csum.patch patches/linux-2.6.12/patch-2.6.12.5 patches/linux-2.6.12/rcu-nohz.patch patches/linux-2.6.12/smp-alts.patch tools/Makefile tools/Rules.mk tools/blktap/Makefile tools/blktap/README.sept05 tools/blktap/blkdump.c tools/blktap/blkif.c tools/blktap/blktaplib.c tools/blktap/blktaplib.h tools/blktap/list.h tools/blktap/parallax/Makefile tools/blktap/parallax/block-async.h tools/blktap/parallax/blockstore.h tools/blktap/ublkback/Makefile tools/blktap/ublkback/ublkback.c tools/blktap/ublkback/ublkbacklib.c tools/blktap/ublkback/ublkbacklib.h tools/blktap/xenbus.c tools/check/check_brctl tools/check/check_iproute tools/check/check_logging tools/check/check_python tools/check/check_zlib_devel tools/check/check_zlib_lib tools/check/chk tools/console/Makefile tools/console/client/main.c tools/console/daemon/io.c tools/console/daemon/io.h tools/console/daemon/main.c tools/console/daemon/utils.c tools/console/daemon/utils.h tools/console/testsuite/Makefile tools/console/testsuite/README tools/console/testsuite/console-dom0.c tools/console/testsuite/console-domU.c tools/console/testsuite/procpipe.c tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/linux-xen-low.c tools/debugger/gdb/gdbbuild tools/debugger/libxendebug/Makefile tools/debugger/libxendebug/xendebug.c tools/debugger/libxendebug/xendebug.h tools/debugger/pdb/Domain.ml tools/debugger/pdb/Domain.mli tools/debugger/pdb/Makefile tools/debugger/pdb/PDB.ml tools/debugger/pdb/Process.ml tools/debugger/pdb/Process.mli tools/debugger/pdb/Util.ml tools/debugger/pdb/Xen_domain.ml tools/debugger/pdb/Xen_domain.mli tools/debugger/pdb/debugger.ml tools/debugger/pdb/linux-2.6-module/Makefile tools/debugger/pdb/linux-2.6-module/debug.c tools/debugger/pdb/linux-2.6-module/module.c tools/debugger/pdb/linux-2.6-module/pdb_debug.h tools/debugger/pdb/linux-2.6-module/pdb_module.h tools/debugger/pdb/linux-2.6-patches/Makefile tools/debugger/pdb/linux-2.6-patches/i386_ksyms.patch tools/debugger/pdb/linux-2.6-patches/kdebug.patch tools/debugger/pdb/linux-2.6-patches/makefile.patch tools/debugger/pdb/linux-2.6-patches/ptrace.patch tools/debugger/pdb/linux-2.6-patches/traps.patch tools/debugger/pdb/pdb_caml_domain.c tools/debugger/pdb/pdb_caml_evtchn.c tools/debugger/pdb/pdb_caml_process.c tools/debugger/pdb/pdb_caml_xc.c tools/debugger/pdb/pdb_caml_xcs.c tools/debugger/pdb/pdb_caml_xen.h tools/debugger/pdb/pdb_xen.c tools/debugger/pdb/readme tools/debugger/pdb/server.ml tools/examples/Makefile tools/examples/README tools/examples/block-enbd tools/examples/block-file tools/examples/block-phy tools/examples/init.d/xend tools/examples/network-bridge tools/examples/vif-bridge tools/examples/vif-route tools/examples/xen-backend.agent tools/examples/xend-config.sxp tools/examples/xmexample.vmx.in tools/examples/xmexample1 tools/examples/xmexample2 tools/examples/xmexample3 tools/firmware/acpi/acpi2_0.h tools/firmware/rombios/rombios.c tools/firmware/vmxassist/Makefile tools/firmware/vmxassist/setup.c tools/firmware/vmxassist/vm86.c tools/firmware/vmxassist/vmxloader.c tools/ioemu/cpu-all.h tools/ioemu/exec.c tools/ioemu/hw/i8254.c tools/ioemu/hw/i8259.c tools/ioemu/hw/ide.c tools/ioemu/hw/ioapic.h tools/ioemu/hw/pc.c tools/ioemu/hw/pckbd.c tools/ioemu/hw/pcnet.c tools/ioemu/hw/pcnet.h tools/ioemu/hw/vga.c tools/ioemu/monitor.c tools/ioemu/target-i386-dm/Makefile tools/ioemu/target-i386-dm/helper2.c tools/ioemu/target-i386-dm/qemu-dm.debug tools/ioemu/vl.c tools/ioemu/vl.h tools/ioemu/vnc.c tools/libxc/Makefile tools/libxc/linux_boot_params.h tools/libxc/xc_core.c tools/libxc/xc_domain.c tools/libxc/xc_gnttab.c tools/libxc/xc_linux_build.c tools/libxc/xc_linux_restore.c tools/libxc/xc_linux_save.c tools/libxc/xc_load_aout9.c tools/libxc/xc_load_bin.c tools/libxc/xc_load_elf.c tools/libxc/xc_private.c tools/libxc/xc_private.h tools/libxc/xc_ptrace.c tools/libxc/xc_vmx_build.c tools/libxc/xenctrl.h tools/libxc/xenguest.h tools/libxc/xg_private.c tools/libxc/xg_private.h tools/misc/Makefile tools/misc/cpuperf/Makefile tools/misc/cpuperf/cpuperf.c tools/misc/cpuperf/cpuperf_xeno.h tools/misc/mbootpack/Makefile tools/misc/mbootpack/buildimage.c tools/misc/mbootpack/mbootpack.c tools/misc/mbootpack/mbootpack.h tools/misc/xc_shadow.c tools/misc/xend tools/misc/xenperf.c tools/python/Makefile tools/python/pylintrc tools/python/setup.py tools/python/xen/lowlevel/xc/xc.c tools/python/xen/lowlevel/xs/xs.c tools/python/xen/sv/CreateDomain.py tools/python/xen/sv/DomInfo.py tools/python/xen/sv/GenTabbed.py tools/python/xen/sv/HTMLBase.py tools/python/xen/sv/Main.py tools/python/xen/sv/NodeInfo.py tools/python/xen/sv/RestoreDomain.py tools/python/xen/sv/Wizard.py tools/python/xen/sv/__init__.py tools/python/xen/sv/util.py tools/python/xen/util/Brctl.py tools/python/xen/web/SrvBase.py tools/python/xen/web/SrvDir.py tools/python/xen/web/__init__.py tools/python/xen/web/connection.py tools/python/xen/web/httpserver.py tools/python/xen/web/protocol.py tools/python/xen/web/reactor.py tools/python/xen/web/resource.py tools/python/xen/web/static.py tools/python/xen/web/tcp.py tools/python/xen/web/unix.py tools/python/xen/xend/Args.py tools/python/xen/xend/EventServer.py tools/python/xen/xend/PrettyPrint.py tools/python/xen/xend/Vifctl.py tools/python/xen/xend/XendCheckpoint.py tools/python/xen/xend/XendClient.py tools/python/xen/xend/XendDB.py tools/python/xen/xend/XendDmesg.py tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/XendError.py tools/python/xen/xend/XendLogging.py tools/python/xen/xend/XendNode.py tools/python/xen/xend/XendProtocol.py tools/python/xen/xend/XendRoot.py tools/python/xen/xend/XendVnet.py tools/python/xen/xend/encode.py tools/python/xen/xend/image.py tools/python/xen/xend/scheduler.py tools/python/xen/xend/server/SrvDaemon.py tools/python/xen/xend/server/SrvDmesg.py tools/python/xen/xend/server/SrvDomain.py tools/python/xen/xend/server/SrvDomainDir.py tools/python/xen/xend/server/SrvNode.py tools/python/xen/xend/server/SrvRoot.py tools/python/xen/xend/server/SrvServer.py tools/python/xen/xend/server/SrvVnetDir.py tools/python/xen/xend/server/SrvXendLog.py tools/python/xen/xend/server/blkif.py tools/python/xen/xend/server/channel.py tools/python/xen/xend/server/controller.py tools/python/xen/xend/server/event.py tools/python/xen/xend/server/netif.py tools/python/xen/xend/server/params.py tools/python/xen/xend/server/pciif.py tools/python/xen/xend/server/relocate.py tools/python/xen/xend/server/tpmif.py tools/python/xen/xend/server/usbif.py tools/python/xen/xend/sxp.py tools/python/xen/xend/uuid.py tools/python/xen/xend/xenstore/__init__.py tools/python/xen/xend/xenstore/xsnode.py tools/python/xen/xend/xenstore/xsobj.py tools/python/xen/xend/xenstore/xsresource.py tools/python/xen/xend/xenstore/xstransact.py tools/python/xen/xend/xenstore/xswatch.py tools/python/xen/xm/create.py tools/python/xen/xm/destroy.py tools/python/xen/xm/help.py tools/python/xen/xm/main.py tools/python/xen/xm/migrate.py tools/python/xen/xm/opts.py tools/python/xen/xm/shutdown.py tools/python/xen/xm/sysrq.py tools/security/Makefile tools/security/example.txt tools/security/getlabel.sh tools/security/install.txt tools/security/labelfuncs.sh tools/security/policies/chwall/chwall-security_label_template.xml tools/security/policies/chwall/chwall-security_policy.xml tools/security/policies/chwall_ste/chwall_ste-security_label_template.xml tools/security/policies/chwall_ste/chwall_ste-security_policy.xml tools/security/policies/null/null-security_label_template.xml tools/security/policies/null/null-security_policy.xml tools/security/policies/security_policy.xsd tools/security/policies/ste/ste-security_label_template.xml tools/security/policies/ste/ste-security_policy.xml tools/security/policy.txt tools/security/readme.txt tools/security/secpol_compat.h tools/security/secpol_tool.c tools/security/secpol_xml2bin.c tools/security/secpol_xml2bin.h tools/security/setlabel.sh tools/security/updategrub.sh tools/sv/Makefile tools/sv/images/destroy.png tools/sv/images/finish.png tools/sv/images/next.png tools/sv/images/pause.png tools/sv/images/previous.png tools/sv/images/reboot.png tools/sv/images/shutdown.png tools/sv/images/small-destroy.png tools/sv/images/small-pause.png tools/sv/images/small-unpause.png tools/sv/images/unpause.png tools/sv/images/xen.png tools/sv/inc/script.js tools/sv/inc/style.css tools/sv/index.psp tools/vnet/00INSTALL tools/vnet/Make.env tools/vnet/Makefile tools/vnet/doc/vnet-module.txt tools/vnet/doc/vnet-xend.txt tools/vnet/examples/Makefile tools/vnet/examples/network-vnet tools/vnet/examples/vnet-insert tools/vnet/examples/vnet97.sxp tools/vnet/examples/vnet98.sxp tools/vnet/examples/vnet99.sxp tools/vnet/libxutil/Makefile tools/vnet/libxutil/debug.h tools/vnet/libxutil/mem_stream.c tools/vnet/libxutil/mem_stream.h tools/vnet/libxutil/sxpr.c tools/vnet/libxutil/sxpr.h tools/vnet/libxutil/sxpr_parser.c tools/vnet/libxutil/sxpr_parser.h tools/vnet/libxutil/sys_string.c tools/vnet/libxutil/sys_string.h tools/vnet/vnet-module/00README tools/vnet/vnet-module/Makefile tools/vnet/vnet-module/Makefile-2.4 tools/vnet/vnet-module/Makefile-2.6 tools/vnet/vnet-module/Makefile.ver tools/vnet/vnet-module/Makefile.vnet tools/vnet/vnet-module/etherip.c tools/vnet/vnet-module/if_etherip.h tools/vnet/vnet-module/if_varp.h tools/vnet/vnet-module/skb_util.h tools/vnet/vnet-module/tunnel.c tools/vnet/vnet-module/tunnel.h tools/vnet/vnet-module/varp.c tools/vnet/vnet-module/varp.h tools/vnet/vnet-module/varp_socket.c tools/vnet/vnet-module/varp_util.c tools/vnet/vnet-module/varp_util.h tools/vnet/vnet-module/vif.c tools/vnet/vnet-module/vif.h tools/vnet/vnet-module/vnet.c tools/vnet/vnet-module/vnet.h tools/vnet/vnet-module/vnet_dev.c tools/vnet/vnet-module/vnet_dev.h tools/vnet/vnet-module/vnet_ioctl.c tools/vnet/vnetd/Makefile tools/vnet/vnetd/vcache.c tools/vnet/vnetd/vcache.h tools/vnet/vnetd/vnetd.c tools/vnet/vnetd/vnetd.h tools/vtpm/Makefile tools/vtpm/README tools/vtpm/Rules.mk tools/vtpm/tpm_emulator.patch tools/vtpm/vtpm.patch tools/vtpm_manager/COPYING tools/vtpm_manager/Makefile tools/vtpm_manager/README tools/vtpm_manager/Rules.mk tools/vtpm_manager/crypto/Makefile tools/vtpm_manager/crypto/crypto.c tools/vtpm_manager/crypto/crypto.h tools/vtpm_manager/crypto/hash.c tools/vtpm_manager/crypto/rsa.c tools/vtpm_manager/crypto/sym_crypto.c tools/vtpm_manager/crypto/sym_crypto.h tools/vtpm_manager/manager/Makefile tools/vtpm_manager/manager/dmictl.c tools/vtpm_manager/manager/securestorage.c tools/vtpm_manager/manager/tpmpassthrough.c tools/vtpm_manager/manager/vtpm_manager.c tools/vtpm_manager/manager/vtpm_manager.h tools/vtpm_manager/manager/vtpmd.c tools/vtpm_manager/manager/vtpmpriv.h tools/vtpm_manager/manager/vtsp.c tools/vtpm_manager/manager/vtsp.h tools/vtpm_manager/tcs/Makefile tools/vtpm_manager/tcs/contextmgr.c tools/vtpm_manager/tcs/contextmgr.h tools/vtpm_manager/tcs/tcs.c tools/vtpm_manager/tcs/tcs.h tools/vtpm_manager/tcs/tpmddl.h tools/vtpm_manager/tcs/transmit.c tools/vtpm_manager/util/Makefile tools/vtpm_manager/util/bsg.c tools/vtpm_manager/util/bsg.h tools/vtpm_manager/util/buffer.c tools/vtpm_manager/util/buffer.h tools/vtpm_manager/util/depend tools/vtpm_manager/util/hashtable.c tools/vtpm_manager/util/hashtable.h tools/vtpm_manager/util/hashtable_itr.c tools/vtpm_manager/util/hashtable_itr.h tools/vtpm_manager/util/hashtable_private.h tools/vtpm_manager/util/log.c tools/vtpm_manager/util/log.h tools/vtpm_manager/util/tcg.h tools/xcutils/Makefile tools/xcutils/xc_restore.c tools/xcutils/xc_save.c tools/xenstat/Makefile tools/xenstat/libxenstat/COPYING tools/xenstat/libxenstat/Makefile tools/xenstat/libxenstat/bindings/swig/perl/.empty tools/xenstat/libxenstat/bindings/swig/python/.empty tools/xenstat/libxenstat/bindings/swig/xenstat.i tools/xenstat/libxenstat/src/xen-interface.c tools/xenstat/libxenstat/src/xen-interface.h tools/xenstat/libxenstat/src/xenstat.c tools/xenstat/libxenstat/src/xenstat.h tools/xenstat/xentop/Makefile tools/xenstat/xentop/TODO tools/xenstat/xentop/xentop.1 tools/xenstat/xentop/xentop.c tools/xenstore/COPYING tools/xenstore/Makefile tools/xenstore/TODO tools/xenstore/fake_libxc.c tools/xenstore/testsuite/01simple.test tools/xenstore/testsuite/02directory.test tools/xenstore/testsuite/03write.test tools/xenstore/testsuite/04rm.test tools/xenstore/testsuite/05filepermissions.test tools/xenstore/testsuite/06dirpermissions.test tools/xenstore/testsuite/07watch.test tools/xenstore/testsuite/08transaction.slowtest tools/xenstore/testsuite/08transaction.test tools/xenstore/testsuite/09domain.test tools/xenstore/testsuite/10domain-homedir.test tools/xenstore/testsuite/11domain-watch.test tools/xenstore/testsuite/12readonly.test tools/xenstore/testsuite/13watch-ack.test tools/xenstore/testsuite/14complexperms.test tools/xenstore/testsuite/15nowait.test tools/xenstore/testsuite/test.sh tools/xenstore/testsuite/vg-suppressions tools/xenstore/utils.c tools/xenstore/utils.h tools/xenstore/xenstore_client.c tools/xenstore/xenstored.h tools/xenstore/xenstored_core.c tools/xenstore/xenstored_core.h tools/xenstore/xenstored_domain.c tools/xenstore/xenstored_domain.h tools/xenstore/xenstored_transaction.c tools/xenstore/xenstored_transaction.h tools/xenstore/xenstored_watch.c tools/xenstore/xenstored_watch.h tools/xenstore/xs.c tools/xenstore/xs.h tools/xenstore/xs_crashme.c tools/xenstore/xs_dom0_test.c tools/xenstore/xs_lib.c tools/xenstore/xs_lib.h tools/xenstore/xs_random.c tools/xenstore/xs_test.c tools/xentrace/Makefile tools/xentrace/formats tools/xentrace/xenctx.c tools/xentrace/xentrace.c xen/Makefile xen/Rules.mk xen/acm/acm_chinesewall_hooks.c xen/acm/acm_core.c xen/acm/acm_null_hooks.c xen/acm/acm_policy.c xen/acm/acm_simple_type_enforcement_hooks.c xen/arch/ia64/Makefile xen/arch/ia64/Rules.mk xen/arch/ia64/asm-offsets.c xen/arch/ia64/asm-xsi-offsets.c xen/arch/ia64/linux-xen/efi.c xen/arch/ia64/linux-xen/entry.S xen/arch/ia64/linux-xen/entry.h xen/arch/ia64/linux-xen/head.S xen/arch/ia64/linux-xen/irq_ia64.c xen/arch/ia64/linux-xen/mm_contig.c xen/arch/ia64/linux-xen/setup.c xen/arch/ia64/linux-xen/unaligned.c xen/arch/ia64/linux/extable.c xen/arch/ia64/linux/ia64_ksyms.c xen/arch/ia64/linux/irq_lsapic.c xen/arch/ia64/linux/pcdp.h xen/arch/ia64/tools/README.xenia64 xen/arch/ia64/tools/README.xenia64linux xen/arch/ia64/xen/xensetup.c xen/arch/x86/Makefile xen/arch/x86/Rules.mk xen/arch/x86/acpi/boot.c xen/arch/x86/apic.c xen/arch/x86/audit.c xen/arch/x86/boot/x86_32.S xen/arch/x86/boot/x86_64.S xen/arch/x86/cdb.c xen/arch/x86/cpu/amd.c xen/arch/x86/cpu/common.c xen/arch/x86/dom0_ops.c xen/arch/x86/domain.c xen/arch/x86/domain_build.c xen/arch/x86/genapic/es7000plat.c xen/arch/x86/i8259.c xen/arch/x86/io_apic.c xen/arch/x86/mm.c xen/arch/x86/mpparse.c xen/arch/x86/physdev.c xen/arch/x86/setup.c xen/arch/x86/shadow.c xen/arch/x86/shadow32.c xen/arch/x86/shadow_guest32.c xen/arch/x86/shadow_public.c xen/arch/x86/smpboot.c xen/arch/x86/time.c xen/arch/x86/traps.c xen/arch/x86/vmx.c xen/arch/x86/vmx_intercept.c xen/arch/x86/vmx_io.c xen/arch/x86/vmx_platform.c xen/arch/x86/vmx_vmcs.c xen/arch/x86/x86_32/asm-offsets.c xen/arch/x86/x86_32/entry.S xen/arch/x86/x86_32/mm.c xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/asm-offsets.c xen/arch/x86/x86_64/entry.S xen/arch/x86/x86_64/mm.c xen/arch/x86/x86_64/traps.c xen/common/Makefile xen/common/ac_timer.c xen/common/acm_ops.c xen/common/dom0_ops.c xen/common/domain.c xen/common/event_channel.c xen/common/grant_table.c xen/common/kernel.c xen/common/lib.c xen/common/memory.c xen/common/multicall.c xen/common/page_alloc.c xen/common/perfc.c xen/common/sched_sedf.c xen/common/schedule.c xen/common/symbols.c xen/common/trace.c xen/common/xmalloc.c xen/drivers/char/Makefile xen/drivers/char/console.c xen/drivers/char/ns16550.c xen/drivers/char/serial.c xen/include/acm/acm_core.h xen/include/acm/acm_hooks.h xen/include/asm-ia64/config.h xen/include/asm-ia64/domain.h xen/include/asm-ia64/event.h xen/include/asm-ia64/ia64_int.h xen/include/asm-ia64/linux-xen/asm/gcc_intrin.h xen/include/asm-ia64/linux-xen/asm/ia64regs.h xen/include/asm-ia64/linux-xen/asm/io.h xen/include/asm-ia64/linux-xen/asm/kregs.h xen/include/asm-ia64/linux-xen/asm/mca_asm.h xen/include/asm-ia64/linux-xen/asm/page.h xen/include/asm-ia64/linux-xen/asm/pal.h xen/include/asm-ia64/linux-xen/asm/pgalloc.h xen/include/asm-ia64/linux-xen/asm/processor.h xen/include/asm-ia64/linux-xen/asm/system.h xen/include/asm-ia64/linux-xen/asm/types.h xen/include/asm-ia64/linux-xen/asm/uaccess.h xen/include/asm-ia64/linux-xen/linux/cpumask.h xen/include/asm-ia64/linux-xen/linux/hardirq.h xen/include/asm-ia64/linux-xen/linux/interrupt.h xen/include/asm-ia64/linux/asm-generic/bug.h xen/include/asm-ia64/linux/asm-generic/errno.h xen/include/asm-ia64/linux/asm-generic/iomap.h xen/include/asm-ia64/linux/asm-generic/pci.h xen/include/asm-ia64/linux/asm-generic/pgtable-nopud.h xen/include/asm-ia64/linux/asm-generic/pgtable.h xen/include/asm-ia64/linux/asm-generic/sections.h xen/include/asm-ia64/linux/asm-generic/topology.h xen/include/asm-ia64/linux/asm-generic/vmlinux.lds.h xen/include/asm-ia64/linux/asm/acpi.h xen/include/asm-ia64/linux/asm/bitops.h xen/include/asm-ia64/linux/asm/break.h xen/include/asm-ia64/linux/asm/bug.h xen/include/asm-ia64/linux/asm/cacheflush.h xen/include/asm-ia64/linux/asm/param.h xen/include/asm-ia64/linux/asm/pci.h xen/include/asm-ia64/linux/asm/percpu.h xen/include/asm-ia64/linux/asm/sal.h xen/include/asm-ia64/linux/asm/sections.h xen/include/asm-ia64/linux/asm/signal.h xen/include/asm-ia64/linux/asm/smp.h xen/include/asm-ia64/linux/asm/thread_info.h xen/include/asm-ia64/linux/asm/topology.h xen/include/asm-ia64/linux/asm/unaligned.h xen/include/asm-ia64/linux/asm/unistd.h xen/include/asm-ia64/linux/bitmap.h xen/include/asm-ia64/linux/bitops.h xen/include/asm-ia64/linux/dma-mapping.h xen/include/asm-ia64/linux/efi.h xen/include/asm-ia64/linux/err.h xen/include/asm-ia64/linux/gfp.h xen/include/asm-ia64/linux/mmzone.h xen/include/asm-ia64/linux/numa.h xen/include/asm-ia64/linux/page-flags.h xen/include/asm-ia64/linux/slab.h xen/include/asm-ia64/linux/threads.h xen/include/asm-ia64/linux/timex.h xen/include/asm-ia64/linux/topology.h xen/include/asm-ia64/linux/wait.h xen/include/asm-ia64/mm.h xen/include/asm-ia64/mmu_context.h xen/include/asm-ia64/privop.h xen/include/asm-ia64/regionreg.h xen/include/asm-ia64/regs.h xen/include/asm-ia64/time.h xen/include/asm-ia64/tlb.h xen/include/asm-ia64/vcpu.h xen/include/asm-ia64/vhpt.h xen/include/asm-ia64/vmmu.h xen/include/asm-ia64/vmx.h xen/include/asm-ia64/vmx_uaccess.h xen/include/asm-ia64/vmx_vcpu.h xen/include/asm-ia64/vmx_vpd.h xen/include/asm-ia64/xenprocessor.h xen/include/asm-ia64/xensystem.h xen/include/asm-x86/apicdef.h xen/include/asm-x86/asm_defns.h xen/include/asm-x86/bitops.h xen/include/asm-x86/config.h xen/include/asm-x86/e820.h xen/include/asm-x86/event.h xen/include/asm-x86/fixmap.h xen/include/asm-x86/genapic.h xen/include/asm-x86/hpet.h xen/include/asm-x86/io.h xen/include/asm-x86/mach-bigsmp/mach_apic.h xen/include/asm-x86/mach-default/mach_apic.h xen/include/asm-x86/mach-es7000/mach_apic.h xen/include/asm-x86/mach-generic/mach_apic.h xen/include/asm-x86/mach-summit/mach_apic.h xen/include/asm-x86/mach-summit/mach_mpparse.h xen/include/asm-x86/mm.h xen/include/asm-x86/page-guest32.h xen/include/asm-x86/page.h xen/include/asm-x86/processor.h xen/include/asm-x86/shadow.h xen/include/asm-x86/shadow_64.h xen/include/asm-x86/shadow_ops.h xen/include/asm-x86/shadow_public.h xen/include/asm-x86/time.h xen/include/asm-x86/types.h xen/include/asm-x86/uaccess.h xen/include/asm-x86/vmx.h xen/include/asm-x86/vmx_platform.h xen/include/asm-x86/vmx_virpit.h xen/include/asm-x86/vmx_vmcs.h xen/include/asm-x86/x86_32/asm_defns.h xen/include/asm-x86/x86_32/page-3level.h xen/include/asm-x86/x86_32/uaccess.h xen/include/asm-x86/x86_64/asm_defns.h xen/include/asm-x86/x86_64/page.h xen/include/public/acm.h xen/include/public/acm_ops.h xen/include/public/arch-ia64.h xen/include/public/arch-x86_32.h xen/include/public/arch-x86_64.h xen/include/public/dom0_ops.h xen/include/public/grant_table.h xen/include/public/io/blkif.h xen/include/public/io/domain_controller.h xen/include/public/io/ioreq.h xen/include/public/io/netif.h xen/include/public/io/tpmif.h xen/include/public/memory.h xen/include/public/physdev.h xen/include/public/trace.h xen/include/public/version.h xen/include/public/xen.h xen/include/xen/ac_timer.h xen/include/xen/config.h xen/include/xen/domain.h xen/include/xen/event.h xen/include/xen/grant_table.h xen/include/xen/mm.h xen/include/xen/perfc.h xen/include/xen/perfc_defn.h xen/include/xen/sched.h xen/include/xen/serial.h xen/include/xen/symbols.h xen/include/xen/time.h xen/include/xen/trace.h xen/tools/Makefile xen/tools/symbols.c
line diff
     1.1 --- a/.hgignore	Fri Sep 09 10:31:36 2005 -0600
     1.2 +++ b/.hgignore	Tue Sep 13 10:14:16 2005 -0600
     1.3 @@ -19,6 +19,7 @@
     1.4  ^docs/.*\.toc$
     1.5  ^docs/figs/xenserver\.eps$
     1.6  ^docs/html/.*$
     1.7 +^docs/api/.*$
     1.8  ^docs/interface/WARNINGS$
     1.9  ^docs/interface/images\.pl$
    1.10  ^docs/interface/images\.tex$
    1.11 @@ -60,8 +61,6 @@
    1.12  ^pristine-.*$
    1.13  ^ref-.*$
    1.14  ^tools/.*/build/lib.*/.*\.py$
    1.15 -^tools/Makefile\.smh$
    1.16 -^tools/balloon/balloon$
    1.17  ^tools/blktap/Makefile\.smh$
    1.18  ^tools/blktap/blkcow$
    1.19  ^tools/blktap/blkcowgnbd$
    1.20 @@ -85,8 +84,7 @@
    1.21  ^tools/blktap/ublkback/ublkback$
    1.22  ^tools/blktap/xen/.*$
    1.23  ^tools/check/\..*$
    1.24 -^tools/cmdline/.*$
    1.25 -^tools/cmdline/xen/.*$
    1.26 +^tools/examples/xmexample\.vmx$
    1.27  ^tools/console/xenconsoled$
    1.28  ^tools/console/xenconsole$
    1.29  ^tools/debugger/pdb/pdb$
    1.30 @@ -109,8 +107,6 @@
    1.31  ^tools/firmware/vmxassist/roms\.h$
    1.32  ^tools/firmware/vmxassist/vmxassist$
    1.33  ^tools/firmware/vmxassist/vmxloader$
    1.34 -^tools/gdb/gdb-6\.2\.1-linux-i386-xen/.*$
    1.35 -^tools/gdb/gdb-6\.2\.1/.*$
    1.36  ^tools/ioemu/config-host\..*$
    1.37  ^tools/ioemu/keysym_adapter_sdl\.h$
    1.38  ^tools/ioemu/keysym_adapter_vnc\.h$
    1.39 @@ -141,20 +137,18 @@
    1.40  ^tools/vnet/vnet-module/\..*\.cmd$
    1.41  ^tools/vnet/vnet-module/\.tmp_versions/.*$
    1.42  ^tools/vnet/vnet-module/vnet_module\.mod\..*$
    1.43 -^tools/vnetd/vnetd$
    1.44  ^tools/vtpm/vtpm*
    1.45  ^tools/vtpm/tpm_emulator-*
    1.46  ^tools/vtpm_manager/manager/vtpm_managerd
    1.47 -^tools/web-shutdown\.tap$
    1.48 -^tools/x2d2/minixend$
    1.49  ^tools/xcutils/xc_restore$
    1.50  ^tools/xcutils/xc_save$
    1.51  ^tools/xenstat/xentop/xentop$
    1.52  ^tools/xenstore/testsuite/tmp/.*$
    1.53  ^tools/xenstore/xen$
    1.54 -^tools/xenstore/xenbus_dev.h$
    1.55  ^tools/xenstore/xenstored$
    1.56  ^tools/xenstore/xenstored_test$
    1.57 +^tools/xenstore/xenstore-exists$
    1.58 +^tools/xenstore/xenstore-list$
    1.59  ^tools/xenstore/xenstore-read$
    1.60  ^tools/xenstore/xenstore-rm$
    1.61  ^tools/xenstore/xenstore-write$
     3.1 --- a/Makefile	Fri Sep 09 10:31:36 2005 -0600
     3.2 +++ b/Makefile	Tue Sep 13 10:14:16 2005 -0600
     3.3 @@ -35,8 +35,8 @@ ifeq ($(XEN_TARGET_X86_PAE),y)
     3.4  export pae=y
     3.5  endif
     3.6  
     3.7 -.PHONY:	all dist install xen kernels tools docs world clean mkpatches mrproper
     3.8 -.PHONY:	kbuild kdelete kclean
     3.9 +.PHONY:	all dist install xen kernels tools dev-docs docs world clean
    3.10 +.PHONY:	mkpatches mrproper kbuild kdelete kclean
    3.11  
    3.12  # build and install everything into the standard system directories
    3.13  install: install-xen install-kernels install-tools install-docs
    3.14 @@ -66,6 +66,9 @@ kernels:
    3.15  docs:
    3.16  	sh ./docs/check_pkgs && $(MAKE) -C docs install || true
    3.17  
    3.18 +dev-docs:
    3.19 +	$(MAKE) -C docs dev-docs
    3.20 +
    3.21  # Build all the various kernels and modules
    3.22  kbuild: kernels
    3.23  
    3.24 @@ -123,7 +126,7 @@ help:
    3.25  	@echo '  install-xen      - build and install the Xen hypervisor'
    3.26  	@echo '  install-tools    - build and install the control tools'
    3.27  	@echo '  install-kernels  - build and install guest kernels'
    3.28 -	@echo '  install-docs     - build and install documentation'
    3.29 +	@echo '  install-docs     - build and install user documentation'
    3.30  	@echo ''
    3.31  	@echo 'Building targets:'
    3.32  	@echo '  dist             - build and install everything into local dist directory'
    3.33 @@ -133,7 +136,8 @@ help:
    3.34  	@echo '  tools            - build and install tools'
    3.35  	@echo '  kernels          - build and install guest kernels'
    3.36  	@echo '  kbuild           - synonym for make kernels'
    3.37 -	@echo '  docs             - build and install docs'
    3.38 +	@echo '  docs             - build and install user documentation'
    3.39 +	@echo '  dev-docs         - build developer-only documentation'
    3.40  	@echo ''
    3.41  	@echo 'Cleaning targets:'
    3.42  	@echo '  clean            - clean the Xen, tools and docs (but not'
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/docs/Doxyfile	Tue Sep 13 10:14:16 2005 -0600
     8.3 @@ -0,0 +1,1218 @@
     8.4 +# Doxyfile 1.4.2
     8.5 +
     8.6 +# This file describes the settings to be used by the documentation system
     8.7 +# doxygen (www.doxygen.org) for a project
     8.8 +#
     8.9 +# All text after a hash (#) is considered a comment and will be ignored
    8.10 +# The format is:
    8.11 +#       TAG = value [value, ...]
    8.12 +# For lists items can also be appended using:
    8.13 +#       TAG += value [value, ...]
    8.14 +# Values that contain spaces should be placed between quotes (" ")
    8.15 +
    8.16 +#---------------------------------------------------------------------------
    8.17 +# Project related configuration options
    8.18 +#---------------------------------------------------------------------------
    8.19 +
    8.20 +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
    8.21 +# by quotes) that should identify the project.
    8.22 +
    8.23 +PROJECT_NAME           = Xen Python Tools
    8.24 +
    8.25 +# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
    8.26 +# This could be handy for archiving the generated documentation or 
    8.27 +# if some version control system is used.
    8.28 +
    8.29 +PROJECT_NUMBER         = 
    8.30 +
    8.31 +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
    8.32 +# base path where the generated documentation will be put. 
    8.33 +# If a relative path is entered, it will be relative to the location 
    8.34 +# where doxygen was started. If left blank the current directory will be used.
    8.35 +
    8.36 +OUTPUT_DIRECTORY       = api/tools/python
    8.37 +
    8.38 +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
    8.39 +# 4096 sub-directories (in 2 levels) under the output directory of each output 
    8.40 +# format and will distribute the generated files over these directories. 
    8.41 +# Enabling this option can be useful when feeding doxygen a huge amount of 
    8.42 +# source files, where putting all generated files in the same directory would 
    8.43 +# otherwise cause performance problems for the file system.
    8.44 +
    8.45 +CREATE_SUBDIRS         = NO
    8.46 +
    8.47 +# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
    8.48 +# documentation generated by doxygen is written. Doxygen will use this 
    8.49 +# information to generate all constant output in the proper language. 
    8.50 +# The default language is English, other supported languages are: 
    8.51 +# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, 
    8.52 +# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, 
    8.53 +# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, 
    8.54 +# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, 
    8.55 +# Swedish, and Ukrainian.
    8.56 +
    8.57 +OUTPUT_LANGUAGE        = English
    8.58 +
    8.59 +# This tag can be used to specify the encoding used in the generated output. 
    8.60 +# The encoding is not always determined by the language that is chosen, 
    8.61 +# but also whether or not the output is meant for Windows or non-Windows users. 
    8.62 +# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
    8.63 +# forces the Windows encoding (this is the default for the Windows binary), 
    8.64 +# whereas setting the tag to NO uses a Unix-style encoding (the default for 
    8.65 +# all platforms other than Windows).
    8.66 +
    8.67 +USE_WINDOWS_ENCODING   = NO
    8.68 +
    8.69 +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
    8.70 +# include brief member descriptions after the members that are listed in 
    8.71 +# the file and class documentation (similar to JavaDoc). 
    8.72 +# Set to NO to disable this.
    8.73 +
    8.74 +BRIEF_MEMBER_DESC      = YES
    8.75 +
    8.76 +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
    8.77 +# the brief description of a member or function before the detailed description. 
    8.78 +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
    8.79 +# brief descriptions will be completely suppressed.
    8.80 +
    8.81 +REPEAT_BRIEF           = YES
    8.82 +
    8.83 +# This tag implements a quasi-intelligent brief description abbreviator 
    8.84 +# that is used to form the text in various listings. Each string 
    8.85 +# in this list, if found as the leading text of the brief description, will be 
    8.86 +# stripped from the text and the result after processing the whole list, is 
    8.87 +# used as the annotated text. Otherwise, the brief description is used as-is. 
    8.88 +# If left blank, the following values are used ("$name" is automatically 
    8.89 +# replaced with the name of the entity): "The $name class" "The $name widget" 
    8.90 +# "The $name file" "is" "provides" "specifies" "contains" 
    8.91 +# "represents" "a" "an" "the"
    8.92 +
    8.93 +ABBREVIATE_BRIEF       = 
    8.94 +
    8.95 +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
    8.96 +# Doxygen will generate a detailed section even if there is only a brief 
    8.97 +# description.
    8.98 +
    8.99 +ALWAYS_DETAILED_SEC    = NO
   8.100 +
   8.101 +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
   8.102 +# inherited members of a class in the documentation of that class as if those 
   8.103 +# members were ordinary class members. Constructors, destructors and assignment 
   8.104 +# operators of the base classes will not be shown.
   8.105 +
   8.106 +INLINE_INHERITED_MEMB  = NO
   8.107 +
   8.108 +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
   8.109 +# path before files name in the file list and in the header files. If set 
   8.110 +# to NO the shortest path that makes the file name unique will be used.
   8.111 +
   8.112 +FULL_PATH_NAMES        = YES
   8.113 +
   8.114 +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
   8.115 +# can be used to strip a user-defined part of the path. Stripping is 
   8.116 +# only done if one of the specified strings matches the left-hand part of 
   8.117 +# the path. The tag can be used to show relative paths in the file list. 
   8.118 +# If left blank the directory from which doxygen is run is used as the 
   8.119 +# path to strip.
   8.120 +
   8.121 +STRIP_FROM_PATH        = 
   8.122 +
   8.123 +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
   8.124 +# the path mentioned in the documentation of a class, which tells 
   8.125 +# the reader which header file to include in order to use a class. 
   8.126 +# If left blank only the name of the header file containing the class 
   8.127 +# definition is used. Otherwise one should specify the include paths that 
   8.128 +# are normally passed to the compiler using the -I flag.
   8.129 +
   8.130 +STRIP_FROM_INC_PATH    = 
   8.131 +
   8.132 +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
   8.133 +# (but less readable) file names. This can be useful is your file systems 
   8.134 +# doesn't support long names like on DOS, Mac, or CD-ROM.
   8.135 +
   8.136 +SHORT_NAMES            = NO
   8.137 +
   8.138 +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
   8.139 +# will interpret the first line (until the first dot) of a JavaDoc-style 
   8.140 +# comment as the brief description. If set to NO, the JavaDoc 
   8.141 +# comments will behave just like the Qt-style comments (thus requiring an 
   8.142 +# explicit @brief command for a brief description.
   8.143 +
   8.144 +JAVADOC_AUTOBRIEF      = YES
   8.145 +
   8.146 +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
   8.147 +# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
   8.148 +# comments) as a brief description. This used to be the default behaviour. 
   8.149 +# The new default is to treat a multi-line C++ comment block as a detailed 
   8.150 +# description. Set this tag to YES if you prefer the old behaviour instead.
   8.151 +
   8.152 +MULTILINE_CPP_IS_BRIEF = NO
   8.153 +
   8.154 +# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
   8.155 +# will output the detailed description near the top, like JavaDoc.
   8.156 +# If set to NO, the detailed description appears after the member 
   8.157 +# documentation.
   8.158 +
   8.159 +DETAILS_AT_TOP         = YES
   8.160 +
   8.161 +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
   8.162 +# member inherits the documentation from any documented member that it 
   8.163 +# re-implements.
   8.164 +
   8.165 +INHERIT_DOCS           = YES
   8.166 +
   8.167 +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
   8.168 +# tag is set to YES, then doxygen will reuse the documentation of the first 
   8.169 +# member in the group (if any) for the other members of the group. By default 
   8.170 +# all members of a group must be documented explicitly.
   8.171 +
   8.172 +DISTRIBUTE_GROUP_DOC   = NO
   8.173 +
   8.174 +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
   8.175 +# a new page for each member. If set to NO, the documentation of a member will 
   8.176 +# be part of the file/class/namespace that contains it.
   8.177 +
   8.178 +SEPARATE_MEMBER_PAGES  = NO
   8.179 +
   8.180 +# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
   8.181 +# Doxygen uses this value to replace tabs by spaces in code fragments.
   8.182 +
   8.183 +TAB_SIZE               = 8
   8.184 +
   8.185 +# This tag can be used to specify a number of aliases that acts 
   8.186 +# as commands in the documentation. An alias has the form "name=value". 
   8.187 +# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
   8.188 +# put the command \sideeffect (or @sideeffect) in the documentation, which 
   8.189 +# will result in a user-defined paragraph with heading "Side Effects:". 
   8.190 +# You can put \n's in the value part of an alias to insert newlines.
   8.191 +
   8.192 +ALIASES                = 
   8.193 +
   8.194 +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
   8.195 +# sources only. Doxygen will then generate output that is more tailored for C. 
   8.196 +# For instance, some of the names that are used will be different. The list 
   8.197 +# of all members will be omitted, etc.
   8.198 +
   8.199 +OPTIMIZE_OUTPUT_FOR_C  = NO
   8.200 +
   8.201 +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources 
   8.202 +# only. Doxygen will then generate output that is more tailored for Java. 
   8.203 +# For instance, namespaces will be presented as packages, qualified scopes 
   8.204 +# will look different, etc.
   8.205 +
   8.206 +OPTIMIZE_OUTPUT_JAVA   = YES
   8.207 +
   8.208 +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
   8.209 +# the same type (for instance a group of public functions) to be put as a 
   8.210 +# subgroup of that type (e.g. under the Public Functions section). Set it to 
   8.211 +# NO to prevent subgrouping. Alternatively, this can be done per class using 
   8.212 +# the \nosubgrouping command.
   8.213 +
   8.214 +SUBGROUPING            = YES
   8.215 +
   8.216 +#---------------------------------------------------------------------------
   8.217 +# Build related configuration options
   8.218 +#---------------------------------------------------------------------------
   8.219 +
   8.220 +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
   8.221 +# documentation are documented, even if no documentation was available. 
   8.222 +# Private class members and static file members will be hidden unless 
   8.223 +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
   8.224 +
   8.225 +EXTRACT_ALL            = YES
   8.226 +
   8.227 +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
   8.228 +# will be included in the documentation.
   8.229 +
   8.230 +EXTRACT_PRIVATE        = YES
   8.231 +
   8.232 +# If the EXTRACT_STATIC tag is set to YES all static members of a file 
   8.233 +# will be included in the documentation.
   8.234 +
   8.235 +EXTRACT_STATIC         = YES
   8.236 +
   8.237 +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
   8.238 +# defined locally in source files will be included in the documentation. 
   8.239 +# If set to NO only classes defined in header files are included.
   8.240 +
   8.241 +EXTRACT_LOCAL_CLASSES  = YES
   8.242 +
   8.243 +# This flag is only useful for Objective-C code. When set to YES local 
   8.244 +# methods, which are defined in the implementation section but not in 
   8.245 +# the interface are included in the documentation. 
   8.246 +# If set to NO (the default) only methods in the interface are included.
   8.247 +
   8.248 +EXTRACT_LOCAL_METHODS  = NO
   8.249 +
   8.250 +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
   8.251 +# undocumented members of documented classes, files or namespaces. 
   8.252 +# If set to NO (the default) these members will be included in the 
   8.253 +# various overviews, but no documentation section is generated. 
   8.254 +# This option has no effect if EXTRACT_ALL is enabled.
   8.255 +
   8.256 +HIDE_UNDOC_MEMBERS     = NO
   8.257 +
   8.258 +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
   8.259 +# undocumented classes that are normally visible in the class hierarchy. 
   8.260 +# If set to NO (the default) these classes will be included in the various 
   8.261 +# overviews. This option has no effect if EXTRACT_ALL is enabled.
   8.262 +
   8.263 +HIDE_UNDOC_CLASSES     = NO
   8.264 +
   8.265 +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
   8.266 +# friend (class|struct|union) declarations. 
   8.267 +# If set to NO (the default) these declarations will be included in the 
   8.268 +# documentation.
   8.269 +
   8.270 +HIDE_FRIEND_COMPOUNDS  = NO
   8.271 +
   8.272 +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
   8.273 +# documentation blocks found inside the body of a function. 
   8.274 +# If set to NO (the default) these blocks will be appended to the 
   8.275 +# function's detailed documentation block.
   8.276 +
   8.277 +HIDE_IN_BODY_DOCS      = NO
   8.278 +
   8.279 +# The INTERNAL_DOCS tag determines if documentation 
   8.280 +# that is typed after a \internal command is included. If the tag is set 
   8.281 +# to NO (the default) then the documentation will be excluded. 
   8.282 +# Set it to YES to include the internal documentation.
   8.283 +
   8.284 +INTERNAL_DOCS          = NO
   8.285 +
   8.286 +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
   8.287 +# file names in lower-case letters. If set to YES upper-case letters are also 
   8.288 +# allowed. This is useful if you have classes or files whose names only differ 
   8.289 +# in case and if your file system supports case sensitive file names. Windows 
   8.290 +# and Mac users are advised to set this option to NO.
   8.291 +
   8.292 +CASE_SENSE_NAMES       = YES
   8.293 +
   8.294 +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
   8.295 +# will show members with their full class and namespace scopes in the 
   8.296 +# documentation. If set to YES the scope will be hidden.
   8.297 +
   8.298 +HIDE_SCOPE_NAMES       = NO
   8.299 +
   8.300 +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
   8.301 +# will put a list of the files that are included by a file in the documentation 
   8.302 +# of that file.
   8.303 +
   8.304 +SHOW_INCLUDE_FILES     = YES
   8.305 +
   8.306 +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
   8.307 +# is inserted in the documentation for inline members.
   8.308 +
   8.309 +INLINE_INFO            = YES
   8.310 +
   8.311 +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
   8.312 +# will sort the (detailed) documentation of file and class members 
   8.313 +# alphabetically by member name. If set to NO the members will appear in 
   8.314 +# declaration order.
   8.315 +
   8.316 +SORT_MEMBER_DOCS       = YES
   8.317 +
   8.318 +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
   8.319 +# brief documentation of file, namespace and class members alphabetically 
   8.320 +# by member name. If set to NO (the default) the members will appear in 
   8.321 +# declaration order.
   8.322 +
   8.323 +SORT_BRIEF_DOCS        = NO
   8.324 +
   8.325 +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
   8.326 +# sorted by fully-qualified names, including namespaces. If set to 
   8.327 +# NO (the default), the class list will be sorted only by class name, 
   8.328 +# not including the namespace part. 
   8.329 +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
   8.330 +# Note: This option applies only to the class list, not to the 
   8.331 +# alphabetical list.
   8.332 +
   8.333 +SORT_BY_SCOPE_NAME     = NO
   8.334 +
   8.335 +# The GENERATE_TODOLIST tag can be used to enable (YES) or 
   8.336 +# disable (NO) the todo list. This list is created by putting \todo 
   8.337 +# commands in the documentation.
   8.338 +
   8.339 +GENERATE_TODOLIST      = YES
   8.340 +
   8.341 +# The GENERATE_TESTLIST tag can be used to enable (YES) or 
   8.342 +# disable (NO) the test list. This list is created by putting \test 
   8.343 +# commands in the documentation.
   8.344 +
   8.345 +GENERATE_TESTLIST      = YES
   8.346 +
   8.347 +# The GENERATE_BUGLIST tag can be used to enable (YES) or 
   8.348 +# disable (NO) the bug list. This list is created by putting \bug 
   8.349 +# commands in the documentation.
   8.350 +
   8.351 +GENERATE_BUGLIST       = YES
   8.352 +
   8.353 +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
   8.354 +# disable (NO) the deprecated list. This list is created by putting 
   8.355 +# \deprecated commands in the documentation.
   8.356 +
   8.357 +GENERATE_DEPRECATEDLIST= YES
   8.358 +
   8.359 +# The ENABLED_SECTIONS tag can be used to enable conditional 
   8.360 +# documentation sections, marked by \if sectionname ... \endif.
   8.361 +
   8.362 +ENABLED_SECTIONS       = 
   8.363 +
   8.364 +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
   8.365 +# the initial value of a variable or define consists of for it to appear in 
   8.366 +# the documentation. If the initializer consists of more lines than specified 
   8.367 +# here it will be hidden. Use a value of 0 to hide initializers completely. 
   8.368 +# The appearance of the initializer of individual variables and defines in the 
   8.369 +# documentation can be controlled using \showinitializer or \hideinitializer 
   8.370 +# command in the documentation regardless of this setting.
   8.371 +
   8.372 +MAX_INITIALIZER_LINES  = 30
   8.373 +
   8.374 +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
   8.375 +# at the bottom of the documentation of classes and structs. If set to YES the 
   8.376 +# list will mention the files that were used to generate the documentation.
   8.377 +
   8.378 +SHOW_USED_FILES        = YES
   8.379 +
   8.380 +# If the sources in your project are distributed over multiple directories 
   8.381 +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
   8.382 +# in the documentation.
   8.383 +
   8.384 +SHOW_DIRECTORIES       = YES
   8.385 +
   8.386 +# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
   8.387 +# doxygen should invoke to get the current version for each file (typically from the 
   8.388 +# version control system). Doxygen will invoke the program by executing (via 
   8.389 +# popen()) the command <command> <input-file>, where <command> is the value of 
   8.390 +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
   8.391 +# provided by doxygen. Whatever the progam writes to standard output 
   8.392 +# is used as the file version. See the manual for examples.
   8.393 +
   8.394 +FILE_VERSION_FILTER    = 
   8.395 +
   8.396 +#---------------------------------------------------------------------------
   8.397 +# configuration options related to warning and progress messages
   8.398 +#---------------------------------------------------------------------------
   8.399 +
   8.400 +# The QUIET tag can be used to turn on/off the messages that are generated 
   8.401 +# by doxygen. Possible values are YES and NO. If left blank NO is used.
   8.402 +
   8.403 +QUIET                  = YES
   8.404 +
   8.405 +# The WARNINGS tag can be used to turn on/off the warning messages that are 
   8.406 +# generated by doxygen. Possible values are YES and NO. If left blank 
   8.407 +# NO is used.
   8.408 +
   8.409 +WARNINGS               = YES
   8.410 +
   8.411 +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
   8.412 +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
   8.413 +# automatically be disabled.
   8.414 +
   8.415 +WARN_IF_UNDOCUMENTED   = YES
   8.416 +
   8.417 +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
   8.418 +# potential errors in the documentation, such as not documenting some 
   8.419 +# parameters in a documented function, or documenting parameters that 
   8.420 +# don't exist or using markup commands wrongly.
   8.421 +
   8.422 +WARN_IF_DOC_ERROR      = YES
   8.423 +
   8.424 +# This WARN_NO_PARAMDOC option can be abled to get warnings for 
   8.425 +# functions that are documented, but have no documentation for their parameters 
   8.426 +# or return value. If set to NO (the default) doxygen will only warn about 
   8.427 +# wrong or incomplete parameter documentation, but not about the absence of 
   8.428 +# documentation.
   8.429 +
   8.430 +WARN_NO_PARAMDOC       = NO
   8.431 +
   8.432 +# The WARN_FORMAT tag determines the format of the warning messages that 
   8.433 +# doxygen can produce. The string should contain the $file, $line, and $text 
   8.434 +# tags, which will be replaced by the file and line number from which the 
   8.435 +# warning originated and the warning text. Optionally the format may contain 
   8.436 +# $version, which will be replaced by the version of the file (if it could 
   8.437 +# be obtained via FILE_VERSION_FILTER)
   8.438 +
   8.439 +WARN_FORMAT            = "$file:$line: $text"
   8.440 +
   8.441 +# The WARN_LOGFILE tag can be used to specify a file to which warning 
   8.442 +# and error messages should be written. If left blank the output is written 
   8.443 +# to stderr.
   8.444 +
   8.445 +WARN_LOGFILE           = 
   8.446 +
   8.447 +#---------------------------------------------------------------------------
   8.448 +# configuration options related to the input files
   8.449 +#---------------------------------------------------------------------------
   8.450 +
   8.451 +# The INPUT tag can be used to specify the files and/or directories that contain 
   8.452 +# documented source files. You may enter file names like "myfile.cpp" or 
   8.453 +# directories like "/usr/src/myproject". Separate the files or directories 
   8.454 +# with spaces.
   8.455 +
   8.456 +INPUT                  = ../tools/python/xen/
   8.457 +
   8.458 +# If the value of the INPUT tag contains directories, you can use the 
   8.459 +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
   8.460 +# and *.h) to filter out the source-files in the directories. If left 
   8.461 +# blank the following patterns are tested: 
   8.462 +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
   8.463 +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
   8.464 +
   8.465 +FILE_PATTERNS          = *.py *.c
   8.466 +
   8.467 +# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
   8.468 +# should be searched for input files as well. Possible values are YES and NO. 
   8.469 +# If left blank NO is used.
   8.470 +
   8.471 +RECURSIVE              = YES
   8.472 +
   8.473 +# The EXCLUDE tag can be used to specify files and/or directories that should 
   8.474 +# excluded from the INPUT source files. This way you can easily exclude a 
   8.475 +# subdirectory from a directory tree whose root is specified with the INPUT tag.
   8.476 +
   8.477 +EXCLUDE                = 
   8.478 +
   8.479 +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
   8.480 +# directories that are symbolic links (a Unix filesystem feature) are excluded 
   8.481 +# from the input.
   8.482 +
   8.483 +EXCLUDE_SYMLINKS       = NO
   8.484 +
   8.485 +# If the value of the INPUT tag contains directories, you can use the 
   8.486 +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
   8.487 +# certain files from those directories.
   8.488 +
   8.489 +EXCLUDE_PATTERNS       = 
   8.490 +
   8.491 +# The EXAMPLE_PATH tag can be used to specify one or more files or 
   8.492 +# directories that contain example code fragments that are included (see 
   8.493 +# the \include command).
   8.494 +
   8.495 +EXAMPLE_PATH           = 
   8.496 +
   8.497 +# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
   8.498 +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
   8.499 +# and *.h) to filter out the source-files in the directories. If left 
   8.500 +# blank all files are included.
   8.501 +
   8.502 +EXAMPLE_PATTERNS       = 
   8.503 +
   8.504 +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
   8.505 +# searched for input files to be used with the \include or \dontinclude 
   8.506 +# commands irrespective of the value of the RECURSIVE tag. 
   8.507 +# Possible values are YES and NO. If left blank NO is used.
   8.508 +
   8.509 +EXAMPLE_RECURSIVE      = NO
   8.510 +
   8.511 +# The IMAGE_PATH tag can be used to specify one or more files or 
   8.512 +# directories that contain image that are included in the documentation (see 
   8.513 +# the \image command).
   8.514 +
   8.515 +IMAGE_PATH             = 
   8.516 +
   8.517 +# The INPUT_FILTER tag can be used to specify a program that doxygen should 
   8.518 +# invoke to filter for each input file. Doxygen will invoke the filter program 
   8.519 +# by executing (via popen()) the command <filter> <input-file>, where <filter> 
   8.520 +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
   8.521 +# input file. Doxygen will then use the output that the filter program writes 
   8.522 +# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
   8.523 +# ignored.
   8.524 +
   8.525 +INPUT_FILTER           = "sh ./Doxyfilter ../tools/python"
   8.526 +
   8.527 +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
   8.528 +# basis.  Doxygen will compare the file name with each pattern and apply the 
   8.529 +# filter if there is a match.  The filters are a list of the form: 
   8.530 +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
   8.531 +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
   8.532 +# is applied to all files.
   8.533 +
   8.534 +FILTER_PATTERNS        = 
   8.535 +
   8.536 +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
   8.537 +# INPUT_FILTER) will be used to filter the input files when producing source 
   8.538 +# files to browse (i.e. when SOURCE_BROWSER is set to YES).
   8.539 +
   8.540 +FILTER_SOURCE_FILES    = YES
   8.541 +
   8.542 +#---------------------------------------------------------------------------
   8.543 +# configuration options related to source browsing
   8.544 +#---------------------------------------------------------------------------
   8.545 +
   8.546 +# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
   8.547 +# be generated. Documented entities will be cross-referenced with these sources. 
   8.548 +# Note: To get rid of all source code in the generated output, make sure also 
   8.549 +# VERBATIM_HEADERS is set to NO.
   8.550 +
   8.551 +SOURCE_BROWSER         = NO
   8.552 +
   8.553 +# Setting the INLINE_SOURCES tag to YES will include the body 
   8.554 +# of functions and classes directly in the documentation.
   8.555 +
   8.556 +INLINE_SOURCES         = NO
   8.557 +
   8.558 +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
   8.559 +# doxygen to hide any special comment blocks from generated source code 
   8.560 +# fragments. Normal C and C++ comments will always remain visible.
   8.561 +
   8.562 +STRIP_CODE_COMMENTS    = YES
   8.563 +
   8.564 +# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
   8.565 +# then for each documented function all documented 
   8.566 +# functions referencing it will be listed.
   8.567 +
   8.568 +REFERENCED_BY_RELATION = YES
   8.569 +
   8.570 +# If the REFERENCES_RELATION tag is set to YES (the default) 
   8.571 +# then for each documented function all documented entities 
   8.572 +# called/used by that function will be listed.
   8.573 +
   8.574 +REFERENCES_RELATION    = YES
   8.575 +
   8.576 +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
   8.577 +# will generate a verbatim copy of the header file for each class for 
   8.578 +# which an include is specified. Set to NO to disable this.
   8.579 +
   8.580 +VERBATIM_HEADERS       = YES
   8.581 +
   8.582 +#---------------------------------------------------------------------------
   8.583 +# configuration options related to the alphabetical class index
   8.584 +#---------------------------------------------------------------------------
   8.585 +
   8.586 +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
   8.587 +# of all compounds will be generated. Enable this if the project 
   8.588 +# contains a lot of classes, structs, unions or interfaces.
   8.589 +
   8.590 +ALPHABETICAL_INDEX     = NO
   8.591 +
   8.592 +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
   8.593 +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
   8.594 +# in which this list will be split (can be a number in the range [1..20])
   8.595 +
   8.596 +COLS_IN_ALPHA_INDEX    = 5
   8.597 +
   8.598 +# In case all classes in a project start with a common prefix, all 
   8.599 +# classes will be put under the same header in the alphabetical index. 
   8.600 +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
   8.601 +# should be ignored while generating the index headers.
   8.602 +
   8.603 +IGNORE_PREFIX          = 
   8.604 +
   8.605 +#---------------------------------------------------------------------------
   8.606 +# configuration options related to the HTML output
   8.607 +#---------------------------------------------------------------------------
   8.608 +
   8.609 +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
   8.610 +# generate HTML output.
   8.611 +
   8.612 +GENERATE_HTML          = YES
   8.613 +
   8.614 +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
   8.615 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
   8.616 +# put in front of it. If left blank `html' will be used as the default path.
   8.617 +
   8.618 +HTML_OUTPUT            = html
   8.619 +
   8.620 +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
   8.621 +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
   8.622 +# doxygen will generate files with .html extension.
   8.623 +
   8.624 +HTML_FILE_EXTENSION    = .html
   8.625 +
   8.626 +# The HTML_HEADER tag can be used to specify a personal HTML header for 
   8.627 +# each generated HTML page. If it is left blank doxygen will generate a 
   8.628 +# standard header.
   8.629 +
   8.630 +HTML_HEADER            = 
   8.631 +
   8.632 +# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
   8.633 +# each generated HTML page. If it is left blank doxygen will generate a 
   8.634 +# standard footer.
   8.635 +
   8.636 +HTML_FOOTER            = 
   8.637 +
   8.638 +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
   8.639 +# style sheet that is used by each HTML page. It can be used to 
   8.640 +# fine-tune the look of the HTML output. If the tag is left blank doxygen 
   8.641 +# will generate a default style sheet. Note that doxygen will try to copy 
   8.642 +# the style sheet file to the HTML output directory, so don't put your own 
   8.643 +# stylesheet in the HTML output directory as well, or it will be erased!
   8.644 +
   8.645 +HTML_STYLESHEET        = 
   8.646 +
   8.647 +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
   8.648 +# files or namespaces will be aligned in HTML using tables. If set to 
   8.649 +# NO a bullet list will be used.
   8.650 +
   8.651 +HTML_ALIGN_MEMBERS     = YES
   8.652 +
   8.653 +# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
   8.654 +# will be generated that can be used as input for tools like the 
   8.655 +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
   8.656 +# of the generated HTML documentation.
   8.657 +
   8.658 +GENERATE_HTMLHELP      = NO
   8.659 +
   8.660 +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
   8.661 +# be used to specify the file name of the resulting .chm file. You 
   8.662 +# can add a path in front of the file if the result should not be 
   8.663 +# written to the html output directory.
   8.664 +
   8.665 +CHM_FILE               = 
   8.666 +
   8.667 +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
   8.668 +# be used to specify the location (absolute path including file name) of 
   8.669 +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
   8.670 +# the HTML help compiler on the generated index.hhp.
   8.671 +
   8.672 +HHC_LOCATION           = 
   8.673 +
   8.674 +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
   8.675 +# controls if a separate .chi index file is generated (YES) or that 
   8.676 +# it should be included in the master .chm file (NO).
   8.677 +
   8.678 +GENERATE_CHI           = NO
   8.679 +
   8.680 +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
   8.681 +# controls whether a binary table of contents is generated (YES) or a 
   8.682 +# normal table of contents (NO) in the .chm file.
   8.683 +
   8.684 +BINARY_TOC             = NO
   8.685 +
   8.686 +# The TOC_EXPAND flag can be set to YES to add extra items for group members 
   8.687 +# to the contents of the HTML help documentation and to the tree view.
   8.688 +
   8.689 +TOC_EXPAND             = NO
   8.690 +
   8.691 +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
   8.692 +# top of each HTML page. The value NO (the default) enables the index and 
   8.693 +# the value YES disables it.
   8.694 +
   8.695 +DISABLE_INDEX          = NO
   8.696 +
   8.697 +# This tag can be used to set the number of enum values (range [1..20]) 
   8.698 +# that doxygen will group on one line in the generated HTML documentation.
   8.699 +
   8.700 +ENUM_VALUES_PER_LINE   = 4
   8.701 +
   8.702 +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
   8.703 +# generated containing a tree-like index structure (just like the one that 
   8.704 +# is generated for HTML Help). For this to work a browser that supports 
   8.705 +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
   8.706 +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
   8.707 +# probably better off using the HTML help feature.
   8.708 +
   8.709 +GENERATE_TREEVIEW      = NO
   8.710 +
   8.711 +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
   8.712 +# used to set the initial width (in pixels) of the frame in which the tree 
   8.713 +# is shown.
   8.714 +
   8.715 +TREEVIEW_WIDTH         = 250
   8.716 +
   8.717 +#---------------------------------------------------------------------------
   8.718 +# configuration options related to the LaTeX output
   8.719 +#---------------------------------------------------------------------------
   8.720 +
   8.721 +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
   8.722 +# generate Latex output.
   8.723 +
   8.724 +GENERATE_LATEX         = YES
   8.725 +
   8.726 +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
   8.727 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
   8.728 +# put in front of it. If left blank `latex' will be used as the default path.
   8.729 +
   8.730 +LATEX_OUTPUT           = latex
   8.731 +
   8.732 +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
   8.733 +# invoked. If left blank `latex' will be used as the default command name.
   8.734 +
   8.735 +LATEX_CMD_NAME         = latex
   8.736 +
   8.737 +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
   8.738 +# generate index for LaTeX. If left blank `makeindex' will be used as the 
   8.739 +# default command name.
   8.740 +
   8.741 +MAKEINDEX_CMD_NAME     = makeindex
   8.742 +
   8.743 +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
   8.744 +# LaTeX documents. This may be useful for small projects and may help to 
   8.745 +# save some trees in general.
   8.746 +
   8.747 +COMPACT_LATEX          = NO
   8.748 +
   8.749 +# The PAPER_TYPE tag can be used to set the paper type that is used 
   8.750 +# by the printer. Possible values are: a4, a4wide, letter, legal and 
   8.751 +# executive. If left blank a4wide will be used.
   8.752 +
   8.753 +PAPER_TYPE             = a4wide
   8.754 +
   8.755 +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
   8.756 +# packages that should be included in the LaTeX output.
   8.757 +
   8.758 +EXTRA_PACKAGES         = 
   8.759 +
   8.760 +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
   8.761 +# the generated latex document. The header should contain everything until 
   8.762 +# the first chapter. If it is left blank doxygen will generate a 
   8.763 +# standard header. Notice: only use this tag if you know what you are doing!
   8.764 +
   8.765 +LATEX_HEADER           = 
   8.766 +
   8.767 +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
   8.768 +# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
   8.769 +# contain links (just like the HTML output) instead of page references 
   8.770 +# This makes the output suitable for online browsing using a pdf viewer.
   8.771 +
   8.772 +PDF_HYPERLINKS         = YES
   8.773 +
   8.774 +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
   8.775 +# plain latex in the generated Makefile. Set this option to YES to get a 
   8.776 +# higher quality PDF documentation.
   8.777 +
   8.778 +USE_PDFLATEX           = YES
   8.779 +
   8.780 +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
   8.781 +# command to the generated LaTeX files. This will instruct LaTeX to keep 
   8.782 +# running if errors occur, instead of asking the user for help. 
   8.783 +# This option is also used when generating formulas in HTML.
   8.784 +
   8.785 +LATEX_BATCHMODE        = NO
   8.786 +
   8.787 +# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
   8.788 +# include the index chapters (such as File Index, Compound Index, etc.) 
   8.789 +# in the output.
   8.790 +
   8.791 +LATEX_HIDE_INDICES     = NO
   8.792 +
   8.793 +#---------------------------------------------------------------------------
   8.794 +# configuration options related to the RTF output
   8.795 +#---------------------------------------------------------------------------
   8.796 +
   8.797 +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
   8.798 +# The RTF output is optimized for Word 97 and may not look very pretty with 
   8.799 +# other RTF readers or editors.
   8.800 +
   8.801 +GENERATE_RTF           = NO
   8.802 +
   8.803 +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
   8.804 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
   8.805 +# put in front of it. If left blank `rtf' will be used as the default path.
   8.806 +
   8.807 +RTF_OUTPUT             = rtf
   8.808 +
   8.809 +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
   8.810 +# RTF documents. This may be useful for small projects and may help to 
   8.811 +# save some trees in general.
   8.812 +
   8.813 +COMPACT_RTF            = NO
   8.814 +
   8.815 +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
   8.816 +# will contain hyperlink fields. The RTF file will 
   8.817 +# contain links (just like the HTML output) instead of page references. 
   8.818 +# This makes the output suitable for online browsing using WORD or other 
   8.819 +# programs which support those fields. 
   8.820 +# Note: wordpad (write) and others do not support links.
   8.821 +
   8.822 +RTF_HYPERLINKS         = NO
   8.823 +
   8.824 +# Load stylesheet definitions from file. Syntax is similar to doxygen's 
   8.825 +# config file, i.e. a series of assignments. You only have to provide 
   8.826 +# replacements, missing definitions are set to their default value.
   8.827 +
   8.828 +RTF_STYLESHEET_FILE    = 
   8.829 +
   8.830 +# Set optional variables used in the generation of an rtf document. 
   8.831 +# Syntax is similar to doxygen's config file.
   8.832 +
   8.833 +RTF_EXTENSIONS_FILE    = 
   8.834 +
   8.835 +#---------------------------------------------------------------------------
   8.836 +# configuration options related to the man page output
   8.837 +#---------------------------------------------------------------------------
   8.838 +
   8.839 +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
   8.840 +# generate man pages
   8.841 +
   8.842 +GENERATE_MAN           = NO
   8.843 +
   8.844 +# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
   8.845 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
   8.846 +# put in front of it. If left blank `man' will be used as the default path.
   8.847 +
   8.848 +MAN_OUTPUT             = man
   8.849 +
   8.850 +# The MAN_EXTENSION tag determines the extension that is added to 
   8.851 +# the generated man pages (default is the subroutine's section .3)
   8.852 +
   8.853 +MAN_EXTENSION          = .3
   8.854 +
   8.855 +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
   8.856 +# then it will generate one additional man file for each entity 
   8.857 +# documented in the real man page(s). These additional files 
   8.858 +# only source the real man page, but without them the man command 
   8.859 +# would be unable to find the correct page. The default is NO.
   8.860 +
   8.861 +MAN_LINKS              = NO
   8.862 +
   8.863 +#---------------------------------------------------------------------------
   8.864 +# configuration options related to the XML output
   8.865 +#---------------------------------------------------------------------------
   8.866 +
   8.867 +# If the GENERATE_XML tag is set to YES Doxygen will 
   8.868 +# generate an XML file that captures the structure of 
   8.869 +# the code including all documentation.
   8.870 +
   8.871 +GENERATE_XML           = NO
   8.872 +
   8.873 +# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
   8.874 +# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
   8.875 +# put in front of it. If left blank `xml' will be used as the default path.
   8.876 +
   8.877 +XML_OUTPUT             = xml
   8.878 +
   8.879 +# The XML_SCHEMA tag can be used to specify an XML schema, 
   8.880 +# which can be used by a validating XML parser to check the 
   8.881 +# syntax of the XML files.
   8.882 +
   8.883 +XML_SCHEMA             = 
   8.884 +
   8.885 +# The XML_DTD tag can be used to specify an XML DTD, 
   8.886 +# which can be used by a validating XML parser to check the 
   8.887 +# syntax of the XML files.
   8.888 +
   8.889 +XML_DTD                = 
   8.890 +
   8.891 +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
   8.892 +# dump the program listings (including syntax highlighting 
   8.893 +# and cross-referencing information) to the XML output. Note that 
   8.894 +# enabling this will significantly increase the size of the XML output.
   8.895 +
   8.896 +XML_PROGRAMLISTING     = YES
   8.897 +
   8.898 +#---------------------------------------------------------------------------
   8.899 +# configuration options for the AutoGen Definitions output
   8.900 +#---------------------------------------------------------------------------
   8.901 +
   8.902 +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
   8.903 +# generate an AutoGen Definitions (see autogen.sf.net) file 
   8.904 +# that captures the structure of the code including all 
   8.905 +# documentation. Note that this feature is still experimental 
   8.906 +# and incomplete at the moment.
   8.907 +
   8.908 +GENERATE_AUTOGEN_DEF   = NO
   8.909 +
   8.910 +#---------------------------------------------------------------------------
   8.911 +# configuration options related to the Perl module output
   8.912 +#---------------------------------------------------------------------------
   8.913 +
   8.914 +# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
   8.915 +# generate a Perl module file that captures the structure of 
   8.916 +# the code including all documentation. Note that this 
   8.917 +# feature is still experimental and incomplete at the 
   8.918 +# moment.
   8.919 +
   8.920 +GENERATE_PERLMOD       = NO
   8.921 +
   8.922 +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
   8.923 +# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
   8.924 +# to generate PDF and DVI output from the Perl module output.
   8.925 +
   8.926 +PERLMOD_LATEX          = NO
   8.927 +
   8.928 +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
   8.929 +# nicely formatted so it can be parsed by a human reader.  This is useful 
   8.930 +# if you want to understand what is going on.  On the other hand, if this 
   8.931 +# tag is set to NO the size of the Perl module output will be much smaller 
   8.932 +# and Perl will parse it just the same.
   8.933 +
   8.934 +PERLMOD_PRETTY         = YES
   8.935 +
   8.936 +# The names of the make variables in the generated doxyrules.make file 
   8.937 +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
   8.938 +# This is useful so different doxyrules.make files included by the same 
   8.939 +# Makefile don't overwrite each other's variables.
   8.940 +
   8.941 +PERLMOD_MAKEVAR_PREFIX = 
   8.942 +
   8.943 +#---------------------------------------------------------------------------
   8.944 +# Configuration options related to the preprocessor   
   8.945 +#---------------------------------------------------------------------------
   8.946 +
   8.947 +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
   8.948 +# evaluate all C-preprocessor directives found in the sources and include 
   8.949 +# files.
   8.950 +
   8.951 +ENABLE_PREPROCESSING   = YES
   8.952 +
   8.953 +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
   8.954 +# names in the source code. If set to NO (the default) only conditional 
   8.955 +# compilation will be performed. Macro expansion can be done in a controlled 
   8.956 +# way by setting EXPAND_ONLY_PREDEF to YES.
   8.957 +
   8.958 +MACRO_EXPANSION        = NO
   8.959 +
   8.960 +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
   8.961 +# then the macro expansion is limited to the macros specified with the 
   8.962 +# PREDEFINED and EXPAND_AS_PREDEFINED tags.
   8.963 +
   8.964 +EXPAND_ONLY_PREDEF     = NO
   8.965 +
   8.966 +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
   8.967 +# in the INCLUDE_PATH (see below) will be search if a #include is found.
   8.968 +
   8.969 +SEARCH_INCLUDES        = YES
   8.970 +
   8.971 +# The INCLUDE_PATH tag can be used to specify one or more directories that 
   8.972 +# contain include files that are not input files but should be processed by 
   8.973 +# the preprocessor.
   8.974 +
   8.975 +INCLUDE_PATH           = 
   8.976 +
   8.977 +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
   8.978 +# patterns (like *.h and *.hpp) to filter out the header-files in the 
   8.979 +# directories. If left blank, the patterns specified with FILE_PATTERNS will 
   8.980 +# be used.
   8.981 +
   8.982 +INCLUDE_FILE_PATTERNS  = 
   8.983 +
   8.984 +# The PREDEFINED tag can be used to specify one or more macro names that 
   8.985 +# are defined before the preprocessor is started (similar to the -D option of 
   8.986 +# gcc). The argument of the tag is a list of macros of the form: name 
   8.987 +# or name=definition (no spaces). If the definition and the = are 
   8.988 +# omitted =1 is assumed. To prevent a macro definition from being 
   8.989 +# undefined via #undef or recursively expanded use the := operator 
   8.990 +# instead of the = operator.
   8.991 +
   8.992 +PREDEFINED             = 
   8.993 +
   8.994 +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
   8.995 +# this tag can be used to specify a list of macro names that should be expanded. 
   8.996 +# The macro definition that is found in the sources will be used. 
   8.997 +# Use the PREDEFINED tag if you want to use a different macro definition.
   8.998 +
   8.999 +EXPAND_AS_DEFINED      = 
  8.1000 +
  8.1001 +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
  8.1002 +# doxygen's preprocessor will remove all function-like macros that are alone 
  8.1003 +# on a line, have an all uppercase name, and do not end with a semicolon. Such 
  8.1004 +# function macros are typically used for boiler-plate code, and will confuse 
  8.1005 +# the parser if not removed.
  8.1006 +
  8.1007 +SKIP_FUNCTION_MACROS   = YES
  8.1008 +
  8.1009 +#---------------------------------------------------------------------------
  8.1010 +# Configuration::additions related to external references   
  8.1011 +#---------------------------------------------------------------------------
  8.1012 +
  8.1013 +# The TAGFILES option can be used to specify one or more tagfiles. 
  8.1014 +# Optionally an initial location of the external documentation 
  8.1015 +# can be added for each tagfile. The format of a tag file without 
  8.1016 +# this location is as follows: 
  8.1017 +#   TAGFILES = file1 file2 ... 
  8.1018 +# Adding location for the tag files is done as follows: 
  8.1019 +#   TAGFILES = file1=loc1 "file2 = loc2" ... 
  8.1020 +# where "loc1" and "loc2" can be relative or absolute paths or 
  8.1021 +# URLs. If a location is present for each tag, the installdox tool 
  8.1022 +# does not have to be run to correct the links.
  8.1023 +# Note that each tag file must have a unique name
  8.1024 +# (where the name does NOT include the path)
  8.1025 +# If a tag file is not located in the directory in which doxygen 
  8.1026 +# is run, you must also specify the path to the tagfile here.
  8.1027 +
  8.1028 +TAGFILES               = 
  8.1029 +
  8.1030 +# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
  8.1031 +# a tag file that is based on the input files it reads.
  8.1032 +
  8.1033 +GENERATE_TAGFILE       = 
  8.1034 +
  8.1035 +# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
  8.1036 +# in the class index. If set to NO only the inherited external classes 
  8.1037 +# will be listed.
  8.1038 +
  8.1039 +ALLEXTERNALS           = NO
  8.1040 +
  8.1041 +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
  8.1042 +# in the modules index. If set to NO, only the current project's groups will 
  8.1043 +# be listed.
  8.1044 +
  8.1045 +EXTERNAL_GROUPS        = YES
  8.1046 +
  8.1047 +# The PERL_PATH should be the absolute path and name of the perl script 
  8.1048 +# interpreter (i.e. the result of `which perl').
  8.1049 +
  8.1050 +PERL_PATH              = /usr/bin/perl
  8.1051 +
  8.1052 +#---------------------------------------------------------------------------
  8.1053 +# Configuration options related to the dot tool   
  8.1054 +#---------------------------------------------------------------------------
  8.1055 +
  8.1056 +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
  8.1057 +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
  8.1058 +# or super classes. Setting the tag to NO turns the diagrams off. Note that 
  8.1059 +# this option is superseded by the HAVE_DOT option below. This is only a 
  8.1060 +# fallback. It is recommended to install and use dot, since it yields more 
  8.1061 +# powerful graphs.
  8.1062 +
  8.1063 +CLASS_DIAGRAMS         = YES
  8.1064 +
  8.1065 +# If set to YES, the inheritance and collaboration graphs will hide 
  8.1066 +# inheritance and usage relations if the target is undocumented 
  8.1067 +# or is not a class.
  8.1068 +
  8.1069 +HIDE_UNDOC_RELATIONS   = YES
  8.1070 +
  8.1071 +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
  8.1072 +# available from the path. This tool is part of Graphviz, a graph visualization 
  8.1073 +# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
  8.1074 +# have no effect if this option is set to NO (the default)
  8.1075 +
  8.1076 +HAVE_DOT               = NO
  8.1077 +
  8.1078 +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
  8.1079 +# will generate a graph for each documented class showing the direct and 
  8.1080 +# indirect inheritance relations. Setting this tag to YES will force the 
  8.1081 +# the CLASS_DIAGRAMS tag to NO.
  8.1082 +
  8.1083 +CLASS_GRAPH            = YES
  8.1084 +
  8.1085 +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
  8.1086 +# will generate a graph for each documented class showing the direct and 
  8.1087 +# indirect implementation dependencies (inheritance, containment, and 
  8.1088 +# class references variables) of the class with other documented classes.
  8.1089 +
  8.1090 +COLLABORATION_GRAPH    = YES
  8.1091 +
  8.1092 +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
  8.1093 +# will generate a graph for groups, showing the direct groups dependencies
  8.1094 +
  8.1095 +GROUP_GRAPHS           = YES
  8.1096 +
  8.1097 +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
  8.1098 +# collaboration diagrams in a style similar to the OMG's Unified Modeling 
  8.1099 +# Language.
  8.1100 +
  8.1101 +UML_LOOK               = NO
  8.1102 +
  8.1103 +# If set to YES, the inheritance and collaboration graphs will show the 
  8.1104 +# relations between templates and their instances.
  8.1105 +
  8.1106 +TEMPLATE_RELATIONS     = NO
  8.1107 +
  8.1108 +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
  8.1109 +# tags are set to YES then doxygen will generate a graph for each documented 
  8.1110 +# file showing the direct and indirect include dependencies of the file with 
  8.1111 +# other documented files.
  8.1112 +
  8.1113 +INCLUDE_GRAPH          = YES
  8.1114 +
  8.1115 +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
  8.1116 +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
  8.1117 +# documented header file showing the documented files that directly or 
  8.1118 +# indirectly include this file.
  8.1119 +
  8.1120 +INCLUDED_BY_GRAPH      = YES
  8.1121 +
  8.1122 +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
  8.1123 +# generate a call dependency graph for every global function or class method. 
  8.1124 +# Note that enabling this option will significantly increase the time of a run. 
  8.1125 +# So in most cases it will be better to enable call graphs for selected 
  8.1126 +# functions only using the \callgraph command.
  8.1127 +
  8.1128 +CALL_GRAPH             = NO
  8.1129 +
  8.1130 +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
  8.1131 +# will graphical hierarchy of all classes instead of a textual one.
  8.1132 +
  8.1133 +GRAPHICAL_HIERARCHY    = YES
  8.1134 +
  8.1135 +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
  8.1136 +# then doxygen will show the dependencies a directory has on other directories 
  8.1137 +# in a graphical way. The dependency relations are determined by the #include
  8.1138 +# relations between the files in the directories.
  8.1139 +
  8.1140 +DIRECTORY_GRAPH        = YES
  8.1141 +
  8.1142 +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
  8.1143 +# generated by dot. Possible values are png, jpg, or gif
  8.1144 +# If left blank png will be used.
  8.1145 +
  8.1146 +DOT_IMAGE_FORMAT       = png
  8.1147 +
  8.1148 +# The tag DOT_PATH can be used to specify the path where the dot tool can be 
  8.1149 +# found. If left blank, it is assumed the dot tool can be found in the path.
  8.1150 +
  8.1151 +DOT_PATH               = 
  8.1152 +
  8.1153 +# The DOTFILE_DIRS tag can be used to specify one or more directories that 
  8.1154 +# contain dot files that are included in the documentation (see the 
  8.1155 +# \dotfile command).
  8.1156 +
  8.1157 +DOTFILE_DIRS           = 
  8.1158 +
  8.1159 +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
  8.1160 +# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
  8.1161 +# this value, doxygen will try to truncate the graph, so that it fits within 
  8.1162 +# the specified constraint. Beware that most browsers cannot cope with very 
  8.1163 +# large images.
  8.1164 +
  8.1165 +MAX_DOT_GRAPH_WIDTH    = 1024
  8.1166 +
  8.1167 +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
  8.1168 +# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
  8.1169 +# this value, doxygen will try to truncate the graph, so that it fits within 
  8.1170 +# the specified constraint. Beware that most browsers cannot cope with very 
  8.1171 +# large images.
  8.1172 +
  8.1173 +MAX_DOT_GRAPH_HEIGHT   = 1024
  8.1174 +
  8.1175 +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
  8.1176 +# graphs generated by dot. A depth value of 3 means that only nodes reachable 
  8.1177 +# from the root by following a path via at most 3 edges will be shown. Nodes 
  8.1178 +# that lay further from the root node will be omitted. Note that setting this 
  8.1179 +# option to 1 or 2 may greatly reduce the computation time needed for large 
  8.1180 +# code bases. Also note that a graph may be further truncated if the graph's 
  8.1181 +# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH 
  8.1182 +# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), 
  8.1183 +# the graph is not depth-constrained.
  8.1184 +
  8.1185 +MAX_DOT_GRAPH_DEPTH    = 0
  8.1186 +
  8.1187 +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
  8.1188 +# background. This is disabled by default, which results in a white background. 
  8.1189 +# Warning: Depending on the platform used, enabling this option may lead to 
  8.1190 +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
  8.1191 +# read).
  8.1192 +
  8.1193 +DOT_TRANSPARENT        = NO
  8.1194 +
  8.1195 +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
  8.1196 +# files in one run (i.e. multiple -o and -T options on the command line). This 
  8.1197 +# makes dot run faster, but since only newer versions of dot (>1.8.10) 
  8.1198 +# support this, this feature is disabled by default.
  8.1199 +
  8.1200 +DOT_MULTI_TARGETS      = NO
  8.1201 +
  8.1202 +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
  8.1203 +# generate a legend page explaining the meaning of the various boxes and 
  8.1204 +# arrows in the dot generated graphs.
  8.1205 +
  8.1206 +GENERATE_LEGEND        = YES
  8.1207 +
  8.1208 +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
  8.1209 +# remove the intermediate dot files that are used to generate 
  8.1210 +# the various graphs.
  8.1211 +
  8.1212 +DOT_CLEANUP            = YES
  8.1213 +
  8.1214 +#---------------------------------------------------------------------------
  8.1215 +# Configuration::additions related to the search engine   
  8.1216 +#---------------------------------------------------------------------------
  8.1217 +
  8.1218 +# The SEARCHENGINE tag specifies whether or not a search engine should be 
  8.1219 +# used. If set to NO the values of all tags below this one will be ignored.
  8.1220 +
  8.1221 +SEARCHENGINE           = NO
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/docs/Doxyfilter	Tue Sep 13 10:14:16 2005 -0600
     9.3 @@ -0,0 +1,16 @@
     9.4 +#!/bin/sh
     9.5 +
     9.6 +#
     9.7 +# Doxyfilter <source-root> <filename>
     9.8 +#
     9.9 +
    9.10 +dir=$(dirname "$0")
    9.11 +
    9.12 +PYFILTER="$dir/pythfilter.py"
    9.13 +
    9.14 +if [ "${2/.py/}" != "$2" ]
    9.15 +then
    9.16 +    python "$PYFILTER" -r "$1" -f "$2"
    9.17 +else
    9.18 +    cat "$2"
    9.19 +fi
    10.1 --- a/docs/Makefile	Fri Sep 09 10:31:36 2005 -0600
    10.2 +++ b/docs/Makefile	Tue Sep 13 10:14:16 2005 -0600
    10.3 @@ -8,6 +8,7 @@ DVIPS		:= dvips
    10.4  LATEX		:= latex
    10.5  FIG2DEV		:= fig2dev
    10.6  LATEX2HTML	:= latex2html
    10.7 +DOXYGEN		:= doxygen
    10.8  
    10.9  pkgdocdir	:= /usr/share/doc/xen
   10.10  
   10.11 @@ -18,10 +19,14 @@ DOC_HTML	:= $(patsubst src/%.tex,html/%/
   10.12  
   10.13  GFX = $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
   10.14  
   10.15 +.PHONY:	all build dev-docs python-dev-docs ps pdf html clean install
   10.16 +
   10.17  all: build
   10.18  build: ps pdf html
   10.19  	rm -f *.aux *.dvi *.bbl *.blg *.glo *.idx *.ilg *.log *.ind *.toc
   10.20  
   10.21 +dev-docs: python-dev-docs
   10.22 +
   10.23  ps: $(DOC_PS)
   10.24  
   10.25  pdf: $(DOC_PDF)
   10.26 @@ -30,10 +35,18 @@ html:
   10.27  	@if which $(LATEX2HTML) 1>/dev/null 2>/dev/null; then \
   10.28  	$(MAKE) $(DOC_HTML); fi
   10.29  
   10.30 +python-dev-docs:
   10.31 +	mkdir -p api/tools/python
   10.32 +	@if which $(DOXYGEN) 1>/dev/null 2>/dev/null; then         \
   10.33 +        echo "Running doxygen to generate Python tools APIs ... "; \
   10.34 +	$(DOXYGEN) Doxyfile;                                       \
   10.35 +	$(MAKE) -C api/tools/python/latex ; fi
   10.36 +
   10.37  clean:
   10.38  	rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
   10.39  	rm -rf *.ilg *.log *.ind *.toc *.bak core
   10.40  	rm -rf $(GFX) ps pdf html
   10.41 +	rm -rf api
   10.42  
   10.43  install: all
   10.44  	rm -rf $(DESTDIR)$(pkgdocdir)
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/docs/pythfilter.py	Tue Sep 13 10:14:16 2005 -0600
    12.3 @@ -0,0 +1,658 @@
    12.4 +#!/usr/bin/env python
    12.5 +
    12.6 +# pythfilter.py v1.5.5, written by Matthias Baas (baas@ira.uka.de)
    12.7 +
    12.8 +# Doxygen filter which can be used to document Python source code.
    12.9 +# Classes (incl. methods) and functions can be documented.
   12.10 +# Every comment that begins with ## is literally turned into an
   12.11 +# Doxygen comment. Consecutive comment lines are turned into
   12.12 +# comment blocks (-> /** ... */).
   12.13 +# All the stuff is put inside a namespace with the same name as
   12.14 +# the source file.
   12.15 +
   12.16 +# Conversions:
   12.17 +# ============
   12.18 +# ##-blocks                  ->  /** ... */
   12.19 +# "class name(base): ..."    ->  "class name : public base {...}"
   12.20 +# "def name(params): ..."    ->  "name(params) {...}"
   12.21 +
   12.22 +# Changelog:
   12.23 +# 21.01.2003: Raw (r"") or unicode (u"") doc string will now be properly
   12.24 +#             handled. (thanks to Richard Laager for the patch)
   12.25 +# 22.12.2003: Fixed a bug where no function names would be output for "def"
   12.26 +#             blocks that were not in a class.
   12.27 +#             (thanks to Richard Laager for the patch)
   12.28 +# 12.12.2003: Implemented code to handle static and class methods with
   12.29 +#             this logic: Methods with "self" as the first argument are
   12.30 +#             non-static. Methods with "cls" are Python class methods,
   12.31 +#             which translate into static methods for Doxygen. Other
   12.32 +#             methods are assumed to be static methods. As should be
   12.33 +#             obvious, this logic doesn't take into account if the method
   12.34 +#             is actually setup as a classmethod() or a staticmethod(),
   12.35 +#             just if it follows the normal conventions.
   12.36 +#             (thanks to Richard Laager for the patch)
   12.37 +# 11.12.2003: Corrected #includes to use os.path.sep instead of ".". Corrected
   12.38 +#             namespace code to use "::" instead of ".".
   12.39 +#             (thanks to Richard Laager for the patch)
   12.40 +# 11.12.2003: Methods beginning with two underscores that end with
   12.41 +#             something other than two underscores are considered private
   12.42 +#             and are handled accordingly.
   12.43 +#             (thanks to Richard Laager for the patch)
   12.44 +# 03.12.2003: The first parameter of class methods (self) is removed from
   12.45 +#             the documentation.
   12.46 +# 03.11.2003: The module docstring will be used as namespace documentation
   12.47 +#             (thanks to Joe Bronkema for the patch)
   12.48 +# 08.07.2003: Namespaces get a default documentation so that the namespace
   12.49 +#             and its contents will show up in the generated documentation.
   12.50 +# 05.02.2003: Directories will be delted during synchronization.
   12.51 +# 31.01.2003: -f option & filtering entire directory trees.
   12.52 +# 10.08.2002: In base classes the '.' will be replaced by '::'
   12.53 +# 18.07.2002: * and ** will be translated into arguments
   12.54 +# 18.07.2002: Argument lists may contain default values using constructors.
   12.55 +# 18.06.2002: Support for ## public:
   12.56 +# 21.01.2002: from ... import will be translated to "using namespace ...;"
   12.57 +#             TODO: "from ... import *" vs "from ... import names"
   12.58 +#             TODO: Using normal imports: name.name -> name::name
   12.59 +# 20.01.2002: #includes will be placed in front of the namespace
   12.60 +
   12.61 +######################################################################
   12.62 +
   12.63 +# The program is written as a state machine with the following states:
   12.64 +#
   12.65 +# - OUTSIDE               The current position is outside any comment,
   12.66 +#                         class definition or function.
   12.67 +#
   12.68 +# - BUILD_COMMENT         Begins with first "##".
   12.69 +#                         Ends with the first token that is no "##"
   12.70 +#                         at the same column as before.
   12.71 +#
   12.72 +# - BUILD_CLASS_DECL      Begins with "class".
   12.73 +#                         Ends with ":"
   12.74 +# - BUILD_CLASS_BODY      Begins just after BUILD_CLASS_DECL.
   12.75 +#                         The first following token (which is no comment)
   12.76 +#                         determines indentation depth.
   12.77 +#                         Ends with a token that has a smaller indendation.
   12.78 +#
   12.79 +# - BUILD_DEF_DECL        Begins with "def".
   12.80 +#                         Ends with ":".
   12.81 +# - BUILD_DEF_BODY        Begins just after BUILD_DEF_DECL.
   12.82 +#                         The first following token (which is no comment)
   12.83 +#                         determines indentation depth.
   12.84 +#                         Ends with a token that has a smaller indendation.
   12.85 +
   12.86 +import getopt
   12.87 +import glob
   12.88 +import os.path
   12.89 +import re
   12.90 +import shutil
   12.91 +import string
   12.92 +import sys
   12.93 +import token
   12.94 +import tokenize
   12.95 +
   12.96 +from stat import *
   12.97 +
   12.98 +OUTSIDE          = 0
   12.99 +BUILD_COMMENT    = 1
  12.100 +BUILD_CLASS_DECL = 2
  12.101 +BUILD_CLASS_BODY = 3
  12.102 +BUILD_DEF_DECL   = 4
  12.103 +BUILD_DEF_BODY   = 5
  12.104 +IMPORT           = 6
  12.105 +IMPORT_OP        = 7
  12.106 +IMPORT_APPEND    = 8
  12.107 +
  12.108 +# Output file stream
  12.109 +outfile = sys.stdout
  12.110 +
  12.111 +# Output buffer
  12.112 +outbuffer = []
  12.113 +
  12.114 +out_row = 1
  12.115 +out_col = 0
  12.116 +
  12.117 +# Variables used by rec_name_n_param()
  12.118 +name         = ""
  12.119 +param        = ""
  12.120 +doc_string   = ""
  12.121 +record_state = 0
  12.122 +bracket_counter = 0
  12.123 +
  12.124 +# Tuple: (row,column)
  12.125 +class_spos  = (0,0)
  12.126 +def_spos    = (0,0)
  12.127 +import_spos = (0,0)
  12.128 +
  12.129 +# Which import was used? ("import" or "from")
  12.130 +import_token = ""
  12.131 +
  12.132 +# Comment block buffer
  12.133 +comment_block = []
  12.134 +comment_finished = 0
  12.135 +
  12.136 +# Imported modules
  12.137 +modules = []
  12.138 +
  12.139 +# Program state
  12.140 +stateStack = [OUTSIDE]
  12.141 +
  12.142 +# Keep track of whether module has a docstring
  12.143 +module_has_docstring = False
  12.144 +
  12.145 +# Keep track of member protection
  12.146 +protection_level = "public"
  12.147 +private_member = False
  12.148 +
  12.149 +# Keep track of the module namespace
  12.150 +namespace = ""
  12.151 +
  12.152 +######################################################################
  12.153 +# Output string s. '\n' may only be at the end of the string (not
  12.154 +# somewhere in the middle).
  12.155 +#
  12.156 +# In: s    - String
  12.157 +#     spos - Startpos
  12.158 +######################################################################
  12.159 +def output(s,spos, immediate=0):
  12.160 +    global outbuffer, out_row, out_col, outfile
  12.161 +
  12.162 +    os = string.rjust(s,spos[1]-out_col+len(s))
  12.163 +
  12.164 +    if immediate:
  12.165 +        outfile.write(os)
  12.166 +    else:
  12.167 +        outbuffer.append(os)
  12.168 +
  12.169 +    assert -1 == string.find(s[0:-2], "\n"), s
  12.170 +
  12.171 +    if (s[-1:]=="\n"):
  12.172 +        out_row = out_row+1
  12.173 +        out_col = 0
  12.174 +    else:
  12.175 +        out_col = spos[1]+len(s)
  12.176 +
  12.177 +
  12.178 +######################################################################
  12.179 +# Records a name and parameters. The name is either a class name or
  12.180 +# a function name. Then the parameter is either the base class or
  12.181 +# the function parameters.
  12.182 +# The name is stored in the global variable "name", the parameters
  12.183 +# in "param".
  12.184 +# The variable "record_state" holds the current state of this internal
  12.185 +# state machine.
  12.186 +# The recording is started by calling start_recording().
  12.187 +#
  12.188 +# In: type, tok
  12.189 +######################################################################
  12.190 +def rec_name_n_param(type, tok):
  12.191 +    global record_state,name,param,doc_string,bracket_counter
  12.192 +    s = record_state
  12.193 +    # State 0: Do nothing.
  12.194 +    if   (s==0):
  12.195 +         return
  12.196 +    # State 1: Remember name.
  12.197 +    elif (s==1):
  12.198 +        name = tok
  12.199 +        record_state = 2
  12.200 +    # State 2: Wait for opening bracket or colon
  12.201 +    elif (s==2):
  12.202 +        if (tok=='('):
  12.203 +            bracket_counter = 1
  12.204 +            record_state=3
  12.205 +        if (tok==':'): record_state=4
  12.206 +    # State 3: Store parameter (or base class) and wait for an ending bracket
  12.207 +    elif (s==3):
  12.208 +        if (tok=='*' or tok=='**'):
  12.209 +            tok=''
  12.210 +        if (tok=='('):
  12.211 +            bracket_counter = bracket_counter+1
  12.212 +        if (tok==')'):
  12.213 +            bracket_counter = bracket_counter-1
  12.214 +        if bracket_counter==0:
  12.215 +            record_state=4
  12.216 +        else:
  12.217 +            param=param+tok
  12.218 +    # State 4: Look for doc string
  12.219 +    elif (s==4):
  12.220 +        if (type==token.NEWLINE or type==token.INDENT or type==token.SLASHEQUAL):
  12.221 +            return
  12.222 +        elif (tok==":"):
  12.223 +            return
  12.224 +        elif (type==token.STRING):
  12.225 +            while tok[:1]=='r' or tok[:1]=='u':
  12.226 +                tok=tok[1:]
  12.227 +            while tok[:1]=='"':
  12.228 +                tok=tok[1:]
  12.229 +            while tok[-1:]=='"':
  12.230 +                tok=tok[:-1]
  12.231 +            doc_string=tok
  12.232 +        record_state=0
  12.233 +
  12.234 +######################################################################
  12.235 +# Starts the recording of a name & param part.
  12.236 +# The function rec_name_n_param() has to be fed with tokens. After
  12.237 +# the necessary tokens are fed the name and parameters can be found
  12.238 +# in the global variables "name" und "param".
  12.239 +######################################################################
  12.240 +def start_recording():
  12.241 +    global record_state,param,name, doc_string
  12.242 +    record_state=1
  12.243 +    name=""
  12.244 +    param=""
  12.245 +    doc_string=""
  12.246 +
  12.247 +######################################################################
  12.248 +# Test if recording is finished
  12.249 +######################################################################
  12.250 +def is_recording_finished():
  12.251 +    global record_state
  12.252 +    return record_state==0
  12.253 +
  12.254 +######################################################################
  12.255 +## Gather comment block
  12.256 +######################################################################
  12.257 +def gather_comment(type,tok,spos):
  12.258 +    global comment_block,comment_finished
  12.259 +    if (type!=tokenize.COMMENT):
  12.260 +        comment_finished = 1
  12.261 +    else:
  12.262 +        # Output old comment block if a new one is started.
  12.263 +        if (comment_finished):
  12.264 +            print_comment(spos)
  12.265 +            comment_finished=0
  12.266 +        if (tok[0:2]=="##" and tok[0:3]!="###"):
  12.267 +            append_comment_lines(tok[2:])
  12.268 +
  12.269 +######################################################################
  12.270 +## Output comment block and empty buffer.
  12.271 +######################################################################
  12.272 +def print_comment(spos):
  12.273 +    global comment_block,comment_finished
  12.274 +    if (comment_block!=[]):
  12.275 +        output("/** ",spos)
  12.276 +        for c in comment_block:
  12.277 +            output(c,spos)
  12.278 +        output("*/\n",spos)
  12.279 +    comment_block    = []
  12.280 +    comment_finished = 0
  12.281 +
  12.282 +######################################################################
  12.283 +def set_state(s):
  12.284 +    global stateStack
  12.285 +    stateStack[len(stateStack)-1]=s
  12.286 +
  12.287 +######################################################################
  12.288 +def get_state():
  12.289 +    global stateStack
  12.290 +    return stateStack[len(stateStack)-1]
  12.291 +
  12.292 +######################################################################
  12.293 +def push_state(s):
  12.294 +    global stateStack
  12.295 +    stateStack.append(s)
  12.296 +
  12.297 +######################################################################
  12.298 +def pop_state():
  12.299 +    global stateStack
  12.300 +    stateStack.pop()
  12.301 +
  12.302 +
  12.303 +######################################################################
  12.304 +def tok_eater(type, tok, spos, epos, line):
  12.305 +    global stateStack,name,param,class_spos,def_spos,import_spos
  12.306 +    global doc_string, modules, import_token, module_has_docstring
  12.307 +    global protection_level, private_member
  12.308 +    global out_row
  12.309 +
  12.310 +    while out_row + 1 < spos[0]:
  12.311 +        output("\n", (0, 0))
  12.312 +
  12.313 +    rec_name_n_param(type,tok)
  12.314 +    if (string.replace(string.strip(tok)," ","")=="##private:"):
  12.315 +         protection_level = "private"
  12.316 +         output("private:\n",spos)
  12.317 +    elif (string.replace(string.strip(tok)," ","")=="##protected:"):
  12.318 +         protection_level = "protected"
  12.319 +         output("protected:\n",spos)
  12.320 +    elif (string.replace(string.strip(tok)," ","")=="##public:"):
  12.321 +         protection_level = "public"
  12.322 +         output("public:\n",spos)
  12.323 +    else:
  12.324 +         gather_comment(type,tok,spos)
  12.325 +
  12.326 +    state = get_state()
  12.327 +
  12.328 +#    sys.stderr.write("%d: %s\n"%(state, tok))
  12.329 +
  12.330 +    # OUTSIDE
  12.331 +    if   (state==OUTSIDE):
  12.332 +        if  (tok=="class"):
  12.333 +            start_recording()
  12.334 +            class_spos = spos
  12.335 +            push_state(BUILD_CLASS_DECL)
  12.336 +        elif (tok=="def"):
  12.337 +            start_recording()
  12.338 +            def_spos = spos
  12.339 +            push_state(BUILD_DEF_DECL)
  12.340 +        elif (tok=="import") or (tok=="from"):
  12.341 +            import_token = tok
  12.342 +            import_spos = spos
  12.343 +            modules     = []
  12.344 +            push_state(IMPORT)
  12.345 +        elif (spos[1] == 0 and tok[:3] == '"""'):
  12.346 +            # Capture module docstring as namespace documentation
  12.347 +            module_has_docstring = True
  12.348 +            append_comment_lines("\\namespace %s\n" % namespace)
  12.349 +            append_comment_lines(tok[3:-3])
  12.350 +            print_comment(spos)
  12.351 +
  12.352 +    # IMPORT
  12.353 +    elif (state==IMPORT):
  12.354 +        if (type==token.NAME):
  12.355 +            modules.append(tok)
  12.356 +            set_state(IMPORT_OP)
  12.357 +    # IMPORT_OP
  12.358 +    elif (state==IMPORT_OP):
  12.359 +        if (tok=="."):
  12.360 +            set_state(IMPORT_APPEND)
  12.361 +        elif (tok==","):
  12.362 +            set_state(IMPORT)
  12.363 +        else:
  12.364 +            for m in modules:
  12.365 +                output('#include "'+m.replace('.',os.path.sep)+'.py"\n', import_spos, immediate=1)
  12.366 +                if import_token=="from":
  12.367 +                    output('using namespace '+m.replace('.', '::')+';\n', import_spos)
  12.368 +            pop_state()
  12.369 +    # IMPORT_APPEND
  12.370 +    elif (state==IMPORT_APPEND):
  12.371 +        if (type==token.NAME):
  12.372 +            modules[len(modules)-1]+="."+tok
  12.373 +            set_state(IMPORT_OP)
  12.374 +    # BUILD_CLASS_DECL
  12.375 +    elif (state==BUILD_CLASS_DECL):
  12.376 +        if (is_recording_finished()):
  12.377 +            s = "class "+name
  12.378 +            if (param!=""): s = s+" : public "+param.replace('.','::')
  12.379 +            if (doc_string!=""):
  12.380 +                append_comment_lines(doc_string)
  12.381 +            print_comment(class_spos)
  12.382 +            output(s+"\n",class_spos)
  12.383 +            output("{\n",(class_spos[0]+1,class_spos[1]))
  12.384 +            protection_level = "public"
  12.385 +            output("  public:\n",(class_spos[0]+2,class_spos[1]))
  12.386 +            set_state(BUILD_CLASS_BODY)
  12.387 +    # BUILD_CLASS_BODY
  12.388 +    elif (state==BUILD_CLASS_BODY):
  12.389 +        if (type!=token.INDENT and type!=token.NEWLINE and type!=40 and
  12.390 +            type!=tokenize.NL and type!=tokenize.COMMENT and
  12.391 +            (spos[1]<=class_spos[1])):
  12.392 +            output("}; // end of class\n",(out_row+1,class_spos[1]))
  12.393 +            pop_state()
  12.394 +        elif (tok=="def"):
  12.395 +            start_recording()
  12.396 +            def_spos = spos
  12.397 +            push_state(BUILD_DEF_DECL)
  12.398 +    # BUILD_DEF_DECL
  12.399 +    elif (state==BUILD_DEF_DECL):
  12.400 +        if (is_recording_finished()):
  12.401 +            param = param.replace("\n", " ")
  12.402 +            param = param.replace("=", " = ")
  12.403 +            params = param.split(",")
  12.404 +            if BUILD_CLASS_BODY in stateStack:
  12.405 +                if len(name) > 1 \
  12.406 +                   and name[0:2] == '__' \
  12.407 +                   and name[len(name)-2:len(name)] != '__' \
  12.408 +                   and protection_level != 'private':
  12.409 +                       private_member = True
  12.410 +                       output("  private:\n",(def_spos[0]+2,def_spos[1]))
  12.411 +
  12.412 +            if (doc_string != ""):
  12.413 +                append_comment_lines(doc_string)
  12.414 +
  12.415 +            print_comment(def_spos)
  12.416 +
  12.417 +            output_function_decl(name, params)
  12.418 +#       output("{\n",(def_spos[0]+1,def_spos[1]))
  12.419 +            set_state(BUILD_DEF_BODY)
  12.420 +    # BUILD_DEF_BODY
  12.421 +    elif (state==BUILD_DEF_BODY):
  12.422 +        if (type!=token.INDENT and type!=token.NEWLINE \
  12.423 +            and type!=40 and type!=tokenize.NL \
  12.424 +            and (spos[1]<=def_spos[1])):
  12.425 +#            output("} // end of method/function\n",(out_row+1,def_spos[1]))
  12.426 +            if private_member and protection_level != 'private':
  12.427 +                private_member = False
  12.428 +                output("  " + protection_level + ":\n",(def_spos[0]+2,def_spos[1]))
  12.429 +            pop_state()
  12.430 +#       else:
  12.431 +#            output(tok,spos)
  12.432 +
  12.433 +
  12.434 +def output_function_decl(name, params):
  12.435 +    global def_spos
  12.436 +
  12.437 +    # Do we document a class method? then remove the 'self' parameter
  12.438 +    if params[0] == 'self':
  12.439 +        preamble = ''
  12.440 +        params = params[1:]
  12.441 +    else:
  12.442 +        preamble = 'static '
  12.443 +        if params[0] == 'cls':
  12.444 +            params = params[1:]
  12.445 +
  12.446 +    param_string = string.join(params, ", Type ")
  12.447 +
  12.448 +    if param_string == '':
  12.449 +        param_string = '(' + param_string + ');\n'
  12.450 +    else:
  12.451 +        param_string = '(Type ' + param_string + ');\n'
  12.452 +
  12.453 +    output(preamble, def_spos)
  12.454 +    output(name, def_spos)
  12.455 +    output(param_string, def_spos)
  12.456 +
  12.457 +
  12.458 +def append_comment_lines(lines):
  12.459 +    map(append_comment_line, doc_string.split('\n'))
  12.460 +
  12.461 +paramRE = re.compile(r'(@param \w+):')
  12.462 +
  12.463 +def append_comment_line(line):
  12.464 +    global paramRE
  12.465 +    
  12.466 +    comment_block.append(paramRE.sub(r'\1', line) + '\n')
  12.467 +
  12.468 +def dump(filename):
  12.469 +    f = open(filename)
  12.470 +    r = f.readlines()
  12.471 +    for s in r:
  12.472 +        sys.stdout.write(s)
  12.473 +
  12.474 +def filter(filename):
  12.475 +    global name, module_has_docstring, source_root
  12.476 +
  12.477 +    path,name = os.path.split(filename)
  12.478 +    root,ext  = os.path.splitext(name)
  12.479 +
  12.480 +    if source_root and path.find(source_root) == 0:
  12.481 +        path = path[len(source_root):]
  12.482 +
  12.483 +        if path[0] == os.sep:
  12.484 +            path = path[1:]
  12.485 +
  12.486 +        ns = path.split(os.sep)
  12.487 +    else:
  12.488 +        ns = []
  12.489 +
  12.490 +    ns.append(root)
  12.491 +
  12.492 +    for n in ns:
  12.493 +        output("namespace " + n + " {\n",(0,0))
  12.494 +
  12.495 +    # set module name for tok_eater to use if there's a module doc string
  12.496 +    name = root
  12.497 +
  12.498 +#    sys.stderr.write('Filtering "'+filename+'"...')
  12.499 +    f = open(filename)
  12.500 +    tokenize.tokenize(f.readline, tok_eater)
  12.501 +    f.close()
  12.502 +    print_comment((0,0))
  12.503 +
  12.504 +    output("\n",(0,0))
  12.505 +    
  12.506 +    for n in ns:
  12.507 +        output("}  // end of namespace\n",(0,0))
  12.508 +
  12.509 +    if not module_has_docstring:
  12.510 +        # Put in default namespace documentation
  12.511 +        output('/** \\namespace '+root+' \n',(0,0))
  12.512 +        output('    \\brief Module "%s" */\n'%(root),(0,0))
  12.513 +
  12.514 +    for s in outbuffer:
  12.515 +        outfile.write(s)
  12.516 +
  12.517 +
  12.518 +def filterFile(filename, out=sys.stdout):
  12.519 +    global outfile
  12.520 +
  12.521 +    outfile = out
  12.522 +
  12.523 +    try:
  12.524 +        root,ext  = os.path.splitext(filename)
  12.525 +
  12.526 +        if ext==".py":
  12.527 +            filter(filename)
  12.528 +        else:
  12.529 +            dump(filename)
  12.530 +
  12.531 +#        sys.stderr.write("OK\n")
  12.532 +    except IOError,e:
  12.533 +        sys.stderr.write(e[1]+"\n")
  12.534 +
  12.535 +
  12.536 +######################################################################
  12.537 +
  12.538 +# preparePath
  12.539 +def preparePath(path):
  12.540 +    """Prepare a path.
  12.541 +
  12.542 +    Checks if the path exists and creates it if it does not exist.
  12.543 +    """
  12.544 +    if not os.path.exists(path):
  12.545 +        parent = os.path.dirname(path)
  12.546 +        if parent!="":
  12.547 +            preparePath(parent)
  12.548 +        os.mkdir(path)
  12.549 +
  12.550 +# isNewer
  12.551 +def isNewer(file1,file2):
  12.552 +    """Check if file1 is newer than file2.
  12.553 +
  12.554 +    file1 must be an existing file.
  12.555 +    """
  12.556 +    if not os.path.exists(file2):
  12.557 +        return True
  12.558 +    return os.stat(file1)[ST_MTIME]>os.stat(file2)[ST_MTIME]
  12.559 +
  12.560 +# convert
  12.561 +def convert(srcpath, destpath):
  12.562 +    """Convert a Python source tree into a C+ stub tree.
  12.563 +
  12.564 +    All *.py files in srcpath (including sub-directories) are filtered
  12.565 +    and written to destpath. If destpath exists, only the files
  12.566 +    that have been modified are filtered again. Files that were deleted
  12.567 +    from srcpath are also deleted in destpath if they are still present.
  12.568 +    The function returns the number of processed *.py files.
  12.569 +    """
  12.570 +    count=0
  12.571 +    sp = os.path.join(srcpath,"*")
  12.572 +    sfiles = glob.glob(sp)
  12.573 +    dp = os.path.join(destpath,"*")
  12.574 +    dfiles = glob.glob(dp)
  12.575 +    leftovers={}
  12.576 +    for df in dfiles:
  12.577 +        leftovers[os.path.basename(df)]=1
  12.578 +
  12.579 +    for srcfile in sfiles:
  12.580 +        basename = os.path.basename(srcfile)
  12.581 +        if basename in leftovers:
  12.582 +            del leftovers[basename]
  12.583 +
  12.584 +        # Is it a subdirectory?
  12.585 +        if os.path.isdir(srcfile):
  12.586 +            sdir = os.path.join(srcpath,basename)
  12.587 +            ddir = os.path.join(destpath,basename)
  12.588 +            count+=convert(sdir, ddir)
  12.589 +            continue
  12.590 +        # Check the extension (only *.py will be converted)
  12.591 +        root, ext = os.path.splitext(srcfile)
  12.592 +        if ext.lower()!=".py":
  12.593 +            continue
  12.594 +
  12.595 +        destfile = os.path.join(destpath,basename)
  12.596 +        if destfile==srcfile:
  12.597 +            print "WARNING: Input and output names are identical!"
  12.598 +            sys.exit(1)
  12.599 +
  12.600 +        count+=1
  12.601 +#        sys.stdout.write("%s\015"%(srcfile))
  12.602 +
  12.603 +        if isNewer(srcfile, destfile):
  12.604 +            preparePath(os.path.dirname(destfile))
  12.605 +#            out=open(destfile,"w")
  12.606 +#            filterFile(srcfile, out)
  12.607 +#            out.close()
  12.608 +            os.system("python %s -f %s>%s"%(sys.argv[0],srcfile,destfile))
  12.609 +
  12.610 +    # Delete obsolete files in destpath
  12.611 +    for df in leftovers:
  12.612 +        dname=os.path.join(destpath,df)
  12.613 +        if os.path.isdir(dname):
  12.614 +            try:
  12.615 +                shutil.rmtree(dname)
  12.616 +            except:
  12.617 +                print "Can't remove obsolete directory '%s'"%dname
  12.618 +        else:
  12.619 +            try:
  12.620 +                os.remove(dname)
  12.621 +            except:
  12.622 +                print "Can't remove obsolete file '%s'"%dname
  12.623 +
  12.624 +    return count
  12.625 +
  12.626 +
  12.627 +######################################################################
  12.628 +######################################################################
  12.629 +######################################################################
  12.630 +
  12.631 +filter_file = False
  12.632 +source_root = None
  12.633 +
  12.634 +try:
  12.635 +    opts, args = getopt.getopt(sys.argv[1:], "hfr:", ["help"])
  12.636 +except getopt.GetoptError,e:
  12.637 +    print e
  12.638 +    sys.exit(1)
  12.639 +
  12.640 +for o,a in opts:
  12.641 +    if o=="-f":
  12.642 +        filter_file = True
  12.643 +
  12.644 +    if o=="-r":
  12.645 +        source_root = os.path.abspath(a)
  12.646 +
  12.647 +if filter_file:
  12.648 +    # Filter the specified file and print the result to stdout
  12.649 +    filename = string.join(args)
  12.650 +    filterFile(os.path.abspath(filename))
  12.651 +else:
  12.652 +
  12.653 +    if len(args)!=2:
  12.654 +        sys.stderr.write("%s options input output\n"%(os.path.basename(sys.argv[0])))
  12.655 +        sys.exit(1)
  12.656 +
  12.657 +    # Filter an entire Python source tree
  12.658 +    print '"%s" -> "%s"\n'%(args[0],args[1])
  12.659 +    c=convert(args[0],args[1])
  12.660 +    print "%d files"%(c)
  12.661 +
    24.1 --- a/extras/mini-os/include/hypervisor.h	Fri Sep 09 10:31:36 2005 -0600
    24.2 +++ b/extras/mini-os/include/hypervisor.h	Tue Sep 13 10:14:16 2005 -0600
    24.3 @@ -414,15 +414,15 @@ HYPERVISOR_event_channel_op(
    24.4  
    24.5  static inline int
    24.6  HYPERVISOR_xen_version(
    24.7 -    int cmd)
    24.8 +    int cmd, void *arg)
    24.9  {
   24.10      int ret;
   24.11 -    unsigned long ignore;
   24.12 +    unsigned long ignore, ign2;
   24.13  
   24.14      __asm__ __volatile__ (
   24.15          TRAP_INSTR
   24.16 -        : "=a" (ret), "=b" (ignore)
   24.17 -	: "0" (__HYPERVISOR_xen_version), "1" (cmd)
   24.18 +        : "=a" (ret), "=b" (ignore), "=c" (ign2)
   24.19 +	: "0" (__HYPERVISOR_xen_version), "1" (cmd), "2" (arg)
   24.20  	: "memory" );
   24.21  
   24.22      return ret;
   166.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Fri Sep 09 10:31:36 2005 -0600
   166.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Tue Sep 13 10:14:16 2005 -0600
   166.3 @@ -543,7 +543,7 @@ EXPORT_SYMBOL(profile_pc);
   166.4  irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
   166.5  {
   166.6  	s64 delta, delta_cpu;
   166.7 -	int cpu = smp_processor_id();
   166.8 +	int i, cpu = smp_processor_id();
   166.9  	struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
  166.10  
  166.11  	write_seqlock(&xtime_lock);
  166.12 @@ -566,9 +566,9 @@ irqreturn_t timer_interrupt(int irq, voi
  166.13  		       (s64)get_nsec_offset(shadow),
  166.14  		       processed_system_time,
  166.15  		       per_cpu(processed_system_time, cpu));
  166.16 -		for (cpu = 0; cpu < num_online_cpus(); cpu++)
  166.17 -			printk(" %d: %lld\n", cpu,
  166.18 -			       per_cpu(processed_system_time, cpu));
  166.19 +		for (i = 0; i < num_online_cpus(); i++)
  166.20 +			printk(" %d: %lld\n", i,
  166.21 +			       per_cpu(processed_system_time, i));
  166.22  	}
  166.23  
  166.24  	/* System-wide jiffy work. */
   181.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Fri Sep 09 10:31:36 2005 -0600
   181.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/evtchn.c	Tue Sep 13 10:14:16 2005 -0600
   181.3 @@ -37,7 +37,7 @@
   181.4  #include <asm/atomic.h>
   181.5  #include <asm/system.h>
   181.6  #include <asm/ptrace.h>
   181.7 -#include <asm-xen/synch_bitops.h>
   181.8 +#include <asm/synch_bitops.h>
   181.9  #include <asm-xen/xen-public/event_channel.h>
  181.10  #include <asm-xen/xen-public/physdev.h>
  181.11  #include <asm-xen/hypervisor.h>
  181.12 @@ -123,7 +123,7 @@ extern asmlinkage unsigned int do_IRQ(st
  181.13   */
  181.14  void force_evtchn_callback(void)
  181.15  {
  181.16 -    (void)HYPERVISOR_xen_version(0);
  181.17 +    (void)HYPERVISOR_xen_version(0, NULL);
  181.18  }
  181.19  EXPORT_SYMBOL(force_evtchn_callback);
  181.20  
   183.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c	Fri Sep 09 10:31:36 2005 -0600
   183.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c	Tue Sep 13 10:14:16 2005 -0600
   183.3 @@ -19,7 +19,7 @@
   183.4  #include <asm-xen/xen_proc.h>
   183.5  #include <asm-xen/linux-public/privcmd.h>
   183.6  #include <asm-xen/gnttab.h>
   183.7 -#include <asm-xen/synch_bitops.h>
   183.8 +#include <asm/synch_bitops.h>
   183.9  
  183.10  #if 1
  183.11  #define ASSERT(_p) \
   247.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Fri Sep 09 10:31:36 2005 -0600
   247.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c	Tue Sep 13 10:14:16 2005 -0600
   247.3 @@ -65,7 +65,6 @@ static void frontend_changed(struct xenb
   247.4  
   247.5  	/* If other end is gone, delete ourself. */
   247.6  	if (node && !xenbus_exists(be->frontpath, "")) {
   247.7 -		xenbus_rm(be->dev->nodename, "");
   247.8  		device_unregister(&be->dev->dev);
   247.9  		return;
  247.10  	}
   260.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c	Fri Sep 09 10:31:36 2005 -0600
   260.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c	Tue Sep 13 10:14:16 2005 -0600
   260.3 @@ -182,9 +182,9 @@ static kdev_t kcons_device(struct consol
   260.4  #endif
   260.5  
   260.6  static struct console kcons_info = {
   260.7 -    device:  kcons_device,
   260.8 -    flags:   CON_PRINTBUFFER,
   260.9 -    index:   -1
  260.10 +    .device	= kcons_device,
  260.11 +    .flags	= CON_PRINTBUFFER,
  260.12 +    .index	= -1,
  260.13  };
  260.14  
  260.15  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
   264.1 --- a/linux-2.6-xen-sparse/drivers/xen/evtchn/evtchn.c	Fri Sep 09 10:31:36 2005 -0600
   264.2 +++ b/linux-2.6-xen-sparse/drivers/xen/evtchn/evtchn.c	Tue Sep 13 10:14:16 2005 -0600
   264.3 @@ -356,14 +356,14 @@ static int evtchn_release(struct inode *
   264.4  }
   264.5  
   264.6  static struct file_operations evtchn_fops = {
   264.7 -    owner:    THIS_MODULE,
   264.8 -    read:     evtchn_read,
   264.9 -    write:    evtchn_write,
  264.10 -    ioctl:    evtchn_ioctl,
  264.11 -    poll:     evtchn_poll,
  264.12 -    fasync:   evtchn_fasync,
  264.13 -    open:     evtchn_open,
  264.14 -    release:  evtchn_release
  264.15 +    .owner   = THIS_MODULE,
  264.16 +    .read    = evtchn_read,
  264.17 +    .write   = evtchn_write,
  264.18 +    .ioctl   = evtchn_ioctl,
  264.19 +    .poll    = evtchn_poll,
  264.20 +    .fasync  = evtchn_fasync,
  264.21 +    .open    = evtchn_open,
  264.22 +    .release = evtchn_release,
  264.23  };
  264.24  
  264.25  static struct miscdevice evtchn_miscdev = {
   275.1 --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Fri Sep 09 10:31:36 2005 -0600
   275.2 +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Tue Sep 13 10:14:16 2005 -0600
   275.3 @@ -241,8 +241,8 @@ static int privcmd_mmap(struct file * fi
   275.4  }
   275.5  
   275.6  static struct file_operations privcmd_file_ops = {
   275.7 -    ioctl : privcmd_ioctl,
   275.8 -    mmap:   privcmd_mmap
   275.9 +    .ioctl = privcmd_ioctl,
  275.10 +    .mmap  = privcmd_mmap,
  275.11  };
  275.12  
  275.13  
   293.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c	Fri Sep 09 10:31:36 2005 -0600
   293.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c	Tue Sep 13 10:14:16 2005 -0600
   293.3 @@ -5,6 +5,7 @@
   293.4   * to xenstore.
   293.5   * 
   293.6   * Copyright (c) 2005, Christian Limpach
   293.7 + * Copyright (c) 2005, Rusty Russell, IBM Corporation
   293.8   * 
   293.9   * This file may be distributed separately from the Linux kernel, or
  293.10   * incorporated into other software packages, subject to the following license:
  293.11 @@ -36,110 +37,105 @@
  293.12  #include <linux/wait.h>
  293.13  #include <linux/fs.h>
  293.14  
  293.15 -#include "xenstored.h"
  293.16  #include "xenbus_comms.h"
  293.17  
  293.18  #include <asm/uaccess.h>
  293.19  #include <asm-xen/xenbus.h>
  293.20 -#include <asm-xen/linux-public/xenbus_dev.h>
  293.21  #include <asm-xen/xen_proc.h>
  293.22 +#include <asm-xen/linux-public/xenstored.h>
  293.23  
  293.24  struct xenbus_dev_data {
  293.25 -	int in_transaction;
  293.26 +	/* Are there bytes left to be read in this message? */
  293.27 +	int bytes_left;
  293.28 +	/* Are we still waiting for the reply to a message we wrote? */
  293.29 +	int awaiting_reply;
  293.30 +	/* Buffer for outgoing messages. */
  293.31 +	unsigned int len;
  293.32 +	union {
  293.33 +		struct xsd_sockmsg msg;
  293.34 +		char buffer[PAGE_SIZE];
  293.35 +	} u;
  293.36  };
  293.37  
  293.38  static struct proc_dir_entry *xenbus_dev_intf;
  293.39  
  293.40 -void *xs_talkv(enum xsd_sockmsg_type type, const struct kvec *iovec,
  293.41 -	       unsigned int num_vecs, unsigned int *len);
  293.42 -
  293.43 -static int xenbus_dev_talkv(struct xenbus_dev_data *u, unsigned long data)
  293.44 +/* Reply can be long (dir, getperm): don't buffer, just examine
  293.45 + * headers so we can discard rest if they die. */
  293.46 +static ssize_t xenbus_dev_read(struct file *filp,
  293.47 +			       char __user *ubuf,
  293.48 +			       size_t len, loff_t *ppos)
  293.49  {
  293.50 -	struct xenbus_dev_talkv xt;
  293.51 -	unsigned int len;
  293.52 -	void *resp, *base;
  293.53 -	struct kvec *iovec;
  293.54 -	int ret = -EFAULT, v = 0;
  293.55 -
  293.56 -	if (copy_from_user(&xt, (void *)data, sizeof(xt)))
  293.57 -		return -EFAULT;
  293.58 -
  293.59 -	iovec = kmalloc(xt.num_vecs * sizeof(struct kvec), GFP_KERNEL);
  293.60 -	if (iovec == NULL)
  293.61 -		return -ENOMEM;
  293.62 +	struct xenbus_dev_data *data = filp->private_data;
  293.63 +	struct xsd_sockmsg msg;
  293.64 +	int err;
  293.65  
  293.66 -	if (copy_from_user(iovec, xt.iovec,
  293.67 -			   xt.num_vecs * sizeof(struct kvec)))
  293.68 -		goto out;
  293.69 +	/* Refill empty buffer? */
  293.70 +	if (data->bytes_left == 0) {
  293.71 +		if (len < sizeof(msg))
  293.72 +			return -EINVAL;
  293.73  
  293.74 -	for (v = 0; v < xt.num_vecs; v++) {
  293.75 -		base = iovec[v].iov_base;
  293.76 -		iovec[v].iov_base = kmalloc(iovec[v].iov_len, GFP_KERNEL);
  293.77 -		if (iovec[v].iov_base == NULL ||
  293.78 -		    copy_from_user(iovec[v].iov_base, base, iovec[v].iov_len))
  293.79 -		{
  293.80 -			if (iovec[v].iov_base)
  293.81 -				kfree(iovec[v].iov_base);
  293.82 -			else
  293.83 -				ret = -ENOMEM;
  293.84 -			v--;
  293.85 -			goto out;
  293.86 -		}
  293.87 +		err = xb_read(&msg, sizeof(msg));
  293.88 +		if (err)
  293.89 +			return err;
  293.90 +		data->bytes_left = msg.len;
  293.91 +		if (ubuf && copy_to_user(ubuf, &msg, sizeof(msg)) != 0)
  293.92 +			return -EFAULT;
  293.93 +		/* We can receive spurious XS_WATCH_EVENT messages. */
  293.94 +		if (msg.type != XS_WATCH_EVENT)
  293.95 +			data->awaiting_reply = 0;
  293.96 +		return sizeof(msg);
  293.97  	}
  293.98  
  293.99 -	resp = xs_talkv(xt.type, iovec, xt.num_vecs, &len);
 293.100 -	if (IS_ERR(resp)) {
 293.101 -		ret = PTR_ERR(resp);
 293.102 -		goto out;
 293.103 -	}
 293.104 +	/* Don't read over next header, or over temporary buffer. */
 293.105 +	if (len > sizeof(data->u.buffer))
 293.106 +		len = sizeof(data->u.buffer);
 293.107 +	if (len > data->bytes_left)
 293.108 +		len = data->bytes_left;
 293.109  
 293.110 -	switch (xt.type) {
 293.111 -	case XS_TRANSACTION_START:
 293.112 -		u->in_transaction = 1;
 293.113 -		break;
 293.114 -	case XS_TRANSACTION_END:
 293.115 -		u->in_transaction = 0;
 293.116 -		break;
 293.117 -	default:
 293.118 -		break;
 293.119 -	}
 293.120 +	err = xb_read(data->u.buffer, len);
 293.121 +	if (err)
 293.122 +		return err;
 293.123  
 293.124 -	ret = len;
 293.125 -	if (len > xt.len)
 293.126 -		len = xt.len;
 293.127 -
 293.128 -	if (copy_to_user(xt.buf, resp, len))
 293.129 -		ret = -EFAULT;
 293.130 -
 293.131 -	kfree(resp);
 293.132 - out:
 293.133 -	while (v-- > 0)
 293.134 -		kfree(iovec[v].iov_base);
 293.135 -	kfree(iovec);
 293.136 -	return ret;
 293.137 +	data->bytes_left -= len;
 293.138 +	if (ubuf && copy_to_user(ubuf, data->u.buffer, len) != 0)
 293.139 +		return -EFAULT;
 293.140 +	return len;
 293.141  }
 293.142  
 293.143 -static int xenbus_dev_ioctl(struct inode *inode, struct file *filp,
 293.144 -			    unsigned int cmd, unsigned long data)
 293.145 +/* We do v. basic sanity checking so they don't screw up kernel later. */
 293.146 +static ssize_t xenbus_dev_write(struct file *filp,
 293.147 +				const char __user *ubuf,
 293.148 +				size_t len, loff_t *ppos)
 293.149  {
 293.150 -	struct xenbus_dev_data *u = filp->private_data;
 293.151 -	int ret = -ENOSYS;
 293.152 +	struct xenbus_dev_data *data = filp->private_data;
 293.153 +	int err;
 293.154  
 293.155 -	switch (cmd) {
 293.156 -	case IOCTL_XENBUS_DEV_TALKV:
 293.157 -		ret = xenbus_dev_talkv(u, data);
 293.158 -		break;
 293.159 -	default:
 293.160 -		ret = -EINVAL;
 293.161 -		break;
 293.162 +	/* We gather data in buffer until we're ready to send it. */
 293.163 +	if (len > data->len + sizeof(data->u))
 293.164 +		return -EINVAL;
 293.165 +	if (copy_from_user(data->u.buffer + data->len, ubuf, len) != 0)
 293.166 +		return -EFAULT;
 293.167 +	data->len += len;
 293.168 +	if (data->len >= sizeof(data->u.msg) + data->u.msg.len) {
 293.169 +		err = xb_write(data->u.buffer, data->len);
 293.170 +		if (err)
 293.171 +			return err;
 293.172 +		data->len = 0;
 293.173 +		data->awaiting_reply = 1;
 293.174  	}
 293.175 -	return ret;
 293.176 +	return len;
 293.177  }
 293.178  
 293.179  static int xenbus_dev_open(struct inode *inode, struct file *filp)
 293.180  {
 293.181  	struct xenbus_dev_data *u;
 293.182  
 293.183 +	if (xen_start_info->store_evtchn == 0)
 293.184 +		return -ENOENT;
 293.185 +
 293.186 +	/* Don't try seeking. */
 293.187 +	nonseekable_open(inode, filp);
 293.188 +
 293.189  	u = kmalloc(sizeof(*u), GFP_KERNEL);
 293.190  	if (u == NULL)
 293.191  		return -ENOMEM;
 293.192 @@ -155,22 +151,27 @@ static int xenbus_dev_open(struct inode 
 293.193  
 293.194  static int xenbus_dev_release(struct inode *inode, struct file *filp)
 293.195  {
 293.196 -	struct xenbus_dev_data *u = filp->private_data;
 293.197 +	struct xenbus_dev_data *data = filp->private_data;
 293.198  
 293.199 -	if (u->in_transaction)
 293.200 -		xenbus_transaction_end(1);
 293.201 +	/* Discard any unread replies. */
 293.202 +	while (data->bytes_left || data->awaiting_reply)
 293.203 +		xenbus_dev_read(filp, NULL, sizeof(data->u.buffer), NULL);
 293.204 +
 293.205 +	/* Harmless if no transaction in progress. */
 293.206 +	xenbus_transaction_end(1);
 293.207  
 293.208  	up(&xenbus_lock);
 293.209  
 293.210 -	kfree(u);
 293.211 +	kfree(data);
 293.212  
 293.213  	return 0;
 293.214  }
 293.215  
 293.216  static struct file_operations xenbus_dev_file_ops = {
 293.217 -	ioctl: xenbus_dev_ioctl,
 293.218 -	open: xenbus_dev_open,
 293.219 -	release: xenbus_dev_release
 293.220 +	.read = xenbus_dev_read,
 293.221 +	.write = xenbus_dev_write,
 293.222 +	.open = xenbus_dev_open,
 293.223 +	.release = xenbus_dev_release,
 293.224  };
 293.225  
 293.226  static int __init
   294.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Fri Sep 09 10:31:36 2005 -0600
   294.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Tue Sep 13 10:14:16 2005 -0600
   294.3 @@ -166,6 +166,10 @@ static int xenbus_hotplug_backend(struct
   294.4  			    buffer, buffer_size, &length,
   294.5  			    "XENBUS_TYPE=%s", xdev->devicetype);
   294.6  
   294.7 +	add_hotplug_env_var(envp, num_envp, &i,
   294.8 +			    buffer, buffer_size, &length,
   294.9 +			    "XENBUS_PATH=%s", xdev->nodename);
  294.10 +
  294.11  	/* terminate, set to next free slot, shrink available space */
  294.12  	envp[i] = NULL;
  294.13  	envp = &envp[i];
   295.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Fri Sep 09 10:31:36 2005 -0600
   295.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Tue Sep 13 10:14:16 2005 -0600
   295.3 @@ -38,7 +38,7 @@
   295.4  #include <linux/fcntl.h>
   295.5  #include <linux/kthread.h>
   295.6  #include <asm-xen/xenbus.h>
   295.7 -#include "xenstored.h"
   295.8 +#include <asm-xen/linux-public/xenstored.h>
   295.9  #include "xenbus_comms.h"
  295.10  
  295.11  #define streq(a, b) (strcmp((a), (b)) == 0)
  295.12 @@ -106,10 +106,10 @@ void xenbus_debug_write(const char *str,
  295.13  }
  295.14  
  295.15  /* Send message to xs, get kmalloc'ed reply.  ERR_PTR() on error. */
  295.16 -void *xs_talkv(enum xsd_sockmsg_type type,
  295.17 -	       const struct kvec *iovec,
  295.18 -	       unsigned int num_vecs,
  295.19 -	       unsigned int *len)
  295.20 +static void *xs_talkv(enum xsd_sockmsg_type type,
  295.21 +		      const struct kvec *iovec,
  295.22 +		      unsigned int num_vecs,
  295.23 +		      unsigned int *len)
  295.24  {
  295.25  	struct xsd_sockmsg msg;
  295.26  	void *ret = NULL;
   304.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypercall.h	Fri Sep 09 10:31:36 2005 -0600
   304.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypercall.h	Tue Sep 13 10:14:16 2005 -0600
   304.3 @@ -270,9 +270,9 @@ HYPERVISOR_event_channel_op(
   304.4  
   304.5  static inline int
   304.6  HYPERVISOR_xen_version(
   304.7 -	int cmd)
   304.8 +	int cmd, void *arg)
   304.9  {
  304.10 -	return _hypercall1(int, xen_version, cmd);
  304.11 +	return _hypercall2(int, xen_version, cmd, arg);
  304.12  }
  304.13  
  304.14  static inline int
   328.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h	Fri Sep 09 10:31:36 2005 -0600
   328.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-i386/system.h	Tue Sep 13 10:14:16 2005 -0600
   328.3 @@ -4,7 +4,7 @@
   328.4  #include <linux/config.h>
   328.5  #include <linux/kernel.h>
   328.6  #include <linux/bitops.h>
   328.7 -#include <asm-xen/synch_bitops.h>
   328.8 +#include <asm/synch_bitops.h>
   328.9  #include <asm/segment.h>
  328.10  #include <asm/cpufeature.h>
  328.11  #include <asm-xen/hypervisor.h>
   338.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypercall.h	Fri Sep 09 10:31:36 2005 -0600
   338.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/hypercall.h	Tue Sep 13 10:14:16 2005 -0600
   338.3 @@ -260,9 +260,9 @@ HYPERVISOR_event_channel_op(
   338.4  
   338.5  static inline int
   338.6  HYPERVISOR_xen_version(
   338.7 -	int cmd)
   338.8 +	int cmd, void *arg)
   338.9  {
  338.10 -	return _hypercall1(int, xen_version, cmd);
  338.11 +	return _hypercall2(int, xen_version, cmd, arg);
  338.12  }
  338.13  
  338.14  static inline int
   358.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   358.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/synch_bitops.h	Tue Sep 13 10:14:16 2005 -0600
   358.3 @@ -0,0 +1,2 @@
   358.4 +
   358.5 +#include <asm-i386/synch_bitops.h>
   359.1 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h	Fri Sep 09 10:31:36 2005 -0600
   359.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/system.h	Tue Sep 13 10:14:16 2005 -0600
   359.3 @@ -4,7 +4,7 @@
   359.4  #include <linux/config.h>
   359.5  #include <linux/kernel.h>
   359.6  #include <asm/segment.h>
   359.7 -#include <asm-xen/synch_bitops.h>
   359.8 +#include <asm/synch_bitops.h>
   359.9  #include <asm-xen/hypervisor.h>
  359.10  #include <asm-xen/xen-public/arch-x86_64.h>
  359.11  
   365.1 --- a/linux-2.6-xen-sparse/include/asm-xen/evtchn.h	Fri Sep 09 10:31:36 2005 -0600
   365.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/evtchn.h	Tue Sep 13 10:14:16 2005 -0600
   365.3 @@ -35,7 +35,7 @@
   365.4  #include <linux/interrupt.h>
   365.5  #include <asm-xen/hypervisor.h>
   365.6  #include <asm/ptrace.h>
   365.7 -#include <asm-xen/synch_bitops.h>
   365.8 +#include <asm/synch_bitops.h>
   365.9  #include <asm-xen/xen-public/event_channel.h>
  365.10  #include <linux/smp.h>
  365.11  
   370.1 --- a/linux-2.6-xen-sparse/include/asm-xen/linux-public/xenbus_dev.h	Fri Sep 09 10:31:36 2005 -0600
   370.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   370.3 @@ -1,47 +0,0 @@
   370.4 -/*
   370.5 - * xenbus_dev.h
   370.6 - * 
   370.7 - * Copyright (c) 2005, Christian Limpach
   370.8 - * 
   370.9 - * This file may be distributed separately from the Linux kernel, or
  370.10 - * incorporated into other software packages, subject to the following license:
  370.11 - * 
  370.12 - * Permission is hereby granted, free of charge, to any person obtaining a copy
  370.13 - * of this source file (the "Software"), to deal in the Software without
  370.14 - * restriction, including without limitation the rights to use, copy, modify,
  370.15 - * merge, publish, distribute, sublicense, and/or sell copies of the Software,
  370.16 - * and to permit persons to whom the Software is furnished to do so, subject to
  370.17 - * the following conditions:
  370.18 - * 
  370.19 - * The above copyright notice and this permission notice shall be included in
  370.20 - * all copies or substantial portions of the Software.
  370.21 - * 
  370.22 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  370.23 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  370.24 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  370.25 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  370.26 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  370.27 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  370.28 - * IN THE SOFTWARE.
  370.29 - */
  370.30 -
  370.31 -#ifndef _XENBUS_DEV_H_
  370.32 -#define _XENBUS_DEV_H_
  370.33 -
  370.34 -struct xenbus_dev_talkv {
  370.35 -	enum xsd_sockmsg_type type;
  370.36 -	const struct kvec *iovec;
  370.37 -	unsigned int num_vecs;
  370.38 -	char *buf;
  370.39 -	unsigned int len;
  370.40 -};
  370.41 -
  370.42 -/*
  370.43 - * @cmd: IOCTL_XENBUS_DEV_TALKV
  370.44 - * @arg: struct xenbus_dev_talkv
  370.45 - * Return: 0 on success, error code on failure.
  370.46 - */
  370.47 -#define	IOCTL_XENBUS_DEV_TALKV \
  370.48 -	_IOC(_IOC_NONE, 'X', 0, sizeof(struct xenbus_dev_talkv))
  370.49 -
  370.50 -#endif /* _XENBUS_DEV_H_ */
   372.1 --- a/linux-2.6-xen-sparse/include/asm-xen/synch_bitops.h	Fri Sep 09 10:31:36 2005 -0600
   372.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   372.3 @@ -1,2 +0,0 @@
   372.4 -
   372.5 -#include <asm-i386/synch_bitops.h>
   382.1 --- a/linux-2.6-xen-sparse/mkbuildtree	Fri Sep 09 10:31:36 2005 -0600
   382.2 +++ b/linux-2.6-xen-sparse/mkbuildtree	Tue Sep 13 10:14:16 2005 -0600
   382.3 @@ -108,5 +108,5 @@ mkdir  ${AD}/include/asm-xen/xen-public
   382.4  cd     ${AD}/include/asm-xen/xen-public
   382.5  relative_lndir ../../../${RS}/../xen/include/public
   382.6  
   382.7 -cd ${AD}/drivers/xen/xenbus
   382.8 +cd ${AD}/include/asm-xen/linux-public
   382.9  ln -sf ../../../${RS}/../tools/xenstore/xenstored.h
   420.1 --- a/tools/console/daemon/io.c	Fri Sep 09 10:31:36 2005 -0600
   420.2 +++ b/tools/console/daemon/io.c	Tue Sep 13 10:14:16 2005 -0600
   420.3 @@ -87,6 +87,7 @@ static void buffer_append(struct domain 
   420.4  	struct buffer *buffer = &dom->buffer;
   420.5  	struct ring_head *ring = (struct ring_head *)dom->page;
   420.6  	size_t size;
   420.7 +	u32 oldcons;
   420.8  
   420.9  	while ((size = ring->prod - ring->cons) != 0) {
  420.10  		if ((buffer->capacity - buffer->size) < size) {
  420.11 @@ -98,7 +99,8 @@ static void buffer_append(struct domain 
  420.12  			}
  420.13  		}
  420.14  
  420.15 -		while (ring->cons < ring->prod) {
  420.16 +		oldcons = ring->cons;
  420.17 +		while (ring->cons < (oldcons + size)) {
  420.18  			buffer->data[buffer->size] =
  420.19  				ring->buf[XENCONS_IDX(ring->cons)];
  420.20  			buffer->size++;
   422.1 --- a/tools/console/daemon/main.c	Fri Sep 09 10:31:36 2005 -0600
   422.2 +++ b/tools/console/daemon/main.c	Tue Sep 13 10:14:16 2005 -0600
   422.3 @@ -30,6 +30,12 @@
   422.4  #include "utils.h"
   422.5  #include "io.h"
   422.6  
   422.7 +void usage(char *prg)
   422.8 +{
   422.9 +	fprintf(stderr, 
  422.10 +		"usage: %s [-h] [-V] [-v] [-i]\n", prg);
  422.11 +}
  422.12 +
  422.13  int main(int argc, char **argv)
  422.14  {
  422.15  	const char *sopts = "hVvi";
  422.16 @@ -49,7 +55,7 @@ int main(int argc, char **argv)
  422.17  	while ((ch = getopt_long(argc, argv, sopts, lopts, &opt_ind)) != -1) {
  422.18  		switch (ch) {
  422.19  		case 'h':
  422.20 -			//usage(argv[0]);
  422.21 +			usage(argv[0]);
  422.22  			exit(0);
  422.23  		case 'V':
  422.24  			//version(argv[0]);
   423.1 --- a/tools/console/daemon/utils.c	Fri Sep 09 10:31:36 2005 -0600
   423.2 +++ b/tools/console/daemon/utils.c	Tue Sep 13 10:14:16 2005 -0600
   423.3 @@ -105,7 +105,8 @@ void daemonize(const char *pidfile)
   423.4  	close(fd);
   423.5  
   423.6  	umask(027);
   423.7 -	chdir("/");
   423.8 +	if (chdir("/") < 0)
   423.9 +		exit (1);
  423.10  
  423.11  	fd = open(pidfile, O_RDWR | O_CREAT);
  423.12  	if (fd == -1) {
  423.13 @@ -117,7 +118,8 @@ void daemonize(const char *pidfile)
  423.14  	}
  423.15  
  423.16  	len = sprintf(buf, "%d\n", getpid());
  423.17 -	write(fd, buf, len);
  423.18 +	if (write(fd, buf, len) < 0)
  423.19 +		exit(1);
  423.20  
  423.21  	signal(SIGCHLD, child_exit);
  423.22  	signal(SIGTSTP, SIG_IGN);
   465.1 --- a/tools/examples/Makefile	Fri Sep 09 10:31:36 2005 -0600
   465.2 +++ b/tools/examples/Makefile	Tue Sep 13 10:14:16 2005 -0600
   465.3 @@ -21,10 +21,11 @@ XEN_CONFIGS += xmexample.vmx
   465.4  XEN_SCRIPT_DIR = /etc/xen/scripts
   465.5  XEN_SCRIPTS = network-bridge vif-bridge
   465.6  XEN_SCRIPTS += network-route vif-route
   465.7 +XEN_SCRIPTS += block-phy
   465.8  XEN_SCRIPTS += block-file
   465.9  XEN_SCRIPTS += block-enbd
  465.10  
  465.11 -XEN_BOOT_DIR = /usr/lib/xen/boot
  465.12 +XEN_BOOT_DIR = /usr/$(LIBDIR)/xen/boot
  465.13  XEN_BOOT = mem-map.sxp
  465.14  
  465.15  XEN_HOTPLUG_DIR = /etc/hotplug
  465.16 @@ -36,12 +37,15 @@ build:
  465.17  install: all install-initd install-configs install-scripts install-boot \
  465.18  	 install-hotplug
  465.19  
  465.20 +xmexample.vmx: xmexample.vmx.in
  465.21 +	sed -e 's/@@LIBDIR@@/$(LIBDIR)/' < $< > $@
  465.22 +
  465.23  install-initd:
  465.24  	[ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d
  465.25  	$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d
  465.26  	$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d
  465.27  
  465.28 -install-configs:
  465.29 +install-configs: $(XEN_CONFIGS)
  465.30  	[ -d $(DESTDIR)$(XEN_CONFIG_DIR) ] || \
  465.31  		$(INSTALL_DIR) $(DESTDIR)$(XEN_CONFIG_DIR)
  465.32  	[ -d $(DESTDIR)$(XEN_CONFIG_DIR)/auto ] || \
  465.33 @@ -76,3 +80,4 @@ install-hotplug:
  465.34  	done
  465.35  
  465.36  clean:
  465.37 +	$(RM) xmexample.vmx
   467.1 --- a/tools/examples/block-enbd	Fri Sep 09 10:31:36 2005 -0600
   467.2 +++ b/tools/examples/block-enbd	Tue Sep 13 10:14:16 2005 -0600
   467.3 @@ -3,31 +3,31 @@
   467.4  # Usage: block-enbd [bind server ctl_port |unbind node]
   467.5  #
   467.6  # The file argument to the bind command is the file we are to bind to a
   467.7 -# loop device.  We print the path to the loop device node to stdout.
   467.8 +# loop device.
   467.9  #
  467.10  # The node argument to unbind is the name of the device node we are to
  467.11  # unbind.
  467.12  #
  467.13  # This assumes you're running a correctly configured server at the other end!
  467.14  
  467.15 -case $1 in
  467.16 -	bind)
  467.17 -		for dev in /dev/nd*; do
  467.18 -			if nbd-client $2:$3 $dev; then
  467.19 -				echo $dev
  467.20 -				exit 0
  467.21 -			fi
  467.22 -		done
  467.23 -		exit 1
  467.24 -	;;
  467.25 +set -e
  467.26  
  467.27 -	unbind)
  467.28 -		nbd-client -d $2
  467.29 -		exit 0
  467.30 -	;;
  467.31 -
  467.32 -	*)
  467.33 -		echo 'Unknown command: ' $1 >&2
  467.34 -		echo 'Valid commands are: bind, unbind' >&2
  467.35 -		exit 1
  467.36 +case $1 in
  467.37 +  bind)
  467.38 +    for dev in /dev/nd*; do
  467.39 +      if nbd-client $2:$3 $dev; then
  467.40 +        major=$(stat -L -c %t "$dev")
  467.41 +        minor=$(stat -L -c %T "$dev")
  467.42 +        pdev=$(printf "0x%02x%02x" 0x$major 0x$minor)
  467.43 +        xenstore-write "$XENBUS_PATH"/physical-device $pdev \
  467.44 +          "$XENBUS_PATH"/node $dev
  467.45 +        exit 0
  467.46 +      fi
  467.47 +    done
  467.48 +    exit 1
  467.49 +    ;;
  467.50 +  unbind)
  467.51 +    nbd-client -d $2
  467.52 +    exit 0
  467.53 +    ;;
  467.54  esac
   468.1 --- a/tools/examples/block-file	Fri Sep 09 10:31:36 2005 -0600
   468.2 +++ b/tools/examples/block-file	Tue Sep 13 10:14:16 2005 -0600
   468.3 @@ -3,29 +3,29 @@
   468.4  # Usage: block_loop [bind file|unbind node]
   468.5  #
   468.6  # The file argument to the bind command is the file we are to bind to a
   468.7 -# loop device.  We print the path to the loop device node to stdout.
   468.8 +# loop device.
   468.9  #
  468.10  # The node argument to unbind is the name of the device node we are to
  468.11  # unbind.
  468.12  
  468.13 -case $1 in
  468.14 -	bind)
  468.15 -		for dev in /dev/loop*; do
  468.16 -			if losetup $dev $2; then
  468.17 -				echo $dev
  468.18 -				exit 0
  468.19 -			fi
  468.20 -		done
  468.21 -		exit 1
  468.22 -	;;
  468.23 +set -e
  468.24  
  468.25 -	unbind)
  468.26 -		losetup -d $2
  468.27 -		exit 0
  468.28 -	;;
  468.29 -
  468.30 -	*)
  468.31 -		echo 'Unknown command: ' $1 >&2
  468.32 -		echo 'Valid commands are: bind, unbind' >&2
  468.33 -		exit 1
  468.34 +case $1 in
  468.35 +  bind)
  468.36 +    for dev in /dev/loop*; do
  468.37 +      if losetup $dev $2; then
  468.38 +        major=$(stat -L -c %t "$dev")
  468.39 +        minor=$(stat -L -c %T "$dev")
  468.40 +        pdev=$(printf "0x%02x%02x" 0x$major 0x$minor)
  468.41 +        xenstore-write "$XENBUS_PATH"/physical-device $pdev \
  468.42 +          "$XENBUS_PATH"/node $dev
  468.43 +        exit 0
  468.44 +      fi
  468.45 +    done
  468.46 +    exit 1
  468.47 +    ;;
  468.48 +  unbind)
  468.49 +    losetup -d $2
  468.50 +    exit 0
  468.51 +    ;;
  468.52  esac
   469.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   469.2 +++ b/tools/examples/block-phy	Tue Sep 13 10:14:16 2005 -0600
   469.3 @@ -0,0 +1,30 @@
   469.4 +#! /bin/sh
   469.5 +
   469.6 +set -e
   469.7 +
   469.8 +expand_dev() {
   469.9 +  local dev
  469.10 +  case $1 in
  469.11 +  /*)
  469.12 +    dev=$1
  469.13 +    ;;
  469.14 +  *)
  469.15 +    dev=/dev/$1
  469.16 +    ;;
  469.17 +  esac
  469.18 +  echo -n $dev
  469.19 +}
  469.20 +
  469.21 +case $1 in
  469.22 +  bind)
  469.23 +    dev=$(expand_dev $2)
  469.24 +    major=$(stat -L -c %t "$dev")
  469.25 +    minor=$(stat -L -c %T "$dev")
  469.26 +    pdev=$(printf "0x%02x%02x" 0x$major 0x$minor)
  469.27 +    xenstore-write "$XENBUS_PATH"/physical-device $pdev \
  469.28 +        "$XENBUS_PATH"/node $dev
  469.29 +    exit 0
  469.30 +    ;;
  469.31 +  unbind)
  469.32 +    ;;
  469.33 +esac
   474.1 --- a/tools/examples/xen-backend.agent	Fri Sep 09 10:31:36 2005 -0600
   474.2 +++ b/tools/examples/xen-backend.agent	Tue Sep 13 10:14:16 2005 -0600
   474.3 @@ -9,8 +9,26 @@ PATH=/etc/xen/scripts:$PATH
   474.4  
   474.5  case "$ACTION" in
   474.6    add)
   474.7 +    case "$XENBUS_TYPE" in
   474.8 +      vbd)
   474.9 +        t=$(xenstore-read "$XENBUS_PATH"/type)
  474.10 +        params=$(xenstore-read "$XENBUS_PATH"/params)
  474.11 +        [ -x /etc/xen/scripts/block-"$t" ] && \
  474.12 +            /etc/xen/scripts/block-"$t" bind $params
  474.13 +        ;;
  474.14 +    esac
  474.15      ;;
  474.16    remove)
  474.17 +    case "$XENBUS_TYPE" in
  474.18 +      vbd)
  474.19 +        t=$(xenstore-read "$XENBUS_PATH"/type)
  474.20 +        node=$(xenstore-read "$XENBUS_PATH"/node)
  474.21 +        [ -x /etc/xen/scripts/block-"$t" ] && \
  474.22 +            /etc/xen/scripts/block-"$t" unbind $node
  474.23 +        ;;
  474.24 +    esac
  474.25 +    # remove device backend store entries
  474.26 +    xenstore-rm "$XENBUS_PATH"
  474.27      ;;
  474.28    online)
  474.29      case "$PHYSDEVDRIVER" in
   476.1 --- a/tools/examples/xmexample.vmx	Fri Sep 09 10:31:36 2005 -0600
   476.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   476.3 @@ -1,96 +0,0 @@
   476.4 -#  -*- mode: python; -*-
   476.5 -#============================================================================
   476.6 -# Python configuration setup for 'xm create'.
   476.7 -# This script sets the parameters used when a domain is created using 'xm create'.
   476.8 -# You use a separate script for each domain you want to create, or 
   476.9 -# you can set the parameters for the domain on the xm command line.
  476.10 -#============================================================================
  476.11 -
  476.12 -#----------------------------------------------------------------------------
  476.13 -# Kernel image file.
  476.14 -kernel = "/usr/lib/xen/boot/vmxloader"
  476.15 -
  476.16 -# The domain build function. VMX domain uses 'vmx'.
  476.17 -builder='vmx'
  476.18 -
  476.19 -# Initial memory allocation (in megabytes) for the new domain.
  476.20 -memory = 128
  476.21 -
  476.22 -# A name for your domain. All domains must have different names.
  476.23 -name = "ExampleVMXDomain"
  476.24 -
  476.25 -# Which CPU to start domain on? 
  476.26 -#cpu = -1   # leave to Xen to pick
  476.27 -
  476.28 -# Optionally define mac and/or bridge for the network interfaces.
  476.29 -# Random MACs are assigned if not given.
  476.30 -#vif = [ 'mac=aa:00:00:00:00:11, bridge=xen-br0' ]
  476.31 -
  476.32 -#----------------------------------------------------------------------------
  476.33 -# Define the disk devices you want the domain to have access to, and
  476.34 -# what you want them accessible as.
  476.35 -# Each disk entry is of the form phy:UNAME,DEV,MODE
  476.36 -# where UNAME is the device, DEV is the device name the domain will see,
  476.37 -# and MODE is r for read-only, w for read-write.
  476.38 -
  476.39 -#disk = [ 'phy:hda1,hda1,r' ]
  476.40 -disk = [ 'file:/var/images/min-el3-i386.img,ioemu:hda,w' ]
  476.41 -
  476.42 -#----------------------------------------------------------------------------
  476.43 -# Set according to whether you want the domain restarted when it exits.
  476.44 -# The default is 'onreboot', which restarts the domain when it shuts down
  476.45 -# with exit code reboot.
  476.46 -# Other values are 'always', and 'never'.
  476.47 -
  476.48 -#restart = 'onreboot'
  476.49 -
  476.50 -#============================================================================
  476.51 -
  476.52 -
  476.53 -# New stuff
  476.54 -device_model = '/usr/lib/xen/bin/qemu-dm'
  476.55 -
  476.56 -# Advanced users only. Don't touch if you don't know what you're doing
  476.57 -memmap = '/usr/lib/xen/boot/mem-map.sxp'
  476.58 -
  476.59 -#-----------------------------------------------------------------------------
  476.60 -# Disk image for 
  476.61 -#cdrom=
  476.62 -
  476.63 -#-----------------------------------------------------------------------------
  476.64 -# boot on floppy (a), hard disk (c) or CD-ROM (d) 
  476.65 -#boot=[a|c|d]
  476.66 -#-----------------------------------------------------------------------------
  476.67 -#  write to temporary files instead of disk image files
  476.68 -#snapshot=1
  476.69 -
  476.70 -#----------------------------------------------------------------------------
  476.71 -# enable SDL library for graphics, default = 0
  476.72 -sdl=0
  476.73 -
  476.74 -#----------------------------------------------------------------------------
  476.75 -# enable VNC library for graphics, default = 1
  476.76 -vnc=1
  476.77 -
  476.78 -#----------------------------------------------------------------------------
  476.79 -# enable spawning vncviewer(only valid when vnc=1), default = 1
  476.80 -vncviewer=1
  476.81 -
  476.82 -#----------------------------------------------------------------------------
  476.83 -# no graphics, use serial port
  476.84 -#nographic=0
  476.85 -
  476.86 -
  476.87 -#-----------------------------------------------------------------------------
  476.88 -#   enable audio support
  476.89 -#enable-audio=1
  476.90 -
  476.91 -
  476.92 -#-----------------------------------------------------------------------------
  476.93 -#    set the real time clock to local time [default=0 i.e. set to utc]
  476.94 -#localtime=1
  476.95 -
  476.96 -
  476.97 -#-----------------------------------------------------------------------------
  476.98 -#    start in full screen
  476.99 -#full-screen=1   
   477.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   477.2 +++ b/tools/examples/xmexample.vmx.in	Tue Sep 13 10:14:16 2005 -0600
   477.3 @@ -0,0 +1,96 @@
   477.4 +#  -*- mode: python; -*-
   477.5 +#============================================================================
   477.6 +# Python configuration setup for 'xm create'.
   477.7 +# This script sets the parameters used when a domain is created using 'xm create'.
   477.8 +# You use a separate script for each domain you want to create, or 
   477.9 +# you can set the parameters for the domain on the xm command line.
  477.10 +#============================================================================
  477.11 +
  477.12 +#----------------------------------------------------------------------------
  477.13 +# Kernel image file.
  477.14 +kernel = "/usr/@@LIBDIR@@/xen/boot/vmxloader"
  477.15 +
  477.16 +# The domain build function. VMX domain uses 'vmx'.
  477.17 +builder='vmx'
  477.18 +
  477.19 +# Initial memory allocation (in megabytes) for the new domain.
  477.20 +memory = 128
  477.21 +
  477.22 +# A name for your domain. All domains must have different names.
  477.23 +name = "ExampleVMXDomain"
  477.24 +
  477.25 +# Which CPU to start domain on? 
  477.26 +#cpu = -1   # leave to Xen to pick
  477.27 +
  477.28 +# Optionally define mac and/or bridge for the network interfaces.
  477.29 +# Random MACs are assigned if not given.
  477.30 +#vif = [ 'mac=aa:00:00:00:00:11, bridge=xen-br0' ]
  477.31 +
  477.32 +#----------------------------------------------------------------------------
  477.33 +# Define the disk devices you want the domain to have access to, and
  477.34 +# what you want them accessible as.
  477.35 +# Each disk entry is of the form phy:UNAME,DEV,MODE
  477.36 +# where UNAME is the device, DEV is the device name the domain will see,
  477.37 +# and MODE is r for read-only, w for read-write.
  477.38 +
  477.39 +#disk = [ 'phy:hda1,hda1,r' ]
  477.40 +disk = [ 'file:/var/images/min-el3-i386.img,ioemu:hda,w' ]
  477.41 +
  477.42 +#----------------------------------------------------------------------------
  477.43 +# Set according to whether you want the domain restarted when it exits.
  477.44 +# The default is 'onreboot', which restarts the domain when it shuts down
  477.45 +# with exit code reboot.
  477.46 +# Other values are 'always', and 'never'.
  477.47 +
  477.48 +#restart = 'onreboot'
  477.49 +
  477.50 +#============================================================================
  477.51 +
  477.52 +
  477.53 +# New stuff
  477.54 +device_model = '/usr/@@LIBDIR@@/xen/bin/qemu-dm'
  477.55 +
  477.56 +# Advanced users only. Don't touch if you don't know what you're doing
  477.57 +memmap = '/usr/@@LIBDIR@@/xen/boot/mem-map.sxp'
  477.58 +
  477.59 +#-----------------------------------------------------------------------------
  477.60 +# Disk image for 
  477.61 +#cdrom=
  477.62 +
  477.63 +#-----------------------------------------------------------------------------
  477.64 +# boot on floppy (a), hard disk (c) or CD-ROM (d) 
  477.65 +#boot=[a|c|d]
  477.66 +#-----------------------------------------------------------------------------
  477.67 +#  write to temporary files instead of disk image files
  477.68 +#snapshot=1
  477.69 +
  477.70 +#----------------------------------------------------------------------------
  477.71 +# enable SDL library for graphics, default = 0
  477.72 +sdl=0
  477.73 +
  477.74 +#----------------------------------------------------------------------------
  477.75 +# enable VNC library for graphics, default = 1
  477.76 +vnc=1
  477.77 +
  477.78 +#----------------------------------------------------------------------------
  477.79 +# enable spawning vncviewer(only valid when vnc=1), default = 1
  477.80 +vncviewer=1
  477.81 +
  477.82 +#----------------------------------------------------------------------------
  477.83 +# no graphics, use serial port
  477.84 +#nographic=0
  477.85 +
  477.86 +
  477.87 +#-----------------------------------------------------------------------------
  477.88 +#   enable audio support
  477.89 +#enable-audio=1
  477.90 +
  477.91 +
  477.92 +#-----------------------------------------------------------------------------
  477.93 +#    set the real time clock to local time [default=0 i.e. set to utc]
  477.94 +#localtime=1
  477.95 +
  477.96 +
  477.97 +#-----------------------------------------------------------------------------
  477.98 +#    start in full screen
  477.99 +#full-screen=1   
   495.1 --- a/tools/ioemu/hw/pcnet.c	Fri Sep 09 10:31:36 2005 -0600
   495.2 +++ b/tools/ioemu/hw/pcnet.c	Tue Sep 13 10:14:16 2005 -0600
   495.3 @@ -380,10 +380,13 @@ static int pcnet_can_receive(void *opaqu
   495.4      return sizeof(s->buffer)-16;
   495.5  }
   495.6  
   495.7 +#define MIN_BUF_SIZE 60
   495.8 +
   495.9  static void pcnet_receive(void *opaque, const uint8_t *buf, int size)
  495.10  {
  495.11      PCNetState *s = opaque;
  495.12      int is_padr = 0, is_bcast = 0, is_ladr = 0;
  495.13 +    uint8_t buf1[60];
  495.14  
  495.15      if (CSR_DRX(s) || CSR_STOP(s) || CSR_SPND(s) || !size)
  495.16          return;
  495.17 @@ -392,6 +395,14 @@ static void pcnet_receive(void *opaque, 
  495.18      printf("pcnet_receive size=%d\n", size);
  495.19  #endif
  495.20  
  495.21 +    /* if too small buffer, then expand it */
  495.22 +    if (size < MIN_BUF_SIZE) {
  495.23 +        memcpy(buf1, buf, size);
  495.24 +        memset(buf1 + size, 0, MIN_BUF_SIZE - size);
  495.25 +        buf = buf1;
  495.26 +        size = MIN_BUF_SIZE;
  495.27 +    }
  495.28 +
  495.29      if (CSR_PROM(s) 
  495.30          || (is_padr=padr_match(s, buf, size)) 
  495.31          || (is_bcast=padr_bcast(s, buf, size))
   499.1 --- a/tools/ioemu/target-i386-dm/Makefile	Fri Sep 09 10:31:36 2005 -0600
   499.2 +++ b/tools/ioemu/target-i386-dm/Makefile	Tue Sep 13 10:14:16 2005 -0600
   499.3 @@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
   499.4  include config.mak
   499.5  override TARGET_ARCH=i386
   499.6  
   499.7 -INSTALL_DIR := $(DESTDIR)/usr/lib/xen/bin
   499.8 +INSTALL_DIR := $(DESTDIR)/usr/$(LIBDIR)/xen/bin
   499.9  TARGET_PATH=$(SRC_PATH)/target-$(TARGET_ARCH)
  499.10  VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
  499.11  DEFINES=-I. -I$(TARGET_PATH) -I$(SRC_PATH) -I$(XEN_ROOT)/xen/include/public
   511.1 --- a/tools/libxc/xc_linux_restore.c	Fri Sep 09 10:31:36 2005 -0600
   511.2 +++ b/tools/libxc/xc_linux_restore.c	Tue Sep 13 10:14:16 2005 -0600
   511.3 @@ -42,18 +42,18 @@ read_exact(int fd, void *buf, size_t cou
   511.4      unsigned char *b = buf;
   511.5  
   511.6      while (r < count) {
   511.7 -	s = read(fd, &b[r], count - r);
   511.8 -	if (s <= 0)
   511.9 -	    break;
  511.10 -	r += s;
  511.11 +        s = read(fd, &b[r], count - r);
  511.12 +        if (s <= 0)
  511.13 +            break;
  511.14 +        r += s;
  511.15      }
  511.16  
  511.17      return r;
  511.18  }
  511.19  
  511.20  int xc_linux_restore(int xc_handle, int io_fd, u32 dom, unsigned long nr_pfns,
  511.21 -		     unsigned int store_evtchn, unsigned long *store_mfn,
  511.22 -		     unsigned int console_evtchn, unsigned long *console_mfn)
  511.23 +                     unsigned int store_evtchn, unsigned long *store_mfn,
  511.24 +                     unsigned int console_evtchn, unsigned long *console_mfn)
  511.25  {
  511.26      dom0_op_t op;
  511.27      int rc = 1, i, n, k;
  511.28 @@ -91,6 +91,8 @@ int xc_linux_restore(int xc_handle, int 
  511.29      /* A temporary mapping of the guest's start_info page. */
  511.30      start_info_t *start_info;
  511.31  
  511.32 +    int pt_levels = 2; /* XXX auto-detect this */
  511.33 +
  511.34      char *region_base;
  511.35  
  511.36      xc_mmu_t *mmu = NULL;
  511.37 @@ -112,8 +114,8 @@ int xc_linux_restore(int xc_handle, int 
  511.38      }
  511.39  
  511.40      if (read_exact(io_fd, pfn_to_mfn_frame_list, PAGE_SIZE) != PAGE_SIZE) {
  511.41 -	ERR("read pfn_to_mfn_frame_list failed");
  511.42 -	goto out;
  511.43 +        ERR("read pfn_to_mfn_frame_list failed");
  511.44 +        goto out;
  511.45      }
  511.46  
  511.47      /* We want zeroed memory so use calloc rather than malloc. */
  511.48 @@ -289,10 +291,10 @@ int xc_linux_restore(int xc_handle, int 
  511.49                          if ( xpfn >= nr_pfns )
  511.50                          {
  511.51                              ERR("Frame number in type %lu page "
  511.52 -                                       "table is out of range. i=%d k=%d "
  511.53 -                                       "pfn=0x%lx nr_pfns=%lu", 
  511.54 -                                       region_pfn_type[i]>>28, i, 
  511.55 -                                       k, xpfn, nr_pfns);
  511.56 +                                "table is out of range. i=%d k=%d "
  511.57 +                                "pfn=0x%lx nr_pfns=%lu", 
  511.58 +                                region_pfn_type[i]>>28, i, 
  511.59 +                                k, xpfn, nr_pfns);
  511.60                              goto out;
  511.61                          }
  511.62  
  511.63 @@ -317,10 +319,10 @@ int xc_linux_restore(int xc_handle, int 
  511.64                          if ( xpfn >= nr_pfns )
  511.65                          {
  511.66                              ERR("Frame number in type %lu page"
  511.67 -                                       " table is out of range. i=%d k=%d "
  511.68 -                                       "pfn=%lu nr_pfns=%lu",
  511.69 -                                       region_pfn_type[i]>>28, i, k, 
  511.70 -                                       xpfn, nr_pfns);
  511.71 +                                " table is out of range. i=%d k=%d "
  511.72 +                                "pfn=%lu nr_pfns=%lu",
  511.73 +                                region_pfn_type[i]>>28, i, k, 
  511.74 +                                xpfn, nr_pfns);
  511.75                              goto out;
  511.76                          }
  511.77  
  511.78 @@ -334,8 +336,8 @@ int xc_linux_restore(int xc_handle, int 
  511.79  
  511.80              default:
  511.81                  ERR("Bogus page type %lx page table is "
  511.82 -                           "out of range. i=%d nr_pfns=%lu", 
  511.83 -                           region_pfn_type[i], i, nr_pfns);
  511.84 +                    "out of range. i=%d nr_pfns=%lu", 
  511.85 +                    region_pfn_type[i], i, nr_pfns);
  511.86                  goto out;
  511.87  
  511.88              } /* end of page type switch statement */
  511.89 @@ -362,8 +364,8 @@ int xc_linux_restore(int xc_handle, int 
  511.90              }
  511.91  
  511.92              if ( xc_add_mmu_update(xc_handle, mmu,
  511.93 -				   (mfn<<PAGE_SHIFT) | MMU_MACHPHYS_UPDATE,
  511.94 -				   pfn) )
  511.95 +                                   (mfn<<PAGE_SHIFT) | MMU_MACHPHYS_UPDATE,
  511.96 +                                   pfn) )
  511.97              {
  511.98                  printf("machpys mfn=%ld pfn=%ld\n",mfn,pfn);
  511.99                  goto out;
 511.100 @@ -377,6 +379,33 @@ int xc_linux_restore(int xc_handle, int 
 511.101  
 511.102      DPRINTF("Received all pages\n");
 511.103  
 511.104 +    if ( pt_levels == 3 )
 511.105 +    {
 511.106 +        /* Get all PGDs below 4GB. */
 511.107 +        for ( i = 0; i < nr_pfns; i++ )
 511.108 +        {
 511.109 +            if ( ((pfn_type[i] & LTABTYPE_MASK) == L3TAB) &&
 511.110 +                 (pfn_to_mfn_table[i] > 0xfffffUL) )
 511.111 +            {
 511.112 +                unsigned long new_mfn = xc_make_page_below_4G(
 511.113 +                    xc_handle, dom, pfn_to_mfn_table[i]);
 511.114 +                if ( new_mfn == 0 )
 511.115 +                {
 511.116 +                    fprintf(stderr, "Couldn't get a page below 4GB :-(\n");
 511.117 +                    goto out;
 511.118 +                }
 511.119 +                pfn_to_mfn_table[i] = new_mfn;
 511.120 +                if ( xc_add_mmu_update(
 511.121 +                    xc_handle, mmu, (new_mfn << PAGE_SHIFT) |
 511.122 +                    MMU_MACHPHYS_UPDATE, i) )
 511.123 +                {
 511.124 +                    fprintf(stderr, "Couldn't m2p on PAE root pgdir\n");
 511.125 +                    goto out;
 511.126 +                }
 511.127 +            }
 511.128 +        }
 511.129 +    }
 511.130 +
 511.131      if ( xc_finish_mmu_updates(xc_handle, mmu) )
 511.132          goto out;
 511.133  
 511.134 @@ -410,57 +439,57 @@ int xc_linux_restore(int xc_handle, int 
 511.135  
 511.136      /* Get the list of PFNs that are not in the psuedo-phys map */
 511.137      {
 511.138 -	unsigned int count;
 511.139 +        unsigned int count;
 511.140          unsigned long *pfntab;
 511.141 -	int rc;
 511.142 +        int rc;
 511.143  
 511.144 -	if ( read_exact(io_fd, &count, sizeof(count)) != sizeof(count) )
 511.145 -	{
 511.146 -	    ERR("Error when reading pfn count");
 511.147 -	    goto out;
 511.148 -	}
 511.149 +        if ( read_exact(io_fd, &count, sizeof(count)) != sizeof(count) )
 511.150 +        {
 511.151 +            ERR("Error when reading pfn count");
 511.152 +            goto out;
 511.153 +        }
 511.154  
 511.155 -	pfntab = malloc( sizeof(unsigned int) * count );
 511.156 -	if ( pfntab == NULL )
 511.157 -	{
 511.158 -	    ERR("Out of memory");
 511.159 -	    goto out;
 511.160 -	}
 511.161 +        pfntab = malloc( sizeof(unsigned int) * count );
 511.162 +        if ( pfntab == NULL )
 511.163 +        {
 511.164 +            ERR("Out of memory");
 511.165 +            goto out;
 511.166 +        }
 511.167  
 511.168 -	if ( read_exact(io_fd, pfntab, sizeof(unsigned int)*count) !=
 511.169 +        if ( read_exact(io_fd, pfntab, sizeof(unsigned int)*count) !=
 511.170               sizeof(unsigned int)*count )
 511.171 -	{
 511.172 -	    ERR("Error when reading pfntab");
 511.173 -	    goto out;
 511.174 -	}
 511.175 +        {
 511.176 +            ERR("Error when reading pfntab");
 511.177 +            goto out;
 511.178 +        }
 511.179  
 511.180 -	for ( i = 0; i < count; i++ )
 511.181 -	{
 511.182 -	    unsigned long pfn = pfntab[i];
 511.183 -	    pfntab[i]=pfn_to_mfn_table[pfn];
 511.184 -	    pfn_to_mfn_table[pfn] = 0x80000001;  // not in pmap
 511.185 -	}
 511.186 +        for ( i = 0; i < count; i++ )
 511.187 +        {
 511.188 +            unsigned long pfn = pfntab[i];
 511.189 +            pfntab[i]=pfn_to_mfn_table[pfn];
 511.190 +            pfn_to_mfn_table[pfn] = 0x80000001;  // not in pmap
 511.191 +        }
 511.192  
 511.193 -	if ( count > 0 )
 511.194 -	{
 511.195 +        if ( count > 0 )
 511.196 +        {
 511.197              struct xen_memory_reservation reservation = {
 511.198                  .extent_start = pfntab,
 511.199                  .nr_extents   = count,
 511.200                  .extent_order = 0,
 511.201                  .domid        = dom
 511.202              };
 511.203 -	    if ( (rc = xc_memory_op(xc_handle,
 511.204 +            if ( (rc = xc_memory_op(xc_handle,
 511.205                                      XENMEM_decrease_reservation,
 511.206                                      &reservation)) != count )
 511.207 -	    {
 511.208 -		ERR("Could not decrease reservation : %d",rc);
 511.209 -		goto out;
 511.210 -	    }
 511.211 -	    else
 511.212 -	    {
 511.213 -		printf("Decreased reservation by %d pages\n", count);
 511.214 -	    }
 511.215 -	}	
 511.216 +            {
 511.217 +                ERR("Could not decrease reservation : %d",rc);
 511.218 +                goto out;
 511.219 +            }
 511.220 +            else
 511.221 +            {
 511.222 +                printf("Decreased reservation by %d pages\n", count);
 511.223 +            }
 511.224 +        } 
 511.225      }
 511.226  
 511.227      if ( read_exact(io_fd, &ctxt,            sizeof(ctxt)) != sizeof(ctxt) ||
 511.228 @@ -484,10 +513,10 @@ int xc_linux_restore(int xc_handle, int 
 511.229      start_info->shared_info = shared_info_frame << PAGE_SHIFT;
 511.230      start_info->flags       = 0;
 511.231      *store_mfn = start_info->store_mfn   =
 511.232 -	pfn_to_mfn_table[start_info->store_mfn];
 511.233 +        pfn_to_mfn_table[start_info->store_mfn];
 511.234      start_info->store_evtchn = store_evtchn;
 511.235      *console_mfn = start_info->console_mfn   =
 511.236 -	pfn_to_mfn_table[start_info->console_mfn];
 511.237 +        pfn_to_mfn_table[start_info->console_mfn];
 511.238      start_info->console_evtchn = console_evtchn;
 511.239      munmap(start_info, PAGE_SIZE);
 511.240  
 511.241 @@ -522,7 +551,7 @@ int xc_linux_restore(int xc_handle, int 
 511.242  
 511.243      /* clear any pending events and the selector */
 511.244      memset(&(shared_info->evtchn_pending[0]), 0,
 511.245 -	   sizeof (shared_info->evtchn_pending));
 511.246 +           sizeof (shared_info->evtchn_pending));
 511.247      for ( i = 0; i < MAX_VIRT_CPUS; i++ )
 511.248          shared_info->vcpu_data[i].evtchn_pending_sel = 0;
 511.249  
 511.250 @@ -548,7 +577,7 @@ int xc_linux_restore(int xc_handle, int 
 511.251      }
 511.252      
 511.253      if ( (live_pfn_to_mfn_table = 
 511.254 -	  xc_map_foreign_batch(xc_handle, dom, 
 511.255 +          xc_map_foreign_batch(xc_handle, dom, 
 511.256                                 PROT_WRITE,
 511.257                                 pfn_to_mfn_frame_list,
 511.258                                 (nr_pfns+1023)/1024 )) == 0 )
   516.1 --- a/tools/libxc/xc_private.c	Fri Sep 09 10:31:36 2005 -0600
   516.2 +++ b/tools/libxc/xc_private.c	Tue Sep 13 10:14:16 2005 -0600
   516.3 @@ -425,23 +425,49 @@ int xc_dom0_op(int xc_handle, dom0_op_t 
   516.4  
   516.5  int xc_version(int xc_handle, int cmd, void *arg)
   516.6  {
   516.7 -    return do_xen_version(xc_handle, cmd, arg);
   516.8 +    int rc, argsize = 0;
   516.9 +
  516.10 +    switch ( cmd )
  516.11 +    {
  516.12 +    case XENVER_extraversion: argsize = sizeof(xen_extraversion_t); break;
  516.13 +    case XENVER_compile_info: argsize = sizeof(xen_compile_info_t); break;
  516.14 +    case XENVER_capabilities: argsize = sizeof(xen_capabilities_info_t); break;
  516.15 +    case XENVER_changeset:    argsize = sizeof(xen_changeset_info_t); break;
  516.16 +    case XENVER_parameters:   argsize = sizeof(xen_parameters_info_t); break;
  516.17 +    }
  516.18 +
  516.19 +    if ( (argsize != 0) && (mlock(arg, argsize) != 0) )
  516.20 +    {
  516.21 +        PERROR("Could not lock memory for version hypercall");
  516.22 +        return -ENOMEM;
  516.23 +    }
  516.24 +
  516.25 +    rc = do_xen_version(xc_handle, cmd, arg);
  516.26 +
  516.27 +    if ( argsize != 0 )
  516.28 +        safe_munlock(arg, argsize);
  516.29 +
  516.30 +    return rc;
  516.31  }
  516.32  
  516.33 -unsigned long xc_make_page_below_4G(int xc_handle, u32 domid, 
  516.34 -				    unsigned long mfn)
  516.35 +unsigned long xc_make_page_below_4G(
  516.36 +    int xc_handle, u32 domid, unsigned long mfn)
  516.37  {
  516.38      unsigned long new_mfn;
  516.39 +
  516.40      if ( xc_domain_memory_decrease_reservation( 
  516.41 -	xc_handle, domid, 1, 0, &mfn ) != 1 )
  516.42 +	xc_handle, domid, 1, 0, &mfn) != 1 )
  516.43      {
  516.44  	fprintf(stderr,"xc_make_page_below_4G decrease failed. mfn=%lx\n",mfn);
  516.45  	return 0;
  516.46      }
  516.47 -    if ( xc_domain_memory_increase_reservation( xc_handle, domid, 1, 0, 32, &new_mfn ) != 1 )
  516.48 +
  516.49 +    if ( xc_domain_memory_increase_reservation(
  516.50 +        xc_handle, domid, 1, 0, 32, &new_mfn) != 1 )
  516.51      {
  516.52  	fprintf(stderr,"xc_make_page_below_4G increase failed. mfn=%lx\n",mfn);
  516.53  	return 0;
  516.54      }
  516.55 +
  516.56      return new_mfn;
  516.57  }
   519.1 --- a/tools/libxc/xc_vmx_build.c	Fri Sep 09 10:31:36 2005 -0600
   519.2 +++ b/tools/libxc/xc_vmx_build.c	Tue Sep 13 10:14:16 2005 -0600
   519.3 @@ -578,15 +578,6 @@ static int setup_guest(int xc_handle,
   519.4      sp->sp_global.eport = control_evtchn;
   519.5      munmap(sp, PAGE_SIZE);
   519.6  
   519.7 -    /*
   519.8 -     * Pin down l2tab addr as page dir page - causes hypervisor to provide
   519.9 -     * correct protection for the page
  519.10 -     */ 
  519.11 -#ifdef __i386__
  519.12 -    if ( pin_table(xc_handle, MMUEXT_PIN_L2_TABLE, l2tab>>PAGE_SHIFT, dom) )
  519.13 -        goto error_out;
  519.14 -#endif
  519.15 -
  519.16      /* Send the page update requests down to the hypervisor. */
  519.17      if ( xc_finish_mmu_updates(xc_handle, mmu) )
  519.18          goto error_out;
   535.1 --- a/tools/python/Makefile	Fri Sep 09 10:31:36 2005 -0600
   535.2 +++ b/tools/python/Makefile	Tue Sep 13 10:14:16 2005 -0600
   535.3 @@ -1,7 +1,8 @@
   535.4 -
   535.5  XEN_ROOT = ../..
   535.6  include $(XEN_ROOT)/tools/Rules.mk
   535.7  
   535.8 +.PHONY: all build install clean
   535.9 +
  535.10  all: build
  535.11  build:
  535.12  	CFLAGS="$(CFLAGS)" python setup.py build
   536.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   536.2 +++ b/tools/python/pylintrc	Tue Sep 13 10:14:16 2005 -0600
   536.3 @@ -0,0 +1,307 @@
   536.4 +# lint Python modules using external checkers.                            
   536.5 +#                                                                                
   536.6 +#     This is the main checker controling the other ones and the reports         
   536.7 +#     generation. It is itself both a raw checker and an astng checker in order  
   536.8 +#     to:                                                                        
   536.9 +#     * handle message activation / deactivation at the module level             
  536.10 +#     * handle some basic but necessary stats'data (number of classes, methods...)
  536.11 +#                                                                                 
  536.12 +# This checker also defines the following reports:                                    
  536.13 +#   * R0001: Total errors / warnings                                              
  536.14 +#   * R0002: % errors / warnings by module                                        
  536.15 +#   * R0003: Messages                                                             
  536.16 +#   * R0004: Global evaluation                                                    
  536.17 +# 
  536.18 +[MASTER]
  536.19 +# Add <file or directory> to the black list. It should be a base name, not a
  536.20 +# path. You may set this option multiple times.
  536.21 +ignore=CVS
  536.22 +
  536.23 +# Pickle collected data for later comparisons.
  536.24 +persistent=yes
  536.25 +
  536.26 +# Set the cache size for astng objects.
  536.27 +cache-size=500
  536.28 +
  536.29 +
  536.30 +
  536.31 +[REPORTS]
  536.32 +# Tells wether to display a full report or only the messages
  536.33 +reports=yes
  536.34 +
  536.35 +# Use HTML as output format instead of text
  536.36 +html=no
  536.37 +
  536.38 +# Use a parseable text output format, so your favorite text editor will be able
  536.39 +# to jump to the line corresponding to a message.
  536.40 +parseable=no
  536.41 +
  536.42 +# Colorizes text output using ansi escape codes
  536.43 +color=no
  536.44 +
  536.45 +# Put messages in a separate file for each module / package specified on the
  536.46 +# command line instead of printing them on stdout. Reports (if any) will be
  536.47 +# written in a file name "pylint_global.[txt|html]".
  536.48 +files-output=no
  536.49 +
  536.50 +# Python expression which should return a note less than 10 (10 is the highest
  536.51 +# note).You have access to the variables errors warning, statement which
  536.52 +# respectivly contain the number of errors / warnings messages and the total
  536.53 +# number of statements analyzed. This is used by the global evaluation report
  536.54 +# (R0004).
  536.55 +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
  536.56 +
  536.57 +# Add a comment according to your evaluation note. This is used by the global
  536.58 +# evaluation report (R0004).
  536.59 +comment=no
  536.60 +
  536.61 +# Include message's id in output
  536.62 +include-ids=yes
  536.63 +
  536.64 +
  536.65 +
  536.66 +# checks for                                                              
  536.67 +#     * unused variables / imports                                               
  536.68 +#     * undefined variables                                                      
  536.69 +#     * redefinition of variable from builtins or from an outer scope            
  536.70 +#     * use of variable before assigment                                         
  536.71 +#     
  536.72 +[VARIABLES]
  536.73 +# Enable / disable this checker
  536.74 +enable-variables=yes
  536.75 +
  536.76 +# Tells wether we should check for unused import in __init__ files.
  536.77 +init-import=no
  536.78 +
  536.79 +# List of variable names used for dummy variables (i.e. not used).
  536.80 +dummy-variables=_,dummy
  536.81 +
  536.82 +
  536.83 +
  536.84 +# checks for :                                                            
  536.85 +#     * doc strings                                                              
  536.86 +#     * modules / classes / functions / methods / arguments / variables name     
  536.87 +#     * number of arguments, local variables, branchs, returns and statements in
  536.88 +# functions, methods                                                       
  536.89 +#     * required module attributes                                             
  536.90 +#     * dangerous default values as arguments                                    
  536.91 +#     * redefinition of function / method / class                                
  536.92 +#     * uses of the global statement                                             
  536.93 +#                                                                                 
  536.94 +# This checker also defines the following reports:                                    
  536.95 +#   * R0101: Statistics by type                                                   
  536.96 +# 
  536.97 +[BASIC]
  536.98 +# Enable / disable this checker
  536.99 +enable-basic=yes
 536.100 +
 536.101 +# Required attributes for module, separated by a comma
 536.102 +required-attributes=
 536.103 +
 536.104 +# Regular expression which should only match functions or classes name which do
 536.105 +# not require a docstring
 536.106 +no-docstring-rgx=.*
 536.107 +
 536.108 +# Minimal length for module / class / function / method / argument / variable
 536.109 +# names
 536.110 +min-name-length=1
 536.111 +
 536.112 +# Regular expression which should only match correct module names
 536.113 +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
 536.114 +
 536.115 +# Regular expression which should only match correct class names
 536.116 +class-rgx=[A-Z_][a-zA-Z0-9]+$
 536.117 +
 536.118 +# Regular expression which should only match correct function names
 536.119 +function-rgx=[a-z_][A-Za-z0-9_]*$
 536.120 +
 536.121 +# Regular expression which should only match correct method names
 536.122 +method-rgx=[a-z_][A-Za-z0-9_]*$
 536.123 +
 536.124 +# Regular expression which should only match correct argument names
 536.125 +argument-rgx=[a-z_][A-Za-z0-9_]*$
 536.126 +
 536.127 +# Regular expression which should only match correct variable names
 536.128 +variable-rgx=[a-z_][A-Za-z0-9_]*$
 536.129 +
 536.130 +# Good variable names which should always be accepted, separated by a comma
 536.131 +good-names=i,j,k,ex,Run,_
 536.132 +
 536.133 +# Bad variable names which should always be refused, separated by a comma
 536.134 +bad-names=foo,bar,baz,toto,tutu,tata
 536.135 +
 536.136 +# List of builtins function names that should not be used, separated by a comma
 536.137 +bad-functions=map,filter,apply,input
 536.138 +
 536.139 +
 536.140 +
 536.141 +# checks for sign of poor/misdesign:                                      
 536.142 +#     * number of methods, attributes, local variables...                        
 536.143 +#     * size, complexity of functions, methods                                   
 536.144 +#     
 536.145 +[DESIGN]
 536.146 +# Enable / disable this checker
 536.147 +enable-design=yes
 536.148 +
 536.149 +# Maximum number of arguments for function / method
 536.150 +max-args=15
 536.151 +
 536.152 +# Maximum number of locals for function / method body
 536.153 +max-locals=15
 536.154 +
 536.155 +# Maximum number of return / yield for function / method body
 536.156 +max-returns=6
 536.157 +
 536.158 +# Maximum number of branch for function / method body
 536.159 +max-branchs=12
 536.160 +
 536.161 +# Maximum number of statements in function / method body
 536.162 +max-statements=50
 536.163 +
 536.164 +# Maximum number of parents for a class (see R0901).
 536.165 +max-parents=7
 536.166 +
 536.167 +# Maximum number of attributes for a class (see R0902).
 536.168 +max-attributes=7
 536.169 +
 536.170 +# Minimum number of public methods for a class (see R0903).
 536.171 +min-public-methods=2
 536.172 +
 536.173 +# Maximum number of public methods for a class (see R0904).
 536.174 +max-public-methods=20
 536.175 +
 536.176 +
 536.177 +
 536.178 +# checks for :                                                            
 536.179 +#     * methods without self as first argument                                   
 536.180 +#     * overriden methods signature                                              
 536.181 +#     * access only to existant members via self                                 
 536.182 +#     * attributes not defined in the __init__ method                            
 536.183 +#     * supported interfaces implementation                                      
 536.184 +#     * unreachable code                                                         
 536.185 +#     
 536.186 +[CLASSES]
 536.187 +# Enable / disable this checker
 536.188 +enable-classes=yes
 536.189 +
 536.190 +# List of interface methods to ignore, separated by a comma. This is used for
 536.191 +# instance to not check methods defines in Zope's Interface base class.
 536.192 +ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
 536.193 +
 536.194 +# Tells wether missing members accessed in mixin class should be ignored. A
 536.195 +# mixin class is detected if its name ends with "mixin" (case insensitive).
 536.196 +ignore-mixin-members=yes
 536.197 +
 536.198 +
 536.199 +
 536.200 +# checks for                                                              
 536.201 +#     * external modules dependencies                                            
 536.202 +#     * relative / wildcard imports                                                         
 536.203 +#     * cyclic imports                                                           
 536.204 +#     * uses of deprecated modules
 536.205 +#                                                                                 
 536.206 +# This checker also defines the following reports:                                    
 536.207 +#   * R0401: External dependencies                                                
 536.208 +#   * R0402: Modules dependencies graph                                           
 536.209 +# 
 536.210 +[IMPORTS]
 536.211 +# Enable / disable this checker
 536.212 +enable-imports=no
 536.213 +
 536.214 +# Deprecated modules which should not be used, separated by a comma
 536.215 +deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
 536.216 +
 536.217 +# Create a graph of every (i.e. internal and external) dependencies in the given
 536.218 +# file (report R0402 must not be disabled)
 536.219 +import-graph=
 536.220 +
 536.221 +# Create a graph of external dependencies in the given file (report R0402 must
 536.222 +# not be disabled)
 536.223 +ext-import-graph=
 536.224 +
 536.225 +# Create a graph of internal dependencies in the given file (report R0402 must
 536.226 +# not be disabled)
 536.227 +int-import-graph=
 536.228 +
 536.229 +
 536.230 +
 536.231 +# checks for                                                              
 536.232 +#     * excepts without exception filter                                         
 536.233 +#     * string exceptions                                                        
 536.234 +#     
 536.235 +[EXCEPTIONS]
 536.236 +# Enable / disable this checker
 536.237 +enable-exceptions=yes
 536.238 +
 536.239 +
 536.240 +
 536.241 +# checks for :                                                            
 536.242 +#     * unauthorized constructions                                               
 536.243 +#     * strict indentation                                                       
 536.244 +#     * line length                                                              
 536.245 +#     * use of <> instead of !=
 536.246 +#     
 536.247 +[FORMAT]
 536.248 +# Enable / disable this checker
 536.249 +enable-format=no
 536.250 +
 536.251 +# Maximum number of characters on a single line.
 536.252 +max-line-length=80
 536.253 +
 536.254 +# Maximum number of lines in a module
 536.255 +max-module-lines=1000
 536.256 +
 536.257 +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 tab).
 536.258 +indent-string='    '
 536.259 +
 536.260 +
 536.261 +
 536.262 +# does not check anything but gives some raw metrics :                    
 536.263 +#     * total number of lines                                                    
 536.264 +#     * total number of code lines                                               
 536.265 +#     * total number of docstring lines                                          
 536.266 +#     * total number of comments lines                                           
 536.267 +#     * total number of empty lines                                              
 536.268 +#                                                                                 
 536.269 +# This checker also defines the following reports:                                    
 536.270 +#   * R0701: Raw metrics                                                          
 536.271 +# 
 536.272 +[METRICS]
 536.273 +# Enable / disable this checker
 536.274 +enable-metrics=yes
 536.275 +
 536.276 +
 536.277 +
 536.278 +# checks for:                                                             
 536.279 +#     * warning notes in the code like FIXME, XXX                                
 536.280 +#     * PEP 263: source code with non ascii character but no encoding declaration
 536.281 +#     
 536.282 +[MISCELLANEOUS]
 536.283 +# Enable / disable this checker
 536.284 +enable-miscellaneous=yes
 536.285 +
 536.286 +# List of note tags to take in consideration, separated by a comma. Default to
 536.287 +# FIXME, XXX, TODO
 536.288 +notes=FIXME,XXX,TODO
 536.289 +
 536.290 +
 536.291 +
 536.292 +# checks for similarities and duplicated code. This computation may be
 536.293 +#     memory / CPU intensive, so you should disable it if you experiments some
 536.294 +#     problems.
 536.295 +#                                                                                 
 536.296 +# This checker also defines the following reports:                                    
 536.297 +#   * R0801: Duplication                                                          
 536.298 +# 
 536.299 +[SIMILARITIES]
 536.300 +# Enable / disable this checker
 536.301 +enable-similarities=yes
 536.302 +
 536.303 +# Minimum lines number of a similarity.
 536.304 +min-similarity-lines=4
 536.305 +
 536.306 +# Ignore comments when computing similarities.
 536.307 +ignore-comments=yes
 536.308 +
 536.309 +
 536.310 +
   538.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Fri Sep 09 10:31:36 2005 -0600
   538.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Tue Sep 13 10:14:16 2005 -0600
   538.3 @@ -756,7 +756,7 @@ static PyObject *pyxc_xeninfo(PyObject *
   538.4                           "xen_major", xen_version >> 16,
   538.5                           "xen_minor", (xen_version & 0xffff),
   538.6                           "xen_extra", xen_extra,
   538.7 -                         "xen_caps",  xen_caps.caps,
   538.8 +                         "xen_caps",  xen_caps,
   538.9                           "xen_params", str,
  538.10                           "xen_changeset", xen_chgset,
  538.11                           "cc_compiler", xen_cc.compiler,
   541.1 --- a/tools/python/xen/sv/DomInfo.py	Fri Sep 09 10:31:36 2005 -0600
   541.2 +++ b/tools/python/xen/sv/DomInfo.py	Tue Sep 13 10:14:16 2005 -0600
   541.3 @@ -75,7 +75,7 @@ class DomGeneralTab( CompositeTab ):
   541.4         
   541.5  class DomGenTab( GeneralTab ):
   541.6  
   541.7 -    def __init__( self, urlWriter ):
   541.8 +    def __init__( self, _ ):
   541.9      
  541.10          titles = {}
  541.11      
  541.12 @@ -103,7 +103,7 @@ class DomGenTab( GeneralTab ):
  541.13              
  541.14  class DomSXPTab( PreTab ):
  541.15  
  541.16 -    def __init__( self, urlWriter ):
  541.17 +    def __init__( self, _ ):
  541.18          self.dom = 0
  541.19          PreTab.__init__( self, "" )
  541.20  
  541.21 @@ -126,7 +126,7 @@ class DomSXPTab( PreTab ):
  541.22         
  541.23  class DomActionTab( ActionTab ):
  541.24  
  541.25 -    def __init__( self, urlWriter ):
  541.26 +    def __init__( self, _ ):
  541.27      	actions = { "shutdown" : "Shutdown",
  541.28          	    "reboot" : "Reboot",
  541.29                      "pause" : "Pause",
  541.30 @@ -188,19 +188,19 @@ class DomDeviceListTab( NullTab ):
  541.31  
  541.32      title = "Device List"
  541.33  
  541.34 -    def __init__( self, urlWriter ):
  541.35 +    def __init__( self, _ ):
  541.36          pass
  541.37  
  541.38  class DomDeviceOptionsTab( NullTab ):
  541.39  
  541.40      title = "Device Options"
  541.41  
  541.42 -    def __init__( self, urlWriter ):
  541.43 +    def __init__( self, _ ):
  541.44          pass
  541.45  
  541.46  class DomDeviceActionTab( ActionTab ):
  541.47  
  541.48 -    def __init__( self, urlWriter ):
  541.49 +    def __init__( self, _ ):
  541.50          ActionTab.__init__( self, { "addvcpu" : "Add VCPU", "addvbd" : "Add VBD", "addvif" : "Add VIF" } )
  541.51  
  541.52  class DomMigrateTab( CompositeTab ):
  541.53 @@ -218,7 +218,7 @@ class DomMigrateExtraTab( Sheet ):
  541.54                                                                                                              
  541.55  class DomMigrateActionTab( ActionTab ):
  541.56  
  541.57 -    def __init__( self, urlWriter ):
  541.58 +    def __init__( self, _ ):
  541.59          actions = { "migrate" : "Migrate" }
  541.60          ActionTab.__init__( self, actions )
  541.61                  
  541.62 @@ -249,7 +249,7 @@ class DomSaveExtraTab( Sheet ):
  541.63                 
  541.64  class DomSaveActionTab( ActionTab ):
  541.65  
  541.66 -    def __init__( self, urlWriter ):
  541.67 +    def __init__( self, _ ):
  541.68          actions = { "save" : "Save" }
  541.69          ActionTab.__init__( self, actions )
  541.70  
   571.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Fri Sep 09 10:31:36 2005 -0600
   571.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Sep 13 10:14:16 2005 -0600
   571.3 @@ -47,6 +47,7 @@ from xen.xend.XendRoot import get_compon
   571.4  
   571.5  from xen.xend.uuid import getUuid
   571.6  from xen.xend.xenstore import DBVar, XenNode, DBMap
   571.7 +from xen.xend.xenstore.xstransact import xstransact
   571.8  
   571.9  """Shutdown code for poweroff."""
  571.10  DOMAIN_POWEROFF = 0
  571.11 @@ -101,34 +102,6 @@ def shutdown_reason(code):
  571.12      """
  571.13      return shutdown_reasons.get(code, "?")
  571.14  
  571.15 -config_handlers = {}
  571.16 -
  571.17 -def add_config_handler(name, h):
  571.18 -    """Add a handler for a config field.
  571.19 -
  571.20 -    @param name:     field name
  571.21 -    @param h:        handler: fn(vm, config, field, index)
  571.22 -    """
  571.23 -    config_handlers[name] = h
  571.24 -
  571.25 -def get_config_handler(name):
  571.26 -    """Get a handler for a config field.
  571.27 -
  571.28 -    returns handler or None
  571.29 -    """
  571.30 -    return config_handlers.get(name)
  571.31 -
  571.32 -"""Table of handlers for devices.
  571.33 -Indexed by device type.
  571.34 -"""
  571.35 -device_handlers = {}
  571.36 -
  571.37 -def add_device_handler(name, type):
  571.38 -    device_handlers[name] = type
  571.39 -
  571.40 -def get_device_handler(name):
  571.41 -    return device_handlers[name]
  571.42 -
  571.43  def dom_get(dom):
  571.44      """Get info from xen for an existing domain.
  571.45  
  571.46 @@ -156,7 +129,8 @@ class XendDomainInfo:
  571.47          """
  571.48          uuid = getUuid()
  571.49          db = parentdb.addChild(uuid)
  571.50 -        vm = cls(db)
  571.51 +        path = parentdb.getPath()
  571.52 +        vm = cls(uuid, path, db)
  571.53          vm.construct(config)
  571.54          vm.saveToDB(sync=True)
  571.55  
  571.56 @@ -171,7 +145,8 @@ class XendDomainInfo:
  571.57          @param info:      domain info from xc
  571.58          """
  571.59          dom = info['dom']
  571.60 -        vm = cls(db)
  571.61 +        path = "/".join(db.getPath().split("/")[0:-1])
  571.62 +        vm = cls(db.getName(), path, db)
  571.63          vm.setdom(dom)
  571.64          db.readDB()
  571.65          vm.importFromDB()
  571.66 @@ -206,7 +181,8 @@ class XendDomainInfo:
  571.67          if not uuid:
  571.68              uuid = getUuid()
  571.69          db = parentdb.addChild(uuid)
  571.70 -        vm = cls(db)
  571.71 +        path = parentdb.getPath()
  571.72 +        vm = cls(uuid, path, db)
  571.73          ssidref = int(sxp.child_value(config, 'ssidref'))
  571.74          log.debug('restoring with ssidref='+str(ssidref))
  571.75          id = xc.domain_create(ssidref = ssidref)
  571.76 @@ -239,9 +215,10 @@ class XendDomainInfo:
  571.77          DBVar('device_model_pid', ty='int'),
  571.78          ]
  571.79      
  571.80 -    def __init__(self, db):
  571.81 +    def __init__(self, uuid, path, db):
  571.82 +        self.uuid = uuid
  571.83 +        self.path = path + "/" + uuid
  571.84          self.db = db
  571.85 -        self.uuid = db.getName()
  571.86  
  571.87          self.recreate = 0
  571.88          self.restore = 0
  571.89 @@ -364,12 +341,6 @@ class XendDomainInfo:
  571.90  
  571.91      __repr__ = __str__
  571.92  
  571.93 -    def getDeviceTypes(self):
  571.94 -        return self.controllers.keys()
  571.95 -
  571.96 -    def getDeviceControllers(self):
  571.97 -        return self.controllers.values()
  571.98 -
  571.99      def getDeviceController(self, type, error=True):
 571.100          ctrl = self.controllers.get(type)
 571.101          if not ctrl and error:
 571.102 @@ -392,35 +363,28 @@ class XendDomainInfo:
 571.103              typedev = sxp.child_value(devconfig, 'dev')
 571.104              if re.match('^ioemu:', typedev):
 571.105  	        return;
 571.106 +
 571.107              backdom = domain_exists(sxp.child_value(devconfig, 'backend', '0'))
 571.108  
 571.109              devnum = blkdev_name_to_number(sxp.child_value(devconfig, 'dev'))
 571.110  
 571.111 -            # create backend db
 571.112 -            backdb = backdom.db.addChild("/backend/%s/%s/%d" %
 571.113 -                                         (type, self.uuid, devnum))
 571.114 +            backpath = "%s/backend/%s/%s/%d" % (backdom.path, type,
 571.115 +                                                self.uuid, devnum)
 571.116 +            frontpath = "%s/device/%s/%d" % (self.path, type, devnum)
 571.117  
 571.118 -            # create frontend db
 571.119 -            db = self.db.addChild("/device/%s/%d" % (type, devnum))
 571.120 -            
 571.121 -            db['virtual-device'] = "%i" % devnum
 571.122 -            #db['backend'] = sxp.child_value(devconfig, 'backend', '0')
 571.123 -            db['backend'] = backdb.getPath()
 571.124 -            db['backend-id'] = "%i" % backdom.id
 571.125 +            front = { 'backend' : backpath,
 571.126 +                      'backend-id' : "%i" % backdom.id,
 571.127 +                      'virtual-device' : "%i" % devnum }
 571.128 +            xstransact.Write(frontpath, front)
 571.129  
 571.130 -            backdb['frontend'] = db.getPath()
 571.131 -            (type, params) = string.split(sxp.child_value(devconfig, 'uname'), ':', 1)
 571.132 -            node = Blkctl.block('bind', type, params)
 571.133 -            backdb['frontend-id'] = "%i" % self.id
 571.134 -            backdb['physical-device'] = "%li" % blkdev_name_to_number(node)
 571.135 -            backdb.saveDB(save=True)
 571.136 +            (type, params) = string.split(sxp.child_value(devconfig,
 571.137 +                                                          'uname'), ':', 1)
 571.138 +            back = { 'type' : type,
 571.139 +                     'params' : params,
 571.140 +                     'frontend' : frontpath,
 571.141 +                     'frontend-id' : "%i" % self.id }
 571.142 +            xstransact.Write(backpath, back)
 571.143  
 571.144 -            # Ok, super gross, this really doesn't belong in the frontend db...
 571.145 -            db['type'] = type
 571.146 -            db['node'] = node
 571.147 -            db['params'] = params
 571.148 -            db.saveDB(save=True)
 571.149 -            
 571.150              return
 571.151  
 571.152          if type == 'vif':
 571.153 @@ -435,8 +399,6 @@ class XendDomainInfo:
 571.154  
 571.155              backdom = domain_exists(sxp.child_value(devconfig, 'backend', '0'))
 571.156  
 571.157 -            log.error(devconfig)
 571.158 -            
 571.159              devnum = self.netif_idx
 571.160              self.netif_idx += 1
 571.161  
 571.162 @@ -448,30 +410,26 @@ class XendDomainInfo:
 571.163              mac = sxp.child_value(devconfig, 'mac')
 571.164              ipaddr = _get_config_ipaddr(devconfig)
 571.165  
 571.166 -            # create backend db
 571.167 -            backdb = backdom.db.addChild("/backend/%s/%s/%d" %
 571.168 -                                         (type, self.uuid, devnum))
 571.169 +            backpath = "%s/backend/%s/%s/%d" % (backdom.path, type,
 571.170 +                                                self.uuid, devnum)
 571.171 +            frontpath = "%s/device/%s/%d" % (self.path, type, devnum)
 571.172  
 571.173 -            # create frontend db
 571.174 -            db = self.db.addChild("/device/%s/%d" % (type, devnum))
 571.175 -            
 571.176 -            backdb['script'] = script
 571.177 -            backdb['domain'] = self.name
 571.178 -            backdb['mac'] = mac
 571.179 -            backdb['bridge'] = bridge
 571.180 +            front = { 'backend' : backpath,
 571.181 +                      'backend-id' : "%i" % backdom.id,
 571.182 +                      'handle' : "%i" % devnum,
 571.183 +                      'mac' : mac }
 571.184 +            xstransact.Write(frontpath, front)
 571.185 +
 571.186 +            back = { 'script' : script,
 571.187 +                     'domain' : self.name,
 571.188 +                     'mac' : mac,
 571.189 +                     'bridge' : bridge,
 571.190 +                     'frontend' : frontpath,
 571.191 +                     'frontend-id' : "%i" % self.id,
 571.192 +                     'handle' : "%i" % devnum }
 571.193              if ipaddr:
 571.194 -                backdb['ip'] = ' '.join(ipaddr)
 571.195 -            backdb['frontend'] = db.getPath()
 571.196 -            backdb['frontend-id'] = "%i" % self.id
 571.197 -            backdb['handle'] = "%i" % devnum
 571.198 -            backdb.saveDB(save=True)
 571.199 -
 571.200 -            db['backend'] = backdb.getPath()
 571.201 -            db['backend-id'] = "%i" % backdom.id
 571.202 -            db['handle'] = "%i" % devnum
 571.203 -            db['mac'] = mac
 571.204 -
 571.205 -            db.saveDB(save=True)
 571.206 +                back['ip'] = ' '.join(ipaddr)
 571.207 +            xstransact.Write(backpath, back)
 571.208  
 571.209              return
 571.210          
 571.211 @@ -481,22 +439,19 @@ class XendDomainInfo:
 571.212              devnum = int(sxp.child_value(devconfig, 'instance', '0'))
 571.213              log.error("The domain has a TPM with instance %d." % devnum)
 571.214  
 571.215 -            # create backend db
 571.216 -            backdb = backdom.db.addChild("/backend/%s/%s/%d" %
 571.217 -                                         (type, self.uuid, devnum))
 571.218 -            # create frontend db
 571.219 -            db = self.db.addChild("/device/%s/%d" % (type, devnum))
 571.220 +            backpath = "%s/backend/%s/%s/%d" % (backdom.path, type,
 571.221 +                                                self.uuid, devnum)
 571.222 +            frontpath = "%s/device/%s/%d" % (self.path, type, devnum)
 571.223  
 571.224 -            backdb['frontend'] = db.getPath()
 571.225 -            backdb['frontend-id'] = "%i" % self.id
 571.226 -            backdb['instance'] = sxp.child_value(devconfig, 'instance', '0')
 571.227 -            backdb.saveDB(save=True)
 571.228 +            front = { 'backend' : backpath,
 571.229 +                      'backend-id' : "%i" % backdom.id,
 571.230 +                      'handle' : "%i" % devnum }
 571.231 +            xstransact.Write(frontpath, front)
 571.232  
 571.233 -            db['handle'] = "%i" % devnum
 571.234 -            db['backend'] = backdb.getPath()
 571.235 -            db['backend-id'] = "%i" % int(sxp.child_value(devconfig,
 571.236 -                                                          'backend', '0'))
 571.237 -            db.saveDB(save=True)
 571.238 +            back = { 'instance' : "%i" % devnum,
 571.239 +                     'frontend' : frontpath,
 571.240 +                     'frontend-id' : "%i" % self.id }
 571.241 +            xstransact.Write(backpath, back)
 571.242  
 571.243              return
 571.244  
 571.245 @@ -594,7 +549,7 @@ class XendDomainInfo:
 571.246  
 571.247      def sxpr_devices(self):
 571.248          sxpr = []
 571.249 -        for ty in self.getDeviceTypes():
 571.250 +        for ty in self.controllers.keys():
 571.251              devs = self.getDeviceSxprs(ty)
 571.252              sxpr += devs
 571.253          if sxpr:
 571.254 @@ -795,29 +750,17 @@ class XendDomainInfo:
 571.255          """Release all vm devices.
 571.256          """
 571.257          reboot = self.restart_pending()
 571.258 -        for ctrl in self.getDeviceControllers():
 571.259 +        for ctrl in self.controllers.values():
 571.260              if ctrl.isDestroyed(): continue
 571.261              ctrl.destroyController(reboot=reboot)
 571.262 -        ddb = self.db.addChild("/device")
 571.263 -        for type in ddb.keys():
 571.264 -            if type == 'vbd':
 571.265 -                typedb = ddb.addChild(type)
 571.266 -                for dev in typedb.keys():
 571.267 -                    devdb = typedb.addChild(str(dev))
 571.268 -                    Blkctl.block('unbind', devdb['type'].getData(),
 571.269 -                                 devdb['node'].getData())
 571.270 -                    typedb[dev].delete()
 571.271 -                typedb.saveDB(save=True)
 571.272 -            if type == 'vif':
 571.273 -                typedb = ddb.addChild(type)
 571.274 -                for dev in typedb.keys():
 571.275 -                    typedb[dev].delete()
 571.276 -                typedb.saveDB(save=True)
 571.277 -            if type == 'vtpm':
 571.278 -                typedb = ddb.addChild(type)
 571.279 -                for dev in typedb.keys():
 571.280 -                    typedb[dev].delete()
 571.281 -                typedb.saveDB(save=True)
 571.282 +        t = xstransact("%s/device" % self.path)
 571.283 +        for d in t.list("vbd"):
 571.284 +            t.remove(d)
 571.285 +        for d in t.list("vif"):
 571.286 +            t.remove(d)
 571.287 +        for d in t.list("vtpm"):
 571.288 +            t.remove(d)
 571.289 +        t.commit()
 571.290  
 571.291      def show(self):
 571.292          """Print virtual machine info.
 571.293 @@ -874,6 +817,7 @@ class XendDomainInfo:
 571.294          self.store_channel = self.eventChannelOld("store_channel")
 571.295          self.console_channel = self.eventChannel("console", "port")
 571.296  
 571.297 +
 571.298      def create_configured_devices(self):
 571.299          devices = sxp.children(self.config, 'device')
 571.300          for d in devices:
 571.301 @@ -881,18 +825,20 @@ class XendDomainInfo:
 571.302              if dev_config is None:
 571.303                  raise VmError('invalid device')
 571.304              dev_type = sxp.name(dev_config)
 571.305 -            ctrl_type = get_device_handler(dev_type)
 571.306 -            if ctrl_type is None:
 571.307 +
 571.308 +            if not controller.isDevControllerClass(dev_type):
 571.309                  raise VmError('unknown device type: ' + dev_type)
 571.310 -            self.createDevice(ctrl_type, dev_config)
 571.311 -        
 571.312 +            
 571.313 +            self.createDevice(dev_type, dev_config)
 571.314 +
 571.315 +
 571.316      def create_devices(self):
 571.317          """Create the devices for a vm.
 571.318  
 571.319          @raise: VmError for invalid devices
 571.320          """
 571.321          if self.rebooting():
 571.322 -            for ctrl in self.getDeviceControllers():
 571.323 +            for ctrl in self.controllers.values():
 571.324                  ctrl.initController(reboot=True)
 571.325          else:
 571.326              self.create_configured_devices()
 571.327 @@ -1043,7 +989,7 @@ class XendDomainInfo:
 571.328              msg = "Had a bootloader specified, but can't find disk"
 571.329              log.error(msg)
 571.330              raise VmError(msg)
 571.331 -        config = sxp.merge(['vm', blconfig ], self.config)
 571.332 +        config = sxp.merge(['vm', blcfg ], self.config)
 571.333          return config
 571.334  
 571.335      def configure_backends(self):
 571.336 @@ -1092,7 +1038,7 @@ class XendDomainInfo:
 571.337          for field in sxp.children(self.config):
 571.338              field_name = sxp.name(field)
 571.339              field_index = index.get(field_name, 0)
 571.340 -            field_handler = get_config_handler(field_name)
 571.341 +            field_handler = config_handlers.get(field_name)
 571.342              # Ignore unknown fields. Warn?
 571.343              if field_handler:
 571.344                  v = field_handler(self, self.config, field, field_index)
 571.345 @@ -1161,23 +1107,17 @@ class XendDomainInfo:
 571.346          # get run-time value of vcpus and update store
 571.347          self.exportVCPUSToDB(dom_get(self.id)['vcpus'])
 571.348  
 571.349 -def vm_field_ignore(vm, config, val, index):
 571.350 +
 571.351 +def vm_field_ignore(_, _1, _2, _3):
 571.352      """Dummy config field handler used for fields with built-in handling.
 571.353 -
 571.354 -    @param vm:        virtual machine
 571.355 -    @param config:    vm config
 571.356 -    @param val:       config field
 571.357 -    @param index:     field index
 571.358 +    Matches the signature required by config_handlers.
 571.359      """
 571.360      pass
 571.361  
 571.362 -def vm_field_maxmem(vm, config, val, index):
 571.363 -    """Configure vm memory limit.
 571.364  
 571.365 -    @param vm:        virtual machine
 571.366 -    @param config:    vm config
 571.367 -    @param val:       config field
 571.368 -    @param index:     field index
 571.369 +def vm_field_maxmem(vm, _1, val, _2):
 571.370 +    """Config field handler to configure vm memory limit.  Matches the
 571.371 +    signature required by config_handlers.
 571.372      """
 571.373      maxmem = sxp.child0(val)
 571.374      if maxmem is None:
 571.375 @@ -1188,8 +1128,10 @@ def vm_field_maxmem(vm, config, val, ind
 571.376          raise VmError("invalid maxmem: " + str(maxmem))
 571.377      xc.domain_setmaxmem(vm.id, maxmem_kb = maxmem * 1024)
 571.378  
 571.379 +
 571.380  #============================================================================
 571.381  # Register image handlers.
 571.382 +
 571.383  from image import          \
 571.384       addImageHandlerClass, \
 571.385       ImageHandler,         \
 571.386 @@ -1199,43 +1141,38 @@ from image import          \
 571.387  addImageHandlerClass(LinuxImageHandler)
 571.388  addImageHandlerClass(VmxImageHandler)
 571.389  
 571.390 -# Ignore the fields we already handle.
 571.391 -add_config_handler('name',       vm_field_ignore)
 571.392 -add_config_handler('memory',     vm_field_ignore)
 571.393 -add_config_handler('ssidref',    vm_field_ignore)
 571.394 -add_config_handler('cpu',        vm_field_ignore)
 571.395 -add_config_handler('cpu_weight', vm_field_ignore)
 571.396 -add_config_handler('restart',    vm_field_ignore)
 571.397 -add_config_handler('image',      vm_field_ignore)
 571.398 -add_config_handler('device',     vm_field_ignore)
 571.399 -add_config_handler('backend',    vm_field_ignore)
 571.400 -add_config_handler('vcpus',      vm_field_ignore)
 571.401 -add_config_handler('bootloader', vm_field_ignore)
 571.402 +
 571.403 +"""Table of handlers for field configuration.
 571.404  
 571.405 -# Register other config handlers.
 571.406 -add_config_handler('maxmem',     vm_field_maxmem)
 571.407 +field_name[String]: fn(vm, config, field, index) -> value(ignored)
 571.408 +"""
 571.409 +config_handlers = {
 571.410 +    
 571.411 +    # Ignore the fields we already handle.
 571.412 +    
 571.413 +    'name':       vm_field_ignore,
 571.414 +    'memory':     vm_field_ignore,
 571.415 +    'ssidref':    vm_field_ignore,
 571.416 +    'cpu':        vm_field_ignore,
 571.417 +    'cpu_weight': vm_field_ignore,
 571.418 +    'restart':    vm_field_ignore,
 571.419 +    'image':      vm_field_ignore,
 571.420 +    'device':     vm_field_ignore,
 571.421 +    'backend':    vm_field_ignore,
 571.422 +    'vcpus':      vm_field_ignore,
 571.423 +    'bootloader': vm_field_ignore,
 571.424 +    
 571.425 +    # Register other config handlers.
 571.426 +    'maxmem':     vm_field_maxmem
 571.427 +    }
 571.428 +
 571.429  
 571.430  #============================================================================
 571.431  # Register device controllers and their device config types.
 571.432  
 571.433 -from server import blkif
 571.434 -controller.addDevControllerClass("vbd", blkif.BlkifController)
 571.435 -add_device_handler("vbd", "vbd")
 571.436 -
 571.437 -from server import netif
 571.438 -controller.addDevControllerClass("vif", netif.NetifController)
 571.439 -add_device_handler("vif", "vif")
 571.440 -
 571.441 -from server import tpmif
 571.442 +from xen.xend.server import blkif, netif, tpmif, pciif, usbif
 571.443 +controller.addDevControllerClass("vbd",  blkif.BlkifController)
 571.444 +controller.addDevControllerClass("vif",  netif.NetifController)
 571.445  controller.addDevControllerClass("vtpm", tpmif.TPMifController)
 571.446 -add_device_handler("vtpm", "vtpm")
 571.447 -
 571.448 -from server import pciif
 571.449 -controller.addDevControllerClass("pci", pciif.PciController)
 571.450 -add_device_handler("pci", "pci")
 571.451 -
 571.452 -from xen.xend.server import usbif
 571.453 -controller.addDevControllerClass("usb", usbif.UsbifController)
 571.454 -add_device_handler("usb", "usb")
 571.455 -
 571.456 -#============================================================================
 571.457 +controller.addDevControllerClass("pci",  pciif.PciController)
 571.458 +controller.addDevControllerClass("usb",  usbif.UsbifController)
   577.1 --- a/tools/python/xen/xend/XendVnet.py	Fri Sep 09 10:31:36 2005 -0600
   577.2 +++ b/tools/python/xen/xend/XendVnet.py	Tue Sep 13 10:14:16 2005 -0600
   577.3 @@ -145,7 +145,7 @@ class XendVnet:
   577.4      def vnet_get(self, id):
   577.5          """Get a vnet.
   577.6  
   577.7 -        @param id: vnet id
   577.8 +        @param id vnet id
   577.9          """
  577.10          id = str(id)
  577.11          return self.vnet.get(id)
   580.1 --- a/tools/python/xen/xend/scheduler.py	Fri Sep 09 10:31:36 2005 -0600
   580.2 +++ b/tools/python/xen/xend/scheduler.py	Tue Sep 13 10:14:16 2005 -0600
   580.3 @@ -20,8 +20,8 @@ import threading
   580.4  def later(delay, fn, args=(), kwargs={}):
   580.5      """Schedule a function to be called later.
   580.6  
   580.7 -    @param _delay: delay in seconds
   580.8 -    @param _fn:    function
   580.9 +    @param delay:  delay in seconds
  580.10 +    @param fn:     function
  580.11      @param args:   arguments (list)
  580.12      @param kwargs  keyword arguments (map)
  580.13      """
  580.14 @@ -32,7 +32,7 @@ def later(delay, fn, args=(), kwargs={})
  580.15  def now(fn, args=(), kwargs={}):
  580.16      """Schedule a function to be called now.
  580.17  
  580.18 -    @param _fn:    function
  580.19 +    @param fn:     function
  580.20      @param args:   arguments (list)
  580.21      @param kwargs  keyword arguments (map)
  580.22      """
   592.1 --- a/tools/python/xen/xend/server/controller.py	Fri Sep 09 10:31:36 2005 -0600
   592.2 +++ b/tools/python/xen/xend/server/controller.py	Tue Sep 13 10:14:16 2005 -0600
   592.3 @@ -63,6 +63,13 @@ def addDevControllerClass(name, cls):
   592.4      cls.type = name
   592.5      getDevControllerTable().addDevControllerClass(cls)
   592.6  
   592.7 +
   592.8 +def isDevControllerClass(name):
   592.9 +    """@return True if a device controller class has been registered with
  592.10 +    the controller table under the given name."""
  592.11 +    return name in getDevControllerTable().controllerClasses
  592.12 +
  592.13 +
  592.14  def createDevController(name, vm, recreate=False):
  592.15      return getDevControllerTable().createDevController(name, vm, recreate=recreate)
  592.16  
   606.1 --- a/tools/python/xen/xend/xenstore/xstransact.py	Fri Sep 09 10:31:36 2005 -0600
   606.2 +++ b/tools/python/xen/xend/xenstore/xstransact.py	Tue Sep 13 10:14:16 2005 -0600
   606.3 @@ -4,6 +4,7 @@
   606.4  # Public License.  See the file "COPYING" in the main directory of
   606.5  # this archive for more details.
   606.6  
   606.7 +import errno
   606.8  import threading
   606.9  from xen.lowlevel import xs
  606.10  
  606.11 @@ -18,9 +19,18 @@ def xshandle():
  606.12  class xstransact:
  606.13  
  606.14      def __init__(self, path):
  606.15 +        self.in_transaction = False
  606.16          self.path = path.rstrip("/")
  606.17 -        xshandle().transaction_start(path)
  606.18 -        self.in_transaction = True
  606.19 +        while True:
  606.20 +            try:
  606.21 +                xshandle().transaction_start(path)
  606.22 +                self.in_transaction = True
  606.23 +                return
  606.24 +            except RuntimeError, ex:
  606.25 +                if ex.args[0] == errno.ENOENT and path != "/":
  606.26 +                    path = "/".join(path.split("/")[0:-1]) or "/"
  606.27 +                else:
  606.28 +                    raise
  606.29  
  606.30      def __del__(self):
  606.31          if self.in_transaction:
  606.32 @@ -78,36 +88,81 @@ class xstransact:
  606.33          else:
  606.34              raise TypeError
  606.35  
  606.36 +    def _remove(self, key):
  606.37 +        path = "%s/%s" % (self.path, key)
  606.38 +        return xshandle().rm(path)
  606.39 +
  606.40 +    def remove(self, *args):
  606.41 +        if len(args) == 0:
  606.42 +            raise TypeError
  606.43 +        for key in args:
  606.44 +            self._remove(key)
  606.45 +
  606.46 +    def _list(self, key):
  606.47 +        path = "%s/%s" % (self.path, key)
  606.48 +        return map(lambda x: key + "/" + x, xshandle().ls(path))
  606.49 +
  606.50 +    def list(self, *args):
  606.51 +        if len(args) == 0:
  606.52 +            raise TypeError
  606.53 +        ret = []
  606.54 +        for key in args:
  606.55 +            ret.extend(self._list(key))
  606.56 +        return ret
  606.57 +
  606.58 +
  606.59      def Read(cls, path, *args):
  606.60 -        t = cls(path)
  606.61 -        v = t.read(*args)
  606.62 -        t.commit()
  606.63 -        return v
  606.64 +        while True:
  606.65 +            try:
  606.66 +                t = cls(path)
  606.67 +                v = t.read(*args)
  606.68 +                t.commit()
  606.69 +                return v
  606.70 +            except RuntimeError, ex:
  606.71 +                if ex.args[0] == errno.ETIMEDOUT:
  606.72 +                    pass
  606.73 +                raise
  606.74  
  606.75      Read = classmethod(Read)
  606.76  
  606.77      def Write(cls, path, *args, **opts):
  606.78 -        t = cls(path)
  606.79 -        t.write(*args, **opts)
  606.80 -        t.commit()
  606.81 +        while True:
  606.82 +            try:
  606.83 +                t = cls(path)
  606.84 +                t.write(*args, **opts)
  606.85 +                t.commit()
  606.86 +                return
  606.87 +            except RuntimeError, ex:
  606.88 +                if ex.args[0] == errno.ETIMEDOUT:
  606.89 +                    pass
  606.90 +                raise
  606.91  
  606.92      Write = classmethod(Write)
  606.93  
  606.94 -    def SafeRead(cls, path, *args):
  606.95 +    def Remove(cls, *args):
  606.96          while True:
  606.97              try:
  606.98 -                return cls.Read(path, *args)
  606.99 +                t = cls(path)
 606.100 +                t.remove(*args)
 606.101 +                t.commit()
 606.102 +                return
 606.103              except RuntimeError, ex:
 606.104 -                pass
 606.105 +                if ex.args[0] == errno.ETIMEDOUT:
 606.106 +                    pass
 606.107 +                raise
 606.108  
 606.109 -    SafeRead = classmethod(SafeRead)
 606.110 +    Remove = classmethod(Remove)
 606.111  
 606.112 -    def SafeWrite(cls, path, *args, **opts):
 606.113 +    def List(cls, path, *args):
 606.114          while True:
 606.115              try:
 606.116 -                cls.Write(path, *args, **opts)
 606.117 -                return
 606.118 +                t = cls(path)
 606.119 +                v = t.list(*args)
 606.120 +                t.commit()
 606.121 +                return v
 606.122              except RuntimeError, ex:
 606.123 -                pass
 606.124 +                if ex.args[0] == errno.ETIMEDOUT:
 606.125 +                    pass
 606.126 +                raise
 606.127  
 606.128 -    SafeWrite = classmethod(SafeWrite)
 606.129 +    List = classmethod(List)
   608.1 --- a/tools/python/xen/xm/create.py	Fri Sep 09 10:31:36 2005 -0600
   608.2 +++ b/tools/python/xen/xm/create.py	Tue Sep 13 10:14:16 2005 -0600
   608.3 @@ -772,30 +772,33 @@ def balloon_out(dom0_min_mem, opts):
   608.4      """Balloon out memory from dom0 if necessary"""
   608.5      SLACK = 4
   608.6      timeout = 20 # 2s
   608.7 -    ret = 0
   608.8 +    ret = 1
   608.9  
  608.10      xc = xen.lowlevel.xc.new()
  608.11 -    pinfo = xc.physinfo()
  608.12 -    free_mem = pinfo['free_pages'] / 256
  608.13 +    free_mem = xc.physinfo()['free_pages'] / 256
  608.14      domU_need_mem = opts.vals.memory + SLACK 
  608.15  
  608.16 +    # we already have enough free memory, return success
  608.17 +    if free_mem >= domU_need_mem:
  608.18 +        del xc
  608.19 +        return 0
  608.20 +
  608.21      dom0_cur_alloc = get_dom0_alloc()
  608.22      dom0_new_alloc = dom0_cur_alloc - (domU_need_mem - free_mem)
  608.23 +    if dom0_new_alloc < dom0_min_mem:
  608.24 +        dom0_new_alloc = dom0_min_mem
  608.25  
  608.26 -    if free_mem < domU_need_mem and dom0_new_alloc < dom0_min_mem:
  608.27 -        ret = 1
  608.28 -    if free_mem < domU_need_mem and ret == 0:
  608.29 -
  608.30 -        server.xend_domain_mem_target_set(0, dom0_new_alloc)
  608.31 +    server.xend_domain_mem_target_set(0, dom0_new_alloc)
  608.32  
  608.33 -        while dom0_cur_alloc > dom0_new_alloc and timeout > 0:
  608.34 -            time.sleep(0.1) # sleep 100ms
  608.35 -            dom0_cur_alloc = get_dom0_alloc()
  608.36 -            timeout -= 1
  608.37 -        
  608.38 -        if dom0_cur_alloc > dom0_new_alloc:
  608.39 -            ret = 1
  608.40 -    
  608.41 +    while timeout > 0:
  608.42 +        time.sleep(0.1) # sleep 100ms
  608.43 +
  608.44 +        free_mem = xc.physinfo()['free_pages'] / 256
  608.45 +        if free_mem >= domU_need_mem:
  608.46 +            ret = 0
  608.47 +            break
  608.48 +        timeout -= 1
  608.49 +
  608.50      del xc
  608.51      return ret
  608.52  
   611.1 --- a/tools/python/xen/xm/main.py	Fri Sep 09 10:31:36 2005 -0600
   611.2 +++ b/tools/python/xen/xm/main.py	Tue Sep 13 10:14:16 2005 -0600
   611.3 @@ -450,7 +450,10 @@ def xm_info(args):
   611.4      info = server.xend_node()
   611.5      
   611.6      for x in info[1:]:
   611.7 -        print "%-23s:" % x[0], x[1]
   611.8 +        if len(x) < 2: 
   611.9 +            print "%-23s: (none)" % x[0]
  611.10 +        else: 
  611.11 +            print "%-23s:" % x[0], x[1]
  611.12  
  611.13  # TODO: remove as soon as console server shows up
  611.14  def xm_console(args):
   655.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   655.2 +++ b/tools/vnet/Make.env	Tue Sep 13 10:14:16 2005 -0600
   655.3 @@ -0,0 +1,20 @@
   655.4 +# -*- mode: Makefile; -*-
   655.5 +
   655.6 +export XEN_ROOT        = $(shell cd $(VNET_ROOT)/../.. && pwd)
   655.7 +export LINUX_SERIES   ?= 2.6
   655.8 +
   655.9 +DISTDIR               ?= $(XEN_ROOT)/dist
  655.10 +export DESTDIR        ?= $(DISTDIR)/install
  655.11 +
  655.12 +export VNET_MODULE_DIR = $(VNET_ROOT)/vnet-module
  655.13 +export VNETD_DIR       = $(VNET_ROOT)/vnetd
  655.14 +export LIBXUTIL_DIR    = $(VNET_ROOT)/libxutil
  655.15 +
  655.16 +export GC_DIR          = $(VNET_ROOT)/build/gc
  655.17 +export GC_INCLUDE      = $(GC_DIR)/include
  655.18 +export GC_LIB_DIR      = $(GC_DIR)/lib
  655.19 +export GC_LIB_A        = $(GC_LIB_DIR)/libgc.a
  655.20 +export GC_LIB_SO       = $(GC_LIB_DIR)/libgc.so
  655.21 +
  655.22 +#$(warning XEN_ROOT  = $(XEN_ROOT))
  655.23 +#$(warning DESTDIR   = $(DESTDIR))
   661.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   661.2 +++ b/tools/vnet/examples/vnet-insert	Tue Sep 13 10:14:16 2005 -0600
   661.3 @@ -0,0 +1,28 @@
   661.4 +#!/bin/bash
   661.5 +
   661.6 +# Insert the vnet module if it can be found and
   661.7 +# it's not already there.
   661.8 +vnet_insert () {
   661.9 +    local module="vnet_module"
  661.10 +    local mod_dir=/lib/modules/$(uname -r)
  661.11 +    local mod_obj=""
  661.12 +
  661.13 +    if lsmod | grep -q ${module} ; then
  661.14 +        echo "VNET: ${module} loaded"
  661.15 +        return
  661.16 +    fi
  661.17 +    local mods=$(find ${mod_dir} -name "${module}.*o")
  661.18 +    if [[ ${mods} ]] ; then
  661.19 +        for mod_obj in ${mods} ; do
  661.20 +            break
  661.21 +        done
  661.22 +    fi
  661.23 +    if [ -z "${mod_obj}" ] ; then
  661.24 +        echo "VNET: ${module} not found"
  661.25 +        exit 1
  661.26 +    fi
  661.27 +    echo "VNET: Loading ${module} from ${mod_obj}"
  661.28 +    insmod ${mod_obj} "$@"
  661.29 +}
  661.30 +
  661.31 +vnet_insert "$@"
   667.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   667.2 +++ b/tools/vnet/libxutil/mem_stream.c	Tue Sep 13 10:14:16 2005 -0600
   667.3 @@ -0,0 +1,319 @@
   667.4 +/*
   667.5 + * Copyright (C) 2005 Mike Wray <mike.wray@hp.com>
   667.6 + *
   667.7 + * This library is free software; you can redistribute it and/or modify
   667.8 + * it under the terms of the GNU Lesser General Public License as published by
   667.9 + * the Free Software Foundation; either version 2.1 of the License, or
  667.10 + * (at your option) any later version.
  667.11 + *
  667.12 + * This library is distributed in the hope that it will be useful,
  667.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  667.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  667.15 + * GNU Lesser General Public License for more details.
  667.16 + *
  667.17 + * You should have received a copy of the GNU Lesser General Public License
  667.18 + * along with this library; if not, write to the Free Software
  667.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  667.20 + */
  667.21 +
  667.22 +/** @file
  667.23 + * IOStream subtype for input and output to memory.
  667.24 + * Usable from user or kernel code (with __KERNEL__ defined).
  667.25 + */
  667.26 +
  667.27 +#include "sys_string.h"
  667.28 +#include "mem_stream.h"
  667.29 +#include "allocate.h"
  667.30 +
  667.31 +/** Internal state for a memory stream.
  667.32 + *
  667.33 + * The memory stream buffer is treated as a circular buffer.
  667.34 + * The lo and hi markers indicate positions in the buffer, but
  667.35 + * are not reduced modulo the buffer size. This avoids the ambiguity
  667.36 + * between a full and empty buffer when using reduced values.
  667.37 + *
  667.38 + * If x is a marker, then buf + (x % buf_n) is the corresponding
  667.39 + * pointer into the buffer. When the buffer is empty, lo == hi,
  667.40 + * and the corresponding pointers are equal. When the buffer is
  667.41 + * full, hi == lo + buf_n, and the corresponding pointers
  667.42 + * are also equal.
  667.43 + *
  667.44 + * Data is written after the high pointer and read from the lo pointer.
  667.45 + * The value hi - lo is the number of bytes in the buffer.
  667.46 + */
  667.47 +typedef struct MemData {
  667.48 +    /** Data buffer. */
  667.49 +    char *buf;
  667.50 +    /** Low marker - start of readable area. */
  667.51 +    unsigned long lo;
  667.52 +    /** High marker - end of readable area, start of writeable area. */
  667.53 +    unsigned long hi;
  667.54 +    /** Size of the buffer. */
  667.55 +    unsigned int buf_n;
  667.56 +    /** Maximum size the buffer can grow to. */
  667.57 +    unsigned int buf_max;
  667.58 +    /** Error code. */
  667.59 +    int err;
  667.60 +} MemData;
  667.61 +
  667.62 +/** Get number of bytes available to read.
  667.63 + *
  667.64 + * @param data mem stream
  667.65 + * @return bytes
  667.66 + */
  667.67 +static inline int mem_len(struct MemData *data){
  667.68 +    return data->hi - data->lo;
  667.69 +}
  667.70 +
  667.71 +/** Get available space left in the buffer.
  667.72 + *
  667.73 + * @param data mem stream
  667.74 + * @return bytes
  667.75 + */
  667.76 +static inline int mem_room(struct MemData *data){
  667.77 +    return data->buf_n - mem_len(data);
  667.78 +}
  667.79 +
  667.80 +/** Get a pointer to the start of the data in the buffer.
  667.81 + *
  667.82 + * @param data mem stream
  667.83 + * @return lo pointer
  667.84 + */
  667.85 +static inline char * mem_lo(struct MemData *data){
  667.86 +    return data->buf + (data->lo % data->buf_n);
  667.87 +}
  667.88 +
  667.89 +/** Get a pointer to the end of the data in the buffer.
  667.90 + *
  667.91 + * @param data mem stream
  667.92 + * @return hi pointer
  667.93 + */
  667.94 +static inline char * mem_hi(struct MemData *data){
  667.95 +    return data->buf + (data->hi % data->buf_n);
  667.96 +}
  667.97 +
  667.98 +/** Get a pointer to the end of the buffer.
  667.99 + *
 667.100 + * @param data mem stream
 667.101 + * @return end pointer
 667.102 + */
 667.103 +static inline char * mem_end(struct MemData *data){
 667.104 +    return data->buf + data->buf_n;
 667.105 +}
 667.106 +
 667.107 +static int mem_error(IOStream *io);
 667.108 +static int mem_close(IOStream *io);
 667.109 +static void mem_free(IOStream *io);
 667.110 +static int mem_write(IOStream *io, const void *msg, size_t n);
 667.111 +static int mem_read(IOStream *io, void *buf, size_t n);
 667.112 +
 667.113 +/** Minimum delta used to increment the buffer. */
 667.114 +static int delta_min = 256;
 667.115 +
 667.116 +/** Methods for a memory stream. */
 667.117 +static IOMethods mem_methods = {
 667.118 +    read:  mem_read,
 667.119 +    write: mem_write,
 667.120 +    error: mem_error,
 667.121 +    close: mem_close,
 667.122 +    free:  mem_free,
 667.123 +};
 667.124 +
 667.125 +/** Get the memory stream state.
 667.126 + *
 667.127 + * @param io memory stream
 667.128 + * @return state
 667.129 + */
 667.130 +static inline MemData *get_mem_data(IOStream *io){
 667.131 +    return (MemData*)io->data;
 667.132 +}
 667.133 +
 667.134 +/** Get the number of bytes available to read.
 667.135 + *
 667.136 + * @param io memory stream
 667.137 + * @return number of bytes
 667.138 + */
 667.139 +int mem_stream_avail(IOStream *io){
 667.140 +    MemData *data = get_mem_data(io);
 667.141 +    return (data->err ? -data->err : mem_len(data));
 667.142 +}
 667.143 +
 667.144 +/** Copy bytes from a memory stream into a buffer.
 667.145 + *
 667.146 + * @param data mem stream
 667.147 + * @param buf buffer
 667.148 + * @param n number of bytes to copy
 667.149 + */
 667.150 +static void mem_get(MemData *data, char *buf, size_t n){
 667.151 +    char *start = mem_lo(data);
 667.152 +    char *end = mem_end(data);
 667.153 +    if (start + n < end) {
 667.154 +        memcpy(buf, start, n);
 667.155 +    } else {
 667.156 +        int k = end - start;
 667.157 +        memcpy(buf, start, k);
 667.158 +        memcpy(buf + k, data->buf, n - k);
 667.159 +    }
 667.160 +}
 667.161 +
 667.162 +/** Copy bytes from a buffer into a memory stream.
 667.163 + *
 667.164 + * @param data mem stream
 667.165 + * @param buf buffer
 667.166 + * @param n number of bytes to copy
 667.167 + */
 667.168 +static void mem_put(MemData *data, const char *buf, size_t n){
 667.169 +    char *start = mem_hi(data);
 667.170 +    char *end = mem_end(data);
 667.171 +    if(start + n < end){
 667.172 +        memcpy(start, buf, n);
 667.173 +    } else {
 667.174 +        int k = end - start;
 667.175 +        memcpy(start, buf, k);
 667.176 +        memcpy(data->buf, buf + k, n - k);
 667.177 +    }
 667.178 +}
 667.179 +
 667.180 +/** Expand the buffer used by a memory stream.
 667.181 + *
 667.182 + * @param data mem stream
 667.183 + * @param extra number of bytes to expand by
 667.184 + * @return 0 on success, negative error otherwise
 667.185 + */
 667.186 +static int mem_expand(MemData *data, size_t extra){
 667.187 +    int err = -ENOMEM;
 667.188 +    int delta = (extra < delta_min ? delta_min : extra);
 667.189 +    if(data->buf_max > 0){
 667.190 +        int delta_max = data->buf_max - data->buf_n;
 667.191 +        if(delta > delta_max){
 667.192 +            delta = extra;
 667.193 +            if(delta > delta_max) goto exit;
 667.194 +        }
 667.195 +    }
 667.196 +    int buf_n = data->buf_n + delta;
 667.197 +    char *buf = allocate(buf_n);
 667.198 +    if(!buf) goto exit;
 667.199 +    mem_get(data, buf, mem_len(data));
 667.200 +    data->hi = mem_len(data);
 667.201 +    data->lo = 0;
 667.202 +    deallocate(data->buf);
 667.203 +    data->buf = buf;
 667.204 +    data->buf_n = buf_n;
 667.205 +    err = 0;
 667.206 +  exit:
 667.207 +    if(err){
 667.208 +        data->err = -err;
 667.209 +    }
 667.210 +    return err;
 667.211 +}
 667.212 +
 667.213 +/** Write bytes from a buffer into a memory stream.
 667.214 + * The internal buffer is expanded as needed to hold the data,
 667.215 + * up to the stream maximum (if specified). If the buffer cannot
 667.216 + * be expanded -ENOMEM is returned.
 667.217 + *
 667.218 + * @param io mem stream
 667.219 + * @param buf buffer
 667.220 + * @param n number of bytes to write
 667.221 + * @return number of bytes written on success, negative error code otherwise
 667.222 + */
 667.223 +static int mem_write(IOStream *io, const void *msg, size_t n){
 667.224 +    MemData *data = get_mem_data(io);
 667.225 +    if(data->err) return -data->err;
 667.226 +    int room = mem_room(data);
 667.227 +    if(n > room){
 667.228 +        int err = mem_expand(data, n - room);
 667.229 +        if(err) return err;
 667.230 +    }
 667.231 +    mem_put(data, msg, n);
 667.232 +    data->hi += n;
 667.233 +    return n;
 667.234 +}
 667.235 +
 667.236 +/** Read bytes from a memory stream into a buffer.
 667.237 + *
 667.238 + * @param io mem stream
 667.239 + * @param buf buffer
 667.240 + * @param n maximum number of bytes to read
 667.241 + * @return number of bytes read on success, negative error code otherwise
 667.242 + */
 667.243 +static int mem_read(IOStream *io, void *buf, size_t n){
 667.244 +    MemData *data = get_mem_data(io);
 667.245 +    if(data->err) return -data->err;
 667.246 +    int k = mem_len(data);
 667.247 +    if(n > k){
 667.248 +        n = k;
 667.249 +    }
 667.250 +    mem_get(data, buf, n);
 667.251 +    data->lo += n;
 667.252 +    return n;
 667.253 +}
 667.254 +
 667.255 +/** Test if a memory stream has an error.
 667.256 + *
 667.257 + * @param io mem stream
 667.258 + * @return 0 if ok, error code otherwise
 667.259 + */
 667.260 +static int mem_error(IOStream *io){
 667.261 +    MemData *data = get_mem_data(io);
 667.262 +    return data->err;
 667.263 +}
 667.264 +
 667.265 +/** Close a memory stream.
 667.266 + *
 667.267 + * @param io mem stream
 667.268 + * @return 0
 667.269 + */
 667.270 +static int mem_close(IOStream *io){
 667.271 +    MemData *data = get_mem_data(io);
 667.272 +    if(!data->err){
 667.273 +        data->err = ENOTCONN;
 667.274 +    }
 667.275 +    return 0;
 667.276 +}
 667.277 +
 667.278 +/** Free a memory stream.
 667.279 + *
 667.280 + * @param io mem stream
 667.281 + */
 667.282 +static void mem_free(IOStream *io){
 667.283 +    MemData *data = get_mem_data(io);
 667.284 +    deallocate(data->buf);
 667.285 +    memzero(data, sizeof(*data));
 667.286 +    deallocate(data);
 667.287 +}
 667.288 +
 667.289 +/** Allocate and initialise a memory stream.
 667.290 + *
 667.291 + * @param buf_n initial buffer size (0 means default)
 667.292 + * @param buf_max maximum buffer size (0 means no max)
 667.293 + * @return new stream (free using IOStream_close)
 667.294 + */
 667.295 +IOStream *mem_stream_new_size(size_t buf_n, size_t buf_max){
 667.296 +    int err = -ENOMEM;
 667.297 +    MemData *data = ALLOCATE(MemData);
 667.298 +    if(!data) goto exit;
 667.299 +    IOStream *io = ALLOCATE(IOStream);
 667.300 +    if(!io) goto exit;
 667.301 +    if(buf_n <= delta_min){
 667.302 +        buf_n = delta_min;
 667.303 +    }
 667.304 +    if(buf_max > 0 && buf_max < buf_n){
 667.305 +        buf_max = buf_n;
 667.306 +    }
 667.307 +    data->buf = allocate(buf_n);
 667.308 +    if(!data->buf) goto exit;
 667.309 +    data->buf_n = buf_n;
 667.310 +    data->buf_max = buf_max;
 667.311 +    io->methods = &mem_methods;
 667.312 +    io->data = data;
 667.313 +    io->nofree = 0;
 667.314 +    err = 0;
 667.315 +  exit:
 667.316 +    if(err){
 667.317 +        deallocate(data);
 667.318 +        deallocate(io);
 667.319 +        io = NULL;
 667.320 +    }
 667.321 +    return io;
 667.322 +}
   668.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   668.2 +++ b/tools/vnet/libxutil/mem_stream.h	Tue Sep 13 10:14:16 2005 -0600
   668.3 @@ -0,0 +1,32 @@
   668.4 +/*
   668.5 + * Copyright (C) 2005 Mike Wray <mike.wray@hp.com>
   668.6 + *
   668.7 + * This library is free software; you can redistribute it and/or modify
   668.8 + * it under the terms of the GNU Lesser General Public License as published by
   668.9 + * the Free Software Foundation; either version 2.1 of the License, or
  668.10 + * (at your option) any later version.
  668.11 + *
  668.12 + * This library is distributed in the hope that it will be useful,
  668.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  668.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  668.15 + * GNU Lesser General Public License for more details.
  668.16 + *
  668.17 + * You should have received a copy of the GNU Lesser General Public License
  668.18 + * along with this library; if not, write to the Free Software
  668.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  668.20 + */
  668.21 +
  668.22 +#ifndef _XUTIL_MEM_STREAM_H_
  668.23 +#define _XUTIL_MEM_STREAM_H_
  668.24 +
  668.25 +#include "iostream.h"
  668.26 +
  668.27 +extern IOStream *mem_stream_new_size(size_t buf_n, size_t buf_max);
  668.28 +
  668.29 +extern int mem_stream_avail(IOStream *io);
  668.30 +
  668.31 +static inline IOStream *mem_stream_new(void){
  668.32 +    return mem_stream_new_size(0, 0);
  668.33 +}
  668.34 +
  668.35 +#endif /* !_XUTIL_MEM_STREAM_H_ */
   690.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   690.2 +++ b/tools/vnet/vnet-module/varp_util.c	Tue Sep 13 10:14:16 2005 -0600
   690.3 @@ -0,0 +1,77 @@
   690.4 +/*
   690.5 + * Copyright (C) 2005 Mike Wray <mike.wray@hp.com>
   690.6 + *
   690.7 + * This program is free software; you can redistribute it and/or modify
   690.8 + * it under the terms of the GNU General Public License as published by the 
   690.9 + * Free Software Foundation; either version 2 of the License, or (at your
  690.10 + * option) any later version.
  690.11 + * 
  690.12 + * This program is distributed in the hope that it will be useful, but
  690.13 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  690.14 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  690.15 + * for more details.
  690.16 + *
  690.17 + * You should have received a copy of the GNU General Public License along
  690.18 + * with this program; if not, write to the Free software Foundation, Inc.,
  690.19 + * 59 Temple Place, suite 330, Boston, MA 02111-1307 USA
  690.20 + *
  690.21 + */
  690.22 +
  690.23 +static int hex16(char *s, uint16_t *val)
  690.24 +{
  690.25 +    int err = -EINVAL;
  690.26 +    uint16_t v = 0;
  690.27 +    
  690.28 +    for( ; *s; s++){
  690.29 +        v <<= 4;
  690.30 +        if('0' <= *s && *s <= '9'){
  690.31 +            v |= *s - '0';
  690.32 +        } else if('A' <= *s && *s <= 'F'){
  690.33 +            v |= *s - 'A' + 10;
  690.34 +        } else if('a' <= *s && *s <= 'f'){
  690.35 +            v |= *s - 'a' + 10;
  690.36 +        } else {
  690.37 +            goto exit;
  690.38 +        }
  690.39 +    }
  690.40 +    err = 0;
  690.41 +  exit:
  690.42 +    *val = (err ? 0 : v);
  690.43 +    return err;
  690.44 +}
  690.45 +
  690.46 +int VnetId_aton(const char *s, VnetId *vnet){
  690.47 +    int err = -EINVAL;
  690.48 +    const char *p, *q;
  690.49 +    uint16_t v;
  690.50 +    char buf[5];
  690.51 +    int buf_n = sizeof(buf) - 1;
  690.52 +    int i, n;
  690.53 +    const int elts_n = 8;
  690.54 +
  690.55 +    q = s;
  690.56 +    p = strchr(q, ':');
  690.57 +    i = (p ? 0 : elts_n - 1);
  690.58 +    do {
  690.59 +        if(!p){
  690.60 +            if(i < elts_n - 1) goto exit;
  690.61 +            p = s + strlen(s);
  690.62 +        }
  690.63 +        n = p - q;
  690.64 +        if(n > buf_n) goto exit;
  690.65 +        memcpy(buf, q, n);
  690.66 +        buf[n] = '\0';
  690.67 +        err = hex16(buf, &v);
  690.68 +        if(err) goto exit;
  690.69 +        vnet->u.vnet16[i] = htons(v);
  690.70 +        q = p+1;
  690.71 +        p = strchr(q, ':');
  690.72 +        i++;
  690.73 +    } while(i < elts_n);
  690.74 +    err = 0;
  690.75 +  exit:
  690.76 +    if(err){
  690.77 +        *vnet = (VnetId){};
  690.78 +    }
  690.79 +    return err;
  690.80 +}
   691.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   691.2 +++ b/tools/vnet/vnet-module/varp_util.h	Tue Sep 13 10:14:16 2005 -0600
   691.3 @@ -0,0 +1,142 @@
   691.4 +/*
   691.5 + * Copyright (C) 2004 Mike Wray <mike.wray@hp.com>
   691.6 + *
   691.7 + * This program is free software; you can redistribute it and/or modify
   691.8 + * it under the terms of the GNU General Public License as published by the 
   691.9 + * Free Software Foundation; either version 2 of the License, or (at your
  691.10 + * option) any later version.
  691.11 + * 
  691.12 + * This program is distributed in the hope that it will be useful, but
  691.13 + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  691.14 + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  691.15 + * for more details.
  691.16 + *
  691.17 + * You should have received a copy of the GNU General Public License along
  691.18 + * with this program; if not, write to the Free software Foundation, Inc.,
  691.19 + * 59 Temple Place, suite 330, Boston, MA 02111-1307 USA
  691.20 + *
  691.21 + */
  691.22 +#ifndef _VNET_VARP_UTIL_H
  691.23 +#define _VNET_VARP_UTIL_H
  691.24 +
  691.25 +#include "hash_table.h"
  691.26 +
  691.27 +/** Size of a string buffer to store a varp address. */
  691.28 +#define VARP_ADDR_BUF 56
  691.29 +
  691.30 +/** Size of a string buffer to store a vnet id. */
  691.31 +#define VNET_ID_BUF 56
  691.32 +
  691.33 +#ifndef NIPQUAD
  691.34 +#define NIPQUAD(addr) \
  691.35 +	((unsigned char *)&addr)[0], \
  691.36 +	((unsigned char *)&addr)[1], \
  691.37 +	((unsigned char *)&addr)[2], \
  691.38 +	((unsigned char *)&addr)[3]
  691.39 +#endif
  691.40 +
  691.41 +#ifndef NIP6
  691.42 +#define NIP6(addr) \
  691.43 +	ntohs((addr).s6_addr16[0]), \
  691.44 +	ntohs((addr).s6_addr16[1]), \
  691.45 +	ntohs((addr).s6_addr16[2]), \
  691.46 +	ntohs((addr).s6_addr16[3]), \
  691.47 +	ntohs((addr).s6_addr16[4]), \
  691.48 +	ntohs((addr).s6_addr16[5]), \
  691.49 +	ntohs((addr).s6_addr16[6]), \
  691.50 +	ntohs((addr).s6_addr16[7])
  691.51 +#endif
  691.52 +
  691.53 +
  691.54 +static inline const char *VarpAddr_ntoa(VarpAddr *addr, char buf[VARP_ADDR_BUF])
  691.55 +{
  691.56 +    switch(addr->family){
  691.57 +    default:
  691.58 +    case AF_INET:
  691.59 +        sprintf(buf, "%u.%u.%u.%u",
  691.60 +                NIPQUAD(addr->u.ip4));
  691.61 +        break;
  691.62 +    case AF_INET6:
  691.63 +        sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x",
  691.64 +                NIP6(addr->u.ip6));
  691.65 +        break;
  691.66 +    }
  691.67 +    return buf;
  691.68 +}
  691.69 +
  691.70 +static inline const char *VnetId_ntoa(VnetId *vnet, char buf[VNET_ID_BUF])
  691.71 +{
  691.72 +    sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x",
  691.73 +            ntohs(vnet->u.vnet16[0]), \
  691.74 +            ntohs(vnet->u.vnet16[1]), \
  691.75 +            ntohs(vnet->u.vnet16[2]), \
  691.76 +            ntohs(vnet->u.vnet16[3]), \
  691.77 +            ntohs(vnet->u.vnet16[4]), \
  691.78 +            ntohs(vnet->u.vnet16[5]), \
  691.79 +            ntohs(vnet->u.vnet16[6]), \
  691.80 +            ntohs(vnet->u.vnet16[7]));
  691.81 +    return buf;
  691.82 +}
  691.83 +
  691.84 +extern int VnetId_aton(const char *s, VnetId *vnet);
  691.85 +
  691.86 +/** Convert an unsigned in host order to a vnet id.
  691.87 + */
  691.88 +static inline struct VnetId toVnetId(uint32_t vnetid){
  691.89 +    struct VnetId vnet = {};
  691.90 +    vnet.u.vnet32[3] = htonl(vnetid);
  691.91 +    return vnet;
  691.92 +}
  691.93 +
  691.94 +static inline uint32_t VnetId_hash(uint32_t h, VnetId *vnet)
  691.95 +{
  691.96 +    h = hash_hul(h, vnet->u.vnet32[0]);
  691.97 +    h = hash_hul(h, vnet->u.vnet32[1]);
  691.98 +    h = hash_hul(h, vnet->u.vnet32[2]);
  691.99 +    h = hash_hul(h, vnet->u.vnet32[3]);
 691.100 +    return h;
 691.101 +}
 691.102 +
 691.103 +static inline int VnetId_eq(VnetId *vnet1, VnetId *vnet2)
 691.104 +{
 691.105 +    return memcmp(vnet1, vnet2, sizeof(VnetId)) == 0;
 691.106 +}
 691.107 +
 691.108 +static inline uint32_t VarpAddr_hash(uint32_t h, VarpAddr *addr)
 691.109 +{
 691.110 +    h = hash_hul(h, addr->family);
 691.111 +    if(addr->family == AF_INET6){
 691.112 +        h = hash_hul(h, addr->u.ip6.s6_addr32[0]);
 691.113 +        h = hash_hul(h, addr->u.ip6.s6_addr32[1]);
 691.114 +        h = hash_hul(h, addr->u.ip6.s6_addr32[2]);
 691.115 +        h = hash_hul(h, addr->u.ip6.s6_addr32[3]);
 691.116 +    } else {
 691.117 +        h = hash_hul(h, addr->u.ip4.s_addr);
 691.118 +    }
 691.119 +    return h;
 691.120 +}
 691.121 +
 691.122 +static inline int VarpAddr_eq(VarpAddr *addr1, VarpAddr*addr2)
 691.123 +{
 691.124 +    return memcmp(addr1, addr2, sizeof(VarpAddr)) == 0;
 691.125 +}
 691.126 +
 691.127 +static inline uint32_t Vmac_hash(uint32_t h, Vmac *vmac)
 691.128 +{
 691.129 +    h = hash_hul(h,
 691.130 +                 (vmac->mac[0] << 24) |
 691.131 +                 (vmac->mac[1] << 16) |
 691.132 +                 (vmac->mac[2] <<  8) |
 691.133 +                 (vmac->mac[3]      ));
 691.134 +    h = hash_hul(h, 
 691.135 +                 (vmac->mac[4] <<   8) |
 691.136 +                 (vmac->mac[5]       ));
 691.137 +    return h;
 691.138 +}
 691.139 +
 691.140 +static inline int Vmac_eq(Vmac *vmac1, Vmac *vmac2)
 691.141 +{
 691.142 +    return memcmp(vmac1, vmac2, sizeof(Vmac)) == 0;
 691.143 +}
 691.144 +
 691.145 +#endif /* _VNET_VARP_UTIL_H */
   769.1 --- a/tools/xenstore/Makefile	Fri Sep 09 10:31:36 2005 -0600
   769.2 +++ b/tools/xenstore/Makefile	Tue Sep 13 10:14:16 2005 -0600
   769.3 @@ -17,15 +17,15 @@ BASECFLAGS+= -O3 $(PROFILE)
   769.4  BASECFLAGS+= -I$(XEN_ROOT)/tools/libxc
   769.5  BASECFLAGS+= -I$(XEN_ROOT)/xen/include/public
   769.6  BASECFLAGS+= -I.
   769.7 -BASECFLAGS+= -I$(XEN_ROOT)/linux-2.6-xen-sparse/include/asm-xen/linux-public
   769.8  
   769.9  CFLAGS  += $(BASECFLAGS)
  769.10  LDFLAGS += $(PROFILE) -L$(XEN_LIBXC)
  769.11 -TESTDIR  = `pwd`/testsuite/tmp
  769.12 +TESTDIR  = testsuite/tmp
  769.13  TESTFLAGS= -DTESTING
  769.14  TESTENV  = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
  769.15  
  769.16 -CLIENTS := xenstore-read xenstore-rm xenstore-write
  769.17 +CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm
  769.18 +CLIENTS += xenstore-write
  769.19  CLIENTS_OBJS := $(patsubst xenstore-%,xenstore_%.o,$(CLIENTS))
  769.20  
  769.21  all: libxenstore.so xenstored $(CLIENTS)
  769.22 @@ -80,10 +80,13 @@ check: print-dir testsuite-fast randomch
  769.23  
  769.24  fullcheck: testsuite-run randomcheck stresstest
  769.25  
  769.26 -testsuite-run: xenstored_test xs_test
  769.27 +$(TESTDIR):
  769.28 +	mkdir $@
  769.29 +
  769.30 +testsuite-run: xenstored_test xs_test $(TESTDIR)
  769.31  	$(TESTENV) testsuite/test.sh && echo
  769.32  
  769.33 -testsuite-fast: xenstored_test xs_test
  769.34 +testsuite-fast: xenstored_test xs_test $(TESTDIR)
  769.35  	@$(TESTENV) testsuite/test.sh --fast
  769.36  
  769.37  testsuite-clean:
  769.38 @@ -92,21 +95,21 @@ testsuite-clean:
  769.39  # Make this visible so they can see repeat tests without --fast if they
  769.40  # fail.
  769.41  RANDSEED=$(shell date +%s)
  769.42 -randomcheck: xs_random xenstored_test
  769.43 +randomcheck: xs_random xenstored_test $(TESTDIR)
  769.44  	$(TESTENV) ./xs_random --simple --fast /tmp/xs_random 200000 $(RANDSEED) && echo
  769.45  	$(TESTENV) ./xs_random --fast /tmp/xs_random 100000 $(RANDSEED) && echo
  769.46  	$(TESTENV) ./xs_random --fail /tmp/xs_random 10000 $(RANDSEED)
  769.47  
  769.48 -crashme:  xs_crashme xenstored_test
  769.49 +crashme:  xs_crashme xenstored_test $(TESTDIR)
  769.50  	rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
  769.51  	export $(TESTENV); ./xs_crashme 5000 $(RANDSEED) 2>/dev/null
  769.52  	if [ -n "`cat /tmp/xs_crashme.vglog*`" ]; then echo Valgrind complained; cat /tmp/xs_crashme.vglog*; exit 1; fi
  769.53  	rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
  769.54  
  769.55 -randomcheck-fast: xs_random xenstored_test
  769.56 +randomcheck-fast: xs_random xenstored_test $(TESTDIR)
  769.57  	@$(TESTENV) ./xs_random --fast /tmp/xs_random 2000 $(RANDSEED)
  769.58  
  769.59 -stresstest: xs_stress xenstored_test
  769.60 +stresstest: xs_stress xenstored_test $(TESTDIR)
  769.61  	rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
  769.62  	export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
  769.63  
   771.1 --- a/tools/xenstore/fake_libxc.c	Fri Sep 09 10:31:36 2005 -0600
   771.2 +++ b/tools/xenstore/fake_libxc.c	Tue Sep 13 10:14:16 2005 -0600
   771.3 @@ -83,6 +83,39 @@ int xc_interface_close(int xc_handle)
   771.4  	return 0;
   771.5  }
   771.6  
   771.7 +int xc_domain_getinfo(int xc_handle __attribute__((unused)),
   771.8 +		      u32 first_domid, unsigned int max_doms,
   771.9 +                      xc_dominfo_t *info)
  771.10 +{
  771.11 +	assert(max_doms == 1);
  771.12 +        info->domid = first_domid;
  771.13 +
  771.14 +        info->dying    = 0;
  771.15 +        info->shutdown = 0;
  771.16 +        info->paused   = 0;
  771.17 +        info->blocked  = 0;
  771.18 +        info->running  = 1;
  771.19 +
  771.20 +        info->shutdown_reason = 0;
  771.21 +
  771.22 +        if ( info->shutdown && (info->shutdown_reason == SHUTDOWN_crash) )
  771.23 +        {
  771.24 +            info->shutdown = 0;
  771.25 +            info->crashed  = 1;
  771.26 +        }
  771.27 +
  771.28 +	return 1;
  771.29 +}
  771.30 +
  771.31 +int xc_evtchn_bind_virq(int xc_handle __attribute__((unused)),
  771.32 +			int virq __attribute__((unused)),
  771.33 +			int *port)
  771.34 +{
  771.35 +	if (port)
  771.36 +		*port = 0;
  771.37 +	return 0;
  771.38 +}
  771.39 +
  771.40  static void send_to_fd(int signo __attribute__((unused)))
  771.41  {
  771.42  	int saved_errno = errno;
   778.1 --- a/tools/xenstore/testsuite/07watch.test	Fri Sep 09 10:31:36 2005 -0600
   778.2 +++ b/tools/xenstore/testsuite/07watch.test	Tue Sep 13 10:14:16 2005 -0600
   778.3 @@ -34,12 +34,13 @@ 1 ackwatch token
   778.4  1 close
   778.5  2 close
   778.6  
   778.7 -# We don't get a watch from our own commands.
   778.8 -watch /dir token
   778.9 -mkdir /dir/newdir
  778.10 -expect waitwatch failed: Connection timed out
  778.11 -waitwatch
  778.12 -close
  778.13 +# Changed in b594bb976a743d509f1ffabb5bc698874ab90d8f
  778.14 +## We don't get a watch from our own commands.
  778.15 +#watch /dir token
  778.16 +#mkdir /dir/newdir
  778.17 +#expect waitwatch failed: Connection timed out
  778.18 +#waitwatch
  778.19 +#close
  778.20  
  778.21  # ignore watches while doing commands, should work.
  778.22  watch /dir token
   786.1 --- a/tools/xenstore/testsuite/14complexperms.test	Fri Sep 09 10:31:36 2005 -0600
   786.2 +++ b/tools/xenstore/testsuite/14complexperms.test	Tue Sep 13 10:14:16 2005 -0600
   786.3 @@ -30,10 +30,8 @@ getperm /dir/file
   786.4  expect *Permission denied
   786.5  setperm /dir/file 0 NONE 
   786.6  watch /dir/file token 
   786.7 -setid 0
   786.8 -write /dir/file create contents
   786.9 -rm /dir/file
  786.10 -setid 1
  786.11 +1 write /dir/file create contents
  786.12 +1 rm /dir/file
  786.13  expect waitwatch failed: Connection timed out
  786.14  waitwatch
  786.15  unwatch /dir/file token 
  786.16 @@ -78,10 +76,8 @@ getperm /dir/file
  786.17  expect *Permission denied
  786.18  setperm /dir/file 0 NONE 
  786.19  watch /dir/file token 
  786.20 -setid 0
  786.21 -write /dir/file create contents
  786.22 -rm /dir/file
  786.23 -setid 1
  786.24 +1 write /dir/file create contents
  786.25 +1 rm /dir/file
  786.26  expect waitwatch failed: Connection timed out
  786.27  waitwatch
  786.28  unwatch /dir/file token 
   792.1 --- a/tools/xenstore/xenstore_client.c	Fri Sep 09 10:31:36 2005 -0600
   792.2 +++ b/tools/xenstore/xenstore_client.c	Tue Sep 13 10:14:16 2005 -0600
   792.3 @@ -22,7 +22,7 @@ usage(const char *progname)
   792.4      errx(1, "Usage: %s [-h] [-p] key [...]", progname);
   792.5  #elif defined(CLIENT_write)
   792.6      errx(1, "Usage: %s [-h] key value [...]", progname);
   792.7 -#elif defined(CLIENT_rm)
   792.8 +#elif defined(CLIENT_rm) || defined(CLIENT_exists) || defined(CLIENT_list)
   792.9      errx(1, "Usage: %s [-h] key [...]", progname);
  792.10  #endif
  792.11  }
  792.12 @@ -33,8 +33,7 @@ main(int argc, char **argv)
  792.13      struct xs_handle *xsh;
  792.14      bool success;
  792.15      int ret = 0;
  792.16 -#if defined(CLIENT_read)
  792.17 -    char *val;
  792.18 +#if defined(CLIENT_read) || defined(CLIENT_list)
  792.19      int prefix = 0;
  792.20  #endif
  792.21  
  792.22 @@ -46,14 +45,14 @@ main(int argc, char **argv)
  792.23  	int c, index = 0;
  792.24  	static struct option long_options[] = {
  792.25  	    {"help", 0, 0, 'h'},
  792.26 -#if defined(CLIENT_read)
  792.27 +#if defined(CLIENT_read) || defined(CLIENT_list)
  792.28  	    {"prefix", 0, 0, 'p'},
  792.29  #endif
  792.30  	    {0, 0, 0, 0}
  792.31  	};
  792.32  
  792.33  	c = getopt_long(argc, argv, "h"
  792.34 -#if defined(CLIENT_read)
  792.35 +#if defined(CLIENT_read) || defined(CLIENT_list)
  792.36  			"p"
  792.37  #endif
  792.38  			, long_options, &index);
  792.39 @@ -64,7 +63,7 @@ main(int argc, char **argv)
  792.40  	case 'h':
  792.41  	    usage(argv[0]);
  792.42  	    /* NOTREACHED */
  792.43 -#if defined(CLIENT_read)
  792.44 +#if defined(CLIENT_read) || defined(CLIENT_list)
  792.45  	case 'p':
  792.46  	    prefix = 1;
  792.47  	    break;
  792.48 @@ -77,7 +76,7 @@ main(int argc, char **argv)
  792.49  	/* NOTREACHED */
  792.50      }
  792.51  #if defined(CLIENT_write)
  792.52 -    if ((argc - optind) % 1) {
  792.53 +    if ((argc - optind) % 2 == 1) {
  792.54  	usage(argv[0]);
  792.55  	/* NOTREACHED */
  792.56      }
  792.57 @@ -90,7 +89,7 @@ main(int argc, char **argv)
  792.58  
  792.59      while (optind < argc) {
  792.60  #if defined(CLIENT_read)
  792.61 -	val = xs_read(xsh, argv[optind], NULL);
  792.62 +	char *val = xs_read(xsh, argv[optind], NULL);
  792.63  	if (val == NULL) {
  792.64  	    warnx("couldn't read path %s", argv[optind]);
  792.65  	    ret = 1;
  792.66 @@ -118,6 +117,29 @@ main(int argc, char **argv)
  792.67  	    goto out;
  792.68  	}
  792.69  	optind++;
  792.70 +#elif defined(CLIENT_exists)
  792.71 +	char *val = xs_read(xsh, argv[optind], NULL);
  792.72 +	if (val == NULL) {
  792.73 +	    ret = 1;
  792.74 +	    goto out;
  792.75 +	}
  792.76 +	free(val);
  792.77 +	optind++;
  792.78 +#elif defined(CLIENT_list)
  792.79 +	unsigned int i, num;
  792.80 +	char **list = xs_directory(xsh, argv[optind], &num);
  792.81 +	if (list == NULL) {
  792.82 +	    warnx("could not list path %s", argv[optind]);
  792.83 +	    ret = 1;
  792.84 +	    goto out;
  792.85 +	}
  792.86 +	for (i = 0; i < num; i++) {
  792.87 +	    if (prefix)
  792.88 +		printf("%s/", argv[optind]);
  792.89 +	    printf("%s\n", list[i]);
  792.90 +	}
  792.91 +	free(list);
  792.92 +	optind++;
  792.93  #endif
  792.94      }
  792.95  
   794.1 --- a/tools/xenstore/xenstored_core.c	Fri Sep 09 10:31:36 2005 -0600
   794.2 +++ b/tools/xenstore/xenstored_core.c	Tue Sep 13 10:14:16 2005 -0600
   794.3 @@ -1640,8 +1640,10 @@ static void daemonize(void)
   794.4  
   794.5  	/* Session leader so ^C doesn't whack us. */
   794.6  	setsid();
   794.7 +#ifndef TESTING	/* Relative paths for socket names */
   794.8  	/* Move off any mount points we might be in. */
   794.9  	chdir("/");
  794.10 +#endif
  794.11  	/* Discard our parent's old-fashioned umask prejudices. */
  794.12  	umask(0);
  794.13  }
   796.1 --- a/tools/xenstore/xenstored_domain.c	Fri Sep 09 10:31:36 2005 -0600
   796.2 +++ b/tools/xenstore/xenstored_domain.c	Tue Sep 13 10:14:16 2005 -0600
   796.3 @@ -218,6 +218,26 @@ static int destroy_domain(void *_domain)
   796.4  	return 0;
   796.5  }
   796.6  
   796.7 +static void domain_cleanup(void)
   796.8 +{
   796.9 +	xc_dominfo_t dominfo;
  796.10 +	struct domain *domain, *tmp;
  796.11 +	int released = 0;
  796.12 +
  796.13 +	list_for_each_entry_safe(domain, tmp, &domains, list) {
  796.14 +		if (xc_domain_getinfo(*xc_handle, domain->domid, 1,
  796.15 +				      &dominfo) == 1 &&
  796.16 +		    dominfo.domid == domain->domid &&
  796.17 +		    !dominfo.dying && !dominfo.crashed && !dominfo.shutdown)
  796.18 +			continue;
  796.19 +		talloc_free(domain->conn);
  796.20 +		released++;
  796.21 +	}
  796.22 +
  796.23 +	if (released)
  796.24 +		fire_watches(NULL, "@releaseDomain", false);
  796.25 +}
  796.26 +
  796.27  /* We scan all domains rather than use the information given here. */
  796.28  void handle_event(int event_fd)
  796.29  {
  796.30 @@ -371,26 +391,6 @@ void do_release(struct connection *conn,
  796.31  	send_ack(conn, XS_RELEASE);
  796.32  }
  796.33  
  796.34 -void domain_cleanup(void)
  796.35 -{
  796.36 -	xc_dominfo_t dominfo;
  796.37 -	struct domain *domain, *tmp;
  796.38 -	int released = 0;
  796.39 -
  796.40 -	list_for_each_entry_safe(domain, tmp, &domains, list) {
  796.41 -		if (xc_domain_getinfo(*xc_handle, domain->domid, 1,
  796.42 -				      &dominfo) == 1 &&
  796.43 -		    dominfo.domid == domain->domid &&
  796.44 -		    !dominfo.dying && !dominfo.crashed && !dominfo.shutdown)
  796.45 -			continue;
  796.46 -		talloc_free(domain->conn);
  796.47 -		released++;
  796.48 -	}
  796.49 -
  796.50 -	if (released)
  796.51 -		fire_watches(NULL, "@releaseDomain", false);
  796.52 -}
  796.53 -
  796.54  void do_get_domain_path(struct connection *conn, const char *domid_str)
  796.55  {
  796.56  	struct domain *domain;
  796.57 @@ -457,6 +457,7 @@ int domain_init(void)
  796.58  
  796.59  #ifdef TESTING
  796.60  	eventchn_fd = fake_open_eventchn();
  796.61 +	(void)&st;
  796.62  #else
  796.63  	/* Make sure any existing device file links to correct device. */
  796.64  	if ((lstat(EVTCHN_DEV_NAME, &st) != 0) || !S_ISCHR(st.st_mode) ||
   797.1 --- a/tools/xenstore/xenstored_domain.h	Fri Sep 09 10:31:36 2005 -0600
   797.2 +++ b/tools/xenstore/xenstored_domain.h	Tue Sep 13 10:14:16 2005 -0600
   797.3 @@ -28,10 +28,6 @@ void do_introduce(struct connection *con
   797.4  /* domid */
   797.5  void do_release(struct connection *conn, const char *domid_str);
   797.6  
   797.7 -/* Enumerate domains and release connections for non-existant or dying
   797.8 - * domains. */
   797.9 -void domain_cleanup(void);
  797.10 -
  797.11  /* domid */
  797.12  void do_get_domain_path(struct connection *conn, const char *domid_str);
  797.13  
   800.1 --- a/tools/xenstore/xenstored_watch.c	Fri Sep 09 10:31:36 2005 -0600
   800.2 +++ b/tools/xenstore/xenstored_watch.c	Tue Sep 13 10:14:16 2005 -0600
   800.3 @@ -105,7 +105,6 @@ static void add_event(struct connection 
   800.4  	 */
   800.5  	if (!check_node_perms(conn, node, XS_PERM_READ|XS_PERM_ENOENT_OK) &&
   800.6  	    !check_event_node(node)) {
   800.7 -		fprintf(stderr, "No permission for %s\n", node);
   800.8  		return;
   800.9  	}
  800.10  
  800.11 @@ -135,11 +134,8 @@ void fire_watches(struct connection *con
  800.12  	if (conn && conn->transaction)
  800.13  		return;
  800.14  
  800.15 -	/* Create an event for each watch.  Don't send to self. */
  800.16 +	/* Create an event for each watch. */
  800.17  	list_for_each_entry(i, &connections, list) {
  800.18 -		if (i == conn)
  800.19 -			continue;
  800.20 -
  800.21  		list_for_each_entry(watch, &i->watches, list) {
  800.22  			if (is_child(node, watch->node))
  800.23  				add_event(i, watch, node);
   802.1 --- a/tools/xenstore/xs.c	Fri Sep 09 10:31:36 2005 -0600
   802.2 +++ b/tools/xenstore/xs.c	Tue Sep 13 10:14:16 2005 -0600
   802.3 @@ -36,12 +36,10 @@
   802.4  #include "xenstored.h"
   802.5  #include "xs_lib.h"
   802.6  #include "utils.h"
   802.7 -#include "xenbus_dev.h"
   802.8  
   802.9  struct xs_handle
  802.10  {
  802.11  	int fd;
  802.12 -	enum { SOCK, DEV } type;
  802.13  };
  802.14  
  802.15  /* Get the socket from the store daemon handle.
  802.16 @@ -68,7 +66,6 @@ static struct xs_handle *get_socket(cons
  802.17  		h = malloc(sizeof(*h));
  802.18  		if (h) {
  802.19  			h->fd = sock;
  802.20 -			h->type = SOCK;
  802.21  			return h;
  802.22  		}
  802.23  	}
  802.24 @@ -82,16 +79,15 @@ static struct xs_handle *get_socket(cons
  802.25  static struct xs_handle *get_dev(const char *connect_to)
  802.26  {
  802.27  	int fd, saved_errno;
  802.28 -	struct xs_handle *h = NULL;
  802.29 +	struct xs_handle *h;
  802.30  
  802.31 -	fd = open(connect_to, O_RDONLY);
  802.32 +	fd = open(connect_to, O_RDWR);
  802.33  	if (fd < 0)
  802.34  		return NULL;
  802.35  
  802.36  	h = malloc(sizeof(*h));
  802.37  	if (h) {
  802.38  		h->fd = fd;
  802.39 -		h->type = DEV;
  802.40  		return h;
  802.41  	}
  802.42  
  802.43 @@ -101,19 +97,32 @@ static struct xs_handle *get_dev(const c
  802.44  	return NULL;
  802.45  }
  802.46  
  802.47 +static struct xs_handle *get_handle(const char *connect_to)
  802.48 +{
  802.49 +	struct stat buf;
  802.50 +
  802.51 +	if (stat(connect_to, &buf) != 0)
  802.52 +		return NULL;
  802.53 +
  802.54 +	if (S_ISSOCK(buf.st_mode))
  802.55 +		return get_socket(connect_to);
  802.56 +	else
  802.57 +		return get_dev(connect_to);
  802.58 +}
  802.59 +
  802.60  struct xs_handle *xs_daemon_open(void)
  802.61  {
  802.62 -	return get_socket(xs_daemon_socket());
  802.63 +	return get_handle(xs_daemon_socket());
  802.64  }
  802.65  
  802.66  struct xs_handle *xs_daemon_open_readonly(void)
  802.67  {
  802.68 -	return get_socket(xs_daemon_socket_ro());
  802.69 +	return get_handle(xs_daemon_socket_ro());
  802.70  }
  802.71  
  802.72  struct xs_handle *xs_domain_open(void)
  802.73  {
  802.74 -	return get_dev(xs_domain_dev());
  802.75 +	return get_handle(xs_domain_dev());
  802.76  }
  802.77  
  802.78  void xs_daemon_close(struct xs_handle *h)
  802.79 @@ -190,9 +199,9 @@ static void *read_reply(int fd, enum xsd
  802.80  }
  802.81  
  802.82  /* Send message to xs, get malloc'ed reply.  NULL and set errno on error. */
  802.83 -static void *xs_talkv_sock(struct xs_handle *h, enum xsd_sockmsg_type type,
  802.84 -			   const struct iovec *iovec, unsigned int num_vecs,
  802.85 -			   unsigned int *len)
  802.86 +static void *xs_talkv(struct xs_handle *h, enum xsd_sockmsg_type type,
  802.87 +		      const struct iovec *iovec, unsigned int num_vecs,
  802.88 +		      unsigned int *len)
  802.89  {
  802.90  	struct xsd_sockmsg msg;
  802.91  	void *ret = NULL;
  802.92 @@ -253,54 +262,6 @@ close_fd:
  802.93  	return NULL;
  802.94  }
  802.95  
  802.96 -/* Send message to xs, get malloc'ed reply.  NULL and set errno on error. */
  802.97 -static void *xs_talkv_dev(struct xs_handle *h, enum xsd_sockmsg_type type,
  802.98 -			  const struct iovec *iovec, unsigned int num_vecs,
  802.99 -			  unsigned int *len)
 802.100 -{
 802.101 -	struct xenbus_dev_talkv dt;
 802.102 -	char *buf;
 802.103 -	int err, buflen = 1024;
 802.104 -
 802.105 - again:
 802.106 -	buf = malloc(buflen);
 802.107 -	if (buf == NULL) {
 802.108 -		errno = ENOMEM;
 802.109 -		return NULL;
 802.110 -	}
 802.111 -	dt.type = type;
 802.112 -	dt.iovec = (struct kvec *)iovec;
 802.113 -	dt.num_vecs = num_vecs;
 802.114 -	dt.buf = buf;
 802.115 -	dt.len = buflen;
 802.116 -	err = ioctl(h->fd, IOCTL_XENBUS_DEV_TALKV, &dt);
 802.117 -	if (err < 0) {
 802.118 -		free(buf);
 802.119 -		errno = err;
 802.120 -		return NULL;
 802.121 -	}
 802.122 -	if (err > buflen) {
 802.123 -		free(buf);
 802.124 -		buflen = err;
 802.125 -		goto again;
 802.126 -	}
 802.127 -	if (len)
 802.128 -		*len = err;
 802.129 -	return buf;
 802.130 -}
 802.131 -
 802.132 -/* Send message to xs, get malloc'ed reply.  NULL and set errno on error. */
 802.133 -static void *xs_talkv(struct xs_handle *h, enum xsd_sockmsg_type type,
 802.134 -		      const struct iovec *iovec, unsigned int num_vecs,
 802.135 -		      unsigned int *len)
 802.136 -{
 802.137 -	if (h->type == SOCK)
 802.138 -		return xs_talkv_sock(h, type, iovec, num_vecs, len);
 802.139 -	if (h->type == DEV)
 802.140 -		return xs_talkv_dev(h, type, iovec, num_vecs, len);
 802.141 -	return NULL;
 802.142 -}
 802.143 -
 802.144  /* free(), but don't change errno. */
 802.145  static void free_no_errno(void *p)
 802.146  {
   806.1 --- a/tools/xenstore/xs_lib.c	Fri Sep 09 10:31:36 2005 -0600
   806.2 +++ b/tools/xenstore/xs_lib.c	Tue Sep 13 10:14:16 2005 -0600
   806.3 @@ -38,37 +38,55 @@ static const char *xs_daemon_rundir(void
   806.4  	return (s ? s : "/var/run/xenstored");
   806.5  }
   806.6  
   806.7 -const char *xs_daemon_socket(void)
   806.8 +static const char *xs_daemon_path(void)
   806.9  {
  806.10  	static char buf[PATH_MAX];
  806.11 -	sprintf(buf, "%s/socket", xs_daemon_rundir());
  806.12 +	char *s = getenv("XENSTORED_PATH");
  806.13 +	if (s)
  806.14 +		return s;
  806.15 +	if (snprintf(buf, PATH_MAX, "%s/socket",
  806.16 +		     xs_daemon_rundir()) >= PATH_MAX)
  806.17 +		return NULL;
  806.18  	return buf;
  806.19  }
  806.20  
  806.21 +const char *xs_daemon_socket(void)
  806.22 +{
  806.23 +	return xs_daemon_path();
  806.24 +}
  806.25 +
  806.26  const char *xs_daemon_socket_ro(void)
  806.27  {
  806.28  	static char buf[PATH_MAX];
  806.29 -	sprintf(buf, "%s/socket_ro", xs_daemon_rundir());
  806.30 +	const char *s = xs_daemon_path();
  806.31 +	if (s == NULL)
  806.32 +		return NULL;
  806.33 +	if (snprintf(buf, PATH_MAX, "%s_ro", s) >= PATH_MAX)
  806.34 +		return NULL;
  806.35  	return buf;
  806.36  }
  806.37  
  806.38  const char *xs_daemon_store(void)
  806.39  {
  806.40  	static char buf[PATH_MAX];
  806.41 -	sprintf(buf, "%s/store", xs_daemon_rootdir());
  806.42 +	if (snprintf(buf, PATH_MAX, "%s/store",
  806.43 +		     xs_daemon_rootdir()) >= PATH_MAX)
  806.44 +		return NULL;
  806.45  	return buf;
  806.46  }
  806.47  
  806.48  const char *xs_daemon_transactions(void)
  806.49  {
  806.50  	static char buf[PATH_MAX];
  806.51 -	sprintf(buf, "%s/transactions", xs_daemon_rootdir());
  806.52 +	if (snprintf(buf, PATH_MAX, "%s/transactions",
  806.53 +		     xs_daemon_rootdir()) >= PATH_MAX)
  806.54 +		return NULL;
  806.55  	return buf;
  806.56  }
  806.57  
  806.58  const char *xs_domain_dev(void)
  806.59  {
  806.60 -	char *s = getenv("XENSTORED_DOMAIN_DEV");
  806.61 +	char *s = getenv("XENSTORED_PATH");
  806.62  	return (s ? s : "/proc/xen/xenbus");
  806.63  }
  806.64  
   809.1 --- a/tools/xenstore/xs_test.c	Fri Sep 09 10:31:36 2005 -0600
   809.2 +++ b/tools/xenstore/xs_test.c	Tue Sep 13 10:14:16 2005 -0600
   809.3 @@ -43,7 +43,7 @@
   809.4  
   809.5  static struct xs_handle *handles[10] = { NULL };
   809.6  
   809.7 -static unsigned int timeout_ms = 200;
   809.8 +static unsigned int timeout_ms = 500;
   809.9  static bool timeout_suppressed = true;
  809.10  static bool readonly = false;
  809.11  static bool print_input = false;
   814.1 --- a/xen/Makefile	Fri Sep 09 10:31:36 2005 -0600
   814.2 +++ b/xen/Makefile	Tue Sep 13 10:14:16 2005 -0600
   814.3 @@ -31,11 +31,11 @@ build: $(TARGET).gz
   814.4  
   814.5  install: $(TARGET).gz
   814.6  	[ -d $(DESTDIR)/boot ] || $(INSTALL_DIR) $(DESTDIR)/boot
   814.7 -	$(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION).gz
   814.8 -	ln -f -s $(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz
   814.9 -	ln -f -s $(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
  814.10 -	ln -f -s $(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
  814.11 -	$(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
  814.12 +	$(INSTALL_DATA) $(TARGET).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_FULLVERSION).gz
  814.13 +	ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).gz
  814.14 +	ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
  814.15 +	ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
  814.16 +	$(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_FULLVERSION)
  814.17  	[ -d $(DESTDIR)/usr/include/xen/io ] || \
  814.18  		$(INSTALL_DIR) $(DESTDIR)/usr/include/xen/io
  814.19  	$(INSTALL_DATA) include/public/*.h $(DESTDIR)/usr/include/xen
   839.1 --- a/xen/arch/ia64/xen/xensetup.c	Fri Sep 09 10:31:36 2005 -0600
   839.2 +++ b/xen/arch/ia64/xen/xensetup.c	Tue Sep 13 10:14:16 2005 -0600
   839.3 @@ -386,16 +386,17 @@ printk("About to call startup_cpu_idle_l
   839.4      startup_cpu_idle_loop();
   839.5  }
   839.6  
   839.7 -void arch_get_xen_caps(xen_capabilities_info_t *info)
   839.8 +void arch_get_xen_caps(xen_capabilities_info_t info)
   839.9  {
  839.10 -    char *p=info->caps;
  839.11 +    char *p=info;
  839.12  
  839.13      *p=0;
  839.14  
  839.15      p+=sprintf(p,"xen_%d.%d_ia64 ",XEN_VERSION,XEN_SUBVERSION);
  839.16  
  839.17 -    BUG_ON((p-info->caps)>sizeof(*info));
  839.18 +    *(p-1) = 0;
  839.19  
  839.20 -    if(p>info->caps) *(p-1) = 0;
  839.21 +    BUG_ON((p-info)>sizeof(xen_capabilities_info_t));
  839.22 +
  839.23  }
  839.24  
   850.1 --- a/xen/arch/x86/dom0_ops.c	Fri Sep 09 10:31:36 2005 -0600
   850.2 +++ b/xen/arch/x86/dom0_ops.c	Tue Sep 13 10:14:16 2005 -0600
   850.3 @@ -35,13 +35,13 @@ static unsigned long msr_hi;
   850.4  
   850.5  static void write_msr_for(void *unused)
   850.6  {
   850.7 -    if (((1 << current->processor) & msr_cpu_mask))
   850.8 +    if ( ((1 << current->processor) & msr_cpu_mask) )
   850.9          (void)wrmsr_user(msr_addr, msr_lo, msr_hi);
  850.10  }
  850.11  
  850.12  static void read_msr_for(void *unused)
  850.13  {
  850.14 -    if (((1 << current->processor) & msr_cpu_mask))
  850.15 +    if ( ((1 << current->processor) & msr_cpu_mask) )
  850.16          (void)rdmsr_user(msr_addr, msr_lo, msr_hi);
  850.17  }
  850.18  
  850.19 @@ -189,11 +189,11 @@ long arch_do_dom0_op(dom0_op_t *op, dom0
  850.20          pi->total_pages      = max_page;
  850.21          pi->free_pages       = avail_domheap_pages();
  850.22          pi->cpu_khz          = cpu_khz;
  850.23 -        memset( pi->hw_cap, 0, sizeof(pi->hw_cap) );
  850.24 -        memcpy( pi->hw_cap, boot_cpu_data.x86_capability, NCAPINTS*4 );
  850.25 +        memset(pi->hw_cap, 0, sizeof(pi->hw_cap));
  850.26 +        memcpy(pi->hw_cap, boot_cpu_data.x86_capability, NCAPINTS*4);
  850.27          ret = 0;
  850.28 -        if( copy_to_user(u_dom0_op, op, sizeof(*op)) )
  850.29 -	    ret = -EINVAL;
  850.30 +        if ( copy_to_user(u_dom0_op, op, sizeof(*op)) )
  850.31 +	    ret = -EFAULT;
  850.32      }
  850.33      break;
  850.34      
   851.1 --- a/xen/arch/x86/domain.c	Fri Sep 09 10:31:36 2005 -0600
   851.2 +++ b/xen/arch/x86/domain.c	Tue Sep 13 10:14:16 2005 -0600
   851.3 @@ -461,14 +461,11 @@ int arch_set_info_guest(
   851.4          if ( !get_page(&frame_table[phys_basetab>>PAGE_SHIFT], d) )
   851.5              return -EINVAL;
   851.6      }
   851.7 -    else
   851.8 +    else if ( !(c->flags & VGCF_VMX_GUEST) )
   851.9      {
  851.10 -#ifdef __x86_64__
  851.11 -        if ( !(c->flags & VGCF_VMX_GUEST) )
  851.12 -#endif
  851.13 -            if ( !get_page_and_type(&frame_table[phys_basetab>>PAGE_SHIFT], d, 
  851.14 -                                    PGT_base_page_table) )
  851.15 -                return -EINVAL;
  851.16 +        if ( !get_page_and_type(&frame_table[phys_basetab>>PAGE_SHIFT], d, 
  851.17 +                                PGT_base_page_table) )
  851.18 +            return -EINVAL;
  851.19      }
  851.20  
  851.21      if ( (rc = (int)set_gdt(v, c->gdt_frames, c->gdt_ents)) != 0 )
  851.22 @@ -677,10 +674,10 @@ static void save_segments(struct vcpu *v
  851.23      if ( VMX_DOMAIN(v) )
  851.24          rdmsrl(MSR_SHADOW_GS_BASE, v->arch.arch_vmx.msr_content.shadow_gs);
  851.25  
  851.26 -    __asm__ __volatile__ ( "movl %%ds,%0" : "=m" (regs->ds) );
  851.27 -    __asm__ __volatile__ ( "movl %%es,%0" : "=m" (regs->es) );
  851.28 -    __asm__ __volatile__ ( "movl %%fs,%0" : "=m" (regs->fs) );
  851.29 -    __asm__ __volatile__ ( "movl %%gs,%0" : "=m" (regs->gs) );
  851.30 +    __asm__ __volatile__ ( "mov %%ds,%0" : "=m" (regs->ds) );
  851.31 +    __asm__ __volatile__ ( "mov %%es,%0" : "=m" (regs->es) );
  851.32 +    __asm__ __volatile__ ( "mov %%fs,%0" : "=m" (regs->fs) );
  851.33 +    __asm__ __volatile__ ( "mov %%gs,%0" : "=m" (regs->gs) );
  851.34  
  851.35      if ( regs->ds )
  851.36          dirty_segment_mask |= DIRTY_DS;
   859.1 --- a/xen/arch/x86/setup.c	Fri Sep 09 10:31:36 2005 -0600
   859.2 +++ b/xen/arch/x86/setup.c	Tue Sep 13 10:14:16 2005 -0600
   859.3 @@ -93,8 +93,6 @@ unsigned long mmu_cr4_features = X86_CR4
   859.4  #endif
   859.5  EXPORT_SYMBOL(mmu_cr4_features);
   859.6  
   859.7 -int hvm_enabled = 0; /* can we run unmodified guests */
   859.8 -
   859.9  struct vcpu *idle_task[NR_CPUS] = { &idle0_vcpu };
  859.10  
  859.11  int acpi_disabled;
  859.12 @@ -533,43 +531,44 @@ void __init __start_xen(multiboot_info_t
  859.13      startup_cpu_idle_loop();
  859.14  }
  859.15  
  859.16 -void arch_get_xen_caps(xen_capabilities_info_t *info)
  859.17 +void arch_get_xen_caps(xen_capabilities_info_t info)
  859.18  {
  859.19 -    char *p=info->caps;
  859.20 +    char *p = info;
  859.21  
  859.22 -    *p=0;
  859.23 -
  859.24 -#ifdef CONFIG_X86_32
  859.25 +#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)
  859.26  
  859.27 -#ifndef CONFIG_X86_PAE       
  859.28 -    p+=sprintf(p,"xen_%d.%d_x86_32 ",XEN_VERSION,XEN_SUBVERSION);    
  859.29 -    if(hvm_enabled)
  859.30 +    p += sprintf(p, "xen_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
  859.31 +    if ( hvm_enabled )
  859.32 +        p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
  859.33 +
  859.34 +#elif defined(CONFIG_X86_32) && defined(CONFIG_X86_PAE)
  859.35 +
  859.36 +    p += sprintf(p, "xen_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION);
  859.37 +    if ( hvm_enabled )
  859.38      {
  859.39 -        p+=sprintf(p,"hvm_%d.%d_x86_32 ",XEN_VERSION,XEN_SUBVERSION);    
  859.40 -    }
  859.41 -#else
  859.42 -    p+=sprintf(p,"xen_%d.%d_x86_32p ",XEN_VERSION,XEN_SUBVERSION);
  859.43 -    if(hvm_enabled)
  859.44 -    {
  859.45 -        //p+=sprintf(p,"hvm_%d.%d_x86_32 ",XEN_VERSION,XEN_SUBVERSION);    
  859.46 -        //p+=sprintf(p,"hvm_%d.%d_x86_32p ",XEN_VERSION,XEN_SUBVERSION);    
  859.47 +        //p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
  859.48 +        //p += sprintf(p, "hvm_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION);
  859.49      }
  859.50  
  859.51 -#endif        
  859.52 +#elif defined(CONFIG_X86_64)
  859.53  
  859.54 -#else /* !CONFIG_X86_32 */
  859.55 -    p+=sprintf(p,"xen_%d.%d_x86_64 ",XEN_VERSION,XEN_SUBVERSION);
  859.56 -    if(hvm_enabled)
  859.57 +    p += sprintf(p, "xen_%d.%d_x86_64 ", XEN_VERSION, XEN_SUBVERSION);
  859.58 +    if ( hvm_enabled )
  859.59      {
  859.60 -        //p+=sprintf(p,"hvm_%d.%d_x86_32 ",XEN_VERSION,XEN_SUBVERSION);    
  859.61 -        //p+=sprintf(p,"hvm_%d.%d_x86_32p ",XEN_VERSION,XEN_SUBVERSION);    
  859.62 -        p+=sprintf(p,"hvm_%d.%d_x86_64 ",XEN_VERSION,XEN_SUBVERSION);    
  859.63 +        //p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION);
  859.64 +        //p += sprintf(p, "hvm_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION);
  859.65 +        p += sprintf(p, "hvm_%d.%d_x86_64 ", XEN_VERSION, XEN_SUBVERSION);
  859.66      }
  859.67 +
  859.68 +#else
  859.69 +
  859.70 +    p++;
  859.71 +
  859.72  #endif
  859.73      
  859.74 -    BUG_ON((p-info->caps)>sizeof(*info));
  859.75 +    *(p-1) = 0;
  859.76  
  859.77 -    if(p>info->caps) *(p-1) = 0;
  859.78 +    BUG_ON((p - info) > sizeof(xen_capabilities_info_t));
  859.79  }
  859.80  
  859.81  /*
   860.1 --- a/xen/arch/x86/shadow.c	Fri Sep 09 10:31:36 2005 -0600
   860.2 +++ b/xen/arch/x86/shadow.c	Tue Sep 13 10:14:16 2005 -0600
   860.3 @@ -54,7 +54,7 @@ static unsigned long shadow_l4_table(
   860.4  static void shadow_map_into_current(struct vcpu *v,
   860.5      unsigned long va, unsigned int from, unsigned int to);
   860.6  static inline void validate_bl2e_change( struct domain *d,
   860.7 -	guest_root_pgentry_t *new_gle_p, pgentry_64_t *shadow_l3, int index);
   860.8 +    guest_root_pgentry_t *new_gle_p, pgentry_64_t *shadow_l3, int index);
   860.9  
  860.10  #endif
  860.11  
   861.1 --- a/xen/arch/x86/shadow32.c	Fri Sep 09 10:31:36 2005 -0600
   861.2 +++ b/xen/arch/x86/shadow32.c	Tue Sep 13 10:14:16 2005 -0600
   861.3 @@ -2214,7 +2214,7 @@ static u32 remove_all_access_in_page(
   861.4      struct domain *d, unsigned long l1mfn, unsigned long forbidden_gmfn)
   861.5  {
   861.6      l1_pgentry_t *pl1e = map_domain_page(l1mfn);
   861.7 -    l1_pgentry_t match;
   861.8 +    l1_pgentry_t match, ol2e;
   861.9      unsigned long flags  = _PAGE_PRESENT;
  861.10      int i;
  861.11      u32 count = 0;
  861.12 @@ -2226,17 +2226,17 @@ static u32 remove_all_access_in_page(
  861.13      
  861.14      for (i = 0; i < L1_PAGETABLE_ENTRIES; i++)
  861.15      {
  861.16 -        if ( unlikely(!l1e_has_changed(pl1e[i], match, flags) == 0) )
  861.17 -        {
  861.18 -            l1_pgentry_t ol2e = pl1e[i];
  861.19 -            pl1e[i] = l1e_empty();
  861.20 -            count++;
  861.21 -
  861.22 -            if ( is_l1_shadow )
  861.23 -                shadow_put_page_from_l1e(ol2e, d);
  861.24 -            else /* must be an hl2 page */
  861.25 -                put_page(&frame_table[forbidden_gmfn]);
  861.26 -        }
  861.27 +        if ( l1e_has_changed(pl1e[i], match, flags) )
  861.28 +            continue;
  861.29 +
  861.30 +        ol2e = pl1e[i];
  861.31 +        pl1e[i] = l1e_empty();
  861.32 +        count++;
  861.33 +
  861.34 +        if ( is_l1_shadow )
  861.35 +            shadow_put_page_from_l1e(ol2e, d);
  861.36 +        else /* must be an hl2 page */
  861.37 +            put_page(&frame_table[forbidden_gmfn]);
  861.38      }
  861.39  
  861.40      unmap_domain_page(pl1e);
   863.1 --- a/xen/arch/x86/shadow_public.c	Fri Sep 09 10:31:36 2005 -0600
   863.2 +++ b/xen/arch/x86/shadow_public.c	Tue Sep 13 10:14:16 2005 -0600
   863.3 @@ -54,24 +54,24 @@ int shadow_set_guest_paging_levels(struc
   863.4      switch(levels) {
   863.5  #if CONFIG_PAGING_LEVELS >= 4
   863.6      case 4:
   863.7 -	if ( d->arch.ops != &MODE_F_HANDLER )
   863.8 -	    d->arch.ops = &MODE_F_HANDLER;
   863.9 -	shadow_unlock(d);
  863.10 +        if ( d->arch.ops != &MODE_F_HANDLER )
  863.11 +            d->arch.ops = &MODE_F_HANDLER;
  863.12 +        shadow_unlock(d);
  863.13          return 1;
  863.14  #endif
  863.15      case 3:
  863.16      case 2:
  863.17  #if CONFIG_PAGING_LEVELS == 2
  863.18 -	if ( d->arch.ops != &MODE_A_HANDLER )
  863.19 -	    d->arch.ops = &MODE_A_HANDLER;
  863.20 +        if ( d->arch.ops != &MODE_A_HANDLER )
  863.21 +            d->arch.ops = &MODE_A_HANDLER;
  863.22  #elif CONFIG_PAGING_LEVELS == 4
  863.23 -	if ( d->arch.ops != &MODE_D_HANDLER )
  863.24 -	    d->arch.ops = &MODE_D_HANDLER;
  863.25 +        if ( d->arch.ops != &MODE_D_HANDLER )
  863.26 +            d->arch.ops = &MODE_D_HANDLER;
  863.27  #endif
  863.28 -	shadow_unlock(d);
  863.29 +        shadow_unlock(d);
  863.30          return 1;
  863.31 -   default:
  863.32 -	shadow_unlock(d);
  863.33 +    default:
  863.34 +        shadow_unlock(d);
  863.35          return 0;
  863.36      }
  863.37  }
  863.38 @@ -115,10 +115,10 @@ int shadow_do_update_va_mapping(unsigned
  863.39  
  863.40  struct out_of_sync_entry *
  863.41  shadow_mark_mfn_out_of_sync(struct vcpu *v, unsigned long gpfn,
  863.42 -                             unsigned long mfn)
  863.43 +                            unsigned long mfn)
  863.44  {
  863.45 -   struct domain *d = v->domain;
  863.46 -   return d->arch.ops->mark_mfn_out_of_sync(v, gpfn, mfn);
  863.47 +    struct domain *d = v->domain;
  863.48 +    return d->arch.ops->mark_mfn_out_of_sync(v, gpfn, mfn);
  863.49  }
  863.50  
  863.51  /*
  863.52 @@ -181,7 +181,7 @@ static void alloc_monitor_pagetable(stru
  863.53      l4_pgentry_t *mpl4e;
  863.54      struct pfn_info *mmfn_info;
  863.55      struct domain *d = v->domain;
  863.56 -     pagetable_t phys_table;
  863.57 +    pagetable_t phys_table;
  863.58  
  863.59      ASSERT(!pagetable_get_paddr(v->arch.monitor_table)); /* we should only get called once */
  863.60  
  863.61 @@ -192,13 +192,13 @@ static void alloc_monitor_pagetable(stru
  863.62      mpl4e = (l4_pgentry_t *) map_domain_page(mmfn);
  863.63      memcpy(mpl4e, &idle_pg_table[0], PAGE_SIZE);
  863.64      mpl4e[l4_table_offset(PERDOMAIN_VIRT_START)] =
  863.65 -      l4e_from_paddr(__pa(d->arch.mm_perdomain_l3), __PAGE_HYPERVISOR);
  863.66 +        l4e_from_paddr(__pa(d->arch.mm_perdomain_l3), __PAGE_HYPERVISOR);
  863.67      /* map the phys_to_machine map into the per domain Read-Only MPT space */
  863.68      phys_table = page_table_convert(d);
  863.69  
  863.70      mpl4e[l4_table_offset(RO_MPT_VIRT_START)] =
  863.71 -       l4e_from_paddr(pagetable_get_paddr(phys_table),
  863.72 -         __PAGE_HYPERVISOR);
  863.73 +        l4e_from_paddr(pagetable_get_paddr(phys_table),
  863.74 +                       __PAGE_HYPERVISOR);
  863.75      v->arch.monitor_table = mk_pagetable(mmfn << PAGE_SHIFT);
  863.76      v->arch.monitor_vtable = (l2_pgentry_t *) mpl4e;
  863.77  }
  863.78 @@ -245,7 +245,7 @@ free_shadow_tables(struct domain *d, uns
  863.79          for ( i = 0; i < PAGETABLE_ENTRIES; i++ )
  863.80              if ( external || is_guest_l4_slot(i) )
  863.81                  if ( entry_get_flags(ple[i]) & _PAGE_PRESENT )
  863.82 -                        put_shadow_ref(entry_get_pfn(ple[i]));
  863.83 +                    put_shadow_ref(entry_get_pfn(ple[i]));
  863.84  
  863.85          unmap_domain_page(ple);
  863.86      }
  863.87 @@ -306,12 +306,12 @@ static void alloc_monitor_pagetable(stru
  863.88  
  863.89      mpl2e[l2_table_offset(PERDOMAIN_VIRT_START)] =
  863.90          l2e_from_paddr(__pa(d->arch.mm_perdomain_pt),
  863.91 -                        __PAGE_HYPERVISOR);
  863.92 +                       __PAGE_HYPERVISOR);
  863.93  
  863.94      // map the phys_to_machine map into the Read-Only MPT space for this domain
  863.95      mpl2e[l2_table_offset(RO_MPT_VIRT_START)] =
  863.96          l2e_from_paddr(pagetable_get_paddr(d->arch.phys_table),
  863.97 -                        __PAGE_HYPERVISOR);
  863.98 +                       __PAGE_HYPERVISOR);
  863.99  
 863.100      // Don't (yet) have mappings for these...
 863.101      // Don't want to accidentally see the idle_pg_table's linear mapping.
 863.102 @@ -365,7 +365,7 @@ void free_monitor_pagetable(struct vcpu 
 863.103      v->arch.monitor_table = mk_pagetable(0);
 863.104      v->arch.monitor_vtable = 0;
 863.105  }
 863.106 -#endif	
 863.107 +#endif 
 863.108  
 863.109  static void
 863.110  shadow_free_snapshot(struct domain *d, struct out_of_sync_entry *entry)
 863.111 @@ -850,16 +850,16 @@ void free_shadow_pages(struct domain *d)
 863.112          perfc_decr(free_l1_pages);
 863.113  
 863.114          struct pfn_info *page = list_entry(list_ent, struct pfn_info, list);
 863.115 -	if (d->arch.ops->guest_paging_levels == PAGING_L2)
 863.116 -	{
 863.117 +        if (d->arch.ops->guest_paging_levels == PAGING_L2)
 863.118 +        {
 863.119  #if CONFIG_PAGING_LEVELS >=4
 863.120 -        free_domheap_pages(page, SL1_ORDER);
 863.121 +            free_domheap_pages(page, SL1_ORDER);
 863.122  #else
 863.123 -	free_domheap_page(page);
 863.124 +            free_domheap_page(page);
 863.125  #endif
 863.126 -	}
 863.127 -	else
 863.128 -	free_domheap_page(page);
 863.129 +        }
 863.130 +        else
 863.131 +            free_domheap_page(page);
 863.132      }
 863.133  
 863.134      shadow_audit(d, 0);
 863.135 @@ -930,9 +930,9 @@ int __shadow_mode_enable(struct domain *
 863.136  
 863.137  #if defined(CONFIG_PAGING_LEVELS)
 863.138      if(!shadow_set_guest_paging_levels(d, 
 863.139 -	   CONFIG_PAGING_LEVELS)) {
 863.140 -	printk("Unsupported guest paging levels\n");
 863.141 -	domain_crash_synchronous(); /* need to take a clean path */
 863.142 +                                       CONFIG_PAGING_LEVELS)) {
 863.143 +        printk("Unsupported guest paging levels\n");
 863.144 +        domain_crash_synchronous(); /* need to take a clean path */
 863.145      }
 863.146  #endif
 863.147  
 863.148 @@ -1004,7 +1004,7 @@ int __shadow_mode_enable(struct domain *
 863.149              goto nomem;
 863.150  
 863.151          memset(d->arch.shadow_ht, 0,
 863.152 -           shadow_ht_buckets * sizeof(struct shadow_status));
 863.153 +               shadow_ht_buckets * sizeof(struct shadow_status));
 863.154      }
 863.155  
 863.156      if ( new_modes & SHM_log_dirty )
 863.157 @@ -1013,7 +1013,7 @@ int __shadow_mode_enable(struct domain *
 863.158          d->arch.shadow_dirty_bitmap_size = (d->max_pages + 63) & ~63;
 863.159          d->arch.shadow_dirty_bitmap = 
 863.160              xmalloc_array(unsigned long, d->arch.shadow_dirty_bitmap_size /
 863.161 -                                         (8 * sizeof(unsigned long)));
 863.162 +                          (8 * sizeof(unsigned long)));
 863.163          if ( d->arch.shadow_dirty_bitmap == NULL )
 863.164          {
 863.165              d->arch.shadow_dirty_bitmap_size = 0;
 863.166 @@ -1039,7 +1039,7 @@ int __shadow_mode_enable(struct domain *
 863.167              // external guests provide their own memory for their P2M maps.
 863.168              //
 863.169              ASSERT( d == page_get_owner(
 863.170 -                        &frame_table[pagetable_get_pfn(d->arch.phys_table)]) );
 863.171 +                &frame_table[pagetable_get_pfn(d->arch.phys_table)]) );
 863.172          }
 863.173      }
 863.174  
 863.175 @@ -1188,9 +1188,9 @@ static int shadow_mode_table_op(
 863.176                            chunk : (d->max_pages - i)) + 7) / 8;
 863.177  
 863.178              if (copy_to_user(
 863.179 -                    sc->dirty_bitmap + (i/(8*sizeof(unsigned long))),
 863.180 -                    d->arch.shadow_dirty_bitmap +(i/(8*sizeof(unsigned long))),
 863.181 -                    bytes))
 863.182 +                sc->dirty_bitmap + (i/(8*sizeof(unsigned long))),
 863.183 +                d->arch.shadow_dirty_bitmap +(i/(8*sizeof(unsigned long))),
 863.184 +                bytes))
 863.185              {
 863.186                  // copy_to_user can fail when copying to guest app memory.
 863.187                  // app should zero buffer after mallocing, and pin it
 863.188 @@ -1474,8 +1474,8 @@ void shadow_l3_normal_pt_update(
 863.189  
 863.190          spl3e = (pgentry_64_t *) map_domain_page_with_cache(sl3mfn, cache);
 863.191          validate_entry_change(d, (pgentry_64_t *) &gpde,
 863.192 -			      &spl3e[(pa & ~PAGE_MASK) / sizeof(l3_pgentry_t)], 
 863.193 -			      shadow_type_to_level(PGT_l3_shadow));
 863.194 +                              &spl3e[(pa & ~PAGE_MASK) / sizeof(l3_pgentry_t)], 
 863.195 +                              shadow_type_to_level(PGT_l3_shadow));
 863.196          unmap_domain_page_with_cache(spl3e, cache);
 863.197      }
 863.198  
 863.199 @@ -1502,8 +1502,8 @@ void shadow_l4_normal_pt_update(
 863.200  
 863.201          spl4e = (pgentry_64_t *)map_domain_page_with_cache(sl4mfn, cache);
 863.202          validate_entry_change(d, (pgentry_64_t *)&gpde,
 863.203 -			      &spl4e[(pa & ~PAGE_MASK) / sizeof(l4_pgentry_t)], 
 863.204 -			      shadow_type_to_level(PGT_l4_shadow));
 863.205 +                              &spl4e[(pa & ~PAGE_MASK) / sizeof(l4_pgentry_t)], 
 863.206 +                              shadow_type_to_level(PGT_l4_shadow));
 863.207          unmap_domain_page_with_cache(spl4e, cache);
 863.208      }
 863.209  
 863.210 @@ -1619,32 +1619,32 @@ gpfn_to_mfn_foreign(struct domain *d, un
 863.211  }
 863.212  
 863.213  static u32 remove_all_access_in_page(
 863.214 -  struct domain *d, unsigned long l1mfn, unsigned long forbidden_gmfn)
 863.215 +    struct domain *d, unsigned long l1mfn, unsigned long forbidden_gmfn)
 863.216  {
 863.217      l1_pgentry_t *pl1e = map_domain_page(l1mfn);
 863.218 -    l1_pgentry_t match;
 863.219 +    l1_pgentry_t match, ol2e;
 863.220      unsigned long flags  = _PAGE_PRESENT;
 863.221      int i;
 863.222      u32 count = 0;
 863.223      int is_l1_shadow =
 863.224 -      ((frame_table[l1mfn].u.inuse.type_info & PGT_type_mask) ==
 863.225 -       PGT_l1_shadow);
 863.226 +        ((frame_table[l1mfn].u.inuse.type_info & PGT_type_mask) ==
 863.227 +         PGT_l1_shadow);
 863.228  
 863.229      match = l1e_from_pfn(forbidden_gmfn, flags);
 863.230  
 863.231      for (i = 0; i < L1_PAGETABLE_ENTRIES; i++)
 863.232      {
 863.233 -        if ( unlikely(!l1e_has_changed(pl1e[i], match, flags) == 0) )
 863.234 -        {
 863.235 -            l1_pgentry_t ol2e = pl1e[i];
 863.236 -            pl1e[i] = l1e_empty();
 863.237 -            count++;
 863.238 +        if ( l1e_has_changed(pl1e[i], match, flags) )
 863.239 +            continue;
 863.240  
 863.241 -            if ( is_l1_shadow )
 863.242 -                shadow_put_page_from_l1e(ol2e, d);
 863.243 -            else /* must be an hl2 page */
 863.244 -                put_page(&frame_table[forbidden_gmfn]);
 863.245 -        }
 863.246 +        ol2e = pl1e[i];
 863.247 +        pl1e[i] = l1e_empty();
 863.248 +        count++;
 863.249 +
 863.250 +        if ( is_l1_shadow )
 863.251 +            shadow_put_page_from_l1e(ol2e, d);
 863.252 +        else /* must be an hl2 page */
 863.253 +            put_page(&frame_table[forbidden_gmfn]);
 863.254      }
 863.255  
 863.256      unmap_domain_page(pl1e);
 863.257 @@ -1671,19 +1671,19 @@ static u32 __shadow_remove_all_access(st
 863.258          {
 863.259              switch (a->gpfn_and_flags & PGT_type_mask)
 863.260              {
 863.261 -                case PGT_l1_shadow:
 863.262 -                case PGT_l2_shadow:
 863.263 -                case PGT_l3_shadow:
 863.264 -                case PGT_l4_shadow:
 863.265 -                case PGT_hl2_shadow:
 863.266 -                    count += remove_all_access_in_page(d, a->smfn, forbidden_gmfn);
 863.267 -                    break;
 863.268 -                case PGT_snapshot:
 863.269 -                case PGT_writable_pred:
 863.270 -                    // these can't hold refs to the forbidden page
 863.271 -                    break;
 863.272 -                default:
 863.273 -                    BUG();
 863.274 +            case PGT_l1_shadow:
 863.275 +            case PGT_l2_shadow:
 863.276 +            case PGT_l3_shadow:
 863.277 +            case PGT_l4_shadow:
 863.278 +            case PGT_hl2_shadow:
 863.279 +                count += remove_all_access_in_page(d, a->smfn, forbidden_gmfn);
 863.280 +                break;
 863.281 +            case PGT_snapshot:
 863.282 +            case PGT_writable_pred:
 863.283 +                // these can't hold refs to the forbidden page
 863.284 +                break;
 863.285 +            default:
 863.286 +                BUG();
 863.287              }
 863.288  
 863.289              a = a->next;
 863.290 @@ -1694,29 +1694,29 @@ static u32 __shadow_remove_all_access(st
 863.291  }
 863.292  
 863.293  void shadow_drop_references(
 863.294 -  struct domain *d, struct pfn_info *page)
 863.295 +    struct domain *d, struct pfn_info *page)
 863.296  {
 863.297      if ( likely(!shadow_mode_refcounts(d)) ||
 863.298 -      ((page->u.inuse.type_info & PGT_count_mask) == 0) )
 863.299 +         ((page->u.inuse.type_info & PGT_count_mask) == 0) )
 863.300          return;
 863.301  
 863.302      /* XXX This needs more thought... */
 863.303      printk("%s: needing to call __shadow_remove_all_access for mfn=%lx\n",
 863.304 -      __func__, page_to_pfn(page));
 863.305 +           __func__, page_to_pfn(page));
 863.306      printk("Before: mfn=%lx c=%08x t=%" PRtype_info "\n", page_to_pfn(page),
 863.307 -      page->count_info, page->u.inuse.type_info);
 863.308 +           page->count_info, page->u.inuse.type_info);
 863.309  
 863.310      shadow_lock(d);
 863.311      __shadow_remove_all_access(d, page_to_pfn(page));
 863.312      shadow_unlock(d);
 863.313  
 863.314      printk("After:  mfn=%lx c=%08x t=%" PRtype_info "\n", page_to_pfn(page),
 863.315 -      page->count_info, page->u.inuse.type_info);
 863.316 +           page->count_info, page->u.inuse.type_info);
 863.317  }
 863.318  
 863.319  /* XXX Needs more thought. Neither pretty nor fast: a place holder. */
 863.320  void shadow_sync_and_drop_references(
 863.321 -  struct domain *d, struct pfn_info *page)
 863.322 +    struct domain *d, struct pfn_info *page)
 863.323  {
 863.324      if ( likely(!shadow_mode_refcounts(d)) )
 863.325          return;
 863.326 @@ -1730,3 +1730,13 @@ void shadow_sync_and_drop_references(
 863.327  
 863.328      shadow_unlock(d);
 863.329  }
 863.330 +
 863.331 +/*
 863.332 + * Local variables:
 863.333 + * mode: C
 863.334 + * c-set-style: "BSD"
 863.335 + * c-basic-offset: 4
 863.336 + * tab-width: 4
 863.337 + * indent-tabs-mode: nil
 863.338 + * End:
 863.339 + */
   866.1 --- a/xen/arch/x86/traps.c	Fri Sep 09 10:31:36 2005 -0600
   866.2 +++ b/xen/arch/x86/traps.c	Tue Sep 13 10:14:16 2005 -0600
   866.3 @@ -106,7 +106,7 @@ integer_param("debug_stack_lines", debug
   866.4  #define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)&regs->esp)
   866.5  #else
   866.6  #define stack_words_per_line 4
   866.7 -#define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)regs->esp)
   866.8 +#define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)regs->rsp)
   866.9  #endif
  866.10  
  866.11  int is_kernel_text(unsigned long addr)
  866.12 @@ -238,7 +238,7 @@ void show_stack(struct cpu_user_regs *re
  866.13      unsigned long *stack = ESP_BEFORE_EXCEPTION(regs), addr;
  866.14      int i;
  866.15  
  866.16 -    if ( GUEST_MODE(regs) )
  866.17 +    if ( GUEST_CONTEXT(current, regs) )
  866.18          return show_guest_stack(regs);
  866.19  
  866.20      printk("Xen stack trace from "__OP"sp=%p:\n   ", stack);
   867.1 --- a/xen/arch/x86/vmx.c	Fri Sep 09 10:31:36 2005 -0600
   867.2 +++ b/xen/arch/x86/vmx.c	Tue Sep 13 10:14:16 2005 -0600
   867.3 @@ -44,14 +44,14 @@
   867.4  
   867.5  #include <public/io/ioreq.h>
   867.6  
   867.7 +int hvm_enabled;
   867.8 +
   867.9  #ifdef CONFIG_VMX
  867.10  
  867.11  int vmcs_size;
  867.12  unsigned int opt_vmx_debug_level = 0;
  867.13  integer_param("vmx_debug", opt_vmx_debug_level);
  867.14  
  867.15 -extern int hvm_enabled;
  867.16 -
  867.17  #ifdef TRACE_BUFFER
  867.18  static unsigned long trace_values[NR_CPUS][4];
  867.19  #define TRACE_VMEXIT(index,value) trace_values[current->processor][index]=value
  867.20 @@ -122,37 +122,37 @@ static inline int long_mode_do_msr_read(
  867.21      struct vcpu *vc = current;
  867.22      struct msr_state * msr = &vc->arch.arch_vmx.msr_content;
  867.23      switch(regs->ecx){
  867.24 -        case MSR_EFER:
  867.25 -            msr_content = msr->msr_items[VMX_INDEX_MSR_EFER];
  867.26 -            VMX_DBG_LOG(DBG_LEVEL_2, "EFER msr_content %llx\n", (unsigned long long)msr_content);
  867.27 -            if (test_bit(VMX_CPU_STATE_LME_ENABLED,
  867.28 -                          &vc->arch.arch_vmx.cpu_state))
  867.29 -                msr_content |= 1 << _EFER_LME;
  867.30 +    case MSR_EFER:
  867.31 +        msr_content = msr->msr_items[VMX_INDEX_MSR_EFER];
  867.32 +        VMX_DBG_LOG(DBG_LEVEL_2, "EFER msr_content %llx\n", (unsigned long long)msr_content);
  867.33 +        if (test_bit(VMX_CPU_STATE_LME_ENABLED,
  867.34 +                     &vc->arch.arch_vmx.cpu_state))
  867.35 +            msr_content |= 1 << _EFER_LME;
  867.36  
  867.37 -            if (VMX_LONG_GUEST(vc))
  867.38 -                msr_content |= 1 << _EFER_LMA;
  867.39 -            break;
  867.40 -        case MSR_FS_BASE:
  867.41 -            if (!(VMX_LONG_GUEST(vc)))
  867.42 -                /* XXX should it be GP fault */
  867.43 -                domain_crash();
  867.44 -            __vmread(GUEST_FS_BASE, &msr_content);
  867.45 -            break;
  867.46 -        case MSR_GS_BASE:
  867.47 -            if (!(VMX_LONG_GUEST(vc)))
  867.48 -                domain_crash();
  867.49 -            __vmread(GUEST_GS_BASE, &msr_content);
  867.50 -            break;
  867.51 -        case MSR_SHADOW_GS_BASE:
  867.52 -            msr_content = msr->shadow_gs;
  867.53 -            break;
  867.54 +        if (VMX_LONG_GUEST(vc))
  867.55 +            msr_content |= 1 << _EFER_LMA;
  867.56 +        break;
  867.57 +    case MSR_FS_BASE:
  867.58 +        if (!(VMX_LONG_GUEST(vc)))
  867.59 +            /* XXX should it be GP fault */
  867.60 +            domain_crash();
  867.61 +        __vmread(GUEST_FS_BASE, &msr_content);
  867.62 +        break;
  867.63 +    case MSR_GS_BASE:
  867.64 +        if (!(VMX_LONG_GUEST(vc)))
  867.65 +            domain_crash();
  867.66 +        __vmread(GUEST_GS_BASE, &msr_content);
  867.67 +        break;
  867.68 +    case MSR_SHADOW_GS_BASE:
  867.69 +        msr_content = msr->shadow_gs;
  867.70 +        break;
  867.71  
  867.72          CASE_READ_MSR(STAR);
  867.73          CASE_READ_MSR(LSTAR);
  867.74          CASE_READ_MSR(CSTAR);
  867.75          CASE_READ_MSR(SYSCALL_MASK);
  867.76 -        default:
  867.77 -            return 0;
  867.78 +    default:
  867.79 +        return 0;
  867.80      }
  867.81      VMX_DBG_LOG(DBG_LEVEL_2, "mode_do_msr_read: msr_content: %lx\n", msr_content);
  867.82      regs->eax = msr_content & 0xffffffff;
  867.83 @@ -166,68 +166,68 @@ static inline int long_mode_do_msr_write
  867.84      struct vcpu *vc = current;
  867.85      struct msr_state * msr = &vc->arch.arch_vmx.msr_content;
  867.86      struct msr_state * host_state = 
  867.87 -		&percpu_msr[smp_processor_id()];
  867.88 +        &percpu_msr[smp_processor_id()];
  867.89  
  867.90      VMX_DBG_LOG(DBG_LEVEL_1, " mode_do_msr_write msr %lx msr_content %lx\n", 
  867.91                  regs->ecx, msr_content);
  867.92  
  867.93      switch (regs->ecx){
  867.94 -        case MSR_EFER:
  867.95 -            if ((msr_content & EFER_LME) ^
  867.96 -                  test_bit(VMX_CPU_STATE_LME_ENABLED,
  867.97 -                           &vc->arch.arch_vmx.cpu_state)){
  867.98 -                if (test_bit(VMX_CPU_STATE_PG_ENABLED,
  867.99 -                             &vc->arch.arch_vmx.cpu_state) ||
 867.100 -                    !test_bit(VMX_CPU_STATE_PAE_ENABLED,
 867.101 -                        &vc->arch.arch_vmx.cpu_state)){
 867.102 -                     vmx_inject_exception(vc, TRAP_gp_fault, 0);
 867.103 -                }
 867.104 +    case MSR_EFER:
 867.105 +        if ((msr_content & EFER_LME) ^
 867.106 +            test_bit(VMX_CPU_STATE_LME_ENABLED,
 867.107 +                     &vc->arch.arch_vmx.cpu_state)){
 867.108 +            if (test_bit(VMX_CPU_STATE_PG_ENABLED,
 867.109 +                         &vc->arch.arch_vmx.cpu_state) ||
 867.110 +                !test_bit(VMX_CPU_STATE_PAE_ENABLED,
 867.111 +                          &vc->arch.arch_vmx.cpu_state)){
 867.112 +                vmx_inject_exception(vc, TRAP_gp_fault, 0);
 867.113              }
 867.114 -            if (msr_content & EFER_LME)
 867.115 -                set_bit(VMX_CPU_STATE_LME_ENABLED,
 867.116 -                        &vc->arch.arch_vmx.cpu_state);
 867.117 -            /* No update for LME/LMA since it have no effect */
 867.118 -            msr->msr_items[VMX_INDEX_MSR_EFER] =
 867.119 -                  msr_content;
 867.120 -            if (msr_content & ~(EFER_LME | EFER_LMA)){
 867.121 -                msr->msr_items[VMX_INDEX_MSR_EFER] = msr_content;
 867.122 -                if (!test_bit(VMX_INDEX_MSR_EFER, &msr->flags)){ 
 867.123 -                    rdmsrl(MSR_EFER,
 867.124 -                            host_state->msr_items[VMX_INDEX_MSR_EFER]);
 867.125 -                      set_bit(VMX_INDEX_MSR_EFER, &host_state->flags);
 867.126 -                      set_bit(VMX_INDEX_MSR_EFER, &msr->flags);  
 867.127 -                      wrmsrl(MSR_EFER, msr_content);
 867.128 -                }
 867.129 +        }
 867.130 +        if (msr_content & EFER_LME)
 867.131 +            set_bit(VMX_CPU_STATE_LME_ENABLED,
 867.132 +                    &vc->arch.arch_vmx.cpu_state);
 867.133 +        /* No update for LME/LMA since it have no effect */
 867.134 +        msr->msr_items[VMX_INDEX_MSR_EFER] =
 867.135 +            msr_content;
 867.136 +        if (msr_content & ~(EFER_LME | EFER_LMA)){
 867.137 +            msr->msr_items[VMX_INDEX_MSR_EFER] = msr_content;
 867.138 +            if (!test_bit(VMX_INDEX_MSR_EFER, &msr->flags)){ 
 867.139 +                rdmsrl(MSR_EFER,
 867.140 +                       host_state->msr_items[VMX_INDEX_MSR_EFER]);
 867.141 +                set_bit(VMX_INDEX_MSR_EFER, &host_state->flags);
 867.142 +                set_bit(VMX_INDEX_MSR_EFER, &msr->flags);  
 867.143 +                wrmsrl(MSR_EFER, msr_content);
 867.144              }
 867.145 -            break;
 867.146 +        }
 867.147 +        break;
 867.148  
 867.149 -        case MSR_FS_BASE:
 867.150 -        case MSR_GS_BASE:
 867.151 -           if (!(VMX_LONG_GUEST(vc)))
 867.152 -                domain_crash();
 867.153 -           if (!IS_CANO_ADDRESS(msr_content)){
 867.154 -               VMX_DBG_LOG(DBG_LEVEL_1, "Not cano address of msr write\n");
 867.155 -               vmx_inject_exception(vc, TRAP_gp_fault, 0);
 867.156 -           }
 867.157 -           if (regs->ecx == MSR_FS_BASE)
 867.158 -               __vmwrite(GUEST_FS_BASE, msr_content);
 867.159 -           else 
 867.160 -               __vmwrite(GUEST_GS_BASE, msr_content);
 867.161 -           break;
 867.162 +    case MSR_FS_BASE:
 867.163 +    case MSR_GS_BASE:
 867.164 +        if (!(VMX_LONG_GUEST(vc)))
 867.165 +            domain_crash();
 867.166 +        if (!IS_CANO_ADDRESS(msr_content)){
 867.167 +            VMX_DBG_LOG(DBG_LEVEL_1, "Not cano address of msr write\n");
 867.168 +            vmx_inject_exception(vc, TRAP_gp_fault, 0);
 867.169 +        }
 867.170 +        if (regs->ecx == MSR_FS_BASE)
 867.171 +            __vmwrite(GUEST_FS_BASE, msr_content);
 867.172 +        else 
 867.173 +            __vmwrite(GUEST_GS_BASE, msr_content);
 867.174 +        break;
 867.175  
 867.176 -        case MSR_SHADOW_GS_BASE:
 867.177 -           if (!(VMX_LONG_GUEST(vc)))
 867.178 -               domain_crash();
 867.179 -           vc->arch.arch_vmx.msr_content.shadow_gs = msr_content;
 867.180 -           wrmsrl(MSR_SHADOW_GS_BASE, msr_content);
 867.181 -           break;
 867.182 +    case MSR_SHADOW_GS_BASE:
 867.183 +        if (!(VMX_LONG_GUEST(vc)))
 867.184 +            domain_crash();
 867.185 +        vc->arch.arch_vmx.msr_content.shadow_gs = msr_content;
 867.186 +        wrmsrl(MSR_SHADOW_GS_BASE, msr_content);
 867.187 +        break;
 867.188  
 867.189 -           CASE_WRITE_MSR(STAR);
 867.190 -           CASE_WRITE_MSR(LSTAR);
 867.191 -           CASE_WRITE_MSR(CSTAR);
 867.192 -           CASE_WRITE_MSR(SYSCALL_MASK);
 867.193 -        default:
 867.194 -            return 0;
 867.195 +        CASE_WRITE_MSR(STAR);
 867.196 +        CASE_WRITE_MSR(LSTAR);
 867.197 +        CASE_WRITE_MSR(CSTAR);
 867.198 +        CASE_WRITE_MSR(SYSCALL_MASK);
 867.199 +    default:
 867.200 +        return 0;
 867.201      }
 867.202      return 1;
 867.203  }
 867.204 @@ -252,8 +252,8 @@ vmx_restore_msrs(struct vcpu *d)
 867.205          i = find_first_set_bit(guest_flags);
 867.206  
 867.207          VMX_DBG_LOG(DBG_LEVEL_2,
 867.208 -          "restore guest's index %d msr %lx with %lx\n",
 867.209 -          i, (unsigned long) msr_data_index[i], (unsigned long) guest_state->msr_items[i]);
 867.210 +                    "restore guest's index %d msr %lx with %lx\n",
 867.211 +                    i, (unsigned long) msr_data_index[i], (unsigned long) guest_state->msr_items[i]);
 867.212          set_bit(i, &host_state->flags);
 867.213          wrmsrl(msr_data_index[i], guest_state->msr_items[i]);
 867.214          clear_bit(i, &guest_flags);
 867.215 @@ -309,8 +309,8 @@ int start_vmx(void)
 867.216  
 867.217      if (eax & IA32_FEATURE_CONTROL_MSR_LOCK) {
 867.218          if ((eax & IA32_FEATURE_CONTROL_MSR_ENABLE_VMXON) == 0x0) {
 867.219 -                printk("VMX disabled by Feature Control MSR.\n");
 867.220 -                return 0;
 867.221 +            printk("VMX disabled by Feature Control MSR.\n");
 867.222 +            return 0;
 867.223          }
 867.224      }
 867.225      else {
 867.226 @@ -320,16 +320,16 @@ int start_vmx(void)
 867.227      }
 867.228  
 867.229      if (!check_vmx_controls(MONITOR_PIN_BASED_EXEC_CONTROLS, 
 867.230 -            MSR_IA32_VMX_PINBASED_CTLS_MSR))
 867.231 +                            MSR_IA32_VMX_PINBASED_CTLS_MSR))
 867.232          return 0;
 867.233      if (!check_vmx_controls(MONITOR_CPU_BASED_EXEC_CONTROLS, 
 867.234 -            MSR_IA32_VMX_PROCBASED_CTLS_MSR))
 867.235 +                            MSR_IA32_VMX_PROCBASED_CTLS_MSR))
 867.236          return 0;
 867.237      if (!check_vmx_controls(MONITOR_VM_EXIT_CONTROLS, 
 867.238 -            MSR_IA32_VMX_EXIT_CTLS_MSR))
 867.239 +                            MSR_IA32_VMX_EXIT_CTLS_MSR))
 867.240          return 0;
 867.241      if (!check_vmx_controls(MONITOR_VM_ENTRY_CONTROLS, 
 867.242 -            MSR_IA32_VMX_ENTRY_CTLS_MSR))
 867.243 +                            MSR_IA32_VMX_ENTRY_CTLS_MSR))
 867.244          return 0;
 867.245  
 867.246      set_in_cr4(X86_CR4_VMXE);   /* Enable VMXE */
 867.247 @@ -385,8 +385,8 @@ static int vmx_do_page_fault(unsigned lo
 867.248      {
 867.249          __vmread(GUEST_RIP, &eip);
 867.250          VMX_DBG_LOG(DBG_LEVEL_VMMU, 
 867.251 -                "vmx_do_page_fault = 0x%lx, eip = %lx, error_code = %lx",
 867.252 -                va, eip, (unsigned long)regs->error_code);
 867.253 +                    "vmx_do_page_fault = 0x%lx, eip = %lx, error_code = %lx",
 867.254 +                    va, eip, (unsigned long)regs->error_code);
 867.255      }
 867.256  #endif
 867.257  
 867.258 @@ -478,8 +478,8 @@ static void vmx_vmexit_do_cpuid(unsigned
 867.259      regs->edx = (unsigned long) edx;
 867.260  
 867.261      VMX_DBG_LOG(DBG_LEVEL_1, 
 867.262 -            "vmx_vmexit_do_cpuid: eip: %lx, input: %lx, out:eax=%x, ebx=%x, ecx=%x, edx=%x",
 867.263 -            eip, input, eax, ebx, ecx, edx);
 867.264 +                "vmx_vmexit_do_cpuid: eip: %lx, input: %lx, out:eax=%x, ebx=%x, ecx=%x, edx=%x",
 867.265 +                eip, input, eax, ebx, ecx, edx);
 867.266  
 867.267  }
 867.268  
 867.269 @@ -607,7 +607,7 @@ static int check_for_null_selector(unsig
 867.270  }
 867.271  
 867.272  void send_pio_req(struct cpu_user_regs *regs, unsigned long port,
 867.273 -       unsigned long count, int size, long value, int dir, int pvalid)
 867.274 +                  unsigned long count, int size, long value, int dir, int pvalid)
 867.275  {
 867.276      struct vcpu *v = current;
 867.277      vcpu_iodata_t *vio;
 867.278 @@ -620,8 +620,8 @@ void send_pio_req(struct cpu_user_regs *
 867.279      }
 867.280  
 867.281      if (test_bit(ARCH_VMX_IO_WAIT, &v->arch.arch_vmx.flags)) {
 867.282 -       printf("VMX I/O has not yet completed\n");
 867.283 -       domain_crash_synchronous();
 867.284 +        printf("VMX I/O has not yet completed\n");
 867.285 +        domain_crash_synchronous();
 867.286      }
 867.287      set_bit(ARCH_VMX_IO_WAIT, &v->arch.arch_vmx.flags);
 867.288  
 867.289 @@ -656,7 +656,7 @@ void send_pio_req(struct cpu_user_regs *
 867.290  }
 867.291  
 867.292  static void vmx_io_instruction(struct cpu_user_regs *regs, 
 867.293 -                   unsigned long exit_qualification, unsigned long inst_len) 
 867.294 +                               unsigned long exit_qualification, unsigned long inst_len) 
 867.295  {
 867.296      struct mi_per_cpu_info *mpcip;
 867.297      unsigned long eip, cs, eflags;
 867.298 @@ -686,10 +686,10 @@ static void vmx_io_instruction(struct cp
 867.299      dir = test_bit(3, &exit_qualification); /* direction */
 867.300  
 867.301      if (test_bit(4, &exit_qualification)) { /* string instruction */
 867.302 -	unsigned long addr, count = 1;
 867.303 -	int sign = regs->eflags & EF_DF ? -1 : 1;
 867.304 +        unsigned long addr, count = 1;
 867.305 +        int sign = regs->eflags & EF_DF ? -1 : 1;
 867.306  
 867.307 -	__vmread(GUEST_LINEAR_ADDRESS, &addr);
 867.308 +        __vmread(GUEST_LINEAR_ADDRESS, &addr);
 867.309  
 867.310          /*
 867.311           * In protected mode, guest linear address is invalid if the
 867.312 @@ -699,35 +699,35 @@ static void vmx_io_instruction(struct cp
 867.313              addr = dir == IOREQ_WRITE ? regs->esi : regs->edi;
 867.314  
 867.315          if (test_bit(5, &exit_qualification)) { /* "rep" prefix */
 867.316 -	    mpcip->flags |= REPZ;
 867.317 -	    count = vm86 ? regs->ecx & 0xFFFF : regs->ecx;
 867.318 -	}
 867.319 +            mpcip->flags |= REPZ;
 867.320 +            count = vm86 ? regs->ecx & 0xFFFF : regs->ecx;
 867.321 +        }
 867.322  
 867.323 -	/*
 867.324 -	 * Handle string pio instructions that cross pages or that
 867.325 -	 * are unaligned. See the comments in vmx_platform.c/handle_mmio()
 867.326 -	 */
 867.327 -	if ((addr & PAGE_MASK) != ((addr + size - 1) & PAGE_MASK)) {
 867.328 -	    unsigned long value = 0;
 867.329 +        /*
 867.330 +         * Handle string pio instructions that cross pages or that
 867.331 +         * are unaligned. See the comments in vmx_platform.c/handle_mmio()
 867.332 +         */
 867.333 +        if ((addr & PAGE_MASK) != ((addr + size - 1) & PAGE_MASK)) {
 867.334 +            unsigned long value = 0;
 867.335  
 867.336 -	    mpcip->flags |= OVERLAP;
 867.337 -	    if (dir == IOREQ_WRITE)
 867.338 -		vmx_copy(&value, addr, size, VMX_COPY_IN);
 867.339 -	    send_pio_req(regs, port, 1, size, value, dir, 0);
 867.340 -	} else {
 867.341 -	    if ((addr & PAGE_MASK) != ((addr + count * size - 1) & PAGE_MASK)) {
 867.342 +            mpcip->flags |= OVERLAP;
 867.343 +            if (dir == IOREQ_WRITE)
 867.344 +                vmx_copy(&value, addr, size, VMX_COPY_IN);
 867.345 +            send_pio_req(regs, port, 1, size, value, dir, 0);
 867.346 +        } else {
 867.347 +            if ((addr & PAGE_MASK) != ((addr + count * size - 1) & PAGE_MASK)) {
 867.348                  if (sign > 0)
 867.349                      count = (PAGE_SIZE - (addr & ~PAGE_MASK)) / size;
 867.350                  else
 867.351                      count = (addr & ~PAGE_MASK) / size;
 867.352 -	    } else
 867.353 -		__update_guest_eip(inst_len);
 867.354 +            } else
 867.355 +                __update_guest_eip(inst_len);
 867.356  
 867.357 -	    send_pio_req(regs, port, count, size, addr, dir, 1);
 867.358 -	}
 867.359 +            send_pio_req(regs, port, count, size, addr, dir, 1);
 867.360 +        }
 867.361      } else {
 867.362          __update_guest_eip(inst_len);
 867.363 -	send_pio_req(regs, port, 1, size, regs->eax, dir, 0);
 867.364 +        send_pio_req(regs, port, 1, size, regs->eax, dir, 0);
 867.365      }
 867.366  }
 867.367  
 867.368 @@ -739,30 +739,30 @@ vmx_copy(void *buf, unsigned long laddr,
 867.369      int count;
 867.370  
 867.371      while (size > 0) {
 867.372 -	count = PAGE_SIZE - (laddr & ~PAGE_MASK);
 867.373 -	if (count > size)
 867.374 -	    count = size;
 867.375 +        count = PAGE_SIZE - (laddr & ~PAGE_MASK);
 867.376 +        if (count > size)
 867.377 +            count = size;
 867.378  
 867.379 -	if (vmx_paging_enabled(current)) {
 867.380 -		gpa = gva_to_gpa(laddr);
 867.381 -		mfn = get_mfn_from_pfn(gpa >> PAGE_SHIFT);
 867.382 -	} else
 867.383 -		mfn = get_mfn_from_pfn(laddr >> PAGE_SHIFT);
 867.384 -	if (mfn == INVALID_MFN)
 867.385 -		return 0;
 867.386 +        if (vmx_paging_enabled(current)) {
 867.387 +            gpa = gva_to_gpa(laddr);
 867.388 +            mfn = get_mfn_from_pfn(gpa >> PAGE_SHIFT);
 867.389 +        } else
 867.390 +            mfn = get_mfn_from_pfn(laddr >> PAGE_SHIFT);
 867.391 +        if (mfn == INVALID_MFN)
 867.392 +            return 0;
 867.393  
 867.394 -	addr = (char *)map_domain_page(mfn) + (laddr & ~PAGE_MASK);
 867.395 +        addr = (char *)map_domain_page(mfn) + (laddr & ~PAGE_MASK);
 867.396  
 867.397 -	if (dir == VMX_COPY_IN)
 867.398 -	    memcpy(buf, addr, count);
 867.399 -	else
 867.400 -	    memcpy(addr, buf, count);
 867.401 +        if (dir == VMX_COPY_IN)
 867.402 +            memcpy(buf, addr, count);
 867.403 +        else
 867.404 +            memcpy(addr, buf, count);
 867.405  
 867.406 -	unmap_domain_page(addr);
 867.407 +        unmap_domain_page(addr);
 867.408  
 867.409 -	laddr += count;
 867.410 -	buf += count;
 867.411 -	size -= count;
 867.412 +        laddr += count;
 867.413 +        buf += count;
 867.414 +        size -= count;
 867.415      }
 867.416  
 867.417      return 1;
 867.418 @@ -846,47 +846,47 @@ vmx_world_restore(struct vcpu *d, struct
 867.419      error |= __vmwrite(CR0_READ_SHADOW, c->cr0);
 867.420  
 867.421      if (!vmx_paging_enabled(d)) {
 867.422 -	VMX_DBG_LOG(DBG_LEVEL_VMMU, "switching to vmxassist. use phys table");
 867.423 -	__vmwrite(GUEST_CR3, pagetable_get_paddr(d->domain->arch.phys_table));
 867.424 +        VMX_DBG_LOG(DBG_LEVEL_VMMU, "switching to vmxassist. use phys table");
 867.425 +        __vmwrite(GUEST_CR3, pagetable_get_paddr(d->domain->arch.phys_table));
 867.426          goto skip_cr3;
 867.427      }
 867.428  
 867.429      if (c->cr3 == d->arch.arch_vmx.cpu_cr3) {
 867.430 -	/* 
 867.431 -	 * This is simple TLB flush, implying the guest has 
 867.432 -	 * removed some translation or changed page attributes.
 867.433 -	 * We simply invalidate the shadow.
 867.434 -	 */
 867.435 -	mfn = get_mfn_from_pfn(c->cr3 >> PAGE_SHIFT);
 867.436 -	if (mfn != pagetable_get_pfn(d->arch.guest_table)) {
 867.437 -	    printk("Invalid CR3 value=%x", c->cr3);
 867.438 -	    domain_crash_synchronous();
 867.439 -	    return 0;
 867.440 -	}
 867.441 -	shadow_sync_all(d->domain);
 867.442 +        /* 
 867.443 +         * This is simple TLB flush, implying the guest has 
 867.444 +         * removed some translation or changed page attributes.
 867.445 +         * We simply invalidate the shadow.
 867.446 +         */
 867.447 +        mfn = get_mfn_from_pfn(c->cr3 >> PAGE_SHIFT);
 867.448 +        if (mfn != pagetable_get_pfn(d->arch.guest_table)) {
 867.449 +            printk("Invalid CR3 value=%x", c->cr3);
 867.450 +            domain_crash_synchronous();
 867.451 +            return 0;
 867.452 +        }
 867.453 +        shadow_sync_all(d->domain);
 867.454      } else {
 867.455 -	/*
 867.456 -	 * If different, make a shadow. Check if the PDBR is valid
 867.457 -	 * first.
 867.458 -	 */
 867.459 -	VMX_DBG_LOG(DBG_LEVEL_VMMU, "CR3 c->cr3 = %x", c->cr3);
 867.460 -	if ((c->cr3 >> PAGE_SHIFT) > d->domain->max_pages) {
 867.461 -	    printk("Invalid CR3 value=%x", c->cr3);
 867.462 -	    domain_crash_synchronous(); 
 867.463 -	    return 0;
 867.464 -	}
 867.465 -	mfn = get_mfn_from_pfn(c->cr3 >> PAGE_SHIFT);
 867.466 -	d->arch.guest_table = mk_pagetable(mfn << PAGE_SHIFT);
 867.467 -	update_pagetables(d);
 867.468 -	/* 
 867.469 -	 * arch.shadow_table should now hold the next CR3 for shadow
 867.470 -	 */
 867.471 -	d->arch.arch_vmx.cpu_cr3 = c->cr3;
 867.472 -	VMX_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %x", c->cr3);
 867.473 -	__vmwrite(GUEST_CR3, pagetable_get_paddr(d->arch.shadow_table));
 867.474 +        /*
 867.475 +         * If different, make a shadow. Check if the PDBR is valid
 867.476 +         * first.
 867.477 +         */
 867.478 +        VMX_DBG_LOG(DBG_LEVEL_VMMU, "CR3 c->cr3 = %x", c->cr3);
 867.479 +        if ((c->cr3 >> PAGE_SHIFT) > d->domain->max_pages) {
 867.480 +            printk("Invalid CR3 value=%x", c->cr3);
 867.481 +            domain_crash_synchronous(); 
 867.482 +            return 0;
 867.483 +        }
 867.484 +        mfn = get_mfn_from_pfn(c->cr3 >> PAGE_SHIFT);
 867.485 +        d->arch.guest_table = mk_pagetable(mfn << PAGE_SHIFT);
 867.486 +        update_pagetables(d);
 867.487 +        /* 
 867.488 +         * arch.shadow_table should now hold the next CR3 for shadow
 867.489 +         */
 867.490 +        d->arch.arch_vmx.cpu_cr3 = c->cr3;
 867.491 +        VMX_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %x", c->cr3);
 867.492 +        __vmwrite(GUEST_CR3, pagetable_get_paddr(d->arch.shadow_table));
 867.493      }
 867.494  
 867.495 -skip_cr3:
 867.496 + skip_cr3:
 867.497  
 867.498      error |= __vmread(CR4_READ_SHADOW, &old_cr4);
 867.499      error |= __vmwrite(GUEST_CR4, (c->cr4 | VMX_CR4_HOST_MASK));
 867.500 @@ -952,59 +952,59 @@ vmx_assist(struct vcpu *d, int mode)
 867.501  
 867.502      /* make sure vmxassist exists (this is not an error) */
 867.503      if (!vmx_copy(&magic, VMXASSIST_MAGIC_OFFSET, sizeof(magic), VMX_COPY_IN))
 867.504 -    	return 0;
 867.505 +        return 0;
 867.506      if (magic != VMXASSIST_MAGIC)
 867.507 -    	return 0;
 867.508 +        return 0;
 867.509  
 867.510      switch (mode) {
 867.511 -    /*
 867.512 -     * Transfer control to vmxassist.
 867.513 -     * Store the current context in VMXASSIST_OLD_CONTEXT and load
 867.514 -     * the new VMXASSIST_NEW_CONTEXT context. This context was created
 867.515 -     * by vmxassist and will transfer control to it.
 867.516 -     */
 867.517 +        /*
 867.518 +         * Transfer control to vmxassist.
 867.519 +         * Store the current context in VMXASSIST_OLD_CONTEXT and load
 867.520 +         * the new VMXASSIST_NEW_CONTEXT context. This context was created
 867.521 +         * by vmxassist and will transfer control to it.
 867.522 +         */
 867.523      case VMX_ASSIST_INVOKE:
 867.524 -	/* save the old context */
 867.525 -	if (!vmx_copy(&cp, VMXASSIST_OLD_CONTEXT, sizeof(cp), VMX_COPY_IN))
 867.526 -    	    goto error;
 867.527 -	if (cp != 0) {
 867.528 -    	    if (!vmx_world_save(d, &c))
 867.529 -		goto error;
 867.530 -	    if (!vmx_copy(&c, cp, sizeof(c), VMX_COPY_OUT))
 867.531 -		goto error;
 867.532 -	}
 867.533 +        /* save the old context */
 867.534 +        if (!vmx_copy(&cp, VMXASSIST_OLD_CONTEXT, sizeof(cp), VMX_COPY_IN))
 867.535 +            goto error;
 867.536 +        if (cp != 0) {
 867.537 +            if (!vmx_world_save(d, &c))
 867.538 +                goto error;
 867.539 +            if (!vmx_copy(&c, cp, sizeof(c), VMX_COPY_OUT))
 867.540 +                goto error;
 867.541 +        }
 867.542  
 867.543 -	/* restore the new context, this should activate vmxassist */
 867.544 -	if (!vmx_copy(&cp, VMXASSIST_NEW_CONTEXT, sizeof(cp), VMX_COPY_IN))
 867.545 -	    goto error;
 867.546 -	if (cp != 0) {
 867.547 +        /* restore the new context, this should activate vmxassist */
 867.548 +        if (!vmx_copy(&cp, VMXASSIST_NEW_CONTEXT, sizeof(cp), VMX_COPY_IN))
 867.549 +            goto error;
 867.550 +        if (cp != 0) {
 867.551              if (!vmx_copy(&c, cp, sizeof(c), VMX_COPY_IN))
 867.552 -		goto error;
 867.553 -    	    if (!vmx_world_restore(d, &c))
 867.554 -		goto error;
 867.555 -    	    return 1;
 867.556 -	}
 867.557 -	break;
 867.558 +                goto error;
 867.559 +            if (!vmx_world_restore(d, &c))
 867.560 +                goto error;
 867.561 +            return 1;
 867.562 +        }
 867.563 +        break;
 867.564  
 867.565 -    /*
 867.566 -     * Restore the VMXASSIST_OLD_CONTEXT that was saved by VMX_ASSIST_INVOKE
 867.567 -     * above.
 867.568 -     */
 867.569 +        /*
 867.570 +         * Restore the VMXASSIST_OLD_CONTEXT that was saved by VMX_ASSIST_INVOKE
 867.571 +         * above.
 867.572 +         */
 867.573      case VMX_ASSIST_RESTORE:
 867.574 -	/* save the old context */
 867.575 -	if (!vmx_copy(&cp, VMXASSIST_OLD_CONTEXT, sizeof(cp), VMX_COPY_IN))
 867.576 -    	    goto error;
 867.577 -	if (cp != 0) {
 867.578 +        /* save the old context */
 867.579 +        if (!vmx_copy(&cp, VMXASSIST_OLD_CONTEXT, sizeof(cp), VMX_COPY_IN))
 867.580 +            goto error;
 867.581 +        if (cp != 0) {
 867.582              if (!vmx_copy(&c, cp, sizeof(c), VMX_COPY_IN))
 867.583 -		goto error;
 867.584 -    	    if (!vmx_world_restore(d, &c))
 867.585 -		goto error;
 867.586 -	    return 1;
 867.587 -	}
 867.588 -	break;
 867.589 +                goto error;
 867.590 +            if (!vmx_world_restore(d, &c))
 867.591 +                goto error;
 867.592 +            return 1;
 867.593 +        }
 867.594 +        break;
 867.595      }
 867.596  
 867.597 -error:
 867.598 + error:
 867.599      printf("Failed to transfer to vmxassist\n");
 867.600      domain_crash_synchronous(); 
 867.601      return 0;
 867.602 @@ -1031,7 +1031,7 @@ static int vmx_set_cr0(unsigned long val
 867.603           * The guest CR3 must be pointing to the guest physical.
 867.604           */
 867.605          if ( !VALID_MFN(mfn = get_mfn_from_pfn(
 867.606 -                            d->arch.arch_vmx.cpu_cr3 >> PAGE_SHIFT)) ||
 867.607 +            d->arch.arch_vmx.cpu_cr3 >> PAGE_SHIFT)) ||
 867.608               !get_page(pfn_to_page(mfn), d->domain) )
 867.609          {
 867.610              printk("Invalid CR3 value = %lx", d->arch.arch_vmx.cpu_cr3);
 867.611 @@ -1040,18 +1040,18 @@ static int vmx_set_cr0(unsigned long val
 867.612  
 867.613  #if defined(__x86_64__)
 867.614          if (test_bit(VMX_CPU_STATE_LME_ENABLED,
 867.615 -              &d->arch.arch_vmx.cpu_state) &&
 867.616 -          !test_bit(VMX_CPU_STATE_PAE_ENABLED,
 867.617 -              &d->arch.arch_vmx.cpu_state)){
 867.618 +                     &d->arch.arch_vmx.cpu_state) &&
 867.619 +            !test_bit(VMX_CPU_STATE_PAE_ENABLED,
 867.620 +                      &d->arch.arch_vmx.cpu_state)){
 867.621              VMX_DBG_LOG(DBG_LEVEL_1, "Enable paging before PAE enable\n");
 867.622              vmx_inject_exception(d, TRAP_gp_fault, 0);
 867.623          }
 867.624          if (test_bit(VMX_CPU_STATE_LME_ENABLED,
 867.625 -              &d->arch.arch_vmx.cpu_state)){
 867.626 +                     &d->arch.arch_vmx.cpu_state)){
 867.627              /* Here the PAE is should to be opened */
 867.628              VMX_DBG_LOG(DBG_LEVEL_1, "Enable the Long mode\n");
 867.629              set_bit(VMX_CPU_STATE_LMA_ENABLED,
 867.630 -              &d->arch.arch_vmx.cpu_state);
 867.631 +                    &d->arch.arch_vmx.cpu_state);
 867.632              __vmread(VM_ENTRY_CONTROLS, &vm_entry_value);
 867.633              vm_entry_value |= VM_ENTRY_CONTROLS_IA32E_MODE;
 867.634              __vmwrite(VM_ENTRY_CONTROLS, vm_entry_value);
 867.635 @@ -1073,20 +1073,15 @@ static int vmx_set_cr0(unsigned long val
 867.636  #endif
 867.637          }
 867.638  
 867.639 -	unsigned long crn;
 867.640 +        unsigned long crn;
 867.641          /* update CR4's PAE if needed */
 867.642          __vmread(GUEST_CR4, &crn);
 867.643          if ( (!(crn & X86_CR4_PAE)) &&
 867.644 -          test_bit(VMX_CPU_STATE_PAE_ENABLED,
 867.645 -              &d->arch.arch_vmx.cpu_state)){
 867.646 +             test_bit(VMX_CPU_STATE_PAE_ENABLED,
 867.647 +                      &d->arch.arch_vmx.cpu_state)){
 867.648              VMX_DBG_LOG(DBG_LEVEL_1, "enable PAE on cr4\n");
 867.649              __vmwrite(GUEST_CR4, crn | X86_CR4_PAE);
 867.650          }
 867.651 -#elif defined( __i386__)
 867.652 -       	unsigned long old_base_mfn;
 867.653 -        old_base_mfn = pagetable_get_pfn(d->arch.guest_table);
 867.654 -        if (old_base_mfn)
 867.655 -            put_page(pfn_to_page(old_base_mfn));
 867.656  #endif
 867.657          /*
 867.658           * Now arch.guest_table points to machine physical.
 867.659 @@ -1095,14 +1090,14 @@ static int vmx_set_cr0(unsigned long val
 867.660          update_pagetables(d);
 867.661  
 867.662          VMX_DBG_LOG(DBG_LEVEL_VMMU, "New arch.guest_table = %lx", 
 867.663 -                (unsigned long) (mfn << PAGE_SHIFT));
 867.664 +                    (unsigned long) (mfn << PAGE_SHIFT));
 867.665  
 867.666          __vmwrite(GUEST_CR3, pagetable_get_paddr(d->arch.shadow_table));
 867.667          /* 
 867.668           * arch->shadow_table should hold the next CR3 for shadow
 867.669           */
 867.670          VMX_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %lx, mfn = %lx", 
 867.671 -                d->arch.arch_vmx.cpu_cr3, mfn);
 867.672 +                    d->arch.arch_vmx.cpu_cr3, mfn);
 867.673      }
 867.674  
 867.675      /*
 867.676 @@ -1129,29 +1124,29 @@ static int vmx_set_cr0(unsigned long val
 867.677                  __vmwrite(VM_ENTRY_CONTROLS, vm_entry_value);
 867.678              }
 867.679          }
 867.680 -	__vmread(GUEST_RIP, &eip);
 867.681 -	VMX_DBG_LOG(DBG_LEVEL_1,
 867.682 -	    "Disabling CR0.PE at %%eip 0x%lx\n", eip);
 867.683 -	if (vmx_assist(d, VMX_ASSIST_INVOKE)) {
 867.684 -	    set_bit(VMX_CPU_STATE_ASSIST_ENABLED, &d->arch.arch_vmx.cpu_state);
 867.685 -	    __vmread(GUEST_RIP, &eip);
 867.686 -	    VMX_DBG_LOG(DBG_LEVEL_1,
 867.687 -		"Transfering control to vmxassist %%eip 0x%lx\n", eip);
 867.688 -	    return 0; /* do not update eip! */
 867.689 -	}
 867.690 +        __vmread(GUEST_RIP, &eip);
 867.691 +        VMX_DBG_LOG(DBG_LEVEL_1,
 867.692 +                    "Disabling CR0.PE at %%eip 0x%lx\n", eip);
 867.693 +        if (vmx_assist(d, VMX_ASSIST_INVOKE)) {
 867.694 +            set_bit(VMX_CPU_STATE_ASSIST_ENABLED, &d->arch.arch_vmx.cpu_state);
 867.695 +            __vmread(GUEST_RIP, &eip);
 867.696 +            VMX_DBG_LOG(DBG_LEVEL_1,
 867.697 +                        "Transfering control to vmxassist %%eip 0x%lx\n", eip);
 867.698 +            return 0; /* do not update eip! */
 867.699 +        }
 867.700      } else if (test_bit(VMX_CPU_STATE_ASSIST_ENABLED,
 867.701 -					&d->arch.arch_vmx.cpu_state)) {
 867.702 -	__vmread(GUEST_RIP, &eip);
 867.703 -	VMX_DBG_LOG(DBG_LEVEL_1,
 867.704 -	    "Enabling CR0.PE at %%eip 0x%lx\n", eip);
 867.705 -	if (vmx_assist(d, VMX_ASSIST_RESTORE)) {
 867.706 -	    clear_bit(VMX_CPU_STATE_ASSIST_ENABLED,
 867.707 -					&d->arch.arch_vmx.cpu_state);
 867.708 -	    __vmread(GUEST_RIP, &eip);
 867.709 -	    VMX_DBG_LOG(DBG_LEVEL_1,
 867.710 -		"Restoring to %%eip 0x%lx\n", eip);
 867.711 -	    return 0; /* do not update eip! */
 867.712 -	}
 867.713 +                        &d->arch.arch_vmx.cpu_state)) {
 867.714 +        __vmread(GUEST_RIP, &eip);
 867.715 +        VMX_DBG_LOG(DBG_LEVEL_1,
 867.716 +                    "Enabling CR0.PE at %%eip 0x%lx\n", eip);
 867.717 +        if (vmx_assist(d, VMX_ASSIST_RESTORE)) {
 867.718 +            clear_bit(VMX_CPU_STATE_ASSIST_ENABLED,
 867.719 +                      &d->arch.arch_vmx.cpu_state);
 867.720 +            __vmread(GUEST_RIP, &eip);
 867.721 +            VMX_DBG_LOG(DBG_LEVEL_1,
 867.722 +                        "Restoring to %%eip 0x%lx\n", eip);
 867.723 +            return 0; /* do not update eip! */
 867.724 +        }
 867.725      }
 867.726  
 867.727      return 1;
 867.728 @@ -1198,8 +1193,8 @@ static int mov_to_cr(int gp, int cr, str
 867.729          CASE_GET_REG(ESI, esi);
 867.730          CASE_GET_REG(EDI, edi);
 867.731          CASE_EXTEND_GET_REG
 867.732 -    case REG_ESP:
 867.733 -        __vmread(GUEST_RSP, &value);
 867.734 +            case REG_ESP:
 867.735 +                __vmread(GUEST_RSP, &value);
 867.736          break;
 867.737      default:
 867.738          printk("invalid gp: %d\n", gp);
 867.739 @@ -1212,7 +1207,7 @@ static int mov_to_cr(int gp, int cr, str
 867.740      switch(cr) {
 867.741      case 0: 
 867.742      {
 867.743 -	return vmx_set_cr0(value);
 867.744 +        return vmx_set_cr0(value);
 867.745      }
 867.746      case 3: 
 867.747      {
 867.748 @@ -1262,7 +1257,7 @@ static int mov_to_cr(int gp, int cr, str
 867.749               */
 867.750              d->arch.arch_vmx.cpu_cr3 = value;
 867.751              VMX_DBG_LOG(DBG_LEVEL_VMMU, "Update CR3 value = %lx",
 867.752 -                    value);
 867.753 +                        value);
 867.754              __vmwrite(GUEST_CR3, pagetable_get_paddr(d->arch.shadow_table));
 867.755          }
 867.756          break;
 867.757 @@ -1332,8 +1327,8 @@ static void mov_from_cr(int cr, int gp, 
 867.758          CASE_SET_REG(ESI, esi);
 867.759          CASE_SET_REG(EDI, edi);
 867.760          CASE_EXTEND_SET_REG
 867.761 -    case REG_ESP:
 867.762 -        __vmwrite(GUEST_RSP, value);
 867.763 +            case REG_ESP:
 867.764 +                __vmwrite(GUEST_RSP, value);
 867.765          regs->esp = value;
 867.766          break;
 867.767      default:
 867.768 @@ -1381,9 +1376,9 @@ static int vmx_cr_access(unsigned long e
 867.769      case TYPE_LMSW:
 867.770          TRACE_VMEXIT(1,TYPE_LMSW);
 867.771          __vmread(CR0_READ_SHADOW, &value);
 867.772 -	value = (value & ~0xF) |
 867.773 -		(((exit_qualification & LMSW_SOURCE_DATA) >> 16) & 0xF);
 867.774 -	return vmx_set_cr0(value);
 867.775 +        value = (value & ~0xF) |
 867.776 +            (((exit_qualification & LMSW_SOURCE_DATA) >> 16) & 0xF);
 867.777 +        return vmx_set_cr0(value);
 867.778          break;
 867.779      default:
 867.780          __vmx_bug(regs);
 867.781 @@ -1394,29 +1389,31 @@ static int vmx_cr_access(unsigned long e
 867.782  
 867.783  static inline void vmx_do_msr_read(struct cpu_user_regs *regs)
 867.784  {
 867.785 +    u64 msr_content = 0;
 867.786 +
 867.787      VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_read: ecx=%lx, eax=%lx, edx=%lx",
 867.788                  (unsigned long)regs->ecx, (unsigned long)regs->eax, 
 867.789                  (unsigned long)regs->edx);
 867.790      switch (regs->ecx) {
 867.791 -        case MSR_IA32_SYSENTER_CS:
 867.792 -            __vmread(GUEST_SYSENTER_CS, &regs->eax);
 867.793 -            regs->edx = 0;
 867.794 -            break;
 867.795 -        case MSR_IA32_SYSENTER_ESP:	
 867.796 -             __vmread(GUEST_SYSENTER_ESP, &regs->eax);
 867.797 -             regs->edx = 0;
 867.798 -            break;
 867.799 -        case MSR_IA32_SYSENTER_EIP:		
 867.800 -            __vmread(GUEST_SYSENTER_EIP, &regs->eax);
 867.801 -            regs->edx = 0;
 867.802 -            break;
 867.803 -        default:
 867.804 -            if(long_mode_do_msr_read(regs))
 867.805 -                return;
 867.806 -            rdmsr_user(regs->ecx, regs->eax, regs->edx);
 867.807 -            break;
 867.808 +    case MSR_IA32_SYSENTER_CS:
 867.809 +        __vmread(GUEST_SYSENTER_CS, (u32 *)&msr_content);
 867.810 +        break;
 867.811 +    case MSR_IA32_SYSENTER_ESP:
 867.812 +        __vmread(GUEST_SYSENTER_ESP, &msr_content);
 867.813 +        break;
 867.814 +    case MSR_IA32_SYSENTER_EIP:
 867.815 +        __vmread(GUEST_SYSENTER_EIP, &msr_content);
 867.816 +        break;
 867.817 +    default:
 867.818 +        if(long_mode_do_msr_read(regs))
 867.819 +            return;
 867.820 +        rdmsr_user(regs->ecx, regs->eax, regs->edx);
 867.821 +        break;
 867.822      }
 867.823  
 867.824 +    regs->eax = msr_content & 0xFFFFFFFF;
 867.825 +    regs->edx = msr_content >> 32;
 867.826 +
 867.827      VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_read returns: "
 867.828                  "ecx=%lx, eax=%lx, edx=%lx",
 867.829                  (unsigned long)regs->ecx, (unsigned long)regs->eax,
 867.830 @@ -1425,22 +1422,27 @@ static inline void vmx_do_msr_read(struc
 867.831  
 867.832  static inline void vmx_do_msr_write(struct cpu_user_regs *regs)
 867.833  {
 867.834 +    u64 msr_content;
 867.835 +
 867.836      VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_write: ecx=%lx, eax=%lx, edx=%lx",
 867.837                  (unsigned long)regs->ecx, (unsigned long)regs->eax, 
 867.838                  (unsigned long)regs->edx);
 867.839 +
 867.840 +    msr_content = (regs->eax & 0xFFFFFFFF) | ((u64)regs->edx << 32);
 867.841 +
 867.842      switch (regs->ecx) {
 867.843 -        case MSR_IA32_SYSENTER_CS:
 867.844 -            __vmwrite(GUEST_SYSENTER_CS, regs->eax);
 867.845 -            break;
 867.846 -        case MSR_IA32_SYSENTER_ESP:	
 867.847 -             __vmwrite(GUEST_SYSENTER_ESP, regs->eax);
 867.848 -            break;
 867.849 -        case MSR_IA32_SYSENTER_EIP:		
 867.850 -            __vmwrite(GUEST_SYSENTER_EIP, regs->eax);
 867.851 -            break;
 867.852 -        default:
 867.853 -            long_mode_do_msr_write(regs);
 867.854 -            break;
 867.855 +    case MSR_IA32_SYSENTER_CS:
 867.856 +        __vmwrite(GUEST_SYSENTER_CS, msr_content);
 867.857 +        break;
 867.858 +    case MSR_IA32_SYSENTER_ESP:
 867.859 +        __vmwrite(GUEST_SYSENTER_ESP, msr_content);
 867.860 +        break;
 867.861 +    case MSR_IA32_SYSENTER_EIP:
 867.862 +        __vmwrite(GUEST_SYSENTER_EIP, msr_content);
 867.863 +        break;
 867.864 +    default:
 867.865 +        long_mode_do_msr_write(regs);
 867.866 +        break;
 867.867      }
 867.868  
 867.869      VMX_DBG_LOG(DBG_LEVEL_1, "vmx_do_msr_write returns: "
 867.870 @@ -1484,28 +1486,28 @@ static inline void vmx_vmexit_do_extint(
 867.871      local_irq_disable();
 867.872  
 867.873      switch(vector) {
 867.874 -        case LOCAL_TIMER_VECTOR:
 867.875 -            smp_apic_timer_interrupt(regs);
 867.876 -            break;
 867.877 -        case EVENT_CHECK_VECTOR:
 867.878 -            smp_event_check_interrupt();
 867.879 -            break;
 867.880 -        case INVALIDATE_TLB_VECTOR:
 867.881 -            smp_invalidate_interrupt();
 867.882 -            break;
 867.883 -        case CALL_FUNCTION_VECTOR:
 867.884 -            smp_call_function_interrupt();
 867.885 -            break;
 867.886 -        case SPURIOUS_APIC_VECTOR:
 867.887 -            smp_spurious_interrupt(regs);
 867.888 -            break;
 867.889 -        case ERROR_APIC_VECTOR:
 867.890 -            smp_error_interrupt(regs);
 867.891 -            break;
 867.892 -        default:
 867.893 -            regs->entry_vector = vector;
 867.894 -            do_IRQ(regs);
 867.895 -            break;
 867.896 +    case LOCAL_TIMER_VECTOR:
 867.897 +        smp_apic_timer_interrupt(regs);
 867.898 +        break;
 867.899 +    case EVENT_CHECK_VECTOR:
 867.900 +        smp_event_check_interrupt();
 867.901 +        break;
 867.902 +    case INVALIDATE_TLB_VECTOR:
 867.903 +        smp_invalidate_interrupt();
 867.904 +        break;
 867.905 +    case CALL_FUNCTION_VECTOR:
 867.906 +        smp_call_function_interrupt();
 867.907 +        break;
 867.908 +    case SPURIOUS_APIC_VECTOR:
 867.909 +        smp_spurious_interrupt(regs);
 867.910 +        break;
 867.911 +    case ERROR_APIC_VECTOR:
 867.912 +        smp_error_interrupt(regs);
 867.913 +        break;
 867.914 +    default:
 867.915 +        regs->entry_vector = vector;
 867.916 +        do_IRQ(regs);
 867.917 +        break;
 867.918      }
 867.919  }
 867.920  
 867.921 @@ -1597,17 +1599,17 @@ asmlinkage void vmx_vmexit_handler(struc
 867.922  
 867.923      __vmread(IDT_VECTORING_INFO_FIELD, &idtv_info_field);
 867.924      if (idtv_info_field & INTR_INFO_VALID_MASK) {
 867.925 -	__vmwrite(VM_ENTRY_INTR_INFO_FIELD, idtv_info_field);
 867.926 +        __vmwrite(VM_ENTRY_INTR_INFO_FIELD, idtv_info_field);
 867.927  
 867.928 -	__vmread(VM_EXIT_INSTRUCTION_LEN, &inst_len);
 867.929 -	if (inst_len >= 1 && inst_len <= 15) 
 867.930 -	    __vmwrite(VM_ENTRY_INSTRUCTION_LEN, inst_len);
 867.931 +        __vmread(VM_EXIT_INSTRUCTION_LEN, &inst_len);
 867.932 +        if (inst_len >= 1 && inst_len <= 15) 
 867.933 +            __vmwrite(VM_ENTRY_INSTRUCTION_LEN, inst_len);
 867.934  
 867.935 -	if (idtv_info_field & 0x800) { /* valid error code */
 867.936 -	    unsigned long error_code;
 867.937 -	    __vmread(IDT_VECTORING_ERROR_CODE, &error_code);
 867.938 -	    __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code);
 867.939 -	} 
 867.940 +        if (idtv_info_field & 0x800) { /* valid error code */
 867.941 +            unsigned long error_code;
 867.942 +            __vmread(IDT_VECTORING_ERROR_CODE, &error_code);
 867.943 +            __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code);
 867.944 +        } 
 867.945  
 867.946          VMX_DBG_LOG(DBG_LEVEL_1, "idtv_info_field=%x", idtv_info_field);
 867.947      }
 867.948 @@ -1645,7 +1647,7 @@ asmlinkage void vmx_vmexit_handler(struc
 867.949              __vmx_bug(&regs);
 867.950          vector &= 0xff;
 867.951  
 867.952 -	 TRACE_VMEXIT(1,vector);
 867.953 +        TRACE_VMEXIT(1,vector);
 867.954          perfc_incra(cause_vector, vector);
 867.955  
 867.956          TRACE_3D(TRC_VMX_VECTOR, v->domain->domain_id, eip, vector);
 867.957 @@ -1691,8 +1693,8 @@ asmlinkage void vmx_vmexit_handler(struc
 867.958              __vmread(EXIT_QUALIFICATION, &va);
 867.959              __vmread(VM_EXIT_INTR_ERROR_CODE, &regs.error_code);
 867.960              
 867.961 -	    TRACE_VMEXIT(3,regs.error_code);
 867.962 -	    TRACE_VMEXIT(4,va);
 867.963 +            TRACE_VMEXIT(3,regs.error_code);
 867.964 +            TRACE_VMEXIT(4,va);
 867.965  
 867.966              VMX_DBG_LOG(DBG_LEVEL_VMMU, 
 867.967                          "eax=%lx, ebx=%lx, ecx=%lx, edx=%lx, esi=%lx, edi=%lx",
 867.968 @@ -1725,7 +1727,7 @@ asmlinkage void vmx_vmexit_handler(struc
 867.969          break;
 867.970      case EXIT_REASON_PENDING_INTERRUPT:
 867.971          __vmwrite(CPU_BASED_VM_EXEC_CONTROL, 
 867.972 -              MONITOR_CPU_BASED_EXEC_CONTROLS);
 867.973 +                  MONITOR_CPU_BASED_EXEC_CONTROLS);
 867.974          break;
 867.975      case EXIT_REASON_TASK_SWITCH:
 867.976          __vmx_bug(&regs);
 867.977 @@ -1765,10 +1767,10 @@ asmlinkage void vmx_vmexit_handler(struc
 867.978          __vmread(EXIT_QUALIFICATION, &exit_qualification);
 867.979  
 867.980          VMX_DBG_LOG(DBG_LEVEL_1, "eip = %lx, inst_len =%lx, exit_qualification = %lx", 
 867.981 -                eip, inst_len, exit_qualification);
 867.982 +                    eip, inst_len, exit_qualification);
 867.983          if (vmx_cr_access(exit_qualification, &regs))
 867.984 -	    __update_guest_eip(inst_len);
 867.985 -	 TRACE_VMEXIT(3,regs.error_code);
 867.986 +            __update_guest_eip(inst_len);
 867.987 +        TRACE_VMEXIT(3,regs.error_code);
 867.988          TRACE_VMEXIT(4,exit_qualification);
 867.989          break;
 867.990      }
 867.991 @@ -1821,8 +1823,8 @@ asmlinkage void load_cr2(void)
 867.992  asmlinkage void trace_vmentry (void)
 867.993  {
 867.994      TRACE_5D(TRC_VMENTRY,trace_values[current->processor][0],
 867.995 -          trace_values[current->processor][1],trace_values[current->processor][2],
 867.996 -          trace_values[current->processor][3],trace_values[current->processor][4]);
 867.997 +             trace_values[current->processor][1],trace_values[current->processor][2],
 867.998 +             trace_values[current->processor][3],trace_values[current->processor][4]);
 867.999      TRACE_VMEXIT(0,9);
867.1000      TRACE_VMEXIT(1,9);
867.1001      TRACE_VMEXIT(2,9);
   868.1 --- a/xen/arch/x86/vmx_intercept.c	Fri Sep 09 10:31:36 2005 -0600
   868.2 +++ b/xen/arch/x86/vmx_intercept.c	Tue Sep 13 10:14:16 2005 -0600
   868.3 @@ -45,8 +45,8 @@ int vmx_io_intercept(ioreq_t *p, int typ
   868.4          addr   = handler->hdl_list[i].addr;
   868.5          offset = handler->hdl_list[i].offset;
   868.6          if (p->addr >= addr &&
   868.7 -	    p->addr <  addr + offset)
   868.8 -	    return handler->hdl_list[i].action(p);
   868.9 +            p->addr <  addr + offset)
  868.10 +            return handler->hdl_list[i].action(p);
  868.11      }
  868.12      return 0;
  868.13  }
  868.14 @@ -172,22 +172,22 @@ int intercept_pit_io(ioreq_t *p)
  868.15  
  868.16      if (p->size != 1 ||
  868.17          p->pdata_valid ||
  868.18 -	p->type != IOREQ_TYPE_PIO)
  868.19 +        p->type != IOREQ_TYPE_PIO)
  868.20          return 0;
  868.21      
  868.22      if (p->addr == PIT_MODE &&
  868.23 -	p->dir == 0 &&				/* write */
  868.24 -        ((p->u.data >> 4) & 0x3) == 0 &&	/* latch command */
  868.25 +        p->dir == 0 &&    /* write */
  868.26 +        ((p->u.data >> 4) & 0x3) == 0 && /* latch command */
  868.27          ((p->u.data >> 6) & 0x3) == (vpit->channel)) {/* right channel */
  868.28          pit_latch_io(vpit);
  868.29 -	return 1;
  868.30 +        return 1;
  868.31      }
  868.32  
  868.33      if (p->addr == (PIT_CH0 + vpit->channel) &&
  868.34 -	p->dir == 1) {	/* read */
  868.35 +        p->dir == 1) { /* read */
  868.36          p->u.data = pit_read_io(vpit);
  868.37          resume_pit_io(p);
  868.38 -	return 1;
  868.39 +        return 1;
  868.40      }
  868.41  
  868.42      return 0;
  868.43 @@ -253,8 +253,8 @@ void vmx_hooks_assist(struct vcpu *d)
  868.44          vpit->channel = ((p->u.data >> 24) & 0x3);
  868.45          vpit->first_injected = 0;
  868.46  
  868.47 -	vpit->count_LSB_latched = 0;
  868.48 -	vpit->count_MSB_latched = 0;
  868.49 +        vpit->count_LSB_latched = 0;
  868.50 +        vpit->count_MSB_latched = 0;
  868.51  
  868.52          rw_mode = ((p->u.data >> 26) & 0x3);
  868.53          switch(rw_mode) {
  868.54 @@ -280,9 +280,19 @@ void vmx_hooks_assist(struct vcpu *d)
  868.55          /*restore the state*/
  868.56          p->state = STATE_IORESP_READY;
  868.57  
  868.58 -	/* register handler to intercept the PIT io when vm_exit */
  868.59 +        /* register handler to intercept the PIT io when vm_exit */
  868.60          if (!reinit)
  868.61 -	    register_portio_handler(0x40, 4, intercept_pit_io); 
  868.62 +            register_portio_handler(0x40, 4, intercept_pit_io); 
  868.63      }
  868.64  }
  868.65  #endif /* CONFIG_VMX */
  868.66 +
  868.67 +/*
  868.68 + * Local variables:
  868.69 + * mode: C
  868.70 + * c-set-style: "BSD"
  868.71 + * c-basic-offset: 4
  868.72 + * tab-width: 4
  868.73 + * indent-tabs-mode: nil
  868.74 + * End:
  868.75 + */
   869.1 --- a/xen/arch/x86/vmx_io.c	Fri Sep 09 10:31:36 2005 -0600
   869.2 +++ b/xen/arch/x86/vmx_io.c	Tue Sep 13 10:14:16 2005 -0600
   869.3 @@ -16,6 +16,7 @@
   869.4   * Place - Suite 330, Boston, MA 02111-1307 USA.
   869.5   *
   869.6   */
   869.7 +
   869.8  #include <xen/config.h>
   869.9  #include <xen/init.h>
  869.10  #include <xen/mm.h>
  869.11 @@ -99,7 +100,6 @@ static void set_reg_value (int size, int
  869.12              printk("Error: size:%x, index:%x are invalid!\n", size, index);
  869.13              domain_crash_synchronous();
  869.14              break;
  869.15 -
  869.16          }
  869.17          break;
  869.18      case WORD:
  869.19 @@ -199,24 +199,24 @@ void load_cpu_user_regs(struct cpu_user_
  869.20  static inline void __set_reg_value(unsigned long *reg, int size, long value)
  869.21  {
  869.22      switch (size) {
  869.23 -        case BYTE_64:
  869.24 -            *reg &= ~0xFF;
  869.25 -            *reg |= (value & 0xFF);
  869.26 -            break;
  869.27 -        case WORD:
  869.28 -            *reg &= ~0xFFFF;
  869.29 -            *reg |= (value & 0xFFFF);
  869.30 -            break;
  869.31 -        case LONG:
  869.32 -            *reg &= ~0xFFFFFFFF;
  869.33 -            *reg |= (value & 0xFFFFFFFF);
  869.34 -            break;
  869.35 -        case QUAD:
  869.36 -            *reg = value;
  869.37 -            break;
  869.38 -        default:
  869.39 -            printk("Error: <__set_reg_value> : Unknown size for register\n");
  869.40 -            domain_crash_synchronous();
  869.41 +    case BYTE_64:
  869.42 +        *reg &= ~0xFF;
  869.43 +        *reg |= (value & 0xFF);
  869.44 +        break;
  869.45 +    case WORD:
  869.46 +        *reg &= ~0xFFFF;
  869.47 +        *reg |= (value & 0xFFFF);
  869.48 +        break;
  869.49 +    case LONG:
  869.50 +        *reg &= ~0xFFFFFFFF;
  869.51 +        *reg |= (value & 0xFFFFFFFF);
  869.52 +        break;
  869.53 +    case QUAD:
  869.54 +        *reg = value;
  869.55 +        break;
  869.56 +    default:
  869.57 +        printk("Error: <__set_reg_value>: size:%x is invalid\n", size);
  869.58 +        domain_crash_synchronous();
  869.59      }
  869.60  }
  869.61  
  869.62 @@ -224,98 +224,98 @@ static void set_reg_value (int size, int
  869.63  {
  869.64      if (size == BYTE) {
  869.65          switch (index) {
  869.66 -            case 0:
  869.67 -                regs->rax &= ~0xFF;
  869.68 -                regs->rax |= (value & 0xFF);
  869.69 -                break;
  869.70 -            case 1:
  869.71 -                regs->rcx &= ~0xFF;
  869.72 -                regs->rcx |= (value & 0xFF);
  869.73 -                break;
  869.74 -            case 2:
  869.75 -                regs->rdx &= ~0xFF;
  869.76 -                regs->rdx |= (value & 0xFF);
  869.77 -                break;
  869.78 -            case 3:
  869.79 -                regs->rbx &= ~0xFF;
  869.80 -                regs->rbx |= (value & 0xFF);
  869.81 -                break;
  869.82 -            case 4:
  869.83 -                regs->rax &= 0xFFFFFFFFFFFF00FF;
  869.84 -                regs->rax |= ((value & 0xFF) << 8);
  869.85 -                break;
  869.86 -            case 5:
  869.87 -                regs->rcx &= 0xFFFFFFFFFFFF00FF;
  869.88 -                regs->rcx |= ((value & 0xFF) << 8);
  869.89 -                break;
  869.90 -            case 6:
  869.91 -                regs->rdx &= 0xFFFFFFFFFFFF00FF;
  869.92 -                regs->rdx |= ((value & 0xFF) << 8);
  869.93 -                break;
  869.94 -            case 7:
  869.95 -                regs->rbx &= 0xFFFFFFFFFFFF00FF;
  869.96 -                regs->rbx |= ((value & 0xFF) << 8);
  869.97 -                break;
  869.98 -            default:
  869.99 -                printk("Error: size:%x, index:%x are invalid!\n", size, index);
 869.100 -                domain_crash_synchronous();
 869.101 -                break;
 869.102 +        case 0:
 869.103 +            regs->rax &= ~0xFF;
 869.104 +            regs->rax |= (value & 0xFF);
 869.105 +            break;
 869.106 +        case 1:
 869.107 +            regs->rcx &= ~0xFF;
 869.108 +            regs->rcx |= (value & 0xFF);
 869.109 +            break;
 869.110 +        case 2:
 869.111 +            regs->rdx &= ~0xFF;
 869.112 +            regs->rdx |= (value & 0xFF);
 869.113 +            break;
 869.114 +        case 3:
 869.115 +            regs->rbx &= ~0xFF;
 869.116 +            regs->rbx |= (value & 0xFF);
 869.117 +            break;
 869.118 +        case 4:
 869.119 +            regs->rax &= 0xFFFFFFFFFFFF00FF;
 869.120 +            regs->rax |= ((value & 0xFF) << 8);
 869.121 +            break;
 869.122 +        case 5:
 869.123 +            regs->rcx &= 0xFFFFFFFFFFFF00FF;
 869.124 +            regs->rcx |= ((value & 0xFF) << 8);
 869.125 +            break;
 869.126 +        case 6:
 869.127 +            regs->rdx &= 0xFFFFFFFFFFFF00FF;
 869.128 +            regs->rdx |= ((value & 0xFF) << 8);
 869.129 +            break;
 869.130 +        case 7:
 869.131 +            regs->rbx &= 0xFFFFFFFFFFFF00FF;
 869.132 +            regs->rbx |= ((value & 0xFF) << 8);
 869.133 +            break;
 869.134 +        default:
 869.135 +            printk("Error: size:%x, index:%x are invalid!\n", size, index);
 869.136 +            domain_crash_synchronous();
 869.137 +            break;
 869.138          }
 869.139 -
 869.140 +        return;
 869.141      }
 869.142  
 869.143      switch (index) {
 869.144 -        case 0: 
 869.145 -            __set_reg_value(&regs->rax, size, value);
 869.146 -            break;
 869.147 -        case 1: 
 869.148 -            __set_reg_value(&regs->rcx, size, value);
 869.149 -            break;
 869.150 -        case 2: 
 869.151 -            __set_reg_value(&regs->rdx, size, value);
 869.152 -            break;
 869.153 -        case 3: 
 869.154 -            __set_reg_value(&regs->rbx, size, value);
 869.155 -            break;
 869.156 -        case 4: 
 869.157 -            __set_reg_value(&regs->rsp, size, value);
 869.158 -            break;
 869.159 -        case 5: 
 869.160 -            __set_reg_value(&regs->rbp, size, value);
 869.161 -            break;
 869.162 -        case 6: 
 869.163 -            __set_reg_value(&regs->rsi, size, value);
 869.164 -            break;
 869.165 -        case 7: 
 869.166 -            __set_reg_value(&regs->rdi, size, value);
 869.167 -            break;
 869.168 -        case 8: 
 869.169 -            __set_reg_value(&regs->r8, size, value);
 869.170 -            break;
 869.171 -        case 9: 
 869.172 -            __set_reg_value(&regs->r9, size, value);
 869.173 -            break;
 869.174 -        case 10: 
 869.175 -            __set_reg_value(&regs->r10, size, value);
 869.176 -            break;
 869.177 -        case 11: 
 869.178 -            __set_reg_value(&regs->r11, size, value);
 869.179 -            break;
 869.180 -        case 12: 
 869.181 -            __set_reg_value(&regs->r12, size, value);
 869.182 -            break;
 869.183 -        case 13: 
 869.184 -            __set_reg_value(&regs->r13, size, value);
 869.185 -            break;
 869.186 -        case 14: 
 869.187 -            __set_reg_value(&regs->r14, size, value);
 869.188 -            break;
 869.189 -        case 15: 
 869.190 -            __set_reg_value(&regs->r15, size, value);
 869.191 -            break;
 869.192 -        default:
 869.193 -            printk("Error: <set_reg_value> Invalid index\n");
 869.194 -            domain_crash_synchronous();
 869.195 +    case 0: 
 869.196 +        __set_reg_value(&regs->rax, size, value);
 869.197 +        break;
 869.198 +    case 1: 
 869.199 +        __set_reg_value(&regs->rcx, size, value);
 869.200 +        break;
 869.201 +    case 2: 
 869.202 +        __set_reg_value(&regs->rdx, size, value);
 869.203 +        break;
 869.204 +    case 3: 
 869.205 +        __set_reg_value(&regs->rbx, size, value);
 869.206 +        break;
 869.207 +    case 4: 
 869.208 +        __set_reg_value(&regs->rsp, size, value);
 869.209 +        break;
 869.210 +    case 5: 
 869.211 +        __set_reg_value(&regs->rbp, size, value);
 869.212 +        break;
 869.213 +    case 6: 
 869.214 +        __set_reg_value(&regs->rsi, size, value);
 869.215 +        break;
 869.216 +    case 7: 
 869.217 +        __set_reg_value(&regs->rdi, size, value);
 869.218 +        break;
 869.219 +    case 8: 
 869.220 +        __set_reg_value(&regs->r8, size, value);
 869.221 +        break;
 869.222 +    case 9: 
 869.223 +        __set_reg_value(&regs->r9, size, value);
 869.224 +        break;
 869.225 +    case 10: 
 869.226 +        __set_reg_value(&regs->r10, size, value);
 869.227 +        break;
 869.228 +    case 11: 
 869.229 +        __set_reg_value(&regs->r11, size, value);
 869.230 +        break;
 869.231 +    case 12: 
 869.232 +        __set_reg_value(&regs->r12, size, value);
 869.233 +        break;
 869.234 +    case 13: 
 869.235 +        __set_reg_value(&regs->r13, size, value);
 869.236 +        break;
 869.237 +    case 14: 
 869.238 +        __set_reg_value(&regs->r14, size, value);
 869.239 +        break;
 869.240 +    case 15: 
 869.241 +        __set_reg_value(&regs->r15, size, value);
 869.242 +        break;
 869.243 +    default:
 869.244 +        printk("Error: <set_reg_value> Invalid index\n");
 869.245 +        domain_crash_synchronous();
 869.246      }
 869.247      return;
 869.248  }
 869.249 @@ -324,44 +324,44 @@ static void set_reg_value (int size, int
 869.250  extern long get_reg_value(int size, int index, int seg, struct cpu_user_regs *regs);
 869.251  
 869.252  static inline void set_eflags_CF(int size, unsigned long v1,
 869.253 -	unsigned long v2, struct cpu_user_regs *regs)
 869.254 +                                 unsigned long v2, struct cpu_user_regs *regs)
 869.255  {
 869.256      unsigned long mask = (1 << (8 * size)) - 1;
 869.257  
 869.258      if ((v1 & mask) > (v2 & mask))
 869.259 -	regs->eflags |= X86_EFLAGS_CF;
 869.260 +        regs->eflags |= X86_EFLAGS_CF;
 869.261      else
 869.262 -	regs->eflags &= ~X86_EFLAGS_CF;
 869.263 +        regs->eflags &= ~X86_EFLAGS_CF;
 869.264  }
 869.265  
 869.266  static inline void set_eflags_OF(int size, unsigned long v1,
 869.267 -	unsigned long v2, unsigned long v3, struct cpu_user_regs *regs)
 869.268 +                                 unsigned long v2, unsigned long v3, struct cpu_user_regs *regs)
 869.269  {
 869.270      if ((v3 ^ v2) & (v3 ^ v1) & (1 << ((8 * size) - 1)))
 869.271 -	regs->eflags |= X86_EFLAGS_OF;
 869.272 +        regs->eflags |= X86_EFLAGS_OF;
 869.273  }
 869.274  
 869.275  static inline void set_eflags_AF(int size, unsigned long v1,
 869.276 -	unsigned long v2, unsigned long v3, struct cpu_user_regs *regs)
 869.277 +                                 unsigned long v2, unsigned long v3, struct cpu_user_regs *regs)
 869.278  {
 869.279      if ((v1 ^ v2 ^ v3) & 0x10)
 869.280 -	regs->eflags |= X86_EFLAGS_AF;
 869.281 +        regs->eflags |= X86_EFLAGS_AF;
 869.282  }
 869.283  
 869.284  static inline void set_eflags_ZF(int size, unsigned long v1,
 869.285 -	struct cpu_user_regs *regs)
 869.286 +                                 struct cpu_user_regs *regs)
 869.287  {
 869.288      unsigned long mask = (1 << (8 * size)) - 1;
 869.289  
 869.290      if ((v1 & mask) == 0)
 869.291 -	regs->eflags |= X86_EFLAGS_ZF;
 869.292 +        regs->eflags |= X86_EFLAGS_ZF;
 869.293  }
 869.294  
 869.295  static inline void set_eflags_SF(int size, unsigned long v1,
 869.296 -	struct cpu_user_regs *regs)
 869.297 +                                 struct cpu_user_regs *regs)
 869.298  {
 869.299      if (v1 & (1 << ((8 * size) - 1)))
 869.300 -	regs->eflags |= X86_EFLAGS_SF;
 869.301 +        regs->eflags |= X86_EFLAGS_SF;
 869.302  }
 869.303  
 869.304  static char parity_table[256] = {
 869.305 @@ -384,14 +384,14 @@ static char parity_table[256] = {
 869.306  };
 869.307  
 869.308  static inline void set_eflags_PF(int size, unsigned long v1,
 869.309 -	struct cpu_user_regs *regs)
 869.310 +                                 struct cpu_user_regs *regs)
 869.311  {
 869.312      if (parity_table[v1 & 0xFF])
 869.313 -	regs->eflags |= X86_EFLAGS_PF;
 869.314 +        regs->eflags |= X86_EFLAGS_PF;
 869.315  }
 869.316  
 869.317  static void vmx_pio_assist(struct cpu_user_regs *regs, ioreq_t *p,
 869.318 -					struct mi_per_cpu_info *mpcip)
 869.319 +                           struct mi_per_cpu_info *mpcip)
 869.320  {
 869.321      unsigned long old_eax;
 869.322      int sign = p->df ? -1 : 1;
 869.323 @@ -399,28 +399,28 @@ static void vmx_pio_assist(struct cpu_us
 869.324      if (p->dir == IOREQ_WRITE) {
 869.325          if (p->pdata_valid) {
 869.326              regs->esi += sign * p->count * p->size;
 869.327 -	    if (mpcip->flags & REPZ)
 869.328 -		regs->ecx -= p->count;
 869.329 +            if (mpcip->flags & REPZ)
 869.330 +                regs->ecx -= p->count;
 869.331          }
 869.332      } else {
 869.333 -	if (mpcip->flags & OVERLAP) {
 869.334 -	    unsigned long addr;
 869.335 +        if (mpcip->flags & OVERLAP) {
 869.336 +            unsigned long addr;
 869.337  
 869.338              regs->edi += sign * p->count * p->size;
 869.339 -	    if (mpcip->flags & REPZ)
 869.340 -		regs->ecx -= p->count;
 869.341 +            if (mpcip->flags & REPZ)
 869.342 +                regs->ecx -= p->count;
 869.343  
 869.344 -	    addr = regs->edi;
 869.345 -	    if (sign > 0)
 869.346 -		addr -= p->size;
 869.347 -	    vmx_copy(&p->u.data, addr, p->size, VMX_COPY_OUT);
 869.348 -	} else if (p->pdata_valid) {
 869.349 +            addr = regs->edi;
 869.350 +            if (sign > 0)
 869.351 +                addr -= p->size;
 869.352 +            vmx_copy(&p->u.data, addr, p->size, VMX_COPY_OUT);
 869.353 +        } else if (p->pdata_valid) {
 869.354              regs->edi += sign * p->count * p->size;
 869.355 -	    if (mpcip->flags & REPZ)
 869.356 -		regs->ecx -= p->count;
 869.357 +            if (mpcip->flags & REPZ)
 869.358 +                regs->ecx -= p->count;
 869.359          } else {
 869.360 -	    old_eax = regs->eax;
 869.361 -	    switch (p->size) {
 869.362 +            old_eax = regs->eax;
 869.363 +            switch (p->size) {
 869.364              case 1:
 869.365                  regs->eax = (old_eax & 0xffffff00) | (p->u.data & 0xff);
 869.366                  break;
 869.367 @@ -431,15 +431,15 @@ static void vmx_pio_assist(struct cpu_us
 869.368                  regs->eax = (p->u.data & 0xffffffff);
 869.369                  break;
 869.370              default:
 869.371 -		printk("Error: %s unknown port size\n", __FUNCTION__);
 869.372 -		domain_crash_synchronous();
 869.373 -	    }
 869.374 -    	}
 869.375 +                printk("Error: %s unknown port size\n", __FUNCTION__);
 869.376 +                domain_crash_synchronous();
 869.377 +            }
 869.378 +        }
 869.379      }
 869.380  }
 869.381  
 869.382  static void vmx_mmio_assist(struct cpu_user_regs *regs, ioreq_t *p,
 869.383 -					struct mi_per_cpu_info *mpcip)
 869.384 +                            struct mi_per_cpu_info *mpcip)
 869.385  {
 869.386      int sign = p->df ? -1 : 1;
 869.387      int size = -1, index = -1;
 869.388 @@ -452,178 +452,178 @@ static void vmx_mmio_assist(struct cpu_u
 869.389  
 869.390      switch (mpcip->instr) {
 869.391      case INSTR_MOV:
 869.392 -	if (dst & REGISTER) {
 869.393 -	    index = operand_index(dst);
 869.394 -	    set_reg_value(size, index, 0, regs, p->u.data);
 869.395 -	}
 869.396 -	break;
 869.397 +        if (dst & REGISTER) {
 869.398 +            index = operand_index(dst);
 869.399 +            set_reg_value(size, index, 0, regs, p->u.data);
 869.400 +        }
 869.401 +        break;
 869.402  
 869.403      case INSTR_MOVZ:
 869.404 -	if (dst & REGISTER) {
 869.405 -	    index = operand_index(dst);
 869.406 -	    switch (size) {
 869.407 -	    case BYTE: p->u.data = p->u.data & 0xFFULL; break;
 869.408 -	    case WORD: p->u.data = p->u.data & 0xFFFFULL; break;
 869.409 -	    case LONG: p->u.data = p->u.data & 0xFFFFFFFFULL; break;
 869.410 -	    }
 869.411 -	    set_reg_value(operand_size(dst), index, 0, regs, p->u.data);
 869.412 -	}
 869.413 -	break;
 869.414 +        if (dst & REGISTER) {
 869.415 +            index = operand_index(dst);
 869.416 +            switch (size) {
 869.417 +            case BYTE: p->u.data = p->u.data & 0xFFULL; break;
 869.418 +            case WORD: p->u.data = p->u.data & 0xFFFFULL; break;
 869.419 +            case LONG: p->u.data = p->u.data & 0xFFFFFFFFULL; break;
 869.420 +            }
 869.421 +            set_reg_value(operand_size(dst), index, 0, regs, p->u.data);
 869.422 +        }
 869.423 +        break;
 869.424  
 869.425      case INSTR_MOVS:
 869.426 -	sign = p->df ? -1 : 1;
 869.427 -	regs->esi += sign * p->count * p->size;
 869.428 -	regs->edi += sign * p->count * p->size;
 869.429 +        sign = p->df ? -1 : 1;
 869.430 +        regs->esi += sign * p->count * p->size;
 869.431 +        regs->edi += sign * p->count * p->size;
 869.432  
 869.433 -	if ((mpcip->flags & OVERLAP) && p->dir == IOREQ_READ) {
 869.434 -	    unsigned long addr = regs->edi;
 869.435 +        if ((mpcip->flags & OVERLAP) && p->dir == IOREQ_READ) {
 869.436 +            unsigned long addr = regs->edi;
 869.437  
 869.438 -	    if (sign > 0)
 869.439 -		addr -= p->size;
 869.440 -	    vmx_copy(&p->u.data, addr, p->size, VMX_COPY_OUT);
 869.441 -	}
 869.442 +            if (sign > 0)
 869.443 +                addr -= p->size;
 869.444 +            vmx_copy(&p->u.data, addr, p->size, VMX_COPY_OUT);
 869.445 +        }
 869.446  
 869.447 -	if (mpcip->flags & REPZ)
 869.448 -	    regs->ecx -= p->count;
 869.449 -	break;
 869.450 +        if (mpcip->flags & REPZ)
 869.451 +            regs->ecx -= p->count;
 869.452 +        break;
 869.453  
 869.454      case INSTR_STOS:
 869.455 -	sign = p->df ? -1 : 1;
 869.456 -	regs->edi += sign * p->count * p->size;
 869.457 -	if (mpcip->flags & REPZ)
 869.458 -	    regs->ecx -= p->count;
 869.459 -	break;
 869.460 +        sign = p->df ? -1 : 1;
 869.461 +        regs->edi += sign * p->count * p->size;
 869.462 +        if (mpcip->flags & REPZ)
 869.463 +            regs->ecx -= p->count;
 869.464 +        break;
 869.465  
 869.466      case INSTR_AND:
 869.467 -	if (src & REGISTER) {
 869.468 -	    index = operand_index(src);
 869.469 -	    value = get_reg_value(size, index, 0, regs);
 869.470 -	    diff = (unsigned long) p->u.data & value;
 869.471 -	} else if (src & IMMEDIATE) {
 869.472 -	    value = mpcip->immediate;
 869.473 -	    diff = (unsigned long) p->u.data & value;
 869.474 -	} else if (src & MEMORY) {
 869.475 -	    index = operand_index(dst);
 869.476 -	    value = get_reg_value(size, index, 0, regs);
 869.477 -	    diff = (unsigned long) p->u.data & value;
 869.478 -	    set_reg_value(size, index, 0, regs, diff);
 869.479 -	}
 869.480 +        if (src & REGISTER) {
 869.481 +            index = operand_index(src);
 869.482 +            value = get_reg_value(size, index, 0, regs);
 869.483 +            diff = (unsigned long) p->u.data & value;
 869.484 +        } else if (src & IMMEDIATE) {
 869.485 +            value = mpcip->immediate;
 869.486 +            diff = (unsigned long) p->u.data & value;
 869.487 +        } else if (src & MEMORY) {
 869.488 +            index = operand_index(dst);
 869.489 +            value = get_reg_value(size, index, 0, regs);
 869.490 +            diff = (unsigned long) p->u.data & value;
 869.491 +            set_reg_value(size, index, 0, regs, diff);
 869.492 +        }
 869.493  
 869.494 -	/*
 869.495 -	 * The OF and CF flags are cleared; the SF, ZF, and PF
 869.496 -	 * flags are set according to the result. The state of
 869.497 -	 * the AF flag is undefined.
 869.498 -	 */
 869.499 -	regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
 869.500 -			  X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
 869.501 -	set_eflags_ZF(size, diff, regs);
 869.502 -	set_eflags_SF(size, diff, regs);
 869.503 -	set_eflags_PF(size, diff, regs);
 869.504 -	break;
 869.505 +        /*
 869.506 +         * The OF and CF flags are cleared; the SF, ZF, and PF
 869.507 +         * flags are set according to the result. The state of
 869.508 +         * the AF flag is undefined.
 869.509 +         */
 869.510 +        regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
 869.511 +                          X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
 869.512 +        set_eflags_ZF(size, diff, regs);
 869.513 +        set_eflags_SF(size, diff, regs);
 869.514 +        set_eflags_PF(size, diff, regs);
 869.515 +        break;
 869.516  
 869.517      case INSTR_OR:
 869.518 -	if (src & REGISTER) {
 869.519 -	    index = operand_index(src);
 869.520 -	    value = get_reg_value(size, index, 0, regs);
 869.521 -	    diff = (unsigned long) p->u.data | value;
 869.522 -	} else if (src & IMMEDIATE) {
 869.523 -	    value = mpcip->immediate;
 869.524 -	    diff = (unsigned long) p->u.data | value;
 869.525 -	} else if (src & MEMORY) {
 869.526 -	    index = operand_index(dst);
 869.527 -	    value = get_reg_value(size, index, 0, regs);
 869.528 -	    diff = (unsigned long) p->u.data | value;
 869.529 -	    set_reg_value(size, index, 0, regs, diff);
 869.530 -	}
 869.531 +        if (src & REGISTER) {
 869.532 +            index = operand_index(src);
 869.533 +            value = get_reg_value(size, index, 0, regs);
 869.534 +            diff = (unsigned long) p->u.data | value;
 869.535 +        } else if (src & IMMEDIATE) {
 869.536 +            value = mpcip->immediate;
 869.537 +            diff = (unsigned long) p->u.data | value;
 869.538 +        } else if (src & MEMORY) {
 869.539 +            index = operand_index(dst);
 869.540 +            value = get_reg_value(size, index, 0, regs);
 869.541 +            diff = (unsigned long) p->u.data | value;
 869.542 +            set_reg_value(size, index, 0, regs, diff);
 869.543 +        }
 869.544  
 869.545 -	/*
 869.546 -	 * The OF and CF flags are cleared; the SF, ZF, and PF
 869.547 -	 * flags are set according to the result. The state of
 869.548 -	 * the AF flag is undefined.
 869.549 -	 */
 869.550 -	regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
 869.551 -			  X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
 869.552 -	set_eflags_ZF(size, diff, regs);
 869.553 -	set_eflags_SF(size, diff, regs);
 869.554 -	set_eflags_PF(size, diff, regs);
 869.555 -	break;
 869.556 +        /*
 869.557 +         * The OF and CF flags are cleared; the SF, ZF, and PF
 869.558 +         * flags are set according to the result. The state of
 869.559 +         * the AF flag is undefined.
 869.560 +         */
 869.561 +        regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
 869.562 +                          X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
 869.563 +        set_eflags_ZF(size, diff, regs);
 869.564 +        set_eflags_SF(size, diff, regs);
 869.565 +        set_eflags_PF(size, diff, regs);
 869.566 +        break;
 869.567  
 869.568      case INSTR_XOR:
 869.569 -	if (src & REGISTER) {
 869.570 -	    index = operand_index(src);
 869.571 -	    value = get_reg_value(size, index, 0, regs);
 869.572 -	    diff = (unsigned long) p->u.data ^ value;
 869.573 -	} else if (src & IMMEDIATE) {
 869.574 -	    value = mpcip->immediate;
 869.575 -	    diff = (unsigned long) p->u.data ^ value;
 869.576 -	} else if (src & MEMORY) {
 869.577 -	    index = operand_index(dst);
 869.578 -	    value = get_reg_value(size, index, 0, regs);
 869.579 -	    diff = (unsigned long) p->u.data ^ value;
 869.580 -	    set_reg_value(size, index, 0, regs, diff);
 869.581 -	}
 869.582 +        if (src & REGISTER) {
 869.583 +            index = operand_index(src);
 869.584 +            value = get_reg_value(size, index, 0, regs);
 869.585 +            diff = (unsigned long) p->u.data ^ value;
 869.586 +        } else if (src & IMMEDIATE) {
 869.587 +            value = mpcip->immediate;
 869.588 +            diff = (unsigned long) p->u.data ^ value;
 869.589 +        } else if (src & MEMORY) {
 869.590 +            index = operand_index(dst);
 869.591 +            value = get_reg_value(size, index, 0, regs);
 869.592 +            diff = (unsigned long) p->u.data ^ value;
 869.593 +            set_reg_value(size, index, 0, regs, diff);
 869.594 +        }
 869.595  
 869.596 -	/*
 869.597 -	 * The OF and CF flags are cleared; the SF, ZF, and PF
 869.598 -	 * flags are set according to the result. The state of
 869.599 -	 * the AF flag is undefined.
 869.600 -	 */
 869.601 -	regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
 869.602 -			  X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
 869.603 -	set_eflags_ZF(size, diff, regs);
 869.604 -	set_eflags_SF(size, diff, regs);
 869.605 -	set_eflags_PF(size, diff, regs);
 869.606 -	break;
 869.607 +        /*
 869.608 +         * The OF and CF flags are cleared; the SF, ZF, and PF
 869.609 +         * flags are set according to the result. The state of
 869.610 +         * the AF flag is undefined.
 869.611 +         */
 869.612 +        regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
 869.613 +                          X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
 869.614 +        set_eflags_ZF(size, diff, regs);
 869.615 +        set_eflags_SF(size, diff, regs);
 869.616 +        set_eflags_PF(size, diff, regs);
 869.617 +        break;
 869.618  
 869.619      case INSTR_CMP:
 869.620 -	if (src & REGISTER) {
 869.621 -	    index = operand_index(src);
 869.622 -	    value = get_reg_value(size, index, 0, regs);
 869.623 -	    diff = (unsigned long) p->u.data - value;
 869.624 -	} else if (src & IMMEDIATE) {
 869.625 -	    value = mpcip->immediate;
 869.626 -	    diff = (unsigned long) p->u.data - value;
 869.627 -	} else if (src & MEMORY) {
 869.628 -	    index = operand_index(dst);
 869.629 -	    value = get_reg_value(size, index, 0, regs);
 869.630 -	    diff = value - (unsigned long) p->u.data;
 869.631 -	}
 869.632 +        if (src & REGISTER) {
 869.633 +            index = operand_index(src);
 869.634 +            value = get_reg_value(size, index, 0, regs);
 869.635 +            diff = (unsigned long) p->u.data - value;
 869.636 +        } else if (src & IMMEDIATE) {
 869.637 +            value = mpcip->immediate;
 869.638 +            diff = (unsigned long) p->u.data - value;
 869.639 +        } else if (src & MEMORY) {
 869.640 +            index = operand_index(dst);
 869.641 +            value = get_reg_value(size, index, 0, regs);
 869.642 +            diff = value - (unsigned long) p->u.data;
 869.643 +        }
 869.644  
 869.645 -	/*
 869.646 -	 * The CF, OF, SF, ZF, AF, and PF flags are set according
 869.647 -	 * to the result
 869.648 -	 */
 869.649 -	regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|X86_EFLAGS_AF|
 869.650 -			  X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
 869.651 -	set_eflags_CF(size, value, (unsigned long) p->u.data, regs);
 869.652 -	set_eflags_OF(size, diff, value, (unsigned long) p->u.data, regs);
 869.653 -	set_eflags_AF(size, diff, value, (unsigned long) p->u.data, regs);
 869.654 -	set_eflags_ZF(size, diff, regs);
 869.655 -	set_eflags_SF(size, diff, regs);
 869.656 -	set_eflags_PF(size, diff, regs);
 869.657 -	break;
 869.658 +        /*
 869.659 +         * The CF, OF, SF, ZF, AF, and PF flags are set according
 869.660 +         * to the result
 869.661 +         */
 869.662 +        regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|X86_EFLAGS_AF|
 869.663 +                          X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
 869.664 +        set_eflags_CF(size, value, (unsigned long) p->u.data, regs);
 869.665 +        set_eflags_OF(size, diff, value, (unsigned long) p->u.data, regs);
 869.666 +        set_eflags_AF(size, diff, value, (unsigned long) p->u.data, regs);
 869.667 +        set_eflags_ZF(size, diff, regs);
 869.668 +        set_eflags_SF(size, diff, regs);
 869.669 +        set_eflags_PF(size, diff, regs);
 869.670 +        break;
 869.671  
 869.672      case INSTR_TEST:
 869.673 -	if (src & REGISTER) {
 869.674 -	    index = operand_index(src);
 869.675 -	    value = get_reg_value(size, index, 0, regs);
 869.676 -	} else if (src & IMMEDIATE) {
 869.677 -	    value = mpcip->immediate;
 869.678 -	} else if (src & MEMORY) {
 869.679 -	    index = operand_index(dst);
 869.680 -	    value = get_reg_value(size, index, 0, regs);
 869.681 -	}
 869.682 -	diff = (unsigned long) p->u.data & value;
 869.683 +        if (src & REGISTER) {
 869.684 +            index = operand_index(src);
 869.685 +            value = get_reg_value(size, index, 0, regs);
 869.686 +        } else if (src & IMMEDIATE) {
 869.687 +            value = mpcip->immediate;
 869.688 +        } else if (src & MEMORY) {
 869.689 +            index = operand_index(dst);
 869.690 +            value = get_reg_value(size, index, 0, regs);
 869.691 +        }
 869.692 +        diff = (unsigned long) p->u.data & value;
 869.693  
 869.694 -	/*
 869.695 -	 * Sets the SF, ZF, and PF status flags. CF and OF are set to 0
 869.696 -	 */
 869.697 -	regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
 869.698 -			  X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
 869.699 -	set_eflags_ZF(size, diff, regs);
 869.700 -	set_eflags_SF(size, diff, regs);
 869.701 -	set_eflags_PF(size, diff, regs);
 869.702 -	break;
 869.703 +        /*
 869.704 +         * Sets the SF, ZF, and PF status flags. CF and OF are set to 0
 869.705 +         */
 869.706 +        regs->eflags &= ~(X86_EFLAGS_CF|X86_EFLAGS_PF|
 869.707 +                          X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_OF);
 869.708 +        set_eflags_ZF(size, diff, regs);
 869.709 +        set_eflags_SF(size, diff, regs);
 869.710 +        set_eflags_PF(size, diff, regs);
 869.711 +        break;
 869.712      }
 869.713  
 869.714      load_cpu_user_regs(regs);
 869.715 @@ -645,7 +645,7 @@ void vmx_io_assist(struct vcpu *v)
 869.716      if (vio == 0) {
 869.717          VMX_DBG_LOG(DBG_LEVEL_1, 
 869.718                      "bad shared page: %lx", (unsigned long) vio);
 869.719 -	printf("bad shared page: %lx\n", (unsigned long) vio);
 869.720 +        printf("bad shared page: %lx\n", (unsigned long) vio);
 869.721          domain_crash_synchronous();
 869.722      }
 869.723  
 869.724 @@ -656,15 +656,15 @@ void vmx_io_assist(struct vcpu *v)
 869.725      /* clear IO wait VMX flag */
 869.726      if (test_bit(ARCH_VMX_IO_WAIT, &v->arch.arch_vmx.flags)) {
 869.727          if (p->state == STATE_IORESP_READY) {
 869.728 -	    p->state = STATE_INVALID;
 869.729 +            p->state = STATE_INVALID;
 869.730              clear_bit(ARCH_VMX_IO_WAIT, &v->arch.arch_vmx.flags);
 869.731  
 869.732 -	    if (p->type == IOREQ_TYPE_PIO)
 869.733 -		vmx_pio_assist(regs, p, mpci_p);
 869.734 -	    else
 869.735 -		vmx_mmio_assist(regs, p, mpci_p);
 869.736 -	}
 869.737 -	/* else an interrupt send event raced us */
 869.738 +            if (p->type == IOREQ_TYPE_PIO)
 869.739 +                vmx_pio_assist(regs, p, mpci_p);
 869.740 +            else
 869.741 +                vmx_mmio_assist(regs, p, mpci_p);
 869.742 +        }
 869.743 +        /* else an interrupt send event raced us */
 869.744      }
 869.745  }
 869.746  
 869.747 @@ -731,7 +731,7 @@ static inline int __fls(u32 word)
 869.748      return word ? bit : -1;
 869.749  }
 869.750  #else
 869.751 -#define __fls(x) 	generic_fls(x)
 869.752 +#define __fls(x)  generic_fls(x)
 869.753  static __inline__ int generic_fls(u32 x)
 869.754  {
 869.755      int r = 31;
 869.756 @@ -840,23 +840,23 @@ interrupt_post_injection(struct vcpu * v
 869.757      struct vmx_virpit_t *vpit = &(v->domain->arch.vmx_platform.vmx_pit);
 869.758      switch(type)
 869.759      {
 869.760 -        case VLAPIC_DELIV_MODE_EXT:
 869.761 -            if (vpit->pending_intr_nr && vector == vpit->vector)
 869.762 -                vpit->pending_intr_nr--;
 869.763 -            else
 869.764 -                clear_highest_bit(v, vector);
 869.765 +    case VLAPIC_DELIV_MODE_EXT:
 869.766 +        if (vpit->pending_intr_nr && vector == vpit->vector)
 869.767 +            vpit->pending_intr_nr--;
 869.768 +        else
 869.769 +            clear_highest_bit(v, vector);
 869.770  
 869.771 -            if (vector == vpit->vector && !vpit->first_injected){
 869.772 -                vpit->first_injected = 1;
 869.773 -                vpit->pending_intr_nr = 0;
 869.774 -            }
 869.775 -            if (vector == vpit->vector)
 869.776 -                vpit->inject_point = NOW();
 869.777 -            break;
 869.778 +        if (vector == vpit->vector && !vpit->first_injected){
 869.779 +            vpit->first_injected = 1;
 869.780 +            vpit->pending_intr_nr = 0;
 869.781 +        }
 869.782 +        if (vector == vpit->vector)
 869.783 +            vpit->inject_point = NOW();
 869.784 +        break;
 869.785  
 869.786 -        default:
 869.787 -            printk("Not support interrupt type\n");
 869.788 -            break;
 869.789 +    default:
 869.790 +        printk("Not support interrupt type\n");
 869.791 +        break;
 869.792      }
 869.793  }
 869.794  
 869.795 @@ -898,51 +898,51 @@ asmlinkage void vmx_intr_assist(void)
 869.796          return;
 869.797      }
 869.798  
 869.799 -     __vmread(VM_ENTRY_INTR_INFO_FIELD, &intr_fields);
 869.800 +    __vmread(VM_ENTRY_INTR_INFO_FIELD, &intr_fields);
 869.801  
 869.802 -     if (intr_fields & INTR_INFO_VALID_MASK) {
 869.803 -         VMX_DBG_LOG(DBG_LEVEL_1, "vmx_intr_assist: intr_fields: %lx",
 869.804 -           intr_fields);
 869.805 -         return;
 869.806 -     }
 869.807 +    if (intr_fields & INTR_INFO_VALID_MASK) {
 869.808 +        VMX_DBG_LOG(DBG_LEVEL_1, "vmx_intr_assist: intr_fields: %lx",
 869.809 +                    intr_fields);
 869.810 +        return;
 869.811 +    }
 869.812  
 869.813 -     __vmread(GUEST_INTERRUPTIBILITY_INFO, &interruptibility);
 869.814 +    __vmread(GUEST_INTERRUPTIBILITY_INFO, &interruptibility);
 869.815  
 869.816 -     if (interruptibility) {
 869.817 -         enable_irq_window(cpu_exec_control);
 869.818 -         VMX_DBG_LOG(DBG_LEVEL_1, "guesting pending: %x, interruptibility: %lx",
 869.819 -                     highest_vector, interruptibility);
 869.820 -         return;
 869.821 -     }
 869.822 +    if (interruptibility) {
 869.823 +        enable_irq_window(cpu_exec_control);
 869.824 +        VMX_DBG_LOG(DBG_LEVEL_1, "guesting pending: %x, interruptibility: %lx",
 869.825 +                    highest_vector, interruptibility);
 869.826 +        return;
 869.827 +    }
 869.828  
 869.829 -     __vmread(GUEST_RFLAGS, &eflags);
 869.830 +    __vmread(GUEST_RFLAGS, &eflags);
 869.831  
 869.832 -     switch (intr_type) {
 869.833 -         case VLAPIC_DELIV_MODE_EXT:
 869.834 -             if (irq_masked(eflags)) {
 869.835 -                 enable_irq_window(cpu_exec_control);
 869.836 -                 VMX_DBG_LOG(DBG_LEVEL_1, "guesting pending: %x, eflags: %lx",
 869.837 -                             highest_vector, eflags);
 869.838 -                 return;
 869.839 -             }
 869.840 +    switch (intr_type) {
 869.841 +    case VLAPIC_DELIV_MODE_EXT:
 869.842 +        if (irq_masked(eflags)) {
 869.843 +            enable_irq_window(cpu_exec_control);
 869.844 +            VMX_DBG_LOG(DBG_LEVEL_1, "guesting pending: %x, eflags: %lx",
 869.845 +                        highest_vector, eflags);
 869.846 +            return;
 869.847 +        }
 869.848  
 869.849 -             vmx_inject_extint(v, highest_vector, VMX_INVALID_ERROR_CODE);
 869.850 -             TRACE_3D(TRC_VMX_INT, v->domain->domain_id, highest_vector, 0);
 869.851 -             break;
 869.852 -         case VLAPIC_DELIV_MODE_FIXED:
 869.853 -         case VLAPIC_DELIV_MODE_LPRI:
 869.854 -         case VLAPIC_DELIV_MODE_SMI:
 869.855 -         case VLAPIC_DELIV_MODE_NMI:
 869.856 -         case VLAPIC_DELIV_MODE_INIT:
 869.857 -         case VLAPIC_DELIV_MODE_STARTUP:
 869.858 -         default:
 869.859 -             printk("Unsupported interrupt type\n");
 869.860 -             BUG();
 869.861 -             break;
 869.862 -     }
 869.863 +        vmx_inject_extint(v, highest_vector, VMX_INVALID_ERROR_CODE);
 869.864 +        TRACE_3D(TRC_VMX_INT, v->domain->domain_id, highest_vector, 0);
 869.865 +        break;
 869.866 +    case VLAPIC_DELIV_MODE_FIXED:
 869.867 +    case VLAPIC_DELIV_MODE_LPRI:
 869.868 +    case VLAPIC_DELIV_MODE_SMI:
 869.869 +    case VLAPIC_DELIV_MODE_NMI:
 869.870 +    case VLAPIC_DELIV_MODE_INIT:
 869.871 +    case VLAPIC_DELIV_MODE_STARTUP:
 869.872 +    default:
 869.873 +        printk("Unsupported interrupt type\n");
 869.874 +        BUG();
 869.875 +        break;
 869.876 +    }
 869.877  
 869.878 -     interrupt_post_injection(v, highest_vector, intr_type);
 869.879 -     return;
 869.880 +    interrupt_post_injection(v, highest_vector, intr_type);
 869.881 +    return;
 869.882  }
 869.883  
 869.884  void vmx_do_resume(struct vcpu *d) 
   870.1 --- a/xen/arch/x86/vmx_platform.c	Fri Sep 09 10:31:36 2005 -0600
   870.2 +++ b/xen/arch/x86/vmx_platform.c	Tue Sep 13 10:14:16 2005 -0600
   870.3 @@ -55,17 +55,17 @@ void store_cpu_user_regs(struct cpu_user
   870.4  static inline long __get_reg_value(unsigned long reg, int size)
   870.5  {
   870.6      switch(size) {
   870.7 -        case BYTE_64:
   870.8 -            return (char)(reg & 0xFF);
   870.9 -        case WORD:
  870.10 -            return (short)(reg & 0xFFFF);
  870.11 -        case LONG:
  870.12 -            return (int)(reg & 0xFFFFFFFF);
  870.13 -        case QUAD:
  870.14 -            return (long)(reg);
  870.15 -        default:
  870.16 -	printf("Error: (__get_reg_value) Invalid reg size\n");
  870.17 -            domain_crash_synchronous();
  870.18 +    case BYTE_64:
  870.19 +        return (char)(reg & 0xFF);
  870.20 +    case WORD:
  870.21 +        return (short)(reg & 0xFFFF);
  870.22 +    case LONG:
  870.23 +        return (int)(reg & 0xFFFFFFFF);
  870.24 +    case QUAD:
  870.25 +        return (long)(reg);
  870.26 +    default:
  870.27 +        printf("Error: (__get_reg_value) Invalid reg size\n");
  870.28 +        domain_crash_synchronous();
  870.29      }
  870.30  }
  870.31  
  870.32 @@ -73,48 +73,49 @@ long get_reg_value(int size, int index, 
  870.33  {
  870.34      if (size == BYTE) {
  870.35          switch (index) { 
  870.36 -	case 0: /* %al */
  870.37 -                return (char)(regs->rax & 0xFF);
  870.38 -	case 1: /* %cl */
  870.39 -                return (char)(regs->rcx & 0xFF);
  870.40 -	case 2: /* %dl */
  870.41 -                return (char)(regs->rdx & 0xFF); 
  870.42 -	case 3: /* %bl */
  870.43 -                return (char)(regs->rbx & 0xFF);
  870.44 -	case 4: /* %ah */
  870.45 -                return (char)((regs->rax & 0xFF00) >> 8);
  870.46 -	case 5: /* %ch */
  870.47 -                return (char)((regs->rcx & 0xFF00) >> 8);
  870.48 -	case 6: /* %dh */
  870.49 -                return (char)((regs->rdx & 0xFF00) >> 8);
  870.50 -	case 7: /* %bh */
  870.51 -                return (char)((regs->rbx & 0xFF00) >> 8);
  870.52 -            default:
  870.53 -	    printf("Error: (get_reg_value) Invalid index value\n"); 
  870.54 -                domain_crash_synchronous();
  870.55 +        case 0: /* %al */
  870.56 +            return (char)(regs->rax & 0xFF);
  870.57 +        case 1: /* %cl */
  870.58 +            return (char)(regs->rcx & 0xFF);
  870.59 +        case 2: /* %dl */
  870.60 +            return (char)(regs->rdx & 0xFF); 
  870.61 +        case 3: /* %bl */
  870.62 +            return (char)(regs->rbx & 0xFF);
  870.63 +        case 4: /* %ah */
  870.64 +            return (char)((regs->rax & 0xFF00) >> 8);
  870.65 +        case 5: /* %ch */
  870.66 +            return (char)((regs->rcx & 0xFF00) >> 8);
  870.67 +        case 6: /* %dh */
  870.68 +            return (char)((regs->rdx & 0xFF00) >> 8);
  870.69 +        case 7: /* %bh */
  870.70 +            return (char)((regs->rbx & 0xFF00) >> 8);
  870.71 +        default:
  870.72 +            printf("Error: (get_reg_value) Invalid index value\n"); 
  870.73 +            domain_crash_synchronous();
  870.74          }
  870.75 +        /* NOTREACHED */
  870.76      }
  870.77  
  870.78      switch (index) {
  870.79 -        case 0: return __get_reg_value(regs->rax, size);
  870.80 -        case 1: return __get_reg_value(regs->rcx, size);
  870.81 -        case 2: return __get_reg_value(regs->rdx, size);
  870.82 -        case 3: return __get_reg_value(regs->rbx, size);
  870.83 -        case 4: return __get_reg_value(regs->rsp, size);
  870.84 -        case 5: return __get_reg_value(regs->rbp, size);
  870.85 -        case 6: return __get_reg_value(regs->rsi, size);
  870.86 -        case 7: return __get_reg_value(regs->rdi, size);
  870.87 -        case 8: return __get_reg_value(regs->r8, size);
  870.88 -        case 9: return __get_reg_value(regs->r9, size);
  870.89 -        case 10: return __get_reg_value(regs->r10, size);
  870.90 -        case 11: return __get_reg_value(regs->r11, size);
  870.91 -        case 12: return __get_reg_value(regs->r12, size);
  870.92 -        case 13: return __get_reg_value(regs->r13, size);
  870.93 -        case 14: return __get_reg_value(regs->r14, size);
  870.94 -        case 15: return __get_reg_value(regs->r15, size);
  870.95 -        default:
  870.96 -	printf("Error: (get_reg_value) Invalid index value\n"); 
  870.97 -            domain_crash_synchronous();
  870.98 +    case 0: return __get_reg_value(regs->rax, size);
  870.99 +    case 1: return __get_reg_value(regs->rcx, size);
 870.100 +    case 2: return __get_reg_value(regs->rdx, size);
 870.101 +    case 3: return __get_reg_value(regs->rbx, size);
 870.102 +    case 4: return __get_reg_value(regs->rsp, size);
 870.103 +    case 5: return __get_reg_value(regs->rbp, size);
 870.104 +    case 6: return __get_reg_value(regs->rsi, size);
 870.105 +    case 7: return __get_reg_value(regs->rdi, size);
 870.106 +    case 8: return __get_reg_value(regs->r8, size);
 870.107 +    case 9: return __get_reg_value(regs->r9, size);
 870.108 +    case 10: return __get_reg_value(regs->r10, size);
 870.109 +    case 11: return __get_reg_value(regs->r11, size);
 870.110 +    case 12: return __get_reg_value(regs->r12, size);
 870.111 +    case 13: return __get_reg_value(regs->r13, size);
 870.112 +    case 14: return __get_reg_value(regs->r14, size);
 870.113 +    case 15: return __get_reg_value(regs->r15, size);
 870.114 +    default:
 870.115 +        printf("Error: (get_reg_value) Invalid index value\n"); 
 870.116 +        domain_crash_synchronous();
 870.117      }
 870.118  }
 870.119  #elif defined (__i386__)
 870.120 @@ -133,12 +134,12 @@ static inline long __get_reg_value(unsig
 870.121  {                    
 870.122      switch(size) {
 870.123      case WORD:
 870.124 -	return (short)(reg & 0xFFFF);
 870.125 +        return (short)(reg & 0xFFFF);
 870.126      case LONG:
 870.127 -	return (int)(reg & 0xFFFFFFFF);
 870.128 +        return (int)(reg & 0xFFFFFFFF);
 870.129      default:
 870.130 -	printf("Error: (__get_reg_value) Invalid reg size\n");
 870.131 -	domain_crash_synchronous();
 870.132 +        printf("Error: (__get_reg_value) Invalid reg size\n");
 870.133 +        domain_crash_synchronous();
 870.134      }
 870.135  }
 870.136  
 870.137 @@ -146,29 +147,29 @@ long get_reg_value(int size, int index, 
 870.138  {                    
 870.139      if (size == BYTE) {
 870.140          switch (index) { 
 870.141 -	case 0: /* %al */
 870.142 +        case 0: /* %al */
 870.143              return (char)(regs->eax & 0xFF);
 870.144 -	case 1: /* %cl */
 870.145 +        case 1: /* %cl */
 870.146              return (char)(regs->ecx & 0xFF);
 870.147 -	case 2: /* %dl */
 870.148 +        case 2: /* %dl */
 870.149              return (char)(regs->edx & 0xFF); 
 870.150 -	case 3: /* %bl */
 870.151 +        case 3: /* %bl */
 870.152              return (char)(regs->ebx & 0xFF);
 870.153 -	case 4: /* %ah */
 870.154 +        case 4: /* %ah */
 870.155              return (char)((regs->eax & 0xFF00) >> 8);
 870.156 -	case 5: /* %ch */
 870.157 +        case 5: /* %ch */
 870.158              return (char)((regs->ecx & 0xFF00) >> 8);
 870.159 -	case 6: /* %dh */
 870.160 +        case 6: /* %dh */
 870.161              return (char)((regs->edx & 0xFF00) >> 8);
 870.162 -	case 7: /* %bh */
 870.163 +        case 7: /* %bh */
 870.164              return (char)((regs->ebx & 0xFF00) >> 8);
 870.165          default:
 870.166 -	    printf("Error: (get_reg_value) Invalid index value\n"); 
 870.167 +            printf("Error: (get_reg_value) Invalid index value\n"); 
 870.168              domain_crash_synchronous();
 870.169          }
 870.170 -        }
 870.171 +    }
 870.172  
 870.173 -        switch (index) {
 870.174 +    switch (index) {
 870.175      case 0: return __get_reg_value(regs->eax, size);
 870.176      case 1: return __get_reg_value(regs->ecx, size);
 870.177      case 2: return __get_reg_value(regs->edx, size);
 870.178 @@ -178,46 +179,46 @@ long get_reg_value(int size, int index, 
 870.179      case 6: return __get_reg_value(regs->esi, size);
 870.180      case 7: return __get_reg_value(regs->edi, size);
 870.181      default:
 870.182 -	printf("Error: (get_reg_value) Invalid index value\n"); 
 870.183 +        printf("Error: (get_reg_value) Invalid index value\n"); 
 870.184          domain_crash_synchronous();
 870.185      }
 870.186  }
 870.187  #endif
 870.188  
 870.189  static inline unsigned char *check_prefix(unsigned char *inst,
 870.190 -		struct instruction *thread_inst, unsigned char *rex_p)
 870.191 +                                          struct instruction *thread_inst, unsigned char *rex_p)
 870.192  {
 870.193      while (1) {
 870.194          switch (*inst) {
 870.195 -        /* rex prefix for em64t instructions */
 870.196 -            case 0x40 ... 0x4e:
 870.197 -                *rex_p = *inst;
 870.198 -                break;
 870.199 +            /* rex prefix for em64t instructions */
 870.200 +        case 0x40 ... 0x4e:
 870.201 +            *rex_p = *inst;
 870.202 +            break;
 870.203          case 0xf3: /* REPZ */
 870.204 -    	    	thread_inst->flags = REPZ;
 870.205 -        	break;
 870.206 +            thread_inst->flags = REPZ;
 870.207 +            break;
 870.208          case 0xf2: /* REPNZ */
 870.209 -    	    	thread_inst->flags = REPNZ;
 870.210 -        	break;
 870.211 +            thread_inst->flags = REPNZ;
 870.212 +            break;
 870.213          case 0xf0: /* LOCK */
 870.214 -    	    	break;
 870.215 +            break;
 870.216          case 0x2e: /* CS */
 870.217          case 0x36: /* SS */
 870.218          case 0x3e: /* DS */
 870.219          case 0x26: /* ES */
 870.220          case 0x64: /* FS */
 870.221          case 0x65: /* GS */
 870.222 -	        thread_inst->seg_sel = *inst;
 870.223 -                break;
 870.224 +            thread_inst->seg_sel = *inst;
 870.225 +            break;
 870.226          case 0x66: /* 32bit->16bit */
 870.227 -                thread_inst->op_size = WORD;
 870.228 -                break;
 870.229 -            case 0x67:
 870.230 -        	printf("Error: Not handling 0x67 (yet)\n");
 870.231 -                domain_crash_synchronous();
 870.232 -                break;
 870.233 -            default:
 870.234 -                return inst;
 870.235 +            thread_inst->op_size = WORD;
 870.236 +            break;
 870.237 +        case 0x67:
 870.238 +            printf("Error: Not handling 0x67 (yet)\n");
 870.239 +            domain_crash_synchronous();
 870.240 +            break;
 870.241 +        default:
 870.242 +            return inst;
 870.243          }
 870.244          inst++;
 870.245      }
 870.246 @@ -239,23 +240,23 @@ static inline unsigned long get_immediat
 870.247      }
 870.248  
 870.249      switch(mod) {
 870.250 -        case 0:
 870.251 -            if (rm == 5 || rm == 4) {
 870.252 -                if (op16)
 870.253 -                    inst = inst + 2; //disp16, skip 2 bytes
 870.254 -                else
 870.255 -                    inst = inst + 4; //disp32, skip 4 bytes
 870.256 -            }
 870.257 -            break;
 870.258 -        case 1:
 870.259 -            inst++; //disp8, skip 1 byte
 870.260 -            break;
 870.261 -        case 2:
 870.262 +    case 0:
 870.263 +        if (rm == 5 || rm == 4) {
 870.264              if (op16)
 870.265                  inst = inst + 2; //disp16, skip 2 bytes
 870.266              else
 870.267                  inst = inst + 4; //disp32, skip 4 bytes
 870.268 -            break;
 870.269 +        }
 870.270 +        break;
 870.271 +    case 1:
 870.272 +        inst++; //disp8, skip 1 byte
 870.273 +        break;
 870.274 +    case 2:
 870.275 +        if (op16)
 870.276 +            inst = inst + 2; //disp16, skip 2 bytes
 870.277 +        else
 870.278 +            inst = inst + 4; //disp32, skip 4 bytes
 870.279 +        break;
 870.280      }
 870.281  
 870.282      if (op_size == QUAD)
 870.283 @@ -303,19 +304,19 @@ static void init_instruction(struct inst
 870.284  }
 870.285  
 870.286  #define GET_OP_SIZE_FOR_BYTE(op_size)   \
 870.287 -    do {				\
 870.288 -    	if (rex)			\
 870.289 -	    op_size = BYTE_64;		\
 870.290 -	else				\
 870.291 -	    op_size = BYTE;		\
 870.292 +    do {    \
 870.293 +     if (rex)   \
 870.294 +     op_size = BYTE_64;  \
 870.295 + else    \
 870.296 +     op_size = BYTE;  \
 870.297      } while(0)
 870.298  
 870.299  #define GET_OP_SIZE_FOR_NONEBYTE(op_size)   \
 870.300 -    do {				\
 870.301 -    	if (rex & 0x8)			\
 870.302 -	    op_size = QUAD;		\
 870.303 -	else if (op_size != WORD)	\
 870.304 -	    op_size = LONG;		\
 870.305 +    do {    \
 870.306 +     if (rex & 0x8)   \
 870.307 +     op_size = QUAD;  \
 870.308 + else if (op_size != WORD) \
 870.309 +     op_size = LONG;  \
 870.310      } while(0)
 870.311  
 870.312  
 870.313 @@ -343,7 +344,7 @@ static int acc_mem(unsigned char size, s
 870.314   * Decode mem,reg operands (as in <opcode> r32/16, m32/16)
 870.315   */
 870.316  static int mem_reg(unsigned char size, unsigned char *opcode,
 870.317 -			struct instruction *instr, unsigned char rex)
 870.318 +                   struct instruction *instr, unsigned char rex)
 870.319  {
 870.320      int index = get_index(opcode + 1, rex);
 870.321  
 870.322 @@ -356,7 +357,7 @@ static int mem_reg(unsigned char size, u
 870.323   * Decode reg,mem operands (as in <opcode> m32/16, r32/16)
 870.324   */
 870.325  static int reg_mem(unsigned char size, unsigned char *opcode,
 870.326 -			struct instruction *instr, unsigned char rex)
 870.327 +                   struct instruction *instr, unsigned char rex)
 870.328  {
 870.329      int index = get_index(opcode + 1, rex);
 870.330  
 870.331 @@ -381,205 +382,210 @@ static int vmx_decode(unsigned char *opc
 870.332          vm86 = 1;
 870.333  
 870.334      if (vm86) { /* meaning is reversed */
 870.335 -       if (instr->op_size == WORD)
 870.336 -           instr->op_size = LONG;
 870.337 -       else if (instr->op_size == LONG)
 870.338 -           instr->op_size = WORD;
 870.339 -       else if (instr->op_size == 0)
 870.340 -           instr->op_size = WORD;
 870.341 +        if (instr->op_size == WORD)
 870.342 +            instr->op_size = LONG;
 870.343 +        else if (instr->op_size == LONG)
 870.344 +            instr->op_size = WORD;
 870.345 +        else if (instr->op_size == 0)
 870.346 +            instr->op_size = WORD;
 870.347      }
 870.348  
 870.349      switch (*opcode) {
 870.350      case 0x0B: /* or m32/16, r32/16 */
 870.351 -	instr->instr = INSTR_OR;
 870.352 -	GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
 870.353 -	return mem_reg(instr->op_size, opcode, instr, rex);
 870.354 +        instr->instr = INSTR_OR;
 870.355 +        GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
 870.356 +        return mem_reg(instr->op_size, opcode, instr, rex);
 870.357  
 870.358      case 0x20: /* and r8, m8 */
 870.359 -	instr->instr = INSTR_AND;
 870.360 -	GET_OP_SIZE_FOR_BYTE(instr->op_size);
 870.361 -	return reg_mem(instr->op_size, opcode, instr, rex);
 870.362 +        instr->instr = INSTR_AND;
 870.363 +        GET_OP_SIZE_FOR_BYTE(instr->op_size);
 870.364 +        return reg_mem(instr->op_size, opcode, instr, rex);
 870.365  
 870.366      case 0x21: /* and r32/16, m32/16 */
 870.367 -	instr->instr = INSTR_AND;
 870.368 -	GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
 870.369 -	return reg_mem(instr->op_size, opcode, instr, rex);
 870.370 +        instr->instr = INSTR_AND;
 870.371 +        GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
 870.372 +        return reg_mem(instr->op_size, opcode, instr, rex);
 870.373  
 870.374      case 0x23: /* and m32/16, r32/16 */
 870.375 -	instr->instr = INSTR_AND;
 870.376 -	GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
 870.377 -	return mem_reg(instr->op_size, opcode, instr, rex);
 870.378 +        instr->instr = INSTR_AND;
 870.379 +        GET_OP_SIZE_FOR_NONEBYTE(ins