Compare commits
135 Commits
libvirt-0_
...
libvirt-0_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36aee593bc | ||
|
|
dc0cb0e91a | ||
|
|
84d66312fe | ||
|
|
4f644ce267 | ||
|
|
cdd5b3d62d | ||
|
|
53f63aa62d | ||
|
|
748df35c5f | ||
|
|
a6e23d00fa | ||
|
|
c6d11b43c9 | ||
|
|
83091ff0dd | ||
|
|
4465a63872 | ||
|
|
3f397d9786 | ||
|
|
750aec5507 | ||
|
|
d7c1d3bbc0 | ||
|
|
fa0f21c263 | ||
|
|
afdaf5d354 | ||
|
|
26bba5aea9 | ||
|
|
1a4185bdcc | ||
|
|
6a73119e65 | ||
|
|
1e2f9fce0a | ||
|
|
f5edf79c95 | ||
|
|
b59e64bf44 | ||
|
|
a09fc2658a | ||
|
|
a008fcf27e | ||
|
|
511f6cd625 | ||
|
|
48b90fefc1 | ||
|
|
bc4bbabdf6 | ||
|
|
905627c8fd | ||
|
|
a16d752c10 | ||
|
|
29b1292019 | ||
|
|
f3546be64b | ||
|
|
fb9044931e | ||
|
|
03c5fec4d2 | ||
|
|
ce373a25b6 | ||
|
|
996d0e4709 | ||
|
|
8c01426c44 | ||
|
|
e859f7e59e | ||
|
|
25ea2f59bd | ||
|
|
c80b7f0d5a | ||
|
|
958f1c3dff | ||
|
|
4a8ca1017f | ||
|
|
1e122ee5dc | ||
|
|
6a6307bcdc | ||
|
|
6e8332946a | ||
|
|
982683e56f | ||
|
|
7244d1a339 | ||
|
|
2a3935580c | ||
|
|
28f7f11450 | ||
|
|
ca07bc4597 | ||
|
|
8e23194a2b | ||
|
|
fe09090e2d | ||
|
|
b5868cf8cf | ||
|
|
f294b40ba5 | ||
|
|
c0c1a7bb79 | ||
|
|
1b864048bd | ||
|
|
072c9c45ab | ||
|
|
af111679c3 | ||
|
|
dd9f21eaa2 | ||
|
|
f0e356df98 | ||
|
|
140bcf9ffc | ||
|
|
af69660412 | ||
|
|
6dc94c6252 | ||
|
|
eb34165670 | ||
|
|
7ce08f2148 | ||
|
|
049a8c79d9 | ||
|
|
f7a6d90012 | ||
|
|
67a2f29a89 | ||
|
|
82422fa1ff | ||
|
|
a73cf1d010 | ||
|
|
481419ebb6 | ||
|
|
1e65165c3a | ||
|
|
bca27d9111 | ||
|
|
08b9144b41 | ||
|
|
2063007248 | ||
|
|
81e46cb6da | ||
|
|
263e2f2021 | ||
|
|
2b9efc3de2 | ||
|
|
69f6239766 | ||
|
|
bf744f9872 | ||
|
|
45b0b2bfa6 | ||
|
|
f29ea218b7 | ||
|
|
7d193b7810 | ||
|
|
3182a4df5a | ||
|
|
4f667910e9 | ||
|
|
b395a39f7b | ||
|
|
fdd7e87fe3 | ||
|
|
f06c387ab5 | ||
|
|
5ad8bc8190 | ||
|
|
31802de821 | ||
|
|
cc39758e17 | ||
|
|
55fabd69c0 | ||
|
|
b2a1a0e9ba | ||
|
|
cbe377ed29 | ||
|
|
06a21e388f | ||
|
|
d1a886ab31 | ||
|
|
c70baa5133 | ||
|
|
52b4d91272 | ||
|
|
338630edc8 | ||
|
|
a05e64b718 | ||
|
|
c003690dfc | ||
|
|
2cac8ea133 | ||
|
|
deefad73a9 | ||
|
|
f6cef943a9 | ||
|
|
7a6f0752c1 | ||
|
|
36d558635e | ||
|
|
98bceee6b1 | ||
|
|
4e70e5049f | ||
|
|
e66ceb7f97 | ||
|
|
23d5b99123 | ||
|
|
df8a62cdc8 | ||
|
|
8e36286f00 | ||
|
|
cd0f44cfff | ||
|
|
dcd808aefc | ||
|
|
8713d4b7ef | ||
|
|
68efefa919 | ||
|
|
1c5afbb774 | ||
|
|
e61694fd1d | ||
|
|
608f915ea7 | ||
|
|
b28edd6eab | ||
|
|
327fe785ba | ||
|
|
5c1d884231 | ||
|
|
54c7c9997c | ||
|
|
dec47cc4eb | ||
|
|
ecaf0eb615 | ||
|
|
ea6b32b5e4 | ||
|
|
313e00f3ac | ||
|
|
b3a53e18a9 | ||
|
|
24467d1235 | ||
|
|
fdaa69f5e3 | ||
|
|
cf2cd869d9 | ||
|
|
f2572ab2b4 | ||
|
|
90a17a6e65 | ||
|
|
9f2e4f2b21 | ||
|
|
bc485ef21f | ||
|
|
0d3a7da407 |
18
.cvsignore
18
.cvsignore
@@ -1,8 +1,10 @@
|
||||
libvirt-0.0.3.tar.gz
|
||||
libvirt-0.0.4.tar.gz
|
||||
libvirt-0.0.5.tar.gz
|
||||
libvirt-0.0.6.tar.gz
|
||||
libvirt-0.1.0.tar.gz
|
||||
libvirt-0.1.2.tar.gz
|
||||
libvirt-0.1.1.tar.gz
|
||||
libvirt-0.1.3.tar.gz
|
||||
.build*.log
|
||||
*.rpm
|
||||
i686
|
||||
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
|
||||
|
||||
17
Makefile
17
Makefile
@@ -3,4 +3,19 @@
|
||||
NAME := libvirt
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
include ../common/Makefile.common
|
||||
define find-makefile-common
|
||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||
|
||||
ifeq ($(MAKEFILE_COMMON),)
|
||||
# attempt a checkout
|
||||
define checkout-makefile-common
|
||||
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
||||
endif
|
||||
|
||||
include $(MAKEFILE_COMMON)
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
From ae4523336ac06e3ff7cc7b416fad9e57998c6b54 Mon Sep 17 00:00:00 2001
|
||||
From: Tim Waugh <twaugh@redhat.com>
|
||||
Date: Fri, 3 Jul 2009 10:29:01 +0100
|
||||
Subject: [PATCH 2/3] Don't unnecessarily try to change a file context
|
||||
|
||||
As pointed out by Tim Waugh here:
|
||||
|
||||
https://bugzilla.redhat.com/507555
|
||||
|
||||
We shouldn't bother trying to set the context of a file if it already
|
||||
matches what we want.
|
||||
|
||||
(Fixed to use STREQ() and not use tabs, as pointed out by danpb)
|
||||
|
||||
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
|
||||
---
|
||||
src/security_selinux.c | 11 ++++++++++-
|
||||
1 files changed, 10 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/src/security_selinux.c b/src/security_selinux.c
|
||||
index db1c27d..c2015a1 100644
|
||||
--- a/src/security_selinux.c
|
||||
+++ b/src/security_selinux.c
|
||||
@@ -280,10 +280,19 @@ static int
|
||||
SELinuxSetFilecon(virConnectPtr conn, const char *path, char *tcon)
|
||||
{
|
||||
char ebuf[1024];
|
||||
+ security_context_t econ;
|
||||
|
||||
VIR_INFO("Setting SELinux context on '%s' to '%s'", path, tcon);
|
||||
|
||||
- if(setfilecon(path, tcon) < 0) {
|
||||
+ if (setfilecon(path, tcon) < 0) {
|
||||
+ if (getfilecon(path, &econ) >= 0) {
|
||||
+ if (STREQ(tcon, econ)) {
|
||||
+ freecon(econ);
|
||||
+ /* It's alright, there's nothing to change anyway. */
|
||||
+ return 0;
|
||||
+ }
|
||||
+ freecon(econ);
|
||||
+ }
|
||||
virSecurityReportError(conn, VIR_ERR_ERROR,
|
||||
_("%s: unable to set security context "
|
||||
"'\%s\' on %s: %s."), __func__,
|
||||
--
|
||||
1.6.2.5
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
From 80965bff6d46dea1808c8bbf02f50f0e289a0e65 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel P. Berrange <berrange@redhat.com>
|
||||
Date: Mon, 29 Jun 2009 10:41:56 +0000
|
||||
Subject: [PATCH] Fix crash in QEMU driver with bad capabilities data
|
||||
|
||||
---
|
||||
src/qemu_driver.c | 80 +++++++++++++++++++++++++++++++++++-----------------
|
||||
1 files changed, 54 insertions(+), 26 deletions(-)
|
||||
|
||||
diff -up libvirt-0.6.2/src/qemu_driver.c.bad-caps libvirt-0.6.2/src/qemu_driver.c
|
||||
--- libvirt-0.6.2/src/qemu_driver.c.bad-caps 2009-07-03 10:07:03.275252815 +0100
|
||||
+++ libvirt-0.6.2/src/qemu_driver.c 2009-07-03 10:08:52.143502961 +0100
|
||||
@@ -360,12 +360,43 @@ next:
|
||||
return 0;
|
||||
}
|
||||
|
||||
+
|
||||
+static int
|
||||
+qemudSecurityCapsInit(virSecurityDriverPtr secdrv,
|
||||
+ virCapsPtr caps)
|
||||
+{
|
||||
+ const char *doi, *model;
|
||||
+
|
||||
+ doi = virSecurityDriverGetDOI(secdrv);
|
||||
+ model = virSecurityDriverGetModel(secdrv);
|
||||
+
|
||||
+ caps->host.secModel.model = strdup(model);
|
||||
+ if (!caps->host.secModel.model) {
|
||||
+ char ebuf[1024];
|
||||
+ VIR_ERROR(_("Failed to copy secModel model: %s"),
|
||||
+ virStrerror(errno, ebuf, sizeof ebuf));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ caps->host.secModel.doi = strdup(doi);
|
||||
+ if (!caps->host.secModel.doi) {
|
||||
+ char ebuf[1024];
|
||||
+ VIR_ERROR(_("Failed to copy secModel DOI: %s"),
|
||||
+ virStrerror(errno, ebuf, sizeof ebuf));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ VIR_DEBUG("Initialized caps for security driver \"%s\" with "
|
||||
+ "DOI \"%s\"", model, doi);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int
|
||||
qemudSecurityInit(struct qemud_driver *qemud_drv)
|
||||
{
|
||||
int ret;
|
||||
- const char *doi, *model;
|
||||
- virCapsPtr caps;
|
||||
virSecurityDriverPtr security_drv;
|
||||
|
||||
ret = virSecurityDriverStartup(&security_drv,
|
||||
@@ -381,36 +412,17 @@ qemudSecurityInit(struct qemud_driver *q
|
||||
}
|
||||
|
||||
qemud_drv->securityDriver = security_drv;
|
||||
- doi = virSecurityDriverGetDOI(security_drv);
|
||||
- model = virSecurityDriverGetModel(security_drv);
|
||||
|
||||
- VIR_DEBUG("Initialized security driver \"%s\" with "
|
||||
- "DOI \"%s\"", model, doi);
|
||||
+ VIR_INFO("Initialized security driver %s", security_drv->name);
|
||||
|
||||
/*
|
||||
* Add security policy host caps now that the security driver is
|
||||
* initialized.
|
||||
*/
|
||||
- caps = qemud_drv->caps;
|
||||
-
|
||||
- caps->host.secModel.model = strdup(model);
|
||||
- if (!caps->host.secModel.model) {
|
||||
- char ebuf[1024];
|
||||
- VIR_ERROR(_("Failed to copy secModel model: %s"),
|
||||
- virStrerror(errno, ebuf, sizeof ebuf));
|
||||
- return -1;
|
||||
- }
|
||||
+ return qemudSecurityCapsInit(security_drv, qemud_drv->caps);
|
||||
+}
|
||||
|
||||
- caps->host.secModel.doi = strdup(doi);
|
||||
- if (!caps->host.secModel.doi) {
|
||||
- char ebuf[1024];
|
||||
- VIR_ERROR(_("Failed to copy secModel DOI: %s"),
|
||||
- virStrerror(errno, ebuf, sizeof ebuf));
|
||||
- return -1;
|
||||
- }
|
||||
|
||||
- return 0;
|
||||
-}
|
||||
|
||||
/**
|
||||
* qemudStartup:
|
||||
@@ -1852,13 +1864,29 @@ static int qemudGetNodeInfo(virConnectPt
|
||||
|
||||
static char *qemudGetCapabilities(virConnectPtr conn) {
|
||||
struct qemud_driver *driver = conn->privateData;
|
||||
+ virCapsPtr caps;
|
||||
char *xml = NULL;
|
||||
|
||||
qemuDriverLock(driver);
|
||||
+ if ((caps = qemudCapsInit()) == NULL) {
|
||||
+ virReportOOMError(conn);
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+
|
||||
+ if (qemu_driver->securityDriver &&
|
||||
+ qemudSecurityCapsInit(qemu_driver->securityDriver, caps) < 0) {
|
||||
+ virCapabilitiesFree(caps);
|
||||
+ virReportOOMError(conn);
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+
|
||||
virCapabilitiesFree(qemu_driver->caps);
|
||||
- if ((qemu_driver->caps = qemudCapsInit()) == NULL ||
|
||||
- (xml = virCapabilitiesFormatXML(driver->caps)) == NULL)
|
||||
+ qemu_driver->caps = caps;
|
||||
+
|
||||
+ if ((xml = virCapabilitiesFormatXML(driver->caps)) == NULL)
|
||||
virReportOOMError(conn);
|
||||
+
|
||||
+cleanup:
|
||||
qemuDriverUnlock(driver);
|
||||
|
||||
return xml;
|
||||
35
libvirt-0.6.4-fix-nosource-label.patch
Normal file
35
libvirt-0.6.4-fix-nosource-label.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
From 06f607a9c5cfd50433ae27cc7729c31f81d87f19 Mon Sep 17 00:00:00 2001
|
||||
From: Cole Robinson <crobinso@redhat.com>
|
||||
Date: Fri, 3 Jul 2009 10:40:55 +0100
|
||||
Subject: [PATCH 3/3] Skip labelling if no src path present
|
||||
|
||||
Fixes startup of guest's with sourceless cdrom devices.
|
||||
|
||||
Patch originall posted here:
|
||||
|
||||
https://bugzilla.redhat.com/499569
|
||||
|
||||
but never sent upstream.
|
||||
|
||||
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
|
||||
---
|
||||
src/security_selinux.c | 3 +++
|
||||
1 files changed, 3 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/src/security_selinux.c b/src/security_selinux.c
|
||||
index c2015a1..eb8d308 100644
|
||||
--- a/src/security_selinux.c
|
||||
+++ b/src/security_selinux.c
|
||||
@@ -342,6 +342,9 @@ SELinuxSetSecurityImageLabel(virConnectPtr conn,
|
||||
{
|
||||
const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
|
||||
|
||||
+ if (!disk->src)
|
||||
+ return 0;
|
||||
+
|
||||
if (disk->shared) {
|
||||
return SELinuxSetFilecon(conn, disk->src, default_image_context);
|
||||
} else if (disk->readonly) {
|
||||
--
|
||||
1.6.2.5
|
||||
|
||||
97
libvirt-0.6.4-shared-readonly-label.patch
Normal file
97
libvirt-0.6.4-shared-readonly-label.patch
Normal file
@@ -0,0 +1,97 @@
|
||||
From e700e17c3989d32e04ef98c63ac9b9414fefb366 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel P. Berrange <berrange@redhat.com>
|
||||
Date: Fri, 3 Jul 2009 10:24:50 +0100
|
||||
Subject: [PATCH 1/3] Re-label shared and readonly images
|
||||
|
||||
This patch was posted ages ago here:
|
||||
|
||||
https://bugzilla.redhat.com/493692
|
||||
|
||||
But was never posted upstream AFAICT.
|
||||
|
||||
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
|
||||
---
|
||||
src/security_selinux.c | 27 +++++++++++++++++----------
|
||||
1 files changed, 17 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/security_selinux.c b/src/security_selinux.c
|
||||
index ac317d7..db1c27d 100644
|
||||
--- a/src/security_selinux.c
|
||||
+++ b/src/security_selinux.c
|
||||
@@ -24,11 +24,12 @@
|
||||
#include "virterror_internal.h"
|
||||
#include "util.h"
|
||||
#include "memory.h"
|
||||
-
|
||||
+#include "logging.h"
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_SECURITY
|
||||
|
||||
static char default_domain_context[1024];
|
||||
+static char default_content_context[1024];
|
||||
static char default_image_context[1024];
|
||||
#define SECURITY_SELINUX_VOID_DOI "0"
|
||||
#define SECURITY_SELINUX_NAME "selinux"
|
||||
@@ -148,8 +149,13 @@ SELinuxInitialize(virConnectPtr conn)
|
||||
close(fd);
|
||||
|
||||
ptr = strchrnul(default_image_context, '\n');
|
||||
- *ptr = '\0';
|
||||
-
|
||||
+ if (*ptr == '\n') {
|
||||
+ *ptr = '\0';
|
||||
+ strcpy(default_content_context, ptr+1);
|
||||
+ ptr = strchrnul(default_content_context, '\n');
|
||||
+ if (*ptr == '\n')
|
||||
+ *ptr = '\0';
|
||||
+ }
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -275,6 +281,8 @@ SELinuxSetFilecon(virConnectPtr conn, const char *path, char *tcon)
|
||||
{
|
||||
char ebuf[1024];
|
||||
|
||||
+ VIR_INFO("Setting SELinux context on '%s' to '%s'", path, tcon);
|
||||
+
|
||||
if(setfilecon(path, tcon) < 0) {
|
||||
virSecurityReportError(conn, VIR_ERR_ERROR,
|
||||
_("%s: unable to set security context "
|
||||
@@ -299,9 +307,6 @@ SELinuxRestoreSecurityImageLabel(virConnectPtr conn,
|
||||
char *newpath = NULL;
|
||||
const char *path = disk->src;
|
||||
|
||||
- if (disk->readonly || disk->shared)
|
||||
- return 0;
|
||||
-
|
||||
if ((err = virFileResolveLink(path, &newpath)) < 0) {
|
||||
virReportSystemError(conn, err,
|
||||
_("cannot resolve symlink %s"), path);
|
||||
@@ -328,8 +333,13 @@ SELinuxSetSecurityImageLabel(virConnectPtr conn,
|
||||
{
|
||||
const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
|
||||
|
||||
- if (secdef->imagelabel)
|
||||
+ if (disk->shared) {
|
||||
+ return SELinuxSetFilecon(conn, disk->src, default_image_context);
|
||||
+ } else if (disk->readonly) {
|
||||
+ return SELinuxSetFilecon(conn, disk->src, default_content_context);
|
||||
+ } else if (secdef->imagelabel) {
|
||||
return SELinuxSetFilecon(conn, disk->src, secdef->imagelabel);
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -403,9 +413,6 @@ SELinuxSetSecurityLabel(virConnectPtr conn,
|
||||
|
||||
if (secdef->imagelabel) {
|
||||
for (i = 0 ; i < vm->def->ndisks ; i++) {
|
||||
- if (vm->def->disks[i]->readonly ||
|
||||
- vm->def->disks[i]->shared) continue;
|
||||
-
|
||||
if (SELinuxSetSecurityImageLabel(conn, vm, vm->def->disks[i]) < 0)
|
||||
return -1;
|
||||
}
|
||||
--
|
||||
1.6.2.5
|
||||
|
||||
33
libvirt-0.6.4-svirt-sound.patch
Normal file
33
libvirt-0.6.4-svirt-sound.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
--- src/qemu_conf.c.orig 2009-05-29 19:24:59.000000000 +0200
|
||||
+++ src/qemu_conf.c 2009-05-29 19:19:39.000000000 +0200
|
||||
@@ -792,6 +792,20 @@ int qemudBuildCommandLine(virConnectPtr
|
||||
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);
|
||||
|
||||
@@ -1429,7 +1443,8 @@ int qemudBuildCommandLine(virConnectPtr
|
||||
}
|
||||
|
||||
/* Add sound hardware */
|
||||
- if (def->nsounds) {
|
||||
+ if (def->nsounds &&
|
||||
+ !skipSound) {
|
||||
int size = 100;
|
||||
char *modstr;
|
||||
if (VIR_ALLOC_N(modstr, size+1) < 0)
|
||||
924
libvirt.spec
924
libvirt.spec
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user