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

Hi, 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 message. # 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. http://xenbits.xensource.com/xen-3.3-testing.hg?rev/e0e17216ba70 If you have any comments, please suggest me. Signed-off-by: Tomohiro Takahashi <takatom@jp.fujitsu.com> Thanks, 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; xenUnifiedLock(priv);

On Mon, Mar 09, 2009 at 01:30:50PM +0900, Takahashi Tomohiro wrote:
Hi,
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 message.
# 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. http://xenbits.xensource.com/xen-3.3-testing.hg?rev/e0e17216ba70
If you have any comments, please suggest me.
Signed-off-by: Tomohiro Takahashi <takatom@jp.fujitsu.com>
Thanks for reminding me about this problem - we've actally been tracking this in BZ too. https://bugzilla.redhat.com/show_bug.cgi?id=475791 There's a patch in that bug which does basically the same thing as yours, but with STREQ & an additional check to avoid NULL dereference Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Hi Daniel-san, Thank you for your infomation. I would like to know your plan to commit the following patch. If there is not problem, please commit it. https://bugzilla.redhat.com/show_bug.cgi?id=475791 Thanks, Tomohiro Takahashi. Daniel P. Berrange wrote:
On Mon, Mar 09, 2009 at 01:30:50PM +0900, Takahashi Tomohiro wrote:
Hi,
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 message.
# 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. http://xenbits.xensource.com/xen-3.3-testing.hg?rev/e0e17216ba70
If you have any comments, please suggest me.
Signed-off-by: Tomohiro Takahashi <takatom@jp.fujitsu.com>
Thanks for reminding me about this problem - we've actally been tracking this in BZ too.
https://bugzilla.redhat.com/show_bug.cgi?id=475791
There's a patch in that bug which does basically the same thing as yours, but with STREQ & an additional check to avoid NULL dereference
Daniel

On Tue, Mar 10, 2009 at 09:24:24AM +0900, Takahashi Tomohiro wrote:
Hi Daniel-san,
Thank you for your infomation.
I would like to know your plan to commit the following patch. If there is not problem, please commit it. https://bugzilla.redhat.com/show_bug.cgi?id=475791
I have just committed this fix now. Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (2)
-
Daniel P. Berrange
-
Takahashi Tomohiro