SHA256
1
0
forked from pool/libvirt
OBS User unknown 2008-11-21 14:32:50 +00:00 committed by Git OBS Bridge
parent 8e48089ef0
commit cc3584ffb4
4 changed files with 72 additions and 2 deletions

59
detach-disk.patch Normal file
View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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)) {