forked from pool/libvirt
278a149fdc
Note: tarball verification is now done using %gpg_verify, along with the .asc file the upstream libvirt maintainer now generates for each release. This approach requires using the upstream .gz tarball, which is slightly larger than the regenerated .bz2 one. - Update to libvirt 1.2.9 - Introduce virNodeAllocPages - event: introduce new event for tunable values - Add support for fetching statistics of completed jobs - CVE-2014-3657: domain_conf: fix domain deadlock - CVE-2014-3633: qemu: blkiotune: Use correct definition when looking up disk - Many incremental improvements and bug fixes, see http://libvirt.org/news.html - Drop upstream patches: 3e745e8f-CVE-2014-3633.patch, libvirt-guests-wait-for-ntp.patch - Verify tarball with associated .asc file Add: libvirt.keyring, libvirt-1.2.9.tar.gz.asc Use upstream .gz tarball instead of locally generated .bz2 OBS-URL: https://build.opensuse.org/request/show/253577 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=411
43 lines
1.7 KiB
Diff
43 lines
1.7 KiB
Diff
Fix PCI device attach in xend driver
|
|
|
|
When attaching PCI device using the xend driver, the 'device_create'
|
|
RPC is called, which is not sufficient to fully prepare/configure
|
|
the device for attachment to a domain. In the xen tools, xm pci-attach
|
|
uses the 'device_configure' RPC.
|
|
|
|
This patch changes the xend driver to always call 'device_configure' for
|
|
PCI devices to be consistent with the usage in the xen tools.
|
|
|
|
Index: libvirt-1.2.9/src/xen/xend_internal.c
|
|
===================================================================
|
|
--- libvirt-1.2.9.orig/src/xen/xend_internal.c
|
|
+++ libvirt-1.2.9/src/xen/xend_internal.c
|
|
@@ -2221,6 +2221,7 @@ xenDaemonAttachDeviceFlags(virConnectPtr
|
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
|
char class[8], ref[80];
|
|
char *target = NULL;
|
|
+ int new_dev;
|
|
|
|
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1);
|
|
|
|
@@ -2319,8 +2320,18 @@ xenDaemonAttachDeviceFlags(virConnectPtr
|
|
}
|
|
|
|
sexpr = virBufferContentAndReset(&buf);
|
|
+ new_dev = virDomainXMLDevID(conn, minidef, dev, class, ref, sizeof(ref));
|
|
|
|
- if (virDomainXMLDevID(conn, minidef, dev, class, ref, sizeof(ref))) {
|
|
+ /* always call 'device_configure' for pci device */
|
|
+ if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV &&
|
|
+ dev->data.hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
|
+ dev->data.hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) {
|
|
+ ret = xend_op(conn, def->name, "op", "device_configure",
|
|
+ "config", sexpr, "dev", ref, NULL);
|
|
+ goto cleanup;
|
|
+ }
|
|
+
|
|
+ if (new_dev) {
|
|
/* device doesn't exist, define it */
|
|
ret = xend_op(conn, def->name, "op", "device_create",
|
|
"config", sexpr, NULL);
|