diff -urN debian.orig/changelog debian/changelog
--- debian.orig/changelog	2010-05-09 14:25:25.000000000 +0200
+++ debian/changelog	2010-05-20 00:44:23.000000000 +0200
@@ -1,5 +1,5 @@
 libvirt (0.8.1-1) unstable; urgency=low
-
+  * added xen patches from opensuse build service https://build.opensuse.org/stage/package/files?package=libvirt&project=Virtualization
   * [647cbd6] Imported Upstream version 0.8.1
         * fixes spurious syslog messages (Closes: #565275)
         * sysfs USB class parsing (Closes: #579208)
diff -urN debian.orig/control debian/control
--- debian.orig/control	2010-05-08 20:09:27.000000000 +0200
+++ debian/control	2010-05-20 00:39:38.000000000 +0200
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Debian Libvirt Maintainers <pkg-libvirt-maintainers@lists.alioth.debian.org>
 Uploaders: Guido Günther <agx@sigxcpu.org>, Laurent Léonard <laurent@open-minds.org>
-Build-Depends: cdbs (>= 0.4.43), debhelper (>= 7), libxml2-dev, libncurses5-dev, libreadline-dev, zlib1g-dev, libgnutls-dev, python-dev (>= 2.3.5-11), python-central (>= 0.5.6), quilt, libavahi-client-dev, libsasl2-dev, libxen-dev [i386 amd64], lvm2, qemu [amd64 i386 powerpc sparc], open-iscsi, libparted0-dev (>= 2.2), libdevmapper-dev, uuid-dev,
+Build-Depends: cdbs (>= 0.4.43), debhelper (>= 7), libssh2-1-dev, libxml2-dev, libncurses5-dev, libreadline-dev, zlib1g-dev, libgnutls-dev, python-dev (>= 2.3.5-11), python-central (>= 0.5.6), quilt, libavahi-client-dev, libsasl2-dev, libxen3-dev [i386 amd64], lvm2, qemu [amd64 i386 powerpc sparc], open-iscsi, libparted0-dev (>= 2.2), libdevmapper-dev, uuid-dev,
  libudev-dev,
  libpciaccess-dev,
  module-init-tools,
@@ -20,7 +20,7 @@
 
 Package: libvirt-bin
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, libvirt0 (= ${binary:Version}), logrotate
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, libvirt0 (= ${binary:Version}), libssh2-1, logrotate
 Enhances: qemu, qemu-kvm, xen
 Section: admin
 Recommends: netcat-openbsd, bridge-utils, dnsmasq-base (>= 2.46-1), iptables, qemu-kvm | qemu (>= 0.9.1)
@@ -45,7 +45,7 @@
 
 Package: libvirt0-dbg
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libvirt0 (= ${binary:Version})
+Depends: ${shlibs:Depends}, ${misc:Depends}, libvirt0 (= ${binary:Version}), libssh2-1
 Priority: extra
 Section: debug
 Description: library for interfacing with different virtualization systems
@@ -72,7 +72,7 @@
 Package: libvirt-dev
 Architecture: any
 Section: libdevel
-Depends: ${misc:Depends}, libvirt0 (= ${binary:Version}), libxen-dev [i386 amd64]
+Depends: ${misc:Depends}, libvirt0 (= ${binary:Version}), libssh2-1-dev, libxen3-dev [i386 amd64]
 Recommends: pkg-config
 Description: development files for the libvirt library
  Libvirt is a C toolkit to interact with the virtualization capabilities
@@ -85,7 +85,7 @@
 
 Package: python-libvirt
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, libvirt0 (>= ${binary:Version})
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, libvirt0 (>= ${binary:Version}), libssh2-1
 Provides: ${python:Provides}
 Section: python
 XB-Python-Version: ${python:Versions}
diff -urN debian.orig/patches/0099-remote-rm-unused-field.patch debian/patches/0099-remote-rm-unused-field.patch
--- debian.orig/patches/0099-remote-rm-unused-field.patch	1970-01-01 01:00:00.000000000 +0100
+++ debian/patches/0099-remote-rm-unused-field.patch	2010-05-19 18:24:07.000000000 +0200
@@ -0,0 +1,50 @@
+commit 34a7f3f6be9c63ac3d4c4604c1fb2482a4e5053b
+Author: Matthew Booth <mbooth@redhat.com>
+Date:   Fri May 7 16:38:05 2010 +0200
+
+    Remove unused nwfilter field from struct remote_error
+    
+    Change 965466c1 added a new field to struct remote_error, which broke
+    the RPC protocol. Fortunately the new field is unused, so this change
+    simply removes it again.
+    
+    * src/remote/remote_protocol.(c|h|x): Remove remote_nwfilter from struct
+      remote_error
+
+diff --git a/src/remote/remote_protocol.c b/src/remote/remote_protocol.c
+index 187281d..972bf52 100644
+--- a/src/remote/remote_protocol.c
++++ b/src/remote/remote_protocol.c
+@@ -227,8 +227,6 @@ xdr_remote_error (XDR *xdrs, remote_error *objp)
+                  return FALSE;
+          if (!xdr_remote_network (xdrs, &objp->net))
+                  return FALSE;
+-         if (!xdr_remote_nwfilter (xdrs, &objp->nwfilter))
+-                 return FALSE;
+         return TRUE;
+ }
+ 
+diff --git a/src/remote/remote_protocol.h b/src/remote/remote_protocol.h
+index 6f01da7..a600af6 100644
+--- a/src/remote/remote_protocol.h
++++ b/src/remote/remote_protocol.h
+@@ -143,7 +143,6 @@ struct remote_error {
+         int int1;
+         int int2;
+         remote_network net;
+-        remote_nwfilter nwfilter;
+ };
+ typedef struct remote_error remote_error;
+ 
+diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
+index 8000ee0..1ce488c 100644
+--- a/src/remote/remote_protocol.x
++++ b/src/remote/remote_protocol.x
+@@ -266,7 +266,6 @@ struct remote_error {
+     int int1;
+     int int2;
+     remote_network net;
+-    remote_nwfilter nwfilter;
+ };
+ 
+ /* Authentication types available thus far.... */
diff -urN debian.orig/patches/0100-xen-name-for-devid.patch debian/patches/0100-xen-name-for-devid.patch
--- debian.orig/patches/0100-xen-name-for-devid.patch	1970-01-01 01:00:00.000000000 +0100
+++ debian/patches/0100-xen-name-for-devid.patch	2010-05-19 18:22:58.000000000 +0200
@@ -0,0 +1,109 @@
+commit 7906a668fa8d5c21cc729db8a13b08e3dd1d241f
+Author: Jim Fehlig <jfehlig@novell.com>
+Date:   Wed Jan 27 16:11:41 2010 -0700
+
+    Do not search xenstore for disk device IDs
+    
+    Disk devices can be referenced by name in Xen, e.g. when modifying
+    their configuration or remvoving them.  As such, don't search
+    xenstore for a device ID corresponding to the disk device.  Instead,
+    search the disks contained in the domain definition and use the
+    disk's target name if found.
+    
+    This approach allows removing a disk when domain is inactive.  We
+    obviously can't search xenstore when the domain is inactive.
+
+Index: libvirt-0.8.1/src/xen/xend_internal.c
+===================================================================
+--- libvirt-0.8.1.orig/src/xen/xend_internal.c
++++ libvirt-0.8.1/src/xen/xend_internal.c
+@@ -91,6 +91,7 @@ xenDaemonFormatSxprOnePCI(virDomainHostd
+ 
+ static int
+ virDomainXMLDevID(virDomainPtr domain,
++                  virDomainDefPtr domDef,
+                   virDomainDeviceDefPtr dev,
+                   char *class,
+                   char *ref,
+@@ -4164,7 +4165,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr
+ 
+     sexpr = virBufferContentAndReset(&buf);
+ 
+-    if (virDomainXMLDevID(domain, dev, class, ref, sizeof(ref))) {
++    if (virDomainXMLDevID(domain, def, dev, class, ref, sizeof(ref))) {
+         /* device doesn't exist, define it */
+         ret = xend_op(domain->conn, domain->name, "op", "device_create",
+                       "config", sexpr, NULL);
+@@ -4281,7 +4282,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr
+ 
+     sexpr = virBufferContentAndReset(&buf);
+ 
+-    if (virDomainXMLDevID(domain, dev, class, ref, sizeof(ref))) {
++    if (virDomainXMLDevID(domain, def, dev, class, ref, sizeof(ref))) {
+         virXendError(VIR_ERR_OPERATION_INVALID, "%s",
+                      _("requested device does not exist"));
+         goto cleanup;
+@@ -4373,7 +4374,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr
+                                         def, xml, VIR_DOMAIN_XML_INACTIVE)))
+         goto cleanup;
+ 
+-    if (virDomainXMLDevID(domain, dev, class, ref, sizeof(ref)))
++    if (virDomainXMLDevID(domain, def, dev, class, ref, sizeof(ref)))
+         goto cleanup;
+ 
+     if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
+@@ -6121,6 +6122,7 @@ error:
+  */
+ static int
+ virDomainXMLDevID(virDomainPtr domain,
++                  virDomainDefPtr domDef,
+                   virDomainDeviceDefPtr dev,
+                   char *class,
+                   char *ref,
+@@ -6129,27 +6131,33 @@ virDomainXMLDevID(virDomainPtr domain,
+     xenUnifiedPrivatePtr priv = domain->conn->privateData;
+     char *xref;
+     char *tmp;
++    unsigned int i;
++    virDomainDiskDefPtr disk;
+ 
+     if (dev->type == VIR_DOMAIN_DEVICE_DISK) {
++        if (dev->data.disk->dst == NULL)
++            return -1;
+         if (dev->data.disk->driverName &&
+             STREQ(dev->data.disk->driverName, "tap"))
+             strcpy(class, "tap");
+         else
+             strcpy(class, "vbd");
+ 
+-        if (dev->data.disk->dst == NULL)
+-            return -1;
+-        xenUnifiedLock(priv);
+-        xref = xenStoreDomainGetDiskID(domain->conn, domain->id,
+-                                       dev->data.disk->dst);
+-        xenUnifiedUnlock(priv);
+-        if (xref == NULL)
+-            return -1;
+-
+-        tmp = virStrcpy(ref, xref, ref_len);
+-        VIR_FREE(xref);
+-        if (tmp == NULL)
+-            return -1;
++        /* For disks, the device name can be used directly.
++         * If disk device exists in domain definintion,
++         * copy it to ref and return success.
++         */
++        for (i = 0; i < domDef->ndisks; i++) {
++            disk = domDef->disks[i];
++            if (STREQ(dev->data.disk->dst, disk->dst)) {
++                tmp = virStrcpy(ref, disk->dst, ref_len);
++                if (tmp == NULL)
++                    return -1;
++                else
++                    return 0;
++            }
++        }
++        return -1;
+     } else if (dev->type == VIR_DOMAIN_DEVICE_NET) {
+         char mac[30];
+         virDomainNetDefPtr def = dev->data.net;
diff -urN debian.orig/patches/0101-socat.patch debian/patches/0101-socat.patch
--- debian.orig/patches/0101-socat.patch	1970-01-01 01:00:00.000000000 +0100
+++ debian/patches/0101-socat.patch	2010-05-20 00:12:21.000000000 +0200
@@ -0,0 +1,44 @@
+Index: libvirt-0.8.1/src/remote/remote_driver.c
+===================================================================
+--- libvirt-0.8.1.orig/src/remote/remote_driver.c
++++ libvirt-0.8.1/src/remote/remote_driver.c
+@@ -769,14 +769,31 @@
+             cmd_argv[j++] = strdup ("none");
+         }
+         cmd_argv[j++] = strdup (priv->hostname);
+-        cmd_argv[j++] = strdup (netcat ? netcat : "nc");
+-        cmd_argv[j++] = strdup ("-q");
+-        cmd_argv[j++] = strdup ("0");
+-        cmd_argv[j++] = strdup ("-U");
+-        cmd_argv[j++] = strdup (sockname ? sockname :
+-                                (flags & VIR_CONNECT_RO
+-                                 ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
+-                                 : LIBVIRTD_PRIV_UNIX_SOCKET));
++        if (netcat) {
++           cmd_argv[j++] = strdup (netcat);
++           cmd_argv[j++] = strdup ("-q");
++           cmd_argv[j++] = strdup ("0");
++           cmd_argv[j++] = strdup ("-U");
++           cmd_argv[j++] = strdup (sockname ? sockname :
++                                   (flags & VIR_CONNECT_RO
++                                    ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
++                                    : LIBVIRTD_PRIV_UNIX_SOCKET));
++        } else {
++           cmd_argv[j++] = strdup ("socat");
++           cmd_argv[j++] = strdup ("-");
++
++           char *socat_addr = NULL;
++           if ((asprintf (&socat_addr, "GOPEN:%s",
++                          sockname ? sockname :
++                          (flags & VIR_CONNECT_RO
++                           ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
++                           : LIBVIRTD_PRIV_UNIX_SOCKET))) < 0) {
++              error (conn, VIR_ERR_SYSTEM_ERROR, strerror (ENOMEM));
++              goto failed;
++           }
++           cmd_argv[j++] = strdup (socat_addr);
++           VIR_FREE(socat_addr);
++        }
+         cmd_argv[j++] = 0;
+         assert (j == nr_args);
+         for (j = 0; j < (nr_args-1); j++)
diff -urN debian.orig/patches/0102-clone.patch debian/patches/0102-clone.patch
--- debian.orig/patches/0102-clone.patch	1970-01-01 01:00:00.000000000 +0100
+++ debian/patches/0102-clone.patch	2010-05-20 00:14:11.000000000 +0200
@@ -0,0 +1,58 @@
+Index: src/lxc/lxc_container.c
+===================================================================
+--- a/src/lxc/lxc_container.c.orig
++++ b/src/lxc/lxc_container.c
+@@ -828,6 +828,9 @@ int lxcContainerStart(virDomainDefPtr de
+     lxc_child_argv_t args = { def, nveths, veths, control, ttyPath };
+ 
+     /* allocate a stack for the container */
++#ifdef __ia64__
++    stacksize *= 2;
++#endif
+     if (VIR_ALLOC_N(stack, stacksize) < 0) {
+         virReportOOMError();
+         return -1;
+@@ -846,7 +849,11 @@ int lxcContainerStart(virDomainDefPtr de
+         flags |= CLONE_NEWNET;
+     }
+ 
++#ifdef __ia64__
++    pid = __clone2(lxcContainerChild, stack, stacksize, flags, &args);
++#else
+     pid = clone(lxcContainerChild, stacktop, flags, &args);
++#endif
+     VIR_FREE(stack);
+     DEBUG("clone() completed, new container PID is %d", pid);
+ 
+@@ -872,6 +879,7 @@ int lxcContainerAvailable(int features)
+     char *childStack;
+     char *stack;
+     int childStatus;
++    int stacksize = getpagesize() * 4;
+ 
+     if (features & LXC_CONTAINER_FEATURE_USER)
+         flags |= CLONE_NEWUSER;
+@@ -879,14 +887,21 @@ int lxcContainerAvailable(int features)
+     if (features & LXC_CONTAINER_FEATURE_NET)
+         flags |= CLONE_NEWNET;
+ 
+-    if (VIR_ALLOC_N(stack, getpagesize() * 4) < 0) {
++#ifdef __ia64__
++    stacksize *= 2;
++#endif
++    if (VIR_ALLOC_N(stack, stacksize) < 0) {
+         DEBUG0("Unable to allocate stack");
+         return -1;
+     }
+ 
+-    childStack = stack + (getpagesize() * 4);
++    childStack = stack + stacksize;
+ 
++#ifdef __ia64__
++    cpid = __clone2(lxcContainerDummyChild, stack, stacksize, flags, NULL);
++#else
+     cpid = clone(lxcContainerDummyChild, childStack, flags, NULL);
++#endif
+     VIR_FREE(stack);
+     if (cpid < 0) {
+         char ebuf[1024];
diff -urN debian.orig/patches/0103-xen-pv-cdrom.patch debian/patches/0103-xen-pv-cdrom.patch
--- debian.orig/patches/0103-xen-pv-cdrom.patch	1970-01-01 01:00:00.000000000 +0100
+++ debian/patches/0103-xen-pv-cdrom.patch	2010-05-19 18:22:29.000000000 +0200
@@ -0,0 +1,16 @@
+Index: libvirt-0.8.1/src/xen/xend_internal.c
+===================================================================
+--- libvirt-0.8.1.orig/src/xen/xend_internal.c
++++ libvirt-0.8.1/src/xen/xend_internal.c
+@@ -5531,7 +5531,10 @@ xenDaemonFormatSxprDisk(virConnectPtr co
+     } else if (def->device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
+         virBufferVSprintf(buf, "(dev '%s:cdrom')", def->dst);
+     } else {
+-        virBufferVSprintf(buf, "(dev '%s')", def->dst);
++        if (def->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
++            virBufferVSprintf(buf, "(dev '%s:cdrom')", def->dst);
++        else
++            virBufferVSprintf(buf, "(dev '%s')", def->dst);
+     }
+ 
+     if (def->src) {
diff -urN debian.orig/patches/0104-xen-domctl-ver7.patch debian/patches/0104-xen-domctl-ver7.patch
--- debian.orig/patches/0104-xen-domctl-ver7.patch	1970-01-01 01:00:00.000000000 +0100
+++ debian/patches/0104-xen-domctl-ver7.patch	2010-05-19 18:23:12.000000000 +0200
@@ -0,0 +1,272 @@
+Index: libvirt-0.8.0/src/xen/xen_hypervisor.c
+===================================================================
+--- libvirt-0.8.0.orig/src/xen/xen_hypervisor.c
++++ libvirt-0.8.0/src/xen/xen_hypervisor.c
+@@ -230,11 +230,28 @@ struct xen_v2d6_getdomaininfo {
+ };
+ typedef struct xen_v2d6_getdomaininfo xen_v2d6_getdomaininfo;
+ 
++struct xen_v2d7_getdomaininfo {
++    domid_t  domain;	/* the domain number */
++    uint32_t flags;	/* flags, see before */
++    uint64_t tot_pages ALIGN_64;	/* total number of pages used */
++    uint64_t max_pages ALIGN_64;	/* maximum number of pages allowed */
++    uint64_t shr_pages ALIGN_64;    /* number of shared pages */
++    uint64_t shared_info_frame ALIGN_64; /* MFN of shared_info struct */
++    uint64_t cpu_time ALIGN_64;  /* CPU time used */
++    uint32_t nr_online_vcpus;  /* Number of VCPUs currently online. */
++    uint32_t max_vcpu_id; /* Maximum VCPUID in use by this domain. */
++    uint32_t ssidref;
++    xen_domain_handle_t handle;
++    uint32_t cpupool;
++};
++typedef struct xen_v2d7_getdomaininfo xen_v2d7_getdomaininfo;
++
+ union xen_getdomaininfo {
+     struct xen_v0_getdomaininfo v0;
+     struct xen_v2_getdomaininfo v2;
+     struct xen_v2d5_getdomaininfo v2d5;
+     struct xen_v2d6_getdomaininfo v2d6;
++    struct xen_v2d7_getdomaininfo v2d7;
+ };
+ typedef union xen_getdomaininfo xen_getdomaininfo;
+ 
+@@ -243,6 +260,7 @@ union xen_getdomaininfolist {
+     struct xen_v2_getdomaininfo *v2;
+     struct xen_v2d5_getdomaininfo *v2d5;
+     struct xen_v2d6_getdomaininfo *v2d6;
++    struct xen_v2d7_getdomaininfo *v2d7;
+ };
+ typedef union xen_getdomaininfolist xen_getdomaininfolist;
+ 
+@@ -280,147 +298,179 @@ typedef struct xen_v2s5_availheap  xen_v
+ #define XEN_GETDOMAININFOLIST_ALLOC(domlist, size)                      \
+     (hypervisor_version < 2 ?                                           \
+      (VIR_ALLOC_N(domlist.v0, (size)) == 0) :                           \
+-     (dom_interface_version >= 6 ?                                      \
++     (dom_interface_version >= 7 ?                                      \
++      (VIR_ALLOC_N(domlist.v2d7, (size)) == 0) :                        \
++     (dom_interface_version == 6 ?                                      \
+       (VIR_ALLOC_N(domlist.v2d6, (size)) == 0) :                        \
+      (dom_interface_version == 5 ?                                      \
+       (VIR_ALLOC_N(domlist.v2d5, (size)) == 0) :                        \
+-      (VIR_ALLOC_N(domlist.v2, (size)) == 0))))
++      (VIR_ALLOC_N(domlist.v2, (size)) == 0)))))
+ 
+ #define XEN_GETDOMAININFOLIST_FREE(domlist)            \
+     (hypervisor_version < 2 ?                          \
+      VIR_FREE(domlist.v0) :                            \
+-     (dom_interface_version >= 6 ?                     \
++     (dom_interface_version >= 7 ?                     \
++      VIR_FREE(domlist.v2d7) :                         \
++     (dom_interface_version == 6 ?                     \
+       VIR_FREE(domlist.v2d6) :                         \
+      (dom_interface_version == 5 ?                     \
+       VIR_FREE(domlist.v2d5) :                         \
+-      VIR_FREE(domlist.v2))))
++      VIR_FREE(domlist.v2)))))
+ 
+ #define XEN_GETDOMAININFOLIST_CLEAR(domlist, size)            \
+     (hypervisor_version < 2 ?                                 \
+      memset(domlist.v0, 0, sizeof(*domlist.v0) * size) :      \
+-     (dom_interface_version >= 6 ?                            \
++     (dom_interface_version >= 7 ?                            \
++      memset(domlist.v2d7, 0, sizeof(*domlist.v2d7) * size) : \
++     (dom_interface_version == 6 ?                            \
+       memset(domlist.v2d6, 0, sizeof(*domlist.v2d6) * size) : \
+      (dom_interface_version == 5 ?                            \
+       memset(domlist.v2d5, 0, sizeof(*domlist.v2d5) * size) : \
+-      memset(domlist.v2, 0, sizeof(*domlist.v2) * size))))
++      memset(domlist.v2, 0, sizeof(*domlist.v2) * size)))))
+ 
+ #define XEN_GETDOMAININFOLIST_DOMAIN(domlist, n)    \
+     (hypervisor_version < 2 ?                       \
+      domlist.v0[n].domain :                         \
+-     (dom_interface_version >= 6 ?                  \
++     (dom_interface_version >= 7 ?                  \
++      domlist.v2d7[n].domain :                      \
++     (dom_interface_version == 6 ?                  \
+       domlist.v2d6[n].domain :                      \
+      (dom_interface_version == 5 ?                  \
+       domlist.v2d5[n].domain :                      \
+-      domlist.v2[n].domain)))
++      domlist.v2[n].domain))))
+ 
+ #define XEN_GETDOMAININFOLIST_UUID(domlist, n)      \
+     (hypervisor_version < 2 ?                       \
+      domlist.v0[n].handle :                         \
+-     (dom_interface_version >= 6 ?                  \
++     (dom_interface_version >= 7 ?                  \
++      domlist.v2d7[n].handle :                      \
++     (dom_interface_version == 6 ?                  \
+       domlist.v2d6[n].handle :                      \
+      (dom_interface_version == 5 ?                  \
+       domlist.v2d5[n].handle :                      \
+-      domlist.v2[n].handle)))
++      domlist.v2[n].handle))))
+ 
+ #define XEN_GETDOMAININFOLIST_DATA(domlist)        \
+     (hypervisor_version < 2 ?                      \
+      (void*)(domlist->v0) :                        \
+-     (dom_interface_version >= 6 ?                 \
++     (dom_interface_version >= 7 ?                 \
++      (void*)(domlist->v2d7) :                     \
++     (dom_interface_version == 6 ?                 \
+       (void*)(domlist->v2d6) :                     \
+      (dom_interface_version == 5 ?                 \
+       (void*)(domlist->v2d5) :                     \
+-      (void*)(domlist->v2))))
++      (void*)(domlist->v2)))))
+ 
+ #define XEN_GETDOMAININFO_SIZE                     \
+     (hypervisor_version < 2 ?                      \
+      sizeof(xen_v0_getdomaininfo) :                \
+-     (dom_interface_version >= 6 ?                 \
++     (dom_interface_version >= 7 ?                 \
++      sizeof(xen_v2d7_getdomaininfo) :             \
++     (dom_interface_version == 6 ?                 \
+       sizeof(xen_v2d6_getdomaininfo) :             \
+      (dom_interface_version == 5 ?                 \
+       sizeof(xen_v2d5_getdomaininfo) :             \
+-      sizeof(xen_v2_getdomaininfo))))
++      sizeof(xen_v2_getdomaininfo)))))
+ 
+ #define XEN_GETDOMAININFO_CLEAR(dominfo)                           \
+     (hypervisor_version < 2 ?                                      \
+      memset(&(dominfo.v0), 0, sizeof(xen_v0_getdomaininfo)) :      \
+-     (dom_interface_version >= 6 ?                                 \
++     (dom_interface_version >= 7 ?                                 \
++      memset(&(dominfo.v2d7), 0, sizeof(xen_v2d7_getdomaininfo)) : \
++     (dom_interface_version == 6 ?                                 \
+       memset(&(dominfo.v2d6), 0, sizeof(xen_v2d6_getdomaininfo)) : \
+      (dom_interface_version == 5 ?                                 \
+       memset(&(dominfo.v2d5), 0, sizeof(xen_v2d5_getdomaininfo)) : \
+-      memset(&(dominfo.v2), 0, sizeof(xen_v2_getdomaininfo)))))
++      memset(&(dominfo.v2), 0, sizeof(xen_v2_getdomaininfo))))))
+ 
+ #define XEN_GETDOMAININFO_DOMAIN(dominfo)       \
+     (hypervisor_version < 2 ?                   \
+      dominfo.v0.domain :                        \
+-     (dom_interface_version >= 6 ?              \
++     (dom_interface_version >= 7 ?              \
++      dominfo.v2d7.domain :                     \
++     (dom_interface_version == 6 ?              \
+       dominfo.v2d6.domain :                     \
+      (dom_interface_version == 5 ?              \
+       dominfo.v2d5.domain :                     \
+-      dominfo.v2.domain)))
++      dominfo.v2.domain))))
+ 
+ #define XEN_GETDOMAININFO_CPUTIME(dominfo)      \
+     (hypervisor_version < 2 ?                   \
+      dominfo.v0.cpu_time :                      \
+-     (dom_interface_version >= 6 ?              \
++     (dom_interface_version >= 7 ?              \
++      dominfo.v2d7.cpu_time :                   \
++     (dom_interface_version == 6 ?              \
+       dominfo.v2d6.cpu_time :                   \
+      (dom_interface_version == 5 ?              \
+       dominfo.v2d5.cpu_time :                   \
+-      dominfo.v2.cpu_time)))
++      dominfo.v2.cpu_time))))
+ 
+ 
+ #define XEN_GETDOMAININFO_CPUCOUNT(dominfo)     \
+     (hypervisor_version < 2 ?                   \
+      dominfo.v0.nr_online_vcpus :               \
+-     (dom_interface_version >= 6 ?              \
++     (dom_interface_version >= 7 ?              \
++      dominfo.v2d7.nr_online_vcpus :            \
++     (dom_interface_version == 6 ?              \
+       dominfo.v2d6.nr_online_vcpus :            \
+      (dom_interface_version == 5 ?              \
+       dominfo.v2d5.nr_online_vcpus :            \
+-      dominfo.v2.nr_online_vcpus)))
++      dominfo.v2.nr_online_vcpus))))
+ 
+ #define XEN_GETDOMAININFO_MAXCPUID(dominfo)  \
+     (hypervisor_version < 2 ?                   \
+      dominfo.v0.max_vcpu_id :                   \
+-     (dom_interface_version >= 6 ?              \
++     (dom_interface_version >= 7 ?              \
++      dominfo.v2d7.max_vcpu_id :                \
++     (dom_interface_version == 6 ?              \
+       dominfo.v2d6.max_vcpu_id :                \
+      (dom_interface_version == 5 ?              \
+       dominfo.v2d5.max_vcpu_id :                \
+-      dominfo.v2.max_vcpu_id)))
++      dominfo.v2.max_vcpu_id))))
+ 
+ #define XEN_GETDOMAININFO_FLAGS(dominfo)        \
+     (hypervisor_version < 2 ?                   \
+      dominfo.v0.flags :                         \
+-     (dom_interface_version >= 6 ?              \
++     (dom_interface_version >= 7 ?              \
++      dominfo.v2d7.flags :                      \
++     (dom_interface_version == 6 ?              \
+       dominfo.v2d6.flags :                      \
+      (dom_interface_version == 5 ?              \
+       dominfo.v2d5.flags :                      \
+-      dominfo.v2.flags)))
++      dominfo.v2.flags))))
+ 
+ #define XEN_GETDOMAININFO_TOT_PAGES(dominfo)    \
+     (hypervisor_version < 2 ?                   \
+      dominfo.v0.tot_pages :                     \
+-     (dom_interface_version >= 6 ?              \
++     (dom_interface_version >= 7 ?              \
++      dominfo.v2d7.tot_pages :                  \
++     (dom_interface_version == 6 ?              \
+       dominfo.v2d6.tot_pages :                  \
+      (dom_interface_version == 5 ?              \
+       dominfo.v2d5.tot_pages :                  \
+-      dominfo.v2.tot_pages)))
++      dominfo.v2.tot_pages))))
+ 
+ #define XEN_GETDOMAININFO_MAX_PAGES(dominfo)    \
+     (hypervisor_version < 2 ?                   \
+      dominfo.v0.max_pages :                     \
+-     (dom_interface_version >= 6 ?              \
++     (dom_interface_version >= 7 ?              \
++      dominfo.v2d7.max_pages :                  \
++     (dom_interface_version == 6 ?              \
+       dominfo.v2d6.max_pages :                  \
+      (dom_interface_version == 5 ?              \
+       dominfo.v2d5.max_pages :                  \
+-      dominfo.v2.max_pages)))
++      dominfo.v2.max_pages))))
+ 
+ #define XEN_GETDOMAININFO_UUID(dominfo)         \
+     (hypervisor_version < 2 ?                   \
+      dominfo.v0.handle :                        \
+-     (dom_interface_version >= 6 ?              \
++     (dom_interface_version >= 7 ?              \
++      dominfo.v2d7.handle :                     \
++     (dom_interface_version == 6 ?              \
+       dominfo.v2d6.handle :                     \
+      (dom_interface_version == 5 ?              \
+       dominfo.v2d5.handle :                     \
+-      dominfo.v2.handle)))
++      dominfo.v2.handle))))
+ 
+ 
+ static int
+@@ -2105,8 +2155,16 @@ xenHypervisorInit(void)
+     sys_interface_version = 7; /* XEN_SYSCTL_INTERFACE_VERSION */
+     if (virXen_getdomaininfo(fd, 0, &info) == 1) {
+         dom_interface_version = 6; /* XEN_DOMCTL_INTERFACE_VERSION */
+-        DEBUG0("Using hypervisor call v2, sys ver7 dom ver6");
+-        goto done;
++        if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
++            DEBUG0("Using hypervisor call v2, sys ver6 dom ver6\n");
++            goto done;
++        }
++        /* CPU Pools addition to domctl interface */
++        dom_interface_version = 7; /* XEN_DOMCTL_INTERFACE_VERSION */
++        if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){
++            DEBUG0("Using hypervisor call v2, sys ver6 dom ver7\n");
++            goto done;
++        }
+     }
+ 
+     hypervisor_version = 1;
diff -urN debian.orig/patches/0105-xen-tap2-support.patch debian/patches/0105-xen-tap2-support.patch
--- debian.orig/patches/0105-xen-tap2-support.patch	1970-01-01 01:00:00.000000000 +0100
+++ debian/patches/0105-xen-tap2-support.patch	2010-05-19 18:22:15.000000000 +0200
@@ -0,0 +1,30 @@
+Index: libvirt-0.8.1/src/xen/xend_internal.c
+===================================================================
+--- libvirt-0.8.1.orig/src/xen/xend_internal.c
++++ libvirt-0.8.1/src/xen/xend_internal.c
+@@ -1596,7 +1596,8 @@ xenDaemonParseSxprDisks(virDomainDefPtr
+            but blktap disks ended up in a differently named
+            (device (tap ....)) block.... */
+         if (sexpr_lookup(node, "device/vbd") ||
+-            sexpr_lookup(node, "device/tap")) {
++            sexpr_lookup(node, "device/tap") ||
++            sexpr_lookup(node, "device/tap2")) {
+             char *offset;
+             const char *src = NULL;
+             const char *dst = NULL;
+@@ -1607,10 +1608,14 @@ xenDaemonParseSxprDisks(virDomainDefPtr
+                 src = sexpr_node(node, "device/vbd/uname");
+                 dst = sexpr_node(node, "device/vbd/dev");
+                 mode = sexpr_node(node, "device/vbd/mode");
+-            } else {
++            } else if (sexpr_lookup(node, "device/tap")) {
+                 src = sexpr_node(node, "device/tap/uname");
+                 dst = sexpr_node(node, "device/tap/dev");
+                 mode = sexpr_node(node, "device/tap/mode");
++            } else {
++                src = sexpr_node(node, "device/tap2/uname");
++                dst = sexpr_node(node, "device/tap2/dev");
++                mode = sexpr_node(node, "device/tap2/mode");
+             }
+ 
+             if (VIR_ALLOC(disk) < 0)
diff -urN debian.orig/patches/0106-xend-disk-order.patch debian/patches/0106-xend-disk-order.patch
--- debian.orig/patches/0106-xend-disk-order.patch	1970-01-01 01:00:00.000000000 +0100
+++ debian/patches/0106-xend-disk-order.patch	2010-05-19 18:22:05.000000000 +0200
@@ -0,0 +1,43 @@
+Index: libvirt-0.8.1/src/xen/xend_internal.c
+===================================================================
+--- libvirt-0.8.1.orig/src/xen/xend_internal.c
++++ libvirt-0.8.1/src/xen/xend_internal.c
+@@ -1602,20 +1602,24 @@ xenDaemonParseSxprDisks(virDomainDefPtr
+             const char *src = NULL;
+             const char *dst = NULL;
+             const char *mode = NULL;
++            int bootable;
+ 
+             /* Again dealing with (vbd...) vs (tap ...) differences */
+             if (sexpr_lookup(node, "device/vbd")) {
+                 src = sexpr_node(node, "device/vbd/uname");
+                 dst = sexpr_node(node, "device/vbd/dev");
+                 mode = sexpr_node(node, "device/vbd/mode");
++                bootable = sexpr_int(node, "device/vbd/bootable");
+             } else if (sexpr_lookup(node, "device/tap")) {
+                 src = sexpr_node(node, "device/tap/uname");
+                 dst = sexpr_node(node, "device/tap/dev");
+                 mode = sexpr_node(node, "device/tap/mode");
++                bootable = sexpr_int(node, "device/tap/bootable");
+             } else {
+                 src = sexpr_node(node, "device/tap2/uname");
+                 dst = sexpr_node(node, "device/tap2/dev");
+                 mode = sexpr_node(node, "device/tap2/mode");
++                bootable = sexpr_int(node, "device/tap2/bootable");
+             }
+ 
+             if (VIR_ALLOC(disk) < 0)
+@@ -1740,7 +1744,12 @@ xenDaemonParseSxprDisks(virDomainDefPtr
+             if (VIR_REALLOC_N(def->disks, def->ndisks+1) < 0)
+                 goto no_memory;
+ 
+-            def->disks[def->ndisks++] = disk;
++            if (bootable == 1 && def->ndisks > 0) {
++                memmove(def->disks + 1, def->disks, sizeof(def->disks) * def->ndisks);
++                def->disks[0] = disk;
++                def->ndisks++;
++            } else
++                def->disks[def->ndisks++] = disk;
+             disk = NULL;
+         }
+     }
diff -urN debian.orig/patches/0200-libvirtd-defaults.patch debian/patches/0200-libvirtd-defaults.patch
--- debian.orig/patches/0200-libvirtd-defaults.patch	1970-01-01 01:00:00.000000000 +0100
+++ debian/patches/0200-libvirtd-defaults.patch	2010-05-19 18:24:40.000000000 +0200
@@ -0,0 +1,52 @@
+Index: libvirt-0.8.0/daemon/libvirtd.conf
+===================================================================
+--- libvirt-0.8.0.orig/daemon/libvirtd.conf
++++ libvirt-0.8.0/daemon/libvirtd.conf
+@@ -18,8 +18,8 @@
+ # It is necessary to setup a CA and issue server certificates before
+ # using this capability.
+ #
+-# This is enabled by default, uncomment this to disable it
+-#listen_tls = 0
++# This is disabled by default, uncomment this to enable it
++#listen_tls = 1
+ 
+ # Listen for unencrypted TCP connections on the public TCP/IP port.
+ # NB, must pass the --listen flag to the libvirtd process for this to
+@@ -53,11 +53,9 @@
+ 
+ # Flag toggling mDNS advertizement of the libvirt service.
+ #
+-# Alternatively can disable for all services on a host by
+-# stopping the Avahi daemon
+-#
+-# This is enabled by default, uncomment this to disable it
+-#mdns_adv = 0
++# Disabled by default.  To enable, ensure the Avahi daemon is
++# running and uncomment this flag.
++#mdns_adv = 1
+ 
+ # Override the default mDNS advertizement name. This must be
+ # unique on the immediate broadcast network.
+Index: libvirt-0.8.0/daemon/libvirtd.c
+===================================================================
+--- libvirt-0.8.0.orig/daemon/libvirtd.c
++++ libvirt-0.8.0/daemon/libvirtd.c
+@@ -141,7 +141,7 @@ static int sigwrite = -1;       /* Signa
+ static int ipsock = 0;          /* -l  Listen for TCP/IP */
+ 
+ /* Defaults for configuration file elements */
+-static int listen_tls = 1;
++static int listen_tls = 0;
+ static int listen_tcp = 0;
+ static char *listen_addr  = (char *) LIBVIRTD_LISTEN_ADDR;
+ static char *tls_port = (char *) LIBVIRTD_TLS_PORT;
+@@ -163,7 +163,7 @@ static int auth_tcp = REMOTE_AUTH_NONE;
+ #endif
+ static int auth_tls = REMOTE_AUTH_NONE;
+ 
+-static int mdns_adv = 1;
++static int mdns_adv = 0;
+ static char *mdns_name = NULL;
+ 
+ static int tls_no_verify_certificate = 0;
diff -urN debian.orig/patches/series debian/patches/series
--- debian.orig/patches/series	2010-05-09 14:00:39.000000000 +0200
+++ debian/patches/series	2010-05-20 00:19:34.000000000 +0200
@@ -5,3 +5,12 @@
 0005-Terminate-nc-on-EOF.patch
 0006-Don-t-drop-caps-when-exec-ing-qemu.patch
 0007-patch-qemuMonitorTextGetMigrationStatus-to-intercept.patch
+0099-remote-rm-unused-field.patch
+0100-xen-name-for-devid.patch
+0101-socat.patch
+0102-clone.patch
+0103-xen-pv-cdrom.patch
+0104-xen-domctl-ver7.patch
+0105-xen-tap2-support.patch
+0106-xend-disk-order.patch
+0200-libvirtd-defaults.patch
diff -urN debian.orig/patches/socat.patch.opensuse debian/patches/socat.patch.opensuse
--- debian.orig/patches/socat.patch.opensuse	1970-01-01 01:00:00.000000000 +0100
+++ debian/patches/socat.patch.opensuse	2010-05-19 18:23:38.000000000 +0200
@@ -0,0 +1,40 @@
+Index: libvirt-0.8.1/src/remote/remote_driver.c
+===================================================================
+--- libvirt-0.8.1.orig/src/remote/remote_driver.c
++++ libvirt-0.8.1/src/remote/remote_driver.c
+@@ -769,12 +769,29 @@ doRemoteOpen (virConnectPtr conn,
+             cmd_argv[j++] = strdup ("none");
+         }
+         cmd_argv[j++] = strdup (priv->hostname);
+-        cmd_argv[j++] = strdup (netcat ? netcat : "nc");
+-        cmd_argv[j++] = strdup ("-U");
+-        cmd_argv[j++] = strdup (sockname ? sockname :
+-                                (flags & VIR_CONNECT_RO
+-                                 ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
+-                                 : LIBVIRTD_PRIV_UNIX_SOCKET));
++        if (netcat) {
++           cmd_argv[j++] = strdup (netcat);
++           cmd_argv[j++] = strdup ("-U");
++           cmd_argv[j++] = strdup (sockname ? sockname :
++                                   (flags & VIR_CONNECT_RO
++                                    ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
++                                    : LIBVIRTD_PRIV_UNIX_SOCKET));
++        } else {
++           cmd_argv[j++] = strdup ("socat");
++           cmd_argv[j++] = strdup ("-");
++
++           char *socat_addr = NULL;
++           if ((asprintf (&socat_addr, "GOPEN:%s",
++                          sockname ? sockname :
++                          (flags & VIR_CONNECT_RO
++                           ? LIBVIRTD_PRIV_UNIX_SOCKET_RO
++                           : LIBVIRTD_PRIV_UNIX_SOCKET))) < 0) {
++              error (conn, VIR_ERR_SYSTEM_ERROR, strerror (ENOMEM));
++              goto failed;
++           }
++           cmd_argv[j++] = strdup (socat_addr);
++           VIR_FREE(socat_addr);
++        }
+         cmd_argv[j++] = 0;
+         assert (j == nr_args);
+         for (j = 0; j < (nr_args-1); j++)
diff -urN debian.orig/rules debian/rules
--- debian.orig/rules	2010-05-09 14:06:12.000000000 +0200
+++ debian/rules	2010-05-20 00:26:44.000000000 +0200
@@ -41,9 +41,9 @@
 	--without-numactl	 \
 	--without-selinux        \
 	--without-esx		 \
-	--without-libssh2	 \
+	--with-libssh2	 \
 	--with-capng		 \
-	--with-macvtap		 \
+	--without-macvtap		 \
 	--enable-debug		 \
 	$(BUILD_XEN)		 \
 	$(BUILD_VBOX)		 \
