Compare commits
56 Commits
libvirt-0_
...
libvirt-0_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
585033f372 | ||
|
|
897506e66a | ||
|
|
e4bf8ffa42 | ||
|
|
20367a58a6 | ||
|
|
aa037364ed | ||
|
|
c034c1a3b2 | ||
|
|
da05e02884 | ||
|
|
e1b7b518ac | ||
|
|
581b5f5022 | ||
|
|
c476c8b683 | ||
|
|
b93eafc59f | ||
|
|
2105d62ca8 | ||
|
|
743adffffe | ||
|
|
11e3b51c0d | ||
|
|
66df925739 | ||
|
|
b20a5c6d3b | ||
|
|
7f58f3aa54 | ||
|
|
6577b14441 | ||
|
|
2e7812764f | ||
|
|
854b878580 | ||
|
|
89c28e4013 | ||
|
|
db269c2d21 | ||
|
|
98e4f7ee9f | ||
|
|
0c4afc5ee9 | ||
|
|
593255292e | ||
|
|
ccafc8ecb4 | ||
|
|
a38fb9cbc1 | ||
|
|
6359121866 | ||
|
|
b20d669e88 | ||
|
|
a3e1cc37ed | ||
|
|
a6eca3382d | ||
|
|
c6c5072e90 | ||
|
|
705fd20a0e | ||
|
|
e0e9927d93 | ||
|
|
bae7a0fb84 | ||
|
|
36aee593bc | ||
|
|
dc0cb0e91a | ||
|
|
84d66312fe | ||
|
|
4f644ce267 | ||
|
|
cdd5b3d62d | ||
|
|
53f63aa62d | ||
|
|
748df35c5f | ||
|
|
a6e23d00fa | ||
|
|
c6d11b43c9 | ||
|
|
83091ff0dd | ||
|
|
4465a63872 | ||
|
|
3f397d9786 | ||
|
|
750aec5507 | ||
|
|
d7c1d3bbc0 | ||
|
|
fa0f21c263 | ||
|
|
afdaf5d354 | ||
|
|
26bba5aea9 | ||
|
|
1a4185bdcc | ||
|
|
6a73119e65 | ||
|
|
1e2f9fce0a | ||
|
|
f5edf79c95 |
@@ -5,3 +5,9 @@ x86_64
|
||||
libvirt-*.tar.gz
|
||||
libvirt-0.6.0.tar.gz
|
||||
libvirt-0.6.1.tar.gz
|
||||
libvirt-0.6.2.tar.gz
|
||||
libvirt-0.6.3.tar.gz
|
||||
libvirt-0.6.4.tar.gz
|
||||
libvirt-0.6.5.tar.gz
|
||||
libvirt-0.7.0.tar.gz
|
||||
libvirt-0.7.1.tar.gz
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
From: Daniel P. Berrange <berrange@redhat.com>
|
||||
Date: Mon, 16 Mar 2009 10:35:21 +0000 (+0000)
|
||||
Subject: Fix dispatch of FD events when one or more handles are marked deleted
|
||||
X-Git-Url: http://git.et.redhat.com/?p=libvirt.git;a=commitdiff_plain;h=10baf3deb8588f5902b6f2eb362fb408707e3d95
|
||||
|
||||
Fix dispatch of FD events when one or more handles are marked deleted
|
||||
---
|
||||
|
||||
diff --git a/qemud/event.c b/qemud/event.c
|
||||
index c9ea563..0887008 100644
|
||||
--- a/qemud/event.c
|
||||
+++ b/qemud/event.c
|
||||
@@ -409,25 +409,26 @@ static int virEventDispatchTimeouts(void) {
|
||||
* Returns 0 upon success, -1 if an error occurred
|
||||
*/
|
||||
static int virEventDispatchHandles(int nfds, struct pollfd *fds) {
|
||||
- int i;
|
||||
+ int i, n;
|
||||
|
||||
- for (i = 0 ; i < nfds ; i++) {
|
||||
+ for (i = 0, n = 0 ; i < eventLoop.handlesCount && n < nfds ; i++) {
|
||||
if (eventLoop.handles[i].deleted) {
|
||||
EVENT_DEBUG("Skip deleted %d", eventLoop.handles[i].fd);
|
||||
continue;
|
||||
}
|
||||
|
||||
- if (fds[i].revents) {
|
||||
+ if (fds[n].revents) {
|
||||
virEventHandleCallback cb = eventLoop.handles[i].cb;
|
||||
void *opaque = eventLoop.handles[i].opaque;
|
||||
- int hEvents = virPollEventToEventHandleType(fds[i].revents);
|
||||
- EVENT_DEBUG("Dispatch %d %d %p", fds[i].fd,
|
||||
- fds[i].revents, eventLoop.handles[i].opaque);
|
||||
+ int hEvents = virPollEventToEventHandleType(fds[n].revents);
|
||||
+ EVENT_DEBUG("Dispatch %d %d %p", fds[n].fd,
|
||||
+ fds[n].revents, eventLoop.handles[i].opaque);
|
||||
virEventUnlock();
|
||||
(cb)(eventLoop.handles[i].watch,
|
||||
- fds[i].fd, hEvents, opaque);
|
||||
+ fds[n].fd, hEvents, opaque);
|
||||
virEventLock();
|
||||
}
|
||||
+ n++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -1,78 +0,0 @@
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Mon, 16 Mar 2009 10:41:37 +0000 (+0000)
|
||||
Subject: Avoid some potential FILE * leaks
|
||||
X-Git-Url: http://git.et.redhat.com/?p=libvirt.git;a=commitdiff_plain;h=39429bab2d55807698d9aed0112200ae532799b8
|
||||
|
||||
Avoid some potential FILE * leaks
|
||||
* qemud/qemud.c src/cgroup.c src/uml_driver.c src/util.c: close
|
||||
some potential FILE * leaks
|
||||
Daniel
|
||||
---
|
||||
|
||||
diff --git a/qemud/qemud.c b/qemud/qemud.c
|
||||
index fd315fc..4f04355 100644
|
||||
--- a/qemud/qemud.c
|
||||
+++ b/qemud/qemud.c
|
||||
@@ -488,7 +488,7 @@ static int qemudWritePidFile(const char *pidFile) {
|
||||
if (fprintf(fh, "%lu\n", (unsigned long)getpid()) < 0) {
|
||||
VIR_ERROR(_("Failed to write to pid file '%s' : %s"),
|
||||
pidFile, virStrerror(errno, ebuf, sizeof ebuf));
|
||||
- close(fd);
|
||||
+ fclose(fh);
|
||||
return -1;
|
||||
}
|
||||
|
||||
diff --git a/src/cgroup.c b/src/cgroup.c
|
||||
index 5af44bd..d1d44a2 100644
|
||||
--- a/src/cgroup.c
|
||||
+++ b/src/cgroup.c
|
||||
@@ -57,7 +57,7 @@ void virCgroupFree(virCgroupPtr *group)
|
||||
|
||||
static virCgroupPtr virCgroupGetMount(const char *controller)
|
||||
{
|
||||
- FILE *mounts;
|
||||
+ FILE *mounts = NULL;
|
||||
struct mntent entry;
|
||||
char buf[CGROUP_MAX_VAL];
|
||||
virCgroupPtr root = NULL;
|
||||
@@ -90,6 +90,8 @@ static virCgroupPtr virCgroupGetMount(const char *controller)
|
||||
|
||||
return root;
|
||||
err:
|
||||
+ if (mounts != NULL)
|
||||
+ fclose(mounts);
|
||||
virCgroupFree(&root);
|
||||
|
||||
return NULL;
|
||||
diff --git a/src/uml_driver.c b/src/uml_driver.c
|
||||
index 1dc7ccd..f7400f9 100644
|
||||
--- a/src/uml_driver.c
|
||||
+++ b/src/uml_driver.c
|
||||
@@ -547,6 +547,7 @@ reopen:
|
||||
|
||||
if (fscanf(file, "%d", &vm->pid) != 1) {
|
||||
errno = EINVAL;
|
||||
+ fclose(file);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -1040,6 +1041,7 @@ static int umlGetProcessInfo(unsigned long long *cpuTime, int pid) {
|
||||
|
||||
if (fscanf(pidinfo, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %llu %llu", &usertime, &systime) != 2) {
|
||||
umlDebug("not enough arg");
|
||||
+ fclose(pidinfo);
|
||||
return -1;
|
||||
}
|
||||
|
||||
diff --git a/src/util.c b/src/util.c
|
||||
index 9b74757..66ad9a4 100644
|
||||
--- a/src/util.c
|
||||
+++ b/src/util.c
|
||||
@@ -1058,6 +1058,7 @@ int virFileReadPid(const char *dir,
|
||||
|
||||
if (fscanf(file, "%d", pid) != 1) {
|
||||
rc = EINVAL;
|
||||
+ fclose(file);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
Index: src/remote_internal.c
|
||||
===================================================================
|
||||
RCS file: /data/cvs/libxen/src/remote_internal.c,v
|
||||
retrieving revision 1.141
|
||||
diff -u -u -p -r1.141 remote_internal.c
|
||||
--- src/remote_internal.c 3 Mar 2009 19:33:34 -0000 1.141
|
||||
+++ src/remote_internal.c 16 Mar 2009 16:57:17 -0000
|
||||
@@ -332,7 +332,7 @@ doRemoteOpen (virConnectPtr conn,
|
||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
||||
int flags)
|
||||
{
|
||||
- int wakeupFD[2];
|
||||
+ int wakeupFD[2] = { -1, -1 };
|
||||
char *transport_str = NULL;
|
||||
|
||||
if (conn->uri) {
|
||||
@@ -885,6 +885,11 @@ doRemoteOpen (virConnectPtr conn,
|
||||
#endif
|
||||
}
|
||||
|
||||
+ if (wakeupFD[0] >= 0) {
|
||||
+ close(wakeupFD[0]);
|
||||
+ close(wakeupFD[1]);
|
||||
+ }
|
||||
+
|
||||
VIR_FREE(priv->hostname);
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -1350,6 +1355,11 @@ doRemoteClose (virConnectPtr conn, struc
|
||||
} while (reap != -1 && reap != priv->pid);
|
||||
}
|
||||
#endif
|
||||
+ if (priv->wakeupReadFD >= 0) {
|
||||
+ close(priv->wakeupReadFD);
|
||||
+ close(priv->wakeupSendFD);
|
||||
+ }
|
||||
+
|
||||
|
||||
/* Free hostname copy */
|
||||
free (priv->hostname);
|
||||
@@ -1,22 +0,0 @@
|
||||
From: Daniel P. Berrange <berrange@redhat.com>
|
||||
Date: Mon, 16 Mar 2009 10:33:01 +0000 (+0000)
|
||||
Subject: Fix handling of cpumaps arg to virDomainGetVcpus RPC dispatcher
|
||||
X-Git-Url: http://git.et.redhat.com/?p=libvirt.git;a=commitdiff_plain;h=2d75d954f52a740470f85ceece4eb995d79968ca
|
||||
|
||||
Fix handling of cpumaps arg to virDomainGetVcpus RPC dispatcher
|
||||
---
|
||||
|
||||
diff --git a/qemud/remote.c b/qemud/remote.c
|
||||
index 8eaa7d6..44a274a 100644
|
||||
--- a/qemud/remote.c
|
||||
+++ b/qemud/remote.c
|
||||
@@ -1475,7 +1475,8 @@ remoteDispatchDomainGetVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
/* Allocate buffers to take the results. */
|
||||
if (VIR_ALLOC_N(info, args->maxinfo) < 0)
|
||||
goto oom;
|
||||
- if (VIR_ALLOC_N(cpumaps, args->maxinfo) < 0)
|
||||
+ if (args->maplen > 0 &&
|
||||
+ VIR_ALLOC_N(cpumaps, args->maxinfo * args->maplen) < 0)
|
||||
goto oom;
|
||||
|
||||
info_len = virDomainGetVcpus (dom,
|
||||
@@ -1,188 +0,0 @@
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Thu, 12 Mar 2009 20:15:32 +0000 (+0000)
|
||||
Subject: * src/storage_conf.c: fix storage pool mode parsing, and refactoring
|
||||
X-Git-Url: http://git.et.redhat.com/?p=libvirt.git;a=commitdiff_plain;h=bc962f5d7c6e2c2cfc233ea6deea95dba2b7c6eb
|
||||
|
||||
* src/storage_conf.c: fix storage pool mode parsing, and refactoring
|
||||
patch by Ryota Ozaki
|
||||
Daniel
|
||||
---
|
||||
|
||||
diff --git a/src/storage_conf.c b/src/storage_conf.c
|
||||
index 9c13e07..1c9a4e5 100644
|
||||
--- a/src/storage_conf.c
|
||||
+++ b/src/storage_conf.c
|
||||
@@ -371,15 +371,33 @@ virStoragePoolDefParseAuthChap(virConnectPtr conn,
|
||||
|
||||
|
||||
static int
|
||||
-virStoragePoolDefParsePerms(virConnectPtr conn,
|
||||
- xmlXPathContextPtr ctxt,
|
||||
- virStoragePermsPtr perms) {
|
||||
+virStorageDefParsePerms(virConnectPtr conn,
|
||||
+ xmlXPathContextPtr ctxt,
|
||||
+ virStoragePermsPtr perms,
|
||||
+ const char *permxpath,
|
||||
+ int defaultmode) {
|
||||
char *mode;
|
||||
long v;
|
||||
+ int ret = -1;
|
||||
+ xmlNodePtr relnode;
|
||||
+ xmlNodePtr node;
|
||||
|
||||
- mode = virXPathString(conn, "string(/pool/permissions/mode)", ctxt);
|
||||
+ node = virXPathNode(conn, permxpath, ctxt);
|
||||
+ if (node == NULL) {
|
||||
+ /* Set default values if there is not <permissions> element */
|
||||
+ perms->mode = defaultmode;
|
||||
+ perms->uid = getuid();
|
||||
+ perms->gid = getgid();
|
||||
+ perms->label = NULL;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ relnode = ctxt->node;
|
||||
+ ctxt->node = node;
|
||||
+
|
||||
+ mode = virXPathString(conn, "string(./mode)", ctxt);
|
||||
if (!mode) {
|
||||
- perms->mode = 0700;
|
||||
+ perms->mode = defaultmode;
|
||||
} else {
|
||||
char *end = NULL;
|
||||
perms->mode = strtol(mode, &end, 8);
|
||||
@@ -387,36 +405,39 @@ virStoragePoolDefParsePerms(virConnectPtr conn,
|
||||
if (*end || perms->mode < 0 || perms->mode > 0777) {
|
||||
virStorageReportError(conn, VIR_ERR_XML_ERROR,
|
||||
"%s", _("malformed octal mode"));
|
||||
- return -1;
|
||||
+ goto error;
|
||||
}
|
||||
}
|
||||
|
||||
- if (virXPathNode(conn, "/pool/permissions/owner", ctxt) == NULL) {
|
||||
+ if (virXPathNode(conn, "./owner", ctxt) == NULL) {
|
||||
perms->uid = getuid();
|
||||
} else {
|
||||
- if (virXPathLong(conn, "number(/pool/permissions/owner)", ctxt, &v) < 0) {
|
||||
+ if (virXPathLong(conn, "number(./owner)", ctxt, &v) < 0) {
|
||||
virStorageReportError(conn, VIR_ERR_XML_ERROR,
|
||||
"%s", _("malformed owner element"));
|
||||
- return -1;
|
||||
+ goto error;
|
||||
}
|
||||
perms->uid = (int)v;
|
||||
}
|
||||
|
||||
- if (virXPathNode(conn, "/pool/permissions/group", ctxt) == NULL) {
|
||||
+ if (virXPathNode(conn, "./group", ctxt) == NULL) {
|
||||
perms->gid = getgid();
|
||||
} else {
|
||||
- if (virXPathLong(conn, "number(/pool/permissions/group)", ctxt, &v) < 0) {
|
||||
+ if (virXPathLong(conn, "number(./group)", ctxt, &v) < 0) {
|
||||
virStorageReportError(conn, VIR_ERR_XML_ERROR,
|
||||
"%s", _("malformed group element"));
|
||||
- return -1;
|
||||
+ goto error;
|
||||
}
|
||||
perms->gid = (int)v;
|
||||
}
|
||||
|
||||
/* NB, we're ignoring missing labels here - they'll simply inherit */
|
||||
- perms->label = virXPathString(conn, "string(/pool/permissions/label)", ctxt);
|
||||
+ perms->label = virXPathString(conn, "string(./label)", ctxt);
|
||||
|
||||
- return 0;
|
||||
+ ret = 0;
|
||||
+error:
|
||||
+ ctxt->node = relnode;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -579,7 +600,8 @@ virStoragePoolDefParseDoc(virConnectPtr conn,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
- if (virStoragePoolDefParsePerms(conn, ctxt, &ret->target.perms) < 0)
|
||||
+ if (virStorageDefParsePerms(conn, ctxt, &ret->target.perms,
|
||||
+ "/pool/target/permissions", 0700) < 0)
|
||||
goto cleanup;
|
||||
|
||||
return ret;
|
||||
@@ -801,55 +823,6 @@ virStoragePoolDefFormat(virConnectPtr conn,
|
||||
|
||||
|
||||
static int
|
||||
-virStorageVolDefParsePerms(virConnectPtr conn,
|
||||
- xmlXPathContextPtr ctxt,
|
||||
- virStoragePermsPtr perms) {
|
||||
- char *mode;
|
||||
- long v;
|
||||
-
|
||||
- mode = virXPathString(conn, "string(/volume/permissions/mode)", ctxt);
|
||||
- if (!mode) {
|
||||
- perms->mode = 0600;
|
||||
- } else {
|
||||
- char *end = NULL;
|
||||
- perms->mode = strtol(mode, &end, 8);
|
||||
- VIR_FREE(mode);
|
||||
- if (*end || perms->mode < 0 || perms->mode > 0777) {
|
||||
- virStorageReportError(conn, VIR_ERR_XML_ERROR,
|
||||
- "%s", _("malformed octal mode"));
|
||||
- return -1;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (virXPathNode(conn, "/volume/permissions/owner", ctxt) == NULL) {
|
||||
- perms->uid = getuid();
|
||||
- } else {
|
||||
- if (virXPathLong(conn, "number(/volume/permissions/owner)", ctxt, &v) < 0) {
|
||||
- virStorageReportError(conn, VIR_ERR_XML_ERROR,
|
||||
- "%s", _("missing owner element"));
|
||||
- return -1;
|
||||
- }
|
||||
- perms->uid = (int)v;
|
||||
- }
|
||||
- if (virXPathNode(conn, "/volume/permissions/group", ctxt) == NULL) {
|
||||
- perms->gid = getgid();
|
||||
- } else {
|
||||
- if (virXPathLong(conn, "number(/volume/permissions/group)", ctxt, &v) < 0) {
|
||||
- virStorageReportError(conn, VIR_ERR_XML_ERROR,
|
||||
- "%s", _("missing group element"));
|
||||
- return -1;
|
||||
- }
|
||||
- perms->gid = (int)v;
|
||||
- }
|
||||
-
|
||||
- /* NB, we're ignoring missing labels here - they'll simply inherit */
|
||||
- perms->label = virXPathString(conn, "string(/volume/permissions/label)", ctxt);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-static int
|
||||
virStorageSize(virConnectPtr conn,
|
||||
const char *unit,
|
||||
const char *val,
|
||||
@@ -997,7 +970,8 @@ virStorageVolDefParseDoc(virConnectPtr conn,
|
||||
VIR_FREE(format);
|
||||
}
|
||||
|
||||
- if (virStorageVolDefParsePerms(conn, ctxt, &ret->target.perms) < 0)
|
||||
+ if (virStorageDefParsePerms(conn, ctxt, &ret->target.perms,
|
||||
+ "/volume/target/permissions", 0600) < 0)
|
||||
goto cleanup;
|
||||
|
||||
|
||||
@@ -1019,7 +993,8 @@ virStorageVolDefParseDoc(virConnectPtr conn,
|
||||
VIR_FREE(format);
|
||||
}
|
||||
|
||||
- if (virStorageVolDefParsePerms(conn, ctxt, &ret->backingStore.perms) < 0)
|
||||
+ if (virStorageDefParsePerms(conn, ctxt, &ret->backingStore.perms,
|
||||
+ "/volume/backingStore/permissions", 0600) < 0)
|
||||
goto cleanup;
|
||||
|
||||
return ret;
|
||||
@@ -1,20 +0,0 @@
|
||||
From: Daniel P. Berrange <berrange@redhat.com>
|
||||
Date: Mon, 16 Mar 2009 10:31:38 +0000 (+0000)
|
||||
Subject: Don't free storage volume in cleanup path, since it may still be referenced
|
||||
X-Git-Url: http://git.et.redhat.com/?p=libvirt.git;a=commitdiff_plain;h=d8f08ca049b6d3bc7a5124a3957e967539ad080d
|
||||
|
||||
Don't free storage volume in cleanup path, since it may still be referenced
|
||||
---
|
||||
|
||||
diff --git a/src/storage_driver.c b/src/storage_driver.c
|
||||
index f1320c5..b261843 100644
|
||||
--- a/src/storage_driver.c
|
||||
+++ b/src/storage_driver.c
|
||||
@@ -1296,7 +1296,6 @@ storageVolumeDelete(virStorageVolPtr obj,
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
- virStorageVolDefFree(vol);
|
||||
if (pool)
|
||||
virStoragePoolObjUnlock(pool);
|
||||
return ret;
|
||||
@@ -1,143 +0,0 @@
|
||||
diff -rup libvirt-0.6.1.orig/src/qemu_driver.c libvirt-0.6.1.new/src/qemu_driver.c
|
||||
--- libvirt-0.6.1.orig/src/qemu_driver.c 2009-03-17 11:57:04.000000000 +0000
|
||||
+++ libvirt-0.6.1.new/src/qemu_driver.c 2009-03-17 11:57:12.000000000 +0000
|
||||
@@ -3765,7 +3765,7 @@ static int qemudDomainAttachDevice(virDo
|
||||
goto cleanup;
|
||||
}
|
||||
if (driver->securityDriver)
|
||||
- driver->securityDriver->domainSetSecurityImageLabel(dom->conn, vm, dev);
|
||||
+ driver->securityDriver->domainSetSecurityImageLabel(dom->conn, vm, dev->data.disk);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -3901,7 +3901,7 @@ static int qemudDomainDetachDevice(virDo
|
||||
dev->data.disk->bus == VIR_DOMAIN_DISK_BUS_VIRTIO)) {
|
||||
ret = qemudDomainDetachPciDiskDevice(dom->conn, vm, dev);
|
||||
if (driver->securityDriver)
|
||||
- driver->securityDriver->domainRestoreSecurityImageLabel(dom->conn, vm, dev);
|
||||
+ driver->securityDriver->domainRestoreSecurityImageLabel(dom->conn, dev->data.disk);
|
||||
}
|
||||
else
|
||||
qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT,
|
||||
diff -rup libvirt-0.6.1.orig/src/security.h libvirt-0.6.1.new/src/security.h
|
||||
--- libvirt-0.6.1.orig/src/security.h 2009-03-03 16:40:46.000000000 +0000
|
||||
+++ libvirt-0.6.1.new/src/security.h 2009-03-17 11:57:12.000000000 +0000
|
||||
@@ -32,11 +32,10 @@ typedef virSecurityDriverStatus (*virSec
|
||||
typedef int (*virSecurityDriverOpen) (virConnectPtr conn,
|
||||
virSecurityDriverPtr drv);
|
||||
typedef int (*virSecurityDomainRestoreImageLabel) (virConnectPtr conn,
|
||||
- virDomainObjPtr vm,
|
||||
- virDomainDeviceDefPtr dev);
|
||||
+ virDomainDiskDefPtr disk);
|
||||
typedef int (*virSecurityDomainSetImageLabel) (virConnectPtr conn,
|
||||
virDomainObjPtr vm,
|
||||
- virDomainDeviceDefPtr dev);
|
||||
+ virDomainDiskDefPtr disk);
|
||||
typedef int (*virSecurityDomainGenLabel) (virConnectPtr conn,
|
||||
virDomainObjPtr sec);
|
||||
typedef int (*virSecurityDomainGetLabel) (virConnectPtr conn,
|
||||
diff -rup libvirt-0.6.1.orig/src/security_selinux.c libvirt-0.6.1.new/src/security_selinux.c
|
||||
--- libvirt-0.6.1.orig/src/security_selinux.c 2009-03-03 16:40:46.000000000 +0000
|
||||
+++ libvirt-0.6.1.new/src/security_selinux.c 2009-03-17 11:57:12.000000000 +0000
|
||||
@@ -269,7 +269,7 @@ SELinuxGetSecurityLabel(virConnectPtr co
|
||||
}
|
||||
|
||||
static int
|
||||
-SELinuxSetFilecon(virConnectPtr conn, char *path, char *tcon)
|
||||
+SELinuxSetFilecon(virConnectPtr conn, const char *path, char *tcon)
|
||||
{
|
||||
char ebuf[1024];
|
||||
|
||||
@@ -288,28 +288,51 @@ SELinuxSetFilecon(virConnectPtr conn, ch
|
||||
|
||||
static int
|
||||
SELinuxRestoreSecurityImageLabel(virConnectPtr conn,
|
||||
- virDomainObjPtr vm,
|
||||
- virDomainDeviceDefPtr dev)
|
||||
+ virDomainDiskDefPtr disk)
|
||||
{
|
||||
- const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
|
||||
+ struct stat buf;
|
||||
+ security_context_t fcon = NULL;
|
||||
+ int rc = -1;
|
||||
+ char *newpath = NULL;
|
||||
+ const char *path = disk->src;
|
||||
|
||||
- if (secdef->imagelabel) {
|
||||
- return SELinuxSetFilecon(conn, dev->data.disk->src, default_image_context);
|
||||
+ if (disk->readonly || disk->shared)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (lstat(path, &buf) != 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ if (S_ISLNK(buf.st_mode)) {
|
||||
+ if (VIR_ALLOC_N(newpath, buf.st_size + 1) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ if (readlink(path, newpath, buf.st_size) < 0)
|
||||
+ goto err;
|
||||
+ path = newpath;
|
||||
+ if (stat(path, &buf) != 0)
|
||||
+ goto err;
|
||||
}
|
||||
- return 0;
|
||||
+
|
||||
+ if (matchpathcon(path, buf.st_mode, &fcon) == 0) {
|
||||
+ rc = SELinuxSetFilecon(conn, path, fcon);
|
||||
+ }
|
||||
+err:
|
||||
+ VIR_FREE(fcon);
|
||||
+ VIR_FREE(newpath);
|
||||
+ return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
SELinuxSetSecurityImageLabel(virConnectPtr conn,
|
||||
virDomainObjPtr vm,
|
||||
- virDomainDeviceDefPtr dev)
|
||||
+ virDomainDiskDefPtr disk)
|
||||
|
||||
{
|
||||
const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
|
||||
|
||||
- if (secdef->imagelabel) {
|
||||
- return SELinuxSetFilecon(conn, dev->data.disk->src, secdef->imagelabel);
|
||||
- }
|
||||
+ if (secdef->imagelabel)
|
||||
+ return SELinuxSetFilecon(conn, disk->src, secdef->imagelabel);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -322,7 +345,7 @@ SELinuxRestoreSecurityLabel(virConnectPt
|
||||
int rc = 0;
|
||||
if (secdef->imagelabel) {
|
||||
for (i = 0 ; i < vm->def->ndisks ; i++) {
|
||||
- if (SELinuxSetFilecon(conn, vm->def->disks[i]->src, default_image_context) < 0)
|
||||
+ if (SELinuxRestoreSecurityImageLabel(conn, vm->def->disks[i]) < 0)
|
||||
rc = -1;
|
||||
}
|
||||
VIR_FREE(secdef->model);
|
||||
@@ -368,16 +391,11 @@ SELinuxSetSecurityLabel(virConnectPtr co
|
||||
|
||||
if (secdef->imagelabel) {
|
||||
for (i = 0 ; i < vm->def->ndisks ; i++) {
|
||||
- if(setfilecon(vm->def->disks[i]->src, secdef->imagelabel) < 0) {
|
||||
- virSecurityReportError(conn, VIR_ERR_ERROR,
|
||||
- _("%s: unable to set security context "
|
||||
- "'\%s\' on %s: %s."), __func__,
|
||||
- secdef->imagelabel,
|
||||
- vm->def->disks[i]->src,
|
||||
- virStrerror(errno, ebuf, sizeof ebuf));
|
||||
- if (security_getenforce() == 1)
|
||||
- return -1;
|
||||
- }
|
||||
+ if (vm->def->disks[i]->readonly ||
|
||||
+ vm->def->disks[i]->shared) continue;
|
||||
+
|
||||
+ if (SELinuxSetSecurityImageLabel(conn, vm, vm->def->disks[i]) < 0)
|
||||
+ return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
diff -rup libvirt-0.6.1.orig/src/qemu_conf.c libvirt-0.6.1.new/src/qemu_conf.c
|
||||
--- libvirt-0.6.1.orig/src/qemu_conf.c 2009-03-17 11:57:04.000000000 +0000
|
||||
+++ libvirt-0.6.1.new/src/qemu_conf.c 2009-03-17 15:50:08.000000000 +0000
|
||||
@@ -757,6 +757,20 @@ int qemudBuildCommandLine(virConnectPtr
|
||||
char uuid[VIR_UUID_STRING_BUFLEN];
|
||||
char domid[50];
|
||||
char *pidfile;
|
||||
+ int skipSound = 0;
|
||||
+
|
||||
+ if (driver->securityDriver &&
|
||||
+ driver->securityDriver->name &&
|
||||
+ STREQ(driver->securityDriver->name, "selinux") &&
|
||||
+ getuid() == 0) {
|
||||
+ static int soundWarned = 0;
|
||||
+ skipSound = 1;
|
||||
+ if (vm->def->nsounds &&
|
||||
+ !soundWarned) {
|
||||
+ soundWarned = 1;
|
||||
+ VIR_WARN0("Sound cards for VMs are disabled while SELinux security model is active");
|
||||
+ }
|
||||
+ }
|
||||
|
||||
uname_normalize(&ut);
|
||||
|
||||
@@ -1364,7 +1378,8 @@ int qemudBuildCommandLine(virConnectPtr
|
||||
}
|
||||
|
||||
/* Add sound hardware */
|
||||
- if (vm->def->nsounds) {
|
||||
+ if (vm->def->nsounds &&
|
||||
+ !skipSound) {
|
||||
int size = 100;
|
||||
char *modstr;
|
||||
if (VIR_ALLOC_N(modstr, size+1) < 0)
|
||||
Only in libvirt-0.6.1.new/src: qemu_conf.c~
|
||||
@@ -1,36 +0,0 @@
|
||||
From: Daniel P. Berrange <berrange@redhat.com>
|
||||
Date: Mon, 16 Mar 2009 11:44:46 +0000 (+0000)
|
||||
Subject: Avoid deadlock setting vcpus in QEMU driver
|
||||
X-Git-Url: http://git.et.redhat.com/?p=libvirt.git;a=commitdiff_plain;h=4d7ecd146ce4de847256ae0887963719f214f62f
|
||||
|
||||
Avoid deadlock setting vcpus in QEMU driver
|
||||
---
|
||||
|
||||
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
|
||||
index dad7098..51442d6 100644
|
||||
--- a/src/qemu_driver.c
|
||||
+++ b/src/qemu_driver.c
|
||||
@@ -2725,6 +2725,7 @@ static int qemudDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) {
|
||||
virDomainObjPtr vm;
|
||||
int max;
|
||||
int ret = -1;
|
||||
+ const char *type;
|
||||
|
||||
qemuDriverLock(driver);
|
||||
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
|
||||
@@ -2745,7 +2746,14 @@ static int qemudDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
- if ((max = qemudDomainGetMaxVcpus(dom)) < 0) {
|
||||
+ if (!(type = virDomainVirtTypeToString(vm->def->virtType))) {
|
||||
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||
+ _("unknown virt type in domain definition '%d'"),
|
||||
+ vm->def->virtType);
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+
|
||||
+ if ((max = qemudGetMaxVCPUs(dom->conn, type)) < 0) {
|
||||
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("could not determine max vcpus for the domain"));
|
||||
goto cleanup;
|
||||
@@ -1,277 +0,0 @@
|
||||
diff -r 961d4b1ca1d3 qemud/libvirtd_qemu.aug
|
||||
--- a/qemud/libvirtd_qemu.aug Wed Mar 04 13:17:44 2009 +0000
|
||||
+++ b/qemud/libvirtd_qemu.aug Thu Mar 05 14:22:50 2009 +0000
|
||||
@@ -27,6 +27,8 @@ module Libvirtd_qemu =
|
||||
| str_entry "vnc_tls_x509_cert_dir"
|
||||
| bool_entry "vnc_tls_x509_verify"
|
||||
| str_entry "vnc_password"
|
||||
+ | bool_entry "vnc_sasl"
|
||||
+ | str_entry "vnc_sasl_dir"
|
||||
|
||||
(* Each enty in the config is one of the following three ... *)
|
||||
let entry = vnc_entry
|
||||
diff -r 961d4b1ca1d3 qemud/test_libvirtd_qemu.aug
|
||||
--- a/qemud/test_libvirtd_qemu.aug Wed Mar 04 13:17:44 2009 +0000
|
||||
+++ b/qemud/test_libvirtd_qemu.aug Thu Mar 05 14:22:50 2009 +0000
|
||||
@@ -60,6 +60,25 @@ vnc_tls_x509_verify = 1
|
||||
# example here before you set this
|
||||
#
|
||||
vnc_password = \"XYZ12345\"
|
||||
+
|
||||
+
|
||||
+# Enable use of SASL encryption on the VNC server. This requires
|
||||
+# a VNC client which supports the SASL protocol extension.
|
||||
+# Examples include vinagre, virt-viewer and virt-manager
|
||||
+# itself. UltraVNC, RealVNC, TightVNC do not support this
|
||||
+#
|
||||
+# It is necessary to configure /etc/sasl2/qemu.conf to choose
|
||||
+# the desired SASL plugin (eg, GSSPI for Kerberos)
|
||||
+#
|
||||
+vnc_sasl = 1
|
||||
+
|
||||
+
|
||||
+# The default SASL configuration file is located in /etc/sasl2/
|
||||
+# When running libvirtd unprivileged, it may be desirable to
|
||||
+# override the configs in this location. Set this parameter to
|
||||
+# point to the directory, and create a qemu.conf in that location
|
||||
+#
|
||||
+vnc_sasl_dir = \"/some/directory/sasl2\"
|
||||
"
|
||||
|
||||
test Libvirtd_qemu.lns get conf =
|
||||
@@ -123,3 +142,22 @@ vnc_password = \"XYZ12345\"
|
||||
{ "#comment" = "example here before you set this" }
|
||||
{ "#comment" = "" }
|
||||
{ "vnc_password" = "XYZ12345" }
|
||||
+{ "#empty" }
|
||||
+{ "#empty" }
|
||||
+{ "#comment" = "Enable use of SASL encryption on the VNC server. This requires" }
|
||||
+{ "#comment" = "a VNC client which supports the SASL protocol extension." }
|
||||
+{ "#comment" = "Examples include vinagre, virt-viewer and virt-manager" }
|
||||
+{ "#comment" = "itself. UltraVNC, RealVNC, TightVNC do not support this" }
|
||||
+{ "#comment" = "" }
|
||||
+{ "#comment" = "It is necessary to configure /etc/sasl2/qemu.conf to choose" }
|
||||
+{ "#comment" = "the desired SASL plugin (eg, GSSPI for Kerberos)" }
|
||||
+{ "#comment" = "" }
|
||||
+{ "vnc_sasl" = "1" }
|
||||
+{ "#empty" }
|
||||
+{ "#empty" }
|
||||
+{ "#comment" = "The default SASL configuration file is located in /etc/sasl2/" }
|
||||
+{ "#comment" = "When running libvirtd unprivileged, it may be desirable to" }
|
||||
+{ "#comment" = "override the configs in this location. Set this parameter to" }
|
||||
+{ "#comment" = "point to the directory, and create a qemu.conf in that location" }
|
||||
+{ "#comment" = "" }
|
||||
+{ "vnc_sasl_dir" = "/some/directory/sasl2" }
|
||||
diff -r 961d4b1ca1d3 src/qemu.conf
|
||||
--- a/src/qemu.conf Wed Mar 04 13:17:44 2009 +0000
|
||||
+++ b/src/qemu.conf Thu Mar 05 14:22:50 2009 +0000
|
||||
@@ -60,6 +60,27 @@
|
||||
# vnc_password = "XYZ12345"
|
||||
|
||||
|
||||
+# Enable use of SASL encryption on the VNC server. This requires
|
||||
+# a VNC client which supports the SASL protocol extension.
|
||||
+# Examples include vinagre, virt-viewer and virt-manager
|
||||
+# itself. UltraVNC, RealVNC, TightVNC do not support this
|
||||
+#
|
||||
+# It is necessary to configure /etc/sasl2/qemu.conf to choose
|
||||
+# the desired SASL plugin (eg, GSSPI for Kerberos)
|
||||
+#
|
||||
+# vnc_sasl = 1
|
||||
+
|
||||
+
|
||||
+# The default SASL configuration file is located in /etc/sasl2/
|
||||
+# When running libvirtd unprivileged, it may be desirable to
|
||||
+# override the configs in this location. Set this parameter to
|
||||
+# point to the directory, and create a qemu.conf in that location
|
||||
+#
|
||||
+# vnc_sasl_dir = "/some/directory/sasl2"
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
# The default security driver is SELinux. If SELinux is disabled
|
||||
# on the host, then the security driver will automatically disable
|
||||
# itself. If you wish to disable QEMU SELinux security driver while
|
||||
diff -r 961d4b1ca1d3 src/qemu_conf.c
|
||||
--- a/src/qemu_conf.c Wed Mar 04 13:17:44 2009 +0000
|
||||
+++ b/src/qemu_conf.c Thu Mar 05 14:22:50 2009 +0000
|
||||
@@ -161,6 +161,21 @@ int qemudLoadDriverConfig(struct qemud_d
|
||||
}
|
||||
}
|
||||
|
||||
+ p = virConfGetValue (conf, "vnc_sasl");
|
||||
+ CHECK_TYPE ("vnc_sasl", VIR_CONF_LONG);
|
||||
+ if (p) driver->vncSASL = p->l;
|
||||
+
|
||||
+ p = virConfGetValue (conf, "vnc_sasl_dir");
|
||||
+ CHECK_TYPE ("vnc_sasl_dir", VIR_CONF_STRING);
|
||||
+ if (p && p->str) {
|
||||
+ VIR_FREE(driver->vncSASLdir);
|
||||
+ if (!(driver->vncSASLdir = strdup(p->str))) {
|
||||
+ virReportOOMError(NULL);
|
||||
+ virConfFree(conf);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
virConfFree (conf);
|
||||
return 0;
|
||||
}
|
||||
@@ -838,15 +853,20 @@ int qemudBuildCommandLine(virConnectPtr
|
||||
goto no_memory; \
|
||||
} while (0)
|
||||
|
||||
+#define ADD_ENV_PAIR(envname, val) \
|
||||
+ do { \
|
||||
+ char *envval; \
|
||||
+ ADD_ENV_SPACE; \
|
||||
+ if (virAsprintf(&envval, "%s=%s", envname, val) < 0) \
|
||||
+ goto no_memory; \
|
||||
+ qenv[qenvc++] = envval; \
|
||||
+ } while (0)
|
||||
+
|
||||
#define ADD_ENV_COPY(envname) \
|
||||
do { \
|
||||
char *val = getenv(envname); \
|
||||
- char *envval; \
|
||||
- ADD_ENV_SPACE; \
|
||||
if (val != NULL) { \
|
||||
- if (virAsprintf(&envval, "%s=%s", envname, val) < 0) \
|
||||
- goto no_memory; \
|
||||
- qenv[qenvc++] = envval; \
|
||||
+ ADD_ENV_PAIR(envname, val); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
@@ -1295,6 +1315,15 @@ int qemudBuildCommandLine(virConnectPtr
|
||||
driver->vncTLSx509certdir);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ if (driver->vncSASL) {
|
||||
+ virBufferAddLit(&opt, ",sasl");
|
||||
+
|
||||
+ if (driver->vncSASLdir)
|
||||
+ ADD_ENV_PAIR("SASL_CONF_DIR", driver->vncSASLdir);
|
||||
+
|
||||
+ /* TODO: Support ACLs later */
|
||||
+ }
|
||||
} else {
|
||||
virBufferVSprintf(&opt, "%d",
|
||||
vm->def->graphics->data.vnc.port - 5900);
|
||||
diff -r 961d4b1ca1d3 src/qemu_conf.h
|
||||
--- a/src/qemu_conf.h Wed Mar 04 13:17:44 2009 +0000
|
||||
+++ b/src/qemu_conf.h Thu Mar 05 14:22:50 2009 +0000
|
||||
@@ -73,9 +73,11 @@ struct qemud_driver {
|
||||
char *stateDir;
|
||||
unsigned int vncTLS : 1;
|
||||
unsigned int vncTLSx509verify : 1;
|
||||
+ unsigned int vncSASL : 1;
|
||||
char *vncTLSx509certdir;
|
||||
char *vncListen;
|
||||
char *vncPassword;
|
||||
+ char *vncSASLdir;
|
||||
|
||||
virCapsPtr caps;
|
||||
|
||||
diff -r 961d4b1ca1d3 src/qemu_driver.c
|
||||
--- a/src/qemu_driver.c Wed Mar 04 13:17:44 2009 +0000
|
||||
+++ b/src/qemu_driver.c Thu Mar 05 14:22:50 2009 +0000
|
||||
@@ -620,6 +620,7 @@ qemudShutdown(void) {
|
||||
VIR_FREE(qemu_driver->vncTLSx509certdir);
|
||||
VIR_FREE(qemu_driver->vncListen);
|
||||
VIR_FREE(qemu_driver->vncPassword);
|
||||
+ VIR_FREE(qemu_driver->vncSASLdir);
|
||||
|
||||
/* Free domain callback list */
|
||||
virDomainEventCallbackListFree(qemu_driver->domainEventCallbacks);
|
||||
diff -r 961d4b1ca1d3 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args
|
||||
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
||||
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args Thu Mar 05 14:22:50 2009 +0000
|
||||
@@ -0,0 +1,1 @@
|
||||
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test SASL_CONF_DIR=/root/.sasl2 /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc 127.0.0.1:3,sasl
|
||||
diff -r 961d4b1ca1d3 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml
|
||||
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
||||
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml Thu Mar 05 14:22:50 2009 +0000
|
||||
@@ -0,0 +1,24 @@
|
||||
+<domain type='qemu'>
|
||||
+ <name>QEMUGuest1</name>
|
||||
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
+ <memory>219200</memory>
|
||||
+ <currentMemory>219200</currentMemory>
|
||||
+ <vcpu>1</vcpu>
|
||||
+ <os>
|
||||
+ <type arch='i686' machine='pc'>hvm</type>
|
||||
+ <boot dev='hd'/>
|
||||
+ </os>
|
||||
+ <clock offset='utc'/>
|
||||
+ <on_poweroff>destroy</on_poweroff>
|
||||
+ <on_reboot>restart</on_reboot>
|
||||
+ <on_crash>destroy</on_crash>
|
||||
+ <devices>
|
||||
+ <emulator>/usr/bin/qemu</emulator>
|
||||
+ <disk type='block' device='disk'>
|
||||
+ <source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
+ <target dev='hda' bus='ide'/>
|
||||
+ </disk>
|
||||
+ <input type='mouse' bus='ps2'/>
|
||||
+ <graphics type='vnc' port='5903' autoport='no' listen='127.0.0.1'/>
|
||||
+ </devices>
|
||||
+</domain>
|
||||
diff -r 961d4b1ca1d3 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.args
|
||||
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
||||
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.args Thu Mar 05 14:22:50 2009 +0000
|
||||
@@ -0,0 +1,1 @@
|
||||
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test SASL_CONF_DIR=/root/.sasl2 /usr/bin/qemu -S -M pc -m 214 -smp 1 -monitor pty -pidfile /nowhere/QEMUGuest1.pid -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb -vnc 127.0.0.1:3,tls,x509verify=/etc/pki/tls/qemu,sasl
|
||||
diff -r 961d4b1ca1d3 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml
|
||||
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
||||
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml Thu Mar 05 14:22:50 2009 +0000
|
||||
@@ -0,0 +1,24 @@
|
||||
+<domain type='qemu'>
|
||||
+ <name>QEMUGuest1</name>
|
||||
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
+ <memory>219200</memory>
|
||||
+ <currentMemory>219200</currentMemory>
|
||||
+ <vcpu>1</vcpu>
|
||||
+ <os>
|
||||
+ <type arch='i686' machine='pc'>hvm</type>
|
||||
+ <boot dev='hd'/>
|
||||
+ </os>
|
||||
+ <clock offset='utc'/>
|
||||
+ <on_poweroff>destroy</on_poweroff>
|
||||
+ <on_reboot>restart</on_reboot>
|
||||
+ <on_crash>destroy</on_crash>
|
||||
+ <devices>
|
||||
+ <emulator>/usr/bin/qemu</emulator>
|
||||
+ <disk type='block' device='disk'>
|
||||
+ <source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
+ <target dev='hda' bus='ide'/>
|
||||
+ </disk>
|
||||
+ <input type='mouse' bus='ps2'/>
|
||||
+ <graphics type='vnc' port='5903' autoport='no' listen='127.0.0.1'/>
|
||||
+ </devices>
|
||||
+</domain>
|
||||
diff -r 961d4b1ca1d3 tests/qemuxml2argvtest.c
|
||||
--- a/tests/qemuxml2argvtest.c Wed Mar 04 13:17:44 2009 +0000
|
||||
+++ b/tests/qemuxml2argvtest.c Thu Mar 05 14:22:50 2009 +0000
|
||||
@@ -213,6 +213,19 @@ mymain(int argc, char **argv)
|
||||
QEMUD_CMD_FLAG_DRIVE_CACHE_V2);
|
||||
DO_TEST("disk-usb", 0);
|
||||
DO_TEST("graphics-vnc", 0);
|
||||
+
|
||||
+ driver.vncSASL = 1;
|
||||
+ driver.vncSASLdir = strdup("/root/.sasl2");
|
||||
+ DO_TEST("graphics-vnc-sasl", 0);
|
||||
+ driver.vncTLS = 1;
|
||||
+ driver.vncTLSx509verify = 1;
|
||||
+ driver.vncTLSx509certdir = strdup("/etc/pki/tls/qemu");
|
||||
+ DO_TEST("graphics-vnc-tls", 0);
|
||||
+ driver.vncSASL = driver.vncTLSx509verify = driver.vncTLS = 0;
|
||||
+ free(driver.vncSASLdir);
|
||||
+ free(driver.vncTLSx509certdir);
|
||||
+ driver.vncSASLdir = driver.vncTLSx509certdir = NULL;
|
||||
+
|
||||
DO_TEST("graphics-sdl", 0);
|
||||
DO_TEST("graphics-sdl-fullscreen", 0);
|
||||
DO_TEST("input-usbmouse", 0);
|
||||
@@ -1,29 +0,0 @@
|
||||
Index: src/xs_internal.c
|
||||
===================================================================
|
||||
RCS file: /data/cvs/libxen/src/xs_internal.c,v
|
||||
retrieving revision 1.88
|
||||
diff -u -u -r1.88 xs_internal.c
|
||||
--- src/xs_internal.c 5 Feb 2009 18:14:00 -0000 1.88
|
||||
+++ src/xs_internal.c 11 Mar 2009 13:23:17 -0000
|
||||
@@ -1215,7 +1215,7 @@
|
||||
static void
|
||||
xenStoreWatchEvent(int watch ATTRIBUTE_UNUSED,
|
||||
int fd ATTRIBUTE_UNUSED,
|
||||
- int events ATTRIBUTE_UNUSED,
|
||||
+ int events,
|
||||
void *data)
|
||||
{
|
||||
char **event;
|
||||
@@ -1226,8 +1226,12 @@
|
||||
|
||||
virConnectPtr conn = data;
|
||||
xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData;
|
||||
+
|
||||
if(!priv) return;
|
||||
|
||||
+ /* only set a watch on read and write events */
|
||||
+ if (events & (VIR_EVENT_HANDLE_ERROR | VIR_EVENT_HANDLE_HANGUP)) return;
|
||||
+
|
||||
xenUnifiedLock(priv);
|
||||
|
||||
if(!priv->xshandle)
|
||||
@@ -1,26 +0,0 @@
|
||||
From: Daniel P. Berrange <berrange@redhat.com>
|
||||
Date: Tue, 10 Mar 2009 10:32:24 +0000 (+0000)
|
||||
Subject: Fix Xen block detach with newer Xend (Cole RobinSon / Tomohiro Takahashi)
|
||||
X-Git-Url: http://git.et.redhat.com/?p=libvirt.git;a=commitdiff_plain;h=33813a932d58c17441203d0e581eba91369a71e0
|
||||
|
||||
Fix Xen block detach with newer Xend (Cole RobinSon / Tomohiro Takahashi)
|
||||
---
|
||||
|
||||
diff --git a/src/xend_internal.c b/src/xend_internal.c
|
||||
index f9f2cb3..772f3f4 100644
|
||||
--- a/src/xend_internal.c
|
||||
+++ b/src/xend_internal.c
|
||||
@@ -5566,7 +5566,12 @@ virDomainXMLDevID(virDomainPtr domain,
|
||||
char *xref;
|
||||
|
||||
if (dev->type == VIR_DOMAIN_DEVICE_DISK) {
|
||||
- strcpy(class, "vbd");
|
||||
+ 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);
|
||||
@@ -1,24 +0,0 @@
|
||||
Index: src/xend_internal.c
|
||||
===================================================================
|
||||
RCS file: /data/cvs/libxen/src/xend_internal.c,v
|
||||
retrieving revision 1.251
|
||||
diff -u -r1.251 xend_internal.c
|
||||
--- src/xend_internal.c 13 Feb 2009 18:23:23 -0000 1.251
|
||||
+++ src/xend_internal.c 10 Mar 2009 10:00:28 -0000
|
||||
@@ -904,7 +904,15 @@
|
||||
count++;
|
||||
}
|
||||
|
||||
- if (VIR_ALLOC_N(ptr, count + 1 + extra) < 0)
|
||||
+ /*
|
||||
+ * We can'tuse the normal allocation routines as we are mixing
|
||||
+ * an array of char * at the beginning followed by an array of char
|
||||
+ * ret points to the NULL terminated array of char *
|
||||
+ * ptr points to the current string after that array but in the same
|
||||
+ * allocated block
|
||||
+ */
|
||||
+ if (virAlloc((void *)&ptr,
|
||||
+ (count + 1) * sizeof(char *) + extra * sizeof(char)) < 0)
|
||||
goto error;
|
||||
|
||||
ret = (char **) ptr;
|
||||
51
libvirt-0.6.4-svirt-sound.patch
Normal file
51
libvirt-0.6.4-svirt-sound.patch
Normal file
@@ -0,0 +1,51 @@
|
||||
From e2106f6db9beb9f48e9f87f8a1eaba821d1a2296 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel P. Berrange <berrange@redhat.com>
|
||||
Date: Mon, 17 Aug 2009 08:32:08 +0100
|
||||
Subject: [PATCH] Disable sound cards when running sVirt
|
||||
|
||||
Temporary hack till PulseAudio autostart problems are sorted out when
|
||||
SELinux enforcing (bz 486112)
|
||||
|
||||
Fedora-patch: libvirt-0.6.4-svirt-sound.patch
|
||||
---
|
||||
src/qemu_conf.c | 17 ++++++++++++++++-
|
||||
1 files changed, 16 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
|
||||
index f92bcef..f3b4ef0 100644
|
||||
--- a/src/qemu_conf.c
|
||||
+++ b/src/qemu_conf.c
|
||||
@@ -1510,6 +1510,20 @@ int qemudBuildCommandLine(virConnectPtr conn,
|
||||
char uuid[VIR_UUID_STRING_BUFLEN];
|
||||
char domid[50];
|
||||
const char *cpu = NULL;
|
||||
+ int skipSound = 0;
|
||||
+
|
||||
+ if (driver->securityDriver &&
|
||||
+ driver->securityDriver->name &&
|
||||
+ STREQ(driver->securityDriver->name, "selinux") &&
|
||||
+ getuid() == 0) {
|
||||
+ static int soundWarned = 0;
|
||||
+ skipSound = 1;
|
||||
+ if (def->nsounds &&
|
||||
+ !soundWarned) {
|
||||
+ soundWarned = 1;
|
||||
+ VIR_WARN0("Sound cards for VMs are disabled while SELinux security model is active");
|
||||
+ }
|
||||
+ }
|
||||
|
||||
uname_normalize(&ut);
|
||||
|
||||
@@ -2181,7 +2195,8 @@ int qemudBuildCommandLine(virConnectPtr conn,
|
||||
}
|
||||
|
||||
/* Add sound hardware */
|
||||
- if (def->nsounds) {
|
||||
+ if (def->nsounds &&
|
||||
+ !skipSound) {
|
||||
int size = 100;
|
||||
char *modstr;
|
||||
if (VIR_ALLOC_N(modstr, size+1) < 0)
|
||||
--
|
||||
1.6.2.5
|
||||
|
||||
531
libvirt.spec
531
libvirt.spec
@@ -1,17 +1,30 @@
|
||||
# -*- rpm-spec -*-
|
||||
|
||||
%define with_xen 0%{!?_without_xen:1}
|
||||
%define with_xen_proxy 0%{!?_without_xen_proxy:1}
|
||||
%define with_qemu 0%{!?_without_qemu:1}
|
||||
%define with_openvz 0%{!?_without_openvz:1}
|
||||
%define with_lxc 0%{!?_without_lxc:1}
|
||||
%define with_sasl 0%{!?_without_sasl:1}
|
||||
%define with_avahi 0%{!?_without_avahi:1}
|
||||
%define with_polkit 0%{!?_without_polkit:0}
|
||||
%define with_python 0%{!?_without_python:1}
|
||||
%define with_libvirtd 0%{!?_without_libvirtd:1}
|
||||
%define with_uml 0%{!?_without_uml:1}
|
||||
%define with_network 0%{!?_without_network:1}
|
||||
%define with_xen 0%{!?_without_xen:1}
|
||||
%define with_xen_proxy 0%{!?_without_xen_proxy:1}
|
||||
%define with_qemu 0%{!?_without_qemu:1}
|
||||
%define with_openvz 0%{!?_without_openvz:1}
|
||||
%define with_lxc 0%{!?_without_lxc:1}
|
||||
%define with_vbox 0%{!?_without_vbox:1}
|
||||
%define with_sasl 0%{!?_without_sasl:1}
|
||||
%define with_avahi 0%{!?_without_avahi:1}
|
||||
%define with_python 0%{!?_without_python:1}
|
||||
%define with_libvirtd 0%{!?_without_libvirtd:1}
|
||||
%define with_uml 0%{!?_without_uml:1}
|
||||
%define with_one 0%{!?_without_one:1}
|
||||
%define with_phyp 0%{!?_without_phyp:1}
|
||||
%define with_network 0%{!?_without_network:1}
|
||||
%define with_storage_fs 0%{!?_without_storage_fs:1}
|
||||
%define with_storage_lvm 0%{!?_without_storage_lvm:1}
|
||||
%define with_storage_iscsi 0%{!?_without_storage_iscsi:1}
|
||||
%define with_storage_disk 0%{!?_without_storage_disk:1}
|
||||
%define with_storage_mpath 0%{!?_without_storage_mpath:1}
|
||||
%define with_numactl 0%{!?_without_numactl:1}
|
||||
|
||||
# default to off - selectively enabled below
|
||||
%define with_polkit 0%{!?_without_polkit:0}
|
||||
%define with_capng 0%{!?_without_capng:0}
|
||||
%define with_netcf 0%{!?_without_netcf:0}
|
||||
|
||||
# Xen is available only on i386 x86_64 ia64
|
||||
%ifnarch i386 i586 i686 x86_64 ia64
|
||||
@@ -33,90 +46,112 @@
|
||||
%define with_xen_proxy 0
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} >= 12
|
||||
%define with_capng 0%{!?_without_capng:1}
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} >= 12
|
||||
%define with_netcf 0%{!?_without_netcf:1}
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} >= 12
|
||||
%define qemu_user qemu
|
||||
%define qemu_group qemu
|
||||
%else
|
||||
%define qemu_user root
|
||||
%define qemu_group root
|
||||
%endif
|
||||
|
||||
#
|
||||
# If building on RHEL switch on the specific support
|
||||
# for the specific Xen version
|
||||
#
|
||||
%if 0%{?fedora}
|
||||
%define with_rhel5 0
|
||||
%define with_rhel5 0
|
||||
%else
|
||||
%define with_rhel5 1
|
||||
%define with_rhel5 1
|
||||
%define with_polkit 0
|
||||
%define with_one 0
|
||||
%endif
|
||||
|
||||
|
||||
Summary: Library providing a simple API virtualization
|
||||
Name: libvirt
|
||||
Version: 0.6.1
|
||||
Release: 6%{?dist}%{?extra_release}
|
||||
Version: 0.7.1
|
||||
Release: 1%{?dist}%{?extra_release}
|
||||
License: LGPLv2+
|
||||
Group: Development/Libraries
|
||||
Source: libvirt-%{version}.tar.gz
|
||||
Patch1: libvirt-0.6.1-xend-lookup.patch
|
||||
Patch2: libvirt-0.6.1-xen-events.patch
|
||||
Patch3: libvirt-0.6.1-events-dispatch.patch
|
||||
Patch4: libvirt-0.6.1-fd-leaks.patch
|
||||
Patch5: libvirt-0.6.1-getvcpus-remote.patch
|
||||
Patch6: libvirt-0.6.1-pool-mode-parse.patch
|
||||
Patch7: libvirt-0.6.1-storage-free.patch
|
||||
Patch8: libvirt-0.6.1-vcpu-deadlock.patch
|
||||
Patch9: libvirt-0.6.1-xenblock-detach.patch
|
||||
Patch10: libvirt-0.6.1-fd-leaks2.patch
|
||||
Patch11: libvirt-0.6.1-svirt-shared-readonly.patch
|
||||
Source: http://libvirt.org/sources/libvirt-%{version}.tar.gz
|
||||
|
||||
# Not upstream yet - pending QEMU merge
|
||||
Patch100: libvirt-0.6.1-vnc-sasl-auth.patch
|
||||
|
||||
# Not for upstream. Temporary hack till PulseAudio autostart
|
||||
# problems are sorted out when SELinux enforcing
|
||||
Patch200: libvirt-0.6.1-svirt-sound.patch
|
||||
# Temporary hack till PulseAudio autostart problems are sorted
|
||||
# out when SELinux enforcing (bz 486112)
|
||||
Patch00: libvirt-0.6.4-svirt-sound.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
URL: http://libvirt.org/
|
||||
BuildRequires: python python-devel
|
||||
Requires: readline
|
||||
Requires: ncurses
|
||||
BuildRequires: python-devel
|
||||
|
||||
# The client side, i.e. shared libs and virsh are in a subpackage
|
||||
Requires: libvirt-client = %{version}-%{release}
|
||||
|
||||
Requires: dnsmasq
|
||||
Requires: bridge-utils
|
||||
Requires: iptables
|
||||
# needed for device enumeration
|
||||
Requires: hal
|
||||
# So remote clients can access libvirt over SSH tunnel
|
||||
# (client invokes 'nc' against the UNIX socket on the server)
|
||||
Requires: nc
|
||||
%if %{with_sasl}
|
||||
Requires: cyrus-sasl
|
||||
# Not technically required, but makes 'out-of-box' config
|
||||
# work correctly & doesn't have onerous dependencies
|
||||
Requires: cyrus-sasl-md5
|
||||
%endif
|
||||
%if %{with_polkit}
|
||||
%if 0%{?fedora} >= 12
|
||||
Requires: polkit >= 0.93
|
||||
%else
|
||||
Requires: PolicyKit >= 0.6
|
||||
%endif
|
||||
%endif
|
||||
%if %{with_storage_fs}
|
||||
# For mount/umount in FS driver
|
||||
BuildRequires: util-linux
|
||||
# For showmount in FS driver (netfs discovery)
|
||||
BuildRequires: nfs-utils
|
||||
Requires: nfs-utils
|
||||
# For glusterfs
|
||||
%if 0%{?fedora} >= 11
|
||||
Requires: glusterfs-client >= 2.0.1
|
||||
%endif
|
||||
%endif
|
||||
%if %{with_qemu}
|
||||
# From QEMU RPMs
|
||||
Requires: /usr/bin/qemu-img
|
||||
# For image compression
|
||||
Requires: gzip
|
||||
Requires: bzip2
|
||||
Requires: lzop
|
||||
Requires: xz
|
||||
%else
|
||||
%if %{with_xen}
|
||||
# From Xen RPMs
|
||||
Requires: /usr/sbin/qcow-create
|
||||
%endif
|
||||
%endif
|
||||
%if %{with_storage_lvm}
|
||||
# For LVM drivers
|
||||
Requires: lvm2
|
||||
%endif
|
||||
%if %{with_storage_iscsi}
|
||||
# For ISCSI driver
|
||||
Requires: iscsi-initiator-utils
|
||||
%endif
|
||||
%if %{with_storage_disk}
|
||||
# For disk driver
|
||||
Requires: parted
|
||||
# For svirt support
|
||||
Requires: libselinux
|
||||
%endif
|
||||
%if %{with_storage_mpath}
|
||||
# For multipath support
|
||||
Requires: device-mapper
|
||||
%endif
|
||||
%if %{with_xen}
|
||||
BuildRequires: xen-devel
|
||||
%endif
|
||||
%if %{with_one}
|
||||
BuildRequires: xmlrpc-c-devel >= 1.14.0
|
||||
%endif
|
||||
BuildRequires: libxml2-devel
|
||||
BuildRequires: xhtml1-dtds
|
||||
BuildRequires: readline-devel
|
||||
@@ -130,17 +165,21 @@ BuildRequires: avahi-devel
|
||||
BuildRequires: libselinux-devel
|
||||
BuildRequires: dnsmasq
|
||||
BuildRequires: bridge-utils
|
||||
%if %{with_qemu}
|
||||
BuildRequires: qemu
|
||||
%endif
|
||||
%if %{with_sasl}
|
||||
BuildRequires: cyrus-sasl-devel
|
||||
%endif
|
||||
%if %{with_polkit}
|
||||
%if 0%{?fedora} >= 12
|
||||
# Only need the binary, not -devel
|
||||
BuildRequires: polkit >= 0.93
|
||||
%else
|
||||
BuildRequires: PolicyKit-devel >= 0.6
|
||||
%endif
|
||||
%endif
|
||||
%if %{with_storage_fs}
|
||||
# For mount/umount in FS driver
|
||||
BuildRequires: util-linux
|
||||
%endif
|
||||
%if %{with_qemu}
|
||||
# From QEMU RPMs
|
||||
BuildRequires: /usr/bin/qemu-img
|
||||
@@ -150,23 +189,62 @@ BuildRequires: /usr/bin/qemu-img
|
||||
BuildRequires: /usr/sbin/qcow-create
|
||||
%endif
|
||||
%endif
|
||||
%if %{with_storage_lvm}
|
||||
# For LVM drivers
|
||||
BuildRequires: lvm2
|
||||
%endif
|
||||
%if %{with_storage_iscsi}
|
||||
# For ISCSI driver
|
||||
BuildRequires: iscsi-initiator-utils
|
||||
%endif
|
||||
%if %{with_storage_disk}
|
||||
# For disk driver
|
||||
BuildRequires: parted-devel
|
||||
%endif
|
||||
%if %{with_storage_mpath}
|
||||
# For Multipath support
|
||||
BuildRequires: device-mapper-devel
|
||||
%endif
|
||||
%if %{with_numactl}
|
||||
# For QEMU/LXC numa info
|
||||
BuildRequires: numactl-devel
|
||||
Obsoletes: libvir <= 0.2
|
||||
Provides: libvir = %{version}-%{release}
|
||||
%endif
|
||||
%if %{with_capng}
|
||||
BuildRequires: libcap-ng-devel >= 0.5.0
|
||||
%endif
|
||||
%if %{with_phyp}
|
||||
BuildRequires: libssh2-devel
|
||||
%endif
|
||||
%if %{with_netcf}
|
||||
BuildRequires: netcf-devel
|
||||
%endif
|
||||
|
||||
# Fedora build root suckage
|
||||
BuildRequires: gawk
|
||||
|
||||
%description
|
||||
Libvirt is a C toolkit to interact with the virtualization capabilities
|
||||
of recent versions of Linux (and other OSes).
|
||||
of recent versions of Linux (and other OSes). The main package includes
|
||||
the libvirtd server exporting the virtualization support.
|
||||
|
||||
%package client
|
||||
Summary: Client side library and utilities of the libvirt library
|
||||
Group: Development/Libraries
|
||||
Requires: readline
|
||||
Requires: ncurses
|
||||
# So remote clients can access libvirt over SSH tunnel
|
||||
# (client invokes 'nc' against the UNIX socket on the server)
|
||||
Requires: nc
|
||||
%if %{with_sasl}
|
||||
Requires: cyrus-sasl
|
||||
# Not technically required, but makes 'out-of-box' config
|
||||
# work correctly & doesn't have onerous dependencies
|
||||
Requires: cyrus-sasl-md5
|
||||
%endif
|
||||
|
||||
%description client
|
||||
Shared libraries and client binaries needed to access to the
|
||||
virtualization capabilities of recent versions of Linux (and other OSes).
|
||||
|
||||
%package devel
|
||||
Summary: Libraries, includes, etc. to compile with the libvirt library
|
||||
@@ -176,8 +254,6 @@ Requires: pkgconfig
|
||||
%if %{with_xen}
|
||||
Requires: xen-devel
|
||||
%endif
|
||||
Obsoletes: libvir-devel <= 0.2
|
||||
Provides: libvir-devel = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
Includes and documentations for the C library providing an API to use
|
||||
@@ -188,8 +264,6 @@ the virtualization capabilities of recent versions of Linux (and other OSes).
|
||||
Summary: Python bindings for the libvirt library
|
||||
Group: Development/Libraries
|
||||
Requires: libvirt = %{version}-%{release}
|
||||
Obsoletes: libvir-python <= 0.2
|
||||
Provides: libvir-python = %{version}-%{release}
|
||||
|
||||
%description python
|
||||
The libvirt-python package contains a module that permits applications
|
||||
@@ -200,23 +274,8 @@ of recent versions of Linux (and other OSes).
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p0
|
||||
%patch2 -p0
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p0
|
||||
%patch11 -p1
|
||||
|
||||
%patch100 -p1
|
||||
%patch200 -p1
|
||||
|
||||
mv NEWS NEWS.old
|
||||
iconv -f ISO-8859-1 -t UTF-8 < NEWS.old > NEWS
|
||||
%patch00 -p1
|
||||
|
||||
%build
|
||||
%if ! %{with_xen}
|
||||
@@ -235,6 +294,10 @@ iconv -f ISO-8859-1 -t UTF-8 < NEWS.old > NEWS
|
||||
%define _without_lxc --without-lxc
|
||||
%endif
|
||||
|
||||
%if ! %{with_vbox}
|
||||
%define _without_vbox --without-vbox
|
||||
%endif
|
||||
|
||||
%if ! %{with_sasl}
|
||||
%define _without_sasl --without-sasl
|
||||
%endif
|
||||
@@ -243,6 +306,10 @@ iconv -f ISO-8859-1 -t UTF-8 < NEWS.old > NEWS
|
||||
%define _without_avahi --without-avahi
|
||||
%endif
|
||||
|
||||
%if ! %{with_phyp}
|
||||
%define _without_phyp --without-phyp
|
||||
%endif
|
||||
|
||||
%if ! %{with_polkit}
|
||||
%define _without_polkit --without-polkit
|
||||
%endif
|
||||
@@ -259,6 +326,10 @@ iconv -f ISO-8859-1 -t UTF-8 < NEWS.old > NEWS
|
||||
%define _without_uml --without-uml
|
||||
%endif
|
||||
|
||||
%if ! %{with_one}
|
||||
%define _without_one --without-one
|
||||
%endif
|
||||
|
||||
%if %{with_rhel5}
|
||||
%define _with_rhel5_api --with-rhel5-api
|
||||
%endif
|
||||
@@ -267,41 +338,80 @@ iconv -f ISO-8859-1 -t UTF-8 < NEWS.old > NEWS
|
||||
%define _without_network --without-network
|
||||
%endif
|
||||
|
||||
%if ! %{with_storage_fs}
|
||||
%define _without_storage_fs --without-storage-fs
|
||||
%endif
|
||||
|
||||
%if ! %{with_storage_lvm}
|
||||
%define _without_storage_lvm --without-storage-lvm
|
||||
%endif
|
||||
|
||||
%if ! %{with_storage_iscsi}
|
||||
%define _without_storage_iscsi --without-storage-iscsi
|
||||
%endif
|
||||
|
||||
%if ! %{with_storage_disk}
|
||||
%define _without_storage_disk --without-storage-disk
|
||||
%endif
|
||||
|
||||
%if ! %{with_storage_mpath}
|
||||
%define _without_storage_mpath --without-storage-mpath
|
||||
%endif
|
||||
|
||||
%if ! %{with_numactl}
|
||||
%define _without_numactl --without-numactl
|
||||
%endif
|
||||
|
||||
%if ! %{with_capng}
|
||||
%define _without_capng --without-capng
|
||||
%endif
|
||||
|
||||
%if ! %{with_netcf}
|
||||
%define _without_netcf --without-netcf
|
||||
%endif
|
||||
|
||||
%configure %{?_without_xen} \
|
||||
%{?_without_qemu} \
|
||||
%{?_without_openvz} \
|
||||
%{?_without_lxc} \
|
||||
%{?_without_vbox} \
|
||||
%{?_without_sasl} \
|
||||
%{?_without_avahi} \
|
||||
%{?_without_polkit} \
|
||||
%{?_without_python} \
|
||||
%{?_without_libvirtd} \
|
||||
%{?_without_uml} \
|
||||
%{?_without_one} \
|
||||
%{?_without_phyp} \
|
||||
%{?_without_network} \
|
||||
%{?_with_rhel5_api} \
|
||||
%{?_without_storage_fs} \
|
||||
%{?_without_storage_lvm} \
|
||||
%{?_without_storage_iscsi} \
|
||||
%{?_without_storage_disk} \
|
||||
%{?_without_storage_mpath} \
|
||||
%{?_without_numactl} \
|
||||
%{?_without_capng} \
|
||||
%{?_without_netcf} \
|
||||
--with-qemu-user=%{qemu_user} \
|
||||
--with-qemu-group=%{qemu_group} \
|
||||
--with-init-script=redhat \
|
||||
--with-qemud-pid-file=%{_localstatedir}/run/libvirt_qemud.pid \
|
||||
--with-remote-file=%{_localstatedir}/run/libvirtd.pid
|
||||
--with-remote-pid-file=%{_localstatedir}/run/libvirtd.pid
|
||||
make %{?_smp_mflags}
|
||||
gzip -9 ChangeLog
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
rm -fr %{buildroot}
|
||||
|
||||
%makeinstall
|
||||
(cd docs/examples ; make clean ; rm -rf .deps Makefile Makefile.in)
|
||||
(cd docs/examples/python ; rm -rf .deps Makefile Makefile.in)
|
||||
(cd examples/hellolibvirt ; make clean ; rm -rf .deps .libs Makefile Makefile.in)
|
||||
(cd examples/domain-events/events-c ; make clean ;rm -rf .deps .libs Makefile Makefile.in)
|
||||
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a
|
||||
install -d -m 0755 $RPM_BUILD_ROOT%{_localstatedir}/run/libvirt/
|
||||
# Default dir for disk images defined in SELinux policy
|
||||
install -d -m 0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/libvirt/images/
|
||||
# Default dir for kernel+initrd images defnied in SELinux policy
|
||||
install -d -m 0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/libvirt/boot/
|
||||
|
||||
%if %{with_qemu}
|
||||
# We don't want to install /etc/libvirt/qemu/networks in the main %files list
|
||||
@@ -337,8 +447,19 @@ chmod 0644 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/libvirtd
|
||||
%clean
|
||||
rm -fr %{buildroot}
|
||||
|
||||
%pre
|
||||
%if 0%{?fedora} >= 12
|
||||
# Normally 'setup' adds this in /etc/passwd, but this is
|
||||
# here for case of upgrades from earlier Fedora. This
|
||||
# UID/GID pair is reserved for qemu:qemu
|
||||
getent group kvm >/dev/null || groupadd -g 36 -r kvm
|
||||
getent group qemu >/dev/null || groupadd -g 107 -r qemu
|
||||
getent passwd qemu >/dev/null || \
|
||||
useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
|
||||
-c "qemu user" qemu
|
||||
%endif
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
|
||||
%if %{with_libvirtd}
|
||||
%if %{with_qemu}
|
||||
@@ -357,6 +478,9 @@ fi
|
||||
%endif
|
||||
|
||||
/sbin/chkconfig --add libvirtd
|
||||
if [ "$1" -ge "1" ]; then
|
||||
/sbin/service libvirtd condrestart > /dev/null 2>&1
|
||||
fi
|
||||
%endif
|
||||
|
||||
%preun
|
||||
@@ -367,15 +491,14 @@ if [ $1 = 0 ]; then
|
||||
fi
|
||||
%endif
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
%post client -p /sbin/ldconfig
|
||||
|
||||
%files -f %{name}.lang
|
||||
%postun client -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
|
||||
%doc AUTHORS ChangeLog NEWS README COPYING.LIB TODO
|
||||
%doc %{_mandir}/man1/virsh.1*
|
||||
%{_bindir}/virsh
|
||||
%{_libdir}/lib*.so.*
|
||||
%doc AUTHORS ChangeLog.gz NEWS README COPYING.LIB TODO
|
||||
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
|
||||
|
||||
%if %{with_qemu}
|
||||
@@ -395,35 +518,23 @@ fi
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
|
||||
%endif
|
||||
|
||||
%if %{with_sasl}
|
||||
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
|
||||
%endif
|
||||
|
||||
%if %{with_qemu}
|
||||
%dir %{_datadir}/libvirt/
|
||||
%dir %{_datadir}/libvirt/networks/
|
||||
%{_datadir}/libvirt/networks/default.xml
|
||||
%endif
|
||||
|
||||
%dir %{_datadir}/libvirt/
|
||||
%dir %{_datadir}/libvirt/schemas/
|
||||
|
||||
%{_datadir}/libvirt/schemas/domain.rng
|
||||
%{_datadir}/libvirt/schemas/network.rng
|
||||
%{_datadir}/libvirt/schemas/storagepool.rng
|
||||
%{_datadir}/libvirt/schemas/storagevol.rng
|
||||
%{_datadir}/libvirt/schemas/nodedev.rng
|
||||
%{_datadir}/libvirt/schemas/capability.rng
|
||||
|
||||
%dir %{_localstatedir}/run/libvirt/
|
||||
|
||||
%dir %{_localstatedir}/lib/libvirt/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/images/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/boot/
|
||||
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/
|
||||
%dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/boot/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/cache/libvirt/
|
||||
|
||||
%if %{with_qemu}
|
||||
%dir %{_localstatedir}/run/libvirt/qemu/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/qemu/
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/qemu/
|
||||
%dir %attr(0700, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
|
||||
%dir %attr(0700, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/
|
||||
%endif
|
||||
%if %{with_lxc}
|
||||
%dir %{_localstatedir}/run/libvirt/lxc/
|
||||
@@ -452,8 +563,12 @@ fi
|
||||
%endif
|
||||
|
||||
%if %{with_polkit}
|
||||
%if 0%{?fedora} >= 12
|
||||
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
|
||||
%else
|
||||
%{_datadir}/PolicyKit/policy/org.libvirt.unix.policy
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/
|
||||
%if %{with_qemu}
|
||||
@@ -475,6 +590,33 @@ fi
|
||||
|
||||
%doc docs/*.xml
|
||||
|
||||
%files client -f %{name}.lang
|
||||
%defattr(-, root, root)
|
||||
%doc AUTHORS ChangeLog.gz NEWS README COPYING.LIB TODO
|
||||
|
||||
%{_mandir}/man1/virsh.1*
|
||||
%{_mandir}/man1/virt-xml-validate.1*
|
||||
%{_bindir}/virsh
|
||||
%{_bindir}/virt-xml-validate
|
||||
%{_libdir}/lib*.so.*
|
||||
|
||||
%dir %{_datadir}/libvirt/
|
||||
%dir %{_datadir}/libvirt/schemas/
|
||||
|
||||
%{_datadir}/libvirt/schemas/domain.rng
|
||||
%{_datadir}/libvirt/schemas/network.rng
|
||||
%{_datadir}/libvirt/schemas/storagepool.rng
|
||||
%{_datadir}/libvirt/schemas/storagevol.rng
|
||||
%{_datadir}/libvirt/schemas/nodedev.rng
|
||||
%{_datadir}/libvirt/schemas/capability.rng
|
||||
%{_datadir}/libvirt/schemas/interface.rng
|
||||
%{_datadir}/libvirt/schemas/secret.rng
|
||||
%{_datadir}/libvirt/schemas/storageencryption.rng
|
||||
|
||||
%if %{with_sasl}
|
||||
%config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf
|
||||
%endif
|
||||
|
||||
%files devel
|
||||
%defattr(-, root, root)
|
||||
|
||||
@@ -482,6 +624,7 @@ fi
|
||||
%dir %{_includedir}/libvirt
|
||||
%{_includedir}/libvirt/*.h
|
||||
%{_libdir}/pkgconfig/libvirt.pc
|
||||
%dir %{_datadir}/gtk-doc/html/libvirt/
|
||||
%doc %{_datadir}/gtk-doc/html/libvirt/*.devhelp
|
||||
%doc %{_datadir}/gtk-doc/html/libvirt/*.html
|
||||
%doc %{_datadir}/gtk-doc/html/libvirt/*.png
|
||||
@@ -506,6 +649,176 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Tue Sep 15 2009 Daniel Veillard <veillard@redhat.com> - 0.7.1-1
|
||||
- Upstream release of 0.7.1
|
||||
- ESX, VBox driver updates
|
||||
- mutipath support
|
||||
- support for encrypted (qcow) volume
|
||||
- compressed save image format for Qemu/KVM
|
||||
- QEmu host PCI device hotplug support
|
||||
- configuration of huge pages in guests
|
||||
- a lot of fixes
|
||||
|
||||
* Mon Sep 14 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-0.2.gitfac3f4c
|
||||
- Update to newer snapshot of 0.7.1
|
||||
- Stop libvirt using untrusted 'info vcpus' PID data (#520864)
|
||||
- Support relabelling of USB and PCI devices
|
||||
- Enable multipath storage support
|
||||
- Restart libvirtd upon RPM upgrade
|
||||
|
||||
* Sun Sep 6 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-0.1.gitg3ef2e05
|
||||
- Update to pre-release git snapshot of 0.7.1
|
||||
- Drop upstreamed patches
|
||||
|
||||
* Wed Aug 19 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.0-6
|
||||
- Fix migration completion with newer versions of qemu (#516187)
|
||||
|
||||
* Wed Aug 19 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.0-5
|
||||
- Add PCI host device hotplug support
|
||||
- Allow PCI bus reset to reset other devices (#499678)
|
||||
- Fix stupid PCI reset error message (bug #499678)
|
||||
- Allow PM reset on multi-function PCI devices (bug #515689)
|
||||
- Re-attach PCI host devices after guest shuts down (bug #499561)
|
||||
- Fix list corruption after disk hot-unplug
|
||||
- Fix minor 'virsh nodedev-list --tree' annoyance
|
||||
|
||||
* Thu Aug 13 2009 Daniel P. Berrange <berrange@redhat.com> - 0.7.0-4
|
||||
- Rewrite policykit support (rhbz #499970)
|
||||
- Log and ignore NUMA topology problems (rhbz #506590)
|
||||
|
||||
* Mon Aug 10 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.0-3
|
||||
- Don't fail to start network if ipv6 modules is not loaded (#516497)
|
||||
|
||||
* Thu Aug 6 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.0-2
|
||||
- Make sure qemu can access kernel/initrd (bug #516034)
|
||||
- Set perms on /var/lib/libvirt/boot to 0711 (bug #516034)
|
||||
|
||||
* Wed Aug 5 2009 Daniel Veillard <veillard@redhat.com> - 0.7.0-1
|
||||
- Upstream release of 0.7.0
|
||||
- ESX, VBox3, Power Hypervisor drivers
|
||||
- new net filesystem glusterfs
|
||||
- Storage cloning for LVM and Disk backends
|
||||
- interface implementation based on netcf
|
||||
- Support cgroups in QEMU driver
|
||||
- QEmu hotplug NIC support
|
||||
- a lot of fixes
|
||||
|
||||
* Fri Jul 31 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.0-0.9.gite195b43
|
||||
- Set perms on /var/lib/libvirt/images to 0711
|
||||
|
||||
* Thu Jul 30 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.0-0.8.gite195b43
|
||||
- Add patch from upstream to fix qemu pidfile perms problem
|
||||
|
||||
* Thu Jul 30 2009 Daniel P. Berrange <berrange@redhat.com> - 0.7.0-0.7.gite195b43
|
||||
- Create qemu/kvm user & group to fix upgrades
|
||||
|
||||
* Wed Jul 29 2009 Daniel Veillard <veillard@redhat.com> - 0.7.0-0.6.gite195b43
|
||||
- another prerelease with qemu, uml and remote patches
|
||||
- drop the news patch as it's now UTF8 upstream
|
||||
|
||||
* Wed Jul 29 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.0-0.5.gitf055724
|
||||
- Move ldconfig call to libvirt-client %post/%postun
|
||||
- Fix rpmlint warning about libvirt-client summary
|
||||
- Fix disabling polkit and netcf on older fedoras
|
||||
|
||||
* Wed Jul 29 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.0-0.4.gitf055724
|
||||
- Drop explicit libselinux requires, it is autorequired
|
||||
- Drop cleanup of python/tests, apparently not needed
|
||||
- Cherry-pick upstream patch to convert NEWS to UTF-8, drop iconv
|
||||
- Drop python BR; python-devel requires it
|
||||
|
||||
* Tue Jul 28 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.0-0.3.gitf055724
|
||||
- Enable netcf support
|
||||
- Pass --with-qemu-user=qemu etc. to configure
|
||||
- Move various requires to the libvirt-client sub-package
|
||||
- Sync some trivial cleanups from upstream spec file
|
||||
- Remove explicit libxml2 requires, again
|
||||
- Build with --without-capng if capng support is disabled
|
||||
- Remove explicit dir creating in makeinstall, replaced by attr in files
|
||||
- Set perms on /var/{run,lib,cache}/libvirt/qemu
|
||||
|
||||
* Tue Jul 28 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.0-0.2.gitf055724
|
||||
- Drop glusterfs dep to 2.0.1 (bug #514191)
|
||||
|
||||
* Mon Jul 27 2009 Daniel Veillard <veillard@redhat.com> - 0.7.0-0.1.gitf055724
|
||||
- prerelease of 0.7.0
|
||||
|
||||
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.5-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||
|
||||
* Fri Jul 10 2009 Richard W.M. Jones <rjones@redhat.com> - 0.6.5-2.fc12
|
||||
- Bump release number to rebuild against new libparted.
|
||||
|
||||
* Fri Jul 3 2009 Daniel Veillard <veillard@redhat.com> - 0.6.5-1.fc12
|
||||
- Upstream release of 0.6.5
|
||||
- OpenNebula driver
|
||||
- many bug fixes
|
||||
|
||||
* Fri Jul 3 2009 Mark McLoughlin <markmc@redhat.com> - 0.6.4-4.fc12
|
||||
- Fix libvirtd crash with bad capabilities data (bug #505635)
|
||||
|
||||
* Fri Jul 3 2009 Mark McLoughlin <markmc@redhat.com> - 0.6.4-3.fc12
|
||||
- Handle shared/readonly image labelling (bug #493692)
|
||||
- Don't unnecessarily try to change a file context (bug #507555)
|
||||
- Don't try to label a disk with no path (e.g. empty cdrom) (bug #499569)
|
||||
|
||||
* Fri Jun 5 2009 Mark McLoughlin <markmc@redhat.com> - 0.6.4-2.fc12
|
||||
- Remove the qemu BuildRequires
|
||||
|
||||
* Fri May 29 2009 Daniel Veillard <veillard@redhat.com> - 0.6.4-1.fc12
|
||||
- Upstream release of 0.6.4
|
||||
- new APIs
|
||||
- fixes for latests QEmu/KVM versions
|
||||
- various assorted fixes
|
||||
|
||||
* Mon May 25 2009 Mark McLoughlin <markmc@redhat.com> - 0.6.3-11.fc12
|
||||
- Bring up the bridge, even if it doesn't have an IP address (bug #501912)
|
||||
|
||||
* Thu May 21 2009 Mark McLoughlin <markmc@redhat.com> - 0.6.3-10.fc12
|
||||
- Fix XML attribute escaping (bug #499791)
|
||||
- Fix serious event handling issues causing guests to be destroyed (bug #499698)
|
||||
|
||||
* Thu May 21 2009 Mark McLoughlin <markmc@redhat.com> - 0.6.3-9.fc12
|
||||
- Fix qemu argv detection with latest qemu (bug #501923)
|
||||
|
||||
* Sun May 10 2009 Cole Robinson <crobinso@redhat.com> - 0.6.2-8.fc12
|
||||
- Don't try to label a disk with no path (e.g. empty cdrom) (bug #499569)
|
||||
|
||||
* Thu May 7 2009 Mark McLoughlin <markmc@redhat.com> - 0.6.3-7.fc12
|
||||
- Enable migration for qemu 0.10 (bug #499704)
|
||||
|
||||
* Wed May 6 2009 Cole Robinson <crobinso@redhat.com> - 0.6.3-6.fc12
|
||||
- Refresh qemu caps when getCapabilities is called (bug #460649)
|
||||
|
||||
* Wed May 6 2009 Mark McLoughlin <markmc@redhat.com> - 0.6.3-5.fc12
|
||||
- Fix handling of <hostdev managed='yes'> (bug #499386)
|
||||
|
||||
* Tue May 5 2009 Daniel Berrange <berrange@redhat.com> - 0.6.3-4.fc12
|
||||
- Fix readonly/shared disk image labelling (rhbz #493692)
|
||||
|
||||
* Tue Apr 28 2009 Daniel Veillard <veillard@redhat.com> - 0.6.3-3.fc12
|
||||
- was also missing /usr/share/gtk-doc/html/libvirt in -devel
|
||||
|
||||
* Tue Apr 28 2009 Daniel Veillard <veillard@redhat.com> - 0.6.3-2.fc12
|
||||
- fix packaging bug #496945 libvirt should own /var/cache/libvirt
|
||||
|
||||
* Fri Apr 24 2009 Daniel Veillard <veillard@redhat.com> - 0.6.3-1.fc12
|
||||
- release of 0.6.3
|
||||
- VirtualBox driver
|
||||
- new virt-xml-validate command
|
||||
- assorted bug fixes
|
||||
|
||||
* Thu Apr 16 2009 Mark McLoughlin <markmc@redhat.com> - 0.6.2-2.fc12
|
||||
- Fix qemu drive format specification (#496092)
|
||||
|
||||
* Fri Apr 3 2009 Daniel Veillard <veillard@redhat.com> - 0.6.2-1.fc11
|
||||
- release of 0.6.2
|
||||
- memory ballooning in QEMU
|
||||
- SCSI HBA storage pool support
|
||||
- support SASL auth for VNC server
|
||||
- PCI passthrough in Xen driver
|
||||
- assorted bug fixes
|
||||
|
||||
* Fri Apr 3 2009 Daniel P. Berrange <berrange@redhat.com> - 0.6.1-6.fc11
|
||||
- Fix typo in previous patch
|
||||
|
||||
|
||||
Reference in New Issue
Block a user