xen: Enable hap for HVM domains in legacy driver

Just as xm enables hap if not specified in an xm config file,
enable hap if not specified in domain XML config. Note that one
downside of this change is that hap cannot be disabled from
domain XML config. FWIW, the same behavior exists in the libxl
driver.

Several of the xml->sexpr tests needed adjusted since the change
enables hap in sexpr even when <hap> is absent in the domain XML.

bsc#952889

Index: libvirt-1.0.5.9/src/xen/xen_hypervisor.c
===================================================================
--- libvirt-1.0.5.9.orig/src/xen/xen_hypervisor.c
+++ libvirt-1.0.5.9/src/xen/xen_hypervisor.c
@@ -2382,12 +2382,12 @@ xenHypervisorBuildCapabilities(virConnec
                 goto no_memory;
 
             /* Xen 3.3.x and beyond supports enabling/disabling
-             * hardware assisted paging.  Default is off.
+             * hardware assisted paging.  Default is on.
              */
             if ((hv_major == 3 && hv_minor >= 3) || (hv_major > 3))
                 if (virCapabilitiesAddGuestFeature(guest,
                                                    "hap",
-                                                   0,
+                                                   1,
                                                    1) == NULL)
                     goto no_memory;
 
Index: libvirt-1.0.5.9/src/xenxs/xen_sxpr.c
===================================================================
--- libvirt-1.0.5.9.orig/src/xenxs/xen_sxpr.c
+++ libvirt-1.0.5.9/src/xenxs/xen_sxpr.c
@@ -2383,8 +2383,12 @@ xenFormatSxpr(virConnectPtr conn,
                 virBufferAddLit(&buf, "(apic 1)");
             if (def->features & (1 << VIR_DOMAIN_FEATURE_PAE))
                 virBufferAddLit(&buf, "(pae 1)");
-            if (def->features & (1 << VIR_DOMAIN_FEATURE_HAP))
-                virBufferAddLit(&buf, "(hap 1)");
+            /*
+             * HACK:
+             * For HVM domains, always enable HAP. Downside is there is no way
+             * to disable HAP. It would have to be disabled through the xm tools.
+             */
+            virBufferAddLit(&buf, "(hap 1)");
             if (def->features & (1 << VIR_DOMAIN_FEATURE_VIRIDIAN))
                 virBufferAddLit(&buf, "(viridian 1)");
 
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-escape.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-escape.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-escape.sexpr
@@ -5,7 +5,7 @@
 (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\
 (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\
 core/test/5.91/x86_64/os&version="devel"  ')\
-(loader '/usr/lib/xen/boot/hvmloader')(vcpus 2)(boot c)(usb 1)(parallel none)\
+(loader '/usr/lib/xen/boot/hvmloader')(vcpus 2)(boot c)(hap 1)(usb 1)(parallel none)\
 (serial pty)(device_model '/usr/lib/xen/bin/qemu-dm')))\
 (localtime 0)\
 (device (vbd (dev 'ioemu:xvda')(uname 'file:/root/\'\\some.img')(mode 'w'))))\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)(serial none)\
 (device_model '/usr/lib64/xen/bin/qemu-dm')(hpet 1)(vnc 1)))\
 (localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)(serial none)\
 (device_model '/usr/lib64/xen/bin/qemu-dm')(hpet 0)(vnc 1)))\
 (localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr
@@ -5,7 +5,7 @@
 (ramdisk '/var/lib/xen/initrd.img.0u-Vhq')\
 (args ' method=http://download.fedora.devel.redhat.com/pub/fedora/linux/\
 core/test/5.91/x86_64/os  ')(loader '/usr/lib/xen/boot/hvmloader')(vcpus 2)\
-(boot c)(usb 1)(parallel none)(serial pty)\
+(boot c)(hap 1)(usb 1)(parallel none)(serial pty)\
 (device_model '/usr/lib/xen/bin/qemu-dm')))\
 (localtime 0)\
 (device (vbd (dev 'ioemu:xvda')(uname 'file:/root/some.img')(mode 'w'))))\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)(serial none)\
 (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\
 (localtime 1)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr
@@ -1,7 +1,7 @@
 (vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)\
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
-(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)\
+(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)(hap 1)\
 (usb 1)(parallel none)(serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')\
 (vnc 1)))(localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr
@@ -1,7 +1,7 @@
 (vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)\
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
-(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)\
+(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)(hap 1)\
 (usb 1)(parallel none)(serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')\
 (vnc 1)))(localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-parallel-tcp.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-parallel-tcp.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-parallel-tcp.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel tcp:localhost:9999)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel tcp:localhost:9999)\
 (serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\
 (localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2-ports.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2-ports.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2-ports.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)\
 (serial (/dev/ttyS0 /dev/ttyS1))(device_model '/usr/lib64/xen/bin/qemu-dm')\
 (vnc 1)))(localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2nd-port.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2nd-port.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-dev-2nd-port.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)\
 (serial (none /dev/ttyS1))(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\
 (localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-file.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-serial-file.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-file.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)\
 (serial file:/tmp/serial.log)(device_model '/usr/lib64/xen/bin/qemu-dm')\
 (vnc 1)))(localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-null.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-serial-null.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-null.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial null)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)(serial null)\
 (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\
 (localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)\
 (serial pipe:/tmp/serial.pipe)(device_model '/usr/lib64/xen/bin/qemu-dm')\
 (vnc 1)))(localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-pty.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-serial-pty.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-pty.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial pty)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)(serial pty)\
 (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\
 (localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-stdio.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-serial-stdio.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-stdio.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial stdio)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)(serial stdio)\
 (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\
 (localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-tcp-telnet.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-serial-tcp-telnet.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-tcp-telnet.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)\
 (serial telnet:localhost:9999,server,nowait)\
 (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\
 (localtime 0)\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)\
 (serial tcp:localhost:9999,server,nowait)\
 (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\
 (localtime 0)\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-udp.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-serial-udp.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-udp.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)\
 (serial udp:localhost:9998@localhost:9999)\
 (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\
 (localtime 0)\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-unix.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-serial-unix.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-serial-unix.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)\
 (serial unix:/tmp/serial.sock,server,nowait)\
 (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\
 (localtime 0)\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-sound.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-sound.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-sound.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)(serial none)\
 (soundhw 'sb16,es1370')(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\
 (localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(usbdevice mouse)(parallel none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(usbdevice mouse)(parallel none)\
 (serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\
 (localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)(serial none)\
 (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\
 (localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr
@@ -1,7 +1,7 @@
 (vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)\
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
-(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)\
+(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)(hap 1)\
 (usb 1)(parallel none)(serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')\
 (vnc 1)(vncunused 0)(vncdisplay 17)(keymap 'ja')))\
 (localtime 0)\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr
@@ -1,7 +1,7 @@
 (vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)\
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
-(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)\
+(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)(hap 1)\
 (usb 1)(parallel none)(serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')\
 (vnc 1)(vncunused 1)(keymap 'ja')))\
 (localtime 0)(device (vbd (dev 'hda:disk')\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-fv.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-fv.sexpr
@@ -2,7 +2,7 @@
 (uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')\
 (on_reboot 'restart')(on_crash 'restart')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)\
-(cdrom '/root/boot.iso')(acpi 1)(usb 1)(parallel none)(serial none)\
+(cdrom '/root/boot.iso')(acpi 1)(hap 1)(usb 1)(parallel none)(serial none)\
 (device_model '/usr/lib64/xen/bin/qemu-dm')(vnc 1)))\
 (localtime 0)\
 (device (vbd (dev 'ioemu:hda')(uname 'file:/root/foo.img')(mode 'w')))\
Index: libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr
===================================================================
--- libvirt-1.0.5.9.orig/tests/xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr
+++ libvirt-1.0.5.9/tests/xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr
@@ -2,7 +2,7 @@
 (uuid 'cc2315e7-d26a-307a-438c-6d188ec4c09c')(on_poweroff 'destroy')\
 (on_reboot 'destroy')(on_crash 'destroy')\
 (image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(acpi 1)\
-(apic 1)(pae 1)(usb 1)(parallel none)(serial none)\
+(apic 1)(pae 1)(hap 1)(usb 1)(parallel none)(serial none)\
 (device_model '/usr/lib/xen/bin/qemu-dm')(vnc 1)(vncunused 0)(vncdisplay 6)))\
 (localtime 0)\
 (device (vbd (dev 'hda:disk')(uname 'phy:/dev/sda8')(mode 'w')))\
