Compare commits
43 Commits
libvirt-0_
...
libvirt-0_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aeda455930 | ||
|
|
288291b795 | ||
|
|
7c2073faca | ||
|
|
5b528ba717 | ||
|
|
4f731a7250 | ||
|
|
f1ac0031f5 | ||
|
|
e45b9c9030 | ||
|
|
3cf75c269d | ||
|
|
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 |
@@ -8,3 +8,6 @@ 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,47 +0,0 @@
|
||||
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
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
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;
|
||||
@@ -1,35 +0,0 @@
|
||||
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
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
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
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
--- 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
|
||||
From 127a39777e9809053bb98a9082e27c73543ccfa2 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;
|
||||
@@ -10,7 +25,7 @@
|
||||
+ driver->securityDriver->name &&
|
||||
+ STREQ(driver->securityDriver->name, "selinux") &&
|
||||
+ getuid() == 0) {
|
||||
+ static int soundWarned = 0;
|
||||
+ static int soundWarned = 0;
|
||||
+ skipSound = 1;
|
||||
+ if (def->nsounds &&
|
||||
+ !soundWarned) {
|
||||
@@ -21,7 +36,7 @@
|
||||
|
||||
uname_normalize(&ut);
|
||||
|
||||
@@ -1429,7 +1443,8 @@ int qemudBuildCommandLine(virConnectPtr
|
||||
@@ -2181,7 +2195,8 @@ int qemudBuildCommandLine(virConnectPtr conn,
|
||||
}
|
||||
|
||||
/* Add sound hardware */
|
||||
@@ -31,3 +46,6 @@
|
||||
int size = 100;
|
||||
char *modstr;
|
||||
if (VIR_ALLOC_N(modstr, size+1) < 0)
|
||||
--
|
||||
1.6.2.5
|
||||
|
||||
|
||||
32
libvirt-fix-drv-supports-feature-bogus-error.patch
Normal file
32
libvirt-fix-drv-supports-feature-bogus-error.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
From 2f6e857ac7d6ed5cd417e684147dd9c98775ab3d Mon Sep 17 00:00:00 2001
|
||||
From: Chris Lalancette <clalance@redhat.com>
|
||||
Date: Mon, 21 Sep 2009 14:53:31 +0200
|
||||
Subject: [PATCH] Don't do virSetConnError when virDrvSupportsFeature is successful.
|
||||
|
||||
Signed-off-by: Chris Lalancette <clalance@redhat.com>
|
||||
Fedora-patch: libvirt-fix-drv-supports-feature-bogus-error.patch
|
||||
---
|
||||
src/libvirt.c | 7 +++++--
|
||||
1 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/libvirt.c b/src/libvirt.c
|
||||
index 4a11688..fa59dc7 100644
|
||||
--- a/src/libvirt.c
|
||||
+++ b/src/libvirt.c
|
||||
@@ -1349,8 +1349,11 @@ virDrvSupportsFeature (virConnectPtr conn, int feature)
|
||||
}
|
||||
|
||||
ret = VIR_DRV_SUPPORTS_FEATURE (conn->driver, conn, feature);
|
||||
- /* Copy to connection error object for back compatability */
|
||||
- virSetConnError(conn);
|
||||
+
|
||||
+ if (ret < 0)
|
||||
+ /* Copy to connection error object for back compatability */
|
||||
+ virSetConnError(conn);
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
|
||||
--
|
||||
1.6.2.5
|
||||
|
||||
46
libvirt-fix-net-hotunplug-double-free.patch
Normal file
46
libvirt-fix-net-hotunplug-double-free.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
From d09ff3c35c29d14760d5ea03559042cc024e09ab Mon Sep 17 00:00:00 2001
|
||||
From: Mark McLoughlin <markmc@redhat.com>
|
||||
Date: Thu, 17 Sep 2009 15:31:08 +0100
|
||||
Subject: [PATCH] Fix net/disk hot-unplug segfault
|
||||
|
||||
When we hot-unplug the last device, we're currently double-freeing
|
||||
the device definition.
|
||||
|
||||
Reported by Michal Nowak here:
|
||||
|
||||
https://bugzilla.redhat.com/523953
|
||||
|
||||
* src/qemu_driver.c: fix double free
|
||||
|
||||
(cherry-picked from commit 8881ae1bf8783006777429403cc543c33187175d)
|
||||
|
||||
Fedora-patch: libvirt-fix-net-hotunplug-double-free.patch
|
||||
---
|
||||
src/qemu_driver.c | 4 ++--
|
||||
1 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
|
||||
index a65334f..de31581 100644
|
||||
--- a/src/qemu_driver.c
|
||||
+++ b/src/qemu_driver.c
|
||||
@@ -5998,7 +5998,7 @@ try_command:
|
||||
/* ignore, harmless */
|
||||
}
|
||||
} else {
|
||||
- VIR_FREE(vm->def->disks[0]);
|
||||
+ VIR_FREE(vm->def->disks);
|
||||
vm->def->ndisks = 0;
|
||||
}
|
||||
virDomainDiskDefFree(detach);
|
||||
@@ -6100,7 +6100,7 @@ qemudDomainDetachNetDevice(virConnectPtr conn,
|
||||
/* ignore, harmless */
|
||||
}
|
||||
} else {
|
||||
- VIR_FREE(vm->def->nets[0]);
|
||||
+ VIR_FREE(vm->def->nets);
|
||||
vm->def->nnets = 0;
|
||||
}
|
||||
virDomainNetDefFree(detach);
|
||||
--
|
||||
1.6.2.5
|
||||
|
||||
50
libvirt-fix-pci-hostdev-hotunplug-leak.patch
Normal file
50
libvirt-fix-pci-hostdev-hotunplug-leak.patch
Normal file
@@ -0,0 +1,50 @@
|
||||
From d04ac8624f5fabe7587982796f2e2161220b0fcc Mon Sep 17 00:00:00 2001
|
||||
From: Mark McLoughlin <markmc@redhat.com>
|
||||
Date: Thu, 17 Sep 2009 15:32:45 +0100
|
||||
Subject: [PATCH] Fix leak in PCI hostdev hot-unplug
|
||||
|
||||
* src/qemu_driver.c: sync the hostdev hot-unplug code with the disk/net
|
||||
code.
|
||||
|
||||
(cherry-picked from commit a70da51ff76ed860bfc0cdee2e1d556da997c557)
|
||||
|
||||
Fedora-patch: libvirt-fix-pci-hostdev-hotunplug-leak.patch
|
||||
---
|
||||
src/qemu_driver.c | 20 +++++++++++++-------
|
||||
1 files changed, 13 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
|
||||
index de31581..2ddcdc0 100644
|
||||
--- a/src/qemu_driver.c
|
||||
+++ b/src/qemu_driver.c
|
||||
@@ -6206,14 +6206,20 @@ static int qemudDomainDetachHostPciDevice(virConnectPtr conn,
|
||||
pciFreeDevice(conn, pci);
|
||||
}
|
||||
|
||||
- if (i != --vm->def->nhostdevs)
|
||||
- memmove(&vm->def->hostdevs[i],
|
||||
- &vm->def->hostdevs[i+1],
|
||||
- sizeof(*vm->def->hostdevs) * (vm->def->nhostdevs-i));
|
||||
- if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs) < 0) {
|
||||
- virReportOOMError(conn);
|
||||
- ret = -1;
|
||||
+ if (vm->def->nhostdevs > 1) {
|
||||
+ memmove(vm->def->hostdevs + i,
|
||||
+ vm->def->hostdevs + i + 1,
|
||||
+ sizeof(*vm->def->hostdevs) *
|
||||
+ (vm->def->nhostdevs - (i + 1)));
|
||||
+ vm->def->nhostdevs--;
|
||||
+ if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs) < 0) {
|
||||
+ /* ignore, harmless */
|
||||
+ }
|
||||
+ } else {
|
||||
+ VIR_FREE(vm->def->hostdevs);
|
||||
+ vm->def->nhostdevs = 0;
|
||||
}
|
||||
+ virDomainHostdevDefFree(detach);
|
||||
|
||||
return ret;
|
||||
}
|
||||
--
|
||||
1.6.2.5
|
||||
|
||||
53
libvirt-fix-qemu-raw-format-save.patch
Normal file
53
libvirt-fix-qemu-raw-format-save.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
From e50c91fdcea5d81e3eb2051c05f4e51a16c3e692 Mon Sep 17 00:00:00 2001
|
||||
From: Charles Duffy <Charles_Duffy@dell.com>
|
||||
Date: Fri, 18 Sep 2009 11:32:35 -0500
|
||||
Subject: [PATCH] Prevent attempt to call cat -c during virDomainSave to raw
|
||||
|
||||
Fedora-patch: libvirt-fix-qemu-raw-format-save.patch
|
||||
---
|
||||
src/qemu_driver.c | 28 ++++++++++++++++++----------
|
||||
1 files changed, 18 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
|
||||
index 2ddcdc0..7c7b985 100644
|
||||
--- a/src/qemu_driver.c
|
||||
+++ b/src/qemu_driver.c
|
||||
@@ -3905,17 +3905,25 @@ static int qemudDomainSave(virDomainPtr dom,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
- const char *prog = qemudSaveCompressionTypeToString(header.compressed);
|
||||
- if (prog == NULL) {
|
||||
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||
- _("Invalid compress format %d"), header.compressed);
|
||||
- goto cleanup;
|
||||
- }
|
||||
+ {
|
||||
+ const char *prog = qemudSaveCompressionTypeToString(header.compressed);
|
||||
+ const char *args;
|
||||
|
||||
- if (STREQ (prog, "raw"))
|
||||
- prog = "cat";
|
||||
- internalret = virAsprintf(&command, "migrate \"exec:"
|
||||
- "%s -c >> '%s' 2>/dev/null\"", prog, safe_path);
|
||||
+ if (prog == NULL) {
|
||||
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||
+ _("Invalid compress format %d"), header.compressed);
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+
|
||||
+ if (STREQ (prog, "raw")) {
|
||||
+ prog = "cat";
|
||||
+ args = "";
|
||||
+ } else {
|
||||
+ args = "-c";
|
||||
+ }
|
||||
+ internalret = virAsprintf(&command, "migrate \"exec:"
|
||||
+ "%s %s >> '%s' 2>/dev/null\"", prog, args, safe_path);
|
||||
+ }
|
||||
|
||||
if (internalret < 0) {
|
||||
virReportOOMError(dom->conn);
|
||||
--
|
||||
1.6.2.5
|
||||
|
||||
41
libvirt-fix-usb-device-passthrough.patch
Normal file
41
libvirt-fix-usb-device-passthrough.patch
Normal file
@@ -0,0 +1,41 @@
|
||||
From 16f20706f8d2f113bb6a49f56e415c16d438183e Mon Sep 17 00:00:00 2001
|
||||
From: Mark McLoughlin <markmc@redhat.com>
|
||||
Date: Wed, 30 Sep 2009 18:37:03 +0100
|
||||
Subject: [PATCH] Fix USB device re-labelling
|
||||
|
||||
A simple misplaced break out of a switch results in:
|
||||
|
||||
libvir: error : Failed to open file '/sys/bus/pci/devices/0000:00:54c./vendor': No such file or directory
|
||||
libvir: error : Failed to open file '/sys/bus/pci/devices/0000:00:54c./device': No such file or directory
|
||||
libvir: error : this function is not supported by the hypervisor: Failed to read product/vendor ID for 0000:00:54c.
|
||||
|
||||
when trying to passthrough a USB host device to qemu.
|
||||
|
||||
* src/security_selinux.c: fix a switch/break thinko
|
||||
|
||||
Fedora-patch: libvirt-fix-usb-device-passthrough.patch
|
||||
---
|
||||
src/security_selinux.c | 3 +--
|
||||
1 files changed, 1 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/security_selinux.c b/src/security_selinux.c
|
||||
index bc295b1..b4dc153 100644
|
||||
--- a/src/security_selinux.c
|
||||
+++ b/src/security_selinux.c
|
||||
@@ -464,12 +464,11 @@ SELinuxSetSecurityHostdevLabel(virConnectPtr conn,
|
||||
|
||||
ret = usbDeviceFileIterate(conn, usb, SELinuxSetSecurityUSBLabel, vm);
|
||||
usbFreeDevice(conn, usb);
|
||||
-
|
||||
- break;
|
||||
} else {
|
||||
/* XXX deal with product/vendor better */
|
||||
ret = 0;
|
||||
}
|
||||
+ break;
|
||||
}
|
||||
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: {
|
||||
--
|
||||
1.6.4.4
|
||||
|
||||
795
libvirt.spec
795
libvirt.spec
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user