[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [Patch] Fix detach tap device on Xen3.3.1


I made the patch that corrected the following problem.

It is that when I executed the "virsh detach-disk" command on Xen3.3.1,
Libvirt could not detach tap device and output the following error

# virsh detach-disk Fedora xvdd
libvir: Xen Daemon error : POST operation failed: xend_post: error
from xen daemon: (xend.err 'Device 51760 not connected')

The cause of this problem is incompatible of Xen3.3.0 and Xen3.3.1.
I think Xen specific was changed by the following patch.

If you have any comments, please suggest me.

Signed-off-by: Tomohiro Takahashi <takatom jp fujitsu com>

Tomohiro Takahashi
diff -uNrp libvirt.orig/src/xend_internal.c libvirt/src/xend_internal.c
--- libvirt.orig/src/xend_internal.c	2009-02-14 03:23:23.000000000 +0900
+++ libvirt/src/xend_internal.c	2009-03-09 12:28:48.000000000 +0900
@@ -5566,7 +5566,11 @@ virDomainXMLDevID(virDomainPtr domain,
     char *xref;
     if (dev->type == VIR_DOMAIN_DEVICE_DISK) {
-        strcpy(class, "vbd");
+        if (!(strcmp(dev->data.disk->driverName, "tap"))) {
+            strcpy(class, "tap");
+        } else {
+            strcpy(class, "vbd");
+        }
         if (dev->data.disk->dst == NULL)
             return -1;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]