Fix crash with invalid QEmu URI (bz 566070)

Fix VNC TLS crash (bz 544305)
Fix USB devices with high bus/addr values (bz 542639)
Fix save/restore with non-root guests (bz 534143, bz 532654)
Fix USB devices attached via virt-manager (bz 537227)
This commit is contained in:
Cole Robinson 2010-05-18 16:42:36 +00:00
parent 29768222f1
commit 4f371cb8c3
6 changed files with 1523 additions and 1 deletions

View File

@ -0,0 +1,267 @@
commit bc0010b3d149df00406b82c37eb59874d8525af4
Author: Daniel P. Berrange <berrange@redhat.com>
Date: Wed Nov 11 12:07:00 2009 +0000
Fix save and restore with non-privileged guests and SELinux
When running qemu:///system instance, libvirtd runs as root,
but QEMU may optionally be configured to run non-root. When
then saving a guest to a state file, the file is initially
created as root, and thus QEMU cannot write to it. It is also
missing labelling required to allow access via SELinux.
* src/qemu_driver.c: Set ownership on save image before
running migrate command in virDomainSave impl. Call out to
security driver to set save image labelling
* src/security.h: Add driver APIs for setting
and restoring saved state file labelling
* src/security_selinux.c: Implement saved state file
labelling for SELinux
diff --git a/src/security.h b/src/security.h
index fde2978..5514962 100644
--- a/src/security.h
+++ b/src/security.h
@@ -42,6 +42,11 @@ typedef int (*virSecurityDomainRestoreHostdevLabel) (virConnectPtr conn,
typedef int (*virSecurityDomainSetHostdevLabel) (virConnectPtr conn,
virDomainObjPtr vm,
virDomainHostdevDefPtr dev);
+typedef int (*virSecurityDomainSetSavedStateLabel) (virConnectPtr conn,
+ virDomainObjPtr vm,
+ const char *savefile);
+typedef int (*virSecurityDomainRestoreSavedStateLabel) (virConnectPtr conn,
+ const char *savefile);
typedef int (*virSecurityDomainGenLabel) (virConnectPtr conn,
virDomainObjPtr sec);
typedef int (*virSecurityDomainReserveLabel) (virConnectPtr conn,
@@ -71,6 +76,8 @@ struct _virSecurityDriver {
virSecurityDomainRestoreLabel domainRestoreSecurityLabel;
virSecurityDomainRestoreHostdevLabel domainRestoreSecurityHostdevLabel;
virSecurityDomainSetHostdevLabel domainSetSecurityHostdevLabel;
+ virSecurityDomainSetSavedStateLabel domainSetSavedStateLabel;
+ virSecurityDomainRestoreSavedStateLabel domainRestoreSavedStateLabel;
/*
* This is internally managed driver state and should only be accessed
diff --git a/src/security_selinux.c b/src/security_selinux.c
index 0e31077..bd838e6 100644
--- a/src/security_selinux.c
+++ b/src/security_selinux.c
@@ -523,6 +523,7 @@ done:
return ret;
}
+
static int
SELinuxRestoreSecurityPCILabel(virConnectPtr conn,
pciDevice *dev ATTRIBUTE_UNUSED,
@@ -623,6 +624,26 @@ SELinuxRestoreSecurityLabel(virConnectPtr conn,
return rc;
}
+
+static int
+SELinuxSetSavedStateLabel(virConnectPtr conn,
+ virDomainObjPtr vm,
+ const char *savefile)
+{
+ const virSecurityLabelDefPtr secdef = &vm->def->seclabel;
+
+ return SELinuxSetFilecon(conn, savefile, secdef->imagelabel);
+}
+
+
+static int
+SELinuxRestoreSavedStateLabel(virConnectPtr conn,
+ const char *savefile)
+{
+ return SELinuxRestoreSecurityFileLabel(conn, savefile);
+}
+
+
static int
SELinuxSecurityVerify(virConnectPtr conn, virDomainDefPtr def)
{
@@ -692,4 +713,6 @@ virSecurityDriver virSELinuxSecurityDriver = {
.domainSetSecurityLabel = SELinuxSetSecurityLabel,
.domainSetSecurityHostdevLabel = SELinuxSetSecurityHostdevLabel,
.domainRestoreSecurityHostdevLabel = SELinuxRestoreSecurityHostdevLabel,
+ .domainSetSavedStateLabel = SELinuxSetSavedStateLabel,
+ .domainRestoreSavedStateLabel = SELinuxRestoreSavedStateLabel,
};
diff -rup libvirt-0.7.1/src/qemu_driver.c new/src/qemu_driver.c
--- libvirt-0.7.1/src/qemu_driver.c 2010-05-17 16:28:38.243890000 -0400
+++ new/src/qemu_driver.c 2010-05-17 16:36:28.035091000 -0400
@@ -3907,6 +3907,20 @@ static int qemudDomainSave(virDomainPtr
}
fd = -1;
+ if (driver->privileged &&
+ chown(path, driver->user, driver->group) < 0) {
+ virReportSystemError(NULL, errno,
+ _("unable to set ownership of '%s' to user %d:%d"),
+ path, driver->user, driver->group);
+ goto cleanup;
+ }
+
+ if (driver->securityDriver &&
+ driver->securityDriver->domainSetSavedStateLabel &&
+ driver->securityDriver->domainSetSavedStateLabel(dom->conn, vm, path) == -1)
+ goto cleanup;
+
+
/* Migrate to file */
safe_path = qemudEscapeShellArg(path);
if (!safe_path) {
@@ -3956,6 +3970,20 @@ static int qemudDomainSave(virDomainPtr
goto cleanup;
}
+ if (driver->privileged &&
+ chown(path, 0, 0) < 0) {
+ virReportSystemError(NULL, errno,
+ _("unable to set ownership of '%s' to user %d:%d"),
+ path, 0, 0);
+ goto cleanup;
+ }
+
+ if (driver->securityDriver &&
+ driver->securityDriver->domainRestoreSavedStateLabel &&
+ driver->securityDriver->domainRestoreSavedStateLabel(dom->conn, path) == -1)
+ VIR_WARN("failed to restore save state label on %s", path);
+
+
/* Shut it down */
qemudShutdownVMDaemon(dom->conn, driver, vm);
event = virDomainEventNewFromObj(vm,
diff -rup libvirt-0.7.1/src/qemu_driver.c new/src/qemu_driver.c
--- libvirt-0.7.1/src/qemu_driver.c 2010-05-17 17:55:34.000000000 -0400
+++ new/src/qemu_driver.c 2010-05-18 11:45:29.903145000 -0400
@@ -4028,7 +4028,7 @@ static int qemudDomainSave(virDomainPtr
if (driver->securityDriver &&
driver->securityDriver->domainRestoreSavedStateLabel &&
- driver->securityDriver->domainRestoreSavedStateLabel(dom->conn, path) == -1)
+ driver->securityDriver->domainRestoreSavedStateLabel(dom->conn, vm, path) == -1)
VIR_WARN("failed to restore save state label on %s", path);
@@ -4616,6 +4616,11 @@ static int qemudDomainRestore(virConnect
}
def = NULL;
+ if (driver->securityDriver &&
+ driver->securityDriver->domainSetSavedStateLabelRO &&
+ driver->securityDriver->domainSetSavedStateLabelRO(conn, vm, path) == -1)
+ goto cleanup;
+
if (header.version == 2) {
const char *intermediate_argv[3] = { NULL, "-dc", NULL };
const char *prog = qemudSaveCompressionTypeToString(header.compressed);
@@ -4651,11 +4656,6 @@ static int qemudDomainRestore(virConnect
close(fd);
fd = -1;
if (ret < 0) {
- if (!vm->persistent) {
- virDomainRemoveInactive(&driver->domains,
- vm);
- vm = NULL;
- }
goto cleanup;
}
@@ -4677,6 +4677,19 @@ static int qemudDomainRestore(virConnect
ret = 0;
cleanup:
+ if (ret < 0) {
+ if (!vm->persistent) {
+ virDomainRemoveInactive(&driver->domains,
+ vm);
+ vm = NULL;
+ }
+ }
+
+ if (driver->securityDriver &&
+ driver->securityDriver->domainRestoreSavedStateLabel &&
+ driver->securityDriver->domainRestoreSavedStateLabel(conn, vm, path) == -1)
+ VIR_WARN("Unable to restore labelling on %s", path);
+
virDomainDefFree(def);
VIR_FREE(xml);
if (fd != -1)
diff -rup libvirt-0.7.1/src/security.h new/src/security.h
--- libvirt-0.7.1/src/security.h 2010-05-17 17:55:34.000000000 -0400
+++ new/src/security.h 2010-05-18 11:41:27.703746000 -0400
@@ -44,7 +44,11 @@ typedef int (*virSecurityDomainSetHostde
typedef int (*virSecurityDomainSetSavedStateLabel) (virConnectPtr conn,
virDomainObjPtr vm,
const char *savefile);
+typedef int (*virSecurityDomainSetSavedStateLabelRO) (virConnectPtr conn,
+ virDomainObjPtr vm,
+ const char *savefile);
typedef int (*virSecurityDomainRestoreSavedStateLabel) (virConnectPtr conn,
+ virDomainObjPtr vm,
const char *savefile);
typedef int (*virSecurityDomainGenLabel) (virConnectPtr conn,
virDomainObjPtr sec);
@@ -76,6 +80,7 @@ struct _virSecurityDriver {
virSecurityDomainRestoreHostdevLabel domainRestoreSecurityHostdevLabel;
virSecurityDomainSetHostdevLabel domainSetSecurityHostdevLabel;
virSecurityDomainSetSavedStateLabel domainSetSavedStateLabel;
+ virSecurityDomainSetSavedStateLabelRO domainSetSavedStateLabelRO;
virSecurityDomainRestoreSavedStateLabel domainRestoreSavedStateLabel;
/*
diff -rup libvirt-0.7.1/src/security_selinux.c new/src/security_selinux.c
--- libvirt-0.7.1/src/security_selinux.c 2010-05-17 17:55:34.000000000 -0400
+++ new/src/security_selinux.c 2010-05-18 11:49:24.542106000 -0400
@@ -364,12 +364,20 @@ SELinuxRestoreSecurityFileLabel(virConne
goto err;
}
- if (stat(newpath, &buf) != 0)
+ if (stat(newpath, &buf) != 0) {
+ virReportSystemError(conn, err,
+ _("cannot stat %s"), newpath);
goto err;
+ }
- if (matchpathcon(newpath, buf.st_mode, &fcon) == 0) {
- rc = SELinuxSetFilecon(conn, newpath, fcon);
+ if (matchpathcon(newpath, buf.st_mode, &fcon) != 0) {
+ virReportSystemError(conn, err,
+ _("failed to determine default context for %s"), newpath);
+ goto err;
}
+
+ rc = SELinuxSetFilecon(conn, newpath, fcon);
+
err:
VIR_FREE(fcon);
VIR_FREE(newpath);
@@ -632,7 +640,17 @@ SELinuxSetSavedStateLabel(virConnectPtr
static int
+SELinuxSetSavedStateLabelRO(virConnectPtr conn,
+ virDomainObjPtr vm ATTRIBUTE_UNUSED,
+ const char *savefile)
+{
+ return SELinuxSetFilecon(conn, savefile, default_content_context);
+}
+
+
+static int
SELinuxRestoreSavedStateLabel(virConnectPtr conn,
+ virDomainObjPtr vm ATTRIBUTE_UNUSED,
const char *savefile)
{
return SELinuxRestoreSecurityFileLabel(conn, savefile);
@@ -709,5 +727,6 @@ virSecurityDriver virSELinuxSecurityDriv
.domainSetSecurityHostdevLabel = SELinuxSetSecurityHostdevLabel,
.domainRestoreSecurityHostdevLabel = SELinuxRestoreSecurityHostdevLabel,
.domainSetSavedStateLabel = SELinuxSetSavedStateLabel,
+ .domainSetSavedStateLabelRO = SELinuxSetSavedStateLabelRO,
.domainRestoreSavedStateLabel = SELinuxRestoreSavedStateLabel,
};

View File

@ -0,0 +1,22 @@
commit 823a684f8d0495bd5e7b413e1a81fd5a600abef7
Author: Daniel P. Berrange <berrange@redhat.com>
Date: Thu Feb 11 14:39:13 2010 +0000
Fix USB device path formatting mixup
* src/util/hostusb.c: The device path for a USB device wants the
bus/device IDs in decimal not octal
diff --git a/src/util/hostusb.c b/src/util/hostusb.c
index 3cce66b..bf96539 100644
--- a/src/hostusb.c
+++ b/src/hostusb.c
@@ -184,7 +184,7 @@ usbGetDevice(unsigned bus,
snprintf(dev->name, sizeof(dev->name), "%.3o:%.3o",
dev->bus, dev->dev);
snprintf(dev->path, sizeof(dev->path),
- USB_DEVFS "%03o/%03o", dev->bus, dev->dev);
+ USB_DEVFS "%03d/%03d", dev->bus, dev->dev);
/* XXX fixme. this should be product/vendor */
snprintf(dev->id, sizeof(dev->id), "%d %d", dev->bus, dev->dev);

View File

@ -0,0 +1,496 @@
diff -rup libvirt-0.7.1/src/hostusb.c new/src/hostusb.c
--- libvirt-0.7.1/src/hostusb.c 2010-05-17 16:53:48.740748000 -0400
+++ new/src/hostusb.c 2010-05-17 16:57:19.294731000 -0400
@@ -37,9 +37,10 @@
#include "util.h"
#include "virterror_internal.h"
+#define USB_SYSFS "/sys/bus/usb"
#define USB_DEVFS "/dev/bus/usb/"
-#define USB_ID_LEN 10 /* "XXXX XXXX" */
-#define USB_ADDR_LEN 8 /* "XXX:XXX" */
+#define USB_ID_LEN 10 /* "1234 5678" */
+#define USB_ADDR_LEN 8 /* "123:456" */
struct _usbDevice {
unsigned bus;
@@ -57,6 +58,101 @@ struct _usbDevice {
virReportErrorHelper(conn, VIR_FROM_NONE, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
+static int usbSysReadFile(virConnectPtr conn,
+ const char *f_name, const char *d_name,
+ int base, unsigned *value)
+{
+ int ret = -1, tmp;
+ char *buf = NULL;
+ char *filename = NULL;
+ char *ignore = NULL;
+
+ tmp = virAsprintf(&filename, USB_SYSFS "/devices/%s/%s", d_name, f_name);
+ if (tmp < 0) {
+ virReportOOMError(conn);
+ goto error;
+ }
+
+ if (virFileReadAll(filename, 1024, &buf) < 0)
+ goto error;
+
+ if (virStrToLong_ui(buf, &ignore, base, value) < 0) {
+ usbReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Could not parse usb file %s"), filename);
+ goto error;
+ }
+
+ ret = 0;
+error:
+ VIR_FREE(filename);
+ VIR_FREE(buf);
+ return ret;
+}
+
+static int usbFindBusByVendor(virConnectPtr conn,
+ unsigned vendor, unsigned product,
+ unsigned *bus, unsigned *devno)
+{
+ DIR *dir = NULL;
+ int ret = -1, found = 0;
+ char *ignore = NULL;
+ struct dirent *de;
+
+ dir = opendir(USB_SYSFS "/devices");
+ if (!dir) {
+ virReportSystemError(conn, errno,
+ _("Could not open directory %s"),
+ USB_SYSFS "/devices");
+ goto error;
+ }
+
+ while ((de = readdir(dir))) {
+ unsigned found_prod, found_vend;
+ if (de->d_name[0] == '.' || strchr(de->d_name, ':'))
+ continue;
+
+ if (usbSysReadFile(conn, "idVendor", de->d_name,
+ 16, &found_vend) < 0)
+ goto error;
+ if (usbSysReadFile(conn, "idProduct", de->d_name,
+ 16, &found_prod) < 0)
+ goto error;
+
+ if (found_prod == product && found_vend == vendor) {
+ /* Lookup bus.addr info */
+ char *tmpstr = de->d_name;
+ unsigned found_bus, found_addr;
+
+ if (STREQ(de->d_name, "usb"))
+ tmpstr += 3;
+
+ if (virStrToLong_ui(tmpstr, &ignore, 10, &found_bus) < 0) {
+ usbReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Failed to parse dir name '%s'"),
+ de->d_name);
+ goto error;
+ }
+
+ if (usbSysReadFile(conn, "devnum", de->d_name,
+ 10, &found_addr) < 0)
+ goto error;
+
+ *bus = found_bus;
+ *devno = found_addr;
+ found = 1;
+ break;
+ }
+ }
+
+ if (!found)
+ usbReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("Did not find USB device %x:%x"), vendor, product);
+ else
+ ret = 0;
+
+error:
+ return ret;
+}
usbDevice *
usbGetDevice(virConnectPtr conn,
@@ -86,6 +182,21 @@ usbGetDevice(virConnectPtr conn,
return dev;
}
+
+usbDevice *
+usbFindDevice(unsigned vendor,
+ unsigned product)
+{
+ unsigned bus = 0, devno = 0;
+
+ if (usbFindBusByVendor(vendor, product, &bus, &devno) < 0) {
+ return NULL;
+ }
+
+ return usbGetDevice(bus, devno);
+}
+
+
void
usbFreeDevice(virConnectPtr conn ATTRIBUTE_UNUSED, usbDevice *dev)
{
@@ -93,6 +204,18 @@ usbFreeDevice(virConnectPtr conn ATTRIBU
VIR_FREE(dev);
}
+unsigned usbDeviceGetBus(usbDevice *dev)
+{
+ return dev->bus;
+}
+
+
+unsigned usbDeviceGetDevno(usbDevice *dev)
+{
+ return dev->dev;
+}
+
+
int usbDeviceFileIterate(virConnectPtr conn,
usbDevice *dev,
diff -rup libvirt-0.7.1/src/hostusb.h new/src/hostusb.h
--- libvirt-0.7.1/src/hostusb.h 2009-09-10 09:45:00.000000000 -0400
+++ new/src/hostusb.h 2010-05-17 16:58:06.553924000 -0400
@@ -27,11 +27,16 @@
typedef struct _usbDevice usbDevice;
-usbDevice *usbGetDevice (virConnectPtr conn,
- unsigned bus,
- unsigned devno);
-void usbFreeDevice (virConnectPtr conn,
- usbDevice *dev);
+usbDevice *usbGetDevice(virConnectPtr conn,
+ unsigned bus,
+ unsigned devno);
+usbDevice *usbFindDevice(virConnectPtr conn,
+ unsigned vendor,
+ unsigned product);
+void usbFreeDevice (virConnectPtr conn, usbDevice *dev);
+
+unsigned usbDeviceGetBus(usbDevice *dev);
+unsigned usbDeviceGetDevno(usbDevice *dev);
/*
* Callback that will be invoked once for each file
diff -rup libvirt-0.7.1/src/libvirt_private.syms new/src/libvirt_private.syms
--- libvirt-0.7.1/src/libvirt_private.syms 2010-05-17 16:53:48.401831000 -0400
+++ new/src/libvirt_private.syms 2010-05-17 16:55:03.001748000 -0400
@@ -441,7 +441,10 @@ virFileMatchesNameSuffix;
# usb.h
usbGetDevice;
+usbFindDevice;
usbFreeDevice;
+usbDeviceGetBus;
+usbDeviceGetDevno;
usbDeviceFileIterate;
# uuid.h
diff -rup libvirt-0.7.1/src/qemu_driver.c new/src/qemu_driver.c
--- libvirt-0.7.1/src/qemu_driver.c 2010-05-17 16:53:48.785743000 -0400
+++ new/src/qemu_driver.c 2010-05-17 17:06:40.575145000 -0400
@@ -1493,16 +1493,13 @@ qemuUpdateActivePciHostdevs(struct qemud
}
static int
-qemuPrepareHostDevices(virConnectPtr conn,
- struct qemud_driver *driver,
- virDomainDefPtr def)
+qemuPrepareHostPCIDevices(virConnectPtr conn,
+ struct qemud_driver *driver,
+ virDomainDefPtr def)
{
pciDeviceList *pcidevs;
int i;
- if (!def->nhostdevs)
- return 0;
-
if (!(pcidevs = qemuGetPciHostDeviceList(conn, def)))
return -1;
@@ -1792,14 +1789,11 @@ static int qemuDomainSetHostdevUSBOwners
struct qemuFileOwner owner = { uid, gid };
int ret = -1;
- /* XXX what todo for USB devs assigned based on product/vendor ? Doom :-( */
- if (!def->source.subsys.u.usb.bus ||
- !def->source.subsys.u.usb.device)
- return 0;
-
usbDevice *dev = usbGetDevice(conn,
def->source.subsys.u.usb.bus,
- def->source.subsys.u.usb.device);
+ def->source.subsys.u.usb.device,
+ def->source.subsys.u.usb.vendor,
+ def->source.subsys.u.usb.product);
if (!dev)
goto cleanup;
@@ -2065,13 +2059,17 @@ static int qemudStartVMDaemon(virConnect
return -1;
}
+ DEBUG0("Preparing host devices");
+ if (qemuPrepareHostDevices(conn, driver, vm->def) < 0)
+ goto cleanup;
+
/* If you are using a SecurityDriver with dynamic labelling,
then generate a security label for isolation */
if (vm->def->seclabel.type == VIR_DOMAIN_SECLABEL_DYNAMIC &&
driver->securityDriver &&
driver->securityDriver->domainGenSecurityLabel &&
driver->securityDriver->domainGenSecurityLabel(conn, vm) < 0)
- return -1;
+ return cleanup;
/* Ensure no historical cgroup for this VM is lieing around bogus settings */
qemuRemoveCgroup(conn, driver, vm);
@@ -2119,9 +2117,6 @@ static int qemudStartVMDaemon(virConnect
if (qemuSetupCgroup(conn, driver, vm) < 0)
goto cleanup;
- if (qemuPrepareHostDevices(conn, driver, vm->def) < 0)
- goto cleanup;
-
if (VIR_ALLOC(vm->monitor_chr) < 0) {
virReportOOMError(conn);
goto cleanup;
@@ -2348,6 +2343,56 @@ retry:
}
+
+static int
+qemuPrepareHostUSBDevices(struct qemud_driver *driver ATTRIBUTE_UNUSED,
+ virDomainDefPtr def)
+{
+ int i;
+ for (i = 0 ; i < def->nhostdevs ; i++) {
+ virDomainHostdevDefPtr hostdev = def->hostdevs[i];
+
+ if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
+ continue;
+ if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB)
+ continue;
+
+ /* Resolve a vendor/product to bus/device */
+ if (hostdev->source.subsys.u.usb.vendor) {
+ usbDevice *usb
+ = usbFindDevice(hostdev->source.subsys.u.usb.vendor,
+ hostdev->source.subsys.u.usb.product);
+
+ if (!usb)
+ return -1;
+
+ hostdev->source.subsys.u.usb.bus = usbDeviceGetBus(usb);
+ hostdev->source.subsys.u.usb.device = usbDeviceGetDevno(usb);
+
+ usbFreeDevice(usb);
+ }
+ }
+
+ return 0;
+}
+
+static int
+qemuPrepareHostDevices(struct qemud_driver *driver,
+ virDomainDefPtr def)
+{
+ if (!def->nhostdevs)
+ return 0;
+
+ if (qemuPrepareHostPCIDevices(driver, def) < 0)
+ return -1;
+
+ if (qemuPrepareHostUSBDevices(driver, def) < 0)
+ return -1;
+
+ return 0;
+}
+
+
static void
qemudDispatchVMEvent(int watch, int fd, int events, void *opaque) {
struct qemud_driver *driver = opaque;
@@ -6294,6 +6339,23 @@ static int qemudDomainDetachHostDevice(v
return -1;
}
+ /* Resolve USB product/vendor to bus/device */
+ if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB &&
+ hostdev->source.subsys.u.usb.vendor) {
+ usbDevice *usb
+ = usbFindDevice(hostdev->source.subsys.u.usb.vendor,
+ hostdev->source.subsys.u.usb.product);
+
+ if (!usb)
+ return -1;
+
+ hostdev->source.subsys.u.usb.bus = usbDeviceGetBus(usb);
+ hostdev->source.subsys.u.usb.device = usbDeviceGetDevno(usb);
+
+ usbFreeDevice(usb);
+ }
+
+
if (driver->securityDriver &&
driver->securityDriver->domainSetSecurityHostdevLabel(conn, vm, dev->data.hostdev) < 0)
VIR_WARN0("Failed to restore device labelling");
diff -rup libvirt-0.7.1/src/security_selinux.c new/src/security_selinux.c
--- libvirt-0.7.1/src/security_selinux.c 2010-05-17 16:53:48.775745000 -0400
+++ new/src/security_selinux.c 2010-05-17 16:58:47.442604000 -0400
@@ -482,20 +482,15 @@ SELinuxSetSecurityHostdevLabel(virConnec
switch (dev->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: {
- if (dev->source.subsys.u.usb.bus && dev->source.subsys.u.usb.device) {
- usbDevice *usb = usbGetDevice(conn,
- dev->source.subsys.u.usb.bus,
- dev->source.subsys.u.usb.device);
-
- if (!usb)
- goto done;
-
- ret = usbDeviceFileIterate(conn, usb, SELinuxSetSecurityUSBLabel, vm);
- usbFreeDevice(conn, usb);
- } else {
- /* XXX deal with product/vendor better */
- ret = 0;
- }
+ usbDevice *usb = usbGetDevice(conn,
+ dev->source.subsys.u.usb.bus,
+ dev->source.subsys.u.usb.device);
+
+ if (!usb)
+ goto done;
+
+ ret = usbDeviceFileIterate(conn, usb, SELinuxSetSecurityUSBLabel, vm);
+ usbFreeDevice(conn, usb);
break;
}
diff -rup libvirt-0.7.1/src/hostusb.c new/src/hostusb.c
--- libvirt-0.7.1/src/hostusb.c 2010-05-17 17:09:02.573638000 -0400
+++ new/src/hostusb.c 2010-05-17 17:29:49.133509000 -0400
@@ -184,16 +184,17 @@ usbGetDevice(virConnectPtr conn,
usbDevice *
-usbFindDevice(unsigned vendor,
+usbFindDevice(virConnectPtr conn,
+ unsigned vendor,
unsigned product)
{
unsigned bus = 0, devno = 0;
- if (usbFindBusByVendor(vendor, product, &bus, &devno) < 0) {
+ if (usbFindBusByVendor(conn, vendor, product, &bus, &devno) < 0) {
return NULL;
}
- return usbGetDevice(bus, devno);
+ return usbGetDevice(conn, bus, devno);
}
diff -rup libvirt-0.7.1/src/qemu_driver.c new/src/qemu_driver.c
--- libvirt-0.7.1/src/qemu_driver.c 2010-05-17 17:09:02.602638000 -0400
+++ new/src/qemu_driver.c 2010-05-17 17:36:10.066214000 -0400
@@ -1791,9 +1791,7 @@ static int qemuDomainSetHostdevUSBOwners
usbDevice *dev = usbGetDevice(conn,
def->source.subsys.u.usb.bus,
- def->source.subsys.u.usb.device,
- def->source.subsys.u.usb.vendor,
- def->source.subsys.u.usb.product);
+ def->source.subsys.u.usb.device);
if (!dev)
goto cleanup;
@@ -2026,6 +2024,10 @@ qemuPrepareMonitorChr(virConnectPtr conn
return 0;
}
+static int
+qemuPrepareHostDevices(struct qemud_driver *driver,
+ virDomainDefPtr def);
+
static int qemudStartVMDaemon(virConnectPtr conn,
struct qemud_driver *driver,
virDomainObjPtr vm,
@@ -2060,7 +2062,7 @@ static int qemudStartVMDaemon(virConnect
}
DEBUG0("Preparing host devices");
- if (qemuPrepareHostDevices(conn, driver, vm->def) < 0)
+ if (qemuPrepareHostDevices(driver, vm->def) < 0)
goto cleanup;
/* If you are using a SecurityDriver with dynamic labelling,
@@ -2069,7 +2071,7 @@ static int qemudStartVMDaemon(virConnect
driver->securityDriver &&
driver->securityDriver->domainGenSecurityLabel &&
driver->securityDriver->domainGenSecurityLabel(conn, vm) < 0)
- return cleanup;
+ goto cleanup;
/* Ensure no historical cgroup for this VM is lieing around bogus settings */
qemuRemoveCgroup(conn, driver, vm);
@@ -2360,7 +2362,8 @@ qemuPrepareHostUSBDevices(struct qemud_d
/* Resolve a vendor/product to bus/device */
if (hostdev->source.subsys.u.usb.vendor) {
usbDevice *usb
- = usbFindDevice(hostdev->source.subsys.u.usb.vendor,
+ = usbFindDevice(NULL,
+ hostdev->source.subsys.u.usb.vendor,
hostdev->source.subsys.u.usb.product);
if (!usb)
@@ -2369,7 +2372,7 @@ qemuPrepareHostUSBDevices(struct qemud_d
hostdev->source.subsys.u.usb.bus = usbDeviceGetBus(usb);
hostdev->source.subsys.u.usb.device = usbDeviceGetDevno(usb);
- usbFreeDevice(usb);
+ usbFreeDevice(NULL, usb);
}
}
@@ -2383,7 +2386,7 @@ qemuPrepareHostDevices(struct qemud_driv
if (!def->nhostdevs)
return 0;
- if (qemuPrepareHostPCIDevices(driver, def) < 0)
+ if (qemuPrepareHostPCIDevices(NULL, driver, def) < 0)
return -1;
if (qemuPrepareHostUSBDevices(driver, def) < 0)
@@ -6343,7 +6346,8 @@ static int qemudDomainDetachHostDevice(v
if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB &&
hostdev->source.subsys.u.usb.vendor) {
usbDevice *usb
- = usbFindDevice(hostdev->source.subsys.u.usb.vendor,
+ = usbFindDevice(NULL,
+ hostdev->source.subsys.u.usb.vendor,
hostdev->source.subsys.u.usb.product);
if (!usb)
@@ -6352,7 +6356,7 @@ static int qemudDomainDetachHostDevice(v
hostdev->source.subsys.u.usb.bus = usbDeviceGetBus(usb);
hostdev->source.subsys.u.usb.device = usbDeviceGetDevno(usb);
- usbFreeDevice(usb);
+ usbFreeDevice(NULL, usb);
}

View File

@ -0,0 +1,686 @@
commit 33a198c1f6a4a1bc7f34d50a31032e03bec10fee
Author: Daniel P. Berrange <berrange@redhat.com>
Date: Fri Jul 17 20:20:08 2009 +0100
Initialize gcrypt threading
GNUTLS uses gcrypt for its crypto functions. gcrypt requires
that the app/library initializes threading before using it.
We don't want to force apps using libvirt to know about
gcrypt, so we make virInitialize init threading on their
behalf. This location also ensures libvirtd has initialized
it correctly. This initialization is required even if libvirt
itself were only using one thread, since another non-libvirt
library (eg GTK-VNC) could also be using gcrypt from another
thread
* src/libvirt.c: Register thread functions for gcrypt
* configure.in: Add -lgcrypt to linker flags
diff --git a/src/libvirt.c b/src/libvirt.c
index 103b331..cad33c2 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -22,6 +22,7 @@
#include <sys/wait.h>
#endif
#include <time.h>
+#include <gcrypt.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
@@ -251,6 +252,55 @@ winsock_init (void)
}
#endif
+static int virTLSMutexInit (void **priv)
+{ \
+ virMutexPtr lock = NULL;
+
+ if (VIR_ALLOC(lock) < 0)
+ return ENOMEM;
+
+ if (virMutexInit(lock) < 0) {
+ VIR_FREE(lock);
+ return errno;
+ }
+
+ *priv = lock;
+ return 0;
+}
+
+static int virTLSMutexDestroy(void **priv)
+{
+ virMutexPtr lock = *priv;
+ virMutexDestroy(lock);
+ VIR_FREE(lock);
+ return 0;
+}
+
+static int virTLSMutexLock(void **priv)
+{
+ virMutexPtr lock = *priv;
+ virMutexLock(lock);
+ return 0;
+}
+
+static int virTLSMutexUnlock(void **priv)
+{
+ virMutexPtr lock = *priv;
+ virMutexUnlock(lock);
+ return 0;
+}
+
+static struct gcry_thread_cbs virTLSThreadImpl = {
+ (GCRY_THREAD_OPTION_PTHREAD | (GCRY_THREAD_OPTION_VERSION << 8)),
+ NULL,
+ virTLSMutexInit,
+ virTLSMutexDestroy,
+ virTLSMutexLock,
+ virTLSMutexUnlock,
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+};
+
+
/**
* virInitialize:
*
@@ -273,6 +323,9 @@ virInitialize(void)
virRandomInitialize(time(NULL) ^ getpid()))
return -1;
+ gcry_control(GCRYCTL_SET_THREAD_CBS, &virTLSThreadImpl);
+ gcry_check_version(NULL);
+
virLogSetFromEnv();
DEBUG0("register drivers");
commit 1c5c63338c90f6e82731f6871901dc72732033ef
Author: Matthias Bolte <matthias.bolte@googlemail.com>
Date: Fri Dec 18 12:02:07 2009 +0100
Fix compilation with gcrypt < 1.4.2
Commit 33a198c1f6a4a1bc7f34d50a31032e03bec10fee increased the gcrypt
version requirement to 1.4.2 because the GCRY_THREAD_OPTION_VERSION
define was added in this version.
The configure script doesn't check for the gcrypt version. To support
gcrypt versions < 1.4.2 change the virTLSThreadImpl initialization
to use GCRY_THREAD_OPTION_VERSION only if it's defined.
diff --git a/src/libvirt.c b/src/libvirt.c
index 5167bc2..16c851f 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -291,7 +291,12 @@ static int virTLSMutexUnlock(void **priv)
}
static struct gcry_thread_cbs virTLSThreadImpl = {
+ /* GCRY_THREAD_OPTION_VERSION was added in gcrypt 1.4.2 */
+#ifdef GCRY_THREAD_OPTION_VERSION
(GCRY_THREAD_OPTION_PTHREAD | (GCRY_THREAD_OPTION_VERSION << 8)),
+#else
+ GCRY_THREAD_OPTION_PTHREAD,
+#endif
NULL,
virTLSMutexInit,
virTLSMutexDestroy,
diff -rup libvirt-0.7.1/aclocal.m4 gcrypt-new/aclocal.m4
--- libvirt-0.7.1/aclocal.m4 2009-09-15 08:35:04.000000000 -0400
+++ gcrypt-new/aclocal.m4 2010-05-17 17:52:13.765215000 -0400
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.11 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
@@ -190,7 +190,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.11'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11], [],
+m4_if([$1], [1.11.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -206,7 +206,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11])dnl
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
diff -rup libvirt-0.7.1/configure gcrypt-new/configure
--- libvirt-0.7.1/configure 2009-09-15 08:35:09.000000000 -0400
+++ gcrypt-new/configure 2010-05-17 17:52:18.706838000 -0400
@@ -43324,7 +43324,7 @@ fi
$as_echo "$as_me: error: You must install the GnuTLS library in order to compile and run libvirt" >&2;}
{ (exit 1); exit 1; }; }
- GNUTLS_LIBS=$LIBS
+ GNUTLS_LIBS="$LIBS -lgcrypt"
LIBS="$old_libs"
fi
diff -rup libvirt-0.7.1/docs/devhelp/Makefile.in gcrypt-new/docs/devhelp/Makefile.in
--- libvirt-0.7.1/docs/devhelp/Makefile.in 2009-09-15 08:35:13.000000000 -0400
+++ gcrypt-new/docs/devhelp/Makefile.in 2010-05-17 17:52:23.305455000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff -rup libvirt-0.7.1/docs/examples/Makefile.in gcrypt-new/docs/examples/Makefile.in
--- libvirt-0.7.1/docs/examples/Makefile.in 2009-09-15 08:35:14.000000000 -0400
+++ gcrypt-new/docs/examples/Makefile.in 2010-05-17 17:52:23.492454000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -999,7 +999,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -1024,7 +1024,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
diff -rup libvirt-0.7.1/docs/examples/python/Makefile.in gcrypt-new/docs/examples/python/Makefile.in
--- libvirt-0.7.1/docs/examples/python/Makefile.in 2009-09-15 08:35:14.000000000 -0400
+++ gcrypt-new/docs/examples/python/Makefile.in 2010-05-17 17:52:23.650454000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff -rup libvirt-0.7.1/docs/Makefile.in gcrypt-new/docs/Makefile.in
--- libvirt-0.7.1/docs/Makefile.in 2009-09-15 08:35:13.000000000 -0400
+++ gcrypt-new/docs/Makefile.in 2010-05-17 17:52:23.143456000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -966,7 +966,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -991,7 +991,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
diff -rup libvirt-0.7.1/docs/schemas/Makefile.in gcrypt-new/docs/schemas/Makefile.in
--- libvirt-0.7.1/docs/schemas/Makefile.in 2009-09-15 08:35:14.000000000 -0400
+++ gcrypt-new/docs/schemas/Makefile.in 2010-05-17 17:52:23.807456000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff -rup libvirt-0.7.1/examples/domain-events/events-c/Makefile.in gcrypt-new/examples/domain-events/events-c/Makefile.in
--- libvirt-0.7.1/examples/domain-events/events-c/Makefile.in 2009-09-15 08:35:14.000000000 -0400
+++ gcrypt-new/examples/domain-events/events-c/Makefile.in 2010-05-17 17:52:23.983380000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff -rup libvirt-0.7.1/examples/hellolibvirt/Makefile.in gcrypt-new/examples/hellolibvirt/Makefile.in
--- libvirt-0.7.1/examples/hellolibvirt/Makefile.in 2009-09-15 08:35:14.000000000 -0400
+++ gcrypt-new/examples/hellolibvirt/Makefile.in 2010-05-17 17:52:24.166378000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff -rup libvirt-0.7.1/gnulib/lib/Makefile.in gcrypt-new/gnulib/lib/Makefile.in
--- libvirt-0.7.1/gnulib/lib/Makefile.in 2009-09-15 08:35:14.000000000 -0400
+++ gcrypt-new/gnulib/lib/Makefile.in 2010-05-17 17:52:24.409381000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -1128,7 +1128,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -1153,7 +1153,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
diff -rup libvirt-0.7.1/gnulib/tests/Makefile.in gcrypt-new/gnulib/tests/Makefile.in
--- libvirt-0.7.1/gnulib/tests/Makefile.in 2009-09-15 08:35:15.000000000 -0400
+++ gcrypt-new/gnulib/tests/Makefile.in 2010-05-17 17:52:24.719382000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -1501,7 +1501,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -1526,7 +1526,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
diff -rup libvirt-0.7.1/include/libvirt/Makefile.in gcrypt-new/include/libvirt/Makefile.in
--- libvirt-0.7.1/include/libvirt/Makefile.in 2009-09-15 08:35:15.000000000 -0400
+++ gcrypt-new/include/libvirt/Makefile.in 2010-05-17 17:52:25.069302000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff -rup libvirt-0.7.1/include/Makefile.in gcrypt-new/include/Makefile.in
--- libvirt-0.7.1/include/Makefile.in 2009-09-15 08:35:15.000000000 -0400
+++ gcrypt-new/include/Makefile.in 2010-05-17 17:52:24.902313000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -896,7 +896,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -921,7 +921,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
diff -rup libvirt-0.7.1/Makefile.in gcrypt-new/Makefile.in
--- libvirt-0.7.1/Makefile.in 2009-09-15 08:35:18.000000000 -0400
+++ gcrypt-new/Makefile.in 2010-05-17 17:52:28.423082000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -1060,7 +1060,7 @@ uninstall-pkgconfigDATA:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -1085,7 +1085,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -1265,7 +1265,8 @@ distdir: $(DISTFILES)
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-test -n "$(am__skip_mode_fix)" \
- || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
@@ -1309,17 +1310,17 @@ dist dist-all: distdir
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
- bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
- unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
diff -rup libvirt-0.7.1/proxy/Makefile.in gcrypt-new/proxy/Makefile.in
--- libvirt-0.7.1/proxy/Makefile.in 2009-09-15 08:35:15.000000000 -0400
+++ gcrypt-new/proxy/Makefile.in 2010-05-17 17:52:25.334306000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff -rup libvirt-0.7.1/python/Makefile.in gcrypt-new/python/Makefile.in
--- libvirt-0.7.1/python/Makefile.in 2009-09-15 08:35:16.000000000 -0400
+++ gcrypt-new/python/Makefile.in 2010-05-17 17:52:25.538302000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -1090,7 +1090,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -1115,7 +1115,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
diff -rup libvirt-0.7.1/python/tests/Makefile.in gcrypt-new/python/tests/Makefile.in
--- libvirt-0.7.1/python/tests/Makefile.in 2009-09-15 08:35:16.000000000 -0400
+++ gcrypt-new/python/tests/Makefile.in 2010-05-17 17:52:25.702304000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff -rup libvirt-0.7.1/qemud/Makefile.in gcrypt-new/qemud/Makefile.in
--- libvirt-0.7.1/qemud/Makefile.in 2009-09-15 08:35:16.000000000 -0400
+++ gcrypt-new/qemud/Makefile.in 2010-05-17 17:52:25.997229000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -1522,7 +1522,7 @@ remote_protocol.c: remote_protocol.h
@WITH_LIBVIRTD_TRUE@ test -e $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml || \
@WITH_LIBVIRTD_TRUE@ ln -s ../default.xml \
@WITH_LIBVIRTD_TRUE@ $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
-@WITH_LIBVIRTD_TRUE@ mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu
+@WITH_LIBVIRTD_TRUE@ mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt
@WITH_LIBVIRTD_TRUE@ mkdir -p $(DESTDIR)$(localstatedir)/run/libvirt
@WITH_LIBVIRTD_TRUE@ mkdir -p $(DESTDIR)$(localstatedir)/lib/libvirt
@@ -1530,7 +1530,7 @@ remote_protocol.c: remote_protocol.h
@WITH_LIBVIRTD_TRUE@ rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
@WITH_LIBVIRTD_TRUE@ rm -f $(DESTDIR)$(sysconfdir)/$(default_xml_dest)
@WITH_LIBVIRTD_TRUE@ rmdir $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart || :
-@WITH_LIBVIRTD_TRUE@ rmdir $(DESTDIR)$(localstatedir)/log/libvirt/qemu || :
+@WITH_LIBVIRTD_TRUE@ rmdir $(DESTDIR)$(localstatedir)/log/libvirt || :
@WITH_LIBVIRTD_TRUE@ rmdir $(DESTDIR)$(localstatedir)/run/libvirt || :
@WITH_LIBVIRTD_TRUE@ rmdir $(DESTDIR)$(localstatedir)/lib/libvirt || :
@@ -1577,6 +1577,8 @@ remote_protocol.c: remote_protocol.h
@WITH_LIBVIRTD_TRUE@install-logrotate: libvirtd.logrotate
@WITH_LIBVIRTD_TRUE@ mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/qemu/
+@WITH_LIBVIRTD_TRUE@ mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/lxc/
+@WITH_LIBVIRTD_TRUE@ mkdir -p $(DESTDIR)$(localstatedir)/log/libvirt/uml/
@WITH_LIBVIRTD_TRUE@ mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d/
@WITH_LIBVIRTD_TRUE@ $(INSTALL_DATA) $< $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd
diff -rup libvirt-0.7.1/src/Makefile.in gcrypt-new/src/Makefile.in
--- libvirt-0.7.1/src/Makefile.in 2009-09-15 08:35:17.000000000 -0400
+++ gcrypt-new/src/Makefile.in 2010-05-17 17:52:26.929151000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -598,9 +598,9 @@ am__objects_45 = libvirt_util_la-bridge.
libvirt_util_la-pci.lo libvirt_util_la-hostusb.lo \
libvirt_util_la-qparams.lo \
libvirt_util_la-storage_encryption_conf.lo \
- libvirt_util_la-threads.lo libvirt_util_la-uuid.lo \
- libvirt_util_la-util.lo libvirt_util_la-virterror.lo \
- libvirt_util_la-xml.lo
+ libvirt_util_la-storage_file.lo libvirt_util_la-threads.lo \
+ libvirt_util_la-uuid.lo libvirt_util_la-util.lo \
+ libvirt_util_la-virterror.lo libvirt_util_la-xml.lo
am_libvirt_util_la_OBJECTS = $(am__objects_45)
libvirt_util_la_OBJECTS = $(am_libvirt_util_la_OBJECTS)
libvirt_util_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
@@ -617,11 +617,11 @@ am__libvirt_lxc_SOURCES_DIST = lxc_conf.
event.h hash.c hash.h iptables.c iptables.h logging.c \
logging.h memory.c memory.h pci.c pci.h hostusb.c hostusb.h \
qparams.c qparams.h storage_encryption_conf.h \
- storage_encryption_conf.c threads.c threads.h \
- threads-pthread.h threads-win32.h uuid.c uuid.h util.c util.h \
- virterror.c virterror_internal.h xml.c xml.h capabilities.c \
- capabilities.h domain_conf.c domain_conf.h nodeinfo.h \
- nodeinfo.c
+ storage_encryption_conf.c storage_file.c storage_file.h \
+ threads.c threads.h threads-pthread.h threads-win32.h uuid.c \
+ uuid.h util.c util.h virterror.c virterror_internal.h xml.c \
+ xml.h capabilities.c capabilities.h domain_conf.c \
+ domain_conf.h nodeinfo.h nodeinfo.c
am__objects_46 = libvirt_lxc-lxc_conf.$(OBJEXT) \
libvirt_lxc-lxc_container.$(OBJEXT) \
libvirt_lxc-lxc_controller.$(OBJEXT) \
@@ -633,6 +633,7 @@ am__objects_47 = libvirt_lxc-bridge.$(OB
libvirt_lxc-memory.$(OBJEXT) libvirt_lxc-pci.$(OBJEXT) \
libvirt_lxc-hostusb.$(OBJEXT) libvirt_lxc-qparams.$(OBJEXT) \
libvirt_lxc-storage_encryption_conf.$(OBJEXT) \
+ libvirt_lxc-storage_file.$(OBJEXT) \
libvirt_lxc-threads.$(OBJEXT) libvirt_lxc-uuid.$(OBJEXT) \
libvirt_lxc-util.$(OBJEXT) libvirt_lxc-virterror.$(OBJEXT) \
libvirt_lxc-xml.$(OBJEXT)
@@ -1485,6 +1486,7 @@ UTIL_SOURCES = \
hostusb.c hostusb.h \
qparams.c qparams.h \
storage_encryption_conf.h storage_encryption_conf.c \
+ storage_file.c storage_file.h \
threads.c threads.h \
threads-pthread.h \
threads-win32.h \
@@ -2151,6 +2153,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_lxc-pci.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_lxc-qparams.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_lxc-storage_encryption_conf.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_lxc-storage_file.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_lxc-threads.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_lxc-util.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_lxc-uuid.Po@am__quote@
@@ -2170,6 +2173,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_util_la-pci.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_util_la-qparams.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_util_la-storage_encryption_conf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_util_la-storage_file.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_util_la-threads.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_util_la-util.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_util_la-uuid.Plo@am__quote@
@@ -2753,6 +2757,14 @@ libvirt_util_la-storage_encryption_conf.
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_util_la_CFLAGS) $(CFLAGS) -c -o libvirt_util_la-storage_encryption_conf.lo `test -f 'storage_encryption_conf.c' || echo '$(srcdir)/'`storage_encryption_conf.c
+libvirt_util_la-storage_file.lo: storage_file.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_util_la_CFLAGS) $(CFLAGS) -MT libvirt_util_la-storage_file.lo -MD -MP -MF $(DEPDIR)/libvirt_util_la-storage_file.Tpo -c -o libvirt_util_la-storage_file.lo `test -f 'storage_file.c' || echo '$(srcdir)/'`storage_file.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvirt_util_la-storage_file.Tpo $(DEPDIR)/libvirt_util_la-storage_file.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='storage_file.c' object='libvirt_util_la-storage_file.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_util_la_CFLAGS) $(CFLAGS) -c -o libvirt_util_la-storage_file.lo `test -f 'storage_file.c' || echo '$(srcdir)/'`storage_file.c
+
libvirt_util_la-threads.lo: threads.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_util_la_CFLAGS) $(CFLAGS) -MT libvirt_util_la-threads.lo -MD -MP -MF $(DEPDIR)/libvirt_util_la-threads.Tpo -c -o libvirt_util_la-threads.lo `test -f 'threads.c' || echo '$(srcdir)/'`threads.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvirt_util_la-threads.Tpo $(DEPDIR)/libvirt_util_la-threads.Plo
@@ -3065,6 +3077,22 @@ libvirt_lxc-storage_encryption_conf.obj:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_lxc_CFLAGS) $(CFLAGS) -c -o libvirt_lxc-storage_encryption_conf.obj `if test -f 'storage_encryption_conf.c'; then $(CYGPATH_W) 'storage_encryption_conf.c'; else $(CYGPATH_W) '$(srcdir)/storage_encryption_conf.c'; fi`
+libvirt_lxc-storage_file.o: storage_file.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_lxc_CFLAGS) $(CFLAGS) -MT libvirt_lxc-storage_file.o -MD -MP -MF $(DEPDIR)/libvirt_lxc-storage_file.Tpo -c -o libvirt_lxc-storage_file.o `test -f 'storage_file.c' || echo '$(srcdir)/'`storage_file.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvirt_lxc-storage_file.Tpo $(DEPDIR)/libvirt_lxc-storage_file.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='storage_file.c' object='libvirt_lxc-storage_file.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_lxc_CFLAGS) $(CFLAGS) -c -o libvirt_lxc-storage_file.o `test -f 'storage_file.c' || echo '$(srcdir)/'`storage_file.c
+
+libvirt_lxc-storage_file.obj: storage_file.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_lxc_CFLAGS) $(CFLAGS) -MT libvirt_lxc-storage_file.obj -MD -MP -MF $(DEPDIR)/libvirt_lxc-storage_file.Tpo -c -o libvirt_lxc-storage_file.obj `if test -f 'storage_file.c'; then $(CYGPATH_W) 'storage_file.c'; else $(CYGPATH_W) '$(srcdir)/storage_file.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvirt_lxc-storage_file.Tpo $(DEPDIR)/libvirt_lxc-storage_file.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='storage_file.c' object='libvirt_lxc-storage_file.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_lxc_CFLAGS) $(CFLAGS) -c -o libvirt_lxc-storage_file.obj `if test -f 'storage_file.c'; then $(CYGPATH_W) 'storage_file.c'; else $(CYGPATH_W) '$(srcdir)/storage_file.c'; fi`
+
libvirt_lxc-threads.o: threads.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_lxc_CFLAGS) $(CFLAGS) -MT libvirt_lxc-threads.o -MD -MP -MF $(DEPDIR)/libvirt_lxc-threads.Tpo -c -o libvirt_lxc-threads.o `test -f 'threads.c' || echo '$(srcdir)/'`threads.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvirt_lxc-threads.Tpo $(DEPDIR)/libvirt_lxc-threads.Po
diff -rup libvirt-0.7.1/tests/confdata/Makefile.in gcrypt-new/tests/confdata/Makefile.in
--- libvirt-0.7.1/tests/confdata/Makefile.in 2009-09-15 08:35:17.000000000 -0400
+++ gcrypt-new/tests/confdata/Makefile.in 2010-05-17 17:52:27.383154000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff -rup libvirt-0.7.1/tests/Makefile.in gcrypt-new/tests/Makefile.in
--- libvirt-0.7.1/tests/Makefile.in 2009-09-15 08:35:17.000000000 -0400
+++ gcrypt-new/tests/Makefile.in 2010-05-17 17:52:27.223153000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -1401,7 +1401,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -1426,7 +1426,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
diff -rup libvirt-0.7.1/tests/sexpr2xmldata/Makefile.in gcrypt-new/tests/sexpr2xmldata/Makefile.in
--- libvirt-0.7.1/tests/sexpr2xmldata/Makefile.in 2009-09-15 08:35:17.000000000 -0400
+++ gcrypt-new/tests/sexpr2xmldata/Makefile.in 2010-05-17 17:52:27.543159000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff -rup libvirt-0.7.1/tests/xencapsdata/Makefile.in gcrypt-new/tests/xencapsdata/Makefile.in
--- libvirt-0.7.1/tests/xencapsdata/Makefile.in 2009-09-15 08:35:18.000000000 -0400
+++ gcrypt-new/tests/xencapsdata/Makefile.in 2010-05-17 17:52:27.704150000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff -rup libvirt-0.7.1/tests/xmconfigdata/Makefile.in gcrypt-new/tests/xmconfigdata/Makefile.in
--- libvirt-0.7.1/tests/xmconfigdata/Makefile.in 2009-09-15 08:35:18.000000000 -0400
+++ gcrypt-new/tests/xmconfigdata/Makefile.in 2010-05-17 17:52:27.872118000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff -rup libvirt-0.7.1/tests/xml2sexprdata/Makefile.in gcrypt-new/tests/xml2sexprdata/Makefile.in
--- libvirt-0.7.1/tests/xml2sexprdata/Makefile.in 2009-09-15 08:35:18.000000000 -0400
+++ gcrypt-new/tests/xml2sexprdata/Makefile.in 2010-05-17 17:52:28.046074000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff -rup libvirt-0.7.1/tools/Makefile.in gcrypt-new/tools/Makefile.in
--- libvirt-0.7.1/tools/Makefile.in 2009-09-15 08:35:18.000000000 -0400
+++ gcrypt-new/tools/Makefile.in 2010-05-17 17:52:28.213075000 -0400
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,

View File

@ -0,0 +1,29 @@
commit c11a82b62aefc21e070c527f59a1f9c57a7b4f36
Author: Richard Jones <rjones@redhat.com>
Date: Thu Dec 10 16:39:07 2009 +0000
qemu driver: Fix segfault in libvirt/libvirtd when uri->path is NULL.
See also:
https://bugzilla.redhat.com/show_bug.cgi?id=545400#c1
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2fb059d..e9cc8c3 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -2651,6 +2651,15 @@ static virDrvOpenStatus qemudOpen(virConnectPtr conn,
return VIR_DRV_OPEN_ERROR;
}
+ if (conn->uri->path == NULL) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("no QEMU URI path given, try %s"),
+ qemu_driver->privileged
+ ? "qemu:///system"
+ : "qemu:///session");
+ return VIR_DRV_OPEN_ERROR;
+ }
+
if (qemu_driver->privileged) {
if (STRNEQ (conn->uri->path, "/system") &&
STRNEQ (conn->uri->path, "/session")) {

View File

@ -151,7 +151,7 @@
Summary: Library providing a simple API virtualization
Name: libvirt
Version: 0.7.1
Release: 15%{?dist}%{?extra_release}
Release: 16%{?dist}%{?extra_release}
License: LGPLv2+
Group: Development/Libraries
Source: http://libvirt.org/sources/libvirt-%{version}.tar.gz
@ -213,6 +213,16 @@ Patch23: libvirt-fix-crash-on-missing-iface-target-dev.patch
# Avoid compressing small log files (#531030)
Patch24: libvirt-logrotate-avoid-compressing-small-logs.patch
# Fix crash with invalid QEmu URI (bz 566070)
Patch25: %{name}-%{version}-qemu-uri-crash.patch
# Fix VNC TLS crash (bz 544305)
Patch26: %{name}-%{version}-gcrypt-thread-init.patch
# Fix USB devices with high bus/addr values (bz 542639)
Patch27: %{name}-%{version}-fix-usb-busaddr.patch
# Fix save/restore with non-root guests (bz 534143, bz 532654)
Patch28: %{name}-%{version}-fix-selinux-save.patch
# Fix USB devices attached via virt-manager (bz 537227)
Patch29: %{name}-%{version}-fix-usb-product.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://libvirt.org/
@ -453,6 +463,11 @@ of recent versions of Linux (and other OSes).
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%build
# Needed for libvirt-logrotate-create-lxc-uml-dirs.patch
@ -847,6 +862,13 @@ fi
%endif
%changelog
* Mon May 17 2010 Cole Robinson <crobinso@redhat.com> - 0.7.1-16.fc12
- Fix crash with invalid QEmu URI (bz 566070)
- Fix VNC TLS crash (bz 544305)
- Fix USB devices with high bus/addr values (bz 542639)
- Fix save/restore with non-root guests (bz 534143, bz 532654)
- Fix USB devices attached via virt-manager (bz 537227)
* Thu Oct 29 2009 Mark McLoughlin <markmc@redhat.com> - 0.7.1-15
- Avoid compressing small log files (#531030)