forked from pool/libvirt
- Update to libvirt 0.9.11.4 stable release
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=212
This commit is contained in:
parent
12b4dbbe29
commit
8d8243b548
@ -1,325 +0,0 @@
|
||||
commit 05abd1507d66aabb6cad12eeafeb4c4d1911c585
|
||||
Author: Guannan Ren <gren@redhat.com>
|
||||
Date: Sun May 6 22:45:05 2012 +0800
|
||||
|
||||
qemu: call usb search function for hostdev initialization and hotplug
|
||||
|
||||
src/qemu/qemu_hostdev.c:
|
||||
refactor qemuPrepareHostdevUSBDevices function, make it focus on
|
||||
adding usb device to activeUsbHostdevs after check. After that,
|
||||
the usb hotplug function qemuDomainAttachHostDevice also could use
|
||||
it.
|
||||
expand qemuPrepareHostUSBDevices to perform the usb search,
|
||||
rollback on failure.
|
||||
|
||||
src/qemu/qemu_hotplug.c:
|
||||
If there are multiple usb devices available with same vendorID and productID,
|
||||
but with different value of "bus, device", we give an error to let user
|
||||
use <address> to specify the desired one.
|
||||
|
||||
Index: libvirt-0.9.11.3/src/qemu/qemu_hostdev.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/qemu/qemu_hostdev.c
|
||||
+++ libvirt-0.9.11.3/src/qemu/qemu_hostdev.c
|
||||
@@ -565,13 +565,53 @@ qemuPrepareHostPCIDevices(struct qemud_d
|
||||
int
|
||||
qemuPrepareHostdevUSBDevices(struct qemud_driver *driver,
|
||||
const char *name,
|
||||
- virDomainHostdevDefPtr *hostdevs,
|
||||
- int nhostdevs)
|
||||
+ usbDeviceList *list)
|
||||
{
|
||||
- int ret = -1;
|
||||
int i;
|
||||
+ unsigned int count;
|
||||
+ usbDevice *tmp;
|
||||
+
|
||||
+ count = usbDeviceListCount(list);
|
||||
+
|
||||
+ for (i = 0; i < count; i++) {
|
||||
+ usbDevice *usb = usbDeviceListGet(list, i);
|
||||
+ if ((tmp = usbDeviceListFind(driver->activeUsbHostdevs, usb))) {
|
||||
+ const char *other_name = usbDeviceGetUsedBy(tmp);
|
||||
+
|
||||
+ if (other_name)
|
||||
+ qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||
+ _("USB device %s is in use by domain %s"),
|
||||
+ usbDeviceGetName(tmp), other_name);
|
||||
+ else
|
||||
+ qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||
+ _("USB device %s is already in use"),
|
||||
+ usbDeviceGetName(tmp));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ usbDeviceSetUsedBy(usb, name);
|
||||
+ VIR_DEBUG("Adding %03d.%03d dom=%s to activeUsbHostdevs",
|
||||
+ usbDeviceGetBus(usb), usbDeviceGetDevno(usb), name);
|
||||
+ /*
|
||||
+ * The caller is responsible to steal these usb devices
|
||||
+ * from the usbDeviceList that passed in on success,
|
||||
+ * perform rollback on failure.
|
||||
+ */
|
||||
+ if (usbDeviceListAdd(driver->activeUsbHostdevs, usb) < 0)
|
||||
+ return -1;
|
||||
+ }
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+qemuPrepareHostUSBDevices(struct qemud_driver *driver,
|
||||
+ virDomainDefPtr def)
|
||||
+{
|
||||
+ int i, ret = -1;
|
||||
usbDeviceList *list;
|
||||
usbDevice *tmp;
|
||||
+ virDomainHostdevDefPtr *hostdevs = def->hostdevs;
|
||||
+ int nhostdevs = def->nhostdevs;
|
||||
|
||||
/* To prevent situation where USB device is assigned to two domains
|
||||
* we need to keep a list of currently assigned USB devices.
|
||||
@@ -586,70 +626,61 @@ qemuPrepareHostdevUSBDevices(struct qemu
|
||||
*/
|
||||
for (i = 0 ; i < nhostdevs ; i++) {
|
||||
virDomainHostdevDefPtr hostdev = hostdevs[i];
|
||||
+ usbDevice *usb = NULL;
|
||||
|
||||
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;
|
||||
- usbDeviceList *devs;
|
||||
+ unsigned vendor = hostdev->source.subsys.u.usb.vendor;
|
||||
+ unsigned product = hostdev->source.subsys.u.usb.product;
|
||||
+ unsigned bus = hostdev->source.subsys.u.usb.bus;
|
||||
+ unsigned device = hostdev->source.subsys.u.usb.device;
|
||||
|
||||
- devs = usbFindDeviceByVendor(hostdev->source.subsys.u.usb.vendor,
|
||||
- hostdev->source.subsys.u.usb.product);
|
||||
+ if (vendor && bus) {
|
||||
+ usb = usbFindDevice(vendor, product, bus, device);
|
||||
|
||||
+ } else if (vendor && !bus) {
|
||||
+ usbDeviceList *devs = usbFindDeviceByVendor(vendor, product);
|
||||
if (!devs)
|
||||
goto cleanup;
|
||||
|
||||
+ if (usbDeviceListCount(devs) > 1) {
|
||||
+ qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||
+ _("multiple USB devices for %x:%x, "
|
||||
+ "use <address> to specify one"), vendor, product);
|
||||
+ usbDeviceListFree(devs);
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
usb = usbDeviceListGet(devs, 0);
|
||||
usbDeviceListSteal(devs, usb);
|
||||
usbDeviceListFree(devs);
|
||||
|
||||
- if ((tmp = usbDeviceListFind(driver->activeUsbHostdevs, usb))) {
|
||||
- const char *other_name = usbDeviceGetUsedBy(tmp);
|
||||
-
|
||||
- if (other_name)
|
||||
- qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||
- _("USB device %s is in use by domain %s"),
|
||||
- usbDeviceGetName(tmp), other_name);
|
||||
- else
|
||||
- qemuReportError(VIR_ERR_OPERATION_INVALID,
|
||||
- _("USB device %s is already in use"),
|
||||
- usbDeviceGetName(tmp));
|
||||
- usbFreeDevice(usb);
|
||||
- goto cleanup;
|
||||
- }
|
||||
-
|
||||
hostdev->source.subsys.u.usb.bus = usbDeviceGetBus(usb);
|
||||
hostdev->source.subsys.u.usb.device = usbDeviceGetDevno(usb);
|
||||
|
||||
- if (usbDeviceListAdd(list, usb) < 0) {
|
||||
- usbFreeDevice(usb);
|
||||
- goto cleanup;
|
||||
- }
|
||||
+ } else if (!vendor && bus) {
|
||||
+ usb = usbFindDeviceByBus(bus, device);
|
||||
+ }
|
||||
+
|
||||
+ if (!usb)
|
||||
+ goto cleanup;
|
||||
|
||||
+ if (usbDeviceListAdd(list, usb) < 0) {
|
||||
+ usbFreeDevice(usb);
|
||||
+ goto cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
- /* Loop 2: Mark devices in temporary list as used by @name
|
||||
+ /* Mark devices in temporary list as used by @name
|
||||
* and add them do driver list. However, if something goes
|
||||
* wrong, perform rollback.
|
||||
*/
|
||||
- for (i = 0; i < usbDeviceListCount(list); i++) {
|
||||
- tmp = usbDeviceListGet(list, i);
|
||||
- usbDeviceSetUsedBy(tmp, name);
|
||||
+ if (qemuPrepareHostdevUSBDevices(driver, def->name, list) < 0)
|
||||
+ goto inactivedevs;
|
||||
|
||||
- VIR_DEBUG("Adding %03d.%03d dom=%s to activeUsbHostdevs",
|
||||
- usbDeviceGetBus(tmp), usbDeviceGetDevno(tmp), name);
|
||||
- if (usbDeviceListAdd(driver->activeUsbHostdevs, tmp) < 0) {
|
||||
- usbFreeDevice(tmp);
|
||||
- goto inactivedevs;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- /* Loop 3: Temporary list was successfully merged with
|
||||
+ /* Loop 2: Temporary list was successfully merged with
|
||||
* driver list, so steal all items to avoid freeing them
|
||||
* in cleanup label.
|
||||
*/
|
||||
@@ -675,13 +706,6 @@ cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int
|
||||
-qemuPrepareHostUSBDevices(struct qemud_driver *driver,
|
||||
- virDomainDefPtr def)
|
||||
-{
|
||||
- return qemuPrepareHostdevUSBDevices(driver, def->name, def->hostdevs, def->nhostdevs);
|
||||
-}
|
||||
-
|
||||
int qemuPrepareHostDevices(struct qemud_driver *driver,
|
||||
virDomainDefPtr def)
|
||||
{
|
||||
Index: libvirt-0.9.11.3/src/qemu/qemu_hostdev.h
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/qemu/qemu_hostdev.h
|
||||
+++ libvirt-0.9.11.3/src/qemu/qemu_hostdev.h
|
||||
@@ -38,8 +38,7 @@ int qemuPrepareHostdevPCIDevices(struct
|
||||
int nhostdevs);
|
||||
int qemuPrepareHostdevUSBDevices(struct qemud_driver *driver,
|
||||
const char *name,
|
||||
- virDomainHostdevDefPtr *hostdevs,
|
||||
- int nhostdevs);
|
||||
+ usbDeviceList *list);
|
||||
int qemuPrepareHostDevices(struct qemud_driver *driver,
|
||||
virDomainDefPtr def);
|
||||
void qemuReattachPciDevice(pciDevice *dev, struct qemud_driver *driver);
|
||||
Index: libvirt-0.9.11.3/src/qemu/qemu_hotplug.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/qemu/qemu_hotplug.c
|
||||
+++ libvirt-0.9.11.3/src/qemu/qemu_hotplug.c
|
||||
@@ -1116,11 +1116,13 @@ error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
-
|
||||
int qemuDomainAttachHostDevice(struct qemud_driver *driver,
|
||||
virDomainObjPtr vm,
|
||||
virDomainHostdevDefPtr hostdev)
|
||||
{
|
||||
+ usbDeviceList *list;
|
||||
+ usbDevice *usb = NULL;
|
||||
+
|
||||
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
|
||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("hostdev mode '%s' not supported"),
|
||||
@@ -1128,35 +1130,58 @@ int qemuDomainAttachHostDevice(struct qe
|
||||
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;
|
||||
- usbDeviceList *list;
|
||||
-
|
||||
- if (qemuPrepareHostdevUSBDevices(driver, vm->def->name, &hostdev, 1) < 0)
|
||||
- goto error;
|
||||
+ if (!(list = usbDeviceListNew()))
|
||||
+ goto cleanup;
|
||||
|
||||
- list = usbFindDeviceByVendor(hostdev->source.subsys.u.usb.vendor,
|
||||
- hostdev->source.subsys.u.usb.product);
|
||||
+ if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) {
|
||||
+ unsigned vendor = hostdev->source.subsys.u.usb.vendor;
|
||||
+ unsigned product = hostdev->source.subsys.u.usb.product;
|
||||
+ unsigned bus = hostdev->source.subsys.u.usb.bus;
|
||||
+ unsigned device = hostdev->source.subsys.u.usb.device;
|
||||
+
|
||||
+ if (vendor && bus) {
|
||||
+ usb = usbFindDevice(vendor, product, bus, device);
|
||||
+
|
||||
+ } else if (vendor && !bus) {
|
||||
+ usbDeviceList *devs = usbFindDeviceByVendor(vendor, product);
|
||||
+ if (!devs)
|
||||
+ goto cleanup;
|
||||
+
|
||||
+ if (usbDeviceListCount(devs) > 1) {
|
||||
+ qemuReportError(VIR_ERR_OPERATION_FAILED,
|
||||
+ _("multiple USB devices for %x:%x, "
|
||||
+ "use <address> to specify one"), vendor, product);
|
||||
+ usbDeviceListFree(devs);
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+ usb = usbDeviceListGet(devs, 0);
|
||||
+ usbDeviceListSteal(devs, usb);
|
||||
+ usbDeviceListFree(devs);
|
||||
+
|
||||
+ hostdev->source.subsys.u.usb.bus = usbDeviceGetBus(usb);
|
||||
+ hostdev->source.subsys.u.usb.device = usbDeviceGetDevno(usb);
|
||||
+
|
||||
+ } else if (!vendor && bus) {
|
||||
+ usb = usbFindDeviceByBus(bus, device);
|
||||
+ }
|
||||
+
|
||||
+ if (!usb)
|
||||
+ goto cleanup;
|
||||
+
|
||||
+ if (usbDeviceListAdd(list, usb) < 0) {
|
||||
+ usbFreeDevice(usb);
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
|
||||
- if (!list)
|
||||
- return -1;
|
||||
+ if (qemuPrepareHostdevUSBDevices(driver, vm->def->name, list) < 0)
|
||||
+ goto cleanup;
|
||||
|
||||
- usb = usbDeviceListGet(list, 0);
|
||||
usbDeviceListSteal(list, usb);
|
||||
- usbDeviceListFree(list);
|
||||
-
|
||||
- hostdev->source.subsys.u.usb.bus = usbDeviceGetBus(usb);
|
||||
- hostdev->source.subsys.u.usb.device = usbDeviceGetDevno(usb);
|
||||
-
|
||||
- usbFreeDevice(usb);
|
||||
}
|
||||
|
||||
-
|
||||
if (virSecurityManagerSetHostdevLabel(driver->securityManager,
|
||||
vm->def, hostdev) < 0)
|
||||
- return -1;
|
||||
+ goto cleanup;
|
||||
|
||||
switch (hostdev->source.subsys.type) {
|
||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
||||
@@ -1178,6 +1203,7 @@ int qemuDomainAttachHostDevice(struct qe
|
||||
goto error;
|
||||
}
|
||||
|
||||
+ usbDeviceListFree(list);
|
||||
return 0;
|
||||
|
||||
error:
|
||||
@@ -1185,6 +1211,9 @@ error:
|
||||
vm->def, hostdev) < 0)
|
||||
VIR_WARN("Unable to restore host device labelling on hotplug fail");
|
||||
|
||||
+cleanup:
|
||||
+ usbDeviceListFree(list);
|
||||
+ usbDeviceListSteal(driver->activeUsbHostdevs, usb);
|
||||
return -1;
|
||||
}
|
||||
|
@ -1,423 +0,0 @@
|
||||
commit 9914477efc9764f691ca50faca6592a2d4fecec8
|
||||
Author: Guannan Ren <gren@redhat.com>
|
||||
Date: Fri May 4 15:49:58 2012 +0800
|
||||
|
||||
usb: create functions to search usb device accurately
|
||||
|
||||
usbFindDevice():get usb device according to
|
||||
idVendor, idProduct, bus, device
|
||||
it is the exact match of the four parameters
|
||||
|
||||
usbFindDeviceByBus():get usb device according to bus, device
|
||||
it returns only one usb device same as usbFindDevice
|
||||
|
||||
usbFindDeviceByVendor():get usb device according to idVendor,idProduct
|
||||
it probably returns multiple usb devices.
|
||||
|
||||
usbDeviceSearch(): a helper function to do the actual search
|
||||
|
||||
Index: libvirt-0.9.11.3/src/libvirt_private.syms
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/libvirt_private.syms
|
||||
+++ libvirt-0.9.11.3/src/libvirt_private.syms
|
||||
@@ -1084,6 +1084,8 @@ usbDeviceListNew;
|
||||
usbDeviceListSteal;
|
||||
usbDeviceSetUsedBy;
|
||||
usbFindDevice;
|
||||
+usbFindDeviceByBus;
|
||||
+usbFindDeviceByVendor;
|
||||
usbFreeDevice;
|
||||
usbGetDevice;
|
||||
|
||||
Index: libvirt-0.9.11.3/src/qemu/qemu_hostdev.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/qemu/qemu_hostdev.c
|
||||
+++ libvirt-0.9.11.3/src/qemu/qemu_hostdev.c
|
||||
@@ -594,13 +594,19 @@ qemuPrepareHostdevUSBDevices(struct qemu
|
||||
|
||||
/* 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);
|
||||
+ usbDevice *usb;
|
||||
+ usbDeviceList *devs;
|
||||
|
||||
- if (!usb)
|
||||
+ devs = usbFindDeviceByVendor(hostdev->source.subsys.u.usb.vendor,
|
||||
+ hostdev->source.subsys.u.usb.product);
|
||||
+
|
||||
+ if (!devs)
|
||||
goto cleanup;
|
||||
|
||||
+ usb = usbDeviceListGet(devs, 0);
|
||||
+ usbDeviceListSteal(devs, usb);
|
||||
+ usbDeviceListFree(devs);
|
||||
+
|
||||
if ((tmp = usbDeviceListFind(driver->activeUsbHostdevs, usb))) {
|
||||
const char *other_name = usbDeviceGetUsedBy(tmp);
|
||||
|
||||
Index: libvirt-0.9.11.3/src/qemu/qemu_hotplug.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/qemu/qemu_hotplug.c
|
||||
+++ libvirt-0.9.11.3/src/qemu/qemu_hotplug.c
|
||||
@@ -1131,16 +1131,22 @@ int qemuDomainAttachHostDevice(struct qe
|
||||
/* 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;
|
||||
+ usbDeviceList *list;
|
||||
+
|
||||
if (qemuPrepareHostdevUSBDevices(driver, vm->def->name, &hostdev, 1) < 0)
|
||||
goto error;
|
||||
|
||||
- usbDevice *usb
|
||||
- = usbFindDevice(hostdev->source.subsys.u.usb.vendor,
|
||||
- hostdev->source.subsys.u.usb.product);
|
||||
+ list = usbFindDeviceByVendor(hostdev->source.subsys.u.usb.vendor,
|
||||
+ hostdev->source.subsys.u.usb.product);
|
||||
|
||||
- if (!usb)
|
||||
+ if (!list)
|
||||
return -1;
|
||||
|
||||
+ usb = usbDeviceListGet(list, 0);
|
||||
+ usbDeviceListSteal(list, usb);
|
||||
+ usbDeviceListFree(list);
|
||||
+
|
||||
hostdev->source.subsys.u.usb.bus = usbDeviceGetBus(usb);
|
||||
hostdev->source.subsys.u.usb.device = usbDeviceGetDevno(usb);
|
||||
|
||||
Index: libvirt-0.9.11.3/src/util/hostusb.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/util/hostusb.c
|
||||
+++ libvirt-0.9.11.3/src/util/hostusb.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (C) 2009-2011 Red Hat, Inc.
|
||||
+ * Copyright (C) 2009-2012 Red Hat, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -42,9 +42,16 @@
|
||||
#define USB_ID_LEN 10 /* "1234 5678" */
|
||||
#define USB_ADDR_LEN 8 /* "123:456" */
|
||||
|
||||
+/* For virReportOOMError() and virReportSystemError() */
|
||||
+#define VIR_FROM_THIS VIR_FROM_NONE
|
||||
+
|
||||
+#define usbReportError(code, ...) \
|
||||
+ virReportErrorHelper(VIR_FROM_NONE, code, __FILE__, \
|
||||
+ __FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
+
|
||||
struct _usbDevice {
|
||||
- unsigned bus;
|
||||
- unsigned dev;
|
||||
+ unsigned int bus;
|
||||
+ unsigned int dev;
|
||||
|
||||
char name[USB_ADDR_LEN]; /* domain:bus:slot.function */
|
||||
char id[USB_ID_LEN]; /* product vendor */
|
||||
@@ -57,15 +64,14 @@ struct _usbDeviceList {
|
||||
usbDevice **devs;
|
||||
};
|
||||
|
||||
-/* For virReportOOMError() and virReportSystemError() */
|
||||
-#define VIR_FROM_THIS VIR_FROM_NONE
|
||||
-
|
||||
-#define usbReportError(code, ...) \
|
||||
- virReportErrorHelper(VIR_FROM_NONE, code, __FILE__, \
|
||||
- __FUNCTION__, __LINE__, __VA_ARGS__)
|
||||
+typedef enum {
|
||||
+ USB_DEVICE_ALL = 0,
|
||||
+ USB_DEVICE_FIND_BY_VENDOR = 1 << 0,
|
||||
+ USB_DEVICE_FIND_BY_BUS = 1 << 1,
|
||||
+} usbDeviceFindFlags;
|
||||
|
||||
static int usbSysReadFile(const char *f_name, const char *d_name,
|
||||
- int base, unsigned *value)
|
||||
+ int base, unsigned int *value)
|
||||
{
|
||||
int ret = -1, tmp;
|
||||
char *buf = NULL;
|
||||
@@ -94,13 +100,22 @@ cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int usbFindBusByVendor(unsigned vendor, unsigned product,
|
||||
- unsigned *bus, unsigned *devno)
|
||||
+static usbDeviceList *
|
||||
+usbDeviceSearch(unsigned int vendor,
|
||||
+ unsigned int product,
|
||||
+ unsigned int bus,
|
||||
+ unsigned int devno,
|
||||
+ unsigned int flags)
|
||||
{
|
||||
DIR *dir = NULL;
|
||||
- int ret = -1, found = 0;
|
||||
+ bool found = false;
|
||||
char *ignore = NULL;
|
||||
struct dirent *de;
|
||||
+ usbDeviceList *list = NULL, *ret = NULL;
|
||||
+ usbDevice *usb;
|
||||
+
|
||||
+ if (!(list = usbDeviceListNew()))
|
||||
+ goto cleanup;
|
||||
|
||||
dir = opendir(USB_SYSFS "/devices");
|
||||
if (!dir) {
|
||||
@@ -111,61 +126,145 @@ static int usbFindBusByVendor(unsigned v
|
||||
}
|
||||
|
||||
while ((de = readdir(dir))) {
|
||||
- unsigned found_prod, found_vend;
|
||||
+ unsigned int found_prod, found_vend, found_bus, found_devno;
|
||||
+ char *tmpstr = de->d_name;
|
||||
+
|
||||
if (de->d_name[0] == '.' || strchr(de->d_name, ':'))
|
||||
continue;
|
||||
|
||||
if (usbSysReadFile("idVendor", de->d_name,
|
||||
16, &found_vend) < 0)
|
||||
goto cleanup;
|
||||
+
|
||||
if (usbSysReadFile("idProduct", de->d_name,
|
||||
16, &found_prod) < 0)
|
||||
goto cleanup;
|
||||
|
||||
- if (found_prod == product && found_vend == vendor) {
|
||||
- /* Lookup bus.addr info */
|
||||
- char *tmpstr = de->d_name;
|
||||
- unsigned found_bus, found_addr;
|
||||
-
|
||||
- if (STRPREFIX(de->d_name, "usb"))
|
||||
- tmpstr += 3;
|
||||
-
|
||||
- if (virStrToLong_ui(tmpstr, &ignore, 10, &found_bus) < 0) {
|
||||
- usbReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
- _("Failed to parse dir name '%s'"),
|
||||
- de->d_name);
|
||||
- goto cleanup;
|
||||
- }
|
||||
-
|
||||
- if (usbSysReadFile("devnum", de->d_name,
|
||||
- 10, &found_addr) < 0)
|
||||
- goto cleanup;
|
||||
-
|
||||
- *bus = found_bus;
|
||||
- *devno = found_addr;
|
||||
- found = 1;
|
||||
- break;
|
||||
+ if (STRPREFIX(de->d_name, "usb"))
|
||||
+ tmpstr += 3;
|
||||
+
|
||||
+ if (virStrToLong_ui(tmpstr, &ignore, 10, &found_bus) < 0) {
|
||||
+ usbReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
+ _("Failed to parse dir name '%s'"),
|
||||
+ de->d_name);
|
||||
+ goto cleanup;
|
||||
}
|
||||
- }
|
||||
|
||||
- if (!found)
|
||||
- usbReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
- _("Did not find USB device %x:%x"), vendor, product);
|
||||
- else
|
||||
- ret = 0;
|
||||
+ if (usbSysReadFile("devnum", de->d_name,
|
||||
+ 10, &found_devno) < 0)
|
||||
+ goto cleanup;
|
||||
+
|
||||
+ if ((flags & USB_DEVICE_FIND_BY_VENDOR) &&
|
||||
+ (found_prod != product || found_vend != vendor))
|
||||
+ continue;
|
||||
+
|
||||
+ if (flags & USB_DEVICE_FIND_BY_BUS) {
|
||||
+ if (found_bus != bus || found_devno != devno)
|
||||
+ continue;
|
||||
+ found = true;
|
||||
+ }
|
||||
+
|
||||
+ usb = usbGetDevice(found_bus, found_devno);
|
||||
+ if (!usb)
|
||||
+ goto cleanup;
|
||||
+
|
||||
+ if (usbDeviceListAdd(list, usb) < 0) {
|
||||
+ usbFreeDevice(usb);
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+
|
||||
+ if (found)
|
||||
+ break;
|
||||
+ }
|
||||
+ ret = list;
|
||||
|
||||
cleanup:
|
||||
if (dir) {
|
||||
int saved_errno = errno;
|
||||
- closedir (dir);
|
||||
+ closedir(dir);
|
||||
errno = saved_errno;
|
||||
}
|
||||
+
|
||||
+ if (!ret)
|
||||
+ usbDeviceListFree(list);
|
||||
return ret;
|
||||
}
|
||||
|
||||
+usbDeviceList *
|
||||
+usbFindDeviceByVendor(unsigned int vendor, unsigned product)
|
||||
+{
|
||||
+
|
||||
+ usbDeviceList *list;
|
||||
+ if (!(list = usbDeviceSearch(vendor, product, 0 , 0,
|
||||
+ USB_DEVICE_FIND_BY_VENDOR)))
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (list->count == 0) {
|
||||
+ usbReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
+ _("Did not find USB device %x:%x"), vendor, product);
|
||||
+ usbDeviceListFree(list);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ return list;
|
||||
+}
|
||||
+
|
||||
usbDevice *
|
||||
-usbGetDevice(unsigned bus,
|
||||
- unsigned devno)
|
||||
+usbFindDeviceByBus(unsigned int bus, unsigned devno)
|
||||
+{
|
||||
+ usbDevice *usb;
|
||||
+ usbDeviceList *list;
|
||||
+
|
||||
+ if (!(list = usbDeviceSearch(0, 0, bus, devno,
|
||||
+ USB_DEVICE_FIND_BY_BUS)))
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (list->count == 0) {
|
||||
+ usbReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
+ _("Did not find USB device bus:%u device:%u"),
|
||||
+ bus, devno);
|
||||
+ usbDeviceListFree(list);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ usb = usbDeviceListGet(list, 0);
|
||||
+ usbDeviceListSteal(list, usb);
|
||||
+ usbDeviceListFree(list);
|
||||
+
|
||||
+ return usb;
|
||||
+}
|
||||
+
|
||||
+usbDevice *
|
||||
+usbFindDevice(unsigned int vendor,
|
||||
+ unsigned int product,
|
||||
+ unsigned int bus,
|
||||
+ unsigned int devno)
|
||||
+{
|
||||
+ usbDevice *usb;
|
||||
+ usbDeviceList *list;
|
||||
+
|
||||
+ unsigned int flags = USB_DEVICE_FIND_BY_VENDOR|USB_DEVICE_FIND_BY_BUS;
|
||||
+ if (!(list = usbDeviceSearch(vendor, product, bus, devno, flags)))
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (list->count == 0) {
|
||||
+ usbReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
+ _("Did not find USB device %x:%x bus:%u device:%u"),
|
||||
+ vendor, product, bus, devno);
|
||||
+ usbDeviceListFree(list);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ usb = usbDeviceListGet(list, 0);
|
||||
+ usbDeviceListSteal(list, usb);
|
||||
+ usbDeviceListFree(list);
|
||||
+
|
||||
+ return usb;
|
||||
+}
|
||||
+
|
||||
+usbDevice *
|
||||
+usbGetDevice(unsigned int bus,
|
||||
+ unsigned int devno)
|
||||
{
|
||||
usbDevice *dev;
|
||||
|
||||
@@ -207,21 +306,6 @@ usbGetDevice(unsigned bus,
|
||||
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(usbDevice *dev)
|
||||
{
|
||||
@@ -247,13 +331,13 @@ const char *usbDeviceGetName(usbDevice *
|
||||
return dev->name;
|
||||
}
|
||||
|
||||
-unsigned usbDeviceGetBus(usbDevice *dev)
|
||||
+unsigned int usbDeviceGetBus(usbDevice *dev)
|
||||
{
|
||||
return dev->bus;
|
||||
}
|
||||
|
||||
|
||||
-unsigned usbDeviceGetDevno(usbDevice *dev)
|
||||
+unsigned int usbDeviceGetDevno(usbDevice *dev)
|
||||
{
|
||||
return dev->dev;
|
||||
}
|
||||
Index: libvirt-0.9.11.3/src/util/hostusb.h
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/util/hostusb.h
|
||||
+++ libvirt-0.9.11.3/src/util/hostusb.h
|
||||
@@ -28,17 +28,27 @@
|
||||
typedef struct _usbDevice usbDevice;
|
||||
typedef struct _usbDeviceList usbDeviceList;
|
||||
|
||||
-usbDevice *usbGetDevice(unsigned bus,
|
||||
- unsigned devno);
|
||||
-usbDevice *usbFindDevice(unsigned vendor,
|
||||
- unsigned product);
|
||||
+usbDevice *usbGetDevice(unsigned int bus,
|
||||
+ unsigned int devno);
|
||||
+
|
||||
+usbDevice *usbFindDeviceByBus(unsigned int bus,
|
||||
+ unsigned int devno);
|
||||
+
|
||||
+usbDeviceList *usbFindDeviceByVendor(unsigned int vendor,
|
||||
+ unsigned int product);
|
||||
+
|
||||
+usbDevice *usbFindDevice(unsigned int vendor,
|
||||
+ unsigned int product,
|
||||
+ unsigned int bus,
|
||||
+ unsigned int devno);
|
||||
+
|
||||
void usbFreeDevice (usbDevice *dev);
|
||||
void usbDeviceSetUsedBy(usbDevice *dev, const char *name);
|
||||
const char *usbDeviceGetUsedBy(usbDevice *dev);
|
||||
const char *usbDeviceGetName(usbDevice *dev);
|
||||
|
||||
-unsigned usbDeviceGetBus(usbDevice *dev);
|
||||
-unsigned usbDeviceGetDevno(usbDevice *dev);
|
||||
+unsigned int usbDeviceGetBus(usbDevice *dev);
|
||||
+unsigned int usbDeviceGetDevno(usbDevice *dev);
|
||||
|
||||
/*
|
||||
* Callback that will be invoked once for each file
|
@ -1,7 +1,7 @@
|
||||
Index: libvirt-0.9.11.3/src/util/virnetdev.c
|
||||
Index: libvirt-0.9.11.4/src/util/virnetdev.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/util/virnetdev.c
|
||||
+++ libvirt-0.9.11.3/src/util/virnetdev.c
|
||||
--- libvirt-0.9.11.4.orig/src/util/virnetdev.c
|
||||
+++ libvirt-0.9.11.4/src/util/virnetdev.c
|
||||
@@ -85,7 +85,7 @@ static int virNetDevSetupControlFull(con
|
||||
static int virNetDevSetupControl(const char *ifname,
|
||||
struct ifreq *ifr)
|
||||
@ -11,10 +11,10 @@ Index: libvirt-0.9.11.3/src/util/virnetdev.c
|
||||
}
|
||||
#endif
|
||||
|
||||
Index: libvirt-0.9.11.3/src/util/virnetdevbridge.c
|
||||
Index: libvirt-0.9.11.4/src/util/virnetdevbridge.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/util/virnetdevbridge.c
|
||||
+++ libvirt-0.9.11.3/src/util/virnetdevbridge.c
|
||||
--- libvirt-0.9.11.4.orig/src/util/virnetdevbridge.c
|
||||
+++ libvirt-0.9.11.4/src/util/virnetdevbridge.c
|
||||
@@ -84,7 +84,7 @@ static int virNetDevSetupControlFull(con
|
||||
static int virNetDevSetupControl(const char *ifname,
|
||||
struct ifreq *ifr)
|
||||
|
@ -2,7 +2,7 @@ Index: src/lxc/lxc_container.c
|
||||
===================================================================
|
||||
--- src/lxc/lxc_container.c.orig
|
||||
+++ src/lxc/lxc_container.c
|
||||
@@ -1453,6 +1453,9 @@ int lxcContainerStart(virDomainDefPtr de
|
||||
@@ -1454,6 +1454,9 @@ int lxcContainerStart(virDomainDefPtr de
|
||||
ttyPaths, nttyPaths, handshakefd};
|
||||
|
||||
/* allocate a stack for the container */
|
||||
@ -12,7 +12,7 @@ Index: src/lxc/lxc_container.c
|
||||
if (VIR_ALLOC_N(stack, stacksize) < 0) {
|
||||
virReportOOMError();
|
||||
return -1;
|
||||
@@ -1472,7 +1475,11 @@ int lxcContainerStart(virDomainDefPtr de
|
||||
@@ -1473,7 +1476,11 @@ int lxcContainerStart(virDomainDefPtr de
|
||||
cflags |= CLONE_NEWNET;
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ Index: src/lxc/lxc_container.c
|
||||
VIR_FREE(stack);
|
||||
VIR_DEBUG("clone() completed, new container PID is %d", pid);
|
||||
|
||||
@@ -1498,6 +1505,7 @@ int lxcContainerAvailable(int features)
|
||||
@@ -1499,6 +1506,7 @@ int lxcContainerAvailable(int features)
|
||||
int cpid;
|
||||
char *childStack;
|
||||
char *stack;
|
||||
@ -32,7 +32,7 @@ Index: src/lxc/lxc_container.c
|
||||
|
||||
if (features & LXC_CONTAINER_FEATURE_USER)
|
||||
flags |= CLONE_NEWUSER;
|
||||
@@ -1505,14 +1513,21 @@ int lxcContainerAvailable(int features)
|
||||
@@ -1506,14 +1514,21 @@ int lxcContainerAvailable(int features)
|
||||
if (features & LXC_CONTAINER_FEATURE_NET)
|
||||
flags |= CLONE_NEWNET;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: libvirt-0.9.11.3/examples/apparmor/Makefile.am
|
||||
Index: libvirt-0.9.11.4/examples/apparmor/Makefile.am
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/examples/apparmor/Makefile.am
|
||||
+++ libvirt-0.9.11.3/examples/apparmor/Makefile.am
|
||||
--- libvirt-0.9.11.4.orig/examples/apparmor/Makefile.am
|
||||
+++ libvirt-0.9.11.4/examples/apparmor/Makefile.am
|
||||
@@ -1,8 +1,39 @@
|
||||
## Copyright (C) 2005-2011 Red Hat, Inc.
|
||||
## See COPYING.LIB for the License of this software
|
||||
@ -47,10 +47,10 @@ Index: libvirt-0.9.11.3/examples/apparmor/Makefile.am
|
||||
+ rm -f $(DESTDIR)$(sysconfdir)/apparmor.d/libvirt/TEMPLATE
|
||||
+
|
||||
+endif
|
||||
Index: libvirt-0.9.11.3/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in
|
||||
Index: libvirt-0.9.11.4/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ libvirt-0.9.11.3/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in
|
||||
+++ libvirt-0.9.11.4/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in
|
||||
@@ -0,0 +1,40 @@
|
||||
+# Last Modified: Fri Aug 19 11:21:48 2011
|
||||
+#include <tunables/global>
|
||||
@ -92,9 +92,9 @@ Index: libvirt-0.9.11.3/examples/apparmor/usr.lib.libvirt.virt-aa-helper.in
|
||||
+ /var/lib/kvm/images/ r,
|
||||
+ /var/lib/kvm/images/** r,
|
||||
+}
|
||||
Index: libvirt-0.9.11.3/examples/apparmor/usr.lib.libvirt.virt-aa-helper
|
||||
Index: libvirt-0.9.11.4/examples/apparmor/usr.lib.libvirt.virt-aa-helper
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/examples/apparmor/usr.lib.libvirt.virt-aa-helper
|
||||
--- libvirt-0.9.11.4.orig/examples/apparmor/usr.lib.libvirt.virt-aa-helper
|
||||
+++ /dev/null
|
||||
@@ -1,38 +0,0 @@
|
||||
-# Last Modified: Mon Apr 5 15:10:27 2010
|
||||
@ -135,9 +135,9 @@ Index: libvirt-0.9.11.3/examples/apparmor/usr.lib.libvirt.virt-aa-helper
|
||||
- /var/lib/libvirt/images/ r,
|
||||
- /var/lib/libvirt/images/** r,
|
||||
-}
|
||||
Index: libvirt-0.9.11.3/examples/apparmor/usr.sbin.libvirtd
|
||||
Index: libvirt-0.9.11.4/examples/apparmor/usr.sbin.libvirtd
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/examples/apparmor/usr.sbin.libvirtd
|
||||
--- libvirt-0.9.11.4.orig/examples/apparmor/usr.sbin.libvirtd
|
||||
+++ /dev/null
|
||||
@@ -1,52 +0,0 @@
|
||||
-# Last Modified: Mon Apr 5 15:03:58 2010
|
||||
@ -192,10 +192,10 @@ Index: libvirt-0.9.11.3/examples/apparmor/usr.sbin.libvirtd
|
||||
- change_profile -> @{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*,
|
||||
-
|
||||
-}
|
||||
Index: libvirt-0.9.11.3/examples/apparmor/usr.sbin.libvirtd.in
|
||||
Index: libvirt-0.9.11.4/examples/apparmor/usr.sbin.libvirtd.in
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ libvirt-0.9.11.3/examples/apparmor/usr.sbin.libvirtd.in
|
||||
+++ libvirt-0.9.11.4/examples/apparmor/usr.sbin.libvirtd.in
|
||||
@@ -0,0 +1,58 @@
|
||||
+# Last Modified: Fri Aug 19 11:20:36 2011
|
||||
+#include <tunables/global>
|
||||
@ -255,10 +255,10 @@ Index: libvirt-0.9.11.3/examples/apparmor/usr.sbin.libvirtd.in
|
||||
+ change_profile -> @{LIBVIRT}-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*,
|
||||
+
|
||||
+}
|
||||
Index: libvirt-0.9.11.3/examples/apparmor/libvirt-qemu
|
||||
Index: libvirt-0.9.11.4/examples/apparmor/libvirt-qemu
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/examples/apparmor/libvirt-qemu
|
||||
+++ libvirt-0.9.11.3/examples/apparmor/libvirt-qemu
|
||||
--- libvirt-0.9.11.4.orig/examples/apparmor/libvirt-qemu
|
||||
+++ libvirt-0.9.11.4/examples/apparmor/libvirt-qemu
|
||||
@@ -52,6 +52,7 @@
|
||||
# access to firmware's etc
|
||||
/usr/share/kvm/** r,
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2f9a4fd33ee9e88b0dc1431799b583feba0539e224db87e1c4b2c44ddae52afa
|
||||
size 13800939
|
3
libvirt-0.9.11.4.tar.bz2
Normal file
3
libvirt-0.9.11.4.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ba68c591b0a500188170fefc43d0dbec02f4527aeed18c5b2ebbdc5ca91bca56
|
||||
size 13792390
|
@ -1,7 +1,7 @@
|
||||
Index: libvirt-0.9.11.3/configure.ac
|
||||
Index: libvirt-0.9.11.4/configure.ac
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/configure.ac
|
||||
+++ libvirt-0.9.11.3/configure.ac
|
||||
--- libvirt-0.9.11.4.orig/configure.ac
|
||||
+++ libvirt-0.9.11.4/configure.ac
|
||||
@@ -63,6 +63,7 @@ AVAHI_REQUIRED="0.6.0"
|
||||
POLKIT_REQUIRED="0.6"
|
||||
PARTED_REQUIRED="1.8.0"
|
||||
@ -10,7 +10,7 @@ Index: libvirt-0.9.11.3/configure.ac
|
||||
UDEV_REQUIRED=145
|
||||
PCIACCESS_REQUIRED=0.10.0
|
||||
XMLRPC_REQUIRED=1.14.0
|
||||
@@ -1741,6 +1742,38 @@ AM_CONDITIONAL([WITH_NETCF], [test "$wit
|
||||
@@ -1756,6 +1757,38 @@ AM_CONDITIONAL([WITH_NETCF], [test "$wit
|
||||
AC_SUBST([NETCF_CFLAGS])
|
||||
AC_SUBST([NETCF_LIBS])
|
||||
|
||||
@ -49,7 +49,7 @@ Index: libvirt-0.9.11.3/configure.ac
|
||||
|
||||
AC_ARG_WITH([secrets],
|
||||
AC_HELP_STRING([--with-secrets], [with local secrets management driver @<:@default=yes@:>@]),[],[with_secrets=yes])
|
||||
@@ -2686,6 +2719,7 @@ AC_MSG_NOTICE([ Remote: $with_remote])
|
||||
@@ -2701,6 +2734,7 @@ AC_MSG_NOTICE([ Remote: $with_remote])
|
||||
AC_MSG_NOTICE([ Network: $with_network])
|
||||
AC_MSG_NOTICE([Libvirtd: $with_libvirtd])
|
||||
AC_MSG_NOTICE([ netcf: $with_netcf])
|
||||
@ -57,7 +57,7 @@ Index: libvirt-0.9.11.3/configure.ac
|
||||
AC_MSG_NOTICE([ macvtap: $with_macvtap])
|
||||
AC_MSG_NOTICE([virtport: $with_virtualport])
|
||||
AC_MSG_NOTICE([])
|
||||
@@ -2817,6 +2851,11 @@ AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $
|
||||
@@ -2832,6 +2866,11 @@ AC_MSG_NOTICE([ netcf: $NETCF_CFLAGS $
|
||||
else
|
||||
AC_MSG_NOTICE([ netcf: no])
|
||||
fi
|
||||
@ -69,10 +69,10 @@ Index: libvirt-0.9.11.3/configure.ac
|
||||
if test "$with_qemu" = "yes" && test "$LIBPCAP_FOUND" != "no"; then
|
||||
AC_MSG_NOTICE([ pcap: $LIBPCAP_CFLAGS $LIBPCAP_LIBS])
|
||||
else
|
||||
Index: libvirt-0.9.11.3/daemon/Makefile.am
|
||||
Index: libvirt-0.9.11.4/daemon/Makefile.am
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/daemon/Makefile.am
|
||||
+++ libvirt-0.9.11.3/daemon/Makefile.am
|
||||
--- libvirt-0.9.11.4.orig/daemon/Makefile.am
|
||||
+++ libvirt-0.9.11.4/daemon/Makefile.am
|
||||
@@ -143,6 +143,10 @@ endif
|
||||
|
||||
if WITH_NETCF
|
||||
@ -84,10 +84,10 @@ Index: libvirt-0.9.11.3/daemon/Makefile.am
|
||||
endif
|
||||
|
||||
if WITH_NODE_DEVICES
|
||||
Index: libvirt-0.9.11.3/daemon/libvirtd.c
|
||||
Index: libvirt-0.9.11.4/daemon/libvirtd.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/daemon/libvirtd.c
|
||||
+++ libvirt-0.9.11.3/daemon/libvirtd.c
|
||||
--- libvirt-0.9.11.4.orig/daemon/libvirtd.c
|
||||
+++ libvirt-0.9.11.4/daemon/libvirtd.c
|
||||
@@ -76,6 +76,10 @@
|
||||
# endif
|
||||
# ifdef WITH_NETCF
|
||||
@ -110,11 +110,11 @@ Index: libvirt-0.9.11.3/daemon/libvirtd.c
|
||||
# endif
|
||||
# ifdef WITH_STORAGE_DIR
|
||||
storageRegister();
|
||||
Index: libvirt-0.9.11.3/src/Makefile.am
|
||||
Index: libvirt-0.9.11.4/src/Makefile.am
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/Makefile.am
|
||||
+++ libvirt-0.9.11.3/src/Makefile.am
|
||||
@@ -967,6 +967,24 @@ libvirt_driver_interface_la_LIBADD += ..
|
||||
--- libvirt-0.9.11.4.orig/src/Makefile.am
|
||||
+++ libvirt-0.9.11.4/src/Makefile.am
|
||||
@@ -970,6 +970,24 @@ libvirt_driver_interface_la_LIBADD += ..
|
||||
libvirt_driver_interface_la_LDFLAGS += -module -avoid-version
|
||||
endif
|
||||
libvirt_driver_interface_la_SOURCES = $(INTERFACE_DRIVER_SOURCES)
|
||||
@ -139,10 +139,10 @@ Index: libvirt-0.9.11.3/src/Makefile.am
|
||||
endif
|
||||
|
||||
if WITH_SECRETS
|
||||
Index: libvirt-0.9.11.3/src/interface/netcf_driver.c
|
||||
Index: libvirt-0.9.11.4/src/interface/netcf_driver.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/interface/netcf_driver.c
|
||||
+++ libvirt-0.9.11.3/src/interface/netcf_driver.c
|
||||
--- libvirt-0.9.11.4.orig/src/interface/netcf_driver.c
|
||||
+++ libvirt-0.9.11.4/src/interface/netcf_driver.c
|
||||
@@ -23,7 +23,13 @@
|
||||
|
||||
#include <config.h>
|
||||
@ -208,11 +208,11 @@ Index: libvirt-0.9.11.3/src/interface/netcf_driver.c
|
||||
/* open netcf */
|
||||
if (ncf_init(&driverState->netcf, NULL) != 0)
|
||||
{
|
||||
Index: libvirt-0.9.11.3/tools/virsh.c
|
||||
Index: libvirt-0.9.11.4/tools/virsh.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/tools/virsh.c
|
||||
+++ libvirt-0.9.11.3/tools/virsh.c
|
||||
@@ -19821,6 +19821,10 @@ vshShowVersion(vshControl *ctl ATTRIBUTE
|
||||
--- libvirt-0.9.11.4.orig/tools/virsh.c
|
||||
+++ libvirt-0.9.11.4/tools/virsh.c
|
||||
@@ -19827,6 +19827,10 @@ vshShowVersion(vshControl *ctl ATTRIBUTE
|
||||
#endif
|
||||
#ifdef WITH_NETCF
|
||||
vshPrint(ctl, " Netcf");
|
||||
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 19 17:48:26 MDT 2012 - jfehlig@suse.com
|
||||
|
||||
- Update to libvirt 0.9.11.4 stable release
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 12 14:18:23 MDT 2012 - jfehlig@suse.com
|
||||
|
||||
|
@ -327,7 +327,7 @@ BuildRequires: systemd
|
||||
|
||||
Name: libvirt
|
||||
Url: http://libvirt.org/
|
||||
Version: 0.9.11.3
|
||||
Version: 0.9.11.4
|
||||
Release: 0
|
||||
Summary: A C toolkit to interact with the virtualization capabilities of Linux
|
||||
License: LGPL-2.1+
|
||||
@ -410,8 +410,6 @@ Source1: libvirtd.init
|
||||
Source2: libvirtd-relocation-server.fw
|
||||
Source99: baselibs.conf
|
||||
# Upstream patches
|
||||
Patch0: 9914477e-usb-search-funcs.patch
|
||||
Patch1: 05abd150-usb-improve-hotplug.patch
|
||||
# Need to go upstream
|
||||
Patch100: xen-name-for-devid.patch
|
||||
Patch101: clone.patch
|
||||
@ -547,8 +545,6 @@ Authors:
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch100 -p1
|
||||
%patch101
|
||||
%patch102 -p1
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: libvirt-0.9.11.3/daemon/libvirtd.conf
|
||||
Index: libvirt-0.9.11.4/daemon/libvirtd.conf
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/daemon/libvirtd.conf
|
||||
+++ libvirt-0.9.11.3/daemon/libvirtd.conf
|
||||
--- libvirt-0.9.11.4.orig/daemon/libvirtd.conf
|
||||
+++ libvirt-0.9.11.4/daemon/libvirtd.conf
|
||||
@@ -18,8 +18,8 @@
|
||||
# It is necessary to setup a CA and issue server certificates before
|
||||
# using this capability.
|
||||
@ -13,10 +13,10 @@ Index: libvirt-0.9.11.3/daemon/libvirtd.conf
|
||||
|
||||
# Listen for unencrypted TCP connections on the public TCP/IP port.
|
||||
# NB, must pass the --listen flag to the libvirtd process for this to
|
||||
Index: libvirt-0.9.11.3/daemon/libvirtd.c
|
||||
Index: libvirt-0.9.11.4/daemon/libvirtd.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/daemon/libvirtd.c
|
||||
+++ libvirt-0.9.11.3/daemon/libvirtd.c
|
||||
--- libvirt-0.9.11.4.orig/daemon/libvirtd.c
|
||||
+++ libvirt-0.9.11.4/daemon/libvirtd.c
|
||||
@@ -872,7 +872,7 @@ daemonConfigNew(bool privileged ATTRIBUT
|
||||
return NULL;
|
||||
}
|
||||
|
@ -7,10 +7,10 @@ drivers as loadable modules instead of built-in to the
|
||||
daemon. Then the qemu driver would only be loaded when needed,
|
||||
which would never be the case on a xen-only configuration.
|
||||
|
||||
Index: libvirt-0.9.11.3/src/qemu/qemu_conf.c
|
||||
Index: libvirt-0.9.11.4/src/qemu/qemu_conf.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/qemu/qemu_conf.c
|
||||
+++ libvirt-0.9.11.3/src/qemu/qemu_conf.c
|
||||
--- libvirt-0.9.11.4.orig/src/qemu/qemu_conf.c
|
||||
+++ libvirt-0.9.11.4/src/qemu/qemu_conf.c
|
||||
@@ -271,9 +271,7 @@ int qemudLoadDriverConfig(struct qemud_d
|
||||
return -1;
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
Index: libvirt-0.9.11.3/src/qemu/qemu.conf
|
||||
Index: libvirt-0.9.11.4/src/qemu/qemu.conf
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/qemu/qemu.conf
|
||||
+++ libvirt-0.9.11.3/src/qemu/qemu.conf
|
||||
@@ -136,7 +136,16 @@
|
||||
--- libvirt-0.9.11.4.orig/src/qemu/qemu.conf
|
||||
+++ libvirt-0.9.11.4/src/qemu/qemu.conf
|
||||
@@ -146,7 +146,16 @@
|
||||
# leaving SELinux enabled for the host in general, then set this
|
||||
# to 'none' instead.
|
||||
#
|
||||
@ -13,15 +13,15 @@ Index: libvirt-0.9.11.3/src/qemu/qemu.conf
|
||||
+# instances. Change this to 'apparmor' to enable Apparmor
|
||||
+# confinement of qemu instances.
|
||||
+#
|
||||
# security_driver = "selinux"
|
||||
#security_driver = "selinux"
|
||||
+# security_driver = "apparmor"
|
||||
+security_driver = "none"
|
||||
|
||||
# If set to non-zero, then the default security labeling
|
||||
# will make guests confined. If set to zero, then guests
|
||||
@@ -317,6 +326,15 @@
|
||||
# max_processes = 0
|
||||
# max_files = 0
|
||||
@@ -319,6 +328,15 @@
|
||||
#allow_disk_format_probing = 1
|
||||
|
||||
|
||||
+# SUSE note:
|
||||
+# Many lock managers, sanlock included, will kill the resources
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: libvirt-0.9.11.3/tools/Makefile.am
|
||||
Index: libvirt-0.9.11.4/tools/Makefile.am
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/tools/Makefile.am
|
||||
+++ libvirt-0.9.11.3/tools/Makefile.am
|
||||
--- libvirt-0.9.11.4.orig/tools/Makefile.am
|
||||
+++ libvirt-0.9.11.4/tools/Makefile.am
|
||||
@@ -182,24 +182,22 @@ install-data-local: install-init install
|
||||
uninstall-local: uninstall-init uninstall-systemd
|
||||
|
||||
@ -33,10 +33,10 @@ Index: libvirt-0.9.11.3/tools/Makefile.am
|
||||
|
||||
|
||||
if LIBVIRT_INIT_SCRIPT_RED_HAT
|
||||
Index: libvirt-0.9.11.3/tools/libvirt-guests.sysconf
|
||||
Index: libvirt-0.9.11.4/tools/libvirt-guests.sysconf
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/tools/libvirt-guests.sysconf
|
||||
+++ libvirt-0.9.11.3/tools/libvirt-guests.sysconf
|
||||
--- libvirt-0.9.11.4.orig/tools/libvirt-guests.sysconf
|
||||
+++ libvirt-0.9.11.4/tools/libvirt-guests.sysconf
|
||||
@@ -1,19 +1,29 @@
|
||||
+## Path: System/Virtualization/libvirt
|
||||
+
|
||||
@ -101,10 +101,10 @@ Index: libvirt-0.9.11.3/tools/libvirt-guests.sysconf
|
||||
# some file systems.
|
||||
-#BYPASS_CACHE=0
|
||||
+BYPASS_CACHE=0
|
||||
Index: libvirt-0.9.11.3/tools/libvirt-guests.init.sh
|
||||
Index: libvirt-0.9.11.4/tools/libvirt-guests.init.sh
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/tools/libvirt-guests.init.sh
|
||||
+++ libvirt-0.9.11.3/tools/libvirt-guests.init.sh
|
||||
--- libvirt-0.9.11.4.orig/tools/libvirt-guests.init.sh
|
||||
+++ libvirt-0.9.11.4/tools/libvirt-guests.init.sh
|
||||
@@ -4,10 +4,10 @@
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
@ -230,7 +230,7 @@ Index: libvirt-0.9.11.3/tools/libvirt-guests.init.sh
|
||||
return
|
||||
fi
|
||||
fi
|
||||
@@ -504,14 +526,13 @@ gueststatus() {
|
||||
@@ -508,14 +530,13 @@ gueststatus() {
|
||||
rh_status() {
|
||||
if [ -f "$LISTFILE" ]; then
|
||||
gettext "stopped, with saved guests"; echo
|
||||
@ -246,16 +246,16 @@ Index: libvirt-0.9.11.3/tools/libvirt-guests.init.sh
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -555,4 +576,4 @@ case "$1" in
|
||||
@@ -559,4 +580,4 @@ case "$1" in
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
-exit $RETVAL
|
||||
+rc_exit
|
||||
Index: libvirt-0.9.11.3/daemon/Makefile.am
|
||||
Index: libvirt-0.9.11.4/daemon/Makefile.am
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/daemon/Makefile.am
|
||||
+++ libvirt-0.9.11.3/daemon/Makefile.am
|
||||
--- libvirt-0.9.11.4.orig/daemon/Makefile.am
|
||||
+++ libvirt-0.9.11.4/daemon/Makefile.am
|
||||
@@ -249,22 +249,16 @@ uninstall-logrotate:
|
||||
rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || :
|
||||
|
||||
@ -297,10 +297,10 @@ Index: libvirt-0.9.11.3/daemon/Makefile.am
|
||||
else
|
||||
install-init-redhat:
|
||||
uninstall-init-redhat:
|
||||
Index: libvirt-0.9.11.3/daemon/libvirtd.sysconf
|
||||
Index: libvirt-0.9.11.4/daemon/libvirtd.sysconf
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/daemon/libvirtd.sysconf
|
||||
+++ libvirt-0.9.11.3/daemon/libvirtd.sysconf
|
||||
--- libvirt-0.9.11.4.orig/daemon/libvirtd.sysconf
|
||||
+++ libvirt-0.9.11.4/daemon/libvirtd.sysconf
|
||||
@@ -1,16 +1,25 @@
|
||||
+## Path: System/Virtualization/libvirt
|
||||
+
|
||||
|
@ -13,10 +13,10 @@ Date: Wed Jan 27 16:11:41 2010 -0700
|
||||
This approach allows removing a disk when domain is inactive. We
|
||||
obviously can't search xenstore when the domain is inactive.
|
||||
|
||||
Index: libvirt-0.9.11.3/src/xen/xend_internal.c
|
||||
Index: libvirt-0.9.11.4/src/xen/xend_internal.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/xen/xend_internal.c
|
||||
+++ libvirt-0.9.11.3/src/xen/xend_internal.c
|
||||
--- libvirt-0.9.11.4.orig/src/xen/xend_internal.c
|
||||
+++ libvirt-0.9.11.4/src/xen/xend_internal.c
|
||||
@@ -60,6 +60,7 @@
|
||||
|
||||
static int
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: libvirt-0.9.11.3/src/xenxs/xen_sxpr.c
|
||||
Index: libvirt-0.9.11.4/src/xenxs/xen_sxpr.c
|
||||
===================================================================
|
||||
--- libvirt-0.9.11.3.orig/src/xenxs/xen_sxpr.c
|
||||
+++ libvirt-0.9.11.3/src/xenxs/xen_sxpr.c
|
||||
--- libvirt-0.9.11.4.orig/src/xenxs/xen_sxpr.c
|
||||
+++ libvirt-0.9.11.4/src/xenxs/xen_sxpr.c
|
||||
@@ -340,7 +340,7 @@ error:
|
||||
static int
|
||||
xenParseSxprDisks(virDomainDefPtr def,
|
||||
|
Loading…
Reference in New Issue
Block a user