From cc3584ffb47eb741631953a2577d6b0fe9e690a295d5926323e445e9034760f2 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 21 Nov 2008 14:32:50 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libvirt?expand=0&rev=28 --- detach-disk.patch | 59 ++++++++++++++++++++++++++++++++++++++++++++++ libvirt.changes | 6 +++++ libvirt.spec | 7 +++++- suse-network.patch | 2 +- 4 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 detach-disk.patch diff --git a/detach-disk.patch b/detach-disk.patch new file mode 100644 index 0000000..2176f1f --- /dev/null +++ b/detach-disk.patch @@ -0,0 +1,59 @@ +Index: libvirt-0.4.6/src/xend_internal.c +=================================================================== +--- libvirt-0.4.6.orig/src/xend_internal.c ++++ libvirt-0.4.6/src/xend_internal.c +@@ -5615,11 +5615,15 @@ virDomainXMLDevID(virDomainPtr domain, + char *xref; + + if (dev->type == VIR_DOMAIN_DEVICE_DISK) { +- strcpy(class, "vbd"); + if (dev->data.disk->dst == NULL) + return -1; ++ ++ if (strcasecmp(dev->data.disk->driverName, "tap") == 0) ++ strcpy(class, "tap"); ++ else ++ strcpy(class, "vbd"); + xref = xenStoreDomainGetDiskID(domain->conn, domain->id, +- dev->data.disk->dst); ++ dev->data.disk->dst, class); + if (xref == NULL) + return -1; + +Index: libvirt-0.4.6/src/xs_internal.c +=================================================================== +--- libvirt-0.4.6.orig/src/xs_internal.c ++++ libvirt-0.4.6/src/xs_internal.c +@@ -868,7 +868,8 @@ xenStoreDomainGetNetworkID(virConnectPtr + * freed by the caller. + */ + char * +-xenStoreDomainGetDiskID(virConnectPtr conn, int id, const char *dev) { ++xenStoreDomainGetDiskID(virConnectPtr conn, int id, ++ const char *dev, const char *class) { + char dir[80], path[128], **list = NULL, *val = NULL; + unsigned int devlen, len, i, num; + char *ret = NULL; +@@ -886,7 +887,7 @@ xenStoreDomainGetDiskID(virConnectPtr co + if (devlen <= 0) + return (NULL); + +- snprintf(dir, sizeof(dir), "/local/domain/0/backend/vbd/%d", id); ++ snprintf(dir, sizeof(dir), "/local/domain/0/backend/%s/%d", class, id); + list = xs_directory(priv->xshandle, 0, dir, &num); + if (list != NULL) { + for (i = 0; i < num; i++) { +Index: libvirt-0.4.6/src/xs_internal.h +=================================================================== +--- libvirt-0.4.6.orig/src/xs_internal.h ++++ libvirt-0.4.6/src/xs_internal.h +@@ -49,7 +49,8 @@ char * xenStoreDomainGetNetworkID(virCo + const char *mac); + char * xenStoreDomainGetDiskID(virConnectPtr conn, + int id, +- const char *dev); ++ const char *dev, ++ const char *class); + char * xenStoreDomainGetName(virConnectPtr conn, + int id); + diff --git a/libvirt.changes b/libvirt.changes index 487fcd4..4087f39 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Nov 20 21:53:13 MST 2008 - jfehlig@novell.com + +- Fix detach of Xen tap devices + bnc#410644 and bnc#411633 + ------------------------------------------------------------------- Thu Nov 6 19:14:29 MST 2008 - jfehlig@novell.com diff --git a/libvirt.spec b/libvirt.spec index 99cc9a7..d913e85 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -49,7 +49,7 @@ License: LGPL v2.1 or later Group: Development/Libraries/C and C++ AutoReqProv: yes Version: 0.4.6 -Release: 7 +Release: 8 Summary: A C toolkit to interract with the virtualization capabilities of Linux Requires: readline Requires: ncurses @@ -83,6 +83,7 @@ Patch13: clone.patch Patch14: vnc-port.patch Patch15: suse-network.patch Patch16: xen-pv-cdrom.patch +Patch17: detach-disk.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -190,6 +191,7 @@ Authors: %patch14 -p1 %patch15 -p1 %patch16 -p1 +%patch17 -p1 rm po/no.* %build @@ -322,6 +324,9 @@ rm -rf $RPM_BUILD_ROOT %{py_sitedir}/libvirtmod* %changelog +* Thu Nov 20 2008 jfehlig@novell.com +- Fix detach of Xen tap devices + bnc#410644 and bnc#411633 * Thu Nov 06 2008 jfehlig@novell.com - Fix handling of iso/cdrom for xen pv domains. bnc#437388 diff --git a/suse-network.patch b/suse-network.patch index 75612d1..69bde60 100644 --- a/suse-network.patch +++ b/suse-network.patch @@ -121,7 +121,7 @@ Index: libvirt-0.4.6/src/network_conf.c + + dir = opendir("/sys/class/net"); + if (dir == NULL) -+ return NULL; ++ return; + + while ((de = readdir(dir))) { + if (virNetworkIsBridge(de->d_name)) {