commit 27044d066806701059bdfee1cad6b642b08f2b7fc3b24e531af569497b6db81c Author: OBS User unknown Date: Mon Jan 15 23:42:10 2007 +0000 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xen?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/README.SuSE b/README.SuSE new file mode 100644 index 0000000..a0b0565 --- /dev/null +++ b/README.SuSE @@ -0,0 +1,575 @@ +README for the Xen packages +=========================== + +This file contains SUSE-specific instructions and suggestions for using Xen. + +For more in-depth documentation of using Xen on SUSE, consult the +virtualization chapter in the SLES or SUSE Linux manual, or read up-to-date +virtualization information, including a list of known issues, at +http://www.novell.com/documentation/vmserver/. + +For more complete documentation on Xen itself, please install one of the +xen-doc-* packages and read the documentation installed into +/usr/share/doc/packages/xen/. + + +About +----- +Xen allows you to run multiple virtual machines on a single physical machine. + +See the Xen homepage for more information: + http://www.cl.cam.ac.uk/Research/SRG/netos/xen/ + +If you want to use Xen, you need to install the Xen hypervisor and a number of +supporting packages. During the initial SUSE installation (or when installing +from YaST) check-mark the "Xen Virtual Machine Host Server" pattern. If, +instead, you wish to install Xen manually later, install the following packages: + bridge-utils + kernel-xen or kernel-xenpae + python + xen + xen-libs + xen-tools + xen-tools-ioemu (Only required for hardware-assisted virtualization) + xen-doc-* (Optional) + tightvnc (Optional, to view VMs) + yast2-vm (Optional, to facilitate creation and management of VMs) + multipath-tools (Required by yast2-vm, for domUloader) + +You then need to reboot your machine. Instead of booting a normal Linux +kernel, you will boot the Xen hypervisor and a slightly changed Linux kernel. +This Linux kernel runs in the first virtual machine and will drive most of your +hardware. + +This approach is called para-virtualization, since it is a partial +virtualization (the Linux kernel needs to be changed slightly, to make the +virtualization easier). It results in very good performance (consult +http://www.cl.cam.ac.uk/Research/SRG/netos/xen/performance.html) but has the +downside of unchanged operating systems not being supported. However, +upcoming hardware features (e.g., Intel's VT and AMD's Virtualization) will +help overcome this limitation. + + +Terminology +----------- +The Xen open-source community has a number of terms that you should be +familiar with. + +A "domain" is Xen's term for a virtual machine. + +"Domain 0" is the first virtual machine. It can control all other virtual +machines. It also (usually) controls the physical hardware. A kernel used in +domain 0 may sometimes be referred to as a dom0 kernel. + +"Domain U" is any virtual machine other than domain 0. The "U" indicates it +is unprivileged (that is, it cannot control other domains). A kernel used in +an unprivileged domain may be referred to as a domU kernel. + +Novell documentation will use the more industry-standard term "virtual +machine", or "VM", rather than "domain" where possible. And to that end, +domain 0 will be called the "virtual machine server", since it essentially the +server on which the other VMs run. All other domains are simply "virtual +machines". + +The acronym "HVM" refers to a hardware-assisted virtual machine. These are +VMs that have not been modified (e.g., Windows) and therefore need hardware +support such as Intel's VT or AMD's Virtualization to run on Xen. + + +Kernels +------- +Xen supports two kinds of kernels: A privileged kernel (which boots the +machine, controls other VMs, and usually controls all your physical hardware) +and unprivileged kernels (which can't control other VMs, and usually don't need +drivers for physical hardware). The privileged kernel boots first (as the VM +server); an unprivileged kernel is used in all subsequent VMs. + +The VM server takes control of the boot process after Xen has initialized the +CPU and the memory. This VM contains a privileged kernel and all the hardware +drivers. + +For the other virtual machines, you usually don't need the hardware drivers. +(It is possible to hide a PCI device from the VM server and re-assign it to +another VM for direct access, but that is a more advanced topic.) Instead you +use virtual network and block device drivers in the unprivileged VMs to access +the physical network and block drivers in the VM server. + +For simplicity, SUSE ships a single Xen-enabled Linux kernel, rather than +separate privileged and unprivileged kernels. As most of the hardware drivers +are modules anyway, using this kernel as an unprivileged kernel has very +little extra overhead. + +The kernel is contained in the kernel-xen package (or kernel-xenpae for 32 bit +hardware with > 4G of RAM), which you need to install to use Xen. + + +Booting +------- +If you installed Xen during the initial SUSE installation, or installed one +of the kernel-xen* packages later, a "XEN" option should exist in your Grub +bootloader. Select that to boot SUSE on top of Xen. + +If you want to add additional entries, or modify the existing ones, you will +have to edit Grub yourself. All Xen entries in the Grub configuration file +(usually /boot/grub/menu.lst) look something like this: + +title XEN + root (hd0,5) + kernel /xen.gz + module /vmlinuz-xen + module /initrd-xen + +Replace (hd0,5) with the partition that holds your /boot directory in +grub-speak, e.g., hda1 -> (hd0,0) and sda5 -> (hd2,4). + +Normally, xen.gz requires no parameters. If you want to add parameters, +see below. + +Replace "" with the kernel parameters that you want to pass to +your kernel. These should be very similar, if not identical, to those passed +to a normal kernel that you boot on bare iron. + +Once you have booted this configuration successfully, you are running Xen with +a privileged kernel on top of it. + + +Xen Boot Parameters +------------------- +Normally, xen.gz requires no parameters. However, in special cases (such as +debugging or a dedicated VM server) you may wish to pass it parameters. + +We have added the following parameters (as compared to upstream Xen): + reboot=option1[,option2,...] + Options are: + warm Reboots will be warm (no memory testing, etc.) + cold Reboots will be cold (with memory testing, etc.) + no No reboots allowed + bios Reboot by calling the BIOS + hard Reboot by toggling RESET and/or crashing the CPU + +For a more complete discussion of possible parameters, see the user +documentation in the xen-doc-* packages. + + +Start Scripts +------------- +Before you can create additional VMs (or use any other xm command) xend must +be running. This init script is part of the xen-tools package, and it is +activated at installation time. You can (de)activate it using insserv (or +chkconfig). You can also start it manually with "rcxend start". + +One other relevant startup script is xendomains. This script can be used to +start other VMs when the VM server boots. It also cleanly shuts down the +other VMs when the VM server shuts down. To use this feature, place a +symbolic link in /etc/xen/auto that points to the VM's configuration file. +Look in /etc/sysconfig/xendomains for relevant settings. + + +Creating a VM with YaST +----------------------- +YaST is the recommended method to create VMs. The YaST module (from the +yast2-vm package) handles creating both the VM's configuration file and +disk(s). YaST can help install any operating system, not just SUSE. + +From the command line, run "yast2 xen". From the GUI, start YaST, select +"System", then start "Virtual Machine Management (Xen)". For full +functionality, YaST must run in graphical mode, not ncurses. + +The first screen shows all created and running VMs. To create a new one, +click "Add". Now adjust the VM's configuration to your liking. + +Xen does not yet properly support removable media in VMs in paravirtual mode, +so installing an operating system from CDs can be difficult. We recommend +using a network installation source, a DVD, or a DVD ISO. CDs do, however, +work as expected in fully-virtual mode. + +Note that paravirtualized SUSE Linux will default to using a text-based +installation. To perform a graphical installation, add "vnc=1" to the +"Installation Options" line in YaST. See this page for further guidance on +installing via VNC: +http://www.novell.com/coolsolutions/feature/15568.html + +Once you have the VM configured, click "Next". YaST will now create a +configuration file for the VM, and create a disk image. The disk image will +exist in /var/lib/xen/images, and a corresponding config file will exist in +/etc/xen/vm. The operating system's installation program will then run within +the VM. + +When the VM shuts down (because the installation -- or at least the first stage +of it -- is done), YaST gives you a chance to finalize the VM's configuration. +This is useful, for example, if the installer and the application that will +run in the VM have different memory or network requirements. + +The creation of VMs can be automated with AutoYaST. A single AutoYaST profile +can control the VM's settings (regardless of OS type) and/or the actual +installation of the OS within the VM (for SUSE only). Perhaps the easiest way +to create such a profile is to install a SUSE OS within a VM and "clone" the +operating system in the final stage of the OS installation. Then copy the +resulting file (/root/autoinst.xml) into the VM server's filesystem, into the +directory /var/lib/autoinstall/repository/. Start the AutoYaST tool (YaST > +Miscellaneous > Autoinstall) and then open the profile. Select the "Virtual +Machine Management (Xen)" heading, and add the settings for the VM. Save the +profile. Now the single profile can direct both the configuration of a VM, +and the installation of the OS within the VM. + + +Creating a VM Manually +---------------------- +If you create a VM manually (as opposed to using YaST, which is the recommended +way), you will need to create a disk (or reuse an existing one) and a +configuration file. + +Each VM needs to have its own root filesystem. The root filesystem can live on +a block device (e.g., a hard disk partition, or an LVM2 or EVMS volume) or in +a file that holds the filesystem image. + +VMs can share filesystems, such as /usr or /opt, that are mounted read-only +from _all_ VMs. Never try to share a filesystem that is mounted read-write; +filesystem corruption will result. For sharing writable data between VMs, use +NFS or other networked or cluster filesystems. + +If you are using a disk or disk image that is already installed with an +operating system, you'll probably need to replace its kernel with a Xen-enabled +kernel. + +The kernel and ramdisk used to bootstrap the VM must match any kernel modules +that might be present in the VM's disk. It is possible to manually copy the +kernel and ramdisk from the VM's disk (for example, after updating the kernel +within that VM) to the VM server's filesystem. However, an easier (and less +error-prone) method is to use something called the "domUloader". Before a new +VM is started, this loader automatically copies the kernel and ramdisk into +the VM server's filesystem, so that it can be used to bootstrap the new VM. +See /etc/xen/examples/xmexample.domUloader for an example. + +Next, make a copy of one of the /etc/xen/examples/* files, and modify it to +suit your needs. For para-virtualized VMs, start with +/etc/xen/examples/xmexample1; for fully-virtualized VMs, start with +/etc/xen/examples/xmexample.hvm. You'll need to change (at very least) the +"name" and "disk" parameters. + +When defining the virtual network adapter(s), we recommend using a static MAC +for the VM rather than allowing Xen to randomly select one each time the VM +boots. (See "Network Troubleshooting" below.) XenSource has been allocated a +range of MAC addresses with the OUI of 00-16-3E. By using MACs from this +range you can be sure they will not conflict with any physical adapters. + +To get started quickly, you can use a modified rescue image from the Novell +SUSE installation CD/DVD. It's on the first CD/DVD in the boot/ directory with +the name "rescue". To make it usable with Xen, run the script +/usr/share/doc/packages/xen/mk-xen-rescue-img.sh (run it with no arguments to +get help). The script replaces the normal Linux kernel in the image with a +Xen-enabled Linux kernel (among other things; read the script for details). +The script also creates a matching configuration file. The disadvantage of +using the rescue way of constructing a root filesystem is that the result does +not have an RPM database, so you can't easily add packages using rpm. On the +positive side, the result is relatively small yet has most of what's needed to +get started with networking. + + +Managing Virtual Machines +------------------------- +VMs can be managed from the command line or from YaST. + +To create a new VM from the command line, use a command like: + xm create my-vm +If your VM's configuration file is not located in /etc/xen/vm, you must +specify the full path. + +Have a look at running sessions with "xm list". Note the ID of the newly +created VM. Attach to that VM with "xm console " (replacing ID with the +VM's ID). Equivalently, you could have passed "-c" during creation to +immediately connect to the console. Attaching to multiple VM consoles is most +conveniently done with the terminal multiplexer "screen". + +Have a look at the other xm commands by typing "xm help". Note that most xm +commands must be done as root. + + +Using the Mouse via VNC in Fully-Virtual Mode +--------------------------------------------- +When accessing a fully-virtualized operating system via VNC, the mouse may be +difficult to control. By default, the VM is emulating a PS/2 mouse. PS/2 +provides mouse deltas, but VNC only provides absolute coordinates. The +solution is (when using VNC) to emulate a pointing device that offers absolute +coordinates. + +Emulation of a SummaSketch graphics tablet is provided for this reason. To +use the Summa emulation, you will need to configure your fully-virtualized OS. +Note that the virtual tablet is connected to the second virtual serial port +(/dev/ttyS1 or COM2). + +Most Linux distributions ship with appropriate drivers, and only need to be +configured. To configure gpm, edit /etc/sysconfig/mouse and add these lines: +MOUSETYPE="summa" +XMOUSETYPE="SUMMA" +DEVICE=/dev/ttyS1 +The format and location of your configuration file could vary depending upon +your Linux distribution. The goal is to run the gpm daemon as follows: + gpm -t summa -m /dev/ttyS1 +X also needs to be configured to use the Summa emulation. Add the following +stanza to /etc/X11/xorg.conf, or use your distribution's tools to add these +settings: +Section "InputDevice" + Identifier "Mouse0" + Driver "summa" + Option "Device" "/dev/ttyS1" + Option "InputFashion" "Tablet" + Option "Mode" "Absolute" + Option "Name" "EasyPen" + Option "Compatible" "True" + Option "Protocol" "Auto" + Option "SendCoreEvents" "on" + Option "Vendor" "GENIUS" +EndSection +After making these changes, restart gpm and X. + +Windows does not ship with a driver for the SummaSketch tablet. You can +obtain an appropriate driver from the device manufacturer's website, or one of +the large Windows driver websites. + + +HVM Console in Fully-Virtual Mode +--------------------------------- +When running a VM in fully-virtual mode, a special console is available that +provides some additional ways to control the VM. Press Ctrl-Alt-2 to access +the console; press Ctrl-Alt-1 to return to the VM. + +The two most important commands are "send-key" and "change". The "send-key" +command allows you to send any key sequence to the VM, which might otherwise +be intercepted by your local window manager. The "change" command allows the +target of a block device to be changed; for example, use it to change from one +CD ISO to another. Type "help" for more information. + + +Networking +---------- +Your virtual machines become much more useful if your can reach them via the +network. The default Xen setup creates a virtual bridge (xenbr0) in domain 0 +when you start xend. Your eth0 device is enslaved to it. The slave VMs get a +virtual network interface eth0, which is visible to domain 0 as vifN.0 and +connected to the bridge. This means that if you set up an IP address in the +slave VMs belonging to the same subnet as eth0 from your domain 0, you'll be +able to communicate not only with the other slave VMs, but also with domain 0 +and with the external network. If you have a DHCP server running in your +network, your slave VMs should succeed in getting an IP address. + +Be aware that this may have unwanted security implications. You may want to +opt for routing instead of bridging, so you can set up firewalling rules in +domain 0. + +Please read about the network configuration in the Xen manual. You can set up +bridging or routing for other interfaces also. + +The network setup is done via the scripts in /etc/xen/scripts. They do not +support ipv6 at this moment, but this is just a limitation of the scripts. + +When using SuSEfirewall2 and Xen network bridging, ensure that the Xen +bridges being used (xenbr0, xenbr1, etc.) are listed in +FW_FORWARD_ALWAYS_INOUT_DEV in the SuSEfirewall2 file. The format for +FW_FORWARD_ALWAYS_INOUT_DEV is a list of interfaces separated by a space. +For example, if the Xen bridge xenbr0 is being used, the line should be: +FW_FORWARD_ALWAYS_INOUT_DEV="xenbr0". +If xenbr0 and xenbr1 are being used, the line should be: +FW_FORWARD_ALWAYS_INOUT_DEV="xenbr0 xenbr1". + +If you use the rescue images created by the above mentioned script, you'll +have a boot script inside that parses the ip=.... boot parameter. You can set +this parameter in the config file, and can have networking work automatically. + +When using bridging, the eth0 in domain 0 device will be renamed to peth0 and +its MAC address will be set to fe:ff:ff:ff:ff:ff and ARP will be disabled. +veth0 will take over the old MAC address, be renamed to eth0, and be enabled +(ifup'ed). vif0.0 and peth0 are then enslaved to xenbr0. veth0 is connected +to vif0.0 behind the scenes. + +Caveats: +- rcSuSEfirewall is not currently called from the Xen networking scripts, but + implicitly started by the ifup call; it won't get restarted on starting + additional domains. +This issue may be addressed in a future update. + +Configuring network interfaces when using Xen bridging: +Due to the renaming of network interfaces by the network-bridge script +(e.g. eth0 to peth0), network interfaces should not be configured or restarted +while they are enslaved to a Xen bridge. Before configuring a network +interface enslaved to a Xen bridge, shutdown all VMs using the interface. +Then use the network-bridge script to remove the Xen bridge and to restore the +network interface back to normal (put peth0 back to eth0). For example, to +remove the Xen bridge and restore eth0 back to normal do the following: + /etc/xen/scripts/network-bridge stop netdev=eth0 +With the Xen bridge removed and eth0 put back to normal, eth0 can then be +configured or restarted. Once the configuration is complete, Xen bridging can +be started back up again (creating the Xen bridge and renaming eth0 to peth0) +by doing the following: + /etc/xen/scripts/network-bridge start netdev=eth0 +The VMs can then be started again. + +For debugging, here's what happens on bootup of a domU: +- xenstored saves the device setup in xenstore +- domU is created +- vifX.1 shows up in domain 0 and a hotplug event is triggered +- hotplug is /sbin/udev; udev looks at /etc/udev/rules.d/40-xen.rules and + calls /etc/xen/scripts/vif-bridge online +- vif-bridge set the vifX.1 device up and enslaves it to the bridge +- eth0 shows up in domU (hotplug event triggered) +Similar things happen for block devices, except that /etc/xen/scripts/block is +called. + +It's not recommended to use ifplugd nor NetworkManager for managing the +interfaces if you use bridging mode. Use routing with nat or proxy-arp +in that case. You also need to do that in case you want to send out packets +on wireless; you can't bridge Xen "ethernet" packets into 802.11 packets. + + +Thread-Local Storage +-------------------- +For some time now, the glibc thread library (NPTL) has used a shortcut to +access thread-local variables at a negative segment offset from the segment +selector GS instead of reading the linear address from the TDB (offset 0). +Unfortunately, this optimization has been made the default by the glibc and +gcc maintainers, as it saves one indirection. For Xen this is bad: The access +to these variables will trap, and Xen will need to use some tricks to make the +access work. It does work, but it's very slow. + +SUSE Linux 9.1 and SLES 9 were prior to this change, and thus are not +affected. SUSE Linux 9.2 and 9.3 are affected. For SUSE Linux 10.x and SLES +10, we have disabled negative segment references in gcc and glibc, and so +these are not affected. Other non-SUSE Linux distributions may be affected. + +For affected distributions, one way to work around the problem is to rename +the /lib/tls directory, so the pre-i686 version gets used, where no such +tricks are done. An example LSB-compliant init script which automates these +steps is installed at /usr/share/doc/packages/xen/boot.xen. This script +renames /lib/tls when running on Xen, and restores it when not running on Xen. +Modify this script to work with your specific distribution. + +Mono has a similar problem, but this has been fixed in SUSE Linux 10.1 and +SLES 10. Older or non-SUSE versions of Mono may have a performance impact. + + +Security +-------- +Domain 0 has control over all domains. This means that care should be taken to +keep domain 0 safe; ideally you strip it down to only do as little there as +possible, preferably with no local users except for the system administrator. +Most commands in domain 0 can only be performed as root, but this protection +scheme only has moderate security and might be defeated. In case domain 0 is +compromised, all other domains are compromised as well. + +To allow relocation of VMs (migration), the receiving machine listens on TCP +port 8002. You might want to put firewall rules in place in domain 0 to +restrict this to machines which you trust. You have some access control in +xend-config.sxp as well by tweaking the xend-relocation-hosts-allow +setting. Relocating VMs with sensitive data is not a good idea in untrusted +networks, since the data is not sent encrypted. + +The memory protections for the domUs are effective; so far no way to break out +of a virtual machine is known. A VM is an effective jail. + + +Limitations +----------- +When booting, Linux reserves data structures matching the amount of (virtual) +processors and RAM found. This has the side-effect that you can't dynamically +grow the virtual hardware beyond what the kernel has been booted with. But +you can trick domU Linux to prepare for a larger amount of RAM by passing the +mem= boot parameter. + +The export of virtual hard disks from files in Xen is handled via the loopback +driver. You can easily run out of those, as by default only 8 loopback devices +are supported. You can change this by inserting: +options loop max_loop=64 +into /etc/modprobe.conf.local in domain 0. + +Similarly, the netback driver comes up with 8 virtual network device pairs +(vif0.X - vethX). You can change this by inserting: +options netloop nloopbacks=64 +into /etc/modprobe.conf.local in domain 0. + + +Network Troubleshooting +----------------------- +First ensure the VM server is configured correctly and can access the network. + +For starting it's easiest to disable any firewall on the VM server, but enable +IP_FORWARD in /etc/sysconfig/sysctl (/proc/sys/net/ipv4/ip_forward). If you +want to enable SuSEfirewall2 with bridging, add xenbr0 to a device class, set +FW_ROUTE and FW_ALLOW_CLASS_ROUTING. Watch the kernel reject messages ... + +Switch off ifplugd and NetworkManager. These can interfere with the changes +xend makes to the network setup. + +Specify a static virtual MAC in the VM's configuration file. Random MACs can +be problematic, since with each boot of the VM it appears that some hardware +has been removed (the previous random MAC) and new hardware is present (the +new random MAC). This can cause network configuration files (which were +intended for the old MAC) to not be matched up with the new virtual hardware. + +In the VM's filesystem, ensure the ifcfg-eth* files are named appropriately. +For example, if you do decide to use a randomly-selected MAC for the VM, the +ifcfg-eth* file must not include the MAC in its name; name it generically +("ifcfg-eth0") instead. If you use a static virtual MAC for the VM, be sure +that is reflected in the file's name. + + +Troubleshooting +--------------- +First try to get Linux running on bare iron before trying with Xen. + +Be sure your Xen hypervisor (xen) and VM kernels (kernel-xen) are compatible. +The hypervisor and domain 0 kernel are a matched set, and usually must be +upgraded together. + +If you have trouble early in the boot, try passing pnpacpi=off to the Linux +kernel. If you have trouble with interrupts or timers, passing lapic to Xen +may help. Xen and Linux understand similar ACPI boot parameters. Try the +options acpi=off,force,strict,ht,noirq or acpi_skip_timer_override. Other +useful debugging options to Xen may be nosmp, noreboot, mem=1024M, +sync_console, noirqbalance (Dell). For a complete list of Xen boot options, +consult chapter 10.3 of the Xen users' manual. + +If domain 0 Linux crashes on X11 startup, please try to boot into runlevel 3. + +To debug Xen or domain 0 Linux crashes or hangs, it may be useful to use the +debug-enabled hypervisor, and to prevent automatic rebooting. Change your +Grub configuration from something like this: + kernel (hd0,5)/xen.gz +To something like this: + kernel (hd0,5)/xen-dbg.gz noreboot +After rebooting, the Xen hypervisor will write any error messages to the log +file (viewable with the "xm dmesg" command). + +If problems persist, check if a newer version is available. Well-tested +versions will be shipped with SUSE and via YaST Online Update. More frequent +(but less supported) updates are available on Novell's Forge site: + http://forge.novell.com/modules/xfmod/project/?xenpreview + + +Known Issues +------------ +For a list of known issues and work-arounds, see +http://www.novell.com/documentation/vmserver/. + + +Disclaimer +---------- +Xen performed amazingly well in our tests and proved very stable. Still, you +should be careful when using it, just like you'd be careful if you boot an +experimental kernel. Expect that it may not boot and be prepared to have a +fall-back solution for that scenario. Be prepared that it may not support all +of your hardware. And for the worst of all cases, have your most valuable +data backed up. (This is always a good idea, of course.) + + +Feedback +-------- +In case you have remarks about, problems with, ideas for, or praise for Xen, +please report it back to the xen-devel list: + xen-devel@lists.xensource.com +If you find issues with the packaging or setup done by Novell/SUSE, please +report it to: + http://www.suse.de/feedback/ + + + ENJOY! + Your Novell SUSE Team. diff --git a/block-iscsi b/block-iscsi new file mode 100644 index 0000000..72ea1f3 --- /dev/null +++ b/block-iscsi @@ -0,0 +1,90 @@ +#!/bin/bash + +# Usage: block-iscsi [add tgtname | remove dev] +# +# This assumes you're running a correctly configured +# iscsi target (server) at the other end! +# Note that we assume that the passwords for discovery (if needed) +# are in /etc/iscsid.conf +# and the node session passwords (if required) in the +# open-iscsi database below /var/lib/open-iscsi/node.db +# +# (c) Kurt Garloff , 2006-09-04, GNU GPL + +dir=$(dirname "$0") +. "$dir/block-common.sh" +#command=$1 + +#echo "DBG:xen/scripts/block-iscsi $1 $2 XENBUS_PATH=$XENBUS_PATH $par $node" + +#write_dev() +#{ +# echo "$1" +#} + +find_sdev() +{ + unset dev + for session in /sys/class/iscsi_session/session*; do + if test $1 = `cat $session/targetname`; then + dev=`readlink $session/device/target*/*:0:*/block*` + dev=${dev##*/} + return + fi + done +} + +find_sdev_rev() +{ + unset tgt + for session in /sys/class/iscsi_session/session*; do + dev=`readlink $session/device/target*/*:0:*/block*` + dev=${dev##*/} + if test $dev = $1; then + tgt=`cat $session/targetname` + return + fi + done +} + +case "$command" in + add) + # load modules and start iscsid + /etc/init.d/open-iscsi status >/dev/null 2>&1 || + { /etc/init.d/open-iscsi start >/dev/null 2>&1; sleep 1; } + # list of targets on node + par=`xenstore-read $XENBUS_PATH/params` || true + TGTID=$par; TGTID=${TGTID//@/:} + while read rec port uuid; do + if test $uuid = $TGTID; then + rec=${rec%]}; rec=${rec#[} + find_sdev $TGTID + if test -z "$dev"; then + iscsiadm -m node -r $rec -l || exit 2 + usleep 100000 + find_sdev $TGTID + fi + xenstore-write $XENBUS_PATH/node /dev/$dev + write_dev /dev/$dev + exit 0 + fi + done < <(iscsiadm -m node) + exit 1 + ;; + remove) + node=`xenstore-read $XENBUS_PATH/node` || true + dev=$node; dev=${dev#/dev/} + find_sdev_rev $dev + #echo $tgt + if test -x /sbin/blockdev -a -n "$node"; then blockdev --flushbufs $node; fi + test -z "$tgt" && exit 2 + while read rec port uuid; do + if test $uuid = $tgt; then + rec=${rec%]}; rec=${rec#[} + iscsiadm -m node -r $rec -u + exit 0 + fi + done < <(iscsiadm -m node) + exit 1 + ;; +esac diff --git a/block-losetup-retry.diff b/block-losetup-retry.diff new file mode 100644 index 0000000..b2741bb --- /dev/null +++ b/block-losetup-retry.diff @@ -0,0 +1,25 @@ +Index: xen-unstable/tools/examples/block +=================================================================== +--- xen-unstable.orig/tools/examples/block ++++ xen-unstable/tools/examples/block +@@ -391,8 +391,18 @@ mount it read-write in a guest domain." + + file) + node=$(xenstore_read "$XENBUS_PATH/node") +- losetup -d "$node" +- exit 0 ++ ++ #In case the loopback is temporarily blocked, retry the losetup -d. ++ for i in 1 2 3 4 5 ++ do ++ if losetup -d "$node" ++ then ++ exit 0 ++ fi ++ sleep 1 ++ done ++ log err "losetup -d $node failed." ++ exit 1 + ;; + + "") diff --git a/block-nbd b/block-nbd new file mode 100644 index 0000000..3ffc21e --- /dev/null +++ b/block-nbd @@ -0,0 +1,34 @@ +#!/bin/sh + +# Usage: block-nbd [bind server ctl_port |unbind node] +# +# The node argument to unbind is the name of the device node we are to +# unbind. +# +# This assumes you're running a correctly configured server at the other end! + +dir=$(dirname "$0") +. "$dir/block-common.sh" + +#set -x +par=`xenstore-read $XENBUS_PATH/params` || true +echo $par + +case "$command" in + add) + modprobe nbd + for dev in /dev/nbd*; do + if nbd-client $par $dev; then + xenstore-write $XENBUS_PATH/node $dev + write_dev $dev + exit 0 + fi + done + exit 1 + ;; + remove) + node=`xenstore-read $XENBUS_PATH/node` || true + nbd-client -d $node + exit 0 + ;; +esac diff --git a/block-sync.diff b/block-sync.diff new file mode 100644 index 0000000..572cf1b --- /dev/null +++ b/block-sync.diff @@ -0,0 +1,42 @@ +Index: xen-unstable/tools/examples/block +=================================================================== +--- xen-unstable.orig/tools/examples/block ++++ xen-unstable/tools/examples/block +@@ -42,6 +42,20 @@ canonicalise_mode() + fi + } + ++## ++# sync_flags mode ++# ++sync_flags() ++{ ++ local mode="$1" ++ if expr index "$mode" 'S' >/dev/null ++ then ++ echo "-y" ++ else ++ echo "" ++ fi ++} ++ + + ## + # check_sharing device mode +@@ -262,6 +276,7 @@ case "$command" in + # Canonicalise the file, for sharing check comparison, and the mode + # for ease of use here. + file=$(readlink -f "$p") || fatal "$p does not exist." ++ sync=$(sync_flags "$mode") + mode=$(canonicalise_mode "$mode") + + claim_lock "block" +@@ -367,7 +382,7 @@ mount it read-write in a guest domain." + fatal 'Failed to find an unused loop device' + fi + +- do_or_die losetup "$loopdev" "$file" ++ do_or_die losetup $sync "$loopdev" "$file" + xenstore_write "$XENBUS_PATH/node" "$loopdev" + write_dev "$loopdev" + release_lock "block" diff --git a/boot.local.xenU b/boot.local.xenU new file mode 100644 index 0000000..b444aff --- /dev/null +++ b/boot.local.xenU @@ -0,0 +1,79 @@ +#! /bin/sh +# +# Copyright (c) 1996 SuSE GmbH Nuernberg, Germany. All rights reserved. +# +# Author: Werner Fink , 1996 +# Burchard Steinbild , 1996 +# +# /etc/init.d/boot.local +# +# script with local commands to be executed from init on system startup +# +# +# Here you should add things, that should happen directly after booting +# before we're going to the first run level. +# + +date + +# echo "$MACHINE: running $0 $*" +my_REDIRECT="$(echo $REDIRECT | sed 's#^/dev/##')" +my_DEVICE="$(echo $my_REDIRECT | sed 's#^tty##')" +my_SPEED="$(stty speed)" +# echo REDIRECT $REDIRECT $my_REDIRECT +# echo my_DEVICE $my_DEVICE +# echo my_SPEED $my_SPEED + +# compose a line like that for inittab +# S0:12345:respawn:/sbin/agetty -L 9600 ttyS0 vt102 + +case $my_REDIRECT in + ttyS*) + echo adding this line to inittab + echo "$my_DEVICE:12345:respawn:/sbin/agetty -L $my_SPEED $my_REDIRECT vt102" + echo "$my_DEVICE:12345:respawn:/sbin/agetty -L $my_SPEED $my_REDIRECT vt102" >> /etc/inittab + echo $my_REDIRECT >> /etc/securetty + ;; + + hvc*) + echo adding this line to inittab + echo "$my_DEVICE:12345:respawn:/sbin/agetty -L $my_SPEED $my_REDIRECT vt320" + echo "$my_DEVICE:12345:respawn:/sbin/agetty -L $my_SPEED $my_REDIRECT vt320" >> /etc/inittab + echo $my_REDIRECT >> /etc/securetty + ;; + + *) + echo "no modification in inittab needed for: $my_REDIRECT" + ;; +esac + +telinit q + +# Changes for Xen +test -f /lib/modules/`uname -r`/modules.dep || depmod -ae + +CMDLINE=`cat /proc/cmdline | grep 'ip='` +if test ! -z "$CMDLINE"; then + OLDIFS=$IFS + IFS=":" + read ip oth mask gw hostname dev dhcp rest < /proc/cmdline + IFS=$OLDIFS + hostname $hostname + ip=`echo $ip | sed 's/ip= *//'` + if test ! -z "$ip"; then + if test -z "$mask"; then + if [ ${ip%/*} = $ip ]; then + ip="$ip/27" + fi + echo "ip addr add $ip dev $dev" + ip addr add $ip dev $dev + ip link set $dev up + else + ifconfig add $ip netmask $mask $dev + fi + fi + if test "${dhcp#dhcp}" != "$dhcp"; then + ifup-dhcp $dev + fi +fi + diff --git a/boot.xen b/boot.xen new file mode 100644 index 0000000..84ea851 --- /dev/null +++ b/boot.xen @@ -0,0 +1,101 @@ +#! /bin/sh +# Copyright (c) 2005-2006 SUSE Linux AG, Nuernberg, Germany. +# All rights reserved. +# +# /etc/init.d/boot.xen +# +# LSB compatible service control script; see http://www.linuxbase.org/spec/ +# +### BEGIN INIT INFO +# Provides: Xen +# Required-Start: boot.localfs +# Should-Start: boot.localnet +# Required-Stop: boot.localfs +# Should-Stop: +# Default-Start: B +# Default-Stop: +# Short-Description: Switch on and off TLS depending on whether Xen is running +# Description: Xen gets a major performance hit by the way +# recent glibc (& gcc) set up the TLS offset, as it needs to +# play segmentation tricks. This can be avoided by moving away +# the tls libs. +### END INIT INFO + +. /etc/rc.status + +# Reset status of this service +rc_reset + +case "$1" in + start) + echo -n "Starting Xen setup " + if test -d /proc/xen; then + export LD_ASSUME_KERNEL=2.4.21 + echo -n "Xen running " + fi + if test -d /proc/xen -a -d /lib/tls; then + echo -n "move /lib/tls away " + mv /lib/tls /lib/tls.save + elif test ! -d /proc/xen -a -d /lib/tls.save; then + echo -n "move back /lib/tls " + mv /lib/tls.save /lib/tls + fi + rc_status -v + ;; + stop) + # rc_status -v + ;; + try-restart|condrestart) + $0 restart + # Remember status and be quiet + rc_status + ;; + restart) + ## Stop the service and regardless of whether it was + ## running or not, start it again. + $0 start + # Remember status and be quiet + rc_status + ;; + force-reload) + $0 try-restart + rc_status + ;; + reload) + rc_failed 3 + rc_status -v + ;; + status) + echo -n "Checking for Xen " + # Return value is slightly different for the status command: + # 0 - service up and running + # 1 - service dead, but /var/run/ pid file exists + # 2 - service dead, but /var/lock/ lock file exists + # 3 - service not running (unused) + # 4 - service status unknown :-( + # 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.) + + if test -d /proc/xen; then + if test -d /lib/tls; then + echo -n "Xen running, /lib/tls existing " + rc_failed 1 + else + echo -n "Xen running, /lib/tls not existing " + fi + else + if test -d /lib/tls.save; then + echo -n "Xen not running, /lib/tls existing " + rc_failed 2 + else + echo -n "Xen not running, /lib/tls not existing " + rc_failed 3 + fi + fi + rc_status -v + ;; + *) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" + exit 1 + ;; +esac +rc_exit diff --git a/domUloader.py b/domUloader.py new file mode 100644 index 0000000..4f99a77 --- /dev/null +++ b/domUloader.py @@ -0,0 +1,521 @@ +#!/usr/bin/env python +# domUloader.py +"""Loader for kernel and (optional) ramdisk from domU filesystem + + Uses bootentry = [dev:]kernel[,initrd] to get a kernel [and initrd] + from a domU filesystem to boot it for Xen. + dev is the disk as seen by domU, filenames are relative to + that filesystem. The script uses the disk settings from the + config file to find the domU filesystems. + The bootentry is passed to the script using --entry= + Optionally, dev: can be omitted; the script then looks at the + root filesystem, parses /etc/fstab to resolve the path to the + kernel [and the initrd]. Obviously, the paths relative to the + domU root filesystem needs to be specified for the kernel + and initrd filenames. + + The root FS is passed using --root=, the filesystem setup in + --disks=. The disks list is a python list + [[uname, dev, mode, backend], [uname, dev, mode, backend], ...] + passed as a string. The script writes an sxpr specifying the + locations of the copied kernel and initrd into the file + specified by --output (default is stdout). + + Limitations: + - It is assumed both kernel and initrd are on the same filesystem. + - domUs might use LVM; the script currently does not have support + for setting up LVM mappings for domUs; it's not trivial and we + might risk namespace conflicts. If you want to use LVM inside domUs, + set up a small non-LVM boot partition and specify it in bootentry. + + The script uses kpartx (multipath-tools) to create mappings for + devices that are exported as whole disk devices that are partitioned. + + (c) 01/2006 Novell Inc + License: GNU GPL + Author: Kurt Garloff +""" + +import os, sys, getopt +from stat import * +from xen.xend import sxp +import tempfile +import time + +# Global options +quiet = False +dryrun = False +verbose = False +tmpdir = '/var/lib/xen/tmp' + +# List of partitions +# It's created by setting up the all the devices from the xen disk +# config; every entry creates on Wholedisk object, which does necessary +# preparatory steps such as losetup and kpartx -a; then a Partition +# object is setup for every partition (which may be one or several per +# Wholedisk); it references the Wholedisk if needed; python reference +# counting will take care of the cleanup. +partitions = [] + +# Helper functions + +def traildigits(strg): + "Return the trailing digits, used to split the partition number off" + idx = len(strg)-1 + while strg[idx].isdigit(): + if len == 0: + return strg + idx -= 1 + return strg[idx+1:] + +def isWholedisk(domUname): + "Determines whether dev is a wholedisk dev" + return not domUname[-1:].isdigit() + + +def findPart(dev): + "Find device dev in list of partitions" + if len(dev) > 5 and dev[:5] == "/dev/": + dev = dev[5:] + for part in partitions: + if dev == part.domname: + return part + return None + +class Wholedisk: + "Class representing a whole disk that has partitions" + def __init__(self, domname, physdev, loopfile = None): + "c'tor: set up" + self.domname = domname + self.physdev = physdev + self.loopfile = loopfile + self.mapped = 0 + self.pcount = self.scanpartitions() + + def loopsetup(self): + "Setup the loop mapping" + if self.loopfile and not self.physdev: + # Loops through all loopback devices, attempting to + # find a free one to set up. Don't scan for free and + # then try to set it up as a separate step - too racy! + i = 0 + while True: + ldev = '/dev/loop%i' % (i) + if not os.path.exists(ldev): + break + i += 1 + fd = os.popen("losetup %s %s 2> /dev/null" % (ldev, self.loopfile)) + if not fd.close(): + if verbose: + print "domUloader: losetup %s %s" % (ldev, self.loopfile) + self.physdev = ldev + break + if not self.physdev: + raise RuntimeError("domUloader: No free loop device found") + + def loopclean(self): + "Delete the loop mapping" + if self.loopfile and self.physdev: + if verbose: + print "domUloader: losetup -d %s" % self.physdev + # Even seemingly innocent queries like "losetup /dev/loop0" + # can temporarily block the loopback and cause transient + # failures deleting the loopback, hence the retry logic. + retries = 10 + while retries: + fd = os.popen("losetup -d %s" % self.physdev) + if not fd.close(): + self.physdev = None + break + else: + time.sleep(0.1) + retries -= 1 + + def scanpartitions(self): + """Scan device for partitions (kpartx -l) and set up data structures, + Returns number of partitions found.""" + self.loopsetup() + # TODO: We could use fdisk -l instead and look at the type of + # partitions; this way we could also detect LVM and support it. + fd = os.popen("kpartx -l %s" % self.physdev) + pcount = 0 + for line in fd.readlines(): + line = line.strip() + (pname, params) = line.split(':') + pno = int(traildigits(pname.strip())) + #if pname.rfind('/') != -1: + # pname = pname[pname.rfind('/')+1:] + #pname = self.physdev[:self.physdev.rfind('/')] + '/' + pname + pname = "/dev/mapper/" + pname + partitions.append(Partition(self, self.domname + '%i' % pno, pname)) + pcount += 1 + fd.close() + if not pcount: + if self.loopfile: + ref = self + else: + ref = None + partitions.append(Partition(ref, self.domname, self.physdev)) + return pcount + + def activatepartitions(self): + "Set up loop mapping and device-mapper mappings" + if not self.mapped: + self.loopsetup() + if self.pcount: + if verbose: + print "domUloader: kpartx -a %s" % self.physdev + fd = os.popen("kpartx -a %s" % self.physdev) + fd.close() + self.mapped += 1 + + def deactivatepartitions(self): + "Remove device-mapper mappings and loop mapping" + if not self.mapped: + return + self.mapped -= 1 + if not self.mapped: + if self.pcount: + if verbose: + print "domUloader: kpartx -d %s" % self.physdev + fd = os.popen("kpartx -d %s" % self.physdev) + fd.close() + self.loopclean() + + def __del__(self): + "d'tor: clean up" + self.deactivatepartitions() + self.loopclean() + + def __repr__(self): + "string representation for debugging" + strg = "[" + self.domname + "," + if self.physdev: + strg += self.physdev + strg += "," + if self.loopfile: + strg += self.loopfile + strg += "," + str(self.pcount) + ",mapped %ix]" % self.mapped + return strg + +class Partition: + """Class representing a domU filesystem (partition) that can be + mounted in dom0""" + def __init__(self, whole = None, domname = None, + physdev = None): + "c'tor: setup" + self.wholedisk = whole + self.domname = domname + self.physdev = physdev + self.mountpoint = None + + def __del__(self): + "d'tor: cleanup" + if self.mountpoint: + self.umount() + # Not needed: Refcounting will take care of it. + #if self.wholedisk: + # self.wholedisk.deactivatepartitions() + + def __repr__(self): + "string representation for debugging" + strg = "[" + self.domname + "," + self.physdev + "," + if self.mountpoint: + strg += "mounted on " + self.mountpoint + "," + else: + strg += "not mounted," + if self.wholedisk: + return strg + self.wholedisk.__repr__() + "]" + else: + return strg + "]" + + def mount(self, fstype = None, options = "ro"): + "mount filesystem, sets self.mountpoint" + if self.mountpoint: + return + if self.wholedisk: + self.wholedisk.activatepartitions() + mtpt = tempfile.mkdtemp(prefix = "%s." % self.domname, dir = tmpdir) + mopts = "" + if fstype: + mopts += " -t %s" % fstype + mopts += " -o %s" % options + if verbose: + print "domUloader: mount %s %s %s" % (mopts, self.physdev, mtpt) + fd = os.popen("mount %s %s %s" % (mopts, self.physdev, mtpt)) + err = fd.close() + if err: + raise RuntimeError("domUloader: Error %i from mount %s %s on %s" % \ + (err, mopts, self.physdev, mtpt)) + self.mountpoint = mtpt + + def umount(self): + "umount filesystem at self.mountpoint" + if not self.mountpoint: + return + if verbose: + print "domUloader: umount %s" % self.mountpoint + fd = os.popen("umount %s" % self.mountpoint) + err = fd.close() + os.rmdir(self.mountpoint) + if err: + raise RuntimeError("domUloader: Error %i from umount %s" % \ + (err, self.mountpoint)) + self.mountpoint = None + if self.wholedisk: + self.wholedisk.deactivatepartitions() + + +def setupOneDisk(cfg): + """Sets up one exported disk (incl. partitions if existing) + @param cfg: 4-tuple (uname, dev, mode, backend)""" + from xen.util.blkif import blkdev_uname_to_file + values = cfg[0].split(':') + if len(values) == 2: + (type, dev) = values + else: + (type, subtype, dev) = values + (loopfile, physdev) = (None, None) + if type == "tap": + if subtype == "aio": + # FIXME: if device, "/dev/" may need to be prepended + mode = os.stat(dev)[ST_MODE] + if S_ISBLK(mode): + physdev = dev + else: + loopfile = dev + else: + raise RuntimeError("domUloader: domUloader supports 'tap' only with 'aio'.") + if type == "file": + loopfile = dev + elif type == "phy": + physdev = blkdev_uname_to_file(cfg[0]) + wdisk = Wholedisk(cfg[1], physdev, loopfile) + +def setupDisks(vbds): + """Create a list of all disks from the disk config: + @param vbds: The disk config as list of 4-tuples + (uname, dev, mode, backend)""" + disks = eval(vbds) + for disk in disks: + setupOneDisk(disk) + if verbose: + print "Partitions: " + str(partitions) + +class Fstab: + "Class representing an fstab" + + class FstabEntry: + "Class representing one fstab line" + def __init__(self, line): + "c'tor: parses one line" + spline = line.split() + self.dev, self.mtpt, self.fstype, self.opts = \ + spline[0], spline[1], spline[2], spline[3] + if len(self.mtpt) > 1: + self.mtpt = self.mtpt.rstrip('/') + + def __init__(self, filename): + "c'tor: parses fstab" + self.entries = [] + fd = open(filename) + for line in fd.readlines(): + line = line.strip() + if len(line) == 0 or line[0] == '#': + continue + self.entries.append(Fstab.FstabEntry(line)) + + def find(self, fname): + "Looks for matching filesystem in fstab" + matchlen = 0 + match = None + fnmlst = fname.split('/') + for fs in self.entries: + entlst = fs.mtpt.split('/') + # '/' needs special treatment :-( + if entlst == ['','']: + entlst = [''] + entln = len(entlst) + if len(fnmlst) >= entln and fnmlst[:entln] == entlst \ + and entln > matchlen: + match = fs + matchlen = entln + if not match: + return (None, None) + return (match.dev, match.mtpt) + +def fsFromFstab(kernel, initrd, root): + """Investigate rootFS fstab, check for filesystem that contains the kernel + and return it; also returns adapted kernel and initrd path. + """ + part = findPart(root) + if not part: + raise RuntimeError("domUloader: Root fs %s not exported?" % root) + part.mount() + if not os.access(part.mountpoint + '/etc/fstab', os.R_OK): + part.umount() + raise RuntimeError("domUloader: /etc/fstab not found on %s" % root) + fstab = Fstab(part.mountpoint + '/etc/fstab') + (dev, fs) = fstab.find(kernel) + if not fs: + raise RuntimeError("domUloader: no matching filesystem for image %s found in fstab" % kernel) + #return (None, kernel, initrd) + if fs == '/': + ln = 0 + # this avoids the stupid /dev/root problem + dev = root + else: + ln = len(fs) + kernel = kernel[ln:] + if initrd: + initrd = initrd[ln:] + if verbose: + print "fsFromFstab: %s %s -- %s,%s" % (dev, fs, kernel, initrd) + return (kernel, initrd, dev) + +def parseEntry(entry): + "disects bootentry and returns kernel, initrd, filesys" + fs = None + initrd = None + fsspl = entry.split(':') + if len(fsspl) > 1: + fs = fsspl[0] + entry = fsspl[1] + enspl = entry.split(',') + # Prepend '/' if missing + kernel = enspl[0] + if kernel[0] != '/': + kernel = '/' + kernel + if len(enspl) > 1: + initrd = enspl[1] + if initrd[0] != '/': + initrd = '/' + initrd + return kernel, initrd, fs + +def copyFile(src, dst): + "Wrapper for shutil.filecopy" + import shutil + if verbose: + print "domUloader: cp %s %s" % (src, dst) + stat = os.stat(src) + if stat.st_size > 16*1024*1024: + raise RuntimeError("domUloader: Too large file %s (%s larger than 16MB)" \ + % (src, stat.st_size)) + try: + shutil.copyfile(src, dst) + except: + os.unlink(dst) + raise() + +def copyKernelAndInitrd(fs, kernel, initrd): + """Finds fs in list of partitions, mounts the partition, copies + kernel [and initrd] off to dom0 files, umounts the parition again, + and returns sxpr pointing to these copies.""" + if dryrun: + return "linux (kernel vmlinuz.dummy) (ramdisk initrd.dummy)" + import shutil + part = findPart(fs) + if not part: + raise RuntimeError("domUloader: Filesystem %s not exported\n" % fs) + part.mount() + try: + (fd, knm) = tempfile.mkstemp(prefix = "vmlinuz.", dir = tmpdir) + os.close(fd) + copyFile(part.mountpoint + kernel, knm) + except: + os.unlink(knm) + raise + if not quiet: + print "Copy kernel %s from %s to %s for booting" % \ + (kernel, fs, knm) + sxpr = "linux (kernel %s)" % knm + if (initrd): + try: + (fd, inm) = tempfile.mkstemp(prefix = "initrd.", dir = tmpdir) + os.close(fd) + copyFile(part.mountpoint + initrd, inm) + except: + os.unlink(knm) + os.unlink(inm) + raise + sxpr += "(ramdisk %s)" % inm + part.umount() + return sxpr + +def main(argv): + "Main routine: Parses options etc." + global quiet, dryrun, verbose, tmpdir + def usage(): + "Help output (usage info)" + global verbose, quiet, dryrun + print >> sys.stderr, "domUloader usage: domUloader --disks=disklist [--root=rootFS]\n" \ + + " --entry=kernel[,initrd] [--output=fd] [--quiet] [--dryrun] [--verbose] [--help]\n" + print >> sys.stderr, __doc__ + + #print "domUloader " + str(argv) + try: + (optlist, args) = getopt.gnu_getopt(argv, 'qvh', \ + ('disks=', 'root=', 'entry=', 'output=', + 'tmpdir=', 'help', 'quiet', 'dryrun', 'verbose')) + except: + usage() + sys.exit(1) + + entry = None + output = None + root = None + disks = None + + for (opt, oarg) in optlist: + if opt in ('-h', '--help'): + usage() + sys.exit(0) + elif opt in ('-q', '--quiet'): + quiet = True + elif opt in ('-n', '--dryrun'): + dryrun = True + elif opt in ('-v', '--verbose'): + verbose = True + elif opt == '--root': + root = oarg + elif opt == '--output': + output = oarg + elif opt == '--disks': + disks = oarg + elif opt == '--entry': + entry = oarg + elif opt == '--tmpdir': + tmpdir = oarg + + if not entry or not disks: + usage() + sys.exit(1) + + if output is None or output == "-": + fd = sys.stdout.fileno() + else: + fd = os.open(output, os.O_WRONLY) + + if not os.access(tmpdir, os.X_OK): + os.mkdir(tmpdir) + os.chmod(tmpdir, 0750) + + # We assume kernel and initrd are on the same FS, + # so only one fs + kernel, initrd, fs = parseEntry(entry) + setupDisks(disks) + if not fs: + if not root: + usage() + raise RuntimeError("domUloader: No root= to parse fstab and no disk in bootentry") + sys.exit(1) + kernel, initrd, fs = fsFromFstab(kernel, initrd, root) + + sxpr = copyKernelAndInitrd(fs, kernel, initrd) + sys.stdout.flush() + os.write(fd, sxpr) + +# Call main if called (and not imported) +if __name__ == "__main__": + main(sys.argv) + diff --git a/init.xend b/init.xend new file mode 100644 index 0000000..585d8a9 --- /dev/null +++ b/init.xend @@ -0,0 +1,151 @@ +#!/bin/bash +# +# xend Starts and stops the Xen control daemon +# +# chkconfig: 35 98 01 +# description: Starts and stops the Xen control daemon +# +### BEGIN INIT INFO +# Provides: xend +# Required-Start: $syslog +# Should-Start: $time $network $remote_fs +# Required-Stop: $syslog +# Should-Stop: $time $network $remote_fs +# Default-Start: 3 5 +# Default-Stop: 0 1 2 4 6 +# Short-Description: Starts and stops the Xen control daemon +# Description: Starts and stops the Xen control daemon. xend is needed +# to use Xen. +### END INIT INFO + +await_daemons_up() +{ + i=1 + rets=10 + xend status + while [ $? -ne 0 -a $i -lt $rets ]; do + sleep 1 + echo -n . + i=$(($i + 1)) + xend status + done +} + +. /etc/rc.status +rc_reset + +xend_abort() +{ + echo -n "xend " + rc_failed $1 + rc_status -v + rc_exit +} + +cleanup() +{ + rm -f /var/lib/xen/tmp/* 2>/dev/null + rm -f /var/lib/xen/xenbl* 2>/dev/null +} + +if [ "$1" == status ]; then + if [ ! -e /proc/xen/capabilities ]; then + xend_abort 3 + fi +else + if [ `id -u` != 0 ]; then + xend_abort 4 + fi + if [ ! -e /proc/xen/capabilities ] || + ! grep control_d /proc/xen/capabilities >/dev/null 2>&1; then + if [ "$1" == stop ] || + [ "$1" == try-restart ]; then + xend_abort 0 + else + xend_abort 6 + fi + fi +fi + +XEND=`ps ax | grep xend | grep python | awk '{ print $1 }'` +XEND=`echo $XEND` + +#export PYTHONOPTIMIZE=2 +case "$1" in + start) + echo -n "Starting xend " + if [ ! -z "$XEND" ]; then + echo -n "(already running pid $XEND) " + else + cleanup + fi + # Load XEN backend modules + # Sidenote: They could be loaded later: + # - netloop at network-bridge init time + # - netbk and blkbk when the dom0 hotplug events occur + # (in xen-network-common.sh and block-common.sh) + # but for now it's safest to have them loaded when xend starts in dom0. + modprobe blktap 2>/dev/null || true + modprobe blkbk 2>/dev/null || true + modprobe netloop 2>/dev/null || true + modprobe netbk 2>/dev/null || true + xend start + await_daemons_up + ;; + stop) + echo -n "Stopping xend " + if [ -z "$XEND" ]; then + echo -n "(not running) " + xend stop + rc_reset + else + echo -n "(pid $XEND) " + unset sysrq_sent + while read nm id mem vcpu state time; do + if [ $id = 0 ]; then continue; fi + sysrq_sent=1 + echo -en "\n Warning: Domain $nm (ID $id) still up ($state)" + # Domains should be closed down by xendomains; anyway, send + # SysRq-S to avoid the worst in case domains are not shut down. + xm sysrq $id s + done < <(xm list | grep -v ^Name) + if [ -n "$sysrq_sent" ]; then sleep 1; fi + xend stop + cleanup + rc_reset + fi + ;; + status) + echo -n "Checking status of xend " + if [ ! -z "$XEND" ]; then + echo -n "(pid $XEND) " + fi + xend status + ;; + restart|reload) + echo -n "Restarting xend " + if [ -z "$XEND" ]; then + echo -n "(not running) " + else + echo -n "(old pid $XEND) " + fi + xend restart + await_daemons_up + ;; + try-restart) + $0 status + if [ $? = 0 ]; then + $0 restart + else + rc_reset + fi + ;; + *) + echo "Usage: $0 {start|stop|restart|try-restart|reload|status}" + rc_failed 2 + rc_exit +esac + +#unset PYTHONOPTIMIZE +rc_status -v +rc_exit diff --git a/init.xendomains b/init.xendomains new file mode 100644 index 0000000..61a97a5 --- /dev/null +++ b/init.xendomains @@ -0,0 +1,463 @@ +#!/bin/bash +# +# xendomains Starts and stops secondary Xen domains +# +# chkconfig: 35 99 00 +# description: Starts and stops secondary Xen domains +# +### BEGIN INIT INFO +# Provides: xendomains +# Required-Start: $syslog $remote_fs xend +# Should-Start: +# Required-Stop: $syslog $remote_fs xend +# Should-Stop: +# Default-Start: 3 5 +# Default-Stop: 0 1 2 4 6 +# Short-Description: Starts and stops secondary Xen domains +# Description: Starts and stops secondary Xen domains automatically +# when domain 0 starts and stops. +### END INIT INFO + +# FIXME: Watch out for domain names with invalid characters. + +. /etc/rc.status +rc_reset + +LOCKFILE=/var/lock/subsys/xendomains +XENDOM_CONFIG=/etc/sysconfig/xendomains +RETCODE_FILE=/var/lock/subsys/xendomains.rc.$$ + +shopt -s dotglob nullglob + +smart_term=1 +if [ -z "$esc" ]; then + smart_term=0 + rc_timer_on() + { + (trap "exit 0" TERM; sleep $1) & _rc_timer_pid=$! + } + rc_timer_off() + { + if [ -n "$_rc_timer_pid" ]; then + kill -TERM $_rc_timer_pid > /dev/null 2>&1 + fi + unset _rc_timer_pid + } +fi + +xendomains_abort() +{ + echo -n "xendomains " + rc_failed $1 + rc_status -v + rc_exit +} + +if [ "$1" = status ]; then + if [ ! -e /proc/xen/privcmd ]; then + xendomains_abort 3 + fi + if [ ! -r "$XENDOM_CONFIG" ]; then + xendomains_abort 3 + fi +else + if [ `id -u` != 0 ]; then + xendomains_abort 4 + fi + if [ ! -e /proc/xen/privcmd ]; then + if [ "$1" = stop ] || + [ "$1" = restart ]; then + xendomains_abort 0 + else + xendomains_abort 6 + fi + fi + if [ ! -r "$XENDOM_CONFIG" ]; then + xendomains_abort 6 + fi +fi + +. "$XENDOM_CONFIG" + +dir_contains_something() +{ + [ -d "$1" ] || return 1 + local dirfiles=( "$1"/* ) + [ ${#dirfiles[@]} != 0 ] +} + +get_name_from_cfg() +{ + NM=`grep '^name[ ]*=' $1 | sed -e 's/^name[ ]*=[ ]*['\''"]\([^'\''"]*\)['\''"].*$/\1/'` +} + +running_auto_names() +{ + unset AUTONAMES[@] + if ! dir_contains_something "$XENDOMAINS_AUTO"; then + return + fi + for dom in "$XENDOMAINS_AUTO"/*; do + get_name_from_cfg "$dom" + AUTONAMES+=("$NM") + done +} + +parseln() +{ + name=`echo "$1" | cut -c0-49` + name=${name%% *} + rest=`echo "$1" | cut -c40- ` + read id mem vcpu state tm < <(echo "$rest") +} + +is_cfg_running() +{ + get_name_from_cfg "$1" + while read LN; do + parseln "$LN" + [ $id = 0 ] && continue + [ "$name" = "$NM" ] && return 0 + done < <(xm list | grep -v '^Name') + return 1 +} + +start() +{ + if [ -f "$LOCKFILE" ]; then + echo -n "xendomains already running (lockfile exists)" + rc_reset + rc_status -v + return 0 + fi + + local printed=0 + + if [ "$XENDOMAINS_RESTORE" = "true" ] && + dir_contains_something "$XENDOMAINS_SAVE"; then + mkdir -p $(dirname "$LOCKFILE") + touch "$LOCKFILE" + echo "Restoring saved Xen domains" + printed=1 + for dom in "$XENDOMAINS_SAVE"/*; do + echo -n " ${dom##*/}: " + xm restore "$dom" >/dev/null 2>&1 + if [ $? -ne 0 ]; then + rc_failed + else + rc_reset + rm -f "$dom" + fi + rc_status -v + done + fi + + if dir_contains_something "$XENDOMAINS_AUTO"; then + touch "$LOCKFILE" + echo "Starting auto Xen domains" + printed=1 + for dom in "$XENDOMAINS_AUTO"/*; do + echo -n " ${dom##*/}: " + if is_cfg_running "$dom"; then + rc_status -s + else + xm create --quiet --defconfig "$dom" + if [ $? -ne 0 ]; then + rc_failed + else + usleep $XENDOMAINS_CREATE_USLEEP + rc_reset + fi + rc_status -v + fi + done + fi + + if [ $printed -eq 0 ]; then + echo -n "Starting xendomains" + rc_failed 6 # not configured + rc_status -v + fi +} + +is_zombie_state() +{ + [ "$1" = "-b---d" ] || [ "$1" = "-----d" ] +} + +any_non_zombies() +{ + while read LN; do + parseln "$LN" + [ $id = 0 ] && continue + is_zombie_state "$state" || return 0 + done < <(xm list | grep -v '^Name') + return 1 +} + +migrate_with_watchdog() +{ + (xm migrate "$@" ; echo $? > "$RETCODE_FILE") >/dev/null 2>&1 & + watchdog_xm $! +} + +save_with_watchdog() +{ + (xm save "$@" ; echo $? > "$RETCODE_FILE") >/dev/null 2>&1 & + watchdog_xm $! +} + +shutdown_with_watchdog() +{ + (xm shutdown -w "$@" ; echo $? > "$RETCODE_FILE") >/dev/null 2>&1 & + watchdog_xm $! +} + +get_return_code() +{ + local RC=127 + [ -r "$RETCODE_FILE" ] && RC=`head -c10 "$RETCODE_FILE"` + rm -f "$RETCODE_FILE" + return $RC +} + +# $1: The PID to wait on. +watchdog_xm() +{ + local col=$((COLUMNS-11)) + if [ -z "$XENDOMAINS_STOP_MAXWAIT" ] || [ "$XENDOMAINS_STOP_MAXWAIT" = "0" ]; then + wait $1 >/dev/null 2>&1 + get_return_code + return + fi + + rc_timer_on $XENDOMAINS_STOP_MAXWAIT $col + while true; do + # Prefer "jobs" over "ps": faster and no false positives + pid=`jobs -l | grep " $1 Running"` + if [ -z "$pid" ]; then + break + fi + pid=`jobs -l | grep " $_rc_timer_pid Running"` + if [ -z "$pid" ]; then + disown $1 # To avoid the "Terminated..." message + kill $1 >/dev/null 2>&1 + fi + sleep 1 + done + rc_timer_off + if [ $smart_term -ne 0 ]; then + echo -en "\015${esc}[${col}C " + fi + get_return_code +} + +stop() +{ + echo "Shutting down Xen domains" + if [ "$XENDOMAINS_AUTO_ONLY" = "true" ]; then + running_auto_names + fi + local printed=0 + while read LN; do + parseln "$LN" + [ $id = 0 ] && continue + printed=1 + if [ "$XENDOMAINS_AUTO_ONLY" = "true" ]; then + is_auto_domain=0 + for n in "${AUTNAMES[@]}"; do + if [ "$name" = "$n" ]; then + is_auto_domain=1 + break + fi + done + if [ $is_auto_domain -eq 0 ]; then + echo -n " $name: " + rc_status -s + continue + fi + fi + if [ -n "$XENDOMAINS_SYSRQ" ]; then + for sysrq in $XENDOMAINS_SYSRQ; do + echo -n " $name: " + echo -n "sending sysrq '$sysrq'... " + xm sysrq $id $sysrq + if [ $? -ne 0 ]; then + rc_failed + else + rc_reset + fi + rc_status -v + # usleep just ignores empty arg + usleep $XENDOMAINS_USLEEP + done + fi + if is_zombie_state "$state"; then + echo -n " $name: " + echo -n "destroying zombie... " + xm destroy $id + rc_reset + rc_status -v + continue + fi + # HVM domains currently can't migrate or save so don't even try. + hvm=0 + vmpath=`xenstore-read /local/domain/$id/vm 2> /dev/null` + if [ $? = 0 ]; then + [ `xenstore-read "$vmpath/image/ostype" 2> /dev/null` = hvm ] && hvm=1 + fi + if [ -n "$XENDOMAINS_MIGRATE" ]; then + echo -n " $name: " + echo -n "migrating... " + if [ $hvm != 0 ]; then + echo -n "(unsupported for fully virtualized)" + rc_status -s + else + migrate_with_watchdog $id "$XENDOMAINS_MIGRATE" + if [ $? -ne 0 ]; then + rc_failed + rc_status -v + else + rc_reset + rc_status -v + continue + fi + fi + fi + if [ -n "$XENDOMAINS_SAVE" ]; then + echo -n " $name: " + echo -n "saving... " + if [ $hvm != 0 ]; then + echo -n "(unsupported for fully virtualized)" + rc_status -s + else + save_with_watchdog $id "$XENDOMAINS_SAVE/$name" + if [ $? -ne 0 ]; then + rm -f "$XENDOMAINS_SAVE/$name" + rc_failed + rc_status -v + else + rc_reset + rc_status -v + continue + fi + fi + fi + if [ -n "$XENDOMAINS_SHUTDOWN" ]; then + echo -n " $name: " + echo -n "shutting down... " + shutdown_with_watchdog $id $XENDOMAINS_SHUTDOWN + if [ $? -ne 0 ]; then + rc_failed + else + rc_reset + fi + rc_status -v + fi + done < <(xm list | grep -v '^Name') + + if [ -n "$XENDOMAINS_SHUTDOWN_ALL" ] && any_non_zombies ; then + echo -n " others: shutting down... " + shutdown_with_watchdog $XENDOMAINS_SHUTDOWN_ALL + if [ $? -ne 0 ]; then + rc_failed + else + rc_reset + fi + rc_status -v + fi + + if [ $printed -eq 0 ]; then + echo -e "${rc_done_up}" + fi + + # Unconditionally delete lock file + rm -f "$LOCKFILE" +} + +check_domain_up() +{ + while read LN; do + parseln "$LN" + [ $id = 0 ] && continue + [ "$name" = "$1" ] && return 0 + done < <(xm list | grep -v "^Name") + return 1 +} + +check_all_domains_up() +{ + if ! dir_contains_something "$XENDOMAINS_AUTO" && + ! dir_contains_something "$XENDOMAINS_SAVE"; then + rc_reset + rc_status -v + return + fi + echo + for nm in "$XENDOMAINS_AUTO"/*; do + get_name_from_cfg "$nm" + echo -n " $nm: " + if check_domain_up "$NM"; then + rc_reset + else + rc_failed 2 + fi + rc_status -v + done + for nm in "$XENDOMAINS_SAVE"/*; do + echo -n " $nm: " + rc_failed 3 + rc_status -v + done +} + +# This does NOT necessarily restart all running domains: instead it +# stops all running domains and then boots all the domains specified in +# AUTODIR. If other domains have been started manually then they will +# not get restarted. +restart() +{ + "$0" stop + start +} + +case "$1" in + start) + start + ;; + + stop) + stop + ;; + + restart|reload) + restart + ;; + + try-restart) + "$0" status + if [ $? = 0 ]; then + "$0" restart + else + rc_reset + rc_status -v + fi + ;; + + status) + echo -n "Checking status of Xen domains" + if [ ! -f "$LOCKFILE" ]; then + rc_failed 3 + rc_status -v + else + check_all_domains_up + fi + ;; + + *) + echo "Usage: $0 {start|stop|restart|try-restart|reload|status}" + rc_failed 2 + ;; +esac + +rc_exit diff --git a/logrotate.xend.conf b/logrotate.xend.conf new file mode 100644 index 0000000..4d63b5a --- /dev/null +++ b/logrotate.xend.conf @@ -0,0 +1,14 @@ +/var/log/xen/xend.log /var/log/xen/xend-debug.log { + rotate 5 + size 1M + notifempty + missingok + nocompress + copytruncate +} + +/var/log/xen/qemu-dm.*.log { + rotate 0 + missingok + monthly +} diff --git a/mk-xen-rescue-img.sh b/mk-xen-rescue-img.sh new file mode 100644 index 0000000..e7e6210 --- /dev/null +++ b/mk-xen-rescue-img.sh @@ -0,0 +1,278 @@ +#!/bin/bash +# Shell script to prepare a root FS image based on the Novell/SUSE rescue +# image source. You must have a xen kernel installed for this to work. +# (c) Kurt Garloff , 2005-01-24, GNU GPL +# Maintained by Charles Coffing +# +# TODO: +# - trap SIGINT and clean up +# - can't know that /sbin/depmod will work with this rescue image +# - support domUloader +# - check for disk full in exchange_kernel_modules + +MB_DEFAULT=88 + +usage() +{ + echo "Usage:" + echo " mk-xen-rescue-img.sh source destination [MB [kernelver]]" + echo "Purpose:" + echo " Creates a root filesystem and an associated config file for a Xen-compatible" + echo " Linux virtual machine." + echo "Arguments:" + echo " * 'source' is the source from which to copy files. Normally, this is" + echo " the SUSE rescue image, such as /media/cdrom/boot/x86_64/rescue," + echo " but it could also be an already-mounted root filesystem." + echo " * 'destination' is the pathname of a disk image to be created, based on" + echo " 'source'." + echo " * 'MB' is the size of disk image (default $MB_DEFAULT)." + echo " * 'kernelver' is the version of an installed Xen-compatible Linux kernel" + echo " (from the kernel-xen package) to install in the disk image. If not" + echo " specified, the newest of those currently installed will be selected." + exit 2 +} + +usage_error() +{ + echo "Error: $@" + echo "" + usage +} + +error() +{ + echo "Error: $@" + if [ ! -z "$DST_MNT" ]; then + umount "$DST_MNT" + rmdir "$DST_MNT" + fi + exit 1 +} + +cp_error() +{ + error "Failed to copy files to '$DST'." +} + +# Determine Xen kernel version +get_xen_kernel() +{ + if [ -z "$KVER" ]; then + KVER="`cd /lib/modules && ls -td *-xen/kernel | head -n1 | sed 's@/kernel@@'`" + else + if [ ! -d /lib/modules/$KVER/kernel ]; then + error "/lib/modules/$KVER/kernel does not exist." + fi + fi + if [ -z "$KVER" ]; then + error "You need to have a 'kernel-xen' package installed." + fi +} + +cp_rescue() +{ + local LSRC=$1 + local LDST=$2 + + # The rescue image has empty directories all hard-linked to the same + # thing, probably to conserve inodes. This gives 'cp' heartburn. + # I want hard linked directories to be created separately (i.e., + # dereferenced), but I don't want to dereference soft links. + # 'tar' handles this nicely. + + (cd "$LSRC" && tar --atime-preserve --one-file-system -cf - *) | \ + (cd "$LDST" && tar -xmf -) +} + +# Create FS and copy rescue FS +create_basis_and_mount() +{ + echo "Creating disk image within '$DST'..." + dd if=/dev/zero of="$DST" bs=4096 count=1 2>/dev/null >/dev/null 2>&1 + dd if=/dev/zero of="$DST" bs=1048576 count=0 seek=$MB >/dev/null 2>&1 + /sbin/mke2fs -b 1024 -i 2048 -L xen_rescue -F "$DST" >/dev/null 2>&1 + DST_MNT="$DST".mnt + mkdir -p "$DST_MNT" + mount -o loop "$DST" "$DST_MNT" + if [ $? -ne 0 ]; then + error "Failed to mount destination disk image via loopback." + fi + echo "Copying files from '$SRC'..." + if test -d "$SRC"; then + if [ ! -d "$SRC"/dev ] || [ ! -d "$SRC"/sbin ]; then + error "'$SRC' does not look like a valid root filesystem." + fi + cp_rescue "$SRC" "$DST_MNT" + if [ $? -ne 0 ]; then + cp_error + fi + else + mkdir -p "$DST".src + if test ! -z "`file $SRC | grep gzip`"; then + cp -p "$SRC" "$DST".stage.gz + gunzip -f "$DST".stage.gz || rm -f "$DST".stage.gz + mount -o loop "$DST".stage "$DST".src + if [ $? -ne 0 ]; then + rm "$DST".stage + rmdir "$DST".src + error "Failed to mount the source via loopback." + fi + cp_rescue "$DST".src "$DST_MNT" + if [ $? -ne 0 ]; then + umount "$DST".src + rm "$DST".stage + rmdir "$DST".src + cp_error + fi + umount "$DST".src + rm "$DST".stage + else + mount -o loop "$SRC" "$DST".src + if [ $? -ne 0 ]; then + rmdir "$DST".src + error "Failed to mount the source via loopback." + fi + cp_rescue "$DST".src "$DST_MNT" + if [ $? -ne 0 ]; then + umount "$DST".src + rmdir "$DST".src + cp_error + fi + umount "$DST".src + fi + rmdir "$DST".src + fi +} + +# Save some inodes +remove_some_files() +{ + # these consume an excessive amount of inodes + rm -f "$DST_MNT"/dev/sd[c-z][a-z][0-9]* + # hwclock does not work + rm -f "$DST_MNT"/etc/init.d/boot.d/*boot.clock +} + +xenify_image() +{ + # Xen doesn't yet support virtualizing USB + sed -i "s/^usbfs/#usbfs/" "$DST_MNT"/etc/fstab +} + +# Copy extra files to rescue image +copy_extra_files() +{ + test ! -e "$DST_MNT"/sbin/depmod && cp -p /sbin/depmod "$DST_MNT"/sbin/ + cp -p /usr/share/doc/packages/xen/boot.local.xenU "$DST_MNT"/etc/init.d/boot.local +} + +# Remove kernel modules and replace by ours +exchange_kernel_modules() +{ + echo "Updating kernel within '$DST'..." + KMODDIR=/lib/modules/$KVER/kernel + MNTKVER="`cd "$DST_MNT"/lib/modules && ls -td */kernel 2>/dev/null | sed 's@/kernel@@' 2>/dev/null`" + for dir in $MNTKVER; do + if test "$MNTKVER" != "$KVER"; then + rm -rf "$DST_MNT"/lib/modules/$MNTKVER + fi + done + mkdir -p "$DST_MNT"$KMODDIR + # complete trees + for dir in arch crypto lib net security; do + cp -ax $KMODDIR/$dir "$DST_MNT"$KMODDIR/ + done + mkdir -p "$DST_MNT"$KMODDIR/fs + cp -p $KMODDIR/fs/*.ko "$DST_MNT"$KMODDIR/fs/ + # a selection of FS + for fs in afs autofs autofs4 cifs exportfs ext3 fat jbd jfs msdos ncpfs nfsd nls ntfs reiser4 reiserfs smbfs subfs sysv udf ufs vfat xfs; do + if test -e $KMODDIR/fs/$fs; then + cp -ax $KMODDIR/fs/$fs "$DST_MNT"$KMODDIR/fs/ + fi + done + # some drivers + mkdir -p "$DST_MNT"$KMODDIR/drivers/char + for name in lp.ko n_hdlc.ko raw.ko; do + cp -p $KMODDIR/drivers/char/$name "$DST_MNT"$KMODDIR/drivers/char/ + done + mkdir -p "$DST_MNT"$KMODDIR/drivers/block + for name in umem.ko nbd.ko loop.ko loop_fish2.ko cryptoloop.ko; do + cp -p $KMODDIR/drivers/block/$name "$DST_MNT"$KMODDIR/drivers/block/ + done + mkdir -p "$DST_MNT"$KMODDIR/drivers/base + cp -p $KMODDIR/drivers/base/firmware_class.ko "$DST_MNT"$KMODDIR/drivers/base/ + mkdir -p "$DST_MNT"$KMODDIR/drivers/md + cp -p $KMODDIR/drivers/md/*.ko "$DST_MNT"$KMODDIR/drivers/md/ + mkdir -p "$DST_MNT"$KMODDIR/drivers/xen + for dir in $KMODDIR/drivers/xen/*front; do + cp -ax $dir "$DST_MNT"$KMODDIR/drivers/xen/ + done + if test -e $KMODDIR/kernel; then + mkdir -p "$DST_MNT"$KMODDIR/kernel + cp -ax $KMODDIR/kernel/* "$DST_MNT"$KMODDIR/kernel/ + fi + # Kernel image + System.map + mkdir -p "$DST_MNT"/boot + rm -f "$DST_MNT"/boot/vmlinuz-* "$DST_MNT"/boot/System.map-* "$DST_MNT"/boot/initrd-* + cp -p /boot/vmlinuz-$KVER "$DST_MNT"/boot/ + if test -e /boot/initrd-$KVER-domU; then + cp -p /boot/initrd-$KVER-domU "$DST_MNT"/boot/initrd-$KVER + else + cp -p /boot/initrd-$KVER "$DST_MNT"/boot/ + fi + cp -p /boot/System.map-$KVER "$DST_MNT"/boot/ + depmod -a $KVER -b "$DST_MNT" -F "$DST_MNT"/boot/System.map-$KVER + +} + +# umount and display message +umount_and_msg() +{ + umount "$DST_MNT" + rmdir "$DST_MNT" + DST_MNT= + echo "'$DST' has been prepared successfully." + CFGFILE=/etc/xen/vm/${DST##*/} + if test -e $CFGFILE; then + mv -b $CFGFILE $CFGFILE.save + fi + if test "${DST:0:1}" != "/"; then + DST="`pwd`/$DST" + fi + cp -p /etc/xen/examples/xmexample.rescue $CFGFILE + sed -i "/^disk/s@^.*\$@disk = [ \'file:$DST,hda1,w\' ]@" $CFGFILE + # These next two lines are only applicable if not using domUloader, + # but try anyway. + sed -i "/^kernel/s@^.*\$@kernel = \"/boot/vmlinuz-$KVER\"@" $CFGFILE + sed -i "/^ramdisk/s@^.*\$@ramdisk = \"/boot/initrd-$KVER\"@" $CFGFILE + echo "" + echo "Config file '$CFGFILE' has been created. Please review!" + echo "You may also want to add an IP address to the config file." + echo "Start the domain with 'xm create -c $CFGFILE'." +} + +if test -z "$1" -o -z "$2"; then + usage +fi +SRC=$1 +if [ ! -e "$SRC" ]; then + usage_error "'$SRC' does not exist." +fi +DST=$2 +if [ -e "$DST" ]; then + error "'$DST' already exists." +fi +MB=$MB_DEFAULT +[ ! -z "$3" ] && MB=$3 +KVER=$4 +if [ `id -u` -ne 0 ]; then + usage_error "Please run this script as root." +fi + +get_xen_kernel +create_basis_and_mount +remove_some_files +copy_extra_files +xenify_image +exchange_kernel_modules +umount_and_msg diff --git a/non-flat-pm.patch b/non-flat-pm.patch new file mode 100644 index 0000000..885068b --- /dev/null +++ b/non-flat-pm.patch @@ -0,0 +1,461 @@ +From: Jan Beulich +Bugzilla #214568 + +Index: xen-3.0.3-testing/xen/arch/x86/hvm/platform.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/platform.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/platform.c +@@ -883,19 +883,14 @@ void handle_mmio(unsigned long va, unsig + memcpy(regs, guest_cpu_user_regs(), HVM_CONTEXT_STACK_BYTES); + hvm_store_cpu_guest_regs(v, regs, NULL); + +- inst_len = hvm_instruction_length(regs, hvm_guest_x86_mode(v)); ++ inst_addr = hvm_get_segment_base(current, seg_cs) + regs->eip; ++ inst_len = hvm_instruction_length(inst_addr, hvm_guest_x86_mode(v)); + if ( inst_len <= 0 ) + { + printk("handle_mmio: failed to get instruction length\n"); + domain_crash_synchronous(); + } + +- realmode = hvm_realmode(v); +- if (realmode) +- inst_addr = (regs->cs << 4) + regs->eip; +- else +- inst_addr = regs->eip; +- + memset(inst, 0, MAX_INST_LEN); + ret = inst_copy_from_guest(inst, inst_addr, inst_len); + if (ret != inst_len) { +@@ -904,6 +899,7 @@ void handle_mmio(unsigned long va, unsig + } + + init_instruction(&mmio_inst); ++ realmode = hvm_realmode(v); + + if (hvm_decode(realmode, inst, &mmio_inst) == DECODE_failure) { + printk("handle_mmio: failed to decode instruction\n"); +Index: xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/svm/svm.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c +@@ -507,6 +507,24 @@ unsigned long svm_get_ctrl_reg(struct vc + return 0; /* dummy */ + } + ++static unsigned long svm_get_segment_base(struct vcpu *v, enum segment seg) ++{ ++ switch ( seg ) ++ { ++ case seg_cs: return v->arch.hvm_svm.vmcb->cs.base; ++ case seg_ds: return v->arch.hvm_svm.vmcb->ds.base; ++ case seg_es: return v->arch.hvm_svm.vmcb->es.base; ++ case seg_fs: return v->arch.hvm_svm.vmcb->fs.base; ++ case seg_gs: return v->arch.hvm_svm.vmcb->gs.base; ++ case seg_ss: return v->arch.hvm_svm.vmcb->ss.base; ++ case seg_tr: return v->arch.hvm_svm.vmcb->tr.base; ++ case seg_gdtr: return v->arch.hvm_svm.vmcb->gdtr.base; ++ case seg_idtr: return v->arch.hvm_svm.vmcb->idtr.base; ++ case seg_ldtr: return v->arch.hvm_svm.vmcb->ldtr.base; ++ } ++ BUG(); ++ return 0; ++} + + /* Make sure that xen intercepts any FP accesses from current */ + static void svm_stts(struct vcpu *v) +@@ -887,6 +905,7 @@ int start_svm(void) + hvm_funcs.pae_enabled = svm_pae_enabled; + hvm_funcs.guest_x86_mode = svm_guest_x86_mode; + hvm_funcs.get_guest_ctrl_reg = svm_get_ctrl_reg; ++ hvm_funcs.get_segment_base = svm_get_segment_base; + + hvm_funcs.update_host_cr3 = svm_update_host_cr3; + +Index: xen-3.0.3-testing/xen/arch/x86/hvm/vmx/vmx.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/vmx/vmx.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/vmx/vmx.c +@@ -610,7 +610,27 @@ static unsigned long vmx_get_ctrl_reg(st + return 0; /* dummy */ + } + ++static unsigned long vmx_get_segment_base(struct vcpu *v, enum segment seg) ++{ ++ unsigned long base; + ++ BUG_ON(v != current); ++ switch ( seg ) ++ { ++ case seg_cs: __vmread(GUEST_CS_BASE, &base); break; ++ case seg_ds: __vmread(GUEST_DS_BASE, &base); break; ++ case seg_es: __vmread(GUEST_ES_BASE, &base); break; ++ case seg_fs: __vmread(GUEST_FS_BASE, &base); break; ++ case seg_gs: __vmread(GUEST_GS_BASE, &base); break; ++ case seg_ss: __vmread(GUEST_SS_BASE, &base); break; ++ case seg_tr: __vmread(GUEST_TR_BASE, &base); break; ++ case seg_gdtr: __vmread(GUEST_GDTR_BASE, &base); break; ++ case seg_idtr: __vmread(GUEST_IDTR_BASE, &base); break; ++ case seg_ldtr: __vmread(GUEST_LDTR_BASE, &base); break; ++ default: BUG(); base = 0; break; ++ } ++ return base; ++} + + /* Make sure that xen intercepts any FP accesses from current */ + static void vmx_stts(struct vcpu *v) +@@ -753,6 +773,7 @@ static void vmx_setup_hvm_funcs(void) + hvm_funcs.pae_enabled = vmx_pae_enabled; + hvm_funcs.guest_x86_mode = vmx_guest_x86_mode; + hvm_funcs.get_guest_ctrl_reg = vmx_get_ctrl_reg; ++ hvm_funcs.get_segment_base = vmx_get_segment_base; + + hvm_funcs.update_host_cr3 = vmx_update_host_cr3; + +Index: xen-3.0.3-testing/xen/include/asm-x86/hvm/hvm.h +=================================================================== +--- xen-3.0.3-testing.orig/xen/include/asm-x86/hvm/hvm.h ++++ xen-3.0.3-testing/xen/include/asm-x86/hvm/hvm.h +@@ -20,6 +20,19 @@ + #ifndef __ASM_X86_HVM_HVM_H__ + #define __ASM_X86_HVM_HVM_H__ + ++enum segment { ++ seg_cs, ++ seg_ss, ++ seg_ds, ++ seg_es, ++ seg_fs, ++ seg_gs, ++ seg_tr, ++ seg_ldtr, ++ seg_gdtr, ++ seg_idtr ++}; ++ + /* + * The hardware virtual machine (HVM) interface abstracts away from the + * x86/x86_64 CPU virtualization assist specifics. Currently this interface +@@ -52,6 +65,7 @@ struct hvm_function_table { + * 1) determine whether the guest is in real or vm8086 mode, + * 2) determine whether paging is enabled, + * 3) return the current guest control-register value ++ * 4) return the current guest segment descriptor base + */ + int (*realmode)(struct vcpu *v); + int (*paging_enabled)(struct vcpu *v); +@@ -59,6 +73,7 @@ struct hvm_function_table { + int (*pae_enabled)(struct vcpu *v); + int (*guest_x86_mode)(struct vcpu *v); + unsigned long (*get_guest_ctrl_reg)(struct vcpu *v, unsigned int num); ++ unsigned long (*get_segment_base)(struct vcpu *v, enum segment seg); + + /* + * Re-set the value of CR3 that Xen runs on when handling VM exits +@@ -157,7 +172,7 @@ hvm_guest_x86_mode(struct vcpu *v) + return hvm_funcs.guest_x86_mode(v); + } + +-int hvm_instruction_length(struct cpu_user_regs *regs, int mode); ++int hvm_instruction_length(unsigned long pc, int mode); + + static inline void + hvm_update_host_cr3(struct vcpu *v) +@@ -176,6 +191,12 @@ hvm_get_guest_ctrl_reg(struct vcpu *v, u + return 0; /* force to fail */ + } + ++static inline unsigned long ++hvm_get_segment_base(struct vcpu *v, enum segment seg) ++{ ++ return hvm_funcs.get_segment_base(v, seg); ++} ++ + void hvm_stts(struct vcpu *v); + void hvm_set_guest_time(struct vcpu *v, u64 gtime); + void hvm_do_resume(struct vcpu *v); +Index: xen-3.0.3-testing/xen/arch/x86/hvm/instrlen.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/instrlen.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/instrlen.c +@@ -20,7 +20,6 @@ + #include + #include + #include +-#include + #include + + /* read from guest memory */ +@@ -195,54 +194,51 @@ static uint8_t twobyte_table[256] = { + }; + + /* +- * insn_fetch - fetch the next 1 to 4 bytes from instruction stream +- * @_type: u8, u16, u32, s8, s16, or s32 +- * @_size: 1, 2, or 4 bytes ++ * insn_fetch - fetch the next byte from instruction stream + */ +-#define insn_fetch(_type, _size) \ +-({ unsigned long _x, _ptr = _regs.eip; \ +- if ( mode == X86EMUL_MODE_REAL ) _ptr += _regs.cs << 4; \ +- rc = inst_copy_from_guest((unsigned char *)(&(_x)), _ptr, _size); \ +- if ( rc != _size ) goto done; \ +- _regs.eip += (_size); \ +- length += (_size); \ +- (_type)_x; \ ++#define insn_fetch() \ ++({ uint8_t _x; \ ++ if ( inst_copy_from_guest(&_x, pc, 1) != 1 ) { \ ++ DPRINTK("Cannot read from address %lx (eip %lx, mode %d)\n", \ ++ pc, org_pc, mode); \ ++ return -1; \ ++ } \ ++ pc += 1; \ ++ length += 1; \ ++ _x; \ + }) + + /** + * hvm_instruction_length - returns the current instructions length + * +- * @regs: guest register state ++ * @org_pc: guest instruction pointer + * @mode: guest operating mode + * + * EXTERNAL this routine calculates the length of the current instruction +- * pointed to by eip. The guest state is _not_ changed by this routine. ++ * pointed to by org_pc. The guest state is _not_ changed by this routine. + */ +-int hvm_instruction_length(struct cpu_user_regs *regs, int mode) ++int hvm_instruction_length(unsigned long org_pc, int mode) + { + uint8_t b, d, twobyte = 0, rex_prefix = 0; + uint8_t modrm, modrm_mod = 0, modrm_reg = 0, modrm_rm = 0; +- unsigned int op_bytes, ad_bytes, i; +- int rc = 0; ++ unsigned int op_default, op_bytes, ad_default, ad_bytes, i; + int length = 0; + unsigned int tmp; +- +- /* Shadow copy of register state. Committed on successful emulation. */ +- struct cpu_user_regs _regs = *regs; ++ unsigned long pc = org_pc; + + switch ( mode ) + { + case X86EMUL_MODE_REAL: + case X86EMUL_MODE_PROT16: +- op_bytes = ad_bytes = 2; ++ op_bytes = op_default = ad_bytes = ad_default = 2; + break; + case X86EMUL_MODE_PROT32: +- op_bytes = ad_bytes = 4; ++ op_bytes = op_default = ad_bytes = ad_default = 4; + break; + #ifdef __x86_64__ + case X86EMUL_MODE_PROT64: +- op_bytes = 4; +- ad_bytes = 8; ++ op_bytes = op_default = 4; ++ ad_bytes = ad_default = 8; + break; + #endif + default: +@@ -252,16 +248,16 @@ int hvm_instruction_length(struct cpu_us + /* Legacy prefixes. */ + for ( i = 0; i < 8; i++ ) + { +- switch ( b = insn_fetch(uint8_t, 1) ) ++ switch ( b = insn_fetch() ) + { + case 0x66: /* operand-size override */ +- op_bytes ^= 6; /* switch between 2/4 bytes */ ++ op_bytes = op_default ^ 6; /* switch between 2/4 bytes */ + break; + case 0x67: /* address-size override */ + if ( mode == X86EMUL_MODE_PROT64 ) +- ad_bytes ^= 12; /* switch between 4/8 bytes */ ++ ad_bytes = ad_default ^ 12; /* switch between 4/8 bytes */ + else +- ad_bytes ^= 6; /* switch between 2/4 bytes */ ++ ad_bytes = ad_default ^ 6; /* switch between 2/4 bytes */ + break; + case 0x2e: /* CS override */ + case 0x3e: /* DS override */ +@@ -273,21 +269,30 @@ int hvm_instruction_length(struct cpu_us + case 0xf3: /* REP/REPE/REPZ */ + case 0xf2: /* REPNE/REPNZ */ + break; ++#ifdef __x86_64__ ++ case 0x40 ... 0x4f: ++ if ( mode == X86EMUL_MODE_PROT64 ) ++ { ++ rex_prefix = b; ++ continue; ++ } ++ /* FALLTHRU */ ++#endif + default: + goto done_prefixes; + } ++ rex_prefix = 0; + } + done_prefixes: + + /* REX prefix. */ +- if ( (mode == X86EMUL_MODE_PROT64) && ((b & 0xf0) == 0x40) ) ++ if ( rex_prefix ) + { +- rex_prefix = b; +- if ( b & 8 ) +- op_bytes = 8; /* REX.W */ +- modrm_reg = (b & 4) << 1; /* REX.R */ ++ if ( rex_prefix & 8 ) ++ op_bytes = 8; /* REX.W */ ++ modrm_reg = (rex_prefix & 4) << 1; /* REX.R */ + /* REX.B and REX.X do not need to be decoded. */ +- b = insn_fetch(uint8_t, 1); ++ b = insn_fetch(); + } + + /* Opcode byte(s). */ +@@ -298,7 +303,7 @@ done_prefixes: + if ( b == 0x0f ) + { + twobyte = 1; +- b = insn_fetch(uint8_t, 1); ++ b = insn_fetch(); + d = twobyte_table[b]; + } + +@@ -310,7 +315,7 @@ done_prefixes: + /* ModRM and SIB bytes. */ + if ( d & ModRM ) + { +- modrm = insn_fetch(uint8_t, 1); ++ modrm = insn_fetch(); + modrm_mod |= (modrm & 0xc0) >> 6; + modrm_reg |= (modrm & 0x38) >> 3; + modrm_rm |= (modrm & 0x07); +@@ -330,16 +335,16 @@ done_prefixes: + if ( modrm_rm == 6 ) + { + length += 2; +- _regs.eip += 2; /* skip disp16 */ ++ pc += 2; /* skip disp16 */ + } + break; + case 1: + length += 1; +- _regs.eip += 1; /* skip disp8 */ ++ pc += 1; /* skip disp8 */ + break; + case 2: + length += 2; +- _regs.eip += 2; /* skip disp16 */ ++ pc += 2; /* skip disp16 */ + break; + } + } +@@ -350,33 +355,34 @@ done_prefixes: + { + case 0: + if ( (modrm_rm == 4) && +- (((insn_fetch(uint8_t, 1)) & 7) +- == 5) ) ++ ((insn_fetch() & 7) == 5) ) + { + length += 4; +- _regs.eip += 4; /* skip disp32 specified by SIB.base */ ++ pc += 4; /* skip disp32 specified by SIB.base */ + } + else if ( modrm_rm == 5 ) + { + length += 4; +- _regs.eip += 4; /* skip disp32 */ ++ pc += 4; /* skip disp32 */ + } + break; + case 1: + if ( modrm_rm == 4 ) + { +- insn_fetch(uint8_t, 1); ++ length += 1; ++ pc += 1; + } + length += 1; +- _regs.eip += 1; /* skip disp8 */ ++ pc += 1; /* skip disp8 */ + break; + case 2: + if ( modrm_rm == 4 ) + { +- insn_fetch(uint8_t, 1); ++ length += 1; ++ pc += 1; + } + length += 4; +- _regs.eip += 4; /* skip disp32 */ ++ pc += 4; /* skip disp32 */ + break; + } + } +@@ -397,15 +403,12 @@ done_prefixes: + tmp = (d & ByteOp) ? 1 : op_bytes; + if ( tmp == 8 ) tmp = 4; + /* NB. Immediates are sign-extended as necessary. */ +- switch ( tmp ) +- { +- case 1: insn_fetch(int8_t, 1); break; +- case 2: insn_fetch(int16_t, 2); break; +- case 4: insn_fetch(int32_t, 4); break; +- } ++ length += tmp; ++ pc += tmp; + break; + case SrcImmByte: +- insn_fetch(int8_t, 1); ++ length += 1; ++ pc += 1; + break; + } + +@@ -414,13 +417,9 @@ done_prefixes: + + switch ( b ) + { +- case 0xa0 ... 0xa1: /* mov */ +- length += ad_bytes; +- _regs.eip += ad_bytes; /* skip src displacement */ +- break; +- case 0xa2 ... 0xa3: /* mov */ ++ case 0xa0 ... 0xa3: /* mov */ + length += ad_bytes; +- _regs.eip += ad_bytes; /* skip dst displacement */ ++ pc += ad_bytes; /* skip src/dst displacement */ + break; + case 0xf6 ... 0xf7: /* Grp3 */ + switch ( modrm_reg ) +@@ -429,12 +428,8 @@ done_prefixes: + /* Special case in Grp3: test has an immediate source operand. */ + tmp = (d & ByteOp) ? 1 : op_bytes; + if ( tmp == 8 ) tmp = 4; +- switch ( tmp ) +- { +- case 1: insn_fetch(int8_t, 1); break; +- case 2: insn_fetch(int16_t, 2); break; +- case 4: insn_fetch(int32_t, 4); break; +- } ++ length += tmp; ++ pc += tmp; + goto done; + } + break; +@@ -445,6 +440,6 @@ done: + + cannot_emulate: + DPRINTK("Cannot emulate %02x at address %lx (eip %lx, mode %d)\n", +- b, (unsigned long)_regs.eip, (unsigned long)regs->eip, mode); ++ b, pc, org_pc, mode); + return -1; + } diff --git a/ready b/ready new file mode 100644 index 0000000..473a0f4 diff --git a/serial-split.patch b/serial-split.patch new file mode 100644 index 0000000..a33d4c9 --- /dev/null +++ b/serial-split.patch @@ -0,0 +1,452 @@ +Index: xen-3.0-testing/tools/misc/serial-split/Makefile +=================================================================== +--- /dev/null ++++ xen-3.0-testing/tools/misc/serial-split/Makefile +@@ -0,0 +1,20 @@ ++CC ?= gcc ++CFLAGS ?= -Wall -Os ++CFILES = $(wildcard *.c) ++OBJS = $(patsubst %.c,%.o,$(wildcard *.c)) ++TARGET = serial-split ++ ++all: $(TARGET) ++ ++install: all ++ install -d $(DESTDIR)/usr/bin ++ install -s $(TARGET) $(DESTDIR)/usr/bin/ ++ ++clean: ++ rm *.o $(TARGET) *~ ++ ++$(TARGET): $(OBJS) ++ $(CC) $(CFLAGS) -o $@ $^ ++ ++%.o: %.c Makefile ++ $(CC) $(CFLAGS) -c -o $@ $< +Index: xen-3.0-testing/tools/misc/serial-split/serial-split.c +=================================================================== +--- /dev/null ++++ xen-3.0-testing/tools/misc/serial-split/serial-split.c +@@ -0,0 +1,422 @@ ++/* ++ * serial-split.c ++ * pdb / console splitter ++ * ++ * Copyright 2005 Charles Coffing ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2 ++ * of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ */ ++ ++/* ++ * Typical setup: ++ * ++ * Development box Xen box ++ * ...-----+ +-----... ++ * +---------+ | | ++ * | gdb | | | ++ * | |\ high | | ++ * +---------+ \ | | ++ * \+-----------+ | serial | +------------------+ ++ * | splitter |------------| Xen | ++ * /+-----------+ | | | - pdb (com1H)| ++ * +---------+ / | | | - printk (com1) | ++ * | console |/ low | | +------------------+ ++ * | viewer | | | ++ * +---------+ | | ++ * ...-----+ +-----... ++ */ ++ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++const unsigned int DefaultLowPort = 12010; ++const unsigned int DefaultBaud = 115200; ++const char DefaultSerialDevice[] = "/dev/ttyS0"; ++ ++#define DEBUG 0 ++#define MAX(a,b) ((a)<(b)?(b):(a)) ++ ++ ++static int cook_baud(int baud) ++{ ++ int cooked_baud = 0; ++ switch (baud) ++ { ++ case 50: cooked_baud = B50; break; ++ case 75: cooked_baud = B75; break; ++ case 110: cooked_baud = B110; break; ++ case 134: cooked_baud = B134; break; ++ case 150: cooked_baud = B150; break; ++ case 200: cooked_baud = B200; break; ++ case 300: cooked_baud = B300; break; ++ case 600: cooked_baud = B600; break; ++ case 1200: cooked_baud = B1200; break; ++ case 1800: cooked_baud = B1800; break; ++ case 2400: cooked_baud = B2400; break; ++ case 4800: cooked_baud = B4800; break; ++ case 9600: cooked_baud = B9600; break; ++ case 19200: cooked_baud = B19200; break; ++ case 38400: cooked_baud = B38400; break; ++ case 57600: cooked_baud = B57600; break; ++ case 115200: cooked_baud = B115200; break; ++ } ++ return cooked_baud; ++} ++ ++ ++static int start_listener(unsigned short port) ++{ ++ int fd; ++ struct sockaddr_in sin; ++ int on = 1; ++ ++ if ((fd = socket (AF_INET, SOCK_STREAM, 0)) < 0) ++ { ++ perror("socket"); ++ goto out1; ++ } ++ ++ setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof (on)); ++ ++ memset(&sin, 0, sizeof(sin)); ++ sin.sin_family = AF_INET; ++ sin.sin_port = htons (port); ++ sin.sin_addr.s_addr = INADDR_ANY; ++ if (bind(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) ++ { ++ perror("bind"); ++ goto out2; ++ } ++ ++ if (listen(fd, 1) < 0) ++ { ++ perror("listen"); ++ goto out2; ++ } ++ ++ fprintf(stderr, "Listening on port %d\n", port); ++ ++ return fd; ++ ++out2: ++ close(fd); ++out1: ++ return -1; ++} ++ ++ ++static int accept_conn(int fd) ++{ ++ int on = 1; ++ int new_fd; ++ struct sockaddr_in from; ++ socklen_t fromlen = sizeof(from); ++ ++ new_fd = accept(fd, (struct sockaddr *)&from, &fromlen); ++ if (new_fd < 0) ++ perror("accept"); ++ ioctl(new_fd, FIONBIO, &on); ++ ++ fprintf(stderr, "Accepted connection on %d\n", new_fd); ++ ++ return new_fd; ++} ++ ++ ++static void close_conn(int * fd) ++{ ++ shutdown(*fd, 2); ++ close(*fd); ++ *fd = -1; ++} ++ ++ ++static int receive_data(int * fd, char * buf, ssize_t max_bytes, int * poll) ++{ ++ ssize_t bytes; ++ if ((bytes = read(*fd, buf, max_bytes)) < 0) ++ { ++ perror("read"); ++ *poll = 1; ++ return 0; ++ } ++ else if (bytes == 0) ++ { ++ close_conn(fd); ++ *poll = 0; ++ return 0; ++ } ++ else ++ { ++ if (bytes == max_bytes) ++ *poll = 1; ++ else ++ *poll = 0; ++#if DEBUG ++ { ++ ssize_t i; ++ fprintf(stderr, "Received %d bytes on %d:\n", bytes, *fd); ++ for (i = 0; i < bytes; ++ i) ++ { ++ if ((i & 0xf) == 0) ++ printf(" "); ++ printf("%02x", buf[i] & 0xff); ++ if (((i+1) & 0xf) == 0 || i + 1 == bytes) ++ printf("\n"); ++ else ++ printf(" "); ++ } ++ } ++#endif ++ return bytes; ++ } ++} ++ ++ ++static void set_high_bit(char * buf, size_t bytes) ++{ ++ size_t i; ++ for(i = 0; i < bytes; ++ i) ++ buf[i] |= 0x80; ++} ++ ++ ++static void clear_high_bit(char * buf, size_t bytes) ++{ ++ size_t i; ++ for(i = 0; i < bytes; ++ i) ++ buf[i] &= 0x7f; ++} ++ ++ ++static int open_serial(char const * serial_dev, int baud) ++{ ++ struct termios newsertio; ++ int serial_fd; ++ memset(&newsertio, 0, sizeof(newsertio)); ++ ++ if ((serial_fd = open(serial_dev, O_RDWR | O_NOCTTY | O_NONBLOCK)) < 0) ++ { ++ perror(serial_dev); ++ return -1; ++ } ++ ++ newsertio.c_cflag = baud | CS8 | CLOCAL | CREAD; ++ newsertio.c_iflag = IGNBRK | IGNPAR; /* raw input */ ++ newsertio.c_oflag = 0; /* raw output */ ++ newsertio.c_lflag = 0; /* no echo, no signals */ ++ newsertio.c_cc[VMIN] = 1; ++ newsertio.c_cc[VTIME] = 0; ++ tcflush(serial_fd, TCIFLUSH); ++ tcsetattr(serial_fd, TCSANOW, &newsertio); ++ ++ fprintf(stderr, "Listening on %s\n", serial_dev); ++ ++ return serial_fd; ++} ++ ++ ++static void main_loop(int serial_fd, int low_listener, int high_listener) ++{ ++ fd_set rdfds; ++ int low_poll = 0, high_poll = 0, serial_poll = 0; ++ int low_fd = -1, high_fd = -1; ++ ++ while(1) ++ { ++ char buf[1024]; ++ ssize_t bytes; ++ int max; ++ ++ FD_ZERO(&rdfds); ++ FD_SET(low_fd < 0 ? low_listener : low_fd, &rdfds); ++ FD_SET(high_fd < 0 ? high_listener : high_fd, &rdfds); ++ FD_SET(serial_fd, &rdfds); ++ ++ max = MAX(low_fd, low_listener); ++ max = MAX(max, high_fd); ++ max = MAX(max, high_listener); ++ max = MAX(max, serial_fd); ++ ++ if (select(max + 1, &rdfds, NULL, NULL, NULL) < 0) ++ { ++ perror("select"); ++ continue; ++ } ++ ++ if (FD_ISSET(low_listener, &rdfds)) ++ { ++ assert(low_fd < 0); ++ low_fd = accept_conn(low_listener); ++ } ++ ++ if (FD_ISSET(high_listener, &rdfds)) ++ { ++ assert(high_fd < 0); ++ high_fd = accept_conn(high_listener); ++ } ++ ++ if (low_poll || (low_fd >= 0 && FD_ISSET(low_fd, &rdfds))) ++ { ++ if ((bytes = receive_data(&low_fd, &buf[0], sizeof(buf), ++ &low_poll)) > 0) ++ { ++ clear_high_bit(&buf[0], bytes); ++ if (write(serial_fd, &buf[0], bytes) < 0) ++ perror("write"); ++ } ++ } ++ ++ if (high_poll || (high_fd >= 0 && FD_ISSET(high_fd, &rdfds))) ++ { ++ if ((bytes = receive_data(&high_fd, &buf[0], sizeof(buf), ++ &high_poll)) > 0) ++ { ++ set_high_bit(&buf[0], bytes); ++ if (write(serial_fd, &buf[0], bytes) < 0) ++ perror("write"); ++ } ++ } ++ ++ if (serial_poll || FD_ISSET(serial_fd, &rdfds)) ++ { ++ if ((bytes = receive_data(&serial_fd, &buf[0], sizeof(buf), ++ &serial_poll)) > 0) ++ { ++ ssize_t i; ++ for (i = 0; i < bytes; ++ i) ++ { ++ if (buf[i] & 0x80) ++ { ++ if (high_fd >= 0) ++ { ++ buf[i] &= 0x7f; ++ if ((write(high_fd, &buf[i], 1)) < 0) ++ { ++ perror("write"); ++ close_conn(&high_fd); ++ high_poll = 0; ++ } ++ } ++ } ++ else ++ { ++ if (low_fd >= 0) ++ { ++ if ((write(low_fd, &buf[i], 1)) < 0) ++ { ++ perror("write"); ++ close_conn(&low_fd); ++ low_poll = 0; ++ } ++ } ++ } ++ } ++ } ++ } ++ } ++} ++ ++ ++static void usage() ++{ ++ printf( ++"Description:\n" ++" Splits the serial port between two TCP ports. Bytes read from the\n" ++" serial port will be delivered to one of the two TCP ports (high or\n" ++" low) depending on whether the high bit is set. Bytes written to the\n" ++" TCP ports will be forwarded to the serial port; the high bit will be\n" ++" set or cleared to denote the source.\n" ++"Usage:\n" ++" serial-split [-d] [-b]\n" ++" [-l] [-h]\n" ++"Parameters:\n" ++" -d Defaults to %s.\n" ++" -b Baud rate of the serial port. Defaults to %d.\n" ++" Also assumes 8N1.\n" ++" -l Low TCP port. Defaults to %d, or one less than\n" ++" the high port.\n" ++" -h High TCP port. Defaults to %d, or one more than\n" ++" the low port.\n", ++DefaultSerialDevice, DefaultBaud, DefaultLowPort, DefaultLowPort + 1); ++ ++ exit(1); ++} ++ ++ ++int main(int argc, char **argv) ++{ ++ int cooked_baud = cook_baud(DefaultBaud); ++ char const * serial_dev = DefaultSerialDevice; ++ int low_port = -1, high_port = -1; ++ int serial_fd, low_listener, high_listener; ++ ++ while ( --argc != 0 ) ++ { ++ char *p = argv[argc]; ++ if ( *(p++) != '-' ) ++ usage(); ++ switch (*(p++)) ++ { ++ case 'b': ++ if ( (cooked_baud = cook_baud(atoi(p))) == 0 ) ++ { ++ fprintf(stderr, "Bad baud rate\n"); ++ exit(1); ++ } ++ break; ++ case 'd': ++ serial_dev = p; ++ break; ++ case 'l': ++ if ((low_port = atoi(p)) <= 0) ++ usage(); ++ break; ++ case 'h': ++ if ((high_port = atoi(p)) <= 0) ++ usage(); ++ break; ++ default: ++ usage(); ++ } ++ } ++ ++ if (low_port == -1 && high_port == -1) ++ low_port = DefaultLowPort; ++ if (low_port == -1) ++ low_port = high_port - 1; ++ if (high_port == -1) ++ high_port = low_port + 1; ++ ++ if ((serial_fd = open_serial(serial_dev, cooked_baud)) < 0 || ++ (low_listener = start_listener(low_port)) < 0 || ++ (high_listener = start_listener(high_port)) < 0) ++ exit(1); ++ ++ main_loop(serial_fd, low_listener, high_listener); ++ ++ return 0; ++} ++ diff --git a/xen-3.0.3-testing-src.tar.bz2 b/xen-3.0.3-testing-src.tar.bz2 new file mode 100644 index 0000000..c0991cb --- /dev/null +++ b/xen-3.0.3-testing-src.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50d18f4e082110db27a98ffcd39d98cc12058a6dd89c58a378ce283fa911ba89 +size 4580110 diff --git a/xen-bonding.diff b/xen-bonding.diff new file mode 100644 index 0000000..6efc264 --- /dev/null +++ b/xen-bonding.diff @@ -0,0 +1,65 @@ +Index: xen-unstable/tools/examples/network-bridge +=================================================================== +--- xen-unstable.orig/tools/examples/network-bridge ++++ xen-unstable/tools/examples/network-bridge +@@ -145,6 +145,21 @@ antispoofing () { + iptables -A FORWARD -m physdev --physdev-in ${vif0} -j ACCEPT + } + ++# Find the netdev that is associated with the bridge by matching MAC addresses. ++find_bridged_netdev () { ++ local bridge=$1 ++ ++ bmac=`ip link show ${bridge} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'` ++ for i in `ls /sys/class/net/${bridge}/brif` ; do ++ mac=`ip link show ${i} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'` ++ if [ "${bmac}" = "${mac}" ] && [ ! "${bridge}" = "${i}" ] ; then ++ netdev=${i} ++ return 0 ++ fi ++ done ++ return 1 ++} ++ + # Usage: show_status dev bridge + # Print ifconfig and routes. + show_status () { +@@ -187,10 +202,11 @@ using loopback.nloopbacks= on the dom + + create_bridge ${bridge} + +- if link_exists "$vdev"; then ++ preiftransfer ++ . /etc/sysconfig/network/ifcfg-${hwddev} ++ if [ ! "$BONDING_MASTER" = yes ] && link_exists "$vdev"; then + mac=`ip link show ${netdev} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'` + ifup ${netdev} # To ensure there is an IP to transfer +- preiftransfer + transfer_addrs ${netdev} ${vdev} + ifdown ${netdev} + ip link set ${netdev} name ${pdev} +@@ -205,6 +221,13 @@ using loopback.nloopbacks= on the dom + add_to_bridge2 ${bridge} ${pdev} + ip link set ${netdev} up + ifup ${hwddev} ++ elif [ "$BONDING_MASTER" = yes ]; then ++ ip link set ${bridge} arp on ++ add_to_bridge ${bridge} ${vif0} ++ ip link set ${vif0} up ++ add_to_bridge2 ${bridge} ${netdev} ++ transfer_addrs ${netdev} ${bridge} ++ transfer_routes ${netdev} ${bridge} + else + # old style without ${vdev} + transfer_addrs ${netdev} ${bridge} +@@ -243,6 +266,10 @@ op_stop () { + ip link set ${pdev} name ${netdev} + ifup ${netdev} + else ++ if [ ${netdev} = ${bridge} ]; then ++ find_bridged_netdev ${bridge} ++ fi ++ ip link set dev ${vif0} down + transfer_routes ${bridge} ${netdev} + ip link set ${bridge} down + fi diff --git a/xen-changeset.diff b/xen-changeset.diff new file mode 100644 index 0000000..2da4d7e --- /dev/null +++ b/xen-changeset.diff @@ -0,0 +1,21 @@ +Index: xen-3.0.3-testing/xen/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/xen/Makefile ++++ xen-3.0.3-testing/xen/Makefile +@@ -3,6 +3,7 @@ + export XEN_VERSION = 3 + export XEN_SUBVERSION = 0 + export XEN_EXTRAVERSION ?= .3-0 ++export XEN_CHANGESET = unavailable + export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION) + -include xen-version + +@@ -103,7 +104,7 @@ include/xen/compile.h: include/xen/compi + -e 's/@@version@@/$(XEN_VERSION)/g' \ + -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \ + -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \ +- -e 's!@@changeset@@!$(shell ((hg parents || head -n 7 ../ChangeLog || echo date: unavailable) | awk '{FS="changeset:[ ]+"}/^changeset/{CS=$$2};{FS="date:[ ]+"}/^date/{D=$$2}; END {print D, CS}') 2>/dev/null)!g' \ ++ -e 's!@@changeset@@!$(XEN_CHANGESET)!g' \ + < include/xen/compile.h.in > $@.new + tools/figlet/figlet -d tools/figlet Xen $(XEN_FULLVERSION) >> $@.new + @mv -f $@.new $@ diff --git a/xen-config-defaults.diff b/xen-config-defaults.diff new file mode 100644 index 0000000..a1158a5 --- /dev/null +++ b/xen-config-defaults.diff @@ -0,0 +1,35 @@ +Index: xen-unstable/tools/examples/init.d/sysconfig.xendomains +=================================================================== +--- xen-unstable.orig/tools/examples/init.d/sysconfig.xendomains ++++ xen-unstable/tools/examples/init.d/sysconfig.xendomains +@@ -98,7 +98,6 @@ XENDOMAINS_RESTORE=true + # Note that the script tries to be clever if both RESTORE and AUTO are + # set: It will first restore saved domains and then only start domains + # in AUTO which are not running yet. +-# Note that the name matching is somewhat fuzzy. + # + XENDOMAINS_AUTO=/etc/xen/auto + +@@ -109,9 +108,8 @@ XENDOMAINS_AUTO=/etc/xen/auto + # files in XENDOMAINS_AUTO will be treated according to XENDOMAINS_SYSRQ, + # XENDOMAINS_MIGRATE, XENDOMAINS_SAVE, XENDMAINS_SHUTDOWN; otherwise + # all running domains will be. +-# Note that the name matching is somewhat fuzzy. + # +-XENDOMAINS_AUTO_ONLY=false ++XENDOMAINS_AUTO_ONLY=true + + ## Type: integer + ## Default: 300 +Index: xen-unstable/tools/examples/xend-config.sxp +=================================================================== +--- xen-unstable.orig/tools/examples/xend-config.sxp ++++ xen-unstable/tools/examples/xend-config.sxp +@@ -19,7 +19,6 @@ + #(xend-tcp-xmlrpc-server no) + #(xend-unix-xmlrpc-server yes) + #(xend-relocation-server no) +-(xend-relocation-server yes) + + #(xend-unix-path /var/lib/xend/xend-socket) + diff --git a/xen-console.diff b/xen-console.diff new file mode 100644 index 0000000..f2288bc --- /dev/null +++ b/xen-console.diff @@ -0,0 +1,63 @@ +Subject: video mode detection (161541) + +Charles, attached the promised patch for replacing xen-console.diff. Jan + +Index: xen-unstable/xen/drivers/video/vga.c +=================================================================== +--- xen-unstable.orig/xen/drivers/video/vga.c ++++ xen-unstable/xen/drivers/video/vga.c +@@ -573,6 +573,30 @@ string_param("vga", opt_vga); + #define ATTRIBUTE 7 + #define VIDEO_SIZE (COLUMNS * LINES * 2) + ++static int gfx_vga(void) ++{ ++ unsigned char idx, data; ++ ++ idx = inb(0x3ce); ++ outb(0x06, 0x3ce); ++ data = inb(0x3cf); ++ outb(idx, 0x3ce); ++ ++ if ( data & 0x01 ) ++ return 1; ++ ++ /* Unfortunately many cards don't reflect their mode in the GDC ++ * miscellaneous register, bit 0 (and even fewer reflect it in the ++ * ATC mode control register, bit 0). Therefore we further check ++ * horizontal display width against our original setting. */ ++ idx = inb(0x3d4); ++ outb(0x01, 0x3d4); ++ data = inb(0x3d5); ++ outb(idx, 0x3d4); ++ ++ return data != COLUMNS - 1; ++} ++ + void vga_init(void) + { + char *p; +@@ -656,14 +680,21 @@ static void put_newline(void) + + void vga_putchar(int c) + { ++ static int vga_in_gfx = -1; ++ + if ( !vgacon_enabled ) + return; + ++ if ( vga_in_gfx < 0 ) ++ vga_in_gfx = gfx_vga(); ++ + if ( c == '\n' ) + { +- put_newline(); ++ if ( vga_in_gfx <= 0 ) ++ put_newline(); ++ vga_in_gfx = -1; + } +- else ++ else if ( vga_in_gfx <= 0 ) + { + if ( xpos >= COLUMNS ) + put_newline(); diff --git a/xen-destdir.diff b/xen-destdir.diff new file mode 100644 index 0000000..d3ff556 --- /dev/null +++ b/xen-destdir.diff @@ -0,0 +1,151 @@ +Index: xen-3.0.3-testing/docs/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/docs/Makefile ++++ xen-3.0.3-testing/docs/Makefile +@@ -12,8 +12,8 @@ LATEX2HTML := latex2html + DOXYGEN := doxygen + POD2MAN := pod2man + +-pkgdocdir := /usr/share/doc/xen +-mandir := /usr/share/man ++pkgdocdir := $(DOCDIR) ++mandir := $(MANDIR) + + DOC_MAN5SRC := $(wildcard man/*.pod.5) + DOC_MAN1SRC := $(wildcard man/*.pod.1) +Index: xen-3.0.3-testing/tools/xentrace/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/tools/xentrace/Makefile ++++ xen-3.0.3-testing/tools/xentrace/Makefile +@@ -43,14 +43,14 @@ install: build + [ -d $(DESTDIR)/usr/bin ] || $(INSTALL_DIR) $(DESTDIR)/usr/bin + [ -z "$(LIBBIN)" ] || [ -d $(DESTDIR)/usr/$(LIBDIR)/xen/bin ] || \ + $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)/xen/bin +- [ -d $(DESTDIR)/usr/share/man/man1 ] || \ +- $(INSTALL_DIR) $(DESTDIR)/usr/share/man/man1 +- [ -d $(DESTDIR)/usr/share/man/man8 ] || \ +- $(INSTALL_DIR) $(DESTDIR)/usr/share/man/man8 ++ [ -d $(DESTDIR)$(MANDIR)/man1 ] || \ ++ $(INSTALL_DIR) $(DESTDIR)$(MANDIR)/man1 ++ [ -d $(DESTDIR)$(MANDIR)/man8 ] || \ ++ $(INSTALL_DIR) $(DESTDIR)$(MANDIR)/man8 + $(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)/usr/bin + [ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)/usr/$(LIBDIR)/xen/bin +- $(INSTALL_DATA) $(MAN1) $(DESTDIR)/usr/share/man/man1 +- $(INSTALL_DATA) $(MAN8) $(DESTDIR)/usr/share/man/man8 ++ $(INSTALL_DATA) $(MAN1) $(DESTDIR)$(MANDIR)/man1 ++ $(INSTALL_DATA) $(MAN8) $(DESTDIR)$(MANDIR)/man8 + + .PHONY: clean + clean: +Index: xen-3.0.3-testing/tools/examples/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/tools/examples/Makefile ++++ xen-3.0.3-testing/tools/examples/Makefile +@@ -43,18 +43,6 @@ XEN_HOTPLUG_SCRIPTS = xen-backend.agent + UDEV_RULES_DIR = /etc/udev + UDEV_RULES = xen-backend.rules + +-DI = $(if $(DISTDIR),$(shell readlink -f $(DISTDIR)),) +-DE = $(if $(DESTDIR),$(shell readlink -f $(DESTDIR)),) +-ifeq ($(findstring $(DI),$(DE)),$(DI)) +-HOTPLUGS=install-hotplug install-udev +-else +-ifeq ($(shell [ -x /usr/bin/udevinfo ] && [ `/usr/bin/udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/'` -ge 059 ] && echo 1),1) +-HOTPLUGS=install-udev +-else +-HOTPLUGS=install-hotplug +-endif +-endif +- + .PHONY: all + all: + +@@ -62,15 +50,15 @@ all: + build: + + .PHONY: install +-install: all install-initd install-configs install-scripts $(HOTPLUGS) ++install: all install-initd install-configs install-scripts install-udev + + .PHONY: install-initd + install-initd: + [ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d +- [ -d $(DESTDIR)/etc/sysconfig ] || $(INSTALL_DIR) $(DESTDIR)/etc/sysconfig ++ [ -d $(DESTDIR)/var/adm/fillup-templates ] || $(INSTALL_DIR) $(DESTDIR)/var/adm/fillup-templates/ + $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d + $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d +- $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)/etc/sysconfig/xendomains ++ $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)/var/adm/fillup-templates/ + + .PHONY: install-configs + install-configs: $(XEN_CONFIGS) +@@ -111,9 +99,7 @@ install-udev: + $(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d + for i in $(UDEV_RULES); \ + do \ +- $(INSTALL_DATA) $$i $(DESTDIR)$(UDEV_RULES_DIR); \ +- ( cd $(DESTDIR)$(UDEV_RULES_DIR)/rules.d ; \ +- ln -sf ../$$i . ) \ ++ $(INSTALL_DATA) $$i $(DESTDIR)$(UDEV_RULES_DIR)/rules.d; \ + done + + .PHONY: clean +Index: xen-3.0.3-testing/tools/security/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/tools/security/Makefile ++++ xen-3.0.3-testing/tools/security/Makefile +@@ -73,9 +73,9 @@ install: all $(ACM_CONFIG_FILE) + $(INSTALL_DIR) -p $(DESTDIR)$(ACM_SECGEN_CGIDIR) + $(INSTALL_PROG) -p $(ACM_INST_CGI) $(DESTDIR)$(ACM_SECGEN_CGIDIR) + ifndef XEN_PYTHON_NATIVE_INSTALL +- python python/setup.py install --home="$(DESTDIR)/usr" ++ python python/setup.py install --home="$(DESTDIR)/usr" --prefix="" + else +- python python/setup.py install --root="$(DESTDIR)" ++ python python/setup.py install --root="$(DESTDIR)" --prefix="/usr" + endif + else + .PHONY: all +Index: xen-3.0.3-testing/tools/pygrub/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/tools/pygrub/Makefile ++++ xen-3.0.3-testing/tools/pygrub/Makefile +@@ -15,7 +15,7 @@ install: all + $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xen + else + install: all +- CFLAGS="$(CFLAGS)" python setup.py install --root="$(DESTDIR)" ++ CFLAGS="$(CFLAGS)" python setup.py install --root="$(DESTDIR)" --prefix="/usr" + $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xen + endif + +Index: xen-3.0.3-testing/tools/python/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/Makefile ++++ xen-3.0.3-testing/tools/python/Makefile +@@ -14,7 +14,7 @@ install: all + CFLAGS="$(CFLAGS)" python setup.py install --home="$(DESTDIR)/usr" --prefix="" --force + else + install: all +- CFLAGS="$(CFLAGS)" python setup.py install --root="$(DESTDIR)" --force ++ CFLAGS="$(CFLAGS)" python setup.py install --root="$(DESTDIR)" --prefix="/usr" --force + endif + + .PHONY: test +Index: xen-3.0.3-testing/xen/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/xen/Makefile ++++ xen-3.0.3-testing/xen/Makefile +@@ -31,8 +31,11 @@ _install: $(TARGET).gz + $(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_FULLVERSION) + [ -d $(DESTDIR)/usr/include/xen/io ] || \ + $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/io ++ [ -d $(DESTDIR)/usr/include/xen/hvm ] || \ ++ $(INSTALL_DIR) $(DESTDIR)/usr/include/xen/hvm + $(INSTALL_DATA) include/public/*.h $(DESTDIR)/usr/include/xen + $(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io ++ $(INSTALL_DATA) include/public/hvm/*.h $(DESTDIR)/usr/include/xen/hvm + $(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen + + .PHONY: _debug diff --git a/xen-docs.diff b/xen-docs.diff new file mode 100644 index 0000000..92479fd --- /dev/null +++ b/xen-docs.diff @@ -0,0 +1,30 @@ +Index: xen-3.0.3-testing/docs/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/docs/Makefile ++++ xen-3.0.3-testing/docs/Makefile +@@ -86,13 +86,13 @@ distclean: clean + .PHONY: install + install: all + rm -rf $(DESTDIR)$(pkgdocdir) +- $(INSTALL_DIR) $(DESTDIR)$(pkgdocdir) ++ $(INSTALL_DIR) $(DESTDIR)$(pkgdocdir)/html + cp -dR ps $(DESTDIR)$(pkgdocdir) + cp -dR pdf $(DESTDIR)$(pkgdocdir) ++ cp -dR html.done/* $(DESTDIR)$(pkgdocdir)/html + $(INSTALL_DIR) $(DESTDIR)$(mandir) + cp -dR man1 $(DESTDIR)$(mandir) + cp -dR man5 $(DESTDIR)$(mandir) +- [ ! -d html ] || cp -dR html $(DESTDIR)$(pkgdocdir) + + pdf/%.pdf: ps/%.ps + $(INSTALL_DIR) $(@D) +@@ -116,3 +116,9 @@ html/%/index.html: src/%.tex + $(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \ + -numbered_footnotes -local_icons -noinfo -math -dir $(@D) \ + $< 1>/dev/null 2>/dev/null ++ rm -rf html.done/$*/ ++ mkdir -p html.done/$*/ ++ cp html/$*/*.html html/$*/*.css html/$*/*.png html.done/$*/ ++ ln -sf $*.html html.done/$*/index.html ++ rm -rf html/ ++ diff --git a/xen-domUloader-pygrub.diff b/xen-domUloader-pygrub.diff new file mode 100644 index 0000000..e07578e --- /dev/null +++ b/xen-domUloader-pygrub.diff @@ -0,0 +1,16 @@ +Index: xen-unstable/tools/pygrub/src/pygrub +=================================================================== +--- xen-unstable.orig/tools/pygrub/src/pygrub ++++ xen-unstable/tools/pygrub/src/pygrub +@@ -432,9 +432,9 @@ if __name__ == "__main__": + print >> sys.stderr, "Usage: %s [-q|--quiet] [--output=] [--entry=] " %(sys.argv[0],) + + try: +- opts, args = getopt.gnu_getopt(sys.argv[1:], 'qh::', ++ opts, args = getopt.gnu_getopt(sys.argv[1:], 'qvh::', + ["quiet", "help", "output=", "entry=", +- "isconfig"]) ++ "isconfig", "root=", "disks=", "verbose="]) + except getopt.GetoptError: + usage() + sys.exit(1) diff --git a/xen-domUloader.diff b/xen-domUloader.diff new file mode 100644 index 0000000..7c86621 --- /dev/null +++ b/xen-domUloader.diff @@ -0,0 +1,123 @@ +Index: xen-3.0.3-testing/tools/python/xen/xm/create.py +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/xen/xm/create.py ++++ xen-3.0.3-testing/tools/python/xen/xm/create.py +@@ -126,7 +126,7 @@ gopts.var('bootloader', val='FILE', + use="Path to bootloader.") + + gopts.var('bootargs', val='NAME', +- fn=set_value, default=None, ++ fn=set_value, default='', + use="Arguments to pass to boot loader") + + gopts.var('bootentry', val='NAME', +@@ -649,16 +649,17 @@ def run_bootloader(vals, config_image): + err("Bootloader isn't executable") + if len(vals.disk) < 1: + err("No disks configured and boot loader requested") +- (uname, dev, mode, backend) = vals.disk[0] +- file = blkif.blkdev_uname_to_file(uname) + + if vals.bootentry: + warn("The bootentry option is deprecated. Use bootargs and pass " + "--entry= directly.") + vals.bootargs = "--entry=%s" %(vals.bootentry,) ++ if vals.root: ++ vals.bootargs += " --root=%s" % vals.root.split()[0] ++ vals.bootargs += " --disks=\"%s\"" % str(vals.disk) + +- return bootloader(vals.bootloader, file, not vals.console_autoconnect, +- vals.bootargs, config_image) ++ return bootloader(vals.bootloader, not vals.console_autoconnect, ++ vals.dryrun, vals.bootargs, config_image) + + def make_config(vals): + """Create the domain configuration. +Index: xen-3.0.3-testing/tools/python/xen/xend/XendBootloader.py +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/xen/xend/XendBootloader.py ++++ xen-3.0.3-testing/tools/python/xen/xend/XendBootloader.py +@@ -20,11 +20,9 @@ import shlex + from XendLogging import log + from XendError import VmError + +-def bootloader(blexec, disk, quiet = 0, blargs = None, imgcfg = None): +- """Run the boot loader executable on the given disk and return a +- config image. ++def bootloader(blexec, quiet = 0, dryrun = 0, blargs = None, imgcfg = None): ++ """Run the boot loader executable and return a config image. + @param blexec Binary to use as the boot loader +- @param disk Disk to run the boot loader on. + @param quiet Run in non-interactive mode, just booting the default. + @param blargs Arguments to pass to the bootloader.""" + +@@ -32,10 +30,6 @@ def bootloader(blexec, disk, quiet = 0, + msg = "Bootloader isn't executable" + log.error(msg) + raise VmError(msg) +- if not os.access(disk, os.R_OK): +- msg = "Disk isn't accessible" +- log.error(msg) +- raise VmError(msg) + + while True: + fifo = "/var/lib/xen/xenbl.%s" %(random.randint(0, 32000),) +@@ -48,10 +42,11 @@ def bootloader(blexec, disk, quiet = 0, + args = [ blexec ] + if quiet: + args.append("-q") ++ if dryrun: ++ args.append("--dryrun") + args.append("--output=%s" %(fifo,)) + if blargs is not None: + args.extend(shlex.split(blargs)) +- args.append(disk) + + try: + os.execvp(args[0], args) +@@ -68,6 +63,7 @@ def bootloader(blexec, disk, quiet = 0, + continue + break + ret = "" ++ # TODO: Add timeout, cleanup and raise VmError if it occurs + while 1: + select.select([r], [], []) + s = os.read(r, 1024) +Index: xen-3.0.3-testing/tools/python/xen/xend/XendDomainInfo.py +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/xen/xend/XendDomainInfo.py ++++ xen-3.0.3-testing/tools/python/xen/xend/XendDomainInfo.py +@@ -1743,18 +1743,27 @@ class XendDomainInfo: + if not self.info['bootloader']: + return + blcfg = None +- # FIXME: this assumes that we want to use the first disk device ++ """This code is currently unneeded, but will be used ++ again when boot device selection is more dynamic. ++ vbds = [] + for (n,c) in self.info['device']: + if not n or not c or not(n in ["vbd", "tap"]): + continue + disk = sxp.child_value(c, "uname") + if disk is None: + continue +- fn = blkdev_uname_to_file(disk) +- blcfg = bootloader(self.info['bootloader'], fn, 1, +- self.info['bootloader_args'], +- self.info['image']) +- break ++ vbds.append([sxp.child_value(c, "uname"), ++ sxp.child_value(c, "dev"), ++ sxp.child_value(c, "mode"), ++ sxp.child_value(c, "backend")]) ++ if vbds: ++ bootargs = self.info['bootloader_args'] + \ ++ " --disks=\"%s\"" % str(vbds) ++ if self.info['root']: ++ bootargs += " --root=%s" % self.info['root'].split()[0] ++ """ ++ blcfg = bootloader(self.info['bootloader'], 1, 0, ++ self.info['bootloader_args'], self.info['image']) + if blcfg is None: + msg = "Had a bootloader specified, but can't find disk" + log.error(msg) diff --git a/xen-enable-hvm-debug.diff b/xen-enable-hvm-debug.diff new file mode 100644 index 0000000..2d963e1 --- /dev/null +++ b/xen-enable-hvm-debug.diff @@ -0,0 +1,110 @@ +Index: xen-unstable/tools/firmware/vmxassist/vm86.c +=================================================================== +--- xen-unstable.orig/tools/firmware/vmxassist/vm86.c ++++ xen-unstable/tools/firmware/vmxassist/vm86.c +@@ -38,7 +38,7 @@ unsigned prev_eip = 0; + enum vm86_mode mode; + + #ifdef DEBUG +-int traceset = 0; ++int traceset = 0xffffffff; + + char *states[] = { + "", +@@ -72,6 +72,35 @@ address(struct regs *regs, unsigned seg, + return addr; + } + ++void ++panic_eip(struct regs *regs, char *fmt, ...) ++{ ++ va_list ap; ++ va_start(ap, fmt); ++ vprintf(fmt, ap); ++ printf("\n"); ++ va_end(ap); ++#ifdef DEBUG ++ if (regs->eflags & EFLAGS_VM) { ++ unsigned int range = 20; ++ unsigned int eip = address(regs, regs->cs, regs->eip); ++ unsigned int start = (eip < range) ? 0 : eip - range; ++ unsigned int stop = (eip > 0x100000 - range) ? 0x100000 : eip + range; ++ int size = (stop - start); ++ unsigned int i; ++ unsigned char data[size]; ++ ++ printf("Dumping %x..%x eip=%x\n", start, stop, eip); ++ for (i = start; i < stop; ++i) ++ data[i-start] = *(unsigned char *) i; ++ hexdump(data, size); ++ } ++#else ++ regs = regs; ++#endif ++ halt(); ++} ++ + #ifdef DEBUG + void + trace(struct regs *regs, int adjust, char *fmt, ...) +@@ -1037,7 +1066,7 @@ emulate(struct regs *regs) + /* detect the case where we are not making progress */ + if (nemul == 0 && prev_eip == regs->eip) { + flteip = address(regs, MASK16(regs->cs), regs->eip); +- panic("Unknown opcode at %04x:%04x=0x%x", ++ panic_eip(regs, "Unknown opcode at %04x:%04x=0x%x", + MASK16(regs->cs), regs->eip, flteip); + } else + prev_eip = regs->eip; +@@ -1061,7 +1090,7 @@ trap(int trapno, int errno, struct regs + if (regs->eflags & EFLAGS_VM) { + /* emulate any 8086 instructions */ + if (mode != VM86_REAL_TO_PROTECTED) +- panic("not in real-to-protected mode"); ++ panic_eip(regs, "not in real-to-protected mode"); + emulate(regs); + return; + } +@@ -1071,7 +1100,7 @@ trap(int trapno, int errno, struct regs + if (regs->eflags & EFLAGS_VM) { + /* emulate any 8086 instructions */ + if (mode == VM86_PROTECTED) +- panic("unexpected protected mode"); ++ panic_eip(regs, "unexpected protected mode"); + emulate(regs); + return; + } +Index: xen-unstable/tools/firmware/rombios/rombios.c +=================================================================== +--- xen-unstable.orig/tools/firmware/rombios/rombios.c ++++ xen-unstable/tools/firmware/rombios/rombios.c +@@ -129,18 +129,18 @@ + // + // BCC Bug: find a generic way to handle the bug of #asm after an "if" (fixed in 0.16.7) + +-#define DEBUG_ROMBIOS 0 ++#define DEBUG_ROMBIOS 1 + +-#define DEBUG_ATA 0 +-#define DEBUG_INT13_HD 0 +-#define DEBUG_INT13_CD 0 +-#define DEBUG_INT13_ET 0 +-#define DEBUG_INT13_FL 0 +-#define DEBUG_INT15 0 +-#define DEBUG_INT16 0 +-#define DEBUG_INT1A 0 +-#define DEBUG_INT74 0 +-#define DEBUG_APM 0 ++#define DEBUG_ATA 1 ++#define DEBUG_INT13_HD 1 ++#define DEBUG_INT13_CD 1 ++#define DEBUG_INT13_ET 1 ++#define DEBUG_INT13_FL 1 ++#define DEBUG_INT15 1 ++#define DEBUG_INT16 1 ++#define DEBUG_INT1A 1 ++#define DEBUG_INT74 1 ++#define DEBUG_APM 1 + + #define BX_CPU 3 + #define BX_USE_PS2_MOUSE 1 diff --git a/xen-hvm-default-bridge.diff b/xen-hvm-default-bridge.diff new file mode 100644 index 0000000..e62a67c --- /dev/null +++ b/xen-hvm-default-bridge.diff @@ -0,0 +1,86 @@ +Index: xen-3.0.3-testing/tools/examples/xend-config.sxp +=================================================================== +--- xen-3.0.3-testing.orig/tools/examples/xend-config.sxp ++++ xen-3.0.3-testing/tools/examples/xend-config.sxp +@@ -76,7 +76,8 @@ + # + # (network-script 'network-bridge netdev=eth1') + # +-# The bridge is named xenbr0, by default. To rename the bridge, use ++# The bridge is named to match the outgoing interface, by default. For example, ++# eth1 is on xenbr1. To rename the bridge, use + # + # (network-script 'network-bridge bridge=') + # +Index: xen-3.0.3-testing/tools/ioemu/vl.c +=================================================================== +--- xen-3.0.3-testing.orig/tools/ioemu/vl.c ++++ xen-3.0.3-testing/tools/ioemu/vl.c +@@ -89,7 +89,6 @@ + #include "exec-all.h" + + #define DEFAULT_NETWORK_SCRIPT "/etc/xen/qemu-ifup" +-#define DEFAULT_BRIDGE "xenbr0" + + //#define DEBUG_UNUSED_IOPORT + //#define DEBUG_IOPORT +@@ -3773,10 +3772,10 @@ int net_client_init(const char *str) + if (get_param_value(setup_script, sizeof(setup_script), "script", p) == 0) { + pstrcpy(setup_script, sizeof(setup_script), DEFAULT_NETWORK_SCRIPT); + } +- if (get_param_value(bridge, sizeof(bridge), "bridge", p) == 0) { +- pstrcpy(bridge, sizeof(bridge), DEFAULT_BRIDGE); +- } +- ret = net_tap_init(vlan, ifname, setup_script, bridge); ++ if (get_param_value(bridge, sizeof(bridge), "bridge", p) == 0) ++ ret = net_tap_init(vlan, ifname, setup_script, NULL); ++ else ++ ret = net_tap_init(vlan, ifname, setup_script, bridge); + } + } else + #endif +Index: xen-3.0.3-testing/tools/python/xen/xend/image.py +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/xen/xend/image.py ++++ xen-3.0.3-testing/tools/python/xen/xend/image.py +@@ -339,13 +339,16 @@ class HVMImageHandler(ImageHandler): + mac = sxp.child_value(info, 'mac') + if mac == None: + mac = randomMAC() +- bridge = sxp.child_value(info, 'bridge', 'xenbr0') ++ bridge = sxp.child_value(info, 'bridge', None) + model = sxp.child_value(info, 'model', 'rtl8139') + ret.append("-net") + ret.append("nic,vlan=%d,macaddr=%s,model=%s" % + (nics, mac, model)) + ret.append("-net") +- ret.append("tap,vlan=%d,bridge=%s" % (nics, bridge)) ++ net = "tap,vlan=%d" % (nics,) ++ if bridge: ++ net += ",bridge=%s" % (bridge,) ++ ret.append(net) + return ret + + def configVNC(self, config): +Index: xen-3.0.3-testing/tools/ioemu/target-i386-dm/qemu-ifup +=================================================================== +--- xen-3.0.3-testing.orig/tools/ioemu/target-i386-dm/qemu-ifup ++++ xen-3.0.3-testing/tools/ioemu/target-i386-dm/qemu-ifup +@@ -1,10 +1,11 @@ + #!/bin/sh + +-#. /etc/rc.d/init.d/functions +-#ulimit -c unlimited +- +-echo -c 'config qemu network with xen bridge for ' +-echo $* ++bridge=$2 ++if [ -z "$bridge" ]; then ++ brnum=$(ip route list | awk '/^default / { print $NF }' | sed 's/^[^0-9]*//') ++ brnum=${brnum:-0} ++ bridge=xenbr${brnum} ++fi + + ifconfig $1 0.0.0.0 up +-brctl addif $2 $1 ++brctl addif $bridge $1 diff --git a/xen-hvm-default-pae.diff b/xen-hvm-default-pae.diff new file mode 100644 index 0000000..51eb1c7 --- /dev/null +++ b/xen-hvm-default-pae.diff @@ -0,0 +1,15 @@ +PAE must be on for 64-on-64 to work at all. + +Index: xen-3.0.3-testing/tools/python/xen/xend/image.py +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/xen/xend/image.py ++++ xen-3.0.3-testing/tools/python/xen/xend/image.py +@@ -263,7 +263,7 @@ class HVMImageHandler(ImageHandler): + + self.dmargs += self.configVNC(imageConfig) + +- self.pae = int(sxp.child_value(imageConfig, 'pae', 0)) ++ self.pae = int(sxp.child_value(imageConfig, 'pae', 1)) + + self.acpi = int(sxp.child_value(imageConfig, 'acpi', 0)) + self.apic = int(sxp.child_value(imageConfig, 'apic', 0)) diff --git a/xen-hvm-netfront.diff b/xen-hvm-netfront.diff new file mode 100644 index 0000000..0bf601d --- /dev/null +++ b/xen-hvm-netfront.diff @@ -0,0 +1,18 @@ +Index: xen-3.0.3-testing/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +=================================================================== +--- xen-3.0.3-testing.orig/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c ++++ xen-3.0.3-testing/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +@@ -275,6 +275,13 @@ static int __devinit netfront_probe(stru + int err; + struct net_device *netdev; + struct netfront_info *info; ++ unsigned int handle; ++ ++ err = xenbus_scanf(XBT_NIL, dev->nodename, "handle", "%u", &handle); ++ if (err != 1) { ++ xenbus_dev_fatal(dev, err, "reading handle"); ++ return err; ++ } + + netdev = create_netdev(dev); + if (IS_ERR(netdev)) { diff --git a/xen-io-register-context.diff b/xen-io-register-context.diff new file mode 100644 index 0000000..e27b037 --- /dev/null +++ b/xen-io-register-context.diff @@ -0,0 +1,680 @@ +From: Jan Beulich +Bugzilla #192150 + +Index: xen-unstable/xen/arch/x86/domain_build.c +=================================================================== +--- xen-unstable.orig/xen/arch/x86/domain_build.c ++++ xen-unstable/xen/arch/x86/domain_build.c +@@ -33,6 +33,11 @@ + extern unsigned long initial_images_nrpages(void); + extern void discard_initial_images(void); + ++/* I/O-port Xen-enforced or admin-specified access control. */ ++struct rangeset *ioport_caps = NULL; ++/* I/O-port admin-specified non-special access requirements. */ ++struct rangeset *ioport_emul = NULL; ++ + static long dom0_nrpages; + + /* +@@ -64,6 +69,12 @@ integer_param("dom0_max_vcpus", opt_dom0 + static unsigned int opt_dom0_shadow; + boolean_param("dom0_shadow", opt_dom0_shadow); + ++static char opt_ioports_noemul[200] = ""; ++string_param("ioports_noemul", opt_ioports_noemul); ++ ++static char opt_ioports_disable[200] = ""; ++string_param("ioports_disable", opt_ioports_disable); ++ + static char opt_dom0_ioports_disable[200] = ""; + string_param("dom0_ioports_disable", opt_dom0_ioports_disable); + +@@ -103,10 +114,10 @@ static struct page_info *alloc_chunk(str + return page; + } + +-static void process_dom0_ioports_disable(void) ++static void process_ioports(char *opt) + { + unsigned long io_from, io_to; +- char *t, *u, *s = opt_dom0_ioports_disable; ++ char *t, *u, *s = opt; + + if ( *s == '\0' ) + return; +@@ -118,7 +129,9 @@ static void process_dom0_ioports_disable + { + parse_error: + printk("Invalid ioport range <%s> " +- "in dom0_ioports_disable, skipping\n", t); ++ "in %sioports_%s, skipping\n", t, ++ opt == opt_dom0_ioports_disable ? "dom0_" : "", ++ opt != opt_ioports_noemul ? "disable" : "noemul"); + continue; + } + +@@ -132,11 +145,26 @@ static void process_dom0_ioports_disable + if ( (*u != '\0') || (io_to < io_from) || (io_to >= 65536) ) + goto parse_error; + +- printk("Disabling dom0 access to ioport range %04lx-%04lx\n", +- io_from, io_to); ++ if ( opt != opt_ioports_noemul ) ++ { ++ printk("Disabling %saccess to ioport range %04lx-%04lx\n", ++ opt != opt_ioports_disable ? "dom0 " : "", ++ io_from, io_to); + +- if ( ioports_deny_access(dom0, io_from, io_to) != 0 ) +- BUG(); ++ if ( opt == opt_ioports_disable ++ && ioports_deny_access_all(io_from, io_to) != 0 ) ++ BUG(); ++ if ( ioports_deny_access(dom0, io_from, io_to) != 0 ) ++ BUG(); ++ } ++ else ++ { ++ printk("Setting non-emulated access for ioport range %04lx-%04lx\n", ++ io_from, io_to); ++ ++ if ( ioports_set_noemul(io_from, io_to) != 0 ) ++ BUG(); ++ } + } + } + +@@ -812,6 +840,13 @@ int construct_dom0(struct domain *d, + + rc = 0; + ++ /* Command-line I/O ranges. */ ++ ioport_caps = rangeset_new(NULL, ++ "global I/O Port access control", ++ RANGESETF_prettyprint_hex); ++ BUG_ON(!ioport_caps); ++ rc |= ioports_permit_access_all(0, 0xFFFF); ++ + /* DOM0 is permitted full I/O capabilities. */ + rc |= ioports_permit_access(dom0, 0, 0xFFFF); + rc |= iomem_permit_access(dom0, 0UL, ~0UL); +@@ -821,15 +856,20 @@ int construct_dom0(struct domain *d, + * Modify I/O port access permissions. + */ + /* Master Interrupt Controller (PIC). */ ++ rc |= ioports_deny_access_all(0x20, 0x21); + rc |= ioports_deny_access(dom0, 0x20, 0x21); + /* Slave Interrupt Controller (PIC). */ ++ rc |= ioports_deny_access_all(0xA0, 0xA1); + rc |= ioports_deny_access(dom0, 0xA0, 0xA1); + /* Interval Timer (PIT). */ ++ rc |= ioports_deny_access_all(0x40, 0x43); + rc |= ioports_deny_access(dom0, 0x40, 0x43); + /* PIT Channel 2 / PC Speaker Control. */ ++ rc |= ioports_deny_access_all(0x61, 0x61); + rc |= ioports_deny_access(dom0, 0x61, 0x61); + /* Command-line I/O ranges. */ +- process_dom0_ioports_disable(); ++ process_ioports(opt_ioports_disable); ++ process_ioports(opt_dom0_ioports_disable); + + /* + * Modify I/O memory access permissions. +@@ -848,6 +888,14 @@ int construct_dom0(struct domain *d, + rc |= iomem_deny_access(dom0, mfn, mfn); + } + ++ /* Command-line I/O ranges requiring full register context access. */ ++ ioport_emul = rangeset_new(NULL, ++ "I/O Port emulation control", ++ RANGESETF_prettyprint_hex); ++ BUG_ON(!ioport_emul); ++ rc |= ioports_set_emul(0, 0xFFFF); ++ process_ioports(opt_ioports_noemul); ++ + BUG_ON(rc != 0); + + return 0; +Index: xen-unstable/xen/arch/x86/sysctl.c +=================================================================== +--- xen-unstable.orig/xen/arch/x86/sysctl.c ++++ xen-unstable/xen/arch/x86/sysctl.c +@@ -57,6 +57,23 @@ long arch_do_sysctl( + } + break; + ++ case XEN_SYSCTL_ioport_emulation: ++ { ++ unsigned int fp = sysctl->u.ioport_emulation.first_port; ++ unsigned int np = sysctl->u.ioport_emulation.nr_ports; ++ ++ ret = -EINVAL; ++ if ( (fp + np) > 65536 ) ++ break; ++ ++ if ( np == 0 ) ++ ret = 0; ++ else if ( sysctl->u.ioport_emulation.emulate ) ++ ret = ioports_set_emul(fp, fp + np - 1); ++ else ++ ret = ioports_set_noemul(fp, fp + np - 1); ++ } ++ break; + + default: + ret = -ENOSYS; +Index: xen-unstable/xen/arch/x86/traps.c +=================================================================== +--- xen-unstable.orig/xen/arch/x86/traps.c ++++ xen-unstable/xen/arch/x86/traps.c +@@ -1002,9 +1002,20 @@ static inline int admin_io_okay( + return ioports_access_permitted(v->domain, port, port + bytes - 1); + } + ++typedef unsigned long io_emul_stub_t(struct cpu_user_regs *) __attribute__((__regparm__(1))); ++long io_emul_stub_offset = 0, io_emul_insn_offset = 0; ++ ++/* Can the I/O access be carried out without full register context? */ ++static inline int normal_io_okay( ++ unsigned int port, unsigned int bytes) ++{ ++ return ioports_emul(port, port + bytes - 1); ++} ++ + /* Check admin limits. Silently fail the access if it is disallowed. */ + static inline unsigned char inb_user( +- unsigned int port, struct vcpu *v, struct cpu_user_regs *regs) ++ unsigned int port, io_emul_stub_t *stub, ++ struct vcpu *v, struct cpu_user_regs *regs) + { + /* + * Allow read access to port 0x61. Bit 4 oscillates with period 30us, and +@@ -1014,18 +1025,54 @@ static inline unsigned char inb_user( + * but there's not really a good reason to do so. + */ + if ( admin_io_okay(port, 1, v, regs) || (port == 0x61) ) +- return inb(port); ++ return !stub || normal_io_okay(port, 1) ? inb(port) : stub(regs); + return ~0; + } +-//#define inb_user(_p, _d, _r) (admin_io_okay(_p, 1, _d, _r) ? inb(_p) : ~0) +-#define inw_user(_p, _d, _r) (admin_io_okay(_p, 2, _d, _r) ? inw(_p) : ~0) +-#define inl_user(_p, _d, _r) (admin_io_okay(_p, 4, _d, _r) ? inl(_p) : ~0) +-#define outb_user(_v, _p, _d, _r) \ +- (admin_io_okay(_p, 1, _d, _r) ? outb(_v, _p) : ((void)0)) +-#define outw_user(_v, _p, _d, _r) \ +- (admin_io_okay(_p, 2, _d, _r) ? outw(_v, _p) : ((void)0)) +-#define outl_user(_v, _p, _d, _r) \ +- (admin_io_okay(_p, 4, _d, _r) ? outl(_v, _p) : ((void)0)) ++ ++static inline unsigned short inw_user( ++ unsigned int port, io_emul_stub_t *stub, ++ struct vcpu *v, struct cpu_user_regs *regs) ++{ ++ if ( admin_io_okay(port, 2, v, regs) ) ++ return !stub || normal_io_okay(port, 2) ? inw(port) : stub(regs); ++ return ~0; ++} ++ ++static inline unsigned int inl_user( ++ unsigned int port, io_emul_stub_t *stub, ++ struct vcpu *v, struct cpu_user_regs *regs) ++{ ++ if ( admin_io_okay(port, 4, v, regs) ) ++ return !stub || normal_io_okay(port, 4) ? inl(port) : stub(regs); ++ return ~0; ++} ++ ++static inline void outb_user( ++ unsigned char value, unsigned int port, ++ io_emul_stub_t *stub, ++ struct vcpu *v, struct cpu_user_regs *regs) ++{ ++ if ( admin_io_okay(port, 1, v, regs) ) ++ !stub || normal_io_okay(port, 1) ? outb(value, port) : (void)stub(regs); ++} ++ ++static inline void outw_user( ++ unsigned short value, unsigned int port, ++ io_emul_stub_t *stub, ++ struct vcpu *v, struct cpu_user_regs *regs) ++{ ++ if ( admin_io_okay(port, 2, v, regs) ) ++ !stub || normal_io_okay(port, 2) ? outw(value, port) : (void)stub(regs); ++} ++ ++static inline void outl_user( ++ unsigned int value, unsigned int port, ++ io_emul_stub_t *stub, ++ struct vcpu *v, struct cpu_user_regs *regs) ++{ ++ if ( admin_io_okay(port, 4, v, regs) ) ++ !stub || normal_io_okay(port, 4) ? outl(value, port) : (void)stub(regs); ++} + + /* Instruction fetch with error handling. */ + #define insn_fetch(_type, _size, cs, eip) \ +@@ -1046,6 +1093,8 @@ static int emulate_privileged_op(struct + u8 opcode, modrm_reg = 0, modrm_rm = 0, rep_prefix = 0; + unsigned int port, i, op_bytes = 4, data, rc; + u32 l, h; ++ io_emul_stub_t *stub; ++ char *insn; + + /* Legacy prefixes. */ + for ( i = 0; i < 8; i++ ) +@@ -1103,13 +1152,13 @@ static int emulate_privileged_op(struct + switch ( op_bytes ) + { + case 1: +- data = (u8)inb_user((u16)regs->edx, v, regs); ++ data = (u8)inb_user((u16)regs->edx, NULL, v, regs); + break; + case 2: +- data = (u16)inw_user((u16)regs->edx, v, regs); ++ data = (u16)inw_user((u16)regs->edx, NULL, v, regs); + break; + case 4: +- data = (u32)inl_user((u16)regs->edx, v, regs); ++ data = (u32)inl_user((u16)regs->edx, NULL, v, regs); + break; + } + if ( (rc = copy_to_user((void *)regs->edi, &data, op_bytes)) != 0 ) +@@ -1135,13 +1184,13 @@ static int emulate_privileged_op(struct + switch ( op_bytes ) + { + case 1: +- outb_user((u8)data, (u16)regs->edx, v, regs); ++ outb_user((u8)data, (u16)regs->edx, NULL, v, regs); + break; + case 2: +- outw_user((u16)data, (u16)regs->edx, v, regs); ++ outw_user((u16)data, (u16)regs->edx, NULL, v, regs); + break; + case 4: +- outl_user((u32)data, (u16)regs->edx, v, regs); ++ outl_user((u32)data, (u16)regs->edx, NULL, v, regs); + break; + } + regs->esi += (int)((regs->eflags & EF_DF) ? -op_bytes : op_bytes); +@@ -1159,27 +1208,33 @@ static int emulate_privileged_op(struct + } + + /* I/O Port and Interrupt Flag instructions. */ ++ insn = (char *)get_stack_bottom(); ++ stub = (io_emul_stub_t *)(insn + io_emul_stub_offset); ++ insn += io_emul_insn_offset; ++ *insn++ = op_bytes != 2 ? 0x90 : 0x66; ++ *insn++ = opcode; + switch ( opcode ) + { + case 0xe4: /* IN imm8,%al */ + op_bytes = 1; + case 0xe5: /* IN imm8,%eax */ + port = insn_fetch(u8, 1, cs, eip); ++ *insn = port; + exec_in: + if ( !guest_io_okay(port, op_bytes, v, regs) ) + goto fail; + switch ( op_bytes ) + { + case 1: +- regs->eax &= ~0xffUL; +- regs->eax |= (u8)inb_user(port, v, regs); ++ res = regs->eax & ~0xffUL; ++ regs->eax = res | (u8)inb_user(port, stub, v, regs); + break; + case 2: +- regs->eax &= ~0xffffUL; +- regs->eax |= (u16)inw_user(port, v, regs); ++ res = regs->eax & ~0xffffUL; ++ regs->eax = res | (u16)inw_user(port, stub, v, regs); + break; + case 4: +- regs->eax = (u32)inl_user(port, v, regs); ++ regs->eax = (u32)inl_user(port, stub, v, regs); + break; + } + goto done; +@@ -1188,25 +1243,27 @@ static int emulate_privileged_op(struct + op_bytes = 1; + case 0xed: /* IN %dx,%eax */ + port = (u16)regs->edx; ++ *insn = 0x90; + goto exec_in; + + case 0xe6: /* OUT %al,imm8 */ + op_bytes = 1; + case 0xe7: /* OUT %eax,imm8 */ + port = insn_fetch(u8, 1, cs, eip); ++ *insn = port; + exec_out: + if ( !guest_io_okay(port, op_bytes, v, regs) ) + goto fail; + switch ( op_bytes ) + { + case 1: +- outb_user((u8)regs->eax, port, v, regs); ++ outb_user((u8)regs->eax, port, stub, v, regs); + break; + case 2: +- outw_user((u16)regs->eax, port, v, regs); ++ outw_user((u16)regs->eax, port, stub, v, regs); + break; + case 4: +- outl_user((u32)regs->eax, port, v, regs); ++ outl_user((u32)regs->eax, port, stub, v, regs); + break; + } + goto done; +@@ -1215,6 +1272,7 @@ static int emulate_privileged_op(struct + op_bytes = 1; + case 0xef: /* OUT %eax,%dx */ + port = (u16)regs->edx; ++ *insn = 0x90; + goto exec_out; + + case 0xfa: /* CLI */ +Index: xen-unstable/xen/arch/x86/x86_32/Makefile +=================================================================== +--- xen-unstable.orig/xen/arch/x86/x86_32/Makefile ++++ xen-unstable/xen/arch/x86/x86_32/Makefile +@@ -1,5 +1,6 @@ + obj-y += domain_page.o + obj-y += entry.o ++obj-y += io.o + obj-y += mm.o + obj-y += seg_fixup.o + obj-y += traps.o +Index: xen-unstable/xen/arch/x86/x86_32/io.S +=================================================================== +--- /dev/null ++++ xen-unstable/xen/arch/x86/x86_32/io.S +@@ -0,0 +1,42 @@ ++/* ++ * Special (full-context) I/O handling routines. ++ * ++ * Copyright (c) 2006, Novell, Inc. ++ */ ++ ++#include ++#include ++ ++ENTRY(save_host_restore_guest) ++ movl (%esp), %ecx ++ movl %eax, (%esp) ++ movl UREGS_edx(%eax), %edx ++ pushl %ebx ++ movl UREGS_ebx(%eax), %ebx ++ pushl %ebp ++ movl UREGS_ebp(%eax), %ebp ++ pushl %esi ++ movl UREGS_esi(%eax), %esi ++ pushl %edi ++ movl UREGS_edi(%eax), %edi ++ pushl %ecx ++ movl UREGS_ecx(%eax), %ecx ++ movl UREGS_eax(%eax), %eax ++ ret ++ ++ENTRY(save_guest_restore_host) ++ pushl %edx ++ movl 5*4(%esp), %edx ++ movl %eax, UREGS_eax(%edx) ++ popl UREGS_edx(%edx) ++ movl %edi, UREGS_edi(%edx) ++ popl %edi ++ movl %esi, UREGS_esi(%edx) ++ popl %esi ++ movl %ebp, UREGS_ebp(%edx) ++ popl %ebp ++ movl %ebx, UREGS_ebx(%edx) ++ popl %ebx ++ movl %ecx, UREGS_ecx(%edx) ++ popl %ecx ++ ret +Index: xen-unstable/xen/arch/x86/x86_32/traps.c +=================================================================== +--- xen-unstable.orig/xen/arch/x86/x86_32/traps.c ++++ xen-unstable/xen/arch/x86/x86_32/traps.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -250,6 +251,7 @@ fastcall void smp_deferred_nmi(struct cp + void __init percpu_traps_init(void) + { + struct tss_struct *tss = &doublefault_tss; ++ char *stack_bottom, *stack; + asmlinkage int hypercall(void); + + if ( smp_processor_id() != 0 ) +@@ -283,6 +285,28 @@ void __init percpu_traps_init(void) + (unsigned long)tss, 235, 9); + + set_task_gate(TRAP_double_fault, __DOUBLEFAULT_TSS_ENTRY<<3); ++ ++ /* ++ * Stub for full-context I/O emulation. ++ */ ++ stack_bottom = (char *)get_stack_bottom(); ++ stack = (char *)((unsigned long)stack_bottom & ~(STACK_SIZE - 1)); ++ if ( !io_emul_stub_offset ) ++ io_emul_stub_offset = stack - stack_bottom; ++ else ++ BUG_ON(io_emul_stub_offset != stack - stack_bottom); ++ /* call save_host_restore_guest */ ++ stack[0] = 0xe8; ++ *(s32*)&stack[1] = (char *)save_host_restore_guest - &stack[5]; ++ stack += 5; ++ if ( !io_emul_insn_offset ) ++ io_emul_insn_offset = stack - stack_bottom; ++ else ++ BUG_ON(io_emul_insn_offset != stack - stack_bottom); ++ stack += 3; /* operand size prefix, opcode, immediate */ ++ /* jmp save_guest_restore_host */ ++ stack[0] = 0xe9; ++ *(s32*)&stack[1] = (char *)save_guest_restore_host - &stack[5]; + } + + void init_int80_direct_trap(struct vcpu *v) +Index: xen-unstable/xen/arch/x86/x86_64/Makefile +=================================================================== +--- xen-unstable.orig/xen/arch/x86/x86_64/Makefile ++++ xen-unstable/xen/arch/x86/x86_64/Makefile +@@ -1,3 +1,4 @@ + obj-y += entry.o ++obj-y += io.o + obj-y += mm.o + obj-y += traps.o +Index: xen-unstable/xen/arch/x86/x86_64/io.S +=================================================================== +--- /dev/null ++++ xen-unstable/xen/arch/x86/x86_64/io.S +@@ -0,0 +1,62 @@ ++/* ++ * Special (full-context) I/O handling routines. ++ * ++ * Copyright (c) 2006, Novell, Inc. ++ */ ++ ++#include ++#include ++ ++ENTRY(save_host_restore_guest) ++ movq (%rsp), %rcx ++ movq %rdi, (%rsp) ++ movq UREGS_rdx(%rdi), %rdx ++ pushq %rbx ++ movq UREGS_rax(%rdi), %rax ++ movq UREGS_rbx(%rdi), %rbx ++ pushq %rbp ++ movq UREGS_rsi(%rdi), %rsi ++ movq UREGS_rbp(%rdi), %rbp ++ pushq %r12 ++ movq UREGS_r8(%rdi), %r8 ++ movq UREGS_r12(%rdi), %r12 ++ pushq %r13 ++ movq UREGS_r9(%rdi), %r9 ++ movq UREGS_r13(%rdi), %r13 ++ pushq %r14 ++ movq UREGS_r10(%rdi), %r10 ++ movq UREGS_r14(%rdi), %r14 ++ pushq %r15 ++ movq UREGS_r11(%rdi), %r11 ++ movq UREGS_r15(%rdi), %r15 ++ pushq %rcx ++ movq UREGS_rcx(%rdi), %rcx ++ movq UREGS_rdi(%rdi), %rdi ++ ret ++ ++ENTRY(save_guest_restore_host) ++ pushq %rdi ++ movq 7*8(%rsp), %rdi ++ movq %rax, UREGS_rax(%rdi) ++ popq UREGS_rdi(%rdi) ++ movq %r15, UREGS_r15(%rdi) ++ movq %r11, UREGS_r11(%rdi) ++ popq %r15 ++ movq %r14, UREGS_r14(%rdi) ++ movq %r10, UREGS_r10(%rdi) ++ popq %r14 ++ movq %r13, UREGS_r13(%rdi) ++ movq %r9, UREGS_r9(%rdi) ++ popq %r13 ++ movq %r12, UREGS_r12(%rdi) ++ movq %r8, UREGS_r8(%rdi) ++ popq %r12 ++ movq %rbp, UREGS_rbp(%rdi) ++ movq %rsi, UREGS_rsi(%rdi) ++ popq %rbp ++ movq %rbx, UREGS_rbx(%rdi) ++ movq %rdx, UREGS_rdx(%rdi) ++ popq %rbx ++ movq %rcx, UREGS_rcx(%rdi) ++ popq %rcx ++ ret +Index: xen-unstable/xen/arch/x86/x86_64/traps.c +=================================================================== +--- xen-unstable.orig/xen/arch/x86/x86_64/traps.c ++++ xen-unstable/xen/arch/x86/x86_64/traps.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -337,6 +338,29 @@ void __init percpu_traps_init(void) + + wrmsr(MSR_STAR, 0, (FLAT_RING3_CS32<<16) | __HYPERVISOR_CS); + wrmsr(MSR_SYSCALL_MASK, EF_VM|EF_RF|EF_NT|EF_DF|EF_IE|EF_TF, 0U); ++ ++ /* ++ * Stub for full-context I/O emulation. ++ */ ++ ++ /* Skip the compatibility-mode entry trampoline. */ ++ stack += 26; ++ if ( !io_emul_stub_offset ) ++ io_emul_stub_offset = stack - stack_bottom; ++ else ++ BUG_ON(io_emul_stub_offset != stack - stack_bottom); ++ /* call save_host_restore_guest */ ++ stack[0] = 0xe8; ++ *(s32*)&stack[1] = (char *)save_host_restore_guest - &stack[5]; ++ stack += 5; ++ if ( !io_emul_insn_offset ) ++ io_emul_insn_offset = stack - stack_bottom; ++ else ++ BUG_ON(io_emul_insn_offset != stack - stack_bottom); ++ stack += 3; /* operand size prefix, opcode, immediate */ ++ /* jmp save_guest_restore_host */ ++ stack[0] = 0xe9; ++ *(s32*)&stack[1] = (char *)save_guest_restore_host - &stack[5]; + } + + static long register_guest_callback(struct callback_register *reg) +Index: xen-unstable/xen/include/asm-x86/io.h +=================================================================== +--- xen-unstable.orig/xen/include/asm-x86/io.h ++++ xen-unstable/xen/include/asm-x86/io.h +@@ -50,4 +50,10 @@ __OUT(b,"b",char) + __OUT(w,"w",short) + __OUT(l,,int) + ++struct cpu_user_regs; ++void save_host_restore_guest(struct cpu_user_regs *) __attribute__((__regparm__(1))); ++unsigned long save_guest_restore_host(unsigned long) __attribute__((__regparm__(1))); ++ ++extern long io_emul_stub_offset, io_emul_insn_offset; ++ + #endif +Index: xen-unstable/xen/include/asm-x86/iocap.h +=================================================================== +--- xen-unstable.orig/xen/include/asm-x86/iocap.h ++++ xen-unstable/xen/include/asm-x86/iocap.h +@@ -7,6 +7,15 @@ + #ifndef __X86_IOCAP_H__ + #define __X86_IOCAP_H__ + ++extern struct rangeset *ioport_caps, *ioport_emul; ++ ++#define ioports_permit_access_all(s, e) \ ++ rangeset_add_range(ioport_caps, s, e) ++#define ioports_deny_access_all(s, e) \ ++ rangeset_remove_range(ioport_caps, s, e) ++#define ioports_any_access_permitted(s, e) \ ++ rangeset_contains_range(ioport_caps, s, e) ++ + #define ioports_permit_access(d, s, e) \ + rangeset_add_range((d)->arch.ioport_caps, s, e) + #define ioports_deny_access(d, s, e) \ +@@ -14,6 +23,13 @@ + #define ioports_access_permitted(d, s, e) \ + rangeset_contains_range((d)->arch.ioport_caps, s, e) + ++#define ioports_set_emul(s, e) \ ++ rangeset_add_range(ioport_emul, s, e) ++#define ioports_set_noemul(s, e) \ ++ rangeset_remove_range(ioport_emul, s, e) ++#define ioports_emul(s, e) \ ++ rangeset_contains_range(ioport_emul, s, e) ++ + #define cache_flush_permitted(d) \ + (!rangeset_is_empty((d)->iomem_caps)) + +Index: xen-unstable/xen/include/public/sysctl.h +=================================================================== +--- xen-unstable.orig/xen/include/public/sysctl.h ++++ xen-unstable/xen/include/public/sysctl.h +@@ -122,6 +122,15 @@ struct xen_sysctl_getdomaininfolist { + typedef struct xen_sysctl_getdomaininfolist xen_sysctl_getdomaininfolist_t; + DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getdomaininfolist_t); + ++#define XEN_SYSCTL_ioport_emulation 7 ++struct xen_sysctl_ioport_emulation { ++ uint32_t first_port; /* first port int range */ ++ uint32_t nr_ports; /* size of port range */ ++ uint8_t emulate; /* emulate access to range? */ ++}; ++typedef struct xen_sysctl_ioport_emulation xen_sysctl_ioport_emulation_t; ++DEFINE_XEN_GUEST_HANDLE(xen_sysctl_ioport_emulation_t); ++ + struct xen_sysctl { + uint32_t cmd; + uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */ +@@ -132,6 +141,7 @@ struct xen_sysctl { + struct xen_sysctl_sched_id sched_id; + struct xen_sysctl_perfc_op perfc_op; + struct xen_sysctl_getdomaininfolist getdomaininfolist; ++ struct xen_sysctl_ioport_emulation ioport_emulation; + uint8_t pad[128]; + } u; + }; diff --git a/xen-ioapic-ack-default.diff b/xen-ioapic-ack-default.diff new file mode 100644 index 0000000..bb722bb --- /dev/null +++ b/xen-ioapic-ack-default.diff @@ -0,0 +1,25 @@ +Change default IO-APIC ack mode for single IO-APIC systems to old-style. Jan + + +Index: xen-unstable/xen/arch/x86/io_apic.c +=================================================================== +--- xen-unstable.orig/xen/arch/x86/io_apic.c ++++ xen-unstable/xen/arch/x86/io_apic.c +@@ -1342,7 +1342,7 @@ static unsigned int startup_level_ioapic + return 0; /* don't check for pending */ + } + +-int ioapic_ack_new = 1; ++int ioapic_ack_new = -1; + static void setup_ioapic_ack(char *s) + { + if ( !strcmp(s, "old") ) +@@ -1779,6 +1779,8 @@ void __init setup_IO_APIC(void) + else + io_apic_irqs = ~PIC_IRQS; + ++ if (ioapic_ack_new < 0) ++ ioapic_ack_new = (nr_ioapics > 1); + printk("ENABLING IO-APIC IRQs\n"); + printk(" -> Using %s ACK method\n", ioapic_ack_new ? "new" : "old"); + diff --git a/xen-keymap.diff b/xen-keymap.diff new file mode 100644 index 0000000..5c5bb81 --- /dev/null +++ b/xen-keymap.diff @@ -0,0 +1,47 @@ +Index: xen-3.0.3-testing/tools/python/xen/xm/create.py +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/xen/xm/create.py ++++ xen-3.0.3-testing/tools/python/xen/xm/create.py +@@ -428,6 +428,10 @@ gopts.var('sdl', val='', + fn=set_value, default=None, + use="""Should the device model use SDL?""") + ++gopts.var('keymap', val='', ++ fn=set_value, default=None, ++ use="""Keyboard mapping for SDL/VNC""") ++ + gopts.var('display', val='DISPLAY', + fn=set_value, default=None, + use="X11 display to use") +@@ -639,7 +643,7 @@ def configure_hvm(config_image, vals): + 'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'soundhw', + 'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'vnclisten', + 'sdl', 'display', 'xauthority', +- 'acpi', 'apic', 'usb', 'usbdevice' ] ++ 'acpi', 'apic', 'usb', 'usbdevice', 'keymap' ] + for a in args: + if (vals.__dict__[a]): + config_image.append([a, vals.__dict__[a]]) +Index: xen-3.0.3-testing/tools/python/xen/xend/image.py +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/xen/xend/image.py ++++ xen-3.0.3-testing/tools/python/xen/xend/image.py +@@ -352,6 +352,10 @@ class HVMImageHandler(ImageHandler): + if nographic: + ret.append('-nographic') + return ret ++ keymap = sxp.child_value(config, 'keymap') ++ if not keymap: ++ keymap = "en-us" ++ ret += ['-k', keymap] + if vnc: + vncdisplay = sxp.child_value(config, 'vncdisplay', + int(self.vm.getDomid())) +@@ -360,7 +364,6 @@ class HVMImageHandler(ImageHandler): + ret += ['-vncunused'] + else: + ret += ['-vnc', '%d' % vncdisplay] +- ret += ['-k', 'en-us'] + vnclisten = sxp.child_value(config, 'vnclisten') + if not(vnclisten): + vnclisten = xen.xend.XendRoot.instance().get_vnclisten_address() diff --git a/xen-lost-mouse.diff b/xen-lost-mouse.diff new file mode 100644 index 0000000..a13cb15 --- /dev/null +++ b/xen-lost-mouse.diff @@ -0,0 +1,20 @@ +From: ? +Upstream: xen-unstable + +SIGKILL causes atexit to not be called, so mouse SDL cleanup wasn't +performed, so mouse wasn't released. + + +Index: xen-unstable/tools/python/xen/xend/image.py +=================================================================== +--- xen-unstable.orig/tools/python/xen/xend/image.py ++++ xen-unstable/tools/python/xen/xend/image.py +@@ -412,7 +412,7 @@ class HVMImageHandler(ImageHandler): + import signal + if not self.pid: + return +- os.kill(self.pid, signal.SIGKILL) ++ os.kill(self.pid, signal.SIGTERM) + os.waitpid(self.pid, 0) + self.pid = 0 + diff --git a/xen-lowmem-emergency-pool.diff b/xen-lowmem-emergency-pool.diff new file mode 100644 index 0000000..197473c --- /dev/null +++ b/xen-lowmem-emergency-pool.diff @@ -0,0 +1,47 @@ +Index: xen-unstable/xen/arch/x86/x86_32/mm.c +=================================================================== +--- xen-unstable.orig/xen/arch/x86/x86_32/mm.c ++++ xen-unstable/xen/arch/x86/x86_32/mm.c +@@ -62,6 +62,8 @@ l2_pgentry_t *virt_to_xen_l2e(unsigned l + return &idle_pg_table_l2[l2_linear_offset(v)]; + } + ++extern unsigned long lowmem_emergency_pool_pages; ++ + void __init paging_init(void) + { + void *ioremap_pt; +@@ -129,6 +131,20 @@ void __init setup_idle_pagetable(void) + l2e_from_page(virt_to_page(idle_vcpu[0]->domain-> + arch.mm_perdomain_pt) + i, + __PAGE_HYPERVISOR); ++ ++ /* ++ * Size the lowmem_emergency_pool based on the total memory on the box ++ * This pool is needed only on 32 bit PAE configurations (4g to 16g). ++ */ ++ if (lowmem_emergency_pool_pages) ++ return; ++ ++ if (total_pages > (4 * 1024 * 1024)) ++ lowmem_emergency_pool_pages = 12000; ++ else if (total_pages > (2 * 1024 * 1024)) ++ lowmem_emergency_pool_pages = 8000; ++ else if (total_pages > (1 * 1024 * 1024) || max_page >= (1 * 1024 * 1024)) ++ lowmem_emergency_pool_pages = 4000; + } + + void __init zap_low_mappings(l2_pgentry_t *base) +Index: xen-unstable/xen/common/page_alloc.c +=================================================================== +--- xen-unstable.orig/xen/common/page_alloc.c ++++ xen-unstable/xen/common/page_alloc.c +@@ -47,7 +47,7 @@ string_param("badpage", opt_badpage); + * allocation requests. Ordinary requests will not fall back to the + * lowmem emergency pool. + */ +-static unsigned long lowmem_emergency_pool_pages; ++unsigned long lowmem_emergency_pool_pages; + static void parse_lowmem_emergency_pool(char *s) + { + unsigned long long bytes; diff --git a/xen-man-permissions.patch b/xen-man-permissions.patch new file mode 100644 index 0000000..3d0efe9 --- /dev/null +++ b/xen-man-permissions.patch @@ -0,0 +1,13 @@ +Index: xen-3.0.3-testing/tools/ioemu/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/tools/ioemu/Makefile ++++ xen-3.0.3-testing/tools/ioemu/Makefile +@@ -68,7 +68,7 @@ install-doc: $(DOCS) + $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)" + ifndef CONFIG_WIN32 + mkdir -p "$(DESTDIR)$(mandir)/man1" +- $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" ++ $(INSTALL) -m 644 qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" + endif + + install: all $(if $(BUILD_DOCS),install-doc) diff --git a/xen-man-xm-bad-char.diff b/xen-man-xm-bad-char.diff new file mode 100644 index 0000000..2c61c7b --- /dev/null +++ b/xen-man-xm-bad-char.diff @@ -0,0 +1,43 @@ +Index: xen-3.0.3-testing/docs/man/xm.pod.1 +=================================================================== +--- xen-3.0.3-testing.orig/docs/man/xm.pod.1 ++++ xen-3.0.3-testing/docs/man/xm.pod.1 +@@ -554,29 +554,29 @@ B + I + + xm sched-sedf 20000000 5000000 0 0 0 +- ++ + I + + xm sched-sedf 20000000 0 0 1 0 +-  ++ + I +-  ++ + xm sched-sedf 20000000 5000000 0 1 0 + + I<4 domains with weights 2:3:4:2> + + xm sched-sedf 0 0 0 0 2 +-  xm sched-sedf 0 0 0 0 3 +-  xm sched-sedf 0 0 0 0 4 +-  xm sched-sedf 0 0 0 0 2 ++ xm sched-sedf 0 0 0 0 3 ++ xm sched-sedf 0 0 0 0 4 ++ xm sched-sedf 0 0 0 0 2 + + I<1 fully-specified (10ms/3ms) domain, 3 other domains share available + rest in 2:7:3 ratio:> + +- xm sched-sedf 10000000 3000000 0 0 0   +- xm sched-sedf 0 0 0 0 2   ++ xm sched-sedf 10000000 3000000 0 0 0 ++ xm sched-sedf 0 0 0 0 2 + xm sched-sedf 0 0 0 0 7 +-   xm sched-sedf 0 0 0 0 3 ++ xm sched-sedf 0 0 0 0 3 + + =back + diff --git a/xen-max-free-mem.diff b/xen-max-free-mem.diff new file mode 100644 index 0000000..560f6d7 --- /dev/null +++ b/xen-max-free-mem.diff @@ -0,0 +1,134 @@ +Index: xen-3.0.3-testing/tools/python/xen/xend/XendNode.py +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/xen/xend/XendNode.py ++++ xen-3.0.3-testing/tools/python/xen/xend/XendNode.py +@@ -59,9 +59,34 @@ class XendNode: + info['cores_per_socket'] * + info['threads_per_core']) + info['cpu_mhz'] = info['cpu_khz'] / 1000 +- # physinfo is in KiB +- info['total_memory'] = info['total_memory'] / 1024 +- info['free_memory'] = info['free_memory'] / 1024 ++ import XendRoot ++ configured_floor = XendRoot.instance().get_dom0_min_mem() * 1024 ++ from xen.xend import balloon ++ try: ++ kernel_floor = balloon.get_dom0_min_target() ++ except: ++ kernel_floor = 0 ++ dom0_min_mem = max(configured_floor, kernel_floor) ++ dom0_mem = balloon.get_dom0_current_alloc() ++ extra_mem = 0 ++ if dom0_min_mem > 0 and dom0_mem > dom0_min_mem: ++ extra_mem = dom0_mem - dom0_min_mem ++ info['free_memory'] = info['free_memory'] + info['scrub_memory'] ++ info['max_free_memory'] = info['free_memory'] + extra_mem ++ ++ # Convert KiB to MiB, rounding down to be conservative ++ info['total_memory'] = info['total_memory'] / 1024 ++ info['free_memory'] = info['free_memory'] / 1024 ++ info['max_free_memory'] = info['max_free_memory'] / 1024 ++ ++ # FIXME: These are hard-coded to be the inverse of the getXenMemory ++ # functions in image.py. Find a cleaner way. ++ info['max_para_memory'] = info['max_free_memory'] - 4 ++ if info['max_para_memory'] < 0: ++ info['max_para_memory'] = 0 ++ info['max_hvm_memory'] = int((info['max_free_memory']-12) * (1-2.4/1024)) ++ if info['max_hvm_memory'] < 0: ++ info['max_hvm_memory'] = 0 + + ITEM_ORDER = ['nr_cpus', + 'nr_nodes', +@@ -72,6 +97,9 @@ class XendNode: + 'hw_caps', + 'total_memory', + 'free_memory', ++ 'max_free_memory', ++ 'max_para_memory', ++ 'max_hvm_memory', + ] + + return [[k, info[k]] for k in ITEM_ORDER] +Index: xen-3.0.3-testing/tools/python/xen/xend/balloon.py +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/xen/xend/balloon.py ++++ xen-3.0.3-testing/tools/python/xen/xend/balloon.py +@@ -43,6 +43,8 @@ SLEEP_TIME_GROWTH = 0.1 + # label actually shown in the PROC_XEN_BALLOON file. + labels = { 'current' : 'Current allocation', + 'target' : 'Requested target', ++ 'min-target' : 'Minimum target', ++ 'max-target' : 'Maximum target', + 'low-balloon' : 'Low-mem balloon', + 'high-balloon' : 'High-mem balloon', + 'limit' : 'Xen hard limit' } +@@ -81,6 +83,23 @@ def get_dom0_target_alloc(): + raise VmError('Failed to query target memory allocation of dom0.') + return kb + ++def get_dom0_min_target(): ++ """Returns the minimum amount of memory (in KiB) that dom0 will accept.""" ++ ++ kb = _get_proc_balloon(labels['min-target']) ++ if kb == None: ++ raise VmError('Failed to query minimum target memory allocation of dom0.') ++ return kb ++ ++def get_dom0_max_target(): ++ """Returns the maximum amount of memory (in KiB) that is potentially ++ visible to dom0.""" ++ ++ kb = _get_proc_balloon(labels['max-target']) ++ if kb == None: ++ raise VmError('Failed to query maximum target memory allocation of dom0.') ++ return kb ++ + def free(need_mem): + """Balloon out memory from the privileged domain so that there is the + specified required amount (in KiB) free. +Index: xen-3.0.3-testing/tools/python/xen/xend/XendDomainInfo.py +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/xen/xend/XendDomainInfo.py ++++ xen-3.0.3-testing/tools/python/xen/xend/XendDomainInfo.py +@@ -1005,6 +1005,27 @@ class XendDomainInfo: + + ## public: + ++ def capAndSetMemoryTarget(self, target): ++ """Potentially lowers the requested target to the largest possible ++ value (i.e., caps it), and then sets the memory target of this domain ++ to that value. ++ @param target in MiB. ++ """ ++ max_target = 0 ++ if self.domid == 0: ++ try: ++ from balloon import get_dom0_max_target ++ max_target = get_dom0_max_target() / 1024 ++ except: ++ # It's nice to cap the max at sane values, but harmless to set ++ # them high. Carry on. ++ pass ++ if max_target and target > max_target: ++ log.debug("Requested memory target %d MiB; maximum reasonable is %d MiB.", ++ target, max_target) ++ target = max_target ++ self.setMemoryTarget(target) ++ + def setMemoryTarget(self, target): + """Set the memory target of this domain. + @param target In MiB. +Index: xen-3.0.3-testing/tools/python/xen/xend/server/SrvDomain.py +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/xen/xend/server/SrvDomain.py ++++ xen-3.0.3-testing/tools/python/xen/xend/server/SrvDomain.py +@@ -147,7 +147,7 @@ class SrvDomain(SrvDir): + + + def op_mem_target_set(self, _, req): +- return self.call(self.dom.setMemoryTarget, ++ return self.call(self.dom.capAndSetMemoryTarget, + [['target', 'int']], + req) + diff --git a/xen-messages.diff b/xen-messages.diff new file mode 100644 index 0000000..0bcc0c8 --- /dev/null +++ b/xen-messages.diff @@ -0,0 +1,33 @@ +Index: xen-unstable/tools/misc/xend +=================================================================== +--- xen-unstable.orig/tools/misc/xend ++++ xen-unstable/tools/misc/xend +@@ -64,14 +64,7 @@ def check_logging(): + try: + import logging + except ImportError: +- hline() +- msg("Python logging is not installed.") +- msg("Use 'make install-logging' at the xen root to install.") +- msg("") +- msg("Alternatively download and install from") +- msg("http://www.red-dove.com/python_logging.html") +- hline() +- raise CheckError("logging is not installed") ++ raise CheckError("logging is not installed; try Python 2.3 or later") + + def check_user(): + """Check that the effective user id is 0 (root). +Index: xen-unstable/tools/python/xen/xend/XendDomain.py +=================================================================== +--- xen-unstable.orig/tools/python/xen/xend/XendDomain.py ++++ xen-unstable/tools/python/xen/xend/XendDomain.py +@@ -467,6 +467,8 @@ class XendDomain: + + if dominfo.getDomid() == PRIV_DOMAIN: + raise XendError("Cannot save privileged domain %s" % domid) ++ if dominfo.readVm('image/ostype') == "hvm": ++ raise XendError("Cannot save fully virtualized domains") + + fd = os.open(dst, os.O_WRONLY | os.O_CREAT | os.O_TRUNC) + try: diff --git a/xen-network-bridge.diff b/xen-network-bridge.diff new file mode 100644 index 0000000..1f028cf --- /dev/null +++ b/xen-network-bridge.diff @@ -0,0 +1,168 @@ +Index: xen-3.0.3-testing/tools/examples/network-bridge +=================================================================== +--- xen-3.0.3-testing.orig/tools/examples/network-bridge ++++ xen-3.0.3-testing/tools/examples/network-bridge +@@ -69,23 +69,6 @@ pdev="p${netdev}" + vdev="veth${vifnum}" + vif0="vif0.${vifnum}" + +-get_ip_info() { +- addr_pfx=`ip addr show dev $1 | egrep '^ *inet' | sed -e 's/ *inet //' -e 's/ .*//'` +- gateway=`ip route show dev $1 | fgrep default | sed 's/default via //'` +-} +- +-do_ifup() { +- if ! ifup $1 ; then +- if [ ${addr_pfx} ] ; then +- # use the info from get_ip_info() +- ip addr flush $1 +- ip addr add ${addr_pfx} dev $1 +- ip link set dev $1 up +- [ ${gateway} ] && ip route add default via ${gateway} +- fi +- fi +-} +- + # Usage: transfer_addrs src dst + # Copy all IP addresses (including aliases) from device $src to device $dst. + transfer_addrs () { +@@ -204,14 +187,10 @@ using loopback.nloopbacks= on the dom + + if link_exists "$vdev"; then + mac=`ip link show ${netdev} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'` +- preiftransfer ${netdev} ++ ifup ${netdev} # To ensure there is an IP to transfer ++ preiftransfer + transfer_addrs ${netdev} ${vdev} +- if ! ifdown ${netdev}; then +- # If ifdown fails, remember the IP details. +- get_ip_info ${netdev} +- ip link set ${netdev} down +- ip addr flush ${netdev} +- fi ++ ifdown ${netdev} + ip link set ${netdev} name ${pdev} + ip link set ${vdev} name ${netdev} + +@@ -222,7 +201,8 @@ using loopback.nloopbacks= on the dom + ip link set ${bridge} up + add_to_bridge ${bridge} ${vif0} + add_to_bridge2 ${bridge} ${pdev} +- do_ifup ${netdev} ++ ip link set ${netdev} up ++ ifup ${hwddev} + else + # old style without ${vdev} + transfer_addrs ${netdev} ${bridge} +@@ -246,9 +226,7 @@ op_stop () { + ip link set dev ${vif0} down + mac=`ip link show ${netdev} | grep 'link\/ether' | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/'` + transfer_addrs ${netdev} ${pdev} +- if ! ifdown ${netdev}; then +- get_ip_info ${netdev} +- fi ++ ifdown ${netdev} + ip link set ${netdev} down arp off + ip link set ${netdev} addr fe:ff:ff:ff:ff:ff + ip link set ${pdev} down +@@ -261,7 +239,7 @@ op_stop () { + + ip link set ${netdev} name ${vdev} + ip link set ${pdev} name ${netdev} +- do_ifup ${netdev} ++ ifup ${netdev} + else + transfer_routes ${bridge} ${netdev} + ip link set ${bridge} down +Index: xen-3.0.3-testing/tools/examples/xen-network-common.sh +=================================================================== +--- xen-3.0.3-testing.orig/tools/examples/xen-network-common.sh ++++ xen-3.0.3-testing/tools/examples/xen-network-common.sh +@@ -16,57 +16,33 @@ + # + + +-# On SuSE it is necessary to run a command before transfering addresses and +-# routes from the physical interface to the virtual. This command creates a +-# variable $HWD_CONFIG_0 that specifies the appropriate configuration for +-# ifup. ++# Reads the global variable "netdev" (which is the kernel interface name, ++# e.g., "eth0") and sets the global variable "hwddev" (which is the persistent ++# interface name, e.g., "eth-id-00:e0:81:54:12:34"). + +-# Gentoo doesn't have ifup/ifdown, so we define appropriate alternatives. +- +-# Other platforms just use ifup / ifdown directly. ++preiftransfer() ++{ ++ local HWD_CONFIG_0 ++ eval `/sbin/getcfg -d /etc/sysconfig/network/ -f ifcfg- -- "$netdev" | grep HWD_CONFIG_0=` ++ if [ -n "$HWD_CONFIG_0" ]; then ++ hwddev="$HWD_CONFIG_0" ++ fi ++} + +-## +-# preiftransfer +-# +-# @param $1 The current name for the physical device, which is also the name +-# that the virtual device will take once the physical device has +-# been renamed. +- +-if [ -e /etc/SuSE-release ] +-then +- preiftransfer() +- { +- eval `/sbin/getcfg -d /etc/sysconfig/network/ -f ifcfg- -- $1` +- } +- ifup() +- { +- /sbin/ifup ${HWD_CONFIG_0} $1 +- } +-elif ! which ifup >/dev/null 2>/dev/null +-then +- preiftransfer() +- { +- true +- } +- ifup() +- { +- false +- } +- ifdown() +- { +- false +- } +-else +- preiftransfer() +- { +- true +- } +-fi ++ifup() ++{ ++ /sbin/ifup $1 -o rc || true ++} + ++ifdown() ++{ ++ /sbin/ifdown $1 -o rc ++} + + first_file() + { +- t="$1" ++ local t="$1" ++ local file + shift + for file in $@ + do +@@ -80,7 +56,7 @@ first_file() + + find_dhcpd_conf_file() + { +- first_file -f /etc/dhcp3/dhcpd.conf /etc/dhcpd.conf ++ first_file -f /etc/dhcp3/dhcpd.conf /etc/dhcpd.conf /etc/dhcpd.conf.pxe + } + + diff --git a/xen-no-dummy-nfs-ip.diff b/xen-no-dummy-nfs-ip.diff new file mode 100644 index 0000000..5ed5cc5 --- /dev/null +++ b/xen-no-dummy-nfs-ip.diff @@ -0,0 +1,15 @@ +Index: xen-unstable/tools/python/xen/xm/create.py +=================================================================== +--- xen-unstable.orig/tools/python/xen/xm/create.py ++++ xen-unstable/tools/python/xen/xm/create.py +@@ -808,9 +808,8 @@ def preprocess_access_control(vals): + + def preprocess_ip(vals): + if vals.ip or vals.dhcp != 'off': +- dummy_nfs_server = '1.2.3.4' + ip = (vals.ip +- + ':' + (vals.nfs_server or dummy_nfs_server) ++ + ':' + (vals.nfs_server or '') + + ':' + vals.gateway + + ':' + vals.netmask + + ':' + vals.hostname diff --git a/xen-paths.diff b/xen-paths.diff new file mode 100644 index 0000000..f886966 --- /dev/null +++ b/xen-paths.diff @@ -0,0 +1,69 @@ +Index: xen-unstable/tools/python/xen/xm/create.py +=================================================================== +--- xen-unstable.orig/tools/python/xen/xm/create.py ++++ xen-unstable/tools/python/xen/xm/create.py +@@ -64,7 +64,7 @@ gopts.opt('quiet', short='q', + use="Quiet.") + + gopts.opt('path', val='PATH', +- fn=set_value, default='.:/etc/xen', ++ fn=set_value, default='.:/etc/xen/vm', + use="Search path for configuration scripts. " + "The value of PATH is a colon-separated directory list.") + +Index: xen-unstable/docs/man/xm.pod.1 +=================================================================== +--- xen-unstable.orig/docs/man/xm.pod.1 ++++ xen-unstable/docs/man/xm.pod.1 +@@ -72,7 +72,7 @@ format, and possible options used in eit + Name=Value combinations. + + Configfile can either be an absolute path to a file, or a relative +-path to a file located in /etc/xen. ++path to a file located in /etc/xen/vm. + + Create will return B as the domain is started. This B mean the guest OS in the domain has actually booted, or is +@@ -97,7 +97,7 @@ B + + xm create Fedora4 + +-This creates a domain with the file /etc/xen/Fedora4, and returns as ++This creates a domain with the file /etc/xen/vm/Fedora4, and returns as + soon as it is run. + + =item I +Index: xen-unstable/docs/man/xmdomain.cfg.pod.5 +=================================================================== +--- xen-unstable.orig/docs/man/xmdomain.cfg.pod.5 ++++ xen-unstable/docs/man/xmdomain.cfg.pod.5 +@@ -4,9 +4,9 @@ xmdomain.cfg - xm domain config file for + + =head1 SYNOPSIS + +- /etc/xen/myxendomain +- /etc/xen/myxendomain2 +- /etc/xen/auto/myxenautostarted ++ /etc/xen/auto/ ++ /etc/xen/examples/ ++ /etc/xen/vm/ + + =head1 DESCRIPTION + +@@ -14,14 +14,14 @@ The B(1) program uses python executa + domains to create from scratch. Each of these config files needs to + contain a number of required options, and may specify many more. + +-Domain configuration files live in /etc/xen by default, if you store ++Domain configuration files live in /etc/xen/vm by default. If you store + config files anywhere else the full path to the config file must be + specified in the I command. + + /etc/xen/auto is a special case. Domain config files in that + directory will be started automatically at system boot if the + xendomain init script is enabled. The contents of /etc/xen/auto +-should be symlinks to files in /etc/xen to allow I to be ++should be symlinks to files in /etc/xen/vm to allow I to be + used without full paths. + + Options are specified by I statements in the diff --git a/xen-poweroff.diff b/xen-poweroff.diff new file mode 100644 index 0000000..eb98fc7 --- /dev/null +++ b/xen-poweroff.diff @@ -0,0 +1,57 @@ +diff -uNrp xen-2.0-testing/xen/arch/x86/acpi.c xen-2.0-testing.pwroff/xen/arch/x86/acpi.c +--- xen-2.0-testing/xen/arch/x86/acpi.c 2005-03-01 04:45:17.000000000 +0100 ++++ xen-2.0-testing.pwroff/xen/arch/x86/acpi.c 2005-03-01 15:48:13.011511087 +0100 +@@ -719,3 +719,13 @@ acpi_sleep_done: + + #endif /*CONFIG_ACPI_SLEEP*/ + ++int acpi_poweroff() ++{ ++ if (acpi_enter_sleep_state_prep (ACPI_STATE_S5) == AE_OK) { ++ __asm__ __volatile__ ( "cli" ); ++ acpi_enter_sleep_state (ACPI_STATE_S5); ++ __asm__ __volatile__ ( "sti" ); ++ acpi_leave_sleep_state (ACPI_STATE_S5); ++ } ++ return 1; ++} +diff -uNrp xen-2.0-testing/xen/arch/x86/domain.c xen-2.0-testing.pwroff/xen/arch/x86/domain.c +--- xen-2.0-testing/xen/arch/x86/domain.c 2005-03-01 04:45:18.000000000 +0100 ++++ xen-2.0-testing.pwroff/xen/arch/x86/domain.c 2005-03-01 15:48:26.133212475 +0100 +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + /* opt_noreboot: If true, machine will need manual reset on error. */ + static int opt_noreboot = 0; +@@ -186,6 +187,7 @@ void machine_restart(char * __unused) + + void __attribute__((noreturn)) __machine_halt(void *unused) + { ++ acpi_poweroff(); + for ( ; ; ) + __asm__ __volatile__ ( "cli; hlt" ); + } +diff -uNrp xen-2.0-testing/xen/drivers/acpi/acpi_ksyms.c xen-2.0-testing.pwroff/xen/drivers/acpi/acpi_ksyms.c +--- xen-2.0-testing/xen/drivers/acpi/acpi_ksyms.c 2005-03-01 04:45:17.000000000 +0100 ++++ xen-2.0-testing.pwroff/xen/drivers/acpi/acpi_ksyms.c 2005-03-01 15:36:50.941976570 +0100 +@@ -87,6 +87,7 @@ EXPORT_SYMBOL(acpi_get_register); + EXPORT_SYMBOL(acpi_set_register); + EXPORT_SYMBOL(acpi_enter_sleep_state); + EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios); ++EXPORT_SYMBOL(acpi_leave_sleep_state); + EXPORT_SYMBOL(acpi_get_system_info); + EXPORT_SYMBOL(acpi_get_devices); + +diff -uNrp xen-2.0-testing/xen/include/asm-x86/acpi.h xen-2.0-testing.pwroff/xen/include/asm-x86/acpi.h +--- xen-2.0-testing/xen/include/asm-x86/acpi.h 2005-03-01 04:45:21.000000000 +0100 ++++ xen-2.0-testing.pwroff/xen/include/asm-x86/acpi.h 2005-03-01 15:49:22.719299798 +0100 +@@ -163,4 +163,6 @@ extern void acpi_reserve_bootmem(void); + + #endif /*CONFIG_ACPI_SLEEP*/ + ++extern int acpi_poweroff(void); ++ + #endif /*_ASM_ACPI_H*/ diff --git a/xen-pvfb-2.patch b/xen-pvfb-2.patch new file mode 100644 index 0000000..6822249 --- /dev/null +++ b/xen-pvfb-2.patch @@ -0,0 +1,1122 @@ +Index: xen-unstable/tools/Makefile +=================================================================== +--- xen-unstable.orig/tools/Makefile ++++ xen-unstable/tools/Makefile +@@ -18,6 +18,7 @@ SUBDIRS-$(VTPM_TOOLS) += vtpm + SUBDIRS-y += xenstat + SUBDIRS-y += libaio + SUBDIRS-y += blktap ++SUBDIRS-y += xenfb + + # These don't cross-compile + ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH)) +Index: xen-unstable/tools/xenfb/Makefile +=================================================================== +--- /dev/null ++++ xen-unstable/tools/xenfb/Makefile +@@ -0,0 +1,36 @@ ++XEN_ROOT=../.. ++include $(XEN_ROOT)/tools/Rules.mk ++ ++CFLAGS += -g -Wall ++CFLAGS += -I$(XEN_LIBXC) -I$(XEN_XENSTORE) -I$(XEN_ROOT)/linux-2.6-xen-sparse/include ++LDFLAGS += -L$(XEN_LIBXC) -L$(XEN_XENSTORE) ++ ++INSTALL = install ++INSTALL_PROG = $(INSTALL) -m0755 ++INSTALL_DIR = $(INSTALL) -d -m0755 ++ ++.PHONY: all ++all: build ++ ++.PHONY: build ++build: mk-symlinks ++ $(MAKE) vncfb sdlfb ++ ++install: all ++ $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)/xen/bin ++ $(INSTALL_PROG) vncfb $(DESTDIR)/usr/$(LIBDIR)/xen/bin/xen-vncfb ++ $(INSTALL_PROG) sdlfb $(DESTDIR)/usr/$(LIBDIR)/xen/bin/xen-sdlfb ++ ++sdlfb: sdlfb.o xenfb.o ++ ++sdlfb.o: CFLAGS += $(shell sdl-config --cflags) ++sdlfb: LDLIBS += $(shell sdl-config --libs) -lxenctrl -lxenstore ++ ++clean: ++ $(RM) *.o *~ vncfb sdlfb ++ ++keymapping.o: CFLAGS += $(shell pkg-config --cflags gtk+-2.0) ++ ++vncfb: vncfb.o xenfb.o keymapping.o ++vncfb.o: CFLAGS += $(shell libvncserver-config --cflags) ++vncfb: LDLIBS += $(shell libvncserver-config --libs) -lxenctrl -lxenstore +Index: xen-unstable/tools/xenfb/keymapping.c +=================================================================== +--- /dev/null ++++ xen-unstable/tools/xenfb/keymapping.c +@@ -0,0 +1,141 @@ ++#include ++#include ++#include ++ ++uint32_t gdk_linux_mapping[0x10000] = { ++ [GDK_a] = KEY_A, ++ [GDK_b] = KEY_B, ++ [GDK_c] = KEY_C, ++ [GDK_d] = KEY_D, ++ [GDK_e] = KEY_E, ++ [GDK_f] = KEY_F, ++ [GDK_g] = KEY_G, ++ [GDK_h] = KEY_H, ++ [GDK_i] = KEY_I, ++ [GDK_j] = KEY_J, ++ [GDK_k] = KEY_K, ++ [GDK_l] = KEY_L, ++ [GDK_m] = KEY_M, ++ [GDK_n] = KEY_N, ++ [GDK_o] = KEY_O, ++ [GDK_p] = KEY_P, ++ [GDK_q] = KEY_Q, ++ [GDK_r] = KEY_R, ++ [GDK_s] = KEY_S, ++ [GDK_t] = KEY_T, ++ [GDK_u] = KEY_U, ++ [GDK_v] = KEY_V, ++ [GDK_w] = KEY_W, ++ [GDK_x] = KEY_X, ++ [GDK_y] = KEY_Y, ++ [GDK_z] = KEY_Z, ++ [GDK_A] = KEY_A, ++ [GDK_B] = KEY_B, ++ [GDK_C] = KEY_C, ++ [GDK_D] = KEY_D, ++ [GDK_E] = KEY_E, ++ [GDK_F] = KEY_F, ++ [GDK_G] = KEY_G, ++ [GDK_H] = KEY_H, ++ [GDK_I] = KEY_I, ++ [GDK_J] = KEY_J, ++ [GDK_K] = KEY_K, ++ [GDK_L] = KEY_L, ++ [GDK_M] = KEY_M, ++ [GDK_N] = KEY_N, ++ [GDK_O] = KEY_O, ++ [GDK_P] = KEY_P, ++ [GDK_Q] = KEY_Q, ++ [GDK_R] = KEY_R, ++ [GDK_S] = KEY_S, ++ [GDK_T] = KEY_T, ++ [GDK_U] = KEY_U, ++ [GDK_V] = KEY_V, ++ [GDK_W] = KEY_W, ++ [GDK_X] = KEY_X, ++ [GDK_Y] = KEY_Y, ++ [GDK_Z] = KEY_Z, ++ [GDK_0] = KEY_0, ++ [GDK_1] = KEY_1, ++ [GDK_2] = KEY_2, ++ [GDK_3] = KEY_3, ++ [GDK_4] = KEY_4, ++ [GDK_5] = KEY_5, ++ [GDK_6] = KEY_6, ++ [GDK_7] = KEY_7, ++ [GDK_8] = KEY_8, ++ [GDK_9] = KEY_9, ++ [GDK_Return] = KEY_ENTER, ++ [GDK_BackSpace] = KEY_BACKSPACE, ++ [GDK_Tab] = KEY_TAB, ++ [GDK_Pause] = KEY_PAUSE, ++ [GDK_Delete] = KEY_DELETE, ++ [GDK_slash] = KEY_SLASH, ++ [GDK_minus] = KEY_MINUS, ++ [GDK_equal] = KEY_EQUAL, ++ [GDK_Escape] = KEY_ESC, ++ [GDK_braceleft] = KEY_LEFTBRACE, ++ [GDK_braceright] = KEY_RIGHTBRACE, ++ [GDK_bracketleft] = KEY_LEFTMETA, ++ [GDK_bracketright] = KEY_RIGHTMETA, ++ [GDK_Control_L] = KEY_LEFTCTRL, ++ [GDK_Control_R] = KEY_RIGHTCTRL, ++ [GDK_Shift_L] = KEY_LEFTSHIFT, ++ [GDK_Shift_R] = KEY_RIGHTSHIFT, ++ [GDK_Alt_L] = KEY_LEFTALT, ++ [GDK_Alt_R] = KEY_RIGHTALT, ++ [GDK_semicolon] = KEY_SEMICOLON, ++ [GDK_apostrophe] = KEY_APOSTROPHE, ++ [GDK_grave] = KEY_GRAVE, ++ [GDK_backslash] = KEY_BACKSLASH, ++ [GDK_comma] = KEY_COMMA, ++ [GDK_period] = KEY_DOT, ++ [GDK_space] = KEY_SPACE, ++ [GDK_Caps_Lock] = KEY_CAPSLOCK, ++ [GDK_Num_Lock] = KEY_NUMLOCK, ++ [GDK_Scroll_Lock] = KEY_SCROLLLOCK, ++ [GDK_Sys_Req] = KEY_SYSRQ, ++ [GDK_Linefeed] = KEY_LINEFEED, ++ [GDK_Home] = KEY_HOME, ++ [GDK_Pause] = KEY_PAUSE, ++ [GDK_F1] = KEY_F1, ++ [GDK_F2] = KEY_F2, ++ [GDK_F3] = KEY_F3, ++ [GDK_F4] = KEY_F4, ++ [GDK_F5] = KEY_F5, ++ [GDK_F6] = KEY_F6, ++ [GDK_F7] = KEY_F7, ++ [GDK_F8] = KEY_F8, ++ [GDK_F9] = KEY_F9, ++ [GDK_F10] = KEY_F10, ++ [GDK_F11] = KEY_F11, ++ [GDK_F12] = KEY_F12, ++ [GDK_Up] = KEY_UP, ++ [GDK_Page_Up] = KEY_PAGEUP, ++ [GDK_Left] = KEY_LEFT, ++ [GDK_Right] = KEY_RIGHT, ++ [GDK_End] = KEY_END, ++ [GDK_Down] = KEY_DOWN, ++ [GDK_Page_Down] = KEY_PAGEDOWN, ++ [GDK_Insert] = KEY_INSERT, ++ [GDK_colon] = KEY_SEMICOLON, ++ [GDK_quotedbl] = KEY_APOSTROPHE, ++ [GDK_less] = KEY_COMMA, ++ [GDK_greater] = KEY_DOT, ++ [GDK_question] = KEY_SLASH, ++ [GDK_bar] = KEY_BACKSLASH, ++ [GDK_asciitilde] = KEY_GRAVE, ++ [GDK_exclam] = KEY_1, ++ [GDK_at] = KEY_2, ++ [GDK_numbersign] = KEY_3, ++ [GDK_dollar] = KEY_4, ++ [GDK_percent] = KEY_5, ++ [GDK_asciicircum] = KEY_6, ++ [GDK_ampersand] = KEY_7, ++ [GDK_asterisk] = KEY_8, ++ [GDK_parenleft] = KEY_9, ++ [GDK_parenright] = KEY_0, ++ [GDK_underscore] = KEY_MINUS, ++ [GDK_plus] = KEY_EQUAL, ++}; ++ +Index: xen-unstable/tools/xenfb/sdlfb.c +=================================================================== +--- /dev/null ++++ xen-unstable/tools/xenfb/sdlfb.c +@@ -0,0 +1,191 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "xenfb.h" ++ ++struct data ++{ ++ SDL_Surface *dst; ++ SDL_Surface *src; ++}; ++ ++void sdl_update(struct xenfb *xenfb, int x, int y, int width, int height) ++{ ++ struct data *data = xenfb->user_data; ++ SDL_Rect r = { x, y, width, height }; ++ SDL_BlitSurface(data->src, &r, data->dst, &r); ++ SDL_UpdateRect(data->dst, x, y, width, height); ++} ++ ++int sdl2linux[1024] = { ++ [SDLK_a] = KEY_A, ++ [SDLK_b] = KEY_B, ++ [SDLK_c] = KEY_C, ++ [SDLK_d] = KEY_D, ++ [SDLK_e] = KEY_E, ++ [SDLK_f] = KEY_F, ++ [SDLK_g] = KEY_G, ++ [SDLK_h] = KEY_H, ++ [SDLK_i] = KEY_I, ++ [SDLK_j] = KEY_J, ++ [SDLK_k] = KEY_K, ++ [SDLK_l] = KEY_L, ++ [SDLK_m] = KEY_M, ++ [SDLK_n] = KEY_N, ++ [SDLK_o] = KEY_O, ++ [SDLK_p] = KEY_P, ++ [SDLK_q] = KEY_Q, ++ [SDLK_r] = KEY_R, ++ [SDLK_s] = KEY_S, ++ [SDLK_t] = KEY_T, ++ [SDLK_u] = KEY_U, ++ [SDLK_v] = KEY_V, ++ [SDLK_w] = KEY_W, ++ [SDLK_x] = KEY_X, ++ [SDLK_y] = KEY_Y, ++ [SDLK_z] = KEY_Z, ++ [SDLK_0] = KEY_0, ++ [SDLK_1] = KEY_1, ++ [SDLK_2] = KEY_2, ++ [SDLK_3] = KEY_3, ++ [SDLK_4] = KEY_4, ++ [SDLK_5] = KEY_5, ++ [SDLK_6] = KEY_6, ++ [SDLK_7] = KEY_7, ++ [SDLK_8] = KEY_8, ++ [SDLK_9] = KEY_9, ++ [SDLK_SPACE] = KEY_SPACE, ++ [SDLK_RETURN] = KEY_ENTER, ++ [SDLK_PERIOD] = KEY_DOT, ++ [SDLK_SLASH] = KEY_SLASH, ++ [SDLK_BACKSPACE] = KEY_BACKSPACE, ++ [SDLK_TAB] = KEY_TAB, ++ [SDLK_LSHIFT] = KEY_LEFTSHIFT, ++ [SDLK_RSHIFT] = KEY_RIGHTSHIFT, ++ [SDLK_LALT] = KEY_LEFTALT, ++ [SDLK_RALT] = KEY_RIGHTALT, ++}; ++ ++static struct option options[] = { ++ { "domid", 1, NULL, 'd' }, ++ { "title", 1, NULL, 't' }, ++}; ++ ++int main(int argc, char **argv) ++{ ++ struct xenfb *xenfb; ++ int fd; ++ int domid = -1; ++ char * title = NULL; ++ fd_set readfds; ++ struct data data; ++ SDL_Rect r; ++ struct timeval tv = { 0, 500 }; ++ int do_quit = 0; ++ int opt; ++ ++ while ((opt = getopt_long(argc, argv, "d:t:", options, ++ NULL)) != -1) { ++ switch (opt) { ++ case 'd': ++ domid = strtol(optarg, NULL, 10); ++ break; ++ case 't': ++ title = strdup(optarg); ++ break; ++ } ++ } ++ if (optind != argc) { ++ fprintf(stderr, "Invalid options!\n"); ++ exit(1); ++ } ++ if (domid == -1) { ++ fprintf(stderr, "Domain ID must be specified!\n"); ++ exit(1); ++ } ++ ++ xenfb = xenfb_new(); ++ if (xenfb == NULL) ++ return 1; ++ ++ if (!xenfb_attach_dom(xenfb, domid)) ++ return 1; ++ ++ SDL_Init(SDL_INIT_VIDEO); ++ ++ fd = xenfb_get_fileno(xenfb); ++ ++ data.dst = SDL_SetVideoMode(xenfb->width, xenfb->height, xenfb->depth, ++ SDL_SWSURFACE); ++ ++ data.src = SDL_CreateRGBSurfaceFrom(xenfb->pixels, ++ xenfb->width, xenfb->height, ++ xenfb->depth, xenfb->row_stride, ++ 0xFF0000, 0xFF00, 0xFF, 0); ++ ++ if (title == NULL) ++ title = strdup("xen-sdlfb"); ++ SDL_WM_SetCaption(title, title); ++ ++ r.x = r.y = 0; ++ r.w = xenfb->width; ++ r.h = xenfb->height; ++ SDL_BlitSurface(data.src, &r, data.dst, &r); ++ SDL_UpdateRect(data.dst, 0, 0, xenfb->width, xenfb->height); ++ ++ xenfb->update = sdl_update; ++ xenfb->user_data = &data; ++ ++ FD_ZERO(&readfds); ++ FD_SET(fd, &readfds); ++ ++ SDL_ShowCursor(0); ++ ++ while (!do_quit && select(fd + 1, &readfds, NULL, NULL, &tv) != -1) { ++ SDL_Event event; ++ ++ while (SDL_PollEvent(&event)) { ++ switch (event.type) { ++ case SDL_KEYDOWN: ++ case SDL_KEYUP: ++ xenfb_send_key(xenfb, ++ event.type == SDL_KEYDOWN, ++ sdl2linux[event.key.keysym.sym]); ++ break; ++ case SDL_MOUSEMOTION: { ++ int x, y; ++ Uint8 button; ++ ++ button = SDL_GetRelativeMouseState(&x, &y); ++ xenfb_send_motion(xenfb, x, y); ++ } break; ++ case SDL_MOUSEBUTTONDOWN: ++ case SDL_MOUSEBUTTONUP: ++ xenfb_send_button(xenfb, ++ event.type==SDL_MOUSEBUTTONDOWN, ++ 3 - event.button.button); ++ break; ++ case SDL_QUIT: ++ do_quit = 1; ++ break; ++ } ++ } ++ if (FD_ISSET(fd, &readfds)) ++ xenfb_on_incoming(xenfb); ++ ++ FD_ZERO(&readfds); ++ FD_SET(fd, &readfds); ++ ++ tv = (struct timeval){0, 500}; ++ } ++ ++ xenfb_delete(xenfb); ++ ++ SDL_Quit(); ++ ++ return 0; ++} +Index: xen-unstable/tools/xenfb/vncfb.c +=================================================================== +--- /dev/null ++++ xen-unstable/tools/xenfb/vncfb.c +@@ -0,0 +1,245 @@ ++#define _GNU_SOURCE ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "xenfb.h" ++ ++static void on_kbd_event(rfbBool down, rfbKeySym keycode, rfbClientPtr cl) ++{ ++ extern uint32_t gdk_linux_mapping[0x10000]; ++ rfbScreenInfoPtr server = cl->screen; ++ struct xenfb *xenfb = server->screenData; ++ xenfb_send_key(xenfb, down, gdk_linux_mapping[keycode & 0xFFFF]); ++} ++ ++static void on_ptr_event(int buttonMask, int x, int y, rfbClientPtr cl) ++{ ++ static int last_x = -1, last_y = -1; ++ static int last_button = -1; ++ rfbScreenInfoPtr server = cl->screen; ++ struct xenfb *xenfb = server->screenData; ++ ++ if (last_button != -1) { ++ int i; ++ ++ for (i = 0; i < 8; i++) { ++ if ((last_button & (1 << i)) != ++ (buttonMask & (1 << i))) { ++ printf("%d %d\n", buttonMask & (1 << i), i); ++ xenfb_send_button(xenfb, buttonMask & (1 << i), ++ 2 - i); ++ } ++ } ++ } ++ ++ if (last_x != -1) ++ xenfb_send_motion(xenfb, x - last_x, y - last_y); ++ ++ last_button = buttonMask; ++ ++ last_x = x; ++ last_y = y; ++} ++ ++static void xenstore_write_vncport(int port, int domid) ++{ ++ char *buf = NULL, *path; ++ char *portstr = NULL; ++ struct xs_handle *xsh = NULL; ++ ++ xsh = xs_daemon_open(); ++ if (xsh == NULL) ++ return; ++ ++ path = xs_get_domain_path(xsh, domid); ++ if (path == NULL) { ++ fprintf(stderr, "xs_get_domain_path() error\n"); ++ goto out; ++ } ++ ++ buf = malloc(256); ++ if (snprintf(buf, 256, "%s/console/vnc-port", path) == -1) ++ goto out; ++ ++ portstr = malloc(10); ++ if (snprintf(portstr, 10, "%d", port) == -1) ++ goto out; ++ ++ if (xs_write(xsh, XBT_NULL, buf, portstr, strlen(portstr)) == 0) ++ fprintf(stderr, "xs_write() vncport failed\n"); ++ ++ out: ++ free(portstr); ++ free(buf); ++} ++ ++ ++static void vnc_update(struct xenfb *xenfb, int x, int y, int w, int h) ++{ ++ rfbScreenInfoPtr server = xenfb->user_data; ++ rfbMarkRectAsModified(server, x, y, x + w, y + h); ++} ++ ++static int vnc_start_viewer(int port) ++{ ++ int pid; ++ char s[16]; ++ ++ snprintf(s, 16, ":%d", port); ++ switch (pid = fork()) { ++ case -1: ++ fprintf(stderr, "vncviewer failed fork\n"); ++ exit(1); ++ ++ case 0: /* child */ ++ execlp("vncviewer", "vncviewer", s, NULL); ++ fprintf(stderr, "vncviewer execlp failed\n"); ++ exit(1); ++ ++ default: ++ return pid; ++ } ++} ++ ++static struct option options[] = { ++ { "domid", 1, NULL, 'd' }, ++ { "vncport", 1, NULL, 'p' }, ++ { "title", 1, NULL, 't' }, ++ { "unused", 0, NULL, 'u' }, ++ { "listen", 1, NULL, 'l' }, ++ { "vncviewer", 0, NULL, 'v' }, ++}; ++ ++int main(int argc, char **argv) ++{ ++ rfbScreenInfoPtr server; ++ char *fake_argv[7] = { "vncfb", "-rfbport", "5901", ++ "-desktop", "xen-vncfb", ++ "-listen", "0.0.0.0" }; ++ int fake_argc = sizeof(fake_argv) / sizeof(fake_argv[0]); ++ int domid = -1, port = -1; ++ char * title = NULL; ++ char * listen = NULL; ++ struct xenfb *xenfb; ++ fd_set readfds; ++ int fd; ++ char buffer[1024]; ++ int opt; ++ bool unused = FALSE; ++ bool viewer = FALSE; ++ ++ while ((opt = getopt_long(argc, argv, "d:p:t:u", options, ++ NULL)) != -1) { ++ switch (opt) { ++ case 'd': ++ domid = strtol(optarg, NULL, 10); ++ break; ++ case 'p': ++ port = strtol(optarg, NULL, 10); ++ break; ++ case 't': ++ title = strdup(optarg); ++ break; ++ case 'u': ++ unused = TRUE; ++ break; ++ case 'l': ++ listen = strdup(optarg); ++ break; ++ case 'v': ++ viewer = TRUE; ++ break; ++ //case 'l': ++ // listen = strdup(optarg); ++ // break; ++ } ++ } ++ if (optind != argc) { ++ fprintf(stderr, "Invalid options!\n"); ++ exit(1); ++ } ++ if (domid == -1) { ++ fprintf(stderr, "Domain ID must be specified!\n"); ++ exit(1); ++ } ++ ++ if (port == -1) ++ port = 5900 + domid; ++ snprintf(buffer, sizeof(buffer), "%d", port); ++ fake_argv[2] = buffer; ++ ++ if (title != NULL) ++ fake_argv[4] = title; ++ ++ if (listen != NULL) ++ fake_argv[6] = listen; ++ ++ if (listen != NULL) ++ fake_argv[6] = listen; ++ ++ xenfb = xenfb_new(); ++ if (xenfb == NULL) { ++ fprintf(stderr, "Could not create framebuffer (%s)\n", ++ strerror(errno)); ++ exit(1); ++ } ++ ++ if (!xenfb_attach_dom(xenfb, domid)) { ++ fprintf(stderr, "Could not connect to domain (%s)\n", ++ strerror(errno)); ++ exit(1); ++ } ++ ++ server = rfbGetScreen(&fake_argc, fake_argv, ++ xenfb->width, xenfb->height, ++ 8, 3, xenfb->depth / 8); ++ if (server == NULL) { ++ fprintf(stderr, "Could not create VNC server\n"); ++ exit(1); ++ } ++ ++ xenfb->user_data = server; ++ xenfb->update = vnc_update; ++ ++ if (unused) ++ server->autoPort = TRUE; ++ ++ server->serverFormat.redShift = 16; ++ server->serverFormat.greenShift = 8; ++ server->serverFormat.blueShift = 0; ++ server->kbdAddEvent = on_kbd_event; ++ server->ptrAddEvent = on_ptr_event; ++ server->frameBuffer = (char *)xenfb->pixels; ++ server->screenData = xenfb; ++ rfbInitServer(server); ++ ++ rfbRunEventLoop(server, -1, TRUE); ++ ++ fd = xenfb_get_fileno(xenfb); ++ ++ FD_ZERO(&readfds); ++ FD_SET(fd, &readfds); ++ ++ xenstore_write_vncport(server->port, domid); ++ ++ if (viewer) ++ vnc_start_viewer(server->port); ++ ++ while (select(fd + 1, &readfds, NULL, NULL, NULL) != -1) { ++ if (FD_ISSET(fd, &readfds)) { ++ xenfb_on_incoming(xenfb); ++ } ++ ++ FD_ZERO(&readfds); ++ FD_SET(fd, &readfds); ++ } ++ ++ rfbScreenCleanup(server); ++ xenfb_delete(xenfb); ++ ++ return 0; ++} +Index: xen-unstable/tools/xenfb/xenfb.c +=================================================================== +--- /dev/null ++++ xen-unstable/tools/xenfb/xenfb.c +@@ -0,0 +1,434 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "xenfb.h" ++ ++// FIXME defend against malicous backend? ++ ++struct xenfb_private ++{ ++ struct xenfb pub; ++ int domid; ++ unsigned long fbdev_mfn, kbd_mfn; ++ int fbdev_evtchn, kbd_evtchn; ++ evtchn_port_t fbdev_port, kbd_port; ++ int evt_xch; ++ int xc; ++ unsigned char *fb; ++ struct xenfb_page *fb_info; ++ struct xenkbd_info *kbd_info; ++ unsigned long *fbmfns; ++ int n_fbmfns, n_fbdirs; ++}; ++ ++struct xenfb *xenfb_new(void) ++{ ++ struct xenfb_private *xenfb = malloc(sizeof(*xenfb)); ++ ++ if (xenfb == NULL) ++ return NULL; ++ ++ memset(xenfb, 0, sizeof(*xenfb)); ++ ++ xenfb->domid = -1; ++ ++ xenfb->evt_xch = xc_evtchn_open(); ++ if (xenfb->evt_xch == -1) { ++ int serrno = errno; ++ free(xenfb); ++ errno = serrno; ++ return NULL; ++ } ++ ++ xenfb->xc = xc_interface_open(); ++ if (xenfb->xc == -1) { ++ int serrno = errno; ++ xc_evtchn_close(xenfb->evt_xch); ++ free(xenfb); ++ errno = serrno; ++ return NULL; ++ } ++ ++ return &xenfb->pub; ++} ++ ++int xenfb_get_fileno(struct xenfb *xenfb_pub) ++{ ++ struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; ++ ++ return xc_evtchn_fd(xenfb->evt_xch); ++} ++ ++static void xenfb_detach_dom(struct xenfb_private *xenfb) ++{ ++ xenfb->domid = -1; ++ munmap(xenfb->fb, xenfb->fb_info->mem_length); ++ munmap(xenfb->fb_info, XC_PAGE_SIZE); ++ munmap(xenfb->kbd_info, XC_PAGE_SIZE); ++ xc_evtchn_unbind(xenfb->evt_xch, xenfb->fbdev_port); ++ xc_evtchn_unbind(xenfb->evt_xch, xenfb->kbd_port); ++} ++ ++void xenfb_delete(struct xenfb *xenfb_pub) ++{ ++ struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; ++ if (xenfb->domid != -1) ++ xenfb_detach_dom(xenfb); ++ free(xenfb); ++} ++ ++static int xenfb_fb_event(struct xenfb_private *xenfb, union xenfb_in_event *event) ++{ ++ uint32_t prod; ++ struct xenfb_page *info = xenfb->fb_info; ++ ++ prod = info->in_prod; ++ if (prod - info->in_cons == XENFB_IN_RING_LEN) { ++ errno = EAGAIN; ++ return -1; ++ } ++ ++ mb(); /* ensure ring space available */ ++ XENFB_IN_RING_REF(info, prod) = *event; ++ wmb(); /* ensure ring contents visible */ ++ info->in_prod = prod + 1; ++ return xc_evtchn_notify(xenfb->evt_xch, xenfb->fbdev_port); ++} ++ ++static int xenfb_kbd_event(struct xenfb_private *xenfb, union xenkbd_in_event *event) ++{ ++ uint32_t prod; ++ struct xenkbd_info *info = xenfb->kbd_info; ++ ++ prod = info->in_prod; ++ if (prod - info->in_cons == XENKBD_IN_RING_LEN) { ++ errno = EAGAIN; ++ return -1; ++ } ++ ++ mb(); /* ensure ring space available */ ++ XENKBD_IN_RING_REF(info, prod) = *event; ++ wmb(); /* ensure ring contents visible */ ++ info->in_prod = prod + 1; ++ return xc_evtchn_notify(xenfb->evt_xch, xenfb->kbd_port); ++} ++ ++static char *xenfb_path_in_dom(struct xs_handle *h, ++ unsigned domid, const char *path, ++ char *buffer, size_t size) ++{ ++ char *domp = xs_get_domain_path(h, domid); ++ int n = snprintf(buffer, size, "%s/%s", domp, path); ++ free(domp); ++ if (n >= size) ++ return NULL; ++ return buffer; ++} ++ ++static int xenfb_xs_scanf1(struct xs_handle *xsh, unsigned domid, ++ const char *path, const char *fmt, ++ void *dest) ++{ ++ char buffer[1024]; ++ char *p; ++ int ret; ++ ++ p = xenfb_path_in_dom(xsh, domid, path, buffer, sizeof(buffer)); ++ p = xs_read(xsh, XBT_NULL, p, NULL); ++ if (!p) ++ return -ENOENT; ++ ret = sscanf(p, fmt, dest); ++ free(p); ++ if (ret != 1) ++ return -EDOM; ++ return 0; ++} ++ ++bool xenfb_attach_dom(struct xenfb *xenfb_pub, int domid) ++{ ++ struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; ++ char buffer[1024]; ++ struct xs_handle *xsh; ++ unsigned dummy; ++ int ret; ++ char *p, **vec; ++ union xenfb_in_event event; ++ ++ if (xenfb->domid != -1) { ++ xenfb_detach_dom(xenfb); ++ if (domid == -1) ++ return true; ++ } ++ ++ xsh = xs_daemon_open_readonly(); ++ if (!xsh) ++ goto error; ++ ++ p = xenfb_path_in_dom(xsh, domid, "vfb", buffer, sizeof(buffer)); ++ if (!xs_watch(xsh, p, "")) ++ goto error; ++ p = xenfb_path_in_dom(xsh, domid, "vkbd", buffer, sizeof(buffer)); ++ if (!xs_watch(xsh, p, "")) ++ goto error; ++ ++ for (;;) { ++ ret = xenfb_xs_scanf1(xsh, domid, "vfb/page-ref", "%lu", ++ &xenfb->fbdev_mfn); ++ if (ret == -ENOENT || ret == -EAGAIN) ++ goto wait; ++ if (ret < 0) ++ goto error; ++ ret = xenfb_xs_scanf1(xsh, domid, "vfb/event-channel", "%u", ++ &xenfb->fbdev_evtchn); ++ if (ret == -ENOENT || ret == -EAGAIN) ++ goto wait; ++ if (ret < 0) ++ goto error; ++ ret = xenfb_xs_scanf1(xsh, domid, "vkbd/page-ref", "%lu", ++ &xenfb->kbd_mfn); ++ if (ret == -ENOENT || ret == -EAGAIN) ++ goto wait; ++ if (ret < 0) ++ goto error; ++ ret = xenfb_xs_scanf1(xsh, domid, "vkbd/event-channel", "%u", ++ &xenfb->kbd_evtchn); ++ if (ret == -ENOENT || ret == -EAGAIN) ++ goto wait; ++ if (ret < 0) ++ goto error; ++ break; ++ ++ wait: ++ printf("Waiting...\n"); ++ vec = xs_read_watch(xsh, &dummy); ++ if (!vec) ++ goto error; ++ free(vec); ++ } ++ xs_daemon_close(xsh); ++ xsh = NULL; ++ ++ xenfb->fbdev_port = xc_evtchn_bind_interdomain(xenfb->evt_xch, domid, ++ xenfb->fbdev_evtchn); ++ if (xenfb->fbdev_port == -1) ++ goto error; ++ ++ xenfb->kbd_port = xc_evtchn_bind_interdomain(xenfb->evt_xch, domid, ++ xenfb->kbd_evtchn); ++ if (xenfb->kbd_port == -1) ++ goto error_fbdev; ++ ++ xenfb->fb_info = xc_map_foreign_range(xenfb->xc, domid, XC_PAGE_SIZE, ++ PROT_READ | PROT_WRITE, ++ xenfb->fbdev_mfn); ++ if (xenfb->fb_info == NULL) ++ goto error_kbd; ++ ++ xenfb->kbd_info = xc_map_foreign_range(xenfb->xc, domid, XC_PAGE_SIZE, ++ PROT_READ | PROT_WRITE, ++ xenfb->kbd_mfn); ++ if (xenfb->kbd_info == NULL) ++ goto error_fbinfo; ++ ++ xenfb->n_fbmfns = (xenfb->fb_info->mem_length + (XC_PAGE_SIZE - 1)) / XC_PAGE_SIZE; ++ xenfb->n_fbdirs = xenfb->n_fbmfns * sizeof(unsigned long); ++ xenfb->n_fbdirs = (xenfb->n_fbdirs + (XC_PAGE_SIZE - 1)) / XC_PAGE_SIZE; ++ ++ xenfb->fbmfns = xc_map_foreign_batch(xenfb->xc, domid, PROT_READ, xenfb->fb_info->pd, xenfb->n_fbdirs); ++ if (xenfb->fbmfns == NULL) ++ goto error_kbdinfo; ++ ++ xenfb->fb = xc_map_foreign_batch(xenfb->xc, domid, PROT_READ | PROT_WRITE, xenfb->fbmfns, xenfb->n_fbmfns); ++ if (xenfb->fb == NULL) ++ goto error_fbmfns; ++ ++ event.type = XENFB_TYPE_SET_EVENTS; ++ event.set_events.flags = XENFB_FLAG_UPDATE; ++ if (xenfb_fb_event(xenfb, &event)) ++ goto error_fb; ++ ++ munmap(xenfb->fbmfns, xenfb->n_fbdirs * XC_PAGE_SIZE); ++ ++ xenfb->domid = domid; ++ ++ xenfb->pub.pixels = xenfb->fb; ++ ++ xenfb->pub.row_stride = xenfb->fb_info->line_length; ++ xenfb->pub.depth = xenfb->fb_info->depth; ++ xenfb->pub.width = xenfb->fb_info->width; ++ xenfb->pub.height = xenfb->fb_info->height; ++ ++ return true; ++ ++ error_fb: ++ printf("%d\n", __LINE__); ++ { ++ int serrno = errno; ++ munmap(xenfb->fb, xenfb->fb_info->mem_length); ++ errno = serrno; ++ } ++ error_fbmfns: ++ printf("%d\n", __LINE__); ++ { ++ int serrno = errno; ++ munmap(xenfb->fbmfns, xenfb->n_fbdirs * XC_PAGE_SIZE); ++ errno = serrno; ++ } ++ error_kbdinfo: ++ printf("%d\n", __LINE__); ++ { ++ int serrno = errno; ++ munmap(xenfb->kbd_info, XC_PAGE_SIZE); ++ errno = serrno; ++ } ++ error_fbinfo: ++ printf("%d\n", __LINE__); ++ { ++ int serrno = errno; ++ munmap(xenfb->fb_info, XC_PAGE_SIZE); ++ errno = serrno; ++ } ++ error_kbd: ++ printf("%d\n", __LINE__); ++ { ++ int serrno = errno; ++ xc_evtchn_unbind(xenfb->evt_xch, xenfb->kbd_port); ++ errno = serrno; ++ } ++ error_fbdev: ++ printf("%d\n", __LINE__); ++ { ++ int serrno = errno; ++ xc_evtchn_unbind(xenfb->evt_xch, xenfb->fbdev_port); ++ errno = serrno; ++ } ++ error: ++ printf("%d\n", __LINE__); ++ if (xsh) { ++ int serrno = errno; ++ xs_daemon_close(xsh); ++ errno = serrno; ++ } ++ ++ return false; ++} ++ ++static void xenfb_update(struct xenfb_private *xenfb, int x, int y, int width, int height) ++{ ++ if (xenfb->pub.update) ++ xenfb->pub.update(&xenfb->pub, x, y, width, height); ++} ++ ++static void xenfb_on_fb_event(struct xenfb_private *xenfb) ++{ ++ uint32_t prod, cons; ++ struct xenfb_page *info = xenfb->fb_info; ++ ++ prod = info->out_prod; ++ rmb(); /* ensure we see ring contents up to prod */ ++ for (cons = info->out_cons; cons != prod; cons++) { ++ union xenfb_out_event *event = &XENFB_OUT_RING_REF(info, cons); ++ ++ switch (event->type) { ++ case XENFB_TYPE_UPDATE: ++ xenfb_update(xenfb, event->update.x, event->update.y, event->update.width, event->update.height); ++ break; ++ } ++ } ++ mb(); /* ensure we're done with ring contents */ ++ info->out_cons = cons; ++ // FIXME need to notify? ++} ++ ++static void xenfb_on_kbd_event(struct xenfb_private *xenfb) ++{ ++ uint32_t prod, cons; ++ struct xenkbd_info *info = xenfb->kbd_info; ++ ++ prod = info->out_prod; ++ rmb(); /* ensure we see ring contents up to prod */ ++ for (cons = info->out_cons; cons != prod; cons++) { ++ union xenkbd_out_event *event = &XENKBD_OUT_RING_REF(info, cons); ++ ++ switch (event->type) { ++ default: ++ break; ++ } ++ } ++ mb(); /* ensure we're done with ring contents */ ++ info->out_cons = cons; ++ // FIXME need to notify? ++} ++ ++int xenfb_on_incoming(struct xenfb *xenfb_pub) ++{ ++ struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; ++ evtchn_port_t port; ++ ++ port = xc_evtchn_pending(xenfb->evt_xch); ++ if (port == -1) ++ return -1; ++ ++ if (port == xenfb->fbdev_port) { ++ xenfb_on_fb_event(xenfb); ++ } else if (port == xenfb->kbd_port) { ++ xenfb_on_kbd_event(xenfb); ++ } ++ ++ if (xc_evtchn_unmask(xenfb->evt_xch, port) == -1) ++ return -1; ++ ++ return 0; ++} ++ ++int xenfb_send_key(struct xenfb *xenfb_pub, bool down, int keycode) ++{ ++ struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; ++ union xenkbd_in_event event; ++ ++ event.type = XENKBD_TYPE_KEY; ++ event.key.pressed = down ? 1 : 0; ++ event.key.keycode = keycode; ++ ++ return xenfb_kbd_event(xenfb, &event); ++} ++ ++int xenfb_send_motion(struct xenfb *xenfb_pub, int rel_x, int rel_y) ++{ ++ struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; ++ union xenkbd_in_event event; ++ ++ event.type = XENKBD_TYPE_MOTION; ++ event.motion.rel_x = rel_x; ++ event.motion.rel_y = rel_y; ++ ++ return xenfb_kbd_event(xenfb, &event); ++} ++ ++int xenfb_send_button(struct xenfb *xenfb_pub, bool down, int button) ++{ ++ struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub; ++ union xenkbd_in_event event; ++ ++ event.type = XENKBD_TYPE_BUTTON; ++ event.button.pressed = down ? 1 : 0; ++ event.button.button = button; ++ ++ return xenfb_kbd_event(xenfb, &event); ++} +Index: xen-unstable/tools/xenfb/xenfb.h +=================================================================== +--- /dev/null ++++ xen-unstable/tools/xenfb/xenfb.h +@@ -0,0 +1,33 @@ ++#ifndef _XENFB_H_ ++#define _XENFB_H_ ++ ++#include ++#include ++ ++struct xenfb ++{ ++ uint8_t *pixels; ++ ++ int row_stride; ++ int depth; ++ int width; ++ int height; ++ ++ void *user_data; ++ ++ void (*update)(struct xenfb *xenfb, int x, int y, int width, int height); ++}; ++ ++struct xenfb *xenfb_new(void); ++void xenfb_delete(struct xenfb *xenfb); ++ ++bool xenfb_attach_dom(struct xenfb *xenfb, int domid); ++ ++int xenfb_get_fileno(struct xenfb *xenfb); ++int xenfb_on_incoming(struct xenfb *xenfb); ++ ++int xenfb_send_key(struct xenfb *xenfb, bool down, int keycode); ++int xenfb_send_motion(struct xenfb *xenfb, int rel_x, int rel_y); ++int xenfb_send_button(struct xenfb *xenfb, bool down, int button); ++ ++#endif diff --git a/xen-pvfb-3.patch b/xen-pvfb-3.patch new file mode 100644 index 0000000..365328e --- /dev/null +++ b/xen-pvfb-3.patch @@ -0,0 +1,129 @@ +Index: xen-unstable/tools/python/xen/xend/image.py +=================================================================== +--- xen-unstable.orig/tools/python/xen/xend/image.py ++++ xen-unstable/tools/python/xen/xend/image.py +@@ -20,8 +20,10 @@ + import os, string + import re + import math ++import signal + + import xen.lowlevel.xc ++import xen.util.auxbin + from xen.xend import sxp + from xen.xend.XendError import VmError + from xen.xend.XendLogging import log +@@ -205,6 +207,68 @@ class LinuxImageHandler(ImageHandler): + ramdisk = self.ramdisk, + features = self.vm.getFeatures()) + ++ def configure(self, imageConfig, deviceConfig): ++ ImageHandler.configure(self, imageConfig, deviceConfig) ++ ++ self.pid = 0 ++ log.info("configuring linux guest") ++ ++ # set up the graphics bits. ++ # FIXME: this is much like what we do for HVM, should it be ++ # for all image types now? ++ self.display = sxp.child_value(imageConfig, 'display') ++ self.xauthority = sxp.child_value(imageConfig, 'xauthority') ++ self.vncconsole = sxp.child_value(imageConfig, 'vncconsole') ++ self.vnc = sxp.child_value(imageConfig, 'vnc') ++ self.sdl = sxp.child_value(imageConfig, 'sdl') ++ if self.vnc: ++ self.vncdisplay = sxp.child_value(imageConfig, 'vncdisplay', ++ int(self.vm.getDomid())) ++ self.vncunused = sxp.child_value(imageConfig, 'vncunused') ++ self.vnclisten = sxp.child_value(imageConfig, 'vnclisten') ++ if self.vnc or self.sdl: ++ log.info("setting use_graphics") ++ self.vm.writeDom("console/use_graphics", "1") ++ else: ++ self.vm.writeDom("console/use_graphics", "0") ++ ++ def createDeviceModel(self): ++ if self.pid: ++ return ++ # Execute device model (for us, it's just the fb frontend) ++ if not self.vnc and not self.sdl: ++ return ++ ++ if self.vnc: ++ args = [xen.util.auxbin.pathTo("xen-vncfb")] ++ if self.vncunused: ++ args += ['--unused'] ++ elif self.vncdisplay: ++ args += [ "--vncport", "%d" %(5900 + self.vncdisplay,) ] ++ if self.vnclisten: ++ args += [ "--listen", self.vnclisten ] ++ if self.vncconsole: ++ args += [ "--vncviewer" ] ++ elif self.sdl: ++ args = [xen.util.auxbin.pathTo("xen-sdlfb")] ++ args = args + [ "--domid", "%d" % self.vm.getDomid(), ++ "--title", self.vm.info['name'] ] ++ env = dict(os.environ) ++ if self.display: ++ env['DISPLAY'] = self.display ++ if self.xauthority: ++ env['XAUTHORITY'] = self.xauthority ++ log.info("spawning video: %s", args) ++ self.pid = os.spawnve(os.P_NOWAIT, args[0], args, env) ++ log.info("device model pid: %d", self.pid) ++ ++ def destroy(self): ++ if not self.pid: ++ return ++ os.kill(self.pid, signal.SIGKILL) ++ os.waitpid(self.pid, 0) ++ self.pid = 0 ++ + class PPC_LinuxImageHandler(LinuxImageHandler): + + ostype = "linux" +@@ -382,7 +446,6 @@ class HVMImageHandler(ImageHandler): + + def destroy(self): + self.unregister_shutdown_watch(); +- import signal + if not self.pid: + return + os.kill(self.pid, signal.SIGKILL) +Index: xen-unstable/tools/python/xen/xm/create.py +=================================================================== +--- xen-unstable.orig/tools/python/xen/xm/create.py ++++ xen-unstable/tools/python/xen/xm/create.py +@@ -481,6 +481,8 @@ def configure_image(vals): + + if vals.builder == 'hvm': + configure_hvm(config_image, vals) ++ ++ configure_graphics(config_image, vals) + + return config_image + +@@ -627,14 +629,21 @@ def configure_vifs(config_devs, vals): + map(f, d.keys()) + config_devs.append(['device', config_vif]) + ++def configure_graphics(config_image, vals): ++ """Create the config for graphic consoles. ++ """ ++ args = [ 'vnc', 'vncdisplay', 'vncconsole', 'vncunused', ++ 'sdl', 'display', 'xauthority' ] ++ for a in args: ++ if (vals.__dict__[a]): ++ config_image.append([a, vals.__dict__[a]]) + + def configure_hvm(config_image, vals): + """Create the config for HVM devices. + """ + args = [ 'device_model', 'pae', 'vcpus', 'boot', 'fda', 'fdb', + 'localtime', 'serial', 'stdvga', 'isa', 'nographic', 'soundhw', +- 'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'sdl', 'display', +- 'acpi', 'apic', 'xauthority', 'usb', 'usbdevice' ] ++ 'acpi', 'apic', 'usb', 'usbdevice' ] + for a in args: + if (vals.__dict__[a]): + config_image.append([a, vals.__dict__[a]]) diff --git a/xen-python25-warnings.diff b/xen-python25-warnings.diff new file mode 100644 index 0000000..8432632 --- /dev/null +++ b/xen-python25-warnings.diff @@ -0,0 +1,152 @@ +Index: xen-3.0.3-testing/tools/python/xen/lowlevel/xc/xc.c +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/xen/lowlevel/xc/xc.c ++++ xen-3.0.3-testing/tools/python/xen/lowlevel/xc/xc.c +@@ -23,6 +23,13 @@ + #define PyMODINIT_FUNC DL_EXPORT(void) + #endif + ++/* Needed for Python versions earlier than 2.5, due to PEP353 */ ++#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) ++typedef int Py_ssize_t; ++#define PY_SSIZE_T_MAX INT_MAX ++#define PY_SSIZE_T_MIN INT_MIN ++#endif ++ + #define PKG "xen.lowlevel.xc" + #define CLS "xc" + +@@ -65,9 +72,12 @@ static PyObject *pyxc_domain_create(XcOb + PyObject *args, + PyObject *kwds) + { +- uint32_t dom = 0; +- int ret, i; +- uint32_t ssidref = 0; ++ uint32_t dom; ++ Py_ssize_t _dom = 0; ++ uint32_t ssidref; ++ Py_ssize_t _ssidref = 0; ++ Py_ssize_t i; ++ int ret; + PyObject *pyhandle = NULL; + xen_domain_handle_t handle = { + 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, +@@ -76,8 +86,10 @@ static PyObject *pyxc_domain_create(XcOb + static char *kwd_list[] = { "dom", "ssidref", "handle", NULL }; + + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iiO", kwd_list, +- &dom, &ssidref, &pyhandle)) ++ &_dom, &_ssidref, &pyhandle)) + return NULL; ++ dom = Py_SAFE_DOWNCAST(_dom, Py_ssize_t, uint32_t); ++ ssidref = Py_SAFE_DOWNCAST(_ssidref, Py_ssize_t, uint32_t); + + if ( pyhandle != NULL ) + { +@@ -140,7 +152,8 @@ static PyObject *pyxc_vcpu_setaffinity(X + PyObject *kwds) + { + uint32_t dom; +- int vcpu = 0, i; ++ int vcpu = 0; ++ Py_ssize_t i; + uint64_t cpumap = ~0ULL; + PyObject *cpulist = NULL; + +@@ -186,7 +199,7 @@ static PyObject *pyxc_domain_setcpuweigh + + static PyObject *pyxc_domain_sethandle(XcObject *self, PyObject *args) + { +- int i; ++ Py_ssize_t i; + uint32_t dom; + PyObject *pyhandle; + xen_domain_handle_t handle; +Index: xen-3.0.3-testing/tools/python/xen/lowlevel/xs/xs.c +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/xen/lowlevel/xs/xs.c ++++ xen-3.0.3-testing/tools/python/xen/lowlevel/xs/xs.c +@@ -21,6 +21,13 @@ + + #include + ++/* Needed for Python versions earlier than 2.5, due to PEP353 */ ++#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) ++typedef int Py_ssize_t; ++#define PY_SSIZE_T_MAX INT_MAX ++#define PY_SSIZE_T_MIN INT_MIN ++#endif ++ + #include + #include + #include +@@ -320,6 +327,7 @@ static PyObject *xspy_set_permissions(Xs + int i, result; + struct xs_permissions *xsperms = NULL; + int xsperms_n; ++ Py_ssize_t _xsperms_n; + PyObject *tuple0 = NULL; + + xs_transaction_t th; +@@ -336,7 +344,9 @@ static PyObject *xspy_set_permissions(Xs + xs_set_error(EINVAL); + goto exit; + } +- xsperms_n = PyList_Size(perms); ++ _xsperms_n = PyList_Size(perms); ++ /* Should never overflow an int, since xs interface uses int */ ++ xsperms_n = Py_SAFE_DOWNCAST(_xsperms_n, Py_ssize_t, int); + xsperms = calloc(xsperms_n, sizeof(struct xs_permissions)); + if (!xsperms) { + xs_set_error(ENOMEM); +@@ -393,7 +403,7 @@ static PyObject *xspy_watch(XsHandle *se + PyObject *token; + char token_str[MAX_STRLEN(unsigned long) + 1]; + int result; +- int i; ++ Py_ssize_t i; + + if (!xh) + return NULL; +@@ -439,7 +449,7 @@ static PyObject *xspy_read_watch(XsHandl + PyObject *val = NULL; + char **xsval; + PyObject *token; +- int i; ++ Py_ssize_t i; + unsigned int num; + + if (!xh) +@@ -658,7 +668,7 @@ static PyObject *xspy_release_domain(XsH + static PyObject *xspy_close(XsHandle *self) + { + struct xs_handle *xh = xshandle(self); +- int i; ++ Py_ssize_t i; + + if (!xh) + return NULL; +@@ -716,7 +726,7 @@ static PyObject *xspy_get_domain_path(Xs + */ + static void remove_watch(XsHandle *self, PyObject *token) + { +- int i; ++ Py_ssize_t i; + + for (i = 0; i < PyList_Size(self->watches); i++) { + if (PyList_GetItem(self->watches, i) == token) { +Index: xen-3.0.3-testing/tools/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/tools/Makefile ++++ xen-3.0.3-testing/tools/Makefile +@@ -22,7 +22,8 @@ SUBDIRS-y += blktap + # These don't cross-compile + ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH)) + SUBDIRS-y += python +-SUBDIRS-y += pygrub ++# pygrub is unsupported by SUSE, and does not build cleanly with Python 2.5 ++#SUBDIRS-y += pygrub + endif + + .PHONY: all diff --git a/xen-removable.diff b/xen-removable.diff new file mode 100644 index 0000000..b4e816f --- /dev/null +++ b/xen-removable.diff @@ -0,0 +1,722 @@ +Index: xen-unstable/tools/ioemu/block.c +=================================================================== +--- xen-unstable.orig/tools/ioemu/block.c ++++ xen-unstable/tools/ioemu/block.c +@@ -332,6 +332,8 @@ int bdrv_open2(BlockDriverState *bs, con + goto fail; + } + ++ shdev_set_media_instance(bs); ++ + bs->inserted = 1; + + /* call the change callback */ +@@ -356,6 +358,7 @@ void bdrv_close(BlockDriverState *bs) + bs->opaque = NULL; + bs->drv = NULL; + bs->inserted = 0; ++ bs->media_instance = 0; + + /* call the change callback */ + if (bs->change_cb) +@@ -601,6 +604,15 @@ BlockDriverState *bdrv_find(const char * + return NULL; + } + ++BlockDriverState *bdrv_find_bs(int (*it)(BlockDriverState *, void *), void *opaque) ++{ ++ BlockDriverState *bs; ++ ++ for (bs = bdrv_first; bs != NULL && !it(bs, opaque); bs = bs->next); ++ ++ return( bs ); ++} ++ + void bdrv_iterate(void (*it)(void *opaque, const char *name), void *opaque) + { + BlockDriverState *bs; +Index: xen-unstable/tools/ioemu/block_int.h +=================================================================== +--- xen-unstable.orig/tools/ioemu/block_int.h ++++ xen-unstable/tools/ioemu/block_int.h +@@ -51,6 +51,8 @@ struct BlockDriverState { + int removable; /* if true, the media can be removed */ + int locked; /* if true, the media cannot temporarily be ejected */ + int encrypted; /* if true, the media is encrypted */ ++ int media_instance; ++ int shdev_el; + /* event callback when inserting/removing */ + void (*change_cb)(void *opaque); + void *change_opaque; +Index: xen-unstable/tools/ioemu/hw/ide.c +=================================================================== +--- xen-unstable.orig/tools/ioemu/hw/ide.c ++++ xen-unstable/tools/ioemu/hw/ide.c +@@ -23,6 +23,9 @@ + */ + #include "vl.h" + #include ++#include ++#include ++#include + + /* debug IDE devices */ + //#define DEBUG_IDE +@@ -278,6 +281,7 @@ + #define ASC_ILLEGAL_OPCODE 0x20 + #define ASC_LOGICAL_BLOCK_OOR 0x21 + #define ASC_INV_FIELD_IN_CMD_PACKET 0x24 ++#define ASC_MEDIA_CHANGED 0x28 + #define ASC_MEDIUM_NOT_PRESENT 0x3a + #define ASC_SAVING_PARAMETERS_NOT_SUPPORTED 0x39 + +@@ -294,6 +298,7 @@ typedef void EndTransferFunc(struct IDES + typedef struct IDEState { + /* ide config */ + int is_cdrom; ++ int media_changed; + int cylinders, heads, sectors; + int64_t nb_sectors; + int mult_sectors; +@@ -1141,6 +1146,51 @@ static void ide_atapi_cmd_read(IDEState + } + } + ++static int cd_media_inserted(IDEState *s) ++{ ++ int inserted = 0; ++ ++ if (s->bs->removable) { ++ int h = open(s->bs->filename, O_NONBLOCK, O_RDONLY); ++ ++ if (h >= 0) { ++ struct stat statbuf; ++ if (fstat(h, &statbuf) == 0 && S_ISREG(statbuf.st_mode)) { ++ inserted = 1; ++ } else { ++ int status; ++ sg_io_hdr_t io_hdr; ++ unsigned char test_unit_ready_cmd[6] = {TEST_UNIT_READY, 0, 0, 0, 0, 0}; ++ unsigned char inqBuff[2]; ++ unsigned char sb[32]; ++ ++ memset(&io_hdr, 0, sizeof(sg_io_hdr_t)); ++ io_hdr.interface_id = 'S'; ++ io_hdr.cmd_len = 6; ++ io_hdr.mx_sb_len = sizeof(sb); ++ io_hdr.dxfer_direction = SG_DXFER_NONE; ++ io_hdr.dxfer_len = 0; ++ io_hdr.dxferp = inqBuff; ++ io_hdr.sbp = (unsigned char *) sb; ++ io_hdr.timeout = 2000; ++ io_hdr.cmdp = test_unit_ready_cmd; ++ ++ sb[0] = 0xFF; ++ ++ status = ioctl(h, SG_IO, (void *)&io_hdr); ++ ++ if ( (status == 0) && (sb[0] == 0xFF)) ++ inserted = 1; ++ } ++ ++ close(h); ++ } ++ } else ++ inserted = 1; ++ ++ return inserted; ++} ++ + static void ide_atapi_cmd(IDEState *s) + { + const uint8_t *packet; +@@ -1162,11 +1212,25 @@ static void ide_atapi_cmd(IDEState *s) + switch(s->io_buffer[0]) { + case GPCMD_TEST_UNIT_READY: + if (bdrv_is_inserted(s->bs)) { +- ide_atapi_cmd_ok(s); ++ if (s->media_changed) { ++ s->media_changed = 0; ++ ide_atapi_cmd_error(s, SENSE_UNIT_ATTENTION, ASC_MEDIA_CHANGED); ++ } ++ else { ++ if (!cd_media_inserted(s) || shdev_media_check(s->bs)) { ++ bdrv_close(s->bs); ++ ide_atapi_cmd_error(s, SENSE_NOT_READY, ASC_MEDIUM_NOT_PRESENT); ++ } ++ else ++ ide_atapi_cmd_ok(s); ++ } + } else { + ide_atapi_cmd_error(s, SENSE_NOT_READY, + ASC_MEDIUM_NOT_PRESENT); +- xenstore_check_new_media_present(1000); ++// xenstore_check_new_media_present(1000); ++ if (cd_media_inserted(s)) { ++ do_insert_request(); ++ } + } + break; + case GPCMD_MODE_SENSE_10: +@@ -1298,6 +1362,13 @@ static void ide_atapi_cmd(IDEState *s) + ASC_MEDIUM_NOT_PRESENT); + break; + } ++ ++ if (shdev_media_check(s->bs)) { ++ bdrv_close(s->bs); ++ ide_atapi_cmd_error(s, SENSE_NOT_READY, ASC_MEDIUM_NOT_PRESENT); ++ break; ++ } ++ + nb_sectors = (packet[6] << 16) | (packet[7] << 8) | packet[8]; + lba = ube32_to_cpu(packet + 2); + if (nb_sectors == 0) { +@@ -1355,7 +1426,7 @@ static void ide_atapi_cmd(IDEState *s) + + if (eject && !start) { + /* eject the disk */ +- bdrv_close(s->bs); ++ do_eject(1, s->bs->device_name); + } + ide_atapi_cmd_ok(s); + } +@@ -1382,6 +1453,13 @@ static void ide_atapi_cmd(IDEState *s) + ASC_MEDIUM_NOT_PRESENT); + break; + } ++ ++ if (shdev_media_check(s->bs)) { ++ bdrv_close(s->bs); ++ ide_atapi_cmd_error(s, SENSE_NOT_READY, ASC_MEDIUM_NOT_PRESENT); ++ break; ++ } ++ + max_len = ube16_to_cpu(packet + 7); + format = packet[9] >> 6; + msf = (packet[1] >> 1) & 1; +@@ -1454,9 +1532,9 @@ static void cdrom_change_cb(void *opaque + IDEState *s = opaque; + int64_t nb_sectors; + +- /* XXX: send interrupt too */ + bdrv_get_geometry(s->bs, &nb_sectors); + s->nb_sectors = nb_sectors; ++ s->media_changed = 1; + } + + static void ide_cmd_lba48_transform(IDEState *s, int lba48) +@@ -1756,6 +1834,7 @@ static void ide_ioport_write(void *opaqu + ide_set_signature(s); + s->status = 0x00; /* NOTE: READY is _not_ set */ + s->error = 0x01; ++ s->media_changed = 0; + break; + case WIN_PACKETCMD: + if (!s->is_cdrom) +Index: xen-unstable/tools/ioemu/monitor.c +=================================================================== +--- xen-unstable.orig/tools/ioemu/monitor.c ++++ xen-unstable/tools/ioemu/monitor.c +@@ -24,6 +24,7 @@ + #include "vl.h" + #include "disas.h" + #include ++#include + #include "block_int.h" + + //#define DEBUG +@@ -340,7 +341,44 @@ void do_eject(int force, const char *fil + term_printf("device not found\n"); + return; + } +- eject_device(bs, force); ++ ++ if (eject_device(bs, force) == 0) { ++ char cmd[strlen(bs->filename) + 16]; ++ shdev_eject_notice(bs); ++ sprintf(cmd, "eject %s", bs->filename); ++ system(cmd); ++ } ++} ++ ++void do_insert(const char *device) ++{ ++ BlockDriverState *bs; ++ ++ bs = bdrv_find(device); ++ ++ if (!bs) { ++ term_printf("'%s' not found\n", device); ++ return; ++ } ++ ++ if (!bs->removable) { ++ term_printf("'%s' is not removable\n", device); ++ return; ++ } ++ ++ if (bs->inserted) { ++ term_printf("'%s' is already inserted\n", device); ++ return; ++ } ++ ++ bdrv_open(bs, bs->filename, 0); ++} ++ ++static int find_bs_by_type(BlockDriverState *bs, void *opaque) ++{ ++ int *type = (int *)opaque; ++ ++ return( (bs->type == *type) ); + } + + void do_change(const char *device, const char *filename) +@@ -356,7 +394,8 @@ void do_change(const char *device, const + } + if (eject_device(bs, 0) < 0) + return; +- bdrv_open(bs, filename, 0); ++ pstrcpy(bs->filename, sizeof(bs->filename), filename); ++ do_insert(bs->device_name); + if (bdrv_is_encrypted(bs)) { + term_printf("%s is encrypted.\n", device); + for(i = 0; i < 3; i++) { +@@ -368,6 +407,19 @@ void do_change(const char *device, const + } + } + ++void do_insert_request() ++{ ++ BlockDriverState *bs = NULL; ++ int type = BDRV_TYPE_CDROM; ++ ++ bs = bdrv_find_bs(find_bs_by_type, &type); ++ ++ if (bs) ++ do_change(bs->device_name, bs->filename); ++ else ++ term_printf("Did not find cdrom bs.\n"); ++} ++ + static void do_screen_dump(const char *filename) + { + vga_hw_screen_dump(filename); +Index: xen-unstable/tools/ioemu/sdl.c +=================================================================== +--- xen-unstable.orig/tools/ioemu/sdl.c ++++ xen-unstable/tools/ioemu/sdl.c +@@ -544,7 +544,7 @@ void sdl_display_init(DisplayState *ds, + #ifndef _WIN32 + /* NOTE: we still want Ctrl-C to work, so we undo the SDL redirections */ + signal(SIGINT, SIG_DFL); +- signal(SIGQUIT, SIG_DFL); ++// signal(SIGQUIT, SIG_DFL); + #endif + + ds->dpy_update = sdl_update; +Index: xen-unstable/tools/ioemu/vl.h +=================================================================== +--- xen-unstable.orig/tools/ioemu/vl.h ++++ xen-unstable/tools/ioemu/vl.h +@@ -180,6 +180,8 @@ extern int smp_cpus; + #define BIOS_SIZE ((256 + 64) * 1024) + #endif + ++#define CDROM_DISK_POSITION 2 ++ + /* keyboard/mouse support */ + + #define MOUSE_EVENT_LBUTTON 0x01 +@@ -561,6 +563,7 @@ void bdrv_set_change_cb(BlockDriverState + void (*change_cb)(void *opaque), void *opaque); + void bdrv_get_format(BlockDriverState *bs, char *buf, int buf_size); + void bdrv_info(void); ++BlockDriverState *bdrv_find_bs(int (*it)(BlockDriverState *bs, void *opaque), void *opaque); + BlockDriverState *bdrv_find(const char *name); + void bdrv_iterate(void (*it)(void *opaque, const char *name), void *opaque); + int bdrv_is_encrypted(BlockDriverState *bs); +@@ -1180,6 +1183,15 @@ pflash_t *pflash_register (target_ulong + + #endif /* defined(QEMU_TOOL) */ + ++/* shdev.h */ ++ ++int shdev_init(void); ++int shdev_report_device(BlockDriverState *bs, const char *name); ++void shdev_set_media_instance(BlockDriverState *bs); ++void shdev_eject_notice(BlockDriverState *bs); ++inline int shdev_media_check(BlockDriverState *bs); ++void do_info_shdev(void); ++ + /* monitor.c */ + void monitor_init(CharDriverState *hd, int show_banner); + void term_puts(const char *str); +@@ -1189,6 +1201,7 @@ void term_flush(void); + void term_print_help(void); + void monitor_readline(const char *prompt, int is_password, + char *buf, int buf_size); ++void do_insert_request(void); + void do_eject(int force, const char *filename); + void do_change(const char *device, const char *filename); + +Index: xen-unstable/tools/ioemu/shdev.c +=================================================================== +--- /dev/null ++++ xen-unstable/tools/ioemu/shdev.c +@@ -0,0 +1,138 @@ ++/* ++ * Managment for Devices Shared Across Guests ++ * ++ * Copyright (c) 2006 Novell, Inc. ++ * ++ * - Author: Ross Maxfield (ross.maxfield@novell.com) ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a copy ++ * of this software and associated documentation files (the "Software"), to deal ++ * in the Software without restriction, including without limitation the rights ++ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ++ * copies of the Software, and to permit persons to whom the Software is ++ * furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in ++ * all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ++ * THE SOFTWARE. ++ */ ++ ++#include "vl.h" ++#include "block_int.h" ++#include ++ ++#define MAX_SHARED_DEVS 4 ++#define SHDEV_NAME_LEN 128 ++#define SHARED_DEVS_SIGNATURE "ShRdDeVs" ++#define QEMU_KEY_PATH "/etc/xen" ++ ++typedef struct SharedDevice { ++ char name[SHDEV_NAME_LEN]; ++ int media_instance; ++} SharedDevice; ++ ++typedef struct SharedDevices { ++ char signature[sizeof(SHARED_DEVS_SIGNATURE)]; ++ SharedDevice device[MAX_SHARED_DEVS]; ++} SharedDevices; ++ ++SharedDevices *shdevs; ++ ++int shdev_init() ++{ ++ key_t shm_key; ++ int shm_id; ++ ++ /* Alloc/Get shared device memory */ ++ shm_key = ftok(QEMU_KEY_PATH, 'X'); ++ ++ if (((shm_id = shmget(shm_key, ++ sizeof(SharedDevices), ++ IPC_CREAT|IPC_EXCL|0660)) != -1) ++ && ((shdevs = shmat(shm_id, 0, 0)) != (void *)-1)) { ++ memcpy(&shdevs->signature, SHARED_DEVS_SIGNATURE, ++ sizeof(SHARED_DEVS_SIGNATURE)); ++ } ++ else ++ if (errno == EEXIST) ++ { ++ if (((shm_id = shmget(shm_key, sizeof(SharedDevices), 0)) == -1) ++ || ((shdevs = shmat(shm_id, 0, 0)) == (void *)-1) ++ || (memcmp(shdevs->signature, SHARED_DEVS_SIGNATURE, ++ sizeof(SHARED_DEVS_SIGNATURE)) != 0)) { ++ shdevs = NULL; ++ fprintf(stderr, "Could not setup support for shared devices.\n"); ++ return 1; ++ } ++ } ++ ++ return 0; ++} ++ ++void shdev_set_media_instance(BlockDriverState *bs) ++{ ++ bs->media_instance = shdevs->device[bs->shdev_el].media_instance; ++} ++ ++void shdev_eject_notice(BlockDriverState *bs) ++{ ++ shdevs->device[bs->shdev_el].media_instance++; ++} ++ ++inline int shdev_media_check(BlockDriverState *bs) ++{ ++ return(!(bs->media_instance == shdevs->device[bs->shdev_el].media_instance)); ++} ++ ++int shdev_report_device(BlockDriverState *bs, const char *name) ++{ ++ int i; ++ ++ for (i = 0; ++ (i < MAX_SHARED_DEVS) && strcmp(shdevs->device[i].name, name); ++ i++); ++ ++ if (i == MAX_SHARED_DEVS) { ++ for (i = 0; ++ (i < MAX_SHARED_DEVS) && (shdevs->device[i].name[0] != '\0'); ++ i++); ++ ++ if (i < MAX_SHARED_DEVS) { ++ pstrcpy(shdevs->device[i].name, SHDEV_NAME_LEN, name); ++ shdevs->device[i].media_instance = 0; ++ } ++ else { ++ fprintf(stderr, "%s exceeds maximum of %d shared devices.\n", ++ name, MAX_SHARED_DEVS ); ++ return -1; ++ } ++ } ++ ++ bs->media_instance = shdevs->device[i].media_instance; ++ bs->shdev_el = i; ++ ++ return 0; ++} ++ ++void do_info_shdev(void) ++{ ++ int i; ++ ++ /* Can this device be made availble to this domain? */ ++ for (i = 0; i < MAX_SHARED_DEVS; i++) { ++ if (shdevs->device[i].name[0] != '\0') { ++ term_printf("'%s' [%d]\n", ++ shdevs->device[i].name, ++ shdevs->device[i].media_instance); ++ } ++ } ++} ++ ++ +Index: xen-unstable/tools/ioemu/Makefile.target +=================================================================== +--- xen-unstable.orig/tools/ioemu/Makefile.target ++++ xen-unstable/tools/ioemu/Makefile.target +@@ -307,7 +307,7 @@ ifeq ($(ARCH),alpha) + endif + + # must use static linking to avoid leaving stuff in virtual address space +-VL_OBJS=vl.o osdep.o block.o readline.o monitor.o pci.o console.o ++VL_OBJS=vl.o osdep.o block.o shdev.o readline.o monitor.o pci.o console.o + VL_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o + ifdef CONFIG_WIN32 + VL_OBJS+=tap-win32.o +Index: xen-unstable/tools/ioemu/vl.c +=================================================================== +--- xen-unstable.orig/tools/ioemu/vl.c ++++ xen-unstable/tools/ioemu/vl.c +@@ -5843,6 +5843,8 @@ int main(int argc, char **argv) + int usb_devices_index; + unsigned long nr_pages, tmp_nr_pages, shared_page_nr; + xen_pfn_t *page_array; ++ int dev_type; ++ char buf[64]; + extern void *shared_page; + extern void *buffered_io_page; + +@@ -5073,7 +5073,7 @@ int main(int argc, char **argv) + #ifdef CONFIG_GDBSTUB + int use_gdbstub, gdbstub_port; + #endif +- int i, has_cdrom; ++ int i, has_cdrom = 0; + int snapshot, linux_boot; + CPUState *env; + const char *initrd_filename; +@@ -5094,6 +5094,8 @@ int main(int argc, char **argv) + const char *loadvm = NULL; + unsigned long nr_pages, extra_pages, ram_pages, *page_array; + xc_dominfo_t info; ++ int dev_type; ++ char buf[64]; + extern void *shared_page; + extern void *shared_vram; + extern void *buffered_io_page; +@@ -5122,7 +5124,6 @@ int main(int argc, char **argv) + vncconnect=NULL; + kernel_filename = NULL; + kernel_cmdline = ""; +- has_cdrom = 1; + cyls = heads = secs = 0; + pstrcpy(monitor_device, sizeof(monitor_device), "vc"); + +@@ -5185,12 +5186,6 @@ int main(int argc, char **argv) + case QEMU_OPTION_initrd: + initrd_filename = optarg; + break; +- case QEMU_OPTION_hda: +- hd_filename[0] = optarg; +- break; +- case QEMU_OPTION_hdb: +- hd_filename[1] = optarg; +- break; + case QEMU_OPTION_snapshot: + snapshot = 1; + break; +@@ -5263,15 +5258,56 @@ int main(int argc, char **argv) + } + } + break; ++ case QEMU_OPTION_hda: ++ if (hd_filename[0]) { ++ fprintf(stderr, ++ "qemu: virtual device 'hd%c' already defined as %s\n", ++ 'a', ++ hd_filename[0] ); ++ break; ++ } ++ hd_filename[0] = optarg; ++ break; ++ case QEMU_OPTION_hdb: ++ if (hd_filename[1]) { ++ fprintf(stderr, ++ "qemu: virtual device 'hd%c' already defined as %s\n", ++ 'b', ++ hd_filename[1] ); ++ break; ++ } ++ hd_filename[1] = optarg; ++ break; + case QEMU_OPTION_hdc: ++ if (hd_filename[2]) { ++ fprintf(stderr, ++ "qemu: virtual device 'hd%c' already defined as %s\n", ++ 'c', ++ hd_filename[2] ); ++ break; ++ } + hd_filename[2] = optarg; +- has_cdrom = 0; + break; + case QEMU_OPTION_hdd: ++ if (hd_filename[3]) { ++ fprintf(stderr, ++ "qemu: virtual device 'hd%c' already defined as %s\n", ++ 'd', ++ hd_filename[3] ); ++ break; ++ } + hd_filename[3] = optarg; + break; + case QEMU_OPTION_cdrom: +- hd_filename[2] = optarg; ++ if (hd_filename[CDROM_DISK_POSITION]) { ++ fprintf(stderr, ++ "qemu: virtual device 'hd%c' for cdrom " ++ "is already defined as %s\n", ++ 'a' + CDROM_DISK_POSITION, ++ hd_filename[CDROM_DISK_POSITION] ); ++ break; ++ } ++ hd_filename[CDROM_DISK_POSITION] = optarg; + has_cdrom = 1; + break; + case QEMU_OPTION_boot: +@@ -5487,7 +5523,7 @@ int main(int argc, char **argv) + linux_boot = (kernel_filename != NULL); + + if ( !linux_boot && hd_filename[0] == '\0' && +- hd_filename[2] == '\0' && fd_filename[0] == '\0' ) ++ hd_filename[CDROM_DISK_POSITION] == '\0' && fd_filename[0] == '\0' ) + help(); + + /* boot to cd by default if no hard disk */ +@@ -5668,59 +5704,55 @@ int main(int argc, char **argv) + fprintf(logfile, "shared page at pfn:%lx, mfn: %lx\n", (nr_pages-1), + (page_array[nr_pages - 1])); + +- /* we always create the cdrom drive, even if no disk is there */ + bdrv_init(); +- if (has_cdrom) { +- int fd; +- if ( (fd = open(hd_filename[2], O_RDONLY | O_BINARY)) < 0) { +- hd_filename[2]=NULL; +- bs_table[2]=NULL; +- fprintf(logfile, "Could not open CD %s.\n", hd_filename[i]); +- } +- else { +- close(fd); +- bs_table[2] = bdrv_new("cdrom"); +- bdrv_set_type_hint(bs_table[2], BDRV_TYPE_CDROM); +- } +- } ++ ++ shdev_init(); + + /* open the virtual block devices */ + for(i = 0; i < MAX_DISKS; i++) { + if (hd_filename[i]) { +- if (!bs_table[i]) { +- char buf[64]; ++ if ((i == CDROM_DISK_POSITION) && has_cdrom) { ++ snprintf(buf, sizeof(buf), "cdrom"); ++ dev_type = BDRV_TYPE_CDROM; ++ } ++ else { + snprintf(buf, sizeof(buf), "hd%c", i + 'a'); +- bs_table[i] = bdrv_new(buf); ++ dev_type = BDRV_TYPE_HD; + } ++ ++ bs_table[i] = bdrv_new(buf); ++ ++ bdrv_set_type_hint(bs_table[i], dev_type); ++ ++ if (bs_table[i]->removable) ++ shdev_report_device(bs_table[i], hd_filename[i]); ++ + if (bdrv_open(bs_table[i], hd_filename[i], snapshot) < 0) { ++ if (bs_table[i]->removable) ++ continue; ++ + fprintf(stderr, "qemu: could not open hard disk image '%s'\n", + hd_filename[i]); + exit(1); + } ++ + if (i == 0 && cyls != 0) + bdrv_set_geometry_hint(bs_table[i], cyls, heads, secs); + } + } + +- /* we always create at least one floppy disk */ +- fd_table[0] = bdrv_new("fda"); +- bdrv_set_type_hint(fd_table[0], BDRV_TYPE_FLOPPY); +- + for(i = 0; i < MAX_FD; i++) { + if (fd_filename[i]) { + if (!fd_table[i]) { +- char buf[64]; + snprintf(buf, sizeof(buf), "fd%c", i + 'a'); + fd_table[i] = bdrv_new(buf); + bdrv_set_type_hint(fd_table[i], BDRV_TYPE_FLOPPY); ++ shdev_report_device(fd_table[i], fd_filename[i]); + } +- if (fd_filename[i] != '\0') { +- if (bdrv_open(fd_table[i], fd_filename[i], snapshot) < 0) { +- fprintf(stderr, "qemu: could not open floppy disk image '%s'\n", ++ ++ if (bdrv_open(fd_table[i], fd_filename[i], snapshot) < 0) ++ fprintf(stderr, "qemu: could not open floppy disk '%s'\n", + fd_filename[i]); +- exit(1); +- } +- } + } + } + diff --git a/xen-rpmoptflags.diff b/xen-rpmoptflags.diff new file mode 100644 index 0000000..7b9b587 --- /dev/null +++ b/xen-rpmoptflags.diff @@ -0,0 +1,78 @@ +Index: xen-3.0.3-testing/tools/firmware/hvmloader/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/tools/firmware/hvmloader/Makefile ++++ xen-3.0.3-testing/tools/firmware/hvmloader/Makefile +@@ -37,7 +37,8 @@ CFLAGS += $(call test-gcc-flag,$(CC),-f + CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector-all) + + OBJCOPY = objcopy +-CFLAGS += $(DEFINES) -I. $(XENINC) -fno-builtin -O2 -msoft-float ++# Optimizations cause problems on 64 bit. Investigate. ++CFLAGS += $(DEFINES) -I. $(XENINC) -fno-builtin -O0 -msoft-float + LDFLAGS = -m32 -nostdlib -Wl,-N -Wl,-Ttext -Wl,$(LOADADDR) + + SRCS = hvmloader.c acpi_madt.c mp_tables.c util.c smbios.c +Index: xen-3.0.3-testing/tools/blktap/drivers/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/tools/blktap/drivers/Makefile ++++ xen-3.0.3-testing/tools/blktap/drivers/Makefile +@@ -10,7 +10,6 @@ QCOW_UTIL = img2qcow qcow2raw qcow-cr + INSTALL_DIR = /usr/sbin + LIBAIO_DIR = ../../libaio/src + +-CFLAGS += -Werror + CFLAGS += -Wno-unused + CFLAGS += -fno-strict-aliasing + CFLAGS += -I $(XEN_LIBXC) -I $(LIBAIO_DIR) +Index: xen-3.0.3-testing/tools/console/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/tools/console/Makefile ++++ xen-3.0.3-testing/tools/console/Makefile +@@ -9,7 +9,7 @@ INSTALL = install + INSTALL_PROG = $(INSTALL) -m0755 + INSTALL_DIR = $(INSTALL) -d -m0755 + +-CFLAGS += -Werror -g ++CFLAGS += -Werror + + CFLAGS += -I $(XEN_LIBXC) + CFLAGS += -I $(XEN_XENSTORE) +Index: xen-3.0.3-testing/tools/ioemu/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/tools/ioemu/Makefile ++++ xen-3.0.3-testing/tools/ioemu/Makefile +@@ -8,7 +8,7 @@ include $(XEN_ROOT)/tools/Rules.mk + .PHONY: all clean distclean dvi info install install-doc tar tarbin \ + speed test test2 html dvi info + +-CFLAGS+=-Wall -O2 -g -fno-strict-aliasing -I. ++CFLAGS+=-Wall -fno-strict-aliasing -I. + ifdef CONFIG_DARWIN + CFLAGS+= -mdynamic-no-pic + endif +Index: xen-3.0.3-testing/tools/xenstore/Makefile +=================================================================== +--- xen-3.0.3-testing.orig/tools/xenstore/Makefile ++++ xen-3.0.3-testing/tools/xenstore/Makefile +@@ -11,7 +11,7 @@ INSTALL_PROG = $(INSTALL) -m0755 + INSTALL_DIR = $(INSTALL) -d -m0755 + + PROFILE=#-pg +-BASECFLAGS=-Wall -g -Werror ++BASECFLAGS=-Wall -Werror + # Make gcc generate dependencies. + BASECFLAGS += -Wp,-MD,.$(@F).d + PROG_DEP = .*.d +Index: xen-3.0.3-testing/Config.mk +=================================================================== +--- xen-3.0.3-testing.orig/Config.mk ++++ xen-3.0.3-testing/Config.mk +@@ -10,7 +10,7 @@ XEN_TARGET_X86_PAE ?= n + + # Tools to run on system hosting the build + HOSTCC = gcc +-HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer ++HOSTCFLAGS:= -Wall -Werror -Wstrict-prototypes $(RPM_OPT_FLAGS) + + AS = $(CROSS_COMPILE)as + LD = $(CROSS_COMPILE)ld diff --git a/xen-tightvnc-args.diff b/xen-tightvnc-args.diff new file mode 100644 index 0000000..2d9fdf5 --- /dev/null +++ b/xen-tightvnc-args.diff @@ -0,0 +1,14 @@ +Index: xen-unstable/tools/python/xen/xm/create.py +=================================================================== +--- xen-unstable.orig/tools/python/xen/xm/create.py ++++ xen-unstable/tools/python/xen/xm/create.py +@@ -902,8 +902,7 @@ def spawn_vnc(display): + returns the port that the vncviewer is listening on and sets the global + vncpid. On failure, returns 0. Note that vncviewer is daemonized. + """ +- vncargs = (["vncviewer", "-log", "*:stdout:0", +- "-listen", "%d" % (VNC_BASE_PORT + display) ]) ++ vncargs = (["vncviewer", "-listen", "%d" % (display) ]) + global vncpid + vncpid = daemonize("vncviewer", vncargs) + if vncpid == 0: diff --git a/xen-warnings.diff b/xen-warnings.diff new file mode 100644 index 0000000..d47cf08 --- /dev/null +++ b/xen-warnings.diff @@ -0,0 +1,51 @@ +Index: xen-3.0.3-testing/xen/tools/symbols.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/tools/symbols.c ++++ xen-3.0.3-testing/xen/tools/symbols.c +@@ -120,7 +120,8 @@ read_symbol(FILE *in, struct sym_entry * + if (rc != 3) { + if (rc != EOF) { + /* skip line */ +- fgets(str, 500, in); ++ if (fgets(str, sizeof(str), in) == NULL) ++ ; /* don't care */ + } + return -1; + } +Index: xen-3.0.3-testing/tools/misc/miniterm/miniterm.c +=================================================================== +--- xen-3.0.3-testing.orig/tools/misc/miniterm/miniterm.c ++++ xen-3.0.3-testing/tools/misc/miniterm/miniterm.c +@@ -157,7 +157,7 @@ int main(int argc, char **argv) + case 0: + close(1); /* stdout not needed */ + for ( c = (char)getchar(); c != ENDMINITERM; c = (char)getchar() ) +- write(fd,&c,1); ++ if (write(fd,&c,1)) ; + tcsetattr(fd,TCSANOW,&oldsertio); + tcsetattr(0,TCSANOW,&oldstdtio); + close(fd); +@@ -169,19 +169,19 @@ int main(int argc, char **argv) + close(fd); + exit(-1); + default: +- write(1, start_str, strlen(start_str)); ++ if (write(1, start_str, strlen(start_str))) ; + close(0); /* stdin not needed */ + sa.sa_handler = child_handler; + sa.sa_flags = 0; + sigaction(SIGCHLD,&sa,NULL); /* handle dying child */ + while ( !stop ) + { +- read(fd,&c,1); /* modem */ ++ if (read(fd,&c,1)) ; /* modem */ + c = (char)c; +- write(1,&c,1); /* stdout */ ++ if (write(1,&c,1)) ; /* stdout */ + } + wait(NULL); /* wait for child to die or it will become a zombie */ +- write(1, end_str, strlen(end_str)); ++ if (write(1, end_str, strlen(end_str))) ; + break; + } + diff --git a/xen-xm-top-needs-root.diff b/xen-xm-top-needs-root.diff new file mode 100644 index 0000000..5da0793 --- /dev/null +++ b/xen-xm-top-needs-root.diff @@ -0,0 +1,18 @@ +From: Charles Coffing +Upstream: no + +Index: xen-unstable/tools/python/xen/xm/main.py +=================================================================== +--- xen-unstable.orig/tools/python/xen/xm/main.py ++++ xen-unstable/tools/python/xen/xm/main.py +@@ -1018,6 +1018,10 @@ def xm_sysrq(args): + def xm_top(args): + arg_check(args, "top", 0) + ++ # A hack to get a clear error message if ran as non-root ++ if os.geteuid() != 0: ++ raise IOError() ++ + os.execvp('xentop', ['xentop']) + + def xm_dmesg(args): diff --git a/xen-xmexample-nbd.diff b/xen-xmexample-nbd.diff new file mode 100644 index 0000000..0139a32 --- /dev/null +++ b/xen-xmexample-nbd.diff @@ -0,0 +1,13 @@ +Index: xen-unstable/tools/examples/Makefile +=================================================================== +--- xen-unstable.orig/tools/examples/Makefile ++++ xen-unstable/tools/examples/Makefile +@@ -17,7 +17,7 @@ XEN_CONFIGS = xend-config.sxp + XEN_CONFIGS += xmexample1 + XEN_CONFIGS += xmexample2 + XEN_CONFIGS += xmexample.hvm +-XEN_CONFIGS += xmexample.vti ++XEN_CONFIGS += xmexample.nbd + XEN_CONFIGS += xend-pci-quirks.sxp + XEN_CONFIGS += xend-pci-permissive.sxp + diff --git a/xen-xmexample.diff b/xen-xmexample.diff new file mode 100644 index 0000000..4c70933 --- /dev/null +++ b/xen-xmexample.diff @@ -0,0 +1,181 @@ +Change various example paths in the config files to match SUSE. + +Index: xen-unstable/tools/examples/xmexample1 +=================================================================== +--- xen-unstable.orig/tools/examples/xmexample1 ++++ xen-unstable/tools/examples/xmexample1 +@@ -7,11 +7,14 @@ + #============================================================================ + + #---------------------------------------------------------------------------- +-# Kernel image file. +-kernel = "/boot/vmlinuz-2.6.10-xenU" +- +-# Optional ramdisk. +-#ramdisk = "/boot/initrd.gz" ++# Kernel image file and (optional) ramdisk (initrd). ++kernel = "/boot/vmlinuz-xen" ++ramdisk = "/boot/initrd-xen" ++ ++# Or use domUloader instead of kernel/ramdisk to get kernel from domU FS ++#bootloader = "/usr/lib/xen/boot/domUlaoder.py" ++#bootentry = "hda2:/vmlinuz-xen,/initrd-xen" ++#bootentry = "/boot/vmlinuz-xen,/boot/initrd-xen" + + # The domain build function. Default is 'linux'. + #builder='linux' +@@ -96,7 +99,7 @@ disk = [ 'phy:hda1,hda1,w' ] + #hostname= "vm%d" % vmid + + # Set root device. +-root = "/dev/hda1 ro" ++root = "/dev/hda1" + + # Root device for nfs. + #root = "/dev/nfs" +@@ -105,8 +108,8 @@ root = "/dev/hda1 ro" + # Root directory on the nfs server. + #nfs_root = '/full/path/to/root/directory' + +-# Sets runlevel 4. +-extra = "4" ++# Extra arguments to pass to the kernel. ++extra = "" + + #---------------------------------------------------------------------------- + # Configure the behaviour when a domain exits. There are three 'reasons' +Index: xen-unstable/tools/examples/xmexample2 +=================================================================== +--- xen-unstable.orig/tools/examples/xmexample2 ++++ xen-unstable/tools/examples/xmexample2 +@@ -35,11 +35,14 @@ xm_vars.var('vmid', + xm_vars.check() + + #---------------------------------------------------------------------------- +-# Kernel image file. +-kernel = "/boot/vmlinuz-2.6.10-xenU" +- +-# Optional ramdisk. +-#ramdisk = "/boot/initrd.gz" ++# Kernel image file and (optional) ramdisk (initrd). ++kernel = "/boot/vmlinuz-xen" ++ramdisk = "/boot/initrd-xen" ++ ++# Or use domUloader instead of kernel/ramdisk to get kernel from domU FS ++#bootloader = "/usr/lib/xen/boot/domUlaoder.py" ++#bootentry = "hda2:/vmlinuz-xen,/initrd-xen" ++#bootentry = "/boot/vmlinuz-xen,/boot/initrd-xen" + + # The domain build function. Default is 'linux'. + #builder='linux' +@@ -132,7 +135,7 @@ disk = [ 'phy:sda%d,sda1,w' % (7+vmid), + #hostname= "vm%d" % vmid + + # Set root device. +-root = "/dev/sda1 ro" ++root = "/dev/sda1" + + # Root device for nfs. + #root = "/dev/nfs" +@@ -141,8 +144,8 @@ root = "/dev/sda1 ro" + # Root directory on the nfs server. + #nfs_root = '/full/path/to/root/directory' + +-# Sets runlevel 4 and the device for /usr. +-extra = "4 VMID=%d usr=/dev/sda6" % vmid ++# Sets the device for /usr. ++extra = "VMID=%d usr=/dev/sda6" % vmid + + #---------------------------------------------------------------------------- + # Configure the behaviour when a domain exits. There are three 'reasons' +Index: xen-unstable/tools/examples/xmexample3 +=================================================================== +--- xen-unstable.orig/tools/examples/xmexample3 ++++ xen-unstable/tools/examples/xmexample3 +@@ -35,11 +35,14 @@ xm_vars.var('vmid', + xm_vars.check() + + #---------------------------------------------------------------------------- +-# Kernel image file. +-kernel = "/path/to/domU/kernel" +- +-# Optional ramdisk. +-#ramdisk = "/boot/initrd.gz" ++# Kernel image file and (optional) ramdisk (initrd). ++kernel = "/boot/vmlinuz-xen" ++ramdisk = "/boot/initrd-xen" ++ ++# Or use domUloader instead of kernel/ramdisk to get kernel from domU FS ++#bootloader = "/usr/lib/xen/boot/domUlaoder.py" ++#bootentry = "hda2:/vmlinuz-xen,/initrd-xen" ++#bootentry = "/boot/vmlinuz-xen,/boot/initrd-xen" + + # The domain build function. Default is 'linux'. + #builder='linux' +Index: xen-unstable/tools/examples/xmexample.hvm +=================================================================== +--- xen-unstable.orig/tools/examples/xmexample.hvm ++++ xen-unstable/tools/examples/xmexample.hvm +@@ -70,7 +70,7 @@ vif = [ 'type=ioemu, bridge=xenbr0' ] + # and MODE is r for read-only, w for read-write. + + #disk = [ 'phy:hda1,hda1,r' ] +-disk = [ 'file:/var/images/min-el3-i386.img,hda,w', ',hdc:cdrom,r' ] ++disk = [ 'file:/var/lib/xen/images/disk.img,ioemu:hda,w', ',hdc:cdrom,r' ] + + #---------------------------------------------------------------------------- + # Configure the behaviour when a domain exits. There are three 'reasons' +Index: xen-unstable/docs/man/xmdomain.cfg.pod.5 +=================================================================== +--- xen-unstable.orig/docs/man/xmdomain.cfg.pod.5 ++++ xen-unstable/docs/man/xmdomain.cfg.pod.5 +@@ -38,13 +38,13 @@ file. + + The kernel image for the domain. The format of the parameter is the + fully qualified path to the kernel image file, +-i.e. I. ++i.e. I. + + + =item B + + The initial ramdisk for the domain. The format of the parameter is +-the fully qualified path to the initrd, i.e. I. On ++the fully qualified path to the initrd, i.e. I. On + many Linux distros you will not need a ramdisk if using the default + xen kernel. + +@@ -258,14 +258,14 @@ configured. They should not be consider + + =item I + +- kernel = "/boot/vmlinuz-2.6-xenU" ++ kernel = "/boot/vmlinuz-xen" + memory = 128 + name = "MyLinux" +- root = "/dev/hda1 ro" +- disk = [ "file:/var/xen/mylinux.img,hda1,w" ] ++ root = "/dev/hda1" ++ disk = [ "file:/var/lib/xen/images/MyLinux/hda1,hda1,w" ] + + This creates a domain called MyLinux with 128 MB of memory using a +-default xen kernel, and the file /var/xen/mylinux.img loopback mounted ++default xen kernel, and the file hda1 loopback mounted + at hda1, which is the root filesystem. + + =item I +Index: xen-unstable/docs/man/xm.pod.1 +=================================================================== +--- xen-unstable.orig/docs/man/xm.pod.1 ++++ xen-unstable/docs/man/xm.pod.1 +@@ -102,8 +102,8 @@ soon as it is run. + + =item I + +- xm create /dev/null ramdisk=initrd.img \ +- kernel=/boot/vmlinuz-2.6.12.6-xenU \ ++ xm create /dev/null ramdisk=initrd-xen \ ++ kernel=/boot/vmlinuz-xen \ + name=ramdisk nics=0 vcpus=1 \ + memory=64 root=/dev/ram0 + diff --git a/xen.changes b/xen.changes new file mode 100644 index 0000000..a16cf41 --- /dev/null +++ b/xen.changes @@ -0,0 +1,1490 @@ +------------------------------------------------------------------- +Mon Nov 27 18:07:41 MST 2006 - ccoffing@novell.com + +- Fix how bootloader is called by the xend during restarts. + (#223850) + +------------------------------------------------------------------- +Wed Nov 22 11:26:06 MST 2006 - ccoffing@novell.com + +- Include Jan's patch, which accounts for selectors in protected + mode with a non-zero base. Fixes some HVM crashes. (#214568) +- Default pae=1, otherwise 64 bit HVM does not work at all. + (#217160) + +------------------------------------------------------------------- +Fri Nov 17 11:30:16 MST 2006 - ccoffing@novell.com + +- Backport several HVM fixes. (#176171?) + +------------------------------------------------------------------- +Thu Nov 16 13:16:09 MST 2006 - ccoffing@novell.com + +- Fix some problems in the xen-hvm-default-bridge patch. (#219092) +- xmlrpc isn't 64-bit clean, causing xend to get exceptions when + PFN is > 2 GB. (#220418) + +------------------------------------------------------------------- +Tue Nov 14 14:20:09 MST 2006 - kallan@novell.com + +- Backport changesets 11847, 11888, 1189[6-9], 119[00-18], 11974, + 1203[0-2], and 12205 from xen-unstable so that the PV drivers + can compile on older kernels such as sles9 and rhel4 +- Fix netfront.c to fail the probe if it is called for an ioemu + type device. This allows both PV and FV drivers to exist at + same time in the FV guest. + +------------------------------------------------------------------- +Thu Nov 9 10:10:09 MST 2006 - ccoffing@novell.com + +- Default bridge correctly for HVM guests. (#219092) + +------------------------------------------------------------------- +Wed Nov 8 11:26:02 CET 2006 - aj@suse.de + +- Set correct permissions on man files. + +------------------------------------------------------------------- +Tue Nov 7 08:43:01 MST 2006 - ccoffing@novell.com + +- Fix some 64 bit issues in Python 2.5 introduced by PEP353. +- Update name of blktap.ko in xend init script. (#215384) +- Remove some extraneous bad chars in xm manpage. (#218440) +- Update logrotate.conf. +- Update spec file. + +------------------------------------------------------------------- +Tue Nov 01 11:16:05 MST 2006 - kallan@novell.com + +- Backport xen-unstable changesets 12040 to address spurious + interrupts with PV drivers in HVM guests. + +------------------------------------------------------------------- +Tue Oct 31 13:56:04 MST 2006 - ccoffing@novell.com + +- Backport xen-unstable changesets 1184[1-3] to address SVM + interrupt injection issues. Replaces earlier (broken) patches. + +------------------------------------------------------------------- +Mon Oct 30 15:19:02 MST 2006 - ccoffing@novell.com + +- /var/lib/xen/images should not be world readable. (#214638) +- Update to xen-3.0.3-0 (changeset 11774; no code changes). + +------------------------------------------------------------------- +Mon Oct 16 12:58:46 MDT 2006 - ccoffing@novell.com + +- Update to xen-3.0.3-testing changeset 11772 (rc5). +- Fix several possible type errors when running domUloader. +- Remove pygrub. Was broken on reiserfs and never had ext2 + support, so it is useless. (#173384) + +------------------------------------------------------------------- +Fri Oct 13 10:29:18 MDT 2006 - ccoffing@novell.com + +- Update to xen-3.0.3-testing changeset 11760 (rc4). + +------------------------------------------------------------------- +Tue Oct 10 10:42:51 MDT 2006 - ccoffing@novell.com + +- Update to xen-3.0.3-testing changeset 11740 (rc3). +- Fix crash on PAE when specifying dom0_mem=4096M. (#211399) +- Make xend.balloon aware of kernel's memory floor, to fix + "Privileged domain did not balloon" errors. (#184727) + +------------------------------------------------------------------- +Mon Oct 9 09:20:46 MDT 2006 - ccoffing@novell.com + +- Include AMD's interrupt injection fix. + +------------------------------------------------------------------- +Wed Oct 4 13:00:09 MDT 2006 - ccoffing@novell.com + +- Imported keymap patch. (#203758) +- Account for minimum memory required by dom0 kernel. (#184727) +- Package /usr/include/xen/hvm/*.h + +------------------------------------------------------------------- +Tue Oct 3 11:51:34 MDT 2006 - ccoffing@novell.com + +- Update to xen-3.0.3-testing changeset 11686. + +------------------------------------------------------------------- +Tue Oct 3 10:36 MDT 2006 - kallan@novell.com + +- Updated README.SuSE to reflect the current method of handling + Xen network-bridging when using SuSEfirewall2. (#205092) + +------------------------------------------------------------------- +Sat Sep 30 10:21:42 CEST 2006 - aj@suse.de + +- Cleanup BuildRequires. + +------------------------------------------------------------------- +Thu Sep 28 11:18:17 MDT 2006 - ccoffing@novell.com + +- Only "eval" disks once in domUloader, to match current Xen. + +------------------------------------------------------------------- +Wed Sep 27 10:47:16 MDT 2006 - ccoffing@novell.com + +- Switch to xen-3.0.3-testing tree; changeset 11633. +- Update (but disable) paravirtualized framebuffer patches. + +------------------------------------------------------------------- +Tue Sep 26 09:07:41 MDT 2006 - ccoffing@novell.com + +- Update to xen-unstable changeset 11623. +- Fix domUloader typo introduced in last update. +- Build debug version of xen-pae. + +------------------------------------------------------------------- +Mon Sep 25 10:11:31 MDT 2006 - ccoffing@novell.com + +- Update to xen-unstable changeset 11616. + +------------------------------------------------------------------- +Tue Sep 12 16:14:51 MDT 2006 - ccoffing@novell.com + +- Update check_python script to identify Python 2.5 RCs as valid. + +------------------------------------------------------------------- +Mon Sep 11 12:04:23 MDT 2006 - ccoffing@novell.com + +- Update to xen-unstable changeset 11440. +- xen-tools conflicts with qemu. Do not package qemu.1 manpage. + (#204758) +- Include Jan's updated patch for #192150 (to preserve register + context when doing IO). + +------------------------------------------------------------------- +Tue Sep 5 15:27:57 MDT 2006 - ccoffing@novell.com + +- Update block-nbd and xmexample.nbd, and add block-iscsi and + xmexample.iscsi (from Kurt). + +------------------------------------------------------------------- +Thu Aug 31 09:45:11 MDT 2006 - ccoffing@novell.com + +- Automatically create/destroy virtual frame buffer viewer. Add + "sdl=1" to config file of a paravirtualized VM to get the viewer. +- Log files have moved to /var/log/xen. + +------------------------------------------------------------------- +Tue Aug 29 15:34:38 MDT 2006 - ccoffing@novell.com + +- xendomains does not actually save domains. (#201349) +- Update to xen-unstable changeset 11299. + +------------------------------------------------------------------- +Tue Aug 29 01:04:22 CEST 2006 - ccoffing@novell.com + +- Fix incorrect path on x86_64 for vncfb and sdlfb. + +------------------------------------------------------------------- +Thu Aug 17 09:09:48 MDT 2006 - ccoffing@novell.com + +- Improve xendomains init script, to handle unset sysconfig vars. +- Import virtual framebuffer patches. +- Drop reboot patch; resync patches. + +------------------------------------------------------------------- +Wed Aug 16 09:20:15 MDT 2006 - ccoffing@novell.com + +- Update to xen-unstable changeset 11134. +- Drop xen-reverse-10064.diff now that kernel is updated. + +------------------------------------------------------------------- +Tue Aug 8 15:44:08 MDT 2006 - ccoffing@novell.com + +- Re-enabled patch for #184175. +- Update to xen-unstable changeset 10986. +- Include Jan's patch to preserve register context when doing + IO. (#192150) + +------------------------------------------------------------------- +Fri Jul 28 14:36:59 MDT 2006 - ccoffing@novell.com + +- Add support to domUloader for "xm create --dry-run". Based on + patch from HP. + +------------------------------------------------------------------- +Thu Jul 27 10:30:26 MDT 2006 - ccoffing@novell.com + +- Add link for qemu-dm that is invariant across architectures, so + that VM config files can be simple key/value pairs parsable by + yast, and still be movable to another arch. (#193854) +- Add loop.ko to rescue image created by mk-xen-rescue-img, and + remove usbfs from image's /etc/fstab since USB isn't yet + supported, to avoid errors during boot. (#191627) + +------------------------------------------------------------------- +Mon Jul 17 11:40:01 MDT 2006 - ccoffing@novell.com + +- Update to xen-unstable changeset 10712. +- Update domUloader and rcxend to work with blktap. + +------------------------------------------------------------------- +Fri Jul 14 09:02:50 MDT 2006 - ccoffing@novell.com + +- When waiting for domains to shut down, must also wait for + loopback devices to be torn down, otherwise higher-level tools + may migrate a VM before the disk image is flushed. (#185557) +- More updates to the README. + +------------------------------------------------------------------- +Wed Jul 13 13:06:14 MDT 2006 - kallan@novell.com + +- Added for loop to retry the losetup -d in /etc/xen/scripts/block. + It is possible for the losetup -d to fail if another process is + examining the loopback devices e.g. losetup -a. (#151105) + +------------------------------------------------------------------- +Wed Jul 12 16:11:10 MDT 2006 - ccoffing@novell.com + +- Corrected and updated README. + +------------------------------------------------------------------- +Mon Jul 10 10:27:09 MDT 2006 - ccoffing@novell.com + +- Add Jeff Mahoney's block-sync.diff, to give control of + "losetup -y" to the user (and potentially yast). Defaults to + old async behavior. (#190869) + +------------------------------------------------------------------- +Thu Jul 6 15:48:35 MDT 2006 - ccoffing@novell.com + +- Update to xen-unstable tree. Revert changeset 10064, to maintain + backwards compatibility with SLES 10. + +------------------------------------------------------------------- +Wed Jul 5 12:10:04 MDT 2006 - ccoffing@novell.com + +- Do not open migration port by default. (#190170) +- Update patch for migration oops, to latest version in bug + #162865. + +------------------------------------------------------------------- +Mon Jul 3 19:58:01 CEST 2006 - okir@suse.de + +- xen-losetup-sync.diff: use the new "losetup -y" option to force + the loop device to use synchronous I/O (#189051) + +------------------------------------------------------------------- +Fri Jun 30 12:38:24 MDT 2006 - ccoffing@novell.com + +- Increase balloon timeout value. (#189815) +- Update to xen-3.0-testing tree, changeset 9762. + +------------------------------------------------------------------- +Thu Jun 29 12:42:25 MDT 2006 - ccoffing@novell.com + +- Fix some loopback races in domUloader. (#151105) + +------------------------------------------------------------------- +Tue Jun 27 13:47:32 MDT 2006 - ccoffing@novell.com + +- Add "max_para_memory" and "max_hvm_memory" to output of "xm info" + for bug #184727. +- Include Jan's patches for bug #184175. Improves PAE guest + support on HVM. + +------------------------------------------------------------------- +Mon Jun 26 11:21:49 MDT 2006 - ccoffing@novell.com + +- Include patch from HP to fix a domU migration failure ("Kernel + BUG at mm/mmap.c:1961"). Force L1/L2 page tables to be updated + at the end, to avoid them from being dirtied and not transferred. + (#162865) + +------------------------------------------------------------------- +Thu Jun 23 09:23:19 MDT 2006 - kallan@novell.com + +- Updated xen-bonding.diff to enable bonding again after the latest + patches to network-bridge etc. (#161888) + +------------------------------------------------------------------- +Wed Jun 21 15:16:47 MDT 2006 - ccoffing@novell.com + +- Clean up the useless "Nothing to flush" messages, from 'ip addr + flush', in /var/log/xen-hotplug.log +- Fix race condition in domUloader.py, when another process did + losetup -d while domUloader was running. This would result in + the mount failing, and so the VM would fail to start. + +------------------------------------------------------------------- +Tue Jun 20 14:42:28 MDT 2006 - ccoffing@novell.com + +- Revamp balloon.py to account for pages currently being + scrubbed. (#185135) + +------------------------------------------------------------------- +Mon Jun 19 09:55:04 MDT 2006 - ccoffing@novell.com + +- Update to xen-3.0-testing tree, changeset 9749. +- DomUs are getting starved for CPU (up to 40 seconds was seen) + when dom0 has a load. This can cause pathological behavior, and + can cause OCFS2 to fence (panic) the domain. (#179368, #178884) +- Import Gerd's fix to network-bridge script for bug #161888. + +------------------------------------------------------------------- +Wed Jun 14 13:24:25 MDT 2006 - ccoffing@novell.com + +- Pull out accidentally-included debugging code. +- Drop xenvers patch; this was for backwards compatibility for + some early internal builds. +- Update from Jan on the console patch. Not all graphics cards / + drivers properly reflect the state in the register being tested. + Improved the check, to prevent screen corruption. (#161541) + +------------------------------------------------------------------- +Tue Jun 13 10:28:36 MDT 2006 - ccoffing@novell.com + +- Resync with new tarball from xen-3.0-testing; changeset 9738. + +------------------------------------------------------------------- +Mon Jun 12 10:23:35 MDT 2006 - ccoffing@novell.com + +- Drop BUILD_BUG_ON and pirq-shared patches. Last week's pirq + sharing patch from upstream (for bug #152892) makes these patches + redundant. Dropping these makes our shared_info structure match + upstream again, which is needed for compatibility with other + paravirtualized guests. +- Import changeset 9734 from xen-3.0-testing. This fixes a hyper- + call (used by the pcifront driver) to work on MP guests. Without + this, the pciback driver can hang on MP. (#181467) +- Import changeset 9733 from xen-3.0-testing. This patch is + required to match the Linux kernel, since Linux always calls + this operation from VCPU0 during secondary VCPU bringup. + Without this, process run-time accounting on secondary CPUs is + completely wrong. +- Updated README: Documented work-around for bug #180058. + +------------------------------------------------------------------- +Fri Jun 9 09:23:04 MDT 2006 - ccoffing@novell.com + +- Include Jan's patch: "IOPL is ignored for VM86 mode port + accesses. Fix Xen emulation to match native behaivour." Fixes + some X lockup issues. (#179045) +- Include Keir's patch to allow reading from port 0x61, to avoid + an X server lockup. (#171087) +- Include xen-3.0-testing changeset 9726, which is needed to + support the latest kernel-xen. With this support, Linux will + only trigger unhandled IRQ path if IRQ is not shared across + multiple guests (another guest may have handled the interrupt). + This is more upstream work that goes with bug #152892. +- Add versioning to the Requires lines, to guard against mixing + binary incompatible versions. (#183292) +- I accidentially dropped part of Clyde's fix for bug #162244. + SMP support in HVM is working in xen-unstable, so upstream + dropped the HT CPUID masking code, which we then inheirited. + Re-add HT CPUID masking. (#162244) +- Updated README: VNC installations, known issues. + +------------------------------------------------------------------- +Thu Jun 8 11:38:34 MDT 2006 - ccoffing@novell.com + +- Drop our XCHG patch for the equivalent upstream patch, to fix + patch application order. No code change. + +------------------------------------------------------------------- +Wed Jun 7 12:19:16 MDT 2006 - ccoffing@novell.com + +- Updated README: HVM issues/tips, CDROM tips, known issues. +- Add patch from Intel to decode LODS/STOS instructions to fix + Windows installation. Only affects HVM. Xen changeset #9725 + consolidates this patch and xen-hvm-decode.diff; drop our 2 in + favor of the consolidated upstream patch. (#176717) + +------------------------------------------------------------------- +Tue Jun 6 10:08:19 MDT 2006 - ccoffing@novell.com + +- Drop xen-8-way-bios patch, because it breaks Windows HVM + installation. The patch was only necessary when running SMP HVM + with "acpi=0" on the kernel command line. (#181974) +- Include two patches from xen-3.0-testing that change the + interface between Xen and guests. Including these now to help + forward-compatibility: + + 9709: Changes interface for accessing %cr3 so that extra bits + (>4GB) for PAE pgdirs are placed in low-order bits of %cr3. + Kernels without support for this will still run fine. + + 9721: Use explicitly-sized types in the dom0_ops and privcmd + structures. +- Fix ability to change ISOs images for HVM guest. (#181895) +- Removed pointless whitespace changes from xen-removable.diff, for + better maintainability. Cut the patch size in half; no code + changes. + +------------------------------------------------------------------- +Mon Jun 5 10:19:27 MDT 2006 - ccoffing@novell.com + +- Include select patches from xen-3.0-testing: + + 9698: Official fix for bug #159001. Dropped our patch. + + 9702: Fix MMU_NORMAL_PT_UPDATE when passed a page that is no + longer of type page-table. + + 9703: Modification to fix for bug #159001; ignore empty PTEs. + + 9704: Fix for obvious typo in map_pages_to_xen: When replacing + a pte, free the page table pointed to by the old entry, not the + new entry. + + 9705: Jan's previous signed-ness patch (c/s 9695) was changed + when accepted upstream, which broke it; this changeset + attempts to fix the breakage. + + 9708: HVM: Fix a hang when doing an "xm destroy" of Windows VM. + + 9717: HVM: Interrupts must be kept disabled when entering Xen + for external interrupt processing. + +------------------------------------------------------------------- +Fri Jun 2 11:08:07 MDT 2006 - ccoffing@novell.com + +- Include xen-3.0-testing changeset 9693. This scales the + ballooning timeout with the amount of memory being requested + (necessary for large memory machines). This is a more proper fix + for Novell bug #175805, and addresses XenSource bug #650. + +------------------------------------------------------------------- +Thu Jun 1 14:40:23 MDT 2006 - ccoffing@novell.com + +- Update the README, regarding how to make the mouse work properly + with VNC in HVM. +- Update help text in mk-xen-rescue-img. + +------------------------------------------------------------------- +Wed May 31 14:53:43 MDT 2006 - ccoffing@novell.com + +- Jan's backport of xen-unstable changesets 9517, 9518, and 9529. + This allows Xen to boot on 4-node configurations without + crashing. (#150114) +- Include patch from Jun Nakajima at Intel to fix inability to + start XWindows after creating HVM guest. (#159001) +- Include select patches from xen-3.0-testing: + + 9697: Fix infinite recursion loop in get_page_type() error path +- Include xen-unstable changeset 9967, to improve Summagraphics + tablet emulation, to help mouse tracking in HVM. (#167187) +- Include 3 patches from AMD to fix SMP support in HVM. (#176171) +- Add CPUID masking patches from AMD and Intel for HVM. This + prevents the OS from seeing (and trying to use) various hardware + features that are not supported within the VM. (#180879) + +------------------------------------------------------------------- +Fri May 26 11:48:08 MDT 2006 - ccoffing@novell.com + +- Fix deadlock between xm and qemu. Qemu should not call xm; + issue xc commands directly. This deadlock was exposed when + making qemu exit nicely and clean up. (#176400) +- Include Gerd's update to his previous REP MOVS fix. Calculating + high_addr and low_addr is more complicated than previously + thought, and the count was wrong. (#165448). +- Drop previous patch that forcefully turns off Xen's console + logging to avoid video corruption; instead use Jan's patch which + only turns logging off when in graphical mode. (#161541) +- Include Jan's patch to call machine_halt rather than inline + assembly "hlt" when Xen crashes to sync display, disable watchdog + timers, etc. +- Tweak the auto-ballooning patch to limit the VM itself to the + requested amount of memory, don't include the overhead, as + suggested by Intel. Separate calls exist elsewhere to increase + the max as needed. (#149179) +- Include select patches from xen-3.0-testing: + + 9688, 9696: These remove some broken assembly string + functions. This is prep work from Jan for bug #160066. + + 9695: Updates in the hypervisor to EDI and ESI could be + incorrect, due to sign not being handled correctly. + +------------------------------------------------------------------- +Fri May 19 11:01:29 MDT 2006 - ccoffing@novell.com + +- Update from Intel to previous patch to fix installation of HVM + W2k. Adds decoding for two more instructions. (#176717) +- Updated the README. +- Included updated version of KY's patch to reserve some lowmem + for PAE, to avoid kernel BUG() during boot. The amounts of + memory reserved at various physical memory sizes have been + adjusted. (#175124) +- Include Intel's patch for unchecked allocations in shadow*.c. + (#149179) + +------------------------------------------------------------------- +Thu May 18 09:50:11 MDT 2006 - ccoffing@novell.com + +- Include Intel's patch to fix installation of HVM W2k. This patch + adds decoding for 'xor' and 'and' instructions. Without this, + the VM crashes when W2k attempts to install network components. + (#176717) +- While tidying xen-hvm-memory-check.diff for submission upstream, + I noticed an error in the patch (such that low-memory while + starting the HVM domain could still crash the physical machine.) + Now all uses of iopm are protected by the check. (#149179) +- Xen must always relinquish control of the VGA console once dom0 + has started. Otherwise, it could be over-writing dom0's memory, + causing screen or other memory corruption. Admin can use + "xm dmesg" to view Xen's log instead. (#161541) +- First send a SIGTERM, rather than SIGKILL, to qemu to give it a + chance to clean up. This fixes both mouse and CD-ROM issues + for fully virtualized VMs. This is a work-around; Ross is + still working on the proper fix. (#176400, #171258, #176157) +- Include select patches from xen-3.0-testing: + + 9682,9683: These patches only affect full virtualization on + AMD. Fixes register corruption, cleans up event injection, + cleans up IO handling. + + 9685,9686: This patch only affects full virtualization on + Intel. Fixes VM's segment base address, to avoid vmentry + failure. Also remove 32/64 differences in vmx reg store/load. + +------------------------------------------------------------------- +Wed May 17 14:45:46 MDT 2006 - ccoffing@novell.com + +- When auto-ballooning domain 0's memory for a new HVM domain, + all memory (including memory intended for overhead) was given + to the VM itself. So increasing the memory size calculations + did not actually free up any more memory. Now, treat the amount + to balloon and the amount to give to the VM as separate values. + (#149179) + +------------------------------------------------------------------- +Tue May 16 11:11:12 MDT 2006 - ccoffing@novell.com + +- Include Gerd's fix for HVM emulation of REP MOVS when the copy + spans a page. If the direction flag was set, the emulation code + broke. This caused the VM to freeze when configuring firewall + (#165448). +- Include KY's fix to default to reserving 16M of lowmem for PAE, + to avoid hitting kernel BUG() during boot (#175124). +- Don Dugger's (Intel) fix for HVM screen corruption (#164573). +- Increase maximum time auto-ballooning will wait for domain 0 to + respond, otherwise large VMs will fail to start from yast + (#175805). + +------------------------------------------------------------------- +Mon May 15 13:18:14 MDT 2006 - ccoffing@novell.com + +- Update memory size calculations when auto-ballooning for HVM + to make more stable (#149179). + +------------------------------------------------------------------- +Fri May 12 10:42:37 MDT 2006 - ccoffing@novell.com + +- Include select patches from xen-3.0-testing: + + 9674: xc_ptrace: Fix reversed conditional, which broke single- + stepping. + + 9675: xc_ptrace: Fix out-of-bounds memory-access for FPU state. + + 9678: Fix the performance issues of 2-level paging HVM guests + on the PAE Xen. +- Update man pages. + +------------------------------------------------------------------- +Wed May 10 12:38:14 MDT 2006 - brogers@novell.com + +- Fix loading of binary images which either require PAE or + dynamically support running on both PAE hypervisor and non-PAE + hypervisors. (#174080) + +------------------------------------------------------------------- +Wed May 10 12:36:23 MDT 2006 - carnold@novell.com + +- Handle memory failure when staring fully virtualized + guests to prevent reboot of the box (AMD) or + hanging the box (VT) (#149179). + +------------------------------------------------------------------- +Tue May 9 16:40:59 MDT 2006 - ccoffing@novell.com + +- Include select patches from xen-3.0-testing: + + 9665: Fix pciif parsing for compatibility variable. + + 9666: Fix HVM hang; was broken due to previous "hda lost + interrupt" patch. (#169146) + + 9667: Do not set GP fault in VMCS for VMX (no bug#; from Intel) + +------------------------------------------------------------------- +Thu May 4 20:53:21 MDT 2006 - cgriffin@novell.com + +- Update xen-3.0-testing tree, changeset 9664: + + Changesets 9663 and 9664 fix AMD fully virtualized + guests causing the system to reboot when + first starting up. (#169855) + +------------------------------------------------------------------- +Thu May 4 20:16:06 MDT 2006 - cgriffin@novell.com + +- With a Xen domain set up with a loop-mountable file as rootfs, + the "xm start " invocation fails. The cause is a bug + domUloader.py (#172586) + +------------------------------------------------------------------- +Thu May 4 12:52:32 MDT 2006 - rmaxfiel@novell.com + +- Added the ability to 'attach' and 'detach' removable media + devices to hvm guests. Also made cdrom eject when the eject + request comes from the hvm guest. (#159907) +- Fixed the loss of mouse when a SDL session ends with 'grab' + in effect. (#159001) + +------------------------------------------------------------------- +Thu May 4 10:42:32 MDT 2006 - cgriffin@novell.com + +- Update xen-3.0-testing tree, changeset 9661: + + Drop patches merged upstream + + Took Kier's official patches for dropped patches most + notably spurious interrupts (#152892) +- Took Intel's patch to fix screen corruption when + resizing the screen of windows hvm guests (#164573) + +------------------------------------------------------------------- +Wed May 03 11:14:40 MDT 2006 - kallan@novell.com + +- Added configuring network interfaces when using Xen bridging instructions + to the README.SuSE file as requested by bug #171533. + +------------------------------------------------------------------- +Mon May 01 09:42:25 MDT 2006 - tthomas@novell.com + +- Added message to xm save to indicate that save is not currently + supported for fully virtualized guests. (#161661) + +------------------------------------------------------------------- +Fri Apr 28 09:42:25 MDT 2006 - ccoffing@novell.com + +- Close fds before exec-ing vncviewer, so yast2-vm doesn't hang + when viewing fully-virtualized console (#168392). + +------------------------------------------------------------------- +Thu Apr 27 08:14:18 MDT 2006 - ccoffing@novell.com + +- Update xen-3.0-testing tree, changeset 9656: + + Drop patches merged upstream. + + Fix reboot on large SMP machines (IBM, no bug #). +- Integrate Jan's patches: + + Spurious interrupt roundup (#152892). + +------------------------------------------------------------------- +Mon Apr 24 15:32:32 MDT 2006 - ccoffing@novell.com + +- Integrate Jan's patches: + + FXSR patch (#135677). + + APIC option patch (work-around #150114). + + Protect against hypervisor crash (#169143). +- Update xen-3.0-testing tree, changeset 9649: + + Avoid spurious timer activations in hypervisor. + + Fix xen command line parsing (lapic / nolapic parsing). + + Fix inverted BUG_ON w.r.t. SiS APIC bug. + +------------------------------------------------------------------- +Fri Apr 21 08:56:29 MDT 2006 - ccoffing@novell.com + +- Update to 3.0.2-2 (xen-3.0-testing tree, changeset 9640): + + Fix for "hda lost interrupt" for PAE VMX. + + Increase L2 PDE to 1 GB; allows x86_64 to boot larger dom0. + + Fix for SVM booting 32pae-on-32pae. +- Drop upstream patches (SiS APIC bug, HTT, HVM interrupt race) +- Add Jan's port of spurious interrupt patch (#152892). +- Add /etc/xen/images link for convenience (#168070). +- Updated README. + +------------------------------------------------------------------- +Thu Apr 20 10:29:44 MDT 2006 - ccoffing@novell.com + +- SiS APIC bug patch (Jan Beulich, #116485). + +------------------------------------------------------------------- +Wed Apr 19 12:22:53 MDT 2006 - ccoffing@novell.com + +- Don't kill xenstored and xenconsoled when stopping xend. + (#158562, #156261) + +------------------------------------------------------------------- +Wed Apr 19 10:46:32 MDT 2006 - ccoffing@novell.com + +- Update to 3.0.2-2 (xen-3.0-testing tree, changeset 9629): + + Fix for SMP IA32 VMX guest booting. + + KY's SETMAXMEM fix. + +------------------------------------------------------------------- +Wed Apr 19 10:23:57 MDT 2006 - cgriffin@novell.com + +- Removed HTT bit from cpuid and set logical processor count to 1. + Also fixed logic problem in svm code where apic=0 was not + handled (#162244). + +------------------------------------------------------------------- +Wed Apr 19 16:41:32 CEST 2006 - agruen@suse.de + +- Create /boot symlinks in the %install section instead of in + %post so that they will end up in the package file list. + +------------------------------------------------------------------- +Tue Apr 18 15:40:41 MDT 2006 - ccoffing@novell.com + +- Add /etc/xen/vm to vm config file search path (#167208). + +------------------------------------------------------------------- +Fri Apr 14 11:05:40 MDT 2006 - kallan@novell.com + +- Add support for bonding in network-bridge. (#161678). + +------------------------------------------------------------------- +Fri Apr 14 09:27:40 MDT 2006 - ccoffing@novell.com + +- Update to 3.0.2-2 (xen-3.0-testing tree, changeset 9620): + + Fixes stack corruption in libxs (XenSource #411). + +------------------------------------------------------------------- +Thu Apr 13 09:55:02 MDT 2006 - rmaxfiel@novell.com + +- Fixed a problem in ioemu which exited when the cdrom line was + found in the guest def file but the cd device contained no media. + (#161210) + +------------------------------------------------------------------- +Wed Apr 12 12:57:23 MDT 2006 - ccoffing@novell.com + +- Auto-balloon domain 0 for HVM domains (#149179). +- Update to 3.0.2-1 (xen-3.0-testing tree, changeset 9612): + + Fixes xmlrpc issues. + + Fixes several emulated instructions for HVM. + + Fixes for x86_64 inline assembly. + +------------------------------------------------------------------- +Tue Apr 11 16:45:48 MDT 2006 - ccoffing@novell.com + +- Fix "jitter" and race in dom0's memory target calculation, which + could cause auto-ballooning to fail (#164714). + +------------------------------------------------------------------- +Tue Apr 11 05:03:34 MDT 2006 - brogers@novell.com + +- Fix problem where localtime=1 results in zombie domains after + they shutdown (#164960) + +------------------------------------------------------------------- +Mon Apr 10 09:54:49 MDT 2006 - ccoffing@novell.com + +- Update to hg 9598 (xen-3.0-testing tree; 3.0.2-rc). Discounting + Linux changes and patches we already carry, this update contains: + + Saner error handling in iret hypercall (x86/64). + + Make root page table sanity check on restore more generic. + + Additional sanity / compatability checks during guest build. + + IO-APIC update hypercall fixes. + +------------------------------------------------------------------- +Fri Apr 7 11:45:56 MDT 2006 - ccoffing@novell.com + +- Don't throw an exception if 'xm top' is run by non-root; print + error message instead (#164224). +- Change localtime patch to account for daylight savings time + (Bruce Rogers). +- Re-add patch to make tightvnc work. It was accidentally dropped + recently (#149556). + +------------------------------------------------------------------- +Thu Apr 6 09:59:03 MDT 2006 - ccoffing@novell.com + +- Update to hg 9590 (xen-3.0-testing tree; 3.0.2-rc). +- Fix type error in localtime patch for para (Bruce Rogers). +- Fix default localtime for full (Bruce Rogers). +- Fix path in mk-xen-resue-img.sh (#163622). +- Update README (pathnames, yast2-vm descriptions, terminology). + +------------------------------------------------------------------- +Tue Apr 4 01:24:01 CEST 2006 - garloff@suse.de + +- init script: Test for control_d in capabilities to determine dom0 + rather than privcmd. +- init script: Try loading netloop and backend modules. +- mk-xen-rescue-img.sh: Copy frontend drivers, remove stale files. +- example config files: provide commented out domUloader exmaples. + +------------------------------------------------------------------- +Mon Apr 3 10:13:38 MDT 2006 - ccoffing@novell.com + +- Update to hg 9514 (xen-unstable tree; 3.0.2-rc). +- Fix for rebooting (Jan Beulich; #160064). + +------------------------------------------------------------------- +Fri Mar 31 13:00:22 MST 2006 - ccoffing@novell.com + +- Update to hg 9502 (xen-unstable tree; 3.0.2-rc). +- Update man page (#162402). +- xen-tools requires python-xml (#161712). +- Include localtime patch to support NetWare (Bruce Rogers). + +------------------------------------------------------------------- +Thu Mar 30 08:56:52 MST 2006 - ccoffing@novell.com + +- Update to hg 9481 (xen-unstable tree; 3.0.2-rc). +- Correctly default XAUTHORITY if it is not set. This allows the + GUI to come up for fully virtualized guests (was especially + problematic when VM was started from YaST). (#142472) + +------------------------------------------------------------------- +Wed Mar 29 15:23:51 MST 2006 - ccoffing@novell.com + +- Fixed reversed "Do I have enough memory?" test when creating + new VMs (#156448). + +------------------------------------------------------------------- +Tue Mar 28 11:37:34 MST 2006 - ccoffing@novell.com + +- Pick up two critical fixes for AMD to fix full virtualization: + c/s 9453 & c/s 9456. + +------------------------------------------------------------------- +Thu Mar 23 14:23:32 MST 2006 - ccoffing@novell.com + +- Update to hg 9434 (xen-unstable tree; 3.0.2-rc). +- Fix /etc/xen/scripts/block to properly check if devices can be + shared. +- Default XENDOMAINS_AUTO_ONLY to true; previous setting + contradicts yast2-vm's claim that only VM's marked auto will be + auto-started. + +------------------------------------------------------------------- +Mon Mar 20 08:48:31 MST 2006 - ccoffing@novell.com + +- Update to hg 9329 (xen-unstable tree). + +------------------------------------------------------------------- +Wed Mar 15 12:20:38 MST 2006 - ccoffing@novell.com + +- Update to hg 9251 (xen-unstable tree). +- Update to latest versions of Intel's VNC patches: + patch-vga-sse2-0314.l, patch-vnc_loop-0314.l, + patch-vncmouse-0315.l +- Gather example files in /etc/xen/examples. + +------------------------------------------------------------------- +Tue Mar 14 11:00:00 MST 2006 - rmaxfiel@novell.com + +- Removed the intermediate sym-link between xen.gz and + xen--.gz. Grub 0.97 XFS can not handle a + double indirect to a file. (#151792) + +------------------------------------------------------------------- +Tue Mar 14 00:29:28 CET 2006 - garloff@suse.de + +- Update README.SuSE: Document limits (mem, cpu hotplug, max_loop), + more network troubleshooting, update security info. +- Be more tolerant against errors in ifdown/ifup to better coexist + with non-std network setups (e.g. ifplugd/NetworkManager). + +------------------------------------------------------------------- +Tue Mar 7 10:56:36 MST 2006 - ccoffing@novell.com + +- Update to hg 9172 (xen-unstable tree). +- Create new xen-libs package, split from xen-tools (#154473). +- Update mk-xen-rescume-img and xmexample.rescue to work with + current rescue image on CD (#152971). +- Include Kurt's patch to domUloader, to pass command line args. +- xendomains shouldn't try to migrate or save HVM domains, as this + isn't supported and will stall the shutdown (#155265). +- Create empty /etc/xen/vm directory for YaST to place config files + in, to avoid name collisions (#156322). +- Update and re-enable vga patch from Intel (Don Dugger). VGA + emul is faster and not corrupted. +- ifup is run to ensure IPs are assigned before rearranging for + xen, but this can fail with ifplugd; this should not kill the + whole script (Kirk Allan) (#154115). +- Make network-bridge script more robust, by checking /sys instead + of grep-ing. + +------------------------------------------------------------------- +Mon Mar 6 12:27:19 MST 2006 - ccoffing@novell.com + +- Update to hg 9148 (xen-unstable tree). Drop patches merged + upstream. +- More README improvements (#154134). +- Fix "vncviewer=1" to bring up vncviewer (#149556). + +------------------------------------------------------------------- +Mon Mar 6 09:58:24 MST 2006 - ccoffing@novell.com + +- Fix build of hvmloader and vmxassist by removing external + CFLAGS (XS changeset #9110). +- Fix build by forcing --prefix during installation of *.py. + +------------------------------------------------------------------- +Wed Mar 1 17:45:52 MST 2006 - ccoffing@novell.com + +- Update to hg 9029 (xen-unstable tree). Adds support for HVM on + 64 bit hardware. +- Update vncmouse diff to 20060301 from Intel; compensates for lack + of eager events in our LibVNCServer. +- Fix many bugs in lomount. +- Cap maximum value of "xm mem-set" for domain 0, based on size of + dom0's page tables (#152667). + +------------------------------------------------------------------- +Mon Feb 27 09:37:38 MST 2006 - ccoffing@novell.com + +- Update to hg 9015 (xen-unstable tree). More bug fixes. +- Update patch to better honor RPM_OPT_FLAGS. +- Updated README (#154134). +- Disable xen-vga-0213 patch; it speeds VGA updates but was + corrupting the display. +- Change max mouse polling time from 1ms to 10ms to reduce CPU + load (from Intel). + +------------------------------------------------------------------- +Thu Feb 23 13:26:07 MST 2006 - ccoffing@novell.com + +- Update to hg 8954 (xen-unstable tree). More bug fixes. +- Don't use a dummy IP of 1.2.3.4 for NFS server when booting domU + with DHCP. Seems to hang x86_64 Linux. +- Remove unnecessary x86_64 patch. +- Fix auto-ballooning of dom0 memory for HVM domUs (XenSource bug + 521). + +------------------------------------------------------------------- +Tue Feb 21 15:07:43 MST 2006 - ccoffing@novell.com + +- Update to hg 8920 (xen-unstable tree). Fixes instruction decode + for fully virtualized guests, fixing booting from CDs. +- Integrate 3 patches from Intel, to improve VNC performance. + +------------------------------------------------------------------- +Tue Feb 21 08:42:37 MST 2006 - ccoffing@novell.com + +- Update to hg 8910 (xen-unstable tree). + fixes 32 on 32, 32 pae on 32pae, 64 on 64, 32 on 64. + critical HVM fixes, for fully virtualized guests. + +------------------------------------------------------------------- +Fri Feb 17 08:27:11 MST 2006 - ccoffing@novell.com + +- Update to hg 8870 (xen-unstable tree). More HVM fixes. +- Remove duplicate balloon.free call. +- Add patch from Intel to fix dom0 crash on 64 bit SMP HVM. + +------------------------------------------------------------------- +Thu Feb 16 16:16:11 MST 2006 - carnold@novell.com + +- Update to hg 8858 (xen-unstable tree). + +------------------------------------------------------------------- +Wed Feb 15 08:31:19 MST 2006 - ccoffing@novell.com + +- Update to hg 8857 (xen-unstable tree). Syncs hypervisor core + with Linux 2.6.16, which may fix some ACPI issues. Fixes HVM. +- Fix uninitialized variable in xc_load_bin (from Bruce Rogers). +- Auto-balloon dom0 for fully virtualized domains (#149179). +- xen-doc-html was missing image files. + +------------------------------------------------------------------- +Mon Feb 13 12:20:03 MST 2006 - ccoffing@novell.com + +- Update to hg 8830 (xen-unstable tree). +- Restore cs 8783/8792 to match kernel. + +------------------------------------------------------------------- +Wed Feb 8 11:58:40 MST 2006 - ccoffing@novell.com + +- Update to hg 8800 (xen-unstable tree). +- Update BuildRequires. +- Add "max-free-memory" to "xm info", to support yast2-vm (#147612) +- Insserv xendomains, to support yast2-vm. +- Fix exit code of "xend stop". +- Revert cs 8783/8792 to allow xenstore to start (until kernel + catches up). +- Ensure eth0 aka veth0 really comes up in network-bridge. + +------------------------------------------------------------------- +Sat Feb 4 18:47:41 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Fri Jan 27 11:24:37 MST 2006 - ccoffing@novell.com + +- Update to hg 8728 (xen-unstable tree). +- Improve network-bridge: + + Ensure netdev really is up, to fix STARTMODE="manual". + + Stop ifplugd when doing ifdown, to fix STARTMODE="ifplugd". + + Improve check for whether bridge already exists. + + Improve defaults for netdev. +- Fix log rotate so xend moves to new log. +- xen-tools "Requires" python, et.al.; xen proper doesn't. +- Revamp mk-xen-rescue-img.sh (#118566). +- Revamp rcxendomains: improved output, error checking, return + values (#143754, #105677). + +------------------------------------------------------------------- +Tue Jan 24 14:49:09 MST 2006 - ccoffing@novell.com + +- Update to hg 8659 (xen-unstable tree). + +------------------------------------------------------------------- +Mon Jan 23 14:46:54 MST 2006 - ccoffing@novell.com + +- Correct return values and improve messages of init scripts. + +------------------------------------------------------------------- +Fri Jan 20 14:10:40 MST 2006 - ccoffing@novell.com + +- Use domUloader instead of pygrub. + +------------------------------------------------------------------- +Thu Jan 19 15:24:28 MST 2006 - carnold@novell.com + +- Build based on the xen-unstable.hg 8628 + +------------------------------------------------------------------- +Wed Jan 18 11:45:50 MST 2006 - carnold@novell.com + +- Update to hg 8646 xen-unstable-hvm.hg tree. + +------------------------------------------------------------------- +Fri Jan 13 11:05:06 MST 2006 - ccoffing@novell.com + +- Allow version string "XEN_VER=3.0" instead of just + "XEN_VER=xen-3.0" for backwards compatibility. +- Correctly set changeset in compile.h. + +------------------------------------------------------------------- +Thu Jan 12 15:39:00 MST 2006 - carnold@novell.com + +- Added two patches from AMD that apply to the 8513 changeset. + +------------------------------------------------------------------- +Thu Jan 12 11:39:17 CET 2006 - kukuk@suse.de + +- Add libreiserfs-devel to nfb. + +------------------------------------------------------------------- +Wed Jan 11 11:14:20 MST 2006 - carnold@novell.com + +- Update to hg 8513 xen-unstable-hvm.hg tree. + +------------------------------------------------------------------- +Tue Jan 10 13:13:24 MST 2006 - ccoffing@novell.com + +- Update to hg 8269 (xen-3.0-testing). +- Support try-restart in init scripts. +- Clean up installation of udev rules. + +------------------------------------------------------------------- +Wed Dec 14 13:05:07 MST 2005 - ccoffing@novell.com + +- Update to hg 8257 (xen-3.0-testing). +- Update documentation. +- Fix gcc 4.1 warnings. + +------------------------------------------------------------------- +Wed Dec 7 13:39:00 MST 2005 - ccoffing@novell.com + +- Update to hg 8241 (xen-3.0-testing). + +------------------------------------------------------------------- +Mon Nov 28 16:30:02 MST 2005 - ccoffing@novell.com + +- Update to hg 8073. +- Rationalize command names (eg, setsize -> xentrace-setsize). +- Fix gcc 4.1 warnings. + +------------------------------------------------------------------- +Wed Nov 16 13:40:03 MST 2005 - ccoffing@novell.com + +- Update to hg 7782. +- Honor RPM_OPT_FLAGS better. +- Include a few simple, obvious fixes from upstream. +- Build xm-test package. +- Update udev scripts. + +------------------------------------------------------------------- +Mon Nov 14 16:43:10 MST 2005 - ccoffing@novell.com + +- Includes upstream fixes to fix i586 save/restore. + +------------------------------------------------------------------- +Thu Nov 10 13:23:13 MST 2005 - ccoffing@novell.com + +- Include a few simple, obvious fixes: 7609, 7618, 7636, 7689, + 7690, 7692, 7696 + +------------------------------------------------------------------- +Thu Nov 3 10:26:32 MST 2005 - ccoffing@novell.com + +- Update to hg 7608. +- Fix warn_unused_result warnings. +- Drop some patches (merged upstream) +- Tidy README.SuSE. + +------------------------------------------------------------------- +Tue Nov 1 13:08:06 MST 2005 - ccoffing@novell.com + +- Update to hg 7583. + +------------------------------------------------------------------- +Thu Oct 20 21:16:07 CEST 2005 - ccoffing@novell.com + +- Don't mention unwritten man pages. +- Update xmexample* to match SUSE paths. +- Update xs-include patch. + +------------------------------------------------------------------- +Wed Oct 19 12:11:35 CEST 2005 - garloff@suse.de + +- Avoid race in watchdog functionality. +- Improve network-bridge script. + +------------------------------------------------------------------- +Tue Oct 18 22:34:41 CEST 2005 - garloff@suse.de + +- Ignore zombies in the xendomains shutdown procedure and have a + configurable timeout for the commands. Make xendomains status + report something useful. +- Make xendomains script comaptible to non-SUSE distros. + +------------------------------------------------------------------- +Mon Oct 17 23:38:58 CEST 2005 - garloff@suse.de + +- Update to hg 7398. + +------------------------------------------------------------------- +Mon Oct 17 15:41:07 CEST 2005 - garloff@suse.de + +- Create useful xendomains init script and sysconfig file. + +------------------------------------------------------------------- +Mon Oct 17 10:44:11 CEST 2005 - garloff@suse.de + +- Create symlinks also for -pae and -dbg hypervisor. +- Build doxygen documentation. +- Include block-nbd script and xen-nbd example config. +- Include patchset info. + +------------------------------------------------------------------- +Wed Oct 12 13:31:06 CEST 2005 - garloff@suse.de + +- Update docu. +- Enable xen-dbg hypervisor for gdbserver domU debugging. + +------------------------------------------------------------------- +Tue Oct 11 20:40:58 CEST 2005 - garloff@suse.de + +- Update docu. +- Update to hg 7313. +- Move libxenstore.so to xen-tools. + +------------------------------------------------------------------- +Tue Oct 11 12:09:24 CEST 2005 - garloff@suse.de + +- Fix buglet in /sbin/xen-vbd. + +------------------------------------------------------------------- +Mon Oct 10 13:18:20 CEST 2005 - garloff@suse.de + +- Downgrade to hg 7267. +- Add troubleshooting section to README.SUSE. + +------------------------------------------------------------------- +Mon Oct 10 11:14:43 CEST 2005 - garloff@suse.de + +- Fix typo in SrvDomain for mem-set operation. +- Workaround: write directly to balloon in dom0 setMemoryTarget. +- Kill xenconsoled and xenstored in rcxend stop. + +------------------------------------------------------------------- +Sun Oct 9 21:25:22 CEST 2005 - garloff@suse.de + +- Update to hg 7278. +- Provide udev rules to setup vifs and vbds in dom0 when domUs + boot (kraxel). +- Change default FS size for rescue images to 80MB. + +------------------------------------------------------------------- +Sat Sep 10 12:23:11 CEST 2005 - garloff@suse.de + +- Update to hg 6715. +- Fix network-bridge down. + +------------------------------------------------------------------- +Thu Sep 8 01:37:40 CEST 2005 - garloff@suse.de + +- Build PAE version along non-PAE version of Hypervisor. + +------------------------------------------------------------------- +Tue Sep 6 23:07:54 CEST 2005 - garloff@suse.de + +- Try to fix network bridge down issue. +- Document netowrking and firewalling caveats in README.SUSE. +- Enable PAE. + +------------------------------------------------------------------- +Tue Sep 6 22:53:08 CEST 2005 - garloff@suse.de + +- Update to hg 6644. + +------------------------------------------------------------------- +Sun Sep 4 23:03:12 CEST 2005 - garloff@suse.de + +- Update to hg 6610. +- Rename default name of xen-br0 to xenbr0. +- Fix pygrub installation. +- Use libreiserfs to support pygrub on reiser. + +------------------------------------------------------------------- +Mon Aug 29 21:39:58 CEST 2005 - ccoffing@novell.com + +- xen-bridge-net.diff: do not destroy domain 0's network setup + when starting xend. + +------------------------------------------------------------------- +Mon Aug 29 15:31:57 CEST 2005 - garloff@suse.de + +- Update to hg 6458. +- Drop privileged port check -- we use Unix dom sockets anyway + (#105178). +- init.xend: Fix linebreaks in PID list. +- Correctly assign insserv to xen-tools subpackage. + +------------------------------------------------------------------- +Thu Aug 25 18:10:15 CEST 2005 - garloff@suse.de + +- Add dirs /var/run/xenstored and /var/lib/xenstored. + +------------------------------------------------------------------- +Thu Aug 25 13:45:17 CEST 2005 - garloff@suse.de + +- Update to hg 6393. + +------------------------------------------------------------------- +Mon Aug 22 14:23:00 CEST 2005 - garloff@suse.de + +- Update to hg 6315. +- Include linux-public headers in xen-devel package. + +------------------------------------------------------------------- +Sun Aug 21 22:55:06 CEST 2005 - garloff@suse.de + +- Update to hg 6305. + +------------------------------------------------------------------- +Sun Aug 21 03:33:31 CEST 2005 - garloff@suse.de + +- Update to hg 6299. +- Enable VNC support (depending on LibVNCServer). + +------------------------------------------------------------------- +Sun Aug 21 02:41:34 CEST 2005 - garloff@suse.de + +- Split off xen-tools-ioemu for supporting unmodified guests. + +------------------------------------------------------------------- +Sat Aug 20 03:21:32 CEST 2005 - garloff@suse.de + +- Enable pygrub (at the cost of depending on e2fsprogs-devel) +- Enable VMX ioemu SDL support (at the cost of many dependencies) + +------------------------------------------------------------------- +Fri Aug 19 20:46:22 CEST 2005 - garloff@suse.de + +- Update to mercurial changeset 6223. +- Move /usr/libexec/xen/ to /usr/lib[64]/xen/bin/. +- Split off -tools package. + +------------------------------------------------------------------- +Mon Aug 15 15:24:05 CEST 2005 - garloff@suse.de + +- Create symlinks in %post. +- Update README.SUSE. +- Mark /etc/xen/ as %config(noreplace). +- Fix x86-64 build (movl -> mov, lib vs. lib64 inst dirs). +- Remove PYTHONOPTIMIZE. + +------------------------------------------------------------------- +Tue Aug 2 17:59:06 CEST 2005 - ccoffing@novell.com + +- Fix warn_unused_result warnings + +------------------------------------------------------------------- +Thu Jul 28 17:37:19 CEST 2005 - ccoffing@novell.com + +- Update to latest 3.0-unstable snapshot. + +------------------------------------------------------------------- +Wed Jul 13 20:41:06 CEST 2005 - ccoffing@novell.com + +- Fixed bug in glibc24 patch that caused erroneous "out of memory" + errors + +------------------------------------------------------------------- +Fri Jun 24 20:18:02 CEST 2005 - ccoffing@novell.com + +- Fix gcc4 patch that caused a panic in Xen at boot. + +------------------------------------------------------------------- +Fri Jun 24 16:11:20 CEST 2005 - ccoffing@novell.com + +- Fix xen-syms link. + +------------------------------------------------------------------- +Fri Jun 17 20:35:09 CEST 2005 - ccoffing@novell.com + +- Fix version-check in NetWare loader (0x336ec577 -> 0x326ec578). + +------------------------------------------------------------------- +Fri Jun 17 18:38:51 CEST 2005 - ccoffing@novell.com + +- Backport NetWare-friendly loader from Xen 3.0. + +------------------------------------------------------------------- +Thu Jun 16 23:18:30 CEST 2005 - ccoffing@novell.com + +- Destroy domains that failed to be fully created. + +------------------------------------------------------------------- +Fri Jun 10 15:42:00 CEST 2005 - garloff@suse.de + +- Update to latest 2.0-testing snapshot. +- Use RPM version and release no as xen version. + +------------------------------------------------------------------- +Wed Jun 8 02:13:40 CEST 2005 - garloff@suse.de + +- Update mk-xen-rescue-img.sh script: Handle SLES9 better. +- Export PYTHONOPTIMIZE in xend start script. + +------------------------------------------------------------------- +Tue Jun 7 00:59:47 CEST 2005 - garloff@suse.de + +- Merge _perform_err fixes. + +------------------------------------------------------------------- +Mon May 23 21:49:00 CEST 2005 - ccoffing@novell.com + +- update to 2.0.6 + +------------------------------------------------------------------- +Wed Apr 13 22:15:45 CEST 2005 - garloff@suse.de + +- More gcc4 and binutils related fixes. + +------------------------------------------------------------------- +Wed Apr 13 16:28:37 CEST 2005 - garloff@suse.de + +- Build fixes for gcc4. + +------------------------------------------------------------------- +Sun Apr 3 23:52:08 CEST 2005 - garloff@suse.de + +- Update xen: Various fixes (scheduling, memset, domain crash + handling) and enhancements (bg page scrubbing). + +------------------------------------------------------------------- +Thu Mar 24 15:36:39 CET 2005 - garloff@suse.de + +- xen-bridge-net.diff: Make sure bridge netdev is up after adding + addresses to it. + +------------------------------------------------------------------- +Wed Mar 23 15:59:27 CET 2005 - garloff@suse.de + +- xen-secure.diff: Check for privileged port before allowing + certain control operations. +- README.SUSE: Document this change. + +------------------------------------------------------------------- +Wed Mar 23 13:29:19 CET 2005 - garloff@suse.de + +- Require ports < 1024 to allow controlling VMs. + +------------------------------------------------------------------- +Mon Mar 21 19:54:38 CET 2005 - garloff@suse.de + +- Update xen. + +------------------------------------------------------------------- +Wed Mar 16 23:53:27 CET 2005 - garloff@suse.de + +- Update xen. +- Add /var/lib/xen/xen-db/ subdirs. + +------------------------------------------------------------------- +Sun Mar 13 12:24:14 CET 2005 - garloff@suse.de + +- Update to post-2.0.5 +- Make /usr/sbin/xm root:trusted 0750 +- Drop some patches (merged upstream) + +------------------------------------------------------------------- +Tue Mar 8 11:58:32 CET 2005 - garloff@suse.de + +- Update README with security notes. +- Update mk-xen-rescue-image.sh script allowing to specify the + kernel version to be used. +- Rather than busy-looping, exit console on a domain that has + shutdown. + +------------------------------------------------------------------- +Mon Mar 7 17:26:38 CET 2005 - garloff@suse.de + +- Update xen to latest snapshot. +- tgif not needed any more. + +------------------------------------------------------------------- +Tue Mar 1 20:32:39 CET 2005 - garloff@suse.de + +- Include serial-split from Charles Coffing. + +------------------------------------------------------------------- +Tue Mar 1 07:21:11 CET 2005 - garloff@suse.de + +- Update xen to latest snapshot. + +------------------------------------------------------------------- +Mon Feb 21 13:50:35 CET 2005 - garloff@suse.de + +- Update README.SuSE. +- Update xen to latest snapshot. + +------------------------------------------------------------------- +Sun Feb 13 17:09:03 CET 2005 - garloff@suse.de + +- Add init header to xendomains init script. +- Add bridge-utils dependency. +- Update config file and README. +- Activate xend init script on installation. + +------------------------------------------------------------------- +Thu Feb 10 02:31:27 CET 2005 - ro@suse.de + +- remove te_etex and te_pdf from neededforbuild. + +------------------------------------------------------------------- +Thu Feb 10 02:24:46 CET 2005 - garloff@suse.de + +- Update README about IDE dma. +- Default to dhcp. + +------------------------------------------------------------------- +Wed Feb 9 22:05:39 CET 2005 - garloff@suse.de + +- Update to xen post-2.0.4. +- Little bugfix for xen rescue install script. +- Update README.SUSE: Better explanation of root FS creation. + +------------------------------------------------------------------- +Mon Jan 24 03:09:50 CET 2005 - garloff@suse.de + +- Change some defaults to be more secure (xend only binds to + localhost, ip spoof protection on). +- Avoid ipv6 issue with xend network script. +- Extensive docu in README.SUSE now. +- mk-xen-rescue-img.sh creates a xen root fs image from the std + SUSE rescue image. +- Put boot.local script in root img to parse ip boot par. + +------------------------------------------------------------------- +Thu Jan 20 14:48:29 CET 2005 - garloff@suse.de + +- Update to newer snapshot. + +------------------------------------------------------------------- +Thu Jan 20 03:05:11 CET 2005 - garloff@suse.de + +- Update to xen-2.0-unstable (post 2.0.3). + +------------------------------------------------------------------- +Thu Dec 9 10:57:17 CET 2004 - garloff@suse.de + +- Initial creation of package xen, xen-doc-*. +- i686 only for now. + diff --git a/xen.spec b/xen.spec new file mode 100644 index 0000000..afb5afb --- /dev/null +++ b/xen.spec @@ -0,0 +1,1690 @@ +# +# spec file for package xen (Version 3.0.3_11774) +# +# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# This file and all modifications and additions to the pristine +# package are under the same license as the package itself. +# +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + +# norootforbuild + +Name: xen +BuildRequires: LibVNCServer SDL-devel autoconf automake bin86 dev86 glibc-devel-32bit latex2html libjpeg-devel libreiserfs-devel openssl openssl-devel python-devel te_ams te_latex tetex transfig +%define xvers 3.0 +%define xvermaj 3 +%define changeset 11774 +%define with_pvfb 0 +%define xen_build_dir xen-3.0.3-testing +Version: 3.0.3_11774 +Release: 18 +License: GNU General Public License (GPL) +Group: System/Kernel +Autoreqprov: on +PreReq: %insserv_prereq %fillup_prereq +Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel) +Source: xen-3.0.3-testing-src.tar.bz2 +Source2: README.SuSE +Source3: boot.xen +Source4: boot.local.xenU +Source5: mk-xen-rescue-img.sh +Source6: init.xend +Source7: init.xendomains +Source8: logrotate.xend.conf +Source9: domUloader.py +Source10: xmexample.domUloader +Source11: xmexample.rescue +Source12: block-nbd +Source13: xmexample.nbd +Source14: block-iscsi +Source15: xmexample.iscsi +Patch1: xen-destdir.diff +Patch2: serial-split.patch +Patch3: xen-warnings.diff +Patch4: xen-rpmoptflags.diff +Patch5: xen-docs.diff +Patch6: xen-xmexample.diff +Patch7: xen-xmexample-nbd.diff +Patch8: xen-changeset.diff +Patch9: xen-domUloader.diff +Patch10: xen-domUloader-pygrub.diff +Patch11: xen-messages.diff +Patch12: xen-network-bridge.diff +Patch13: xen-no-dummy-nfs-ip.diff +Patch14: xen-config-defaults.diff +Patch15: xen-xm-top-needs-root.diff +Patch16: xen-tightvnc-args.diff +Patch17: xen-max-free-mem.diff +Patch18: xen-bonding.diff +Patch19: xen-ioapic-ack-default.diff +Patch20: xen-lost-mouse.diff +Patch21: xen-paths.diff +Patch22: xen-lowmem-emergency-pool.diff +Patch23: xen-console.diff +Patch24: block-losetup-retry.diff +Patch25: block-sync.diff +Patch26: xen-io-register-context.diff +Patch27: xen-keymap.diff +Patch28: xen-man-permissions.patch +Patch29: xen-man-xm-bad-char.diff +Patch30: xen-python25-warnings.diff +Patch31: xen-hvm-default-bridge.diff +Patch32: xen-hvm-netfront.diff +Patch33: xend-xmlrpc-large-ints.diff +Patch34: xen-hvm-default-pae.diff +Patch35: non-flat-pm.patch +## Upstream (or upstream soon): +Patch100: xen-pvfb-2.patch +Patch101: xen-pvfb-3.patch +Patch102: xu-11841-svm-interrupt-delivery.diff +Patch103: xu-11842-svm-interrupt-delivery.diff +Patch104: xu-11843-svm-no-double-nmi.diff +Patch105: xu-11847-pv-hvm.diff +Patch106: xu-11888-pv-hvm.diff +Patch107: xu-11896-pv-hvm.diff +Patch108: xu-11897-pv-hvm.diff +Patch109: xu-11898-pv-hvm.diff +Patch110: xu-11899-pv-hvm.diff +Patch111: xu-11900-pv-hvm.diff +Patch112: xu-11901-pv-hvm.diff +Patch113: xu-11902-pv-hvm.diff +Patch114: xu-11903-pv-hvm.diff +Patch115: xu-11904-pv-hvm.diff +Patch116: xu-11905-pv-hvm.diff +Patch117: xu-11906-pv-hvm.diff +Patch118: xu-11907-pv-hvm.diff +Patch119: xu-11908-pv-hvm.diff +Patch120: xu-11909-pv-hvm.diff +Patch121: xu-11910-pv-hvm.diff +Patch122: xu-11911-pv-hvm.diff +Patch123: xu-11912-pv-hvm.diff +Patch124: xu-11913-pv-hvm.diff +Patch125: xu-11914-pv-hvm.diff +Patch126: xu-11915-pv-hvm.diff +Patch127: xu-11916-pv-hvm.diff +Patch128: xu-11917-pv-hvm.diff +Patch129: xu-11918-pv-hvm.diff +Patch130: xu-11974-pv-hvm.diff +Patch131: xu-12012-hvm-smp-timer.diff +Patch132: xu-12013-hvm-ioapic.diff +Patch133: xu-12030-pv-hvm.diff +Patch134: xu-12031-pv-hvm.diff +Patch135: xu-12032-pv-hvm.diff +Patch136: xu-12040-pv-spurious-interrupt.diff +Patch137: xu-12205-pv-hvm.diff +Patch138: xu-12278-hvm-interrupt-race.diff +## Debugging: +Patch200: xen-enable-hvm-debug.diff +## Future / need to be re-ported: +Patch300: xen-poweroff.diff +Patch301: xen-removable.diff +URL: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/ +Prefix: /usr +BuildRoot: %{_tmppath}/%{name}-%{version}-build +ExclusiveArch: %ix86 x86_64 ia64 +%define pysite %(python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib()") + +%description +Xen is a virtual machine monitor for x86 that supports execution of +multiple guest operating systems with unprecedented levels of +performance and resource isolation. + +This package contains the Xen Hypervisor. (tm) + +Modern computers are sufficiently powerful to use virtualization to +present the illusion of many smaller virtual machines (VMs), each +running a separate operating system instance. Successful partitioning +of a machine to support the concurrent execution of multiple operating +systems poses several challenges. Firstly, virtual machines must be +isolated from one another: It is not acceptable for the execution of +one to adversely affect the performance of another. This is +particularly true when virtual machines are owned by mutually +untrusting users. Secondly, it is necessary to support a variety of +different operating systems to accommodate the heterogeneity of popular +applications. Thirdly, the performance overhead introduced by +virtualization should be small. + +Xen uses a technique called paravirtualization: The guest OS is +modified, mainly to enhance performance. + +The Xen hypervisor (microkernel) does not provide device drivers for +your hardware (except for CPU and memory). This job is left to the +kernel that's running in domain 0. Thus the domain 0 kernel is +privileged; it has full hardware access. It's started immediately after +Xen starts up. Other domains have no access to the hardware; instead +they use virtual interfaces that are provided by Xen (with the help of +the domain 0 kernel). + +Xen does support booting other Operating Systems; ports of NetBSD +(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich) +exist. A port of Windows XP was developed for an earlier version of +Xen, but is not available for release due to license restrictions. + +In addition to this package you need to install the kernel-xen and +xen-tools to use Xen. Xen 3 also supports running unmodified guests +using full virtualization, if appropriate hardware is present. Install +xen-tools-ioemu if you want to use this. + +[Hypervisor is a trademark of IBM] + + + +Authors: +-------- + Ian Pratt + Keir Fraser + Christian Limpach + Mark Williamson + Ewan Mellor + ... + +%package libs +Summary: Xen Virtualization: Libraries +Group: System/Kernel +Requires: xen >= 3.0.3_10000 +AutoReqProv: on + +%description libs +Xen is a virtual machine monitor for x86 that supports execution of +multiple guest operating systems with unprecedented levels of +performance and resource isolation. + +This package contains the libraries used to interact with the Xen +virtual machine monitor. + +Modern computers are sufficiently powerful to use virtualization to +present the illusion of many smaller virtual machines (VMs), each +running a separate operating system instance. Successful partitioning +of a machine to support the concurrent execution of multiple operating +systems poses several challenges. Firstly, virtual machines must be +isolated from one another: It is not acceptable for the execution of +one to adversely affect the performance of another. This is +particularly true when virtual machines are owned by mutually +untrusting users. Secondly, it is necessary to support a variety of +different operating systems to accommodate the heterogeneity of popular +applications. Thirdly, the performance overhead introduced by +virtualization should be small. + +Xen uses a technique called paravirtualization: The guest OS is +modified, mainly to enhance performance. + +The Xen hypervisor (microkernel) does not provide device drivers for +your hardware (except for CPU and memory). This job is left to the +kernel that's running in domain 0. Thus the domain 0 kernel is +privileged; it has full hardware access. It's started immediately after +Xen starts up. Other domains have no access to the hardware; instead +they use virtual interfaces that are provided by Xen (with the help of +the domain 0 kernel). + +Xen does support booting other Operating Systems; ports of NetBSD +(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich) +exist. A port of Windows XP was developed for an earlier version of +Xen, but is not available for release due to license restrictions. + + + +Authors: +-------- + Ian Pratt + +%package tools +Summary: Xen Virtualization: Control tools for domain 0 +Group: System/Kernel +Requires: xen-libs >= 3.0.3_10000 +Requires: python python-xml bridge-utils multipath-tools +AutoReqProv: on + +%description tools +Xen is a virtual machine monitor for x86 that supports execution of +multiple guest operating systems with unprecedented levels of +performance and resource isolation. + +This package contains the control tools that allow you to start, stop, +migrate, and manage virtual machines. + +Modern computers are sufficiently powerful to use virtualization to +present the illusion of many smaller virtual machines (VMs), each +running a separate operating system instance. Successful partitioning +of a machine to support the concurrent execution of multiple operating +systems poses several challenges. Firstly, virtual machines must be +isolated from one another: It is not acceptable for the execution of +one to adversely affect the performance of another. This is +particularly true when virtual machines are owned by mutually +untrusting users. Secondly, it is necessary to support a variety of +different operating systems to accommodate the heterogeneity of popular +applications. Thirdly, the performance overhead introduced by +virtualization should be small. + +Xen uses a technique called paravirtualization: The guest OS is +modified, mainly to enhance performance. + +The Xen hypervisor (microkernel) does not provide device drivers for +your hardware (except for CPU and memory). This job is left to the +kernel that's running in domain 0. Thus the domain 0 kernel is +privileged; it has full hardware access. It's started immediately after +Xen starts up. Other domains have no access to the hardware; instead +they use virtual interfaces that are provided by Xen (with the help of +the domain 0 kernel). + +Xen does support booting other Operating Systems; ports of NetBSD +(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich) +exist. A port of Windows XP was developed for an earlier version of +Xen, but is not available for release due to license restrictions. + +In addition to this package you need to install kernel-xen and xen to +use Xen. + + + +Authors: +-------- + Ian Pratt + +%package tools-ioemu +Summary: Xen Virtualization: BIOS and device emulation for unmodified guests +Group: System/Kernel +Requires: xen-tools >= 3.0.3_10000 +AutoReqProv: on + +%description tools-ioemu +Xen is a virtual machine monitor for x86 that supports execution of +multiple guest operating systems with unprecedented levels of +performance and resource isolation. + +This package contains the needed BIOS and device emulation code to +support unmodified guests. (You need virtualization support in hardware +to make use of this.) + +Modern computers are sufficiently powerful to use virtualization to +present the illusion of many smaller virtual machines (VMs), each +running a separate operating system instance. Successful partitioning +of a machine to support the concurrent execution of multiple operating +systems poses several challenges. Firstly, virtual machines must be +isolated from one another: It is not acceptable for the execution of +one to adversely affect the performance of another. This is +particularly true when virtual machines are owned by mutually +untrusting users. Secondly, it is necessary to support a variety of +different operating systems to accommodate the heterogeneity of popular +applications. Thirdly, the performance overhead introduced by +virtualization should be small. + +Xen uses a technique called paravirtualization: The guest OS is +modified, mainly to enhance performance. + +The Xen hypervisor (microkernel) does not provide device drivers for +your hardware (except for CPU and memory). This job is left to the +kernel that's running in domain 0. Thus the domain 0 kernel is +privileged; it has full hardware access. It's started immediately after +Xen starts up. Other domains have no access to the hardware; instead +they use virtual interfaces that are provided by Xen (with the help of +the domain 0 kernel). + +Xen does support booting other Operating Systems; ports of NetBSD +(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich) +exist. A port of Windows XP was developed for an earlier version of +Xen, but is not available for release due to license restrictions. + +In addition to this package you need to install kernel-xen, xen, and +xen-tools to use Xen. + + + +Authors: +-------- + Ian Pratt + +%package devel +Summary: Xen Virtualization: Headers and libraries for development +Group: System/Kernel +Requires: xen-libs = %{version} + +%description devel +Xen is a virtual machine monitor for x86 that supports execution of +multiple guest operating systems with unprecedented levels of +performance and resource isolation. + +This package contains the libraries and header files needed to create +tools to control virtual machines. + +Modern computers are sufficiently powerful to use virtualization to +present the illusion of many smaller virtual machines (VMs), each +running a separate operating system instance. Successful partitioning +of a machine to support the concurrent execution of multiple operating +systems poses several challenges. Firstly, virtual machines must be +isolated from one another: It is not acceptable for the execution of +one to adversely affect the performance of another. This is +particularly true when virtual machines are owned by mutually +untrusting users. Secondly, it is necessary to support a variety of +different operating systems to accommodate the heterogeneity of popular +applications. Thirdly, the performance overhead introduced by +virtualization should be small. + +Xen uses a technique called paravirtualization: The guest OS is +modified, mainly to enhance performance. + +The Xen hypervisor (microkernel) does not provide device drivers for +your hardware (except for CPU and memory). This job is left to the +kernel that's running in domain 0. Thus the domain 0 kernel is +privileged; it has full hardware access. It's started immediately after +Xen starts up. Other domains have no access to the hardware; instead +they use virtual interfaces that are provided by Xen (with the help of +the domain 0 kernel). + +Xen does support booting other Operating Systems; ports of NetBSD +(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich) +exist. A port of Windows XP was developed for an earlier version of +Xen, but is not available for release due to license restrictions. + + + +Authors: +-------- + Ian Pratt + +%package doc-html +Summary: Xen Virtualization: HTML documentation +Group: Documentation/HTML + +%description doc-html +Xen is a virtual machine monitor for x86 that supports execution of +multiple guest operating systems with unprecedented levels of +performance and resource isolation. + +xen-doc-html contains the online documentation in HTML format. Point +your browser at file:/usr/share/doc/packages/xen/html/ + + + +Authors: +-------- + Ian Pratt + +%package doc-pdf +Summary: Xen Virtualization: PDF documentation +Group: Documentation/Other + +%description doc-pdf +Xen is a virtual machine monitor for x86 that supports execution of +multiple guest operating systems with unprecedented levels of +performance and resource isolation. + +xen-doc-pdf contains the online documentation in PDF format. Use +xpdf/kpdf/gpdf/gv/... to read the files in +/usr/share/doc/packages/xen/pdf/ + + + +Authors: +-------- + Ian Pratt + +%package doc-ps +Summary: Xen Virtualization: PostScript documentation +Group: Documentation/Other + +%description doc-ps +Xen is a virtual machine monitor for x86 that supports execution of +multiple guest operating systems with unprecedented levels of +performance and resource isolation. + +xen-doc-ps contains the online documentation in PostScript format. Use +gv/kghostview/... to read the files in /usr/share/doc/packages/xen/ps/ + + + +Authors: +-------- + Ian Pratt + +%prep +%setup -q -n %xen_build_dir +# Apply upstream patches first... +%if %{?with_pvfb}0 +%patch100 -p1 +%patch101 -p1 +%endif +%patch102 -p1 +%patch103 -p1 +%patch104 -p1 +%patch105 -p1 +%patch106 -p1 +%patch107 -p1 +%patch108 -p1 +%patch109 -p1 +%patch110 -p1 +%patch111 -p1 +%patch112 -p1 +%patch113 -p1 +%patch114 -p1 +%patch115 -p1 +%patch116 -p1 +%patch117 -p1 +%patch118 -p1 +%patch119 -p1 +%patch120 -p1 +%patch121 -p1 +%patch122 -p1 +%patch123 -p1 +%patch124 -p1 +%patch125 -p1 +%patch126 -p1 +%patch127 -p1 +%patch128 -p1 +%patch129 -p1 +%patch130 -p1 +%patch131 -p1 +%patch132 -p1 +%patch133 -p1 +%patch134 -p1 +%patch135 -p1 +%patch136 -p1 +%patch137 -p1 +%patch138 -p1 +# Now our patches... +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +#%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 +%patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 +%patch24 -p1 +%patch25 -p1 +%patch26 -p1 +%patch27 -p1 +%patch28 -p1 +%patch29 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 +%patch33 -p1 +%patch34 -p1 +%patch35 -p1 +XEN_EXTRAVERSION=%version-%release +XEN_EXTRAVERSION=${XEN_EXTRAVERSION#%{xvers}} +sed -i "s/XEN_EXTRAVERSION[ ]*.=.*\$/XEN_EXTRAVERSION = $XEN_EXTRAVERSION/" xen/Makefile +sed -i "s/XEN_CHANGESET[ ]*=.*\$/XEN_CHANGESET = %{changeset}/" xen/Makefile +# Unmaintained; remove to avoid spurious Python PEP353 warnings +rm -rf tools/pygrub + +%build +test ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT +export CFLAGS="$RPM_OPT_FLAGS" +export RPM_OPT_FLAGS +make tools docs + +%install +export CFLAGS="$RPM_OPT_FLAGS" +export RPM_OPT_FLAGS +install_xen() +{ + local ext="" + if [ -n "$1" ]; then + ext="-$1" + mv $RPM_BUILD_ROOT/boot/xen-%{version}-%{release}.gz \ + $RPM_BUILD_ROOT/boot/xen${ext}-%{version}-%{release}.gz + mv $RPM_BUILD_ROOT/boot/xen-syms-%{version}-%{release} \ + $RPM_BUILD_ROOT/boot/xen-syms${ext}-%{version}-%{release} + fi + rm $RPM_BUILD_ROOT/boot/xen-%{xvers}.gz + rm $RPM_BUILD_ROOT/boot/xen-%{xvermaj}.gz + rm $RPM_BUILD_ROOT/boot/xen.gz + # Do not link to links; grub cannot follow. + ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}-%{xvers}.gz + ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}-%{xvermaj}.gz + ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}.gz + ln -sf xen-syms${ext}-%{version}-%{release} $RPM_BUILD_ROOT/boot/xen-syms${ext} +} +%ifarch %ix86 +make -C xen install pae=y debug=y crash_debug=y DESTDIR=$RPM_BUILD_ROOT +install_xen pae-dbg +make -C xen clean +make -C xen install pae=y debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT +install_xen pae +make -C xen clean +%endif +make -C xen install pae=n debug=y crash_debug=y DESTDIR=$RPM_BUILD_ROOT +install_xen dbg +make -C xen clean +make -C xen install pae=n debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT +install_xen +make -C xen clean +# tools +export XEN_PYTHON_NATIVE_INSTALL=1 +export PYTHONOPTIMIZE=1 +mkdir -p $RPM_BUILD_ROOT/%pysite/xen +make -C tools install \ + DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} +make -C tools/misc/serial-split install \ + DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} +%ifarch x86_64 +mkdir -p $RPM_BUILD_ROOT/usr/lib/xen/bin/ +ln -s %{_libdir}/xen/bin/qemu-dm $RPM_BUILD_ROOT/usr/lib/xen/bin/qemu-dm +%if %{?with_pvfb}0 +ln -s %{_libdir}/xen/bin/xen-sdlfb $RPM_BUILD_ROOT/usr/lib/xen/bin/xen-sdlfb +ln -s %{_libdir}/xen/bin/xen-vncfb $RPM_BUILD_ROOT/usr/lib/xen/bin/xen-vncfb +%endif +%endif +# docs +mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen +sh ./docs/check_pkgs \ + && make -C docs install \ + DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} \ + DOCDIR=%{_defaultdocdir}/xen \ + || true +for name in COPYING %SOURCE2 %SOURCE3; do + cp -p $name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/ +done +mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc +for name in vtpm.txt crashdb.txt sedf_scheduler_mini-HOWTO.txt; do + cp -p docs/misc/$name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc/ +done +# init scripts +mkdir -p $RPM_BUILD_ROOT/etc/init.d +install %SOURCE6 $RPM_BUILD_ROOT/etc/init.d/xend +ln -s /etc/init.d/xend $RPM_BUILD_ROOT/usr/sbin/rcxend +install %SOURCE7 $RPM_BUILD_ROOT/etc/init.d/xendomains +ln -s /etc/init.d/xendomains $RPM_BUILD_ROOT/usr/sbin/rcxendomains +# example config +mkdir -p $RPM_BUILD_ROOT/etc/xen/{vm,examples} +mv $RPM_BUILD_ROOT/etc/xen/xmexample* $RPM_BUILD_ROOT/etc/xen/examples +rm $RPM_BUILD_ROOT/etc/xen/examples/*nbd +install -m644 %SOURCE10 %SOURCE11 %SOURCE13 %SOURCE15 $RPM_BUILD_ROOT/etc/xen/examples/ +# scripts +install -m755 %SOURCE4 %SOURCE5 $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/ +rm $RPM_BUILD_ROOT/etc/xen/scripts/block-*nbd +install -m755 %SOURCE12 %SOURCE14 $RPM_BUILD_ROOT/etc/xen/scripts/ +# logrotate +install -m644 -D %SOURCE8 $RPM_BUILD_ROOT/etc/logrotate.d/xend +# directories +mkdir -p $RPM_BUILD_ROOT/var/lib/xenstored +mkdir -p $RPM_BUILD_ROOT/var/lib/xen/images +mkdir -p $RPM_BUILD_ROOT/var/lib/xen/save +mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/domain +mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/migrate +mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/vnet +mkdir -p $RPM_BUILD_ROOT/var/log/xen +mkdir -p $RPM_BUILD_ROOT/var/run/xenstored +ln -s /var/lib/xen/images $RPM_BUILD_ROOT/etc/xen/images +# Bootloader +install -m755 %SOURCE9 $RPM_BUILD_ROOT/usr/lib/xen/boot/ +# udev support +mv $RPM_BUILD_ROOT/etc/udev/rules.d/xen-backend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xen.rules +# Clean up unpackaged files +rm $RPM_BUILD_ROOT/usr/bin/xc_shadow +rm $RPM_BUILD_ROOT/usr/sbin/netfix +rm -rf $RPM_BUILD_ROOT/usr/share/doc/qemu/ +rm $RPM_BUILD_ROOT/%{_mandir}/man1/qemu.* +rm $RPM_BUILD_ROOT/usr/lib*/xen/bin/qemu-dm.debug +rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info + +%files +%defattr(-,root,root) +/boot/xen-%{version}-%{release}.gz +/boot/xen-%{xvers}.gz +/boot/xen-%{xvermaj}.gz +/boot/xen.gz +/boot/xen-syms-%{version}-%{release} +/boot/xen-syms +/boot/xen-dbg-%{version}-%{release}.gz +/boot/xen-dbg-%{xvers}.gz +/boot/xen-dbg-%{xvermaj}.gz +/boot/xen-dbg.gz +/boot/xen-syms-dbg-%{version}-%{release} +/boot/xen-syms-dbg +%ifarch %ix86 +/boot/xen-pae-%{version}-%{release}.gz +/boot/xen-pae-%{xvers}.gz +/boot/xen-pae-%{xvermaj}.gz +/boot/xen-pae.gz +/boot/xen-syms-pae-%{version}-%{release} +/boot/xen-syms-pae +/boot/xen-pae-dbg-%{version}-%{release}.gz +/boot/xen-pae-dbg-%{xvers}.gz +/boot/xen-pae-dbg-%{xvermaj}.gz +/boot/xen-pae-dbg.gz +/boot/xen-syms-pae-dbg-%{version}-%{release} +/boot/xen-syms-pae-dbg +%endif + +%files libs +%defattr(-,root,root) +%{_libdir}/libxen*.so.* +%{_libdir}/libxenstore.so + +%files tools +%defattr(-,root,root) +/usr/bin/lomount +/usr/bin/xencons +/usr/bin/xenstore* +/usr/bin/xentrace* +/usr/sbin/blktapctrl +/usr/sbin/img2qcow +/usr/sbin/qcow-create +/usr/sbin/qcow2raw +/usr/sbin/tapdisk +/usr/sbin/rcxend +/usr/sbin/rcxendomains +/usr/sbin/xen* +/usr/sbin/xm +%dir %{_libdir}/xen +%dir %{_libdir}/xen/bin +%ifarch x86_64 +%dir /usr/lib/xen +%dir /usr/lib/xen/bin +%endif +%dir /usr/lib/xen/boot +%{_libdir}/libblktap.so* +%{_libdir}/xen/bin/readnotes +%if %{?with_pvfb}0 +%{_libdir}/xen/bin/xen-sdlfb +%{_libdir}/xen/bin/xen-vncfb +%endif +#%{_libdir}/xen/bin/xc_kexec +%{_libdir}/xen/bin/xc_restore +%{_libdir}/xen/bin/xc_save +%{_libdir}/xen/bin/xenconsole +%{_libdir}/xen/bin/xenctx +%{_mandir}/man1/*.1.gz +%{_mandir}/man5/*.5.gz +%{_mandir}/man8/*.8.gz +%dir /var/lib/xen +%dir /var/lib/xenstored +%dir %attr(700,root,root) /var/lib/xen/images +%dir %attr(700,root,root) /var/lib/xen/save +%dir /var/lib/xen/xend-db +%dir /var/lib/xen/xend-db/domain +%dir /var/lib/xen/xend-db/migrate +%dir /var/lib/xen/xend-db/vnet +%dir /var/log/xen +%dir /var/run/xenstored +%config /etc/init.d/xendomains +%config /etc/init.d/xend +%config /etc/logrotate.d/xend +/var/adm/fillup-templates/sysconfig.xendomains +%dir /etc/xen +%config /etc/xen/* +%dir /etc/udev +%dir /etc/udev/rules.d +/etc/udev/rules.d/40-xen.rules +%dir %{_defaultdocdir}/xen +%{_defaultdocdir}/xen/COPYING +%attr(644,root,root) %{_defaultdocdir}/xen/README.SuSE +%{_defaultdocdir}/xen/mk-xen-rescue-img.sh +%attr(644,root,root) %{_defaultdocdir}/xen/boot.xen +%attr(644,root,root) %{_defaultdocdir}/xen/boot.local.xenU +%{_defaultdocdir}/xen/misc +%dir %pysite/xen + +%pysite/xen/* +/usr/lib/xen/boot/domUloader.py + +%files tools-ioemu +%defattr(-,root,root) +%dir %{_datadir}/xen +%dir %{_datadir}/xen/qemu +%dir %{_datadir}/xen/qemu/keymaps +%{_datadir}/xen/qemu/keymaps/* +%{_libdir}/xen/bin/qemu-dm +%ifarch x86_64 +/usr/lib/xen/bin/qemu-dm +%if %{?with_pvfb}0 +/usr/lib/xen/bin/xen-sdlfb +/usr/lib/xen/bin/xen-vncfb +%endif +%endif +/usr/lib/xen/boot/hvmloader + +%files devel +%defattr(-,root,root) +%{_libdir}/libblktap.a +%{_libdir}/libxen*.a +%{_libdir}/libxenc*.so +%{_libdir}/libxeng*.so +%dir /usr/include/xen +%dir /usr/include/xen/io +%dir /usr/include/xen/hvm +%dir /usr/include/xen/linux +/usr/include/blktaplib.h +/usr/include/xen*.h +/usr/include/xs.h +/usr/include/xs_lib.h +/usr/include/xen/COPYING +/usr/include/xen/*.h +/usr/include/xen/io/*.h +/usr/include/xen/hvm/*.h +/usr/include/xen/linux/*.h +/usr/bin/serial-split +/usr/bin/xenperf + +%files doc-html +%defattr(-,root,root) +%{_defaultdocdir}/xen/html + +%files doc-pdf +%defattr(-,root,root) +%dir %{_defaultdocdir}/xen/pdf +%{_defaultdocdir}/xen/pdf/* + +%files doc-ps +%defattr(-,root,root) +%dir %{_defaultdocdir}/xen/ps +%{_defaultdocdir}/xen/ps/* + +%clean +#test ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT +#rm -rf $RPM_BUILD_DIR/%xen_build_dir + +%post tools +%{fillup_and_insserv -y -f xend} +%{fillup_and_insserv -y -n xendomains xendomains} + +%preun tools +%{stop_on_removal xend xendomains} + +%postun tools +%{restart_on_update xend} +%{insserv_cleanup} + +%changelog -n xen +* Mon Nov 27 2006 - ccoffing@novell.com +- Fix how bootloader is called by the xend during restarts. + (#223850) +* Wed Nov 22 2006 - ccoffing@novell.com +- Include Jan's patch, which accounts for selectors in protected + mode with a non-zero base. Fixes some HVM crashes. (#214568) +- Default pae=1, otherwise 64 bit HVM does not work at all. + (#217160) +* Fri Nov 17 2006 - ccoffing@novell.com +- Backport several HVM fixes. (#176171?) +* Thu Nov 16 2006 - ccoffing@novell.com +- Fix some problems in the xen-hvm-default-bridge patch. (#219092) +- xmlrpc isn't 64-bit clean, causing xend to get exceptions when + PFN is > 2 GB. (#220418) +* Tue Nov 14 2006 - kallan@novell.com +- Backport changesets 11847, 11888, 1189[6-9], 119[00-18], 11974, + 1203[0-2], and 12205 from xen-unstable so that the PV drivers + can compile on older kernels such as sles9 and rhel4 +- Fix netfront.c to fail the probe if it is called for an ioemu + type device. This allows both PV and FV drivers to exist at + same time in the FV guest. +* Thu Nov 09 2006 - ccoffing@novell.com +- Default bridge correctly for HVM guests. (#219092) +* Wed Nov 08 2006 - aj@suse.de +- Set correct permissions on man files. +* Tue Nov 07 2006 - ccoffing@novell.com +- Fix some 64 bit issues in Python 2.5 introduced by PEP353. +- Update name of blktap.ko in xend init script. (#215384) +- Remove some extraneous bad chars in xm manpage. (#218440) +- Update logrotate.conf. +- Update spec file. +* Wed Nov 01 2006 - kallan@novell.com +- Backport xen-unstable changesets 12040 to address spurious + interrupts with PV drivers in HVM guests. +* Tue Oct 31 2006 - ccoffing@novell.com +- Backport xen-unstable changesets 1184[1-3] to address SVM + interrupt injection issues. Replaces earlier (broken) patches. +* Mon Oct 30 2006 - ccoffing@novell.com +- /var/lib/xen/images should not be world readable. (#214638) +- Update to xen-3.0.3-0 (changeset 11774; no code changes). +* Mon Oct 16 2006 - ccoffing@novell.com +- Update to xen-3.0.3-testing changeset 11772 (rc5). +- Fix several possible type errors when running domUloader. +- Remove pygrub. Was broken on reiserfs and never had ext2 + support, so it is useless. (#173384) +* Fri Oct 13 2006 - ccoffing@novell.com +- Update to xen-3.0.3-testing changeset 11760 (rc4). +* Tue Oct 10 2006 - ccoffing@novell.com +- Update to xen-3.0.3-testing changeset 11740 (rc3). +- Fix crash on PAE when specifying dom0_mem=4096M. (#211399) +- Make xend.balloon aware of kernel's memory floor, to fix + "Privileged domain did not balloon" errors. (#184727) +* Mon Oct 09 2006 - ccoffing@novell.com +- Include AMD's interrupt injection fix. +* Wed Oct 04 2006 - ccoffing@novell.com +- Imported keymap patch. (#203758) +- Account for minimum memory required by dom0 kernel. (#184727) +- Package /usr/include/xen/hvm/*.h +* Tue Oct 03 2006 - ccoffing@novell.com +- Update to xen-3.0.3-testing changeset 11686. +* Tue Oct 03 2006 - kallan@novell.com +- Updated README.SuSE to reflect the current method of handling + Xen network-bridging when using SuSEfirewall2. (#205092) +* Sat Sep 30 2006 - aj@suse.de +- Cleanup BuildRequires. +* Thu Sep 28 2006 - ccoffing@novell.com +- Only "eval" disks once in domUloader, to match current Xen. +* Wed Sep 27 2006 - ccoffing@novell.com +- Switch to xen-3.0.3-testing tree; changeset 11633. +- Update (but disable) paravirtualized framebuffer patches. +* Tue Sep 26 2006 - ccoffing@novell.com +- Update to xen-unstable changeset 11623. +- Fix domUloader typo introduced in last update. +- Build debug version of xen-pae. +* Mon Sep 25 2006 - ccoffing@novell.com +- Update to xen-unstable changeset 11616. +* Tue Sep 12 2006 - ccoffing@novell.com +- Update check_python script to identify Python 2.5 RCs as valid. +* Mon Sep 11 2006 - ccoffing@novell.com +- Update to xen-unstable changeset 11440. +- xen-tools conflicts with qemu. Do not package qemu.1 manpage. + (#204758) +- Include Jan's updated patch for #192150 (to preserve register + context when doing IO). +* Tue Sep 05 2006 - ccoffing@novell.com +- Update block-nbd and xmexample.nbd, and add block-iscsi and + xmexample.iscsi (from Kurt). +* Thu Aug 31 2006 - ccoffing@novell.com +- Automatically create/destroy virtual frame buffer viewer. Add + "sdl=1" to config file of a paravirtualized VM to get the viewer. +- Log files have moved to /var/log/xen. +* Tue Aug 29 2006 - ccoffing@novell.com +- xendomains does not actually save domains. (#201349) +- Update to xen-unstable changeset 11299. +* Tue Aug 29 2006 - ccoffing@novell.com +- Fix incorrect path on x86_64 for vncfb and sdlfb. +* Thu Aug 17 2006 - ccoffing@novell.com +- Improve xendomains init script, to handle unset sysconfig vars. +- Import virtual framebuffer patches. +- Drop reboot patch; resync patches. +* Wed Aug 16 2006 - ccoffing@novell.com +- Update to xen-unstable changeset 11134. +- Drop xen-reverse-10064.diff now that kernel is updated. +* Tue Aug 08 2006 - ccoffing@novell.com +- Re-enabled patch for #184175. +- Update to xen-unstable changeset 10986. +- Include Jan's patch to preserve register context when doing + IO. (#192150) +* Fri Jul 28 2006 - ccoffing@novell.com +- Add support to domUloader for "xm create --dry-run". Based on + patch from HP. +* Thu Jul 27 2006 - ccoffing@novell.com +- Add link for qemu-dm that is invariant across architectures, so + that VM config files can be simple key/value pairs parsable by + yast, and still be movable to another arch. (#193854) +- Add loop.ko to rescue image created by mk-xen-rescue-img, and + remove usbfs from image's /etc/fstab since USB isn't yet + supported, to avoid errors during boot. (#191627) +* Mon Jul 17 2006 - ccoffing@novell.com +- Update to xen-unstable changeset 10712. +- Update domUloader and rcxend to work with blktap. +* Fri Jul 14 2006 - ccoffing@novell.com +- When waiting for domains to shut down, must also wait for + loopback devices to be torn down, otherwise higher-level tools + may migrate a VM before the disk image is flushed. (#185557) +- More updates to the README. +* Thu Jul 13 2006 - kallan@novell.com +- Added for loop to retry the losetup -d in /etc/xen/scripts/block. + It is possible for the losetup -d to fail if another process is + examining the loopback devices e.g. losetup -a. (#151105) +* Wed Jul 12 2006 - ccoffing@novell.com +- Corrected and updated README. +* Mon Jul 10 2006 - ccoffing@novell.com +- Add Jeff Mahoney's block-sync.diff, to give control of + "losetup -y" to the user (and potentially yast). Defaults to + old async behavior. (#190869) +* Thu Jul 06 2006 - ccoffing@novell.com +- Update to xen-unstable tree. Revert changeset 10064, to maintain + backwards compatibility with SLES 10. +* Wed Jul 05 2006 - ccoffing@novell.com +- Do not open migration port by default. (#190170) +- Update patch for migration oops, to latest version in bug + [#162865]. +* Mon Jul 03 2006 - okir@suse.de +- xen-losetup-sync.diff: use the new "losetup -y" option to force + the loop device to use synchronous I/O (#189051) +* Fri Jun 30 2006 - ccoffing@novell.com +- Increase balloon timeout value. (#189815) +- Update to xen-3.0-testing tree, changeset 9762. +* Thu Jun 29 2006 - ccoffing@novell.com +- Fix some loopback races in domUloader. (#151105) +* Tue Jun 27 2006 - ccoffing@novell.com +- Add "max_para_memory" and "max_hvm_memory" to output of "xm info" + for bug #184727. +- Include Jan's patches for bug #184175. Improves PAE guest + support on HVM. +* Mon Jun 26 2006 - ccoffing@novell.com +- Include patch from HP to fix a domU migration failure ("Kernel + BUG at mm/mmap.c:1961"). Force L1/L2 page tables to be updated + at the end, to avoid them from being dirtied and not transferred. + (#162865) +* Fri Jun 23 2006 - kallan@novell.com +- Updated xen-bonding.diff to enable bonding again after the latest + patches to network-bridge etc. (#161888) +* Wed Jun 21 2006 - ccoffing@novell.com +- Clean up the useless "Nothing to flush" messages, from 'ip addr + flush', in /var/log/xen-hotplug.log +- Fix race condition in domUloader.py, when another process did + losetup -d while domUloader was running. This would result in + the mount failing, and so the VM would fail to start. +* Tue Jun 20 2006 - ccoffing@novell.com +- Revamp balloon.py to account for pages currently being + scrubbed. (#185135) +* Mon Jun 19 2006 - ccoffing@novell.com +- Update to xen-3.0-testing tree, changeset 9749. +- DomUs are getting starved for CPU (up to 40 seconds was seen) + when dom0 has a load. This can cause pathological behavior, and + can cause OCFS2 to fence (panic) the domain. (#179368, #178884) +- Import Gerd's fix to network-bridge script for bug #161888. +* Wed Jun 14 2006 - ccoffing@novell.com +- Pull out accidentally-included debugging code. +- Drop xenvers patch; this was for backwards compatibility for + some early internal builds. +- Update from Jan on the console patch. Not all graphics cards / + drivers properly reflect the state in the register being tested. + Improved the check, to prevent screen corruption. (#161541) +* Tue Jun 13 2006 - ccoffing@novell.com +- Resync with new tarball from xen-3.0-testing; changeset 9738. +* Mon Jun 12 2006 - ccoffing@novell.com +- Drop BUILD_BUG_ON and pirq-shared patches. Last week's pirq + sharing patch from upstream (for bug #152892) makes these patches + redundant. Dropping these makes our shared_info structure match + upstream again, which is needed for compatibility with other + paravirtualized guests. +- Import changeset 9734 from xen-3.0-testing. This fixes a hyper- + call (used by the pcifront driver) to work on MP guests. Without + this, the pciback driver can hang on MP. (#181467) +- Import changeset 9733 from xen-3.0-testing. This patch is + required to match the Linux kernel, since Linux always calls + this operation from VCPU0 during secondary VCPU bringup. + Without this, process run-time accounting on secondary CPUs is + completely wrong. +- Updated README: Documented work-around for bug #180058. +* Fri Jun 09 2006 - ccoffing@novell.com +- Include Jan's patch: "IOPL is ignored for VM86 mode port + accesses. Fix Xen emulation to match native behaivour." Fixes + some X lockup issues. (#179045) +- Include Keir's patch to allow reading from port 0x61, to avoid + an X server lockup. (#171087) +- Include xen-3.0-testing changeset 9726, which is needed to + support the latest kernel-xen. With this support, Linux will + only trigger unhandled IRQ path if IRQ is not shared across + multiple guests (another guest may have handled the interrupt). + This is more upstream work that goes with bug #152892. +- Add versioning to the Requires lines, to guard against mixing + binary incompatible versions. (#183292) +- I accidentially dropped part of Clyde's fix for bug #162244. + SMP support in HVM is working in xen-unstable, so upstream + dropped the HT CPUID masking code, which we then inheirited. + Re-add HT CPUID masking. (#162244) +- Updated README: VNC installations, known issues. +* Thu Jun 08 2006 - ccoffing@novell.com +- Drop our XCHG patch for the equivalent upstream patch, to fix + patch application order. No code change. +* Wed Jun 07 2006 - ccoffing@novell.com +- Updated README: HVM issues/tips, CDROM tips, known issues. +- Add patch from Intel to decode LODS/STOS instructions to fix + Windows installation. Only affects HVM. Xen changeset #9725 + consolidates this patch and xen-hvm-decode.diff; drop our 2 in + favor of the consolidated upstream patch. (#176717) +* Tue Jun 06 2006 - ccoffing@novell.com +- Drop xen-8-way-bios patch, because it breaks Windows HVM + installation. The patch was only necessary when running SMP HVM + with "acpi=0" on the kernel command line. (#181974) +- Include two patches from xen-3.0-testing that change the + interface between Xen and guests. Including these now to help + forward-compatibility: + + 9709: Changes interface for accessing %%cr3 so that extra bits + (>4GB) for PAE pgdirs are placed in low-order bits of %%cr3. + Kernels without support for this will still run fine. + + 9721: Use explicitly-sized types in the dom0_ops and privcmd + structures. +- Fix ability to change ISOs images for HVM guest. (#181895) +- Removed pointless whitespace changes from xen-removable.diff, for + better maintainability. Cut the patch size in half; no code + changes. +* Mon Jun 05 2006 - ccoffing@novell.com +- Include select patches from xen-3.0-testing: + + 9698: Official fix for bug #159001. Dropped our patch. + + 9702: Fix MMU_NORMAL_PT_UPDATE when passed a page that is no + longer of type page-table. + + 9703: Modification to fix for bug #159001; ignore empty PTEs. + + 9704: Fix for obvious typo in map_pages_to_xen: When replacing + a pte, free the page table pointed to by the old entry, not the + new entry. + + 9705: Jan's previous signed-ness patch (c/s 9695) was changed + when accepted upstream, which broke it; this changeset + attempts to fix the breakage. + + 9708: HVM: Fix a hang when doing an "xm destroy" of Windows VM. + + 9717: HVM: Interrupts must be kept disabled when entering Xen + for external interrupt processing. +* Fri Jun 02 2006 - ccoffing@novell.com +- Include xen-3.0-testing changeset 9693. This scales the + ballooning timeout with the amount of memory being requested + (necessary for large memory machines). This is a more proper fix + for Novell bug #175805, and addresses XenSource bug #650. +* Thu Jun 01 2006 - ccoffing@novell.com +- Update the README, regarding how to make the mouse work properly + with VNC in HVM. +- Update help text in mk-xen-rescue-img. +* Wed May 31 2006 - ccoffing@novell.com +- Jan's backport of xen-unstable changesets 9517, 9518, and 9529. + This allows Xen to boot on 4-node configurations without + crashing. (#150114) +- Include patch from Jun Nakajima at Intel to fix inability to + start XWindows after creating HVM guest. (#159001) +- Include select patches from xen-3.0-testing: + + 9697: Fix infinite recursion loop in get_page_type() error path +- Include xen-unstable changeset 9967, to improve Summagraphics + tablet emulation, to help mouse tracking in HVM. (#167187) +- Include 3 patches from AMD to fix SMP support in HVM. (#176171) +- Add CPUID masking patches from AMD and Intel for HVM. This + prevents the OS from seeing (and trying to use) various hardware + features that are not supported within the VM. (#180879) +* Fri May 26 2006 - ccoffing@novell.com +- Fix deadlock between xm and qemu. Qemu should not call xm; + issue xc commands directly. This deadlock was exposed when + making qemu exit nicely and clean up. (#176400) +- Include Gerd's update to his previous REP MOVS fix. Calculating + high_addr and low_addr is more complicated than previously + thought, and the count was wrong. (#165448). +- Drop previous patch that forcefully turns off Xen's console + logging to avoid video corruption; instead use Jan's patch which + only turns logging off when in graphical mode. (#161541) +- Include Jan's patch to call machine_halt rather than inline + assembly "hlt" when Xen crashes to sync display, disable watchdog + timers, etc. +- Tweak the auto-ballooning patch to limit the VM itself to the + requested amount of memory, don't include the overhead, as + suggested by Intel. Separate calls exist elsewhere to increase + the max as needed. (#149179) +- Include select patches from xen-3.0-testing: + + 9688, 9696: These remove some broken assembly string + functions. This is prep work from Jan for bug #160066. + + 9695: Updates in the hypervisor to EDI and ESI could be + incorrect, due to sign not being handled correctly. +* Fri May 19 2006 - ccoffing@novell.com +- Update from Intel to previous patch to fix installation of HVM + W2k. Adds decoding for two more instructions. (#176717) +- Updated the README. +- Included updated version of KY's patch to reserve some lowmem + for PAE, to avoid kernel BUG() during boot. The amounts of + memory reserved at various physical memory sizes have been + adjusted. (#175124) +- Include Intel's patch for unchecked allocations in shadow*.c. + (#149179) +* Thu May 18 2006 - ccoffing@novell.com +- Include Intel's patch to fix installation of HVM W2k. This patch + adds decoding for 'xor' and 'and' instructions. Without this, + the VM crashes when W2k attempts to install network components. + (#176717) +- While tidying xen-hvm-memory-check.diff for submission upstream, + I noticed an error in the patch (such that low-memory while + starting the HVM domain could still crash the physical machine.) + Now all uses of iopm are protected by the check. (#149179) +- Xen must always relinquish control of the VGA console once dom0 + has started. Otherwise, it could be over-writing dom0's memory, + causing screen or other memory corruption. Admin can use + "xm dmesg" to view Xen's log instead. (#161541) +- First send a SIGTERM, rather than SIGKILL, to qemu to give it a + chance to clean up. This fixes both mouse and CD-ROM issues + for fully virtualized VMs. This is a work-around; Ross is + still working on the proper fix. (#176400, #171258, #176157) +- Include select patches from xen-3.0-testing: + + 9682,9683: These patches only affect full virtualization on + AMD. Fixes register corruption, cleans up event injection, + cleans up IO handling. + + 9685,9686: This patch only affects full virtualization on + Intel. Fixes VM's segment base address, to avoid vmentry + failure. Also remove 32/64 differences in vmx reg store/load. +* Wed May 17 2006 - ccoffing@novell.com +- When auto-ballooning domain 0's memory for a new HVM domain, + all memory (including memory intended for overhead) was given + to the VM itself. So increasing the memory size calculations + did not actually free up any more memory. Now, treat the amount + to balloon and the amount to give to the VM as separate values. + (#149179) +* Tue May 16 2006 - ccoffing@novell.com +- Include Gerd's fix for HVM emulation of REP MOVS when the copy + spans a page. If the direction flag was set, the emulation code + broke. This caused the VM to freeze when configuring firewall + (#165448). +- Include KY's fix to default to reserving 16M of lowmem for PAE, + to avoid hitting kernel BUG() during boot (#175124). +- Don Dugger's (Intel) fix for HVM screen corruption (#164573). +- Increase maximum time auto-ballooning will wait for domain 0 to + respond, otherwise large VMs will fail to start from yast + (#175805). +* Mon May 15 2006 - ccoffing@novell.com +- Update memory size calculations when auto-ballooning for HVM + to make more stable (#149179). +* Fri May 12 2006 - ccoffing@novell.com +- Include select patches from xen-3.0-testing: + + 9674: xc_ptrace: Fix reversed conditional, which broke single- + stepping. + + 9675: xc_ptrace: Fix out-of-bounds memory-access for FPU state. + + 9678: Fix the performance issues of 2-level paging HVM guests + on the PAE Xen. +- Update man pages. +* Wed May 10 2006 - brogers@novell.com +- Fix loading of binary images which either require PAE or + dynamically support running on both PAE hypervisor and non-PAE + hypervisors. (#174080) +* Wed May 10 2006 - carnold@novell.com +- Handle memory failure when staring fully virtualized + guests to prevent reboot of the box (AMD) or + hanging the box (VT) (#149179). +* Tue May 09 2006 - ccoffing@novell.com +- Include select patches from xen-3.0-testing: + + 9665: Fix pciif parsing for compatibility variable. + + 9666: Fix HVM hang; was broken due to previous "hda lost + interrupt" patch. (#169146) + + 9667: Do not set GP fault in VMCS for VMX (no bug#; from Intel) +* Thu May 04 2006 - cgriffin@novell.com +- Update xen-3.0-testing tree, changeset 9664: + + Changesets 9663 and 9664 fix AMD fully virtualized + guests causing the system to reboot when + first starting up. (#169855) +* Thu May 04 2006 - cgriffin@novell.com +- With a Xen domain set up with a loop-mountable file as rootfs, + the "xm start " invocation fails. The cause is a bug + domUloader.py (#172586) +* Thu May 04 2006 - rmaxfiel@novell.com +- Added the ability to 'attach' and 'detach' removable media + devices to hvm guests. Also made cdrom eject when the eject + request comes from the hvm guest. (#159907) +- Fixed the loss of mouse when a SDL session ends with 'grab' + in effect. (#159001) +* Thu May 04 2006 - cgriffin@novell.com +- Update xen-3.0-testing tree, changeset 9661: + + Drop patches merged upstream + + Took Kier's official patches for dropped patches most + notably spurious interrupts (#152892) +- Took Intel's patch to fix screen corruption when + resizing the screen of windows hvm guests (#164573) +* Wed May 03 2006 - kallan@novell.com +- Added configuring network interfaces when using Xen bridging instructions + to the README.SuSE file as requested by bug #171533. +* Mon May 01 2006 - tthomas@novell.com +- Added message to xm save to indicate that save is not currently + supported for fully virtualized guests. (#161661) +* Fri Apr 28 2006 - ccoffing@novell.com +- Close fds before exec-ing vncviewer, so yast2-vm doesn't hang + when viewing fully-virtualized console (#168392). +* Thu Apr 27 2006 - ccoffing@novell.com +- Update xen-3.0-testing tree, changeset 9656: + + Drop patches merged upstream. + + Fix reboot on large SMP machines (IBM, no bug #). +- Integrate Jan's patches: + + Spurious interrupt roundup (#152892). +* Mon Apr 24 2006 - ccoffing@novell.com +- Integrate Jan's patches: + + FXSR patch (#135677). + + APIC option patch (work-around #150114). + + Protect against hypervisor crash (#169143). +- Update xen-3.0-testing tree, changeset 9649: + + Avoid spurious timer activations in hypervisor. + + Fix xen command line parsing (lapic / nolapic parsing). + + Fix inverted BUG_ON w.r.t. SiS APIC bug. +* Fri Apr 21 2006 - ccoffing@novell.com +- Update to 3.0.2-2 (xen-3.0-testing tree, changeset 9640): + + Fix for "hda lost interrupt" for PAE VMX. + + Increase L2 PDE to 1 GB; allows x86_64 to boot larger dom0. + + Fix for SVM booting 32pae-on-32pae. +- Drop upstream patches (SiS APIC bug, HTT, HVM interrupt race) +- Add Jan's port of spurious interrupt patch (#152892). +- Add /etc/xen/images link for convenience (#168070). +- Updated README. +* Thu Apr 20 2006 - ccoffing@novell.com +- SiS APIC bug patch (Jan Beulich, #116485). +* Wed Apr 19 2006 - agruen@suse.de +- Create /boot symlinks in the %%install section instead of in + %%post so that they will end up in the package file list. +* Wed Apr 19 2006 - ccoffing@novell.com +- Don't kill xenstored and xenconsoled when stopping xend. + (#158562, #156261) +* Wed Apr 19 2006 - ccoffing@novell.com +- Update to 3.0.2-2 (xen-3.0-testing tree, changeset 9629): + + Fix for SMP IA32 VMX guest booting. + + KY's SETMAXMEM fix. +* Wed Apr 19 2006 - cgriffin@novell.com +- Removed HTT bit from cpuid and set logical processor count to 1. + Also fixed logic problem in svm code where apic=0 was not + handled (#162244). +* Tue Apr 18 2006 - ccoffing@novell.com +- Add /etc/xen/vm to vm config file search path (#167208). +* Fri Apr 14 2006 - kallan@novell.com +- Add support for bonding in network-bridge. (#161678). +* Fri Apr 14 2006 - ccoffing@novell.com +- Update to 3.0.2-2 (xen-3.0-testing tree, changeset 9620): + + Fixes stack corruption in libxs (XenSource #411). +* Thu Apr 13 2006 - rmaxfiel@novell.com +- Fixed a problem in ioemu which exited when the cdrom line was + found in the guest def file but the cd device contained no media. + (#161210) +* Wed Apr 12 2006 - ccoffing@novell.com +- Auto-balloon domain 0 for HVM domains (#149179). +- Update to 3.0.2-1 (xen-3.0-testing tree, changeset 9612): + + Fixes xmlrpc issues. + + Fixes several emulated instructions for HVM. + + Fixes for x86_64 inline assembly. +* Tue Apr 11 2006 - ccoffing@novell.com +- Fix "jitter" and race in dom0's memory target calculation, which + could cause auto-ballooning to fail (#164714). +* Tue Apr 11 2006 - brogers@novell.com +- Fix problem where localtime=1 results in zombie domains after + they shutdown (#164960) +* Mon Apr 10 2006 - ccoffing@novell.com +- Update to hg 9598 (xen-3.0-testing tree; 3.0.2-rc). Discounting + Linux changes and patches we already carry, this update contains: + + Saner error handling in iret hypercall (x86/64). + + Make root page table sanity check on restore more generic. + + Additional sanity / compatability checks during guest build. + + IO-APIC update hypercall fixes. +* Fri Apr 07 2006 - ccoffing@novell.com +- Don't throw an exception if 'xm top' is run by non-root; print + error message instead (#164224). +- Change localtime patch to account for daylight savings time + (Bruce Rogers). +- Re-add patch to make tightvnc work. It was accidentally dropped + recently (#149556). +* Thu Apr 06 2006 - ccoffing@novell.com +- Update to hg 9590 (xen-3.0-testing tree; 3.0.2-rc). +- Fix type error in localtime patch for para (Bruce Rogers). +- Fix default localtime for full (Bruce Rogers). +- Fix path in mk-xen-resue-img.sh (#163622). +- Update README (pathnames, yast2-vm descriptions, terminology). +* Tue Apr 04 2006 - garloff@suse.de +- init script: Test for control_d in capabilities to determine dom0 + rather than privcmd. +- init script: Try loading netloop and backend modules. +- mk-xen-rescue-img.sh: Copy frontend drivers, remove stale files. +- example config files: provide commented out domUloader exmaples. +* Mon Apr 03 2006 - ccoffing@novell.com +- Update to hg 9514 (xen-unstable tree; 3.0.2-rc). +- Fix for rebooting (Jan Beulich; #160064). +* Fri Mar 31 2006 - ccoffing@novell.com +- Update to hg 9502 (xen-unstable tree; 3.0.2-rc). +- Update man page (#162402). +- xen-tools requires python-xml (#161712). +- Include localtime patch to support NetWare (Bruce Rogers). +* Thu Mar 30 2006 - ccoffing@novell.com +- Update to hg 9481 (xen-unstable tree; 3.0.2-rc). +- Correctly default XAUTHORITY if it is not set. This allows the + GUI to come up for fully virtualized guests (was especially + problematic when VM was started from YaST). (#142472) +* Wed Mar 29 2006 - ccoffing@novell.com +- Fixed reversed "Do I have enough memory?" test when creating + new VMs (#156448). +* Tue Mar 28 2006 - ccoffing@novell.com +- Pick up two critical fixes for AMD to fix full virtualization: + c/s 9453 & c/s 9456. +* Thu Mar 23 2006 - ccoffing@novell.com +- Update to hg 9434 (xen-unstable tree; 3.0.2-rc). +- Fix /etc/xen/scripts/block to properly check if devices can be + shared. +- Default XENDOMAINS_AUTO_ONLY to true; previous setting + contradicts yast2-vm's claim that only VM's marked auto will be + auto-started. +* Mon Mar 20 2006 - ccoffing@novell.com +- Update to hg 9329 (xen-unstable tree). +* Wed Mar 15 2006 - ccoffing@novell.com +- Update to hg 9251 (xen-unstable tree). +- Update to latest versions of Intel's VNC patches: + patch-vga-sse2-0314.l, patch-vnc_loop-0314.l, + patch-vncmouse-0315.l +- Gather example files in /etc/xen/examples. +* Tue Mar 14 2006 - rmaxfiel@novell.com +- Removed the intermediate sym-link between xen.gz and + xen--.gz. Grub 0.97 XFS can not handle a + double indirect to a file. (#151792) +* Tue Mar 14 2006 - garloff@suse.de +- Update README.SuSE: Document limits (mem, cpu hotplug, max_loop), + more network troubleshooting, update security info. +- Be more tolerant against errors in ifdown/ifup to better coexist + with non-std network setups (e.g. ifplugd/NetworkManager). +* Tue Mar 07 2006 - ccoffing@novell.com +- Update to hg 9172 (xen-unstable tree). +- Create new xen-libs package, split from xen-tools (#154473). +- Update mk-xen-rescume-img and xmexample.rescue to work with + current rescue image on CD (#152971). +- Include Kurt's patch to domUloader, to pass command line args. +- xendomains shouldn't try to migrate or save HVM domains, as this + isn't supported and will stall the shutdown (#155265). +- Create empty /etc/xen/vm directory for YaST to place config files + in, to avoid name collisions (#156322). +- Update and re-enable vga patch from Intel (Don Dugger). VGA + emul is faster and not corrupted. +- ifup is run to ensure IPs are assigned before rearranging for + xen, but this can fail with ifplugd; this should not kill the + whole script (Kirk Allan) (#154115). +- Make network-bridge script more robust, by checking /sys instead + of grep-ing. +* Mon Mar 06 2006 - ccoffing@novell.com +- Update to hg 9148 (xen-unstable tree). Drop patches merged + upstream. +- More README improvements (#154134). +- Fix "vncviewer=1" to bring up vncviewer (#149556). +* Mon Mar 06 2006 - ccoffing@novell.com +- Fix build of hvmloader and vmxassist by removing external + CFLAGS (XS changeset #9110). +- Fix build by forcing --prefix during installation of *.py. +* Wed Mar 01 2006 - ccoffing@novell.com +- Update to hg 9029 (xen-unstable tree). Adds support for HVM on + 64 bit hardware. +- Update vncmouse diff to 20060301 from Intel; compensates for lack + of eager events in our LibVNCServer. +- Fix many bugs in lomount. +- Cap maximum value of "xm mem-set" for domain 0, based on size of + dom0's page tables (#152667). +* Mon Feb 27 2006 - ccoffing@novell.com +- Update to hg 9015 (xen-unstable tree). More bug fixes. +- Update patch to better honor RPM_OPT_FLAGS. +- Updated README (#154134). +- Disable xen-vga-0213 patch; it speeds VGA updates but was + corrupting the display. +- Change max mouse polling time from 1ms to 10ms to reduce CPU + load (from Intel). +* Thu Feb 23 2006 - ccoffing@novell.com +- Update to hg 8954 (xen-unstable tree). More bug fixes. +- Don't use a dummy IP of 1.2.3.4 for NFS server when booting domU + with DHCP. Seems to hang x86_64 Linux. +- Remove unnecessary x86_64 patch. +- Fix auto-ballooning of dom0 memory for HVM domUs (XenSource bug + 521). +* Tue Feb 21 2006 - ccoffing@novell.com +- Update to hg 8920 (xen-unstable tree). Fixes instruction decode + for fully virtualized guests, fixing booting from CDs. +- Integrate 3 patches from Intel, to improve VNC performance. +* Tue Feb 21 2006 - ccoffing@novell.com +- Update to hg 8910 (xen-unstable tree). + fixes 32 on 32, 32 pae on 32pae, 64 on 64, 32 on 64. + critical HVM fixes, for fully virtualized guests. +* Fri Feb 17 2006 - ccoffing@novell.com +- Update to hg 8870 (xen-unstable tree). More HVM fixes. +- Remove duplicate balloon.free call. +- Add patch from Intel to fix dom0 crash on 64 bit SMP HVM. +* Thu Feb 16 2006 - carnold@novell.com +- Update to hg 8858 (xen-unstable tree). +* Wed Feb 15 2006 - ccoffing@novell.com +- Update to hg 8857 (xen-unstable tree). Syncs hypervisor core + with Linux 2.6.16, which may fix some ACPI issues. Fixes HVM. +- Fix uninitialized variable in xc_load_bin (from Bruce Rogers). +- Auto-balloon dom0 for fully virtualized domains (#149179). +- xen-doc-html was missing image files. +* Mon Feb 13 2006 - ccoffing@novell.com +- Update to hg 8830 (xen-unstable tree). +- Restore cs 8783/8792 to match kernel. +* Wed Feb 08 2006 - ccoffing@novell.com +- Update to hg 8800 (xen-unstable tree). +- Update BuildRequires. +- Add "max-free-memory" to "xm info", to support yast2-vm (#147612) +- Insserv xendomains, to support yast2-vm. +- Fix exit code of "xend stop". +- Revert cs 8783/8792 to allow xenstore to start (until kernel + catches up). +- Ensure eth0 aka veth0 really comes up in network-bridge. +* Sat Feb 04 2006 - mls@suse.de +- converted neededforbuild to BuildRequires +* Fri Jan 27 2006 - ccoffing@novell.com +- Update to hg 8728 (xen-unstable tree). +- Improve network-bridge: + + Ensure netdev really is up, to fix STARTMODE="manual". + + Stop ifplugd when doing ifdown, to fix STARTMODE="ifplugd". + + Improve check for whether bridge already exists. + + Improve defaults for netdev. +- Fix log rotate so xend moves to new log. +- xen-tools "Requires" python, et.al.; xen proper doesn't. +- Revamp mk-xen-rescue-img.sh (#118566). +- Revamp rcxendomains: improved output, error checking, return + values (#143754, #105677). +* Tue Jan 24 2006 - ccoffing@novell.com +- Update to hg 8659 (xen-unstable tree). +* Mon Jan 23 2006 - ccoffing@novell.com +- Correct return values and improve messages of init scripts. +* Fri Jan 20 2006 - ccoffing@novell.com +- Use domUloader instead of pygrub. +* Thu Jan 19 2006 - carnold@novell.com +- Build based on the xen-unstable.hg 8628 +* Wed Jan 18 2006 - carnold@novell.com +- Update to hg 8646 xen-unstable-hvm.hg tree. +* Fri Jan 13 2006 - ccoffing@novell.com +- Allow version string "XEN_VER=3.0" instead of just + "XEN_VER=xen-3.0" for backwards compatibility. +- Correctly set changeset in compile.h. +* Thu Jan 12 2006 - carnold@novell.com +- Added two patches from AMD that apply to the 8513 changeset. +* Thu Jan 12 2006 - kukuk@suse.de +- Add libreiserfs-devel to nfb. +* Wed Jan 11 2006 - carnold@novell.com +- Update to hg 8513 xen-unstable-hvm.hg tree. +* Tue Jan 10 2006 - ccoffing@novell.com +- Update to hg 8269 (xen-3.0-testing). +- Support try-restart in init scripts. +- Clean up installation of udev rules. +* Wed Dec 14 2005 - ccoffing@novell.com +- Update to hg 8257 (xen-3.0-testing). +- Update documentation. +- Fix gcc 4.1 warnings. +* Wed Dec 07 2005 - ccoffing@novell.com +- Update to hg 8241 (xen-3.0-testing). +* Mon Nov 28 2005 - ccoffing@novell.com +- Update to hg 8073. +- Rationalize command names (eg, setsize -> xentrace-setsize). +- Fix gcc 4.1 warnings. +* Wed Nov 16 2005 - ccoffing@novell.com +- Update to hg 7782. +- Honor RPM_OPT_FLAGS better. +- Include a few simple, obvious fixes from upstream. +- Build xm-test package. +- Update udev scripts. +* Mon Nov 14 2005 - ccoffing@novell.com +- Includes upstream fixes to fix i586 save/restore. +* Thu Nov 10 2005 - ccoffing@novell.com +- Include a few simple, obvious fixes: 7609, 7618, 7636, 7689, + 7690, 7692, 7696 +* Thu Nov 03 2005 - ccoffing@novell.com +- Update to hg 7608. +- Fix warn_unused_result warnings. +- Drop some patches (merged upstream) +- Tidy README.SuSE. +* Tue Nov 01 2005 - ccoffing@novell.com +- Update to hg 7583. +* Thu Oct 20 2005 - ccoffing@novell.com +- Don't mention unwritten man pages. +- Update xmexample* to match SUSE paths. +- Update xs-include patch. +* Wed Oct 19 2005 - garloff@suse.de +- Avoid race in watchdog functionality. +- Improve network-bridge script. +* Tue Oct 18 2005 - garloff@suse.de +- Ignore zombies in the xendomains shutdown procedure and have a + configurable timeout for the commands. Make xendomains status + report something useful. +- Make xendomains script comaptible to non-SUSE distros. +* Mon Oct 17 2005 - garloff@suse.de +- Update to hg 7398. +* Mon Oct 17 2005 - garloff@suse.de +- Create useful xendomains init script and sysconfig file. +* Mon Oct 17 2005 - garloff@suse.de +- Create symlinks also for -pae and -dbg hypervisor. +- Build doxygen documentation. +- Include block-nbd script and xen-nbd example config. +- Include patchset info. +* Wed Oct 12 2005 - garloff@suse.de +- Update docu. +- Enable xen-dbg hypervisor for gdbserver domU debugging. +* Tue Oct 11 2005 - garloff@suse.de +- Update docu. +- Update to hg 7313. +- Move libxenstore.so to xen-tools. +* Tue Oct 11 2005 - garloff@suse.de +- Fix buglet in /sbin/xen-vbd. +* Mon Oct 10 2005 - garloff@suse.de +- Downgrade to hg 7267. +- Add troubleshooting section to README.SUSE. +* Mon Oct 10 2005 - garloff@suse.de +- Fix typo in SrvDomain for mem-set operation. +- Workaround: write directly to balloon in dom0 setMemoryTarget. +- Kill xenconsoled and xenstored in rcxend stop. +* Sun Oct 09 2005 - garloff@suse.de +- Update to hg 7278. +- Provide udev rules to setup vifs and vbds in dom0 when domUs + boot (kraxel). +- Change default FS size for rescue images to 80MB. +* Sat Sep 10 2005 - garloff@suse.de +- Update to hg 6715. +- Fix network-bridge down. +* Thu Sep 08 2005 - garloff@suse.de +- Build PAE version along non-PAE version of Hypervisor. +* Tue Sep 06 2005 - garloff@suse.de +- Try to fix network bridge down issue. +- Document netowrking and firewalling caveats in README.SUSE. +- Enable PAE. +* Tue Sep 06 2005 - garloff@suse.de +- Update to hg 6644. +* Sun Sep 04 2005 - garloff@suse.de +- Update to hg 6610. +- Rename default name of xen-br0 to xenbr0. +- Fix pygrub installation. +- Use libreiserfs to support pygrub on reiser. +* Mon Aug 29 2005 - ccoffing@novell.com +- xen-bridge-net.diff: do not destroy domain 0's network setup + when starting xend. +* Mon Aug 29 2005 - garloff@suse.de +- Update to hg 6458. +- Drop privileged port check -- we use Unix dom sockets anyway + (#105178). +- init.xend: Fix linebreaks in PID list. +- Correctly assign insserv to xen-tools subpackage. +* Thu Aug 25 2005 - garloff@suse.de +- Add dirs /var/run/xenstored and /var/lib/xenstored. +* Thu Aug 25 2005 - garloff@suse.de +- Update to hg 6393. +* Mon Aug 22 2005 - garloff@suse.de +- Update to hg 6315. +- Include linux-public headers in xen-devel package. +* Sun Aug 21 2005 - garloff@suse.de +- Update to hg 6305. +* Sun Aug 21 2005 - garloff@suse.de +- Update to hg 6299. +- Enable VNC support (depending on LibVNCServer). +* Sun Aug 21 2005 - garloff@suse.de +- Split off xen-tools-ioemu for supporting unmodified guests. +* Sat Aug 20 2005 - garloff@suse.de +- Enable pygrub (at the cost of depending on e2fsprogs-devel) +- Enable VMX ioemu SDL support (at the cost of many dependencies) +* Fri Aug 19 2005 - garloff@suse.de +- Update to mercurial changeset 6223. +- Move /usr/libexec/xen/ to /usr/lib[64]/xen/bin/. +- Split off -tools package. +* Mon Aug 15 2005 - garloff@suse.de +- Create symlinks in %%post. +- Update README.SUSE. +- Mark /etc/xen/ as %%config(noreplace). +- Fix x86-64 build (movl -> mov, lib vs. lib64 inst dirs). +- Remove PYTHONOPTIMIZE. +* Tue Aug 02 2005 - ccoffing@novell.com +- Fix warn_unused_result warnings +* Thu Jul 28 2005 - ccoffing@novell.com +- Update to latest 3.0-unstable snapshot. +* Wed Jul 13 2005 - ccoffing@novell.com +- Fixed bug in glibc24 patch that caused erroneous "out of memory" + errors +* Fri Jun 24 2005 - ccoffing@novell.com +- Fix gcc4 patch that caused a panic in Xen at boot. +* Fri Jun 24 2005 - ccoffing@novell.com +- Fix xen-syms link. +* Fri Jun 17 2005 - ccoffing@novell.com +- Fix version-check in NetWare loader (0x336ec577 -> 0x326ec578). +* Fri Jun 17 2005 - ccoffing@novell.com +- Backport NetWare-friendly loader from Xen 3.0. +* Thu Jun 16 2005 - ccoffing@novell.com +- Destroy domains that failed to be fully created. +* Fri Jun 10 2005 - garloff@suse.de +- Update to latest 2.0-testing snapshot. +- Use RPM version and release no as xen version. +* Wed Jun 08 2005 - garloff@suse.de +- Update mk-xen-rescue-img.sh script: Handle SLES9 better. +- Export PYTHONOPTIMIZE in xend start script. +* Tue Jun 07 2005 - garloff@suse.de +- Merge _perform_err fixes. +* Mon May 23 2005 - ccoffing@novell.com +- update to 2.0.6 +* Wed Apr 13 2005 - garloff@suse.de +- More gcc4 and binutils related fixes. +* Wed Apr 13 2005 - garloff@suse.de +- Build fixes for gcc4. +* Sun Apr 03 2005 - garloff@suse.de +- Update xen: Various fixes (scheduling, memset, domain crash + handling) and enhancements (bg page scrubbing). +* Thu Mar 24 2005 - garloff@suse.de +- xen-bridge-net.diff: Make sure bridge netdev is up after adding + addresses to it. +* Wed Mar 23 2005 - garloff@suse.de +- xen-secure.diff: Check for privileged port before allowing + certain control operations. +- README.SUSE: Document this change. +* Wed Mar 23 2005 - garloff@suse.de +- Require ports < 1024 to allow controlling VMs. +* Mon Mar 21 2005 - garloff@suse.de +- Update xen. +* Wed Mar 16 2005 - garloff@suse.de +- Update xen. +- Add /var/lib/xen/xen-db/ subdirs. +* Sun Mar 13 2005 - garloff@suse.de +- Update to post-2.0.5 +- Make /usr/sbin/xm root:trusted 0750 +- Drop some patches (merged upstream) +* Tue Mar 08 2005 - garloff@suse.de +- Update README with security notes. +- Update mk-xen-rescue-image.sh script allowing to specify the + kernel version to be used. +- Rather than busy-looping, exit console on a domain that has + shutdown. +* Mon Mar 07 2005 - garloff@suse.de +- Update xen to latest snapshot. +- tgif not needed any more. +* Tue Mar 01 2005 - garloff@suse.de +- Include serial-split from Charles Coffing. +* Tue Mar 01 2005 - garloff@suse.de +- Update xen to latest snapshot. +* Mon Feb 21 2005 - garloff@suse.de +- Update README.SuSE. +- Update xen to latest snapshot. +* Sun Feb 13 2005 - garloff@suse.de +- Add init header to xendomains init script. +- Add bridge-utils dependency. +- Update config file and README. +- Activate xend init script on installation. +* Thu Feb 10 2005 - ro@suse.de +- remove te_etex and te_pdf from neededforbuild. +* Thu Feb 10 2005 - garloff@suse.de +- Update README about IDE dma. +- Default to dhcp. +* Wed Feb 09 2005 - garloff@suse.de +- Update to xen post-2.0.4. +- Little bugfix for xen rescue install script. +- Update README.SUSE: Better explanation of root FS creation. +* Mon Jan 24 2005 - garloff@suse.de +- Change some defaults to be more secure (xend only binds to + localhost, ip spoof protection on). +- Avoid ipv6 issue with xend network script. +- Extensive docu in README.SUSE now. +- mk-xen-rescue-img.sh creates a xen root fs image from the std + SUSE rescue image. +- Put boot.local script in root img to parse ip boot par. +* Thu Jan 20 2005 - garloff@suse.de +- Update to newer snapshot. +* Thu Jan 20 2005 - garloff@suse.de +- Update to xen-2.0-unstable (post 2.0.3). +* Thu Dec 09 2004 - garloff@suse.de +- Initial creation of package xen, xen-doc-*. +- i686 only for now. diff --git a/xend-xmlrpc-large-ints.diff b/xend-xmlrpc-large-ints.diff new file mode 100644 index 0000000..c0579a6 --- /dev/null +++ b/xend-xmlrpc-large-ints.diff @@ -0,0 +1,135 @@ +# HG changeset patch +# User anthony@rhesis.austin.ibm.com +# Node ID 8dc8c7bdcbac0e56c606fe5c9205b4d9742e60d7 +# Parent 8b5a752167a17785b998a080a5c1ce1991b9379b +In some cases, Xend can return a very large integer. This so far only happens +on 64bit systems where the sizeof the Python integer is > 32bit. Presumably, +this is occuring because of the fact that we return PFNs as part of the +domain info so on a system with greater than 2G of memory we get into the +invalid integer range. + +For now, the work-around is to overload the xmlrpclib Marshaller and instead +of throwing an exception when we get out-of-range integers, we marshal them +as strings. In the future, we can handle this in a more elegant way by +introducing higher-level types. We also won't have to deal with things like +PFNs once we clean up the XML-RPC interface. + +Signed-off-by: Anthony Liguori + +Index: xen-3.0.3-testing/tools/python/xen/util/xmlrpclib2.py +=================================================================== +--- xen-3.0.3-testing.orig/tools/python/xen/util/xmlrpclib2.py ++++ xen-3.0.3-testing/tools/python/xen/util/xmlrpclib2.py +@@ -25,10 +25,11 @@ import types + import fcntl + + from httplib import HTTPConnection, HTTP +-from xmlrpclib import Transport ++from xmlrpclib import Transport, Fault + from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler + import SocketServer +-import xmlrpclib, socket, os, stat ++import xmlrpclib, socket, os, stat, string ++from types import * + + from xen.xend.XendLogging import log + +@@ -48,6 +49,9 @@ except ImportError: + # + # It assumes that the RPC handler is /RPC2. This probably needs to be improved + ++MAXINT = 2L**31-1 ++MININT = -2L**31 ++ + # We're forced to subclass the RequestHandler class so that we can work around + # some bugs in Keep-Alive handling and also enabled it by default + class XMLRPCRequestHandler(SimpleXMLRPCRequestHandler): +@@ -127,6 +131,67 @@ class ServerProxy(xmlrpclib.ServerProxy) + return conv_string(response) + + ++class Marshaller(xmlrpclib.Marshaller): ++ def __init__(self, encoding=None, allow_none=0): ++ xmlrpclib.Marshaller.__init__(self, encoding, allow_none) ++ self.dispatch[IntType] = Marshaller.dump_int ++ self.dispatch[LongType] = Marshaller.dump_long ++ ++ def dump_int(self, value, write): ++ if value > MAXINT or value < MININT: ++ self.dispatch[StringType](self, str(value), write) ++ else: ++ xmlrpclib.Marshaller.dump_int(self, value, write) ++ ++ def dump_long(self, value, write): ++ if value > MAXINT or value < MININT: ++ self.dispatch[StringType](self, str(value), write) ++ else: ++ xmlrpclib.Marshaller.dump_long(self, value, write) ++ ++def dumps(params, methodname=None, methodresponse=None, encoding=None, ++ allow_none=0): ++ assert isinstance(params, TupleType) or isinstance(params, Fault),\ ++ "argument must be tuple or Fault instance" ++ ++ if isinstance(params, Fault): ++ methodresponse = 1 ++ elif methodresponse and isinstance(params, TupleType): ++ assert len(params) == 1, "response tuple must be a singleton" ++ ++ if not encoding: ++ encoding = "utf-8" ++ ++ m = Marshaller(encoding, allow_none) ++ ++ data = m.dumps(params) ++ ++ if encoding != "utf-8": ++ xmlheader = "\n" % str(encoding) ++ else: ++ xmlheader = "\n" # utf-8 is default ++ ++ if methodname: ++ if not isinstance(methodname, StringType): ++ methodname = methodname.encode(encoding) ++ data = ( ++ xmlheader, ++ "\n" ++ "", methodname, "\n", ++ data, ++ "\n" ++ ) ++ elif methodresponse: ++ data = ( ++ xmlheader, ++ "\n", ++ data, ++ "\n" ++ ) ++ else: ++ return data ++ return string.join(data, "") ++ + # This is a base XML-RPC server for TCP. It sets allow_reuse_address to + # true, and has an improved marshaller that logs and serializes exceptions. + +@@ -174,15 +239,15 @@ class TCPXMLRPCServer(SocketServer.Threa + response = repr(response)[1:-1] + + response = (response,) +- response = xmlrpclib.dumps(response, +- methodresponse=1, +- allow_none=1) ++ response = dumps(response, ++ methodresponse=1, ++ allow_none=1) + except xmlrpclib.Fault, fault: +- response = xmlrpclib.dumps(fault) ++ response = dumps(fault) + except Exception, exn: + import xen.xend.XendClient + log.exception(exn) +- response = xmlrpclib.dumps( ++ response = dumps( + xmlrpclib.Fault(xen.xend.XendClient.ERROR_INTERNAL, str(exn))) + + return response diff --git a/xmexample.domUloader b/xmexample.domUloader new file mode 100644 index 0000000..a762131 --- /dev/null +++ b/xmexample.domUloader @@ -0,0 +1,150 @@ +# -*- mode: python; -*- +#============================================================================ +# Python configuration setup for 'xm create'. +# This script sets the parameters used when a domain is created using 'xm create'. +# You use a separate script for each domain you want to create, or +# you can set the parameters for the domain on the xm command line. +#============================================================================ + +#---------------------------------------------------------------------------- +# The domain build function. Default is 'linux'. +#builder='linux' + +# Initial memory allocation (in megabytes) for the new domain. +memory = 64 + +# A name for your domain. All domains must have different names. +name = "ExampleDomain" + +# List of which CPUS this domain is allowed to use, default Xen picks +#cpus = "" # leave to Xen to pick +#cpus = "0" # all vcpus run on CPU0 +#cpus = "0-3,5,^1" # run on cpus 0,2,3,5 + +# Number of Virtual CPUS to use, default is 1 +#vcpus = 1 + +#---------------------------------------------------------------------------- +# Define network interfaces. + +# By default, no network interfaces are configured. You may have one created +# with sensible defaults using an empty vif clause: +# +# vif = [ '' ] +# +# or optionally override backend, bridge, ip, mac, script, type, or vifname: +# +# vif = [ 'mac=00:16:3e:00:00:11, bridge=xenbr0' ] +# +# or more than one interface may be configured: +# +# vif = [ '', 'bridge=xenbr1' ] + +vif = [ '' ] + +#---------------------------------------------------------------------------- +# Define the disk devices you want the domain to have access to, and +# what you want them accessible as. +# Each disk entry is of the form phy:UNAME,DEV,MODE +# where UNAME is the device, DEV is the device name the domain will see, +# and MODE is r for read-only, w for read-write. + +disk = [ 'phy:hda1,hda1,w' ] + +# This is a bootloader used to boot paravirtualized domains. You can +# optionally plug in a different boot loader here, e.g., pygrub. There is +# usually no reason to change this. Don't use kernel and ramdisk if you +# use a bootloader. +bootloader = "/usr/lib/xen/boot/domUloader.py" + +# The domUloader will pull the specified kernel and initrd out of the domU's +# disk, and use that to boot. This is easier to manage, compared to manually +# keeping a copy of the kernel and initrd in sync in dom0's filesystem and +# pointing to them with the "kernel" and "ramdisk" parameters. Syntax is +# "VDEV:KERNEL,INITRD", where VDEV is the block device (from domU's point of +# view) within which KERNEL and INITRD can be found. VDEV is optional; if it's +# not specified, the root= parameter will be evaluated, /etc/fstab from the +# root FS be consulted and a path relative to the domU root FS be used. +bootentry = "hda1:/boot/vmlinuz-xen,/boot/initrd-xen" + +#---------------------------------------------------------------------------- +# Define to which TPM instance the user domain should communicate. +# The vtpm entry is of the form 'instance=INSTANCE,backend=DOM' +# where INSTANCE indicates the instance number of the TPM the VM +# should be talking to and DOM provides the domain where the backend +# is located. +# Note that no two virtual machines should try to connect to the same +# TPM instance. The handling of all TPM instances does require +# some management effort in so far that VM configration files (and thus +# a VM) should be associated with a TPM instance throughout the lifetime +# of the VM / VM configuration file. The instance number must be +# greater or equal to 1. +#vtpm = [ 'instance=1,backend=0' ] + +#---------------------------------------------------------------------------- +# Set the kernel command line for the new domain. +# You only need to define the IP parameters and hostname if the domain's +# IP config doesn't, e.g. in ifcfg-eth0 or via DHCP. +# You can use 'extra' to set the runlevel and custom environment +# variables used by custom rc scripts (e.g. VMID=, usr= ). + +# Set if you want dhcp to allocate the IP address. +#dhcp="dhcp" +# Set netmask. +#netmask= +# Set default gateway. +#gateway= +# Set the hostname. +#hostname= "vm%d" % vmid + +# Set root device. +root = "/dev/hda1" + +# Root device for nfs. +#root = "/dev/nfs" +# The nfs server. +#nfs_server = '169.254.1.0' +# Root directory on the nfs server. +#nfs_root = '/full/path/to/root/directory' + +# Sets runlevel 4. +extra = "4" + +#---------------------------------------------------------------------------- +# Configure the behaviour when a domain exits. There are three 'reasons' +# for a domain to stop: poweroff, reboot, and crash. For each of these you +# may specify: +# +# "destroy", meaning that the domain is cleaned up as normal; +# "restart", meaning that a new domain is started in place of the old +# one; +# "preserve", meaning that no clean-up is done until the domain is +# manually destroyed (using xm destroy, for example); or +# "rename-restart", meaning that the old domain is not cleaned up, but is +# renamed and a new domain started in its place. +# +# The default is +# +# on_poweroff = 'destroy' +# on_reboot = 'restart' +# on_crash = 'restart' +# +# For backwards compatibility we also support the deprecated option restart +# +# restart = 'onreboot' means on_poweroff = 'destroy' +# on_reboot = 'restart' +# on_crash = 'destroy' +# +# restart = 'always' means on_poweroff = 'restart' +# on_reboot = 'restart' +# on_crash = 'restart' +# +# restart = 'never' means on_poweroff = 'destroy' +# on_reboot = 'destroy' +# on_crash = 'destroy' + +#on_poweroff = 'destroy' +#on_reboot = 'restart' +#on_crash = 'restart' + +#============================================================================ diff --git a/xmexample.iscsi b/xmexample.iscsi new file mode 100644 index 0000000..fcad6e8 --- /dev/null +++ b/xmexample.iscsi @@ -0,0 +1,12 @@ +kernel = "/boot/vmlinuz-xen" +ramdisk = "/boot/initrd-xen" +memory = 128 +name = "nbd" +# Please change MAC +vif = [ 'mac=00:16:e3:10:00:a0, bridge=xenbr0' ] +# Replaced the ':' in the iname with '@' +disk = [ 'iscsi:iqn.2006-09.de.suse@0ac47ee2-216e-452a-a341-a12624cd0225,hda,w' ] +dhcp = "dhcp" +hostname= "nbd" +root = "/dev/hda1" +extra = "3" diff --git a/xmexample.nbd b/xmexample.nbd new file mode 100644 index 0000000..3fd4ad2 --- /dev/null +++ b/xmexample.nbd @@ -0,0 +1,12 @@ +kernel = "/boot/vmlinuz-xen" +ramdisk = "/boot/initrd-xen" +memory = 128 +name = "nbd" +# Please change MAC +vif = [ 'mac=00:16:e3:10:00:a0, bridge=xenbr0' ] +# Please change PORT +disk = [ 'nbd:192.168.0.1 20004,hda1,w' ] +dhcp = "dhcp" +hostname= "nbd" +root = "/dev/hda1" +extra = "3" diff --git a/xmexample.rescue b/xmexample.rescue new file mode 100644 index 0000000..1fd54f9 --- /dev/null +++ b/xmexample.rescue @@ -0,0 +1,85 @@ +# -*- mode: python; -*- +#============================================================================ +# Python configuration setup for 'xm create'. +# This script sets the parameters used when a domain is created using 'xm create'. +# You use a separate script for each domain you want to create, or +# you can set the parameters for the domain on the xm command line. +#============================================================================ + +#---------------------------------------------------------------------------- +# Kernel image file and (optional) ramdisk (initrd). +kernel = "/boot/vmlinuz-xen" +ramdisk = "/boot/initrd-xen" + +# Or use domUloader instead of kernel/ramdisk to get kernel from domU FS +#bootloader = "/usr/lib/xen/boot/domUloader.py" +#bootentry = "hda2:/vmlinuz-xen,/initrd-xen" +#bootentry = "/boot/vmlinuz-xen,/boot/initrd-xen" + +# The domain build function. Default is 'linux'. +#builder='linux' + +# Initial memory allocation (in megabytes) for the new domain. +memory = 64 + +# A name for your domain. All domains must have different names. +name = "Rescue" + +# Which CPU to start domain on? +#cpu = -1 # leave to Xen to pick + +#---------------------------------------------------------------------------- +# Define network interfaces. + +# Optionally define mac and/or bridge for the network interfaces. +# Random MACs are assigned if not given. +vif = [ '' ] + +#---------------------------------------------------------------------------- +# Define the disk devices you want the domain to have access to, and +# what you want them accessible as. +# Each disk entry is of the form phy:UNAME,DEV,MODE +# where UNAME is the device, DEV is the device name the domain will see, +# and MODE is r for read-only, w for read-write. +disk = [ 'file:/var/lib/xen/images/rescue,hda1,w' ] + +#---------------------------------------------------------------------------- +# Set the kernel command line for the new domain. +# You only need to define the IP parameters and hostname if the domain's +# IP config doesn't, e.g. in ifcfg-eth0 or via DHCP. +# You can use 'extra' to set the runlevel and custom environment +# variables used by custom rc scripts (e.g. VMID=, usr= ). + +# Set if you want dhcp to allocate the IP address. +#dhcp = "dhcp" +# Set ip +#ip = "192.168.222.9/27" +# Set netmask. +#netmask = "255.255.255.192" +# Set default gateway. +#gateway = "192.168.222.1" +# Set the hostname. +#hostname= "rescue" + +# Set root device, see disk def above. +root = "/dev/hda1 rw" + +# Root device for nfs. +#root = "/dev/nfs" +# The nfs server. +#nfs_server = '169.254.1.0' +# Root directory on the nfs server. +#nfs_root = '/full/path/to/root/directory' + +# Sets runlevel 3. +extra = "1" + +#---------------------------------------------------------------------------- +# Set according to whether you want the domain restarted when it exits. +# The default is 'onreboot', which restarts the domain when it shuts down +# with exit code reboot. +# Other values are 'always', and 'never'. + +#restart = 'onreboot' + +#============================================================================ diff --git a/xu-11841-svm-interrupt-delivery.diff b/xu-11841-svm-interrupt-delivery.diff new file mode 100644 index 0000000..27a5850 --- /dev/null +++ b/xu-11841-svm-interrupt-delivery.diff @@ -0,0 +1,75 @@ +# HG changeset patch +# User kfraser@localhost.localdomain +# Date Fri Oct 20 10:09:55 2006 +0100 +# Node ID 2fbf11ad58f37313350e71f98f2eadb8ac37a8e4 +# parent: 02506a7443155611d6bbf03e49fbf193e96d24db +[HVM][SVM] Fix 1/2 to interrupt delivery logic. + +This patch uses the VINTR intercept to signal the hypervisor when a +guest can take an interrupt. When guest's interrupts are masked by +EFLAGS.IF or the guests are in an interrupt shadow, we create a 'fake' +virtual interrupt to inject while also enabling the VINTR intercept. +When the guest _can_ take interrupts, the hypervisor will #VMEXIT +on VINTR. The VINTR exit handler then clears the VINTR intercept bit +and clears the V_IRQ bit so that svm_intr_assist() can inject a +legitimate interrupt. + +Signed-off-by: Travis Betak +Signed-off-by: Wei Huang +Signed-off-by: Tom Woller + +Index: xen-3.0.3-testing/xen/arch/x86/hvm/svm/intr.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/svm/intr.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/svm/intr.c +@@ -43,7 +43,7 @@ + * to be suitable for SVM. + */ + +-static inline int svm_inject_extint(struct vcpu *v, int trap, int error_code) ++static inline int svm_inject_extint(struct vcpu *v, int trap) + { + struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb; + vintr_t intr; +@@ -87,6 +87,16 @@ asmlinkage void svm_intr_assist(void) + re_injecting = 1; + } + ++ /* ++ * create a 'fake' virtual interrupt on to intercept as soon ++ * as the guest _can_ take interrupts ++ */ ++ if (irq_masked(vmcb->rflags) || vmcb->interrupt_shadow) { ++ vmcb->general1_intercepts |= GENERAL1_INTERCEPT_VINTR; ++ svm_inject_extint(v, 0x0); /* actual vector doesn't really matter */ ++ return; ++ } ++ + /* Guest's interrputs masked? */ + rflags = vmcb->rflags; + if (irq_masked(rflags)) { +@@ -146,7 +156,7 @@ asmlinkage void svm_intr_assist(void) + } + /* let's inject this interrupt */ + TRACE_3D(TRC_VMX_INT, v->domain->domain_id, intr_vector, 0); +- svm_inject_extint(v, intr_vector, VMX_DELIVER_NO_ERROR_CODE); ++ svm_inject_extint(v, intr_vector); + hvm_interrupt_post(v, intr_vector, intr_type); + break; + case APIC_DM_SMI: +Index: xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/svm/svm.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c +@@ -2802,6 +2802,11 @@ asmlinkage void svm_vmexit_handler(struc + svm_inject_exception(v, TRAP_double_fault, 1, 0); + break; + ++ case VMEXIT_VINTR: ++ vmcb->vintr.fields.irq = 0; ++ vmcb->general1_intercepts &= ~GENERAL1_INTERCEPT_VINTR; ++ break; ++ + case VMEXIT_INTR: + break; + diff --git a/xu-11842-svm-interrupt-delivery.diff b/xu-11842-svm-interrupt-delivery.diff new file mode 100644 index 0000000..44c0aa5 --- /dev/null +++ b/xu-11842-svm-interrupt-delivery.diff @@ -0,0 +1,121 @@ +# HG changeset patch +# User kfraser@localhost.localdomain +# Date Fri Oct 20 10:10:36 2006 +0100 +# Node ID c436ab500c9988f3a295f66b690ad7a98c16b54f +# parent: 2fbf11ad58f37313350e71f98f2eadb8ac37a8e4 +[HVM][SVM] Fix 2/2 to nterrupt delivery logic. + +Add flag to indicate that an exception event needs injecting, and to +delay the ext interrupt injection. +Remove unnecessary check of RFLAGS.IF for ExtInt injection. + +Signed-off-by: Travis Betak +Signed-off-by: Wei Huang +Signed-off-by: Tom Woller + +Index: xen-3.0.3-testing/xen/arch/x86/hvm/svm/intr.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/svm/intr.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/svm/intr.c +@@ -62,7 +62,7 @@ static inline int svm_inject_extint(stru + // printf( "IRQ = %d\n", trap ); + return 0; + } +- ++ + asmlinkage void svm_intr_assist(void) + { + struct vcpu *v = current; +@@ -74,7 +74,6 @@ asmlinkage void svm_intr_assist(void) + int intr_type = APIC_DM_EXTINT; + int intr_vector = -1; + int re_injecting = 0; +- unsigned long rflags; + + ASSERT(vmcb); + +@@ -82,12 +81,19 @@ asmlinkage void svm_intr_assist(void) + /* Previous Interrupt delivery caused this Intercept? */ + if (vmcb->exitintinfo.fields.v && (vmcb->exitintinfo.fields.type == 0)) { + v->arch.hvm_svm.saved_irq_vector = vmcb->exitintinfo.fields.vector; +-// printk("Injecting PF#: saving IRQ from ExitInfo\n"); + vmcb->exitintinfo.bytes = 0; + re_injecting = 1; + } + + /* ++ * If event requires injecting then do not inject int. ++ */ ++ if (unlikely(v->arch.hvm_svm.inject_event)) { ++ v->arch.hvm_svm.inject_event = 0; ++ return; ++ } ++ ++ /* + * create a 'fake' virtual interrupt on to intercept as soon + * as the guest _can_ take interrupts + */ +@@ -97,14 +103,6 @@ asmlinkage void svm_intr_assist(void) + return; + } + +- /* Guest's interrputs masked? */ +- rflags = vmcb->rflags; +- if (irq_masked(rflags)) { +- HVM_DBG_LOG(DBG_LEVEL_1, "Guest IRQs masked: rflags: %lx", rflags); +- /* bail out, we won't be injecting an interrupt this time */ +- return; +- } +- + /* Previous interrupt still pending? */ + if (vmcb->vintr.fields.irq) { + // printk("Re-injecting IRQ from Vintr\n"); +@@ -157,7 +155,6 @@ asmlinkage void svm_intr_assist(void) + /* let's inject this interrupt */ + TRACE_3D(TRC_VMX_INT, v->domain->domain_id, intr_vector, 0); + svm_inject_extint(v, intr_vector); +- hvm_interrupt_post(v, intr_vector, intr_type); + break; + case APIC_DM_SMI: + case APIC_DM_NMI: +@@ -168,6 +165,7 @@ asmlinkage void svm_intr_assist(void) + BUG(); + break; + } ++ hvm_interrupt_post(v, intr_vector, intr_type); + } + } + +Index: xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/svm/svm.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c +@@ -196,6 +196,7 @@ static inline void svm_inject_exception( + ASSERT(vmcb->eventinj.fields.v == 0); + + vmcb->eventinj = event; ++ v->arch.hvm_svm.inject_event=1; + } + + static void stop_svm(void) +@@ -2589,7 +2590,7 @@ asmlinkage void svm_vmexit_handler(struc + save_svm_cpu_user_regs(v, regs); + + vmcb->tlb_control = 1; +- ++ v->arch.hvm_svm.inject_event = 0; + + if (exit_reason == VMEXIT_INVALID) + { +Index: xen-3.0.3-testing/xen/include/asm-x86/hvm/svm/vmcb.h +=================================================================== +--- xen-3.0.3-testing.orig/xen/include/asm-x86/hvm/svm/vmcb.h ++++ xen-3.0.3-testing/xen/include/asm-x86/hvm/svm/vmcb.h +@@ -484,6 +484,7 @@ struct arch_svm_struct { + u32 *msrpm; + u64 vmexit_tsc; /* tsc read at #VMEXIT. for TSC_OFFSET */ + int saved_irq_vector; ++ u32 inject_event; + u32 launch_core; + u32 asid_core; + diff --git a/xu-11843-svm-no-double-nmi.diff b/xu-11843-svm-no-double-nmi.diff new file mode 100644 index 0000000..6da9ae1 --- /dev/null +++ b/xu-11843-svm-no-double-nmi.diff @@ -0,0 +1,33 @@ +# HG changeset patch +# User kfraser@localhost.localdomain +# Date Fri Oct 20 10:11:45 2006 +0100 +# Node ID 899836e04387bec0fc9f7c080e03ca9c4b9b11fd +# parent: c436ab500c9988f3a295f66b690ad7a98c16b54f +[HVM][SVM] Avoid double-execution of NMI handler. + +Remove the do_nmi() call from the vmexit logic, as the NMI is held +pending and will be handled in the context of the host when the STGI +instruction is executed. + +Signed-off-by: Tom Woller + +Index: xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/svm/svm.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c +@@ -54,7 +54,6 @@ + + /* External functions. We should move these to some suitable header file(s) */ + +-extern void do_nmi(struct cpu_user_regs *, unsigned long); + extern int inst_copy_from_guest(unsigned char *buf, unsigned long guest_eip, + int inst_len); + extern uint32_t vlapic_update_ppr(struct vlapic *vlapic); +@@ -2730,7 +2729,6 @@ asmlinkage void svm_vmexit_handler(struc + break; + + case VMEXIT_NMI: +- do_nmi(regs, 0); + break; + + case VMEXIT_SMI: diff --git a/xu-11847-pv-hvm.diff b/xu-11847-pv-hvm.diff new file mode 100644 index 0000000..61426cc --- /dev/null +++ b/xu-11847-pv-hvm.diff @@ -0,0 +1,74 @@ +# HG changeset patch +# User kfraser@localhost.localdomain +# Date Fri Oct 20 10:58:15 2006 +0100 +# Node ID dde8c8038e174ecd8a3ee2f289008465b036d5f8 +# parent: 16f1f8ac89024de4a2d5399411d703e281f40c49 +Allow default target architecture of PV-on-HVM drivers to be overridden. +Signed-off-by: Travis Betak + +--- a/unmodified_drivers/linux-2.6/mkbuildtree Fri Oct 20 10:48:34 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/mkbuildtree Fri Oct 20 10:58:15 2006 +0100 +@@ -1,4 +1,12 @@ + #! /bin/sh ++ ++if [ $1 ]; then ++ uname="$1" ++else ++ uname=`uname -m` ++ echo "Defaulting to this machine's architecture, $uname, for linking." ++ echo "This may be overridden on the command line (i386,x86_64,ia64)." ++fi + + C=$PWD + +@@ -26,30 +34,29 @@ ln -sf ${XEN}/include/public include/xen + # Need to be quite careful here: we don't want the files we link in to + # risk overriding the native Linux ones (in particular, system.h must + # be native and not xenolinux). +-uname=`uname -m` + case "$uname" + in + "x86_64") +- ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/hypervisor.h include/asm +- ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/hypercall.h include/asm +- ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/synch_bitops.h include/asm +- ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/maddr.h include/asm +- ln -sf ${XL}/include/asm-i386 include/asm-i386 +- ;; ++ ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/hypervisor.h include/asm ++ ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/hypercall.h include/asm ++ ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/synch_bitops.h include/asm ++ ln -sf ${XL}/include/asm-x86_64/mach-xen/asm/maddr.h include/asm ++ ln -sf ${XL}/include/asm-i386 include/asm-i386 ++ ;; + i[34567]86) +- ln -sf ${XL}/include/asm-i386/mach-xen/asm/hypervisor.h include/asm +- ln -sf ${XL}/include/asm-i386/mach-xen/asm/hypercall.h include/asm +- ln -sf ${XL}/include/asm-i386/mach-xen/asm/synch_bitops.h include/asm +- ln -sf ${XL}/include/asm-i386/mach-xen/asm/maddr.h include/asm +- ;; ++ ln -sf ${XL}/include/asm-i386/mach-xen/asm/hypervisor.h include/asm ++ ln -sf ${XL}/include/asm-i386/mach-xen/asm/hypercall.h include/asm ++ ln -sf ${XL}/include/asm-i386/mach-xen/asm/synch_bitops.h include/asm ++ ln -sf ${XL}/include/asm-i386/mach-xen/asm/maddr.h include/asm ++ ;; + "ia64") +- ln -sf ${XL}/include/asm-ia64/hypervisor.h include/asm +- ln -sf ${XL}/include/asm-ia64/hypercall.h include/asm +- ln -sf ${XL}/include/asm-ia64/synch_bitops.h include/asm +- ln -sf ${XL}/include/asm-ia64/maddr.h include/asm +- ;; ++ ln -sf ${XL}/include/asm-ia64/hypervisor.h include/asm ++ ln -sf ${XL}/include/asm-ia64/hypercall.h include/asm ++ ln -sf ${XL}/include/asm-ia64/synch_bitops.h include/asm ++ ln -sf ${XL}/include/asm-ia64/maddr.h include/asm ++ ;; + *) +- echo unknown architecture $uname +- exit 1 +- ;; ++ echo unknown architecture $uname ++ exit 1 ++ ;; + esac + diff --git a/xu-11888-pv-hvm.diff b/xu-11888-pv-hvm.diff new file mode 100644 index 0000000..29fa92b --- /dev/null +++ b/xu-11888-pv-hvm.diff @@ -0,0 +1,45 @@ +# HG changeset patch +# User kfraser@localhost.localdomain +# Date Wed Oct 25 10:59:00 2006 +0100 +# Node ID ffbd9e4668a6cfd3c936c7344c194afe368f2642 +# parent: 4be49a3be040f0951a9be971e9b4cf0a399589ec +[BLOCK] blkback: Fix potential grant entry leaks on error + +As it stands grant entries for the actual data are mapped in bulk. +If one of the earlier entries fail to be mapped, it can cause all +subsequent entries to be leaked if they were successfully mapped. + +This patch changes it so that we will continue to reap grant entries +even when an error is detected. + +Signed-off-by: Herbert Xu + +--- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c Wed Oct 25 10:56:50 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c Wed Oct 25 10:59:00 2006 +0100 +@@ -392,16 +392,24 @@ static void dispatch_rw_block_io(blkif_t + for (i = 0; i < nseg; i++) { + if (unlikely(map[i].status != 0)) { + DPRINTK("invalid buffer -- could not remap it\n"); +- goto fail_flush; ++ map[i].handle = BLKBACK_INVALID_HANDLE; ++ ret |= 1; + } + + pending_handle(pending_req, i) = map[i].handle; ++ ++ if (ret) ++ continue; ++ + set_phys_to_machine(__pa(vaddr( + pending_req, i)) >> PAGE_SHIFT, + FOREIGN_FRAME(map[i].dev_bus_addr >> PAGE_SHIFT)); + seg[i].buf = map[i].dev_bus_addr | + (req->seg[i].first_sect << 9); + } ++ ++ if (ret) ++ goto fail_flush; + + if (vbd_translate(&preq, blkif, operation) != 0) { + DPRINTK("access denied: %s of [%llu,%llu] on dev=%04x\n", + diff --git a/xu-11896-pv-hvm.diff b/xu-11896-pv-hvm.diff new file mode 100644 index 0000000..a205daf --- /dev/null +++ b/xu-11896-pv-hvm.diff @@ -0,0 +1,65 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID e715360e82f8d8aa72356fc77df7f4e564a97062 +# parent: 041507e2754cda7a21bb878f703daee47cbe843e +[LINUX] PV-on-HVM: Directly include headers which are used in various +files rather than relying on them being included indirectly. + +This is required because these headers are not pulled in indirectly on +older kernels. + +Signed-off-by: Ian Campbell + +--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c Wed Oct 25 12:30:08 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c Wed Oct 25 13:58:30 2006 +0100 +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + + #include "xenbus_comms.h" + +--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 12:30:08 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 +@@ -42,6 +42,7 @@ + #include + #include + #include ++#include + + #include + #include +--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c Wed Oct 25 12:30:08 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c Wed Oct 25 13:58:30 2006 +0100 +@@ -42,6 +42,8 @@ + #include + #include + #include ++#include ++#include + #include + #include "xenbus_comms.h" + +--- a/linux-2.6-xen-sparse/include/xen/xenbus.h Wed Oct 25 12:30:08 2006 +0100 ++++ b/linux-2.6-xen-sparse/include/xen/xenbus.h Wed Oct 25 13:58:30 2006 +0100 +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + #include + #include + #include +--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c Wed Oct 25 12:30:08 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c Wed Oct 25 13:58:30 2006 +0100 +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + #include + #include + + diff --git a/xu-11897-pv-hvm.diff b/xu-11897-pv-hvm.diff new file mode 100644 index 0000000..b6344f6 --- /dev/null +++ b/xu-11897-pv-hvm.diff @@ -0,0 +1,40 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID 266aef9b0386b0742e05893e24e09375b31bf835 +# parent: e715360e82f8d8aa72356fc77df7f4e564a97062 +PV-on-HVM: Include a Makefile in each subdirectory to maintain +compatability with kernels from before Kbuild files were introduced. + +This follows best practice as described in +Documentation/kbuild/modules.txt + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/unmodified_drivers/linux-2.6/blkfront/Makefile Wed Oct 25 13:58:30 2006 +0100 +@@ -0,0 +1,3 @@ ++ifneq ($(KERNELRELEASE),) ++include $(src)/Kbuild ++endif +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/unmodified_drivers/linux-2.6/netfront/Makefile Wed Oct 25 13:58:30 2006 +0100 +@@ -0,0 +1,3 @@ ++ifneq ($(KERNELRELEASE),) ++include $(src)/Kbuild ++endif +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/unmodified_drivers/linux-2.6/platform-pci/Makefile Wed Oct 25 13:58:30 2006 +0100 +@@ -0,0 +1,3 @@ ++ifneq ($(KERNELRELEASE),) ++include $(src)/Kbuild ++endif +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/unmodified_drivers/linux-2.6/xenbus/Makefile Wed Oct 25 13:58:30 2006 +0100 +@@ -0,0 +1,3 @@ ++ifneq ($(KERNELRELEASE),) ++include $(src)/Kbuild ++endif + diff --git a/xu-11898-pv-hvm.diff b/xu-11898-pv-hvm.diff new file mode 100644 index 0000000..15298fa --- /dev/null +++ b/xu-11898-pv-hvm.diff @@ -0,0 +1,764 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID 47cc7392741ad120a0c5745f7aeaf00a1aefd538 +# parent: 266aef9b0386b0742e05893e24e09375b31bf835 +[LINUX] Move xenbus backend probing into a separate source file and +only build it when CONFIG_XEN_BACKEND is set. + +This removes unused code from frontend only configurations and also +makes PV-on-HVM drivers on older kernels simpler by removing code +which would otherwise require extra code in the compatability shim. + +Signed-off-by: Ian Campbell + +--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/Makefile Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/Makefile Wed Oct 25 13:58:30 2006 +0100 +@@ -9,4 +9,5 @@ xenbus-objs += xenbus_comms.o + xenbus-objs += xenbus_comms.o + xenbus-objs += xenbus_xs.o + xenbus-objs += xenbus_probe.o ++obj-$(CONFIG_XEN_BACKEND) += xenbus_probe_backend.o + obj-$(CONFIG_XEN_XENBUS_DEV) += xenbus_dev.o +--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 +@@ -56,6 +56,7 @@ + #include + + #include "xenbus_comms.h" ++#include "xenbus_probe.h" + + int xen_store_evtchn; + struct xenstore_domain_interface *xen_store_interface; +@@ -68,12 +69,7 @@ static void wait_for_devices(struct xenb + static void wait_for_devices(struct xenbus_driver *xendrv); + + static int xenbus_probe_frontend(const char *type, const char *name); +-static int xenbus_uevent_backend(struct device *dev, char **envp, +- int num_envp, char *buffer, int buffer_size); +-static int xenbus_probe_backend(const char *type, const char *domid); +- +-static int xenbus_dev_probe(struct device *_dev); +-static int xenbus_dev_remove(struct device *_dev); ++ + static void xenbus_dev_shutdown(struct device *_dev); + + /* If something in array of ids matches this device, return it. */ +@@ -87,7 +83,7 @@ match_device(const struct xenbus_device_ + return NULL; + } + +-static int xenbus_match(struct device *_dev, struct device_driver *_drv) ++int xenbus_match(struct device *_dev, struct device_driver *_drv) + { + struct xenbus_driver *drv = to_xenbus_driver(_drv); + +@@ -96,17 +92,6 @@ static int xenbus_match(struct device *_ + + return match_device(drv->ids, to_xenbus_device(_dev)) != NULL; + } +- +-struct xen_bus_type +-{ +- char *root; +- unsigned int levels; +- int (*get_bus_id)(char bus_id[BUS_ID_SIZE], const char *nodename); +- int (*probe)(const char *type, const char *dir); +- struct bus_type bus; +- struct device dev; +-}; +- + + /* device// => - */ + static int frontend_bus_id(char bus_id[BUS_ID_SIZE], const char *nodename) +@@ -144,7 +129,7 @@ static void free_otherend_watch(struct x + } + + +-static int read_otherend_details(struct xenbus_device *xendev, ++int read_otherend_details(struct xenbus_device *xendev, + char *id_node, char *path_node) + { + int err = xenbus_gather(XBT_NIL, xendev->nodename, +@@ -174,12 +159,6 @@ static int read_backend_details(struct x + static int read_backend_details(struct xenbus_device *xendev) + { + return read_otherend_details(xendev, "backend-id", "backend"); +-} +- +- +-static int read_frontend_details(struct xenbus_device *xendev) +-{ +- return read_otherend_details(xendev, "frontend-id", "frontend"); + } + + +@@ -201,106 +180,6 @@ static struct xen_bus_type xenbus_fronte + }, + }; + +-/* backend/// => -- */ +-static int backend_bus_id(char bus_id[BUS_ID_SIZE], const char *nodename) +-{ +- int domid, err; +- const char *devid, *type, *frontend; +- unsigned int typelen; +- +- type = strchr(nodename, '/'); +- if (!type) +- return -EINVAL; +- type++; +- typelen = strcspn(type, "/"); +- if (!typelen || type[typelen] != '/') +- return -EINVAL; +- +- devid = strrchr(nodename, '/') + 1; +- +- err = xenbus_gather(XBT_NIL, nodename, "frontend-id", "%i", &domid, +- "frontend", NULL, &frontend, +- NULL); +- if (err) +- return err; +- if (strlen(frontend) == 0) +- err = -ERANGE; +- if (!err && !xenbus_exists(XBT_NIL, frontend, "")) +- err = -ENOENT; +- +- kfree(frontend); +- +- if (err) +- return err; +- +- if (snprintf(bus_id, BUS_ID_SIZE, +- "%.*s-%i-%s", typelen, type, domid, devid) >= BUS_ID_SIZE) +- return -ENOSPC; +- return 0; +-} +- +-static struct xen_bus_type xenbus_backend = { +- .root = "backend", +- .levels = 3, /* backend/type// */ +- .get_bus_id = backend_bus_id, +- .probe = xenbus_probe_backend, +- .bus = { +- .name = "xen-backend", +- .match = xenbus_match, +- .probe = xenbus_dev_probe, +- .remove = xenbus_dev_remove, +-// .shutdown = xenbus_dev_shutdown, +- .uevent = xenbus_uevent_backend, +- }, +- .dev = { +- .bus_id = "xen-backend", +- }, +-}; +- +-static int xenbus_uevent_backend(struct device *dev, char **envp, +- int num_envp, char *buffer, int buffer_size) +-{ +- struct xenbus_device *xdev; +- struct xenbus_driver *drv; +- int i = 0; +- int length = 0; +- +- DPRINTK(""); +- +- if (dev == NULL) +- return -ENODEV; +- +- xdev = to_xenbus_device(dev); +- if (xdev == NULL) +- return -ENODEV; +- +- /* stuff we want to pass to /sbin/hotplug */ +- add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length, +- "XENBUS_TYPE=%s", xdev->devicetype); +- +- add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length, +- "XENBUS_PATH=%s", xdev->nodename); +- +- add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length, +- "XENBUS_BASE_PATH=%s", xenbus_backend.root); +- +- /* terminate, set to next free slot, shrink available space */ +- envp[i] = NULL; +- envp = &envp[i]; +- num_envp -= i; +- buffer = &buffer[length]; +- buffer_size -= length; +- +- if (dev->driver) { +- drv = to_xenbus_driver(dev->driver); +- if (drv && drv->uevent) +- return drv->uevent(xdev, envp, num_envp, buffer, +- buffer_size); +- } +- +- return 0; +-} +- + static void otherend_changed(struct xenbus_watch *watch, + const char **vec, unsigned int len) + { +@@ -360,7 +239,7 @@ static int watch_otherend(struct xenbus_ + } + + +-static int xenbus_dev_probe(struct device *_dev) ++int xenbus_dev_probe(struct device *_dev) + { + struct xenbus_device *dev = to_xenbus_device(_dev); + struct xenbus_driver *drv = to_xenbus_driver(_dev->driver); +@@ -407,7 +286,7 @@ fail: + return -ENODEV; + } + +-static int xenbus_dev_remove(struct device *_dev) ++int xenbus_dev_remove(struct device *_dev) + { + struct xenbus_device *dev = to_xenbus_device(_dev); + struct xenbus_driver *drv = to_xenbus_driver(_dev->driver); +@@ -445,8 +324,8 @@ static void xenbus_dev_shutdown(struct d + put_device(&dev->dev); + } + +-static int xenbus_register_driver_common(struct xenbus_driver *drv, +- struct xen_bus_type *bus) ++int xenbus_register_driver_common(struct xenbus_driver *drv, ++ struct xen_bus_type *bus) + { + int ret; + +@@ -476,14 +355,6 @@ int xenbus_register_frontend(struct xenb + return 0; + } + EXPORT_SYMBOL_GPL(xenbus_register_frontend); +- +-int xenbus_register_backend(struct xenbus_driver *drv) +-{ +- drv->read_otherend_details = read_frontend_details; +- +- return xenbus_register_driver_common(drv, &xenbus_backend); +-} +-EXPORT_SYMBOL_GPL(xenbus_register_backend); + + void xenbus_unregister_driver(struct xenbus_driver *drv) + { +@@ -596,9 +467,9 @@ DEVICE_ATTR(devtype, S_IRUSR | S_IRGRP | + DEVICE_ATTR(devtype, S_IRUSR | S_IRGRP | S_IROTH, xendev_show_devtype, NULL); + + +-static int xenbus_probe_node(struct xen_bus_type *bus, +- const char *type, +- const char *nodename) ++int xenbus_probe_node(struct xen_bus_type *bus, ++ const char *type, ++ const char *nodename) + { + int err; + struct xenbus_device *xendev; +@@ -668,55 +539,6 @@ static int xenbus_probe_frontend(const c + return err; + } + +-/* backend/// */ +-static int xenbus_probe_backend_unit(const char *dir, +- const char *type, +- const char *name) +-{ +- char *nodename; +- int err; +- +- nodename = kasprintf("%s/%s", dir, name); +- if (!nodename) +- return -ENOMEM; +- +- DPRINTK("%s\n", nodename); +- +- err = xenbus_probe_node(&xenbus_backend, type, nodename); +- kfree(nodename); +- return err; +-} +- +-/* backend// */ +-static int xenbus_probe_backend(const char *type, const char *domid) +-{ +- char *nodename; +- int err = 0; +- char **dir; +- unsigned int i, dir_n = 0; +- +- DPRINTK(""); +- +- nodename = kasprintf("%s/%s/%s", xenbus_backend.root, type, domid); +- if (!nodename) +- return -ENOMEM; +- +- dir = xenbus_directory(XBT_NIL, nodename, "", &dir_n); +- if (IS_ERR(dir)) { +- kfree(nodename); +- return PTR_ERR(dir); +- } +- +- for (i = 0; i < dir_n; i++) { +- err = xenbus_probe_backend_unit(nodename, type, dir[i]); +- if (err) +- break; +- } +- kfree(dir); +- kfree(nodename); +- return err; +-} +- + static int xenbus_probe_device_type(struct xen_bus_type *bus, const char *type) + { + int err = 0; +@@ -737,7 +559,7 @@ static int xenbus_probe_device_type(stru + return err; + } + +-static int xenbus_probe_devices(struct xen_bus_type *bus) ++int xenbus_probe_devices(struct xen_bus_type *bus) + { + int err = 0; + char **dir; +@@ -779,7 +601,7 @@ static int strsep_len(const char *str, c + return (len == 0) ? i : -ERANGE; + } + +-static void dev_changed(const char *node, struct xen_bus_type *bus) ++void dev_changed(const char *node, struct xen_bus_type *bus) + { + int exists, rootlen; + struct xenbus_device *dev; +@@ -824,23 +646,10 @@ static void frontend_changed(struct xenb + dev_changed(vec[XS_WATCH_PATH], &xenbus_frontend); + } + +-static void backend_changed(struct xenbus_watch *watch, +- const char **vec, unsigned int len) +-{ +- DPRINTK(""); +- +- dev_changed(vec[XS_WATCH_PATH], &xenbus_backend); +-} +- + /* We watch for devices appearing and vanishing. */ + static struct xenbus_watch fe_watch = { + .node = "device", + .callback = frontend_changed, +-}; +- +-static struct xenbus_watch be_watch = { +- .node = "backend", +- .callback = backend_changed, + }; + + static int suspend_dev(struct device *dev, void *data) +@@ -913,7 +722,7 @@ void xenbus_suspend(void) + DPRINTK(""); + + bus_for_each_dev(&xenbus_frontend.bus, NULL, NULL, suspend_dev); +- bus_for_each_dev(&xenbus_backend.bus, NULL, NULL, suspend_dev); ++ xenbus_backend_suspend(suspend_dev); + xs_suspend(); + } + EXPORT_SYMBOL_GPL(xenbus_suspend); +@@ -923,7 +732,7 @@ void xenbus_resume(void) + xb_init_comms(); + xs_resume(); + bus_for_each_dev(&xenbus_frontend.bus, NULL, NULL, resume_dev); +- bus_for_each_dev(&xenbus_backend.bus, NULL, NULL, resume_dev); ++ xenbus_backend_resume(resume_dev); + } + EXPORT_SYMBOL_GPL(xenbus_resume); + +@@ -956,13 +765,10 @@ void xenbus_probe(void *unused) + { + BUG_ON((xenstored_ready <= 0)); + +- /* Enumerate devices in xenstore. */ ++ /* Enumerate devices in xenstore and watch for changes. */ + xenbus_probe_devices(&xenbus_frontend); +- xenbus_probe_devices(&xenbus_backend); +- +- /* Watch for changes. */ + register_xenbus_watch(&fe_watch); +- register_xenbus_watch(&be_watch); ++ xenbus_backend_probe_and_watch(); + + /* Notify others that xenstore is up */ + notifier_call_chain(&xenstore_chain, 0, NULL); +@@ -1021,7 +827,7 @@ static int __init xenbus_probe_init(void + + /* Register ourselves with the kernel bus subsystem */ + bus_register(&xenbus_frontend.bus); +- bus_register(&xenbus_backend.bus); ++ xenbus_backend_bus_register(); + + /* + * Domain0 doesn't have a store_evtchn or store_mfn yet. +@@ -1092,7 +898,7 @@ static int __init xenbus_probe_init(void + + /* Register ourselves with the kernel device subsystem */ + device_register(&xenbus_frontend.dev); +- device_register(&xenbus_backend.dev); ++ xenbus_backend_device_register(); + + if (!is_initial_xendomain()) + xenbus_probe(NULL); +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.h Wed Oct 25 13:58:30 2006 +0100 +@@ -0,0 +1,77 @@ ++/****************************************************************************** ++ * xenbus_probe.h ++ * ++ * Talks to Xen Store to figure out what devices we have. ++ * ++ * Copyright (C) 2005 Rusty Russell, IBM Corporation ++ * Copyright (C) 2005 XenSource Ltd. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License version 2 ++ * as published by the Free Software Foundation; or, when distributed ++ * separately from the Linux kernel or incorporated into other ++ * software packages, subject to the following license: ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a copy ++ * of this source file (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, copy, modify, ++ * merge, publish, distribute, sublicense, and/or sell copies of the Software, ++ * and to permit persons to whom the Software is furnished to do so, subject to ++ * the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in ++ * all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS ++ * IN THE SOFTWARE. ++ */ ++ ++#ifndef _XENBUS_PROBE_H ++#define _XENBUS_PROBE_H ++ ++#ifdef CONFIG_XEN_BACKEND ++extern void xenbus_backend_suspend(int (*fn)(struct device *, void *)); ++extern void xenbus_backend_resume(int (*fn)(struct device *, void *)); ++extern void xenbus_backend_probe_and_watch(void); ++extern void xenbus_backend_bus_register(void); ++extern void xenbus_backend_device_register(void); ++#else ++static inline void xenbus_backend_suspend(int (*fn)(struct device *, void *)) {} ++static inline void xenbus_backend_resume(int (*fn)(struct device *, void *)) {} ++static inline void xenbus_backend_probe_and_watch(void) {} ++static inline void xenbus_backend_bus_register(void) {} ++static inline void xenbus_backend_device_register(void) {} ++#endif ++ ++struct xen_bus_type ++{ ++ char *root; ++ unsigned int levels; ++ int (*get_bus_id)(char bus_id[BUS_ID_SIZE], const char *nodename); ++ int (*probe)(const char *type, const char *dir); ++ struct bus_type bus; ++ struct device dev; ++}; ++ ++extern int xenbus_match(struct device *_dev, struct device_driver *_drv); ++extern int xenbus_dev_probe(struct device *_dev); ++extern int xenbus_dev_remove(struct device *_dev); ++extern int xenbus_register_driver_common(struct xenbus_driver *drv, ++ struct xen_bus_type *bus); ++extern int xenbus_probe_node(struct xen_bus_type *bus, ++ const char *type, ++ const char *nodename); ++extern int xenbus_probe_devices(struct xen_bus_type *bus); ++ ++extern void dev_changed(const char *node, struct xen_bus_type *bus); ++ ++/* Simplified asprintf. Probably belongs in lib */ ++extern char *kasprintf(const char *fmt, ...); ++ ++#endif ++ +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe_backend.c Wed Oct 25 13:58:30 2006 +0100 +@@ -0,0 +1,271 @@ ++/****************************************************************************** ++ * Talks to Xen Store to figure out what devices we have (backend half). ++ * ++ * Copyright (C) 2005 Rusty Russell, IBM Corporation ++ * Copyright (C) 2005 Mike Wray, Hewlett-Packard ++ * Copyright (C) 2005, 2006 XenSource Ltd ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License version 2 ++ * as published by the Free Software Foundation; or, when distributed ++ * separately from the Linux kernel or incorporated into other ++ * software packages, subject to the following license: ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a copy ++ * of this source file (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, copy, modify, ++ * merge, publish, distribute, sublicense, and/or sell copies of the Software, ++ * and to permit persons to whom the Software is furnished to do so, subject to ++ * the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in ++ * all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS ++ * IN THE SOFTWARE. ++ */ ++ ++#define DPRINTK(fmt, args...) \ ++ pr_debug("xenbus_probe (%s:%d) " fmt ".\n", \ ++ __FUNCTION__, __LINE__, ##args) ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "xenbus_comms.h" ++#include "xenbus_probe.h" ++ ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif ++ ++static int xenbus_uevent_backend(struct device *dev, char **envp, ++ int num_envp, char *buffer, int buffer_size); ++static int xenbus_probe_backend(const char *type, const char *domid); ++ ++extern int read_otherend_details(struct xenbus_device *xendev, ++ char *id_node, char *path_node); ++ ++static int read_frontend_details(struct xenbus_device *xendev) ++{ ++ return read_otherend_details(xendev, "frontend-id", "frontend"); ++} ++ ++/* backend/// => -- */ ++static int backend_bus_id(char bus_id[BUS_ID_SIZE], const char *nodename) ++{ ++ int domid, err; ++ const char *devid, *type, *frontend; ++ unsigned int typelen; ++ ++ type = strchr(nodename, '/'); ++ if (!type) ++ return -EINVAL; ++ type++; ++ typelen = strcspn(type, "/"); ++ if (!typelen || type[typelen] != '/') ++ return -EINVAL; ++ ++ devid = strrchr(nodename, '/') + 1; ++ ++ err = xenbus_gather(XBT_NIL, nodename, "frontend-id", "%i", &domid, ++ "frontend", NULL, &frontend, ++ NULL); ++ if (err) ++ return err; ++ if (strlen(frontend) == 0) ++ err = -ERANGE; ++ if (!err && !xenbus_exists(XBT_NIL, frontend, "")) ++ err = -ENOENT; ++ kfree(frontend); ++ ++ if (err) ++ return err; ++ ++ if (snprintf(bus_id, BUS_ID_SIZE, ++ "%.*s-%i-%s", typelen, type, domid, devid) >= BUS_ID_SIZE) ++ return -ENOSPC; ++ return 0; ++} ++ ++static struct xen_bus_type xenbus_backend = { ++ .root = "backend", ++ .levels = 3, /* backend/type// */ ++ .get_bus_id = backend_bus_id, ++ .probe = xenbus_probe_backend, ++ .bus = { ++ .name = "xen-backend", ++ .match = xenbus_match, ++ .probe = xenbus_dev_probe, ++ .remove = xenbus_dev_remove, ++// .shutdown = xenbus_dev_shutdown, ++ .uevent = xenbus_uevent_backend, ++ }, ++ .dev = { ++ .bus_id = "xen-backend", ++ }, ++}; ++ ++static int xenbus_uevent_backend(struct device *dev, char **envp, ++ int num_envp, char *buffer, int buffer_size) ++{ ++ struct xenbus_device *xdev; ++ struct xenbus_driver *drv; ++ int i = 0; ++ int length = 0; ++ ++ DPRINTK(""); ++ ++ if (dev == NULL) ++ return -ENODEV; ++ ++ xdev = to_xenbus_device(dev); ++ if (xdev == NULL) ++ return -ENODEV; ++ ++ /* stuff we want to pass to /sbin/hotplug */ ++ add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length, ++ "XENBUS_TYPE=%s", xdev->devicetype); ++ ++ add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length, ++ "XENBUS_PATH=%s", xdev->nodename); ++ ++ add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length, ++ "XENBUS_BASE_PATH=%s", xenbus_backend.root); ++ ++ /* terminate, set to next free slot, shrink available space */ ++ envp[i] = NULL; ++ envp = &envp[i]; ++ num_envp -= i; ++ buffer = &buffer[length]; ++ buffer_size -= length; ++ ++ if (dev->driver) { ++ drv = to_xenbus_driver(dev->driver); ++ if (drv && drv->uevent) ++ return drv->uevent(xdev, envp, num_envp, buffer, ++ buffer_size); ++ } ++ ++ return 0; ++} ++ ++int xenbus_register_backend(struct xenbus_driver *drv) ++{ ++ drv->read_otherend_details = read_frontend_details; ++ ++ return xenbus_register_driver_common(drv, &xenbus_backend); ++} ++EXPORT_SYMBOL_GPL(xenbus_register_backend); ++ ++/* backend/// */ ++static int xenbus_probe_backend_unit(const char *dir, ++ const char *type, ++ const char *name) ++{ ++ char *nodename; ++ int err; ++ ++ nodename = kasprintf("%s/%s", dir, name); ++ if (!nodename) ++ return -ENOMEM; ++ ++ DPRINTK("%s\n", nodename); ++ ++ err = xenbus_probe_node(&xenbus_backend, type, nodename); ++ kfree(nodename); ++ return err; ++} ++ ++/* backend// */ ++static int xenbus_probe_backend(const char *type, const char *domid) ++{ ++ char *nodename; ++ int err = 0; ++ char **dir; ++ unsigned int i, dir_n = 0; ++ ++ DPRINTK(""); ++ ++ nodename = kasprintf("%s/%s/%s", xenbus_backend.root, type, domid); ++ if (!nodename) ++ return -ENOMEM; ++ ++ dir = xenbus_directory(XBT_NIL, nodename, "", &dir_n); ++ if (IS_ERR(dir)) { ++ kfree(nodename); ++ return PTR_ERR(dir); ++ } ++ ++ for (i = 0; i < dir_n; i++) { ++ err = xenbus_probe_backend_unit(nodename, type, dir[i]); ++ if (err) ++ break; ++ } ++ kfree(dir); ++ kfree(nodename); ++ return err; ++} ++ ++static void backend_changed(struct xenbus_watch *watch, ++ const char **vec, unsigned int len) ++{ ++ DPRINTK(""); ++ ++ dev_changed(vec[XS_WATCH_PATH], &xenbus_backend); ++} ++ ++static struct xenbus_watch be_watch = { ++ .node = "backend", ++ .callback = backend_changed, ++}; ++ ++void xenbus_backend_suspend(int (*fn)(struct device *, void *)) ++{ ++ DPRINTK(""); ++ bus_for_each_dev(&xenbus_backend.bus, NULL, NULL, fn); ++} ++ ++void xenbus_backend_resume(int (*fn)(struct device *, void *)) ++{ ++ DPRINTK(""); ++ bus_for_each_dev(&xenbus_backend.bus, NULL, NULL, fn); ++} ++ ++void xenbus_backend_probe_and_watch(void) ++{ ++ xenbus_probe_devices(&xenbus_backend); ++ register_xenbus_watch(&be_watch); ++} ++ ++void xenbus_backend_bus_register(void) ++{ ++ bus_register(&xenbus_backend.bus); ++} ++ ++void xenbus_backend_device_register(void) ++{ ++ device_register(&xenbus_backend.dev); ++} + diff --git a/xu-11899-pv-hvm.diff b/xu-11899-pv-hvm.diff new file mode 100644 index 0000000..caedfe6 --- /dev/null +++ b/xu-11899-pv-hvm.diff @@ -0,0 +1,39 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID bd643d9db83860ca35ef53f9a3e584985c725c14 +# parent: 47cc7392741ad120a0c5745f7aeaf00a1aefd538 +[LINUX] PV-on-HVM: Remove the attr parameter from device attribute +show methods on kernels prior to 2.6.13. The parameter was not present +before that. + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 +@@ -453,14 +453,20 @@ char *kasprintf(const char *fmt, ...) + } + + static ssize_t xendev_show_nodename(struct device *dev, +- struct device_attribute *attr, char *buf) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) ++ struct device_attribute *attr, ++#endif ++ char *buf) + { + return sprintf(buf, "%s\n", to_xenbus_device(dev)->nodename); + } + DEVICE_ATTR(nodename, S_IRUSR | S_IRGRP | S_IROTH, xendev_show_nodename, NULL); + + static ssize_t xendev_show_devtype(struct device *dev, +- struct device_attribute *attr, char *buf) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) ++ struct device_attribute *attr, ++#endif ++ char *buf) + { + return sprintf(buf, "%s\n", to_xenbus_device(dev)->devicetype); + } + diff --git a/xu-11900-pv-hvm.diff b/xu-11900-pv-hvm.diff new file mode 100644 index 0000000..9ef1c8f --- /dev/null +++ b/xu-11900-pv-hvm.diff @@ -0,0 +1,34 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID 40107f658bd984190e14746f25dac750badf4d8c +# parent: bd643d9db83860ca35ef53f9a3e584985c725c14 +[LINUX] Exclude support for /proc/xen/xsd_kva when building a +non-privileged guest. + +This is useful for PV-on-HVM because it removes code which would +otherwise require extra code in the compatability shim. + +Signed-off-by: Ian Campbell + +--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 +@@ -781,7 +781,7 @@ void xenbus_probe(void *unused) + } + + +-#ifdef CONFIG_PROC_FS ++#if defined(CONFIG_PROC_FS) && defined(CONFIG_XEN_PRIVILEGED_GUEST) + static struct file_operations xsd_kva_fops; + static struct proc_dir_entry *xsd_kva_intf; + static struct proc_dir_entry *xsd_port_intf; +@@ -862,7 +862,7 @@ static int __init xenbus_probe_init(void + xen_store_evtchn = xen_start_info->store_evtchn = + alloc_unbound.port; + +-#ifdef CONFIG_PROC_FS ++#if defined(CONFIG_PROC_FS) && defined(CONFIG_XEN_PRIVILEGED_GUEST) + /* And finally publish the above info in /proc/xen */ + xsd_kva_intf = create_xen_proc_entry("xsd_kva", 0600); + if (xsd_kva_intf) { + diff --git a/xu-11901-pv-hvm.diff b/xu-11901-pv-hvm.diff new file mode 100644 index 0000000..d9224a5 --- /dev/null +++ b/xu-11901-pv-hvm.diff @@ -0,0 +1,26 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID 8102ccad440d3218a179e45c296e328aba564983 +# parent: 40107f658bd984190e14746f25dac750badf4d8c +[LINUX] PV-on-HVM: Only initialize the owner field of struct +device_driver on kernels from 2.6.10 onward. The field was not +available until then. + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 +@@ -331,7 +331,9 @@ int xenbus_register_driver_common(struct + + drv->driver.name = drv->name; + drv->driver.bus = &bus->bus; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10) + drv->driver.owner = drv->owner; ++#endif + + mutex_lock(&xenwatch_mutex); + ret = driver_register(&drv->driver); + diff --git a/xu-11902-pv-hvm.diff b/xu-11902-pv-hvm.diff new file mode 100644 index 0000000..caa7826 --- /dev/null +++ b/xu-11902-pv-hvm.diff @@ -0,0 +1,40 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID a0919d3f7d50dad3db4268611213a3923a497afd +# parent: 8102ccad440d3218a179e45c296e328aba564983 +[LINUX] PV-on-HVM: The probe, remove and shutdown methods were added +to struct bus_type in 2.6.16. For older kernels use the methods on the +struct device_driver. + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 +@@ -171,9 +171,11 @@ static struct xen_bus_type xenbus_fronte + .bus = { + .name = "xen", + .match = xenbus_match, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) + .probe = xenbus_dev_probe, + .remove = xenbus_dev_remove, + .shutdown = xenbus_dev_shutdown, ++#endif + }, + .dev = { + .bus_id = "xen", +@@ -333,6 +335,11 @@ int xenbus_register_driver_common(struct + drv->driver.bus = &bus->bus; + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10) + drv->driver.owner = drv->owner; ++#endif ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) ++ drv->driver.probe = xenbus_dev_probe; ++ drv->driver.remove = xenbus_dev_remove; ++ drv->driver.shutdown = xenbus_dev_shutdown; + #endif + + mutex_lock(&xenwatch_mutex); + diff --git a/xu-11903-pv-hvm.diff b/xu-11903-pv-hvm.diff new file mode 100644 index 0000000..150d139 --- /dev/null +++ b/xu-11903-pv-hvm.diff @@ -0,0 +1,55 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID 1c985a2e47eadc66e747443dfa65099e5f1dec86 +# parent: a0919d3f7d50dad3db4268611213a3923a497afd +[LINUX] PV-on-HVM: Implement HDIO_GETGEO ioctl on kernels before +2.6.16. + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c Wed Oct 25 13:58:30 2006 +0100 +@@ -468,6 +468,27 @@ int blkif_ioctl(struct inode *inode, str + command, (long)argument, inode->i_rdev); + + switch (command) { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) ++ case HDIO_GETGEO: { ++ struct block_device *bd = inode->i_bdev; ++ struct hd_geometry geo; ++ int ret; ++ ++ if (!argument) ++ return -EINVAL; ++ ++ geo.start = get_start_sect(bd); ++ ret = blkif_getgeo(bd, &geo); ++ if (ret) ++ return ret; ++ ++ if (copy_to_user((struct hd_geometry __user *)argument, &geo, ++ sizeof(geo))) ++ return -EFAULT; ++ ++ return 0; ++ } ++#endif + case CDROMMULTISESSION: + DPRINTK("FIXME: support multisession CDs later\n"); + for (i = 0; i < sizeof(struct cdrom_multisession); i++) +--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c Wed Oct 25 13:58:30 2006 +0100 +@@ -91,7 +91,9 @@ static struct block_device_operations xl + .open = blkif_open, + .release = blkif_release, + .ioctl = blkif_ioctl, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) + .getgeo = blkif_getgeo ++#endif + }; + + DEFINE_SPINLOCK(blkif_io_lock); + diff --git a/xu-11904-pv-hvm.diff b/xu-11904-pv-hvm.diff new file mode 100644 index 0000000..df9e6d0 --- /dev/null +++ b/xu-11904-pv-hvm.diff @@ -0,0 +1,26 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID db23596992f9388fb776a4518ae638b22ee7c8c2 +# parent: 1c985a2e47eadc66e747443dfa65099e5f1dec86 +[LINUX] PV-on-HVM: The elevator_init prototype changed in 2.6.10 + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c Wed Oct 25 13:58:30 2006 +0100 +@@ -188,7 +188,11 @@ xlvbd_init_blk_queue(struct gendisk *gd, + if (rq == NULL) + return -1; + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10) + elevator_init(rq, "noop"); ++#else ++ elevator_init(rq, &elevator_noop); ++#endif + + /* Hard sector size and max sectors impersonate the equiv. hardware. */ + blk_queue_hardsect_size(rq, sector_size); + diff --git a/xu-11905-pv-hvm.diff b/xu-11905-pv-hvm.diff new file mode 100644 index 0000000..62cb258 --- /dev/null +++ b/xu-11905-pv-hvm.diff @@ -0,0 +1,230 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID 206e20b7b54e09394ed161006439ee2b75ecee5e +# parent: db23596992f9388fb776a4518ae638b22ee7c8c2 +PV-on-HVM: Add infrastructure for a compatibility shim in order to +support PV-on-HVM drivers for older kernel releases. + +The compatability code is included in the xen-platform-pci module +since this module underpins all the others. + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c Wed Oct 25 13:58:30 2006 +0100 +@@ -48,6 +48,10 @@ + #include + #include + ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif ++ + #define BLKIF_STATE_DISCONNECTED 0 + #define BLKIF_STATE_CONNECTED 1 + #define BLKIF_STATE_SUSPENDED 2 +--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c Wed Oct 25 13:58:30 2006 +0100 +@@ -35,6 +35,10 @@ + #include "block.h" + #include + #include ++ ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif + + #define BLKIF_MAJOR(dev) ((dev)>>8) + #define BLKIF_MINOR(dev) ((dev) & 0xff) +--- a/linux-2.6-xen-sparse/drivers/xen/core/features.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/core/features.c Wed Oct 25 13:58:30 2006 +0100 +@@ -10,6 +10,10 @@ + #include + #include + #include ++ ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif + + u8 xen_features[XENFEAT_NR_SUBMAPS * 32] __read_mostly; + /* Not a GPL symbol: used in ubiquitous macros, so too restrictive. */ +--- a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c Wed Oct 25 13:58:30 2006 +0100 +@@ -44,6 +44,10 @@ + #include + #include + ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif ++ + /* External tools reserve first few grant table entries. */ + #define NR_RESERVED_ENTRIES 8 + +--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Wed Oct 25 13:58:30 2006 +0100 +@@ -64,6 +64,10 @@ + #include + #include + ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif ++ + /* + * Mutually-exclusive module options to select receive data path: + * rx_copy : Packets are copied by network backend into local memory +--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c Wed Oct 25 13:58:30 2006 +0100 +@@ -34,6 +34,10 @@ + #include + #include + #include ++ ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif + + /* xenbus_probe.c */ + extern char *kasprintf(const char *fmt, ...); +--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c Wed Oct 25 13:58:30 2006 +0100 +@@ -39,6 +39,10 @@ + #include + #include "xenbus_comms.h" + ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif ++ + static int xenbus_irq; + + extern void xenbus_probe(void *); +--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c Wed Oct 25 13:58:30 2006 +0100 +@@ -49,6 +49,10 @@ + #include + #include + #include ++ ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif + + struct xenbus_dev_transaction { + struct list_head list; +--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Wed Oct 25 13:58:30 2006 +0100 +@@ -58,6 +58,10 @@ + #include "xenbus_comms.h" + #include "xenbus_probe.h" + ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif ++ + int xen_store_evtchn; + struct xenstore_domain_interface *xen_store_interface; + static unsigned long xen_store_mfn; +--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c Wed Oct 25 13:58:30 2006 +0100 +@@ -47,6 +47,10 @@ + #include + #include "xenbus_comms.h" + ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif ++ + /* xenbus_probe.c */ + extern char *kasprintf(const char *fmt, ...); + +--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/synch_bitops.h Wed Oct 25 13:58:30 2006 +0100 ++++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/synch_bitops.h Wed Oct 25 13:58:30 2006 +0100 +@@ -8,6 +8,10 @@ + */ + + #include ++ ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif + + #define ADDR (*(volatile long *) addr) + +--- a/unmodified_drivers/linux-2.6/overrides.mk Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/overrides.mk Wed Oct 25 13:58:30 2006 +0100 +@@ -9,4 +9,4 @@ EXTRA_CFLAGS += -DCONFIG_XEN_BLKDEV_GRAN + EXTRA_CFLAGS += -DCONFIG_XEN_BLKDEV_GRANT -DXEN_EVTCHN_MASK_OPS + EXTRA_CFLAGS += -DCONFIG_XEN_NETDEV_GRANT_RX -DCONFIG_XEN_NETDEV_GRANT_TX + EXTRA_CFLAGS += -D__XEN_INTERFACE_VERSION__=0x00030202 +-EXTRA_CFLAGS += -I$(M)/include ++EXTRA_CFLAGS += -I$(M)/include -I$(M)/compat-include -DHAVE_XEN_PLATFORM_COMPAT_H +--- a/unmodified_drivers/linux-2.6/platform-pci/Kbuild Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/platform-pci/Kbuild Wed Oct 25 13:58:30 2006 +0100 +@@ -4,4 +4,4 @@ obj-m := xen-platform-pci.o + + EXTRA_CFLAGS += -I$(M)/platform-pci + +-xen-platform-pci-objs := evtchn.o platform-pci.o gnttab.o xen_support.o features.o ++xen-platform-pci-objs := evtchn.o platform-pci.o gnttab.o xen_support.o features.o platform-compat.o +--- a/unmodified_drivers/linux-2.6/platform-pci/evtchn.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/platform-pci/evtchn.c Wed Oct 25 13:58:30 2006 +0100 +@@ -35,6 +35,10 @@ + #include + #include + #include "platform-pci.h" ++ ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif + + void *shared_info_area; + +--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c Wed Oct 25 13:58:30 2006 +0100 +@@ -39,6 +39,10 @@ + + #include "platform-pci.h" + ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif ++ + #define DRV_NAME "xen-platform-pci" + #define DRV_VERSION "0.10" + #define DRV_RELDATE "03/03/2005" +--- a/unmodified_drivers/linux-2.6/platform-pci/xen_support.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/platform-pci/xen_support.c Wed Oct 25 13:58:30 2006 +0100 +@@ -26,6 +26,10 @@ + #include + #include "platform-pci.h" + ++#ifdef HAVE_XEN_PLATFORM_COMPAT_H ++#include ++#endif ++ + void xen_machphys_update(unsigned long mfn, unsigned long pfn) + { + BUG(); +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 +@@ -0,0 +1,6 @@ ++#ifndef COMPAT_INCLUDE_XEN_PLATFORM_COMPAT_H ++#define COMPAT_INCLUDE_XEN_PLATFORM_COMPAT_H ++ ++#include ++ ++#endif +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 +@@ -0,0 +1,4 @@ ++#include ++#include ++ ++#include + diff --git a/xu-11906-pv-hvm.diff b/xu-11906-pv-hvm.diff new file mode 100644 index 0000000..301a747 --- /dev/null +++ b/xu-11906-pv-hvm.diff @@ -0,0 +1,25 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID d008b6b44f3c9bd7d7f49737fdc1c93370bf783d +# parent: 206e20b7b54e09394ed161006439ee2b75ecee5e +PV-on-HVM: Add a compatibility linux/io.h for kernels before 2.6.16 + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/unmodified_drivers/linux-2.6/compat-include/linux/io.h Wed Oct 25 13:58:30 2006 +0100 +@@ -0,0 +1,10 @@ ++#ifndef _LINUX_IO_H ++#define _LINUX_IO_H ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) ++#error "This version of Linux should not need compat linux/io.h" ++#endif ++ ++#include ++ ++#endif + diff --git a/xu-11907-pv-hvm.diff b/xu-11907-pv-hvm.diff new file mode 100644 index 0000000..41ac714 --- /dev/null +++ b/xu-11907-pv-hvm.diff @@ -0,0 +1,48 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID ecc1782f69680d94b7d2fe4283616e4890b55504 +# parent: d008b6b44f3c9bd7d7f49737fdc1c93370bf783d +PV-on-HVM: Add a compatibility linux/mutex.h for kernels before +2.6.16. This implements the new mutex type in terms of the old +semaphore type. + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/unmodified_drivers/linux-2.6/compat-include/linux/mutex.h Wed Oct 25 13:58:30 2006 +0100 +@@ -0,0 +1,31 @@ ++/* ++ * Copyright (c) 2006 Cisco Systems. All rights reserved. ++ * ++ * This file is released under the GPLv2. ++ */ ++ ++/* mutex compatibility for pre-2.6.16 kernels */ ++ ++#ifndef __LINUX_MUTEX_H ++#define __LINUX_MUTEX_H ++ ++#include ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) ++#error "This version of Linux should not need compat mutex.h" ++#endif ++ ++#include ++#include ++ ++#define mutex semaphore ++#define DEFINE_MUTEX(foo) DECLARE_MUTEX(foo) ++#define mutex_init(foo) init_MUTEX(foo) ++#define mutex_lock(foo) down(foo) ++#define mutex_lock_interruptible(foo) down_interruptible(foo) ++/* this function follows the spin_trylock() convention, so * ++ * it is negated to the down_trylock() return values! Be careful */ ++#define mutex_trylock(foo) !down_trylock(foo) ++#define mutex_unlock(foo) up(foo) ++ ++#endif /* __LINUX_MUTEX_H */ + diff --git a/xu-11908-pv-hvm.diff b/xu-11908-pv-hvm.diff new file mode 100644 index 0000000..d9170ff --- /dev/null +++ b/xu-11908-pv-hvm.diff @@ -0,0 +1,47 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID e09720caf72dbdc0fe0689c8e2bf8ace97abaae4 +# parent: ecc1782f69680d94b7d2fe4283616e4890b55504 +PV-on-HVM: Include compatability headers for asm/pgtable-no{pmd,pud}.h +for kernels before 2.6.11. + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/unmodified_drivers/linux-2.6/compat-include/asm-generic/pgtable-nopmd.h Wed Oct 25 13:58:30 2006 +0100 +@@ -0,0 +1,14 @@ ++#ifndef _PGTABLE_NOPMD_H ++#define _PGTABLE_NOPMD_H ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) ++#error "This version of Linux should not need compat pgtable-nopmd.h" ++#endif ++ ++#define pud_t pgd_t ++#define pud_offset(d, va) d ++#define pud_none(pud) 0 ++#define pud_present(pud) 1 ++#define PTRS_PER_PUD 1 ++ ++#endif /* _PGTABLE_NOPMD_H */ +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/unmodified_drivers/linux-2.6/compat-include/asm-generic/pgtable-nopud.h Wed Oct 25 13:58:30 2006 +0100 +@@ -0,0 +1,14 @@ ++#ifndef _PGTABLE_NOPUD_H ++#define _PGTABLE_NOPUD_H ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) ++#error "This version of Linux should not need compat pgtable-nopud.h" ++#endif ++ ++#define pud_t pgd_t ++#define pud_offset(d, va) d ++#define pud_none(pud) 0 ++#define pud_present(pud) 1 ++#define PTRS_PER_PUD 1 ++ ++#endif /* _PGTABLE_NOPUD_H */ + diff --git a/xu-11909-pv-hvm.diff b/xu-11909-pv-hvm.diff new file mode 100644 index 0000000..b03520e --- /dev/null +++ b/xu-11909-pv-hvm.diff @@ -0,0 +1,42 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID ded9d1ae21f794f924bb312077bab69f782f87b8 +# parent: e09720caf72dbdc0fe0689c8e2bf8ace97abaae4 +PV-to-HVM: Add compatibility definitions of various #defines when they +are not present in the kernel we are building against. + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 +@@ -3,4 +3,26 @@ + + #include + ++#include ++ ++#if defined(__LINUX_COMPILER_H) && !defined(__always_inline) ++#define __always_inline inline + #endif ++ ++#if defined(__LINUX_SPINLOCK_H) && !defined(DEFINE_SPINLOCK) ++#define DEFINE_SPINLOCK(x) spinlock_t x = SPIN_LOCK_UNLOCKED ++#endif ++ ++#if defined(_LINUX_INIT_H) && !defined(__init) ++#define __init ++#endif ++ ++#if defined(__LINUX_CACHE_H) && !defined(__read_mostly) ++#define __read_mostly ++#endif ++ ++#if defined(_LINUX_SKBUFF_H) && !defined(NET_IP_ALIGN) ++#define NET_IP_ALIGN 0 ++#endif ++ ++#endif + diff --git a/xu-11910-pv-hvm.diff b/xu-11910-pv-hvm.diff new file mode 100644 index 0000000..c682c85 --- /dev/null +++ b/xu-11910-pv-hvm.diff @@ -0,0 +1,22 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID f4b878188b5d521828d8120646ab1192ea5c8483 +# parent: ded9d1ae21f794f924bb312077bab69f782f87b8 +PV-to-HVM: Implement compatibility nonseekable_open as a nop on +kernels before 2.6.9 + +Signed-off-by: Ian Campbell + +--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 +@@ -25,4 +25,8 @@ + #define NET_IP_ALIGN 0 + #endif + ++#if defined(_LINUX_FS_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) ++#define nonseekable_open(inode, filp) /* Nothing to do */ + #endif ++ ++#endif + diff --git a/xu-11911-pv-hvm.diff b/xu-11911-pv-hvm.diff new file mode 100644 index 0000000..27605bd --- /dev/null +++ b/xu-11911-pv-hvm.diff @@ -0,0 +1,26 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID 5d2f91f9b2f09fc57d24ef44f3ce31a4f0a9adfb +# parent: f4b878188b5d521828d8120646ab1192ea5c8483 +PV-on-HVM: Define system_state as 1 (SYSTEM_RUNNING) on kernels prior +to 2.6.7. These kernels did not export the system_state variable to +modules. + +Signed-off-by: Ian Campbell + +--- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 +@@ -1,4 +1,11 @@ + #include + #include + ++#include ++ + #include ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7) ++static int system_state = 1; ++EXPORT_SYMBOL(system_state); ++#endif + diff --git a/xu-11912-pv-hvm.diff b/xu-11912-pv-hvm.diff new file mode 100644 index 0000000..33ec2cc --- /dev/null +++ b/xu-11912-pv-hvm.diff @@ -0,0 +1,39 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID 4dcf172e699e094bc772baa66b9dc93083332941 +# parent: 5d2f91f9b2f09fc57d24ef44f3ce31a4f0a9adfb +PV-on-HVM: Kernels prior to 2.6.8 did not export strcspn to modules +therefore implement our own and export it. + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 +@@ -9,3 +9,23 @@ static int system_state = 1; + static int system_state = 1; + EXPORT_SYMBOL(system_state); + #endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) ++size_t strcspn(const char *s, const char *reject) ++{ ++ const char *p; ++ const char *r; ++ size_t count = 0; ++ ++ for (p = s; *p != '\0'; ++p) { ++ for (r = reject; *r != '\0'; ++r) { ++ if (*p == *r) ++ return count; ++ } ++ ++count; ++ } ++ ++ return count; ++} ++EXPORT_SYMBOL(strcspn); ++#endif + diff --git a/xu-11913-pv-hvm.diff b/xu-11913-pv-hvm.diff new file mode 100644 index 0000000..0274dc6 --- /dev/null +++ b/xu-11913-pv-hvm.diff @@ -0,0 +1,48 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID ac6e4405ab6c363eae43fd7384b7dca975e9e28e +# parent: 4dcf172e699e094bc772baa66b9dc93083332941 +PV-on-HVM: Include compatability vmalloc_to_pfn for kernels before 2.6.10 + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 +@@ -29,4 +29,8 @@ + #define nonseekable_open(inode, filp) /* Nothing to do */ + #endif + ++#if defined(_LINUX_MM_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) ++unsigned long vmalloc_to_pfn(void *addr); + #endif ++ ++#endif +--- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 +@@ -1,6 +1,7 @@ + #include + #include + ++#include + #include + + #include +@@ -29,3 +30,14 @@ size_t strcspn(const char *s, const char + } + EXPORT_SYMBOL(strcspn); + #endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) ++/* ++ * Map a vmalloc()-space virtual address to the physical page frame number. ++ */ ++unsigned long vmalloc_to_pfn(void * vmalloc_addr) ++{ ++ return page_to_pfn(vmalloc_to_page(vmalloc_addr)); ++} ++EXPORT_SYMBOL(vmalloc_to_pfn); ++#endif + diff --git a/xu-11914-pv-hvm.diff b/xu-11914-pv-hvm.diff new file mode 100644 index 0000000..0866fa4 --- /dev/null +++ b/xu-11914-pv-hvm.diff @@ -0,0 +1,67 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID 0886fc73e787076a7ee2247e71da68f48d311e0b +# parent: ac6e4405ab6c363eae43fd7384b7dca975e9e28e +PV-on-HVM: Implement compatibilty version of wait_for_completion_timeout +for kernels before 2.6.11 + +Signed-off-by: Ian Campbell + +--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 +@@ -33,4 +33,8 @@ unsigned long vmalloc_to_pfn(void *addr) + unsigned long vmalloc_to_pfn(void *addr); + #endif + ++#if defined(__LINUX_COMPLETION_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) ++unsigned long wait_for_completion_timeout(struct completion *x, unsigned long timeout); + #endif ++ ++#endif +--- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 +@@ -3,6 +3,7 @@ + + #include + #include ++#include + + #include + +@@ -41,3 +42,34 @@ unsigned long vmalloc_to_pfn(void * vmal + } + EXPORT_SYMBOL(vmalloc_to_pfn); + #endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) ++unsigned long wait_for_completion_timeout(struct completion *x, unsigned long timeout) ++{ ++ might_sleep(); ++ ++ spin_lock_irq(&x->wait.lock); ++ if (!x->done) { ++ DECLARE_WAITQUEUE(wait, current); ++ ++ wait.flags |= WQ_FLAG_EXCLUSIVE; ++ __add_wait_queue_tail(&x->wait, &wait); ++ do { ++ __set_current_state(TASK_UNINTERRUPTIBLE); ++ spin_unlock_irq(&x->wait.lock); ++ timeout = schedule_timeout(timeout); ++ spin_lock_irq(&x->wait.lock); ++ if (!timeout) { ++ __remove_wait_queue(&x->wait, &wait); ++ goto out; ++ } ++ } while (!x->done); ++ __remove_wait_queue(&x->wait, &wait); ++ } ++ x->done--; ++out: ++ spin_unlock_irq(&x->wait.lock); ++ return timeout; ++} ++EXPORT_SYMBOL(wait_for_completion_timeout); ++#endif + diff --git a/xu-11915-pv-hvm.diff b/xu-11915-pv-hvm.diff new file mode 100644 index 0000000..b344cc5 --- /dev/null +++ b/xu-11915-pv-hvm.diff @@ -0,0 +1,34 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID d30a4d4ccd94c41f607e54d2c2233f9be909dda7 +# parent: 0886fc73e787076a7ee2247e71da68f48d311e0b +PV-on-HVM: Implement and export a compatibility version of do_exit(). +Kernels prior to 2.6.12 did not export do_exit(). + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 +@@ -73,3 +73,18 @@ out: + } + EXPORT_SYMBOL(wait_for_completion_timeout); + #endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) ++/* ++ fake do_exit using complete_and_exit ++ */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) ++asmlinkage NORET_TYPE void do_exit(long code) ++#else ++fastcall NORET_TYPE void do_exit(long code) ++#endif ++{ ++ complete_and_exit(NULL, code); ++} ++EXPORT_SYMBOL_GPL(do_exit); ++#endif + diff --git a/xu-11916-pv-hvm.diff b/xu-11916-pv-hvm.diff new file mode 100644 index 0000000..7b00c06 --- /dev/null +++ b/xu-11916-pv-hvm.diff @@ -0,0 +1,39 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID db0d3f22e149d832e722173fa0e037e574db5f37 +# parent: d30a4d4ccd94c41f607e54d2c2233f9be909dda7 +PV-to-HVM: Impletement compatibility version of +schedule_timeout_interruptible for kernels before 2.6.14 + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 +@@ -37,4 +37,8 @@ unsigned long wait_for_completion_timeou + unsigned long wait_for_completion_timeout(struct completion *x, unsigned long timeout); + #endif + ++#if defined(_LINUX_SCHED_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) ++signed long schedule_timeout_interruptible(signed long timeout); + #endif ++ ++#endif +--- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 +@@ -88,3 +88,12 @@ fastcall NORET_TYPE void do_exit(long co + } + EXPORT_SYMBOL_GPL(do_exit); + #endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) ++signed long schedule_timeout_interruptible(signed long timeout) ++{ ++ __set_current_state(TASK_INTERRUPTIBLE); ++ return schedule_timeout(timeout); ++} ++EXPORT_SYMBOL(schedule_timeout_interruptible); ++#endif + diff --git a/xu-11917-pv-hvm.diff b/xu-11917-pv-hvm.diff new file mode 100644 index 0000000..5deb22f --- /dev/null +++ b/xu-11917-pv-hvm.diff @@ -0,0 +1,54 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID 9f0b88aaf17076bcdc42dfef0870ba9f39e72f23 +# parent: db0d3f22e149d832e722173fa0e037e574db5f37 +PV-on-HVM: Include compatibility kzalloc implementation for kernels +before 2.6.14. + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 +@@ -41,4 +41,8 @@ signed long schedule_timeout_interruptib + signed long schedule_timeout_interruptible(signed long timeout); + #endif + ++#if defined(_LINUX_SLAB_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) ++void *kzalloc(size_t size, int flags); + #endif ++ ++#endif +--- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c Wed Oct 25 13:58:30 2006 +0100 +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + + #include + +@@ -97,3 +98,19 @@ signed long schedule_timeout_interruptib + } + EXPORT_SYMBOL(schedule_timeout_interruptible); + #endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) ++/** ++ * kzalloc - allocate memory. The memory is set to zero. ++ * @size: how many bytes of memory are required. ++ * @flags: the type of memory to allocate. ++ */ ++void *kzalloc(size_t size, int flags) ++{ ++ void *ret = kmalloc(size, flags); ++ if (ret) ++ memset(ret, 0, size); ++ return ret; ++} ++EXPORT_SYMBOL(kzalloc); ++#endif + diff --git a/xu-11918-pv-hvm.diff b/xu-11918-pv-hvm.diff new file mode 100644 index 0000000..ae53add --- /dev/null +++ b/xu-11918-pv-hvm.diff @@ -0,0 +1,24 @@ +# HG changeset patch +# User Ian Campbell +# Date Wed Oct 25 13:58:30 2006 +0100 +# Node ID fc68e3ef9139b5483649a6bfe87b83a8ce1e9f12 +# parent: 9f0b88aaf17076bcdc42dfef0870ba9f39e72f23 +PV-to-HVM: Add a compatibility define for the end_that_request_last +which changed prototype in 2.6.16. + +Signed-off-by: Ian Campbell +Signed-off-by: K. Y. Srinivasan +Signed-off-by: Tsunehisa Doi + +--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 ++++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 25 13:58:30 2006 +0100 +@@ -45,4 +45,8 @@ void *kzalloc(size_t size, int flags); + void *kzalloc(size_t size, int flags); + #endif + ++#if defined(_LINUX_BLKDEV_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) ++#define end_that_request_last(req, uptodate) end_that_request_last(req) + #endif ++ ++#endif + diff --git a/xu-11974-pv-hvm.diff b/xu-11974-pv-hvm.diff new file mode 100644 index 0000000..8219bb5 --- /dev/null +++ b/xu-11974-pv-hvm.diff @@ -0,0 +1,72 @@ +# HG changeset patch +# User awilliam@xenbuild.aw +# Date Sat Oct 14 16:28:32 2006 -0600 +# Node ID 7c2a5f96a192a07cc73991a52ff3ffd80658cf94 +# parent: 9e8fdcc46fa31a6e4f607c67e97f8a9d3fa0455c +[IA64] Xencomm fixes for HVM PV-drivers + +Signed-off-by: Tristan Gingold + + + +Index: xen-3.0.3-testing/unmodified_drivers/linux-2.6/mkbuildtree +=================================================================== +--- xen-3.0.3-testing.orig/unmodified_drivers/linux-2.6/mkbuildtree ++++ xen-3.0.3-testing/unmodified_drivers/linux-2.6/mkbuildtree +@@ -27,6 +27,7 @@ mkdir -p include + mkdir -p include/xen + mkdir -p include/public + mkdir -p include/asm ++mkdir -p include/asm/xen + + lndir -silent ${XL}/include/xen include/xen + ln -sf ${XEN}/include/public include/xen/interface +@@ -54,6 +55,10 @@ i[34567]86) + ln -sf ${XL}/include/asm-ia64/hypercall.h include/asm + ln -sf ${XL}/include/asm-ia64/synch_bitops.h include/asm + ln -sf ${XL}/include/asm-ia64/maddr.h include/asm ++ ln -sf ${XL}/include/asm-ia64/xen/xcom_hcall.h include/asm/xen ++ ln -sf ${XL}/include/asm-ia64/xen/xencomm.h include/asm/xen ++ ln -sf ${XL}/arch/ia64/xen/xcom_mini.c platform-pci ++ ln -sf ${XL}/arch/ia64/xen/xencomm.c platform-pci + ;; + *) + echo unknown architecture $uname +Index: xen-3.0.3-testing/unmodified_drivers/linux-2.6/platform-pci/Kbuild +=================================================================== +--- xen-3.0.3-testing.orig/unmodified_drivers/linux-2.6/platform-pci/Kbuild ++++ xen-3.0.3-testing/unmodified_drivers/linux-2.6/platform-pci/Kbuild +@@ -5,3 +5,8 @@ obj-m := xen-platform-pci.o + EXTRA_CFLAGS += -I$(M)/platform-pci + + xen-platform-pci-objs := evtchn.o platform-pci.o gnttab.o xen_support.o features.o platform-compat.o ++ ++# Can we do better ? ++ifeq ($(ARCH),ia64) ++ xen-platform-pci-objs += xcom_mini.o xencomm.o ++endif +Index: xen-3.0.3-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +=================================================================== +--- xen-3.0.3-testing.orig/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c ++++ xen-3.0.3-testing/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c +@@ -36,6 +36,9 @@ + #include + #include + #include ++#ifdef __ia64__ ++#include ++#endif + + #include "platform-pci.h" + +@@ -64,6 +67,10 @@ static int __init init_xen_info(void) + struct xen_add_to_physmap xatp; + extern void *shared_info_area; + ++#ifdef __ia64__ ++ xencomm_init(); ++#endif ++ + setup_xen_features(); + + shared_info_frame = alloc_xen_mmio(PAGE_SIZE) >> PAGE_SHIFT; diff --git a/xu-12012-hvm-smp-timer.diff b/xu-12012-hvm-smp-timer.diff new file mode 100644 index 0000000..8695675 --- /dev/null +++ b/xu-12012-hvm-smp-timer.diff @@ -0,0 +1,140 @@ +# HG changeset patch +# User kaf24@localhost.localdomain +# Date Fri Oct 27 18:00:03 2006 +0100 +# Node ID a1939d76c0e8e27bdac5233df7bd78c004ea8deb +# parent: 66fe61db9e69e03e12d0c4086683bebfb4a67780 +[HVM] Fix SMP timer issues: + * Sync AP TSCs with BP at startup + * Only halt BP TSC when descheduled + * Correctly handle IPIs on timer vector +Signed-off-by: Xiaowei Yang + +Index: xen-3.0.3-testing/xen/arch/x86/hvm/hvm.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/hvm.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/hvm.c +@@ -226,7 +226,7 @@ void hvm_do_resume(struct vcpu *v) + hvm_stts(v); + + /* pick up the elapsed PIT ticks and re-enable pit_timer */ +- if ( pt->enabled && pt->first_injected ) { ++ if ( pt->enabled && v->vcpu_id == pt->bind_vcpu && pt->first_injected ) { + if ( v->arch.hvm_vcpu.guest_time ) { + hvm_set_guest_time(v, v->arch.hvm_vcpu.guest_time); + v->arch.hvm_vcpu.guest_time = 0; +Index: xen-3.0.3-testing/xen/arch/x86/hvm/intercept.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/intercept.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/intercept.c +@@ -339,6 +339,7 @@ struct periodic_time * create_periodic_t + stop_timer (&pt->timer); + pt->enabled = 0; + } ++ pt->bind_vcpu = 0; /* timer interrupt delivered to BSP by default */ + pt->pending_intr_nr = 0; + pt->first_injected = 0; + if (period < 900000) { /* < 0.9 ms */ +Index: xen-3.0.3-testing/xen/arch/x86/hvm/io.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/io.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/io.c +@@ -680,7 +680,7 @@ void hvm_interrupt_post(struct vcpu *v, + struct periodic_time *pt = + &(v->domain->arch.hvm_domain.pl_time.periodic_tm); + +- if ( is_pit_irq(v, vector, type) ) { ++ if ( is_pit_irq(v, vector, type) && (v->vcpu_id == pt->bind_vcpu) ) { + if ( !pt->first_injected ) { + pt->pending_intr_nr = 0; + pt->last_plt_gtime = hvm_get_guest_time(v); +Index: xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/svm/svm.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c +@@ -763,7 +763,8 @@ static void svm_freeze_time(struct vcpu + { + struct periodic_time *pt=&v->domain->arch.hvm_domain.pl_time.periodic_tm; + +- if ( pt->enabled && pt->first_injected && !v->arch.hvm_vcpu.guest_time ) { ++ if ( pt->enabled && pt->first_injected && v->vcpu_id == pt->bind_vcpu ++ && !v->arch.hvm_vcpu.guest_time ) { + v->arch.hvm_vcpu.guest_time = hvm_get_guest_time(v); + stop_timer(&(pt->timer)); + } +Index: xen-3.0.3-testing/xen/arch/x86/hvm/vmx/vmcs.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/vmx/vmcs.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/vmx/vmcs.c +@@ -314,14 +314,20 @@ static void vmx_set_host_env(struct vcpu + error |= __vmwrite(HOST_RSP, (unsigned long)get_stack_bottom()); + } + ++/* Update CR3, CR0, CR4, GDT, LDT, TR */ + static void vmx_do_launch(struct vcpu *v) + { +-/* Update CR3, CR0, CR4, GDT, LDT, TR */ + unsigned int error = 0; + unsigned long cr0, cr4; + +- if (v->vcpu_id == 0) ++ if ( v->vcpu_id == 0 ) + hvm_setup_platform(v->domain); ++ else { ++ /* Sync AP's TSC with BSP's */ ++ v->arch.hvm_vcpu.cache_tsc_offset = ++ v->domain->vcpu[0]->arch.hvm_vcpu.cache_tsc_offset; ++ hvm_funcs.set_tsc_offset(v, v->arch.hvm_vcpu.cache_tsc_offset); ++ } + + __asm__ __volatile__ ("mov %%cr0,%0" : "=r" (cr0) : ); + +@@ -360,9 +366,6 @@ static void vmx_do_launch(struct vcpu *v + __vmwrite(HOST_CR3, v->arch.cr3); + + v->arch.schedule_tail = arch_vmx_do_resume; +- +- /* init guest tsc to start from 0 */ +- hvm_set_guest_time(v, 0); + } + + /* +Index: xen-3.0.3-testing/xen/arch/x86/hvm/vmx/vmx.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/vmx/vmx.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/vmx/vmx.c +@@ -456,7 +456,8 @@ static void vmx_freeze_time(struct vcpu + { + struct periodic_time *pt=&v->domain->arch.hvm_domain.pl_time.periodic_tm; + +- if ( pt->enabled && pt->first_injected && !v->arch.hvm_vcpu.guest_time ) { ++ if ( pt->enabled && pt->first_injected && v->vcpu_id == pt->bind_vcpu ++ && !v->arch.hvm_vcpu.guest_time ) { + v->arch.hvm_vcpu.guest_time = hvm_get_guest_time(v); + stop_timer(&(pt->timer)); + } +@@ -1927,6 +1928,13 @@ static inline void vmx_do_msr_write(stru + + switch (regs->ecx) { + case MSR_IA32_TIME_STAMP_COUNTER: ++ { ++ struct periodic_time *pt = ++ &(v->domain->arch.hvm_domain.pl_time.periodic_tm); ++ if ( pt->enabled && pt->first_injected ++ && v->vcpu_id == pt->bind_vcpu ) ++ pt->first_injected = 0; ++ } + hvm_set_guest_time(v, msr_content); + break; + case MSR_IA32_SYSENTER_CS: +Index: xen-3.0.3-testing/xen/include/asm-x86/hvm/vpit.h +=================================================================== +--- xen-3.0.3-testing.orig/xen/include/asm-x86/hvm/vpit.h ++++ xen-3.0.3-testing/xen/include/asm-x86/hvm/vpit.h +@@ -58,6 +58,7 @@ struct periodic_time { + char one_shot; /* one shot time */ + char irq; + char first_injected; /* flag to prevent shadow window */ ++ u32 bind_vcpu; /* vcpu timer interrupt delivers to */ + u32 pending_intr_nr; /* the couner for pending timer interrupts */ + u32 period; /* frequency in ns */ + u64 period_cycles; /* frequency in cpu cycles */ diff --git a/xu-12013-hvm-ioapic.diff b/xu-12013-hvm-ioapic.diff new file mode 100644 index 0000000..e0a8d6e --- /dev/null +++ b/xu-12013-hvm-ioapic.diff @@ -0,0 +1,59 @@ +# HG changeset patch +# User kaf24@localhost.localdomain +# Date Fri Oct 27 18:02:40 2006 +0100 +# Node ID ee140fbcb88df2e55259b0c6519de7645641468a +# parent: a1939d76c0e8e27bdac5233df7bd78c004ea8deb +[HVM] Ensure that, if AP is blocked, it is woken by interrupt delivered by IOAPIC. + +This fixes 64-bit SMP Windows 2k3 boot. + +Signed-off-by: Xiaowei Yang +Signed-off-by: Xin Li + +Index: xen-3.0.3-testing/xen/arch/x86/hvm/vioapic.c +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/vioapic.c ++++ xen-3.0.3-testing/xen/arch/x86/hvm/vioapic.c +@@ -39,6 +39,7 @@ + #include + #include + #include ++#include + + /* HACK: Route IRQ0 only to VCPU0 to prevent time jumps. */ + #define IRQ0_SPECIAL_ROUTING 1 +@@ -436,9 +437,10 @@ static void ioapic_deliver(hvm_vioapic_t + #endif + target = apic_round_robin(s->domain, dest_mode, + vector, deliver_bitmask); +- if (target) ++ if (target) { + ioapic_inj_irq(s, target, vector, trig_mode, delivery_mode); +- else ++ vcpu_kick(target->vcpu); ++ } else + HVM_DBG_LOG(DBG_LEVEL_IOAPIC, + "null round robin mask %x vector %x delivery_mode %x\n", + deliver_bitmask, vector, dest_LowestPrio); +@@ -448,6 +450,7 @@ static void ioapic_deliver(hvm_vioapic_t + case dest_Fixed: + case dest_ExtINT: + { ++ struct vlapic* target; + uint8_t bit; + for (bit = 0; bit < s->lapic_count; bit++) { + if (deliver_bitmask & (1 << bit)) { +@@ -458,9 +461,10 @@ static void ioapic_deliver(hvm_vioapic_t + domain_crash_synchronous(); + } + #endif +- if (s->lapic_info[bit]) { +- ioapic_inj_irq(s, s->lapic_info[bit], +- vector, trig_mode, delivery_mode); ++ target = s->lapic_info[bit]; ++ if (target) { ++ ioapic_inj_irq(s, target, vector, trig_mode, delivery_mode); ++ vcpu_kick(target->vcpu); + } + } + } diff --git a/xu-12030-pv-hvm.diff b/xu-12030-pv-hvm.diff new file mode 100644 index 0000000..c92b023 --- /dev/null +++ b/xu-12030-pv-hvm.diff @@ -0,0 +1,99 @@ +# HG changeset patch +# User kfraser@localhost.localdomain +# Date Mon Oct 30 14:09:13 2006 +0000 +# Node ID 44caba9460afd444a6a56c5d4517f938ca99130c +# parent: c3b4fef4f751e1fc57b8ee48abf06f1e3e802ce4 +[LINUX] Declare structs as 'static __initdata' where possible. + +Probably still not catching all possible cases, but using static +(where not already the case) makes the code size smaller, and using __initdata +has the usual advantages. + +Signed-off-by: Jan Beulich + +--- a/linux-2.6-xen-sparse/arch/i386/kernel/sysenter.c Mon Oct 30 14:04:44 2006 +0000 ++++ b/linux-2.6-xen-sparse/arch/i386/kernel/sysenter.c Mon Oct 30 14:09:13 2006 +0000 +@@ -60,7 +60,7 @@ int __init sysenter_setup(void) + + #ifdef CONFIG_XEN + if (boot_cpu_has(X86_FEATURE_SEP)) { +- struct callback_register sysenter = { ++ static struct callback_register __initdata sysenter = { + .type = CALLBACKTYPE_sysenter, + .address = { __KERNEL_CS, (unsigned long)sysenter_entry }, + }; +--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h Mon Oct 30 14:04:44 2006 +0000 ++++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h Mon Oct 30 14:09:13 2006 +0000 +@@ -56,15 +56,15 @@ static void __init machine_specific_arch + struct xen_machphys_mapping mapping; + unsigned long machine_to_phys_nr_ents; + struct xen_platform_parameters pp; +- struct callback_register event = { ++ static struct callback_register __initdata event = { + .type = CALLBACKTYPE_event, + .address = { __KERNEL_CS, (unsigned long)hypervisor_callback }, + }; +- struct callback_register failsafe = { ++ static struct callback_register __initdata failsafe = { + .type = CALLBACKTYPE_failsafe, + .address = { __KERNEL_CS, (unsigned long)failsafe_callback }, + }; +- struct callback_register nmi_cb = { ++ static struct callback_register __initdata nmi_cb = { + .type = CALLBACKTYPE_nmi, + .address = { __KERNEL_CS, (unsigned long)nmi }, + }; +@@ -80,9 +80,10 @@ static void __init machine_specific_arch + + ret = HYPERVISOR_callback_op(CALLBACKOP_register, &nmi_cb); + if (ret == -ENOSYS) { +- struct xennmi_callback cb; ++ static struct xennmi_callback __initdata cb = { ++ .handler_address = (unsigned long)nmi; ++ }; + +- cb.handler_address = nmi_cb.address.eip; + HYPERVISOR_nmi_op(XENNMI_register_callback, &cb); + } + +--- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h Mon Oct 30 14:04:44 2006 +0000 ++++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h Mon Oct 30 14:09:13 2006 +0000 +@@ -15,20 +15,20 @@ static void __init machine_specific_arch + static void __init machine_specific_arch_setup(void) + { + int ret; +- struct callback_register event = { ++ static struct callback_register __initdata event = { + .type = CALLBACKTYPE_event, + .address = (unsigned long) hypervisor_callback, + }; +- struct callback_register failsafe = { ++ static struct callback_register __initdata failsafe = { + .type = CALLBACKTYPE_failsafe, + .address = (unsigned long)failsafe_callback, + }; +- struct callback_register syscall = { ++ static struct callback_register __initdata syscall = { + .type = CALLBACKTYPE_syscall, + .address = (unsigned long)system_call, + }; + #ifdef CONFIG_X86_LOCAL_APIC +- struct callback_register nmi_cb = { ++ static struct callback_register __initdata nmi_cb = { + .type = CALLBACKTYPE_nmi, + .address = (unsigned long)nmi, + }; +@@ -49,9 +49,10 @@ static void __init machine_specific_arch + #ifdef CONFIG_X86_LOCAL_APIC + ret = HYPERVISOR_callback_op(CALLBACKOP_register, &nmi_cb); + if (ret == -ENOSYS) { +- struct xennmi_callback cb; ++ static struct xennmi_callback __initdata cb = { ++ .handler_address = (unsigned long)nmi; ++ }; + +- cb.handler_address = nmi_cb.address; + HYPERVISOR_nmi_op(XENNMI_register_callback, &cb); + } + #endif + diff --git a/xu-12031-pv-hvm.diff b/xu-12031-pv-hvm.diff new file mode 100644 index 0000000..d41f7c6 --- /dev/null +++ b/xu-12031-pv-hvm.diff @@ -0,0 +1,243 @@ +# HG changeset patch +# User kfraser@localhost.localdomain +# Date Mon Oct 30 14:14:46 2006 +0000 +# Node ID 6f3865b4d3d3bddbd64c0ed7c21b03bd98e78a0a +# parent: 44caba9460afd444a6a56c5d4517f938ca99130c +[LINUX] Use CONFIG_XEN_COMPAT_030002 where possible. +Signed-off-by: Jan Beulich + +--- a/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c Mon Oct 30 14:09:13 2006 +0000 ++++ b/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c Mon Oct 30 14:14:46 2006 +0000 +@@ -325,6 +325,7 @@ int xen_create_contiguous_region( + success = (exchange.nr_exchanged == (1UL << order)); + BUG_ON(!success && ((exchange.nr_exchanged != 0) || (rc == 0))); + BUG_ON(success && (rc != 0)); ++#ifdef CONFIG_XEN_COMPAT_030002 + if (unlikely(rc == -ENOSYS)) { + /* Compatibility when XENMEM_exchange is unsupported. */ + if (HYPERVISOR_memory_op(XENMEM_decrease_reservation, +@@ -341,6 +342,7 @@ int xen_create_contiguous_region( + BUG(); + } + } ++#endif + + /* 3. Map the new extent in place of old pages. */ + for (i = 0; i < (1UL< + +--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h Mon Oct 30 14:14:46 2006 +0000 ++++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/setup_arch_post.h Mon Oct 30 14:28:29 2006 +0000 +@@ -84,7 +84,7 @@ static void __init machine_specific_arch + #ifdef CONFIG_XEN_COMPAT_030002 + if (ret == -ENOSYS) { + static struct xennmi_callback __initdata cb = { +- .handler_address = (unsigned long)nmi; ++ .handler_address = (unsigned long)nmi + }; + + HYPERVISOR_nmi_op(XENNMI_register_callback, &cb); +--- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h Mon Oct 30 14:14:46 2006 +0000 ++++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/setup_arch_post.h Mon Oct 30 14:28:29 2006 +0000 +@@ -53,7 +53,7 @@ static void __init machine_specific_arch + #ifdef CONFIG_XEN_COMPAT_030002 + if (ret == -ENOSYS) { + static struct xennmi_callback __initdata cb = { +- .handler_address = (unsigned long)nmi; ++ .handler_address = (unsigned long)nmi + }; + + HYPERVISOR_nmi_op(XENNMI_register_callback, &cb); + diff --git a/xu-12040-pv-spurious-interrupt.diff b/xu-12040-pv-spurious-interrupt.diff new file mode 100644 index 0000000..fc060c1 --- /dev/null +++ b/xu-12040-pv-spurious-interrupt.diff @@ -0,0 +1,44 @@ +# HG changeset patch +# User Steven Smith +# Date Tue Oct 31 11:38:55 2006 +0000 +# Node ID 79a40acadb41fbe5e5b88b20de5fe53f4dd6b413 +# parent: b2371c9e05f5146767464db8504214ae2b77c25c +[PV-ON-HVM] Don't generate lots of spurious interrupts when using event +channel upcalls. + +The issue here was that the Xen platform PCI interrupt is only updated +when you return from the hypervisor into guest context, and so remained +asserted for a short interval after the interrupt handler ran. If +it happened that the first subsequent trap to the hypervisor was +for unmasking the 8259 interrupt again, the unmasking caused the interrupt +to be reinjected. This caused an edge on the chaining interrupt from +the slave PIC to the master. The platform interrupt on the slave +would then be cleared as we returned to the guest, and so you +eventually end up injecting an interrupt on the master chained +interrupt with nothing pending on the slave, which shows up as +a spurious interrupt in the guest. + +Signed-off-by: Steven Smith + +--- a/unmodified_drivers/linux-2.6/platform-pci/evtchn.c Tue Oct 31 11:31:34 2006 +0000 ++++ b/unmodified_drivers/linux-2.6/platform-pci/evtchn.c Tue Oct 31 11:38:55 2006 +0000 +@@ -167,11 +167,17 @@ irqreturn_t evtchn_interrupt(int irq, vo + l2 = s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i]; + } + } ++ ++ /* Make sure the hypervisor has a chance to notice that the ++ upcall_pending condition has been cleared, so that we don't ++ try and reinject the interrupt again. */ ++ (void)HYPERVISOR_xen_version(0, NULL); ++ + return IRQ_HANDLED; + } + + void force_evtchn_callback(void) + { +- evtchn_interrupt(0, NULL, NULL); ++ (void)HYPERVISOR_xen_version(0, NULL); + } + EXPORT_SYMBOL(force_evtchn_callback); + diff --git a/xu-12205-pv-hvm.diff b/xu-12205-pv-hvm.diff new file mode 100644 index 0000000..e1371f5 --- /dev/null +++ b/xu-12205-pv-hvm.diff @@ -0,0 +1,23 @@ +# HG changeset patch +# User Ian Campbell +# Date Thu Nov 02 11:56:26 2006 +0000 +# Node ID af1403dd13af9f2e3e778001c1ff681036753aca +# parent: e6fdb32b786c3e57b9c641274607603897b97334 +PV-on-HVM: Use ln -nsf in mkbuildtree to avoid creating a symlink loop +if include/xen/interfaces already exists. + +Signed-off-by: Ian Campbell + +Index: xen-3.0.3-testing/unmodified_drivers/linux-2.6/mkbuildtree +=================================================================== +--- xen-3.0.3-testing.orig/unmodified_drivers/linux-2.6/mkbuildtree ++++ xen-3.0.3-testing/unmodified_drivers/linux-2.6/mkbuildtree +@@ -30,7 +30,7 @@ mkdir -p include/asm + mkdir -p include/asm/xen + + lndir -silent ${XL}/include/xen include/xen +-ln -sf ${XEN}/include/public include/xen/interface ++ln -nsf ${XEN}/include/public include/xen/interface + + # Need to be quite careful here: we don't want the files we link in to + # risk overriding the native Linux ones (in particular, system.h must diff --git a/xu-12278-hvm-interrupt-race.diff b/xu-12278-hvm-interrupt-race.diff new file mode 100644 index 0000000..739e744 --- /dev/null +++ b/xu-12278-hvm-interrupt-race.diff @@ -0,0 +1,57 @@ +# HG changeset patch +# User kfraser@localhost.localdomain +# Date Tue Nov 07 17:48:18 2006 +0000 +# Node ID 2b89ebf00fc884f68168abea4159c11f31db131a +# parent: cba947bc845063ed820142bb921121ab8ead6452 +[SVM] Fix an interrupt race window in the do_launch/vmrun/vmexit loop for AMD-V. + +This problem found by Virtual Iron (Dave Winchell), and patch also +provided by VI. + +Signed-off-by: Tom Woller +Signed-off-by: Dave Winchell + +Index: xen-3.0.3-testing/xen/arch/x86/hvm/svm/x86_32/exits.S +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/svm/x86_32/exits.S ++++ xen-3.0.3-testing/xen/arch/x86/hvm/svm/x86_32/exits.S +@@ -89,8 +89,8 @@ + #define CLGI .byte 0x0F,0x01,0xDD + + ENTRY(svm_asm_do_launch) +- sti + CLGI ++ sti + GET_CURRENT(%ebx) + movl VCPU_svm_vmcb(%ebx), %ecx + movl 24(%esp), %eax +@@ -153,7 +153,6 @@ svm_restore_all_guest: + call svm_intr_assist + call svm_asid + call svm_load_cr2 +- sti + /* + * Check if we are going back to SVM-based VM + * By this time, all the setups in the VMCB must be complete. +Index: xen-3.0.3-testing/xen/arch/x86/hvm/svm/x86_64/exits.S +=================================================================== +--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/svm/x86_64/exits.S ++++ xen-3.0.3-testing/xen/arch/x86/hvm/svm/x86_64/exits.S +@@ -99,8 +99,8 @@ + #define CLGI .byte 0x0F,0x01,0xDD + + ENTRY(svm_asm_do_launch) +- sti + CLGI ++ sti + GET_CURRENT(%rbx) + movq VCPU_svm_vmcb(%rbx), %rcx + movq UREGS_rax(%rsp), %rax +@@ -165,7 +165,6 @@ svm_restore_all_guest: + call svm_intr_assist + call svm_asid + call svm_load_cr2 +- sti + /* + * Check if we are going back to VMX-based VM + * By this time, all the setups in the VMCS must be complete.