2013-03-08 20:47:00 +01:00
|
|
|
>From 5aeda96eafd230af55343e7ef835e081ded484aa Mon Sep 17 00:00:00 2001
|
|
|
|
From: Chunyan Liu <cyliu@suse.com>
|
|
|
|
Date: Fri, 25 Jan 2013 17:37:14 +0800
|
|
|
|
Subject: [PATCH] support managed pci devices in xen driver
|
|
|
|
|
|
|
|
---
|
|
|
|
src/xenxs/xen_sxpr.c | 22 ++++++++--------------
|
|
|
|
src/xenxs/xen_xm.c | 28 +++++++++++++++++++++++++++-
|
|
|
|
2 files changed, 35 insertions(+), 15 deletions(-)
|
|
|
|
|
Accepting request 692393 from home:jfehlig:branches:Virtualization
- CVE-2019-3886: disallow virDomainGetHostname and virDomainGetTime
for read-only connections and users
CVE-2019-3886-api.patch, CVE-2019-3886-remote.patch
bsc#1131595
- spec: BuildRequires rpcgen since CVE-2019-3886-remote.patch
touches remote_protocol.x
- Update to libvirt 5.2.0
- Many incremental improvements and bug fixes, see
http://libvirt.org/news.html
- Dropped patches:
4ec3cf9a-apparmor-rules.patch,
f38ef0fa-no-RDMA-check.patch,
411cdaf8-apparmor-check-profile-name.patch,
696239ba-qemu-fix-query-cpus-fast.patch,
09eb1ae0-conf-add-xenbus-controller.patch,
fb059757-libxl-add-xenbus-controller.patch,
ec5a1191-libxl-support-max-grant-frames.patch,
5a64c202-xenconfig-support-max-grant-frames.patch
- Added patches:
ff376c62-tests-fix-mocking-stat-lstat.patch,
mprivozn-test-fix-proposal.patch
OBS-URL: https://build.opensuse.org/request/show/692393
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=745
2019-04-09 00:27:41 +02:00
|
|
|
Index: libvirt-5.2.0/src/xenconfig/xen_common.c
|
2013-03-08 20:47:00 +01:00
|
|
|
===================================================================
|
Accepting request 692393 from home:jfehlig:branches:Virtualization
- CVE-2019-3886: disallow virDomainGetHostname and virDomainGetTime
for read-only connections and users
CVE-2019-3886-api.patch, CVE-2019-3886-remote.patch
bsc#1131595
- spec: BuildRequires rpcgen since CVE-2019-3886-remote.patch
touches remote_protocol.x
- Update to libvirt 5.2.0
- Many incremental improvements and bug fixes, see
http://libvirt.org/news.html
- Dropped patches:
4ec3cf9a-apparmor-rules.patch,
f38ef0fa-no-RDMA-check.patch,
411cdaf8-apparmor-check-profile-name.patch,
696239ba-qemu-fix-query-cpus-fast.patch,
09eb1ae0-conf-add-xenbus-controller.patch,
fb059757-libxl-add-xenbus-controller.patch,
ec5a1191-libxl-support-max-grant-frames.patch,
5a64c202-xenconfig-support-max-grant-frames.patch
- Added patches:
ff376c62-tests-fix-mocking-stat-lstat.patch,
mprivozn-test-fix-proposal.patch
OBS-URL: https://build.opensuse.org/request/show/692393
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=745
2019-04-09 00:27:41 +02:00
|
|
|
--- libvirt-5.2.0.orig/src/xenconfig/xen_common.c
|
|
|
|
+++ libvirt-5.2.0/src/xenconfig/xen_common.c
|
2019-01-16 00:46:12 +01:00
|
|
|
@@ -386,12 +386,19 @@ xenParsePCI(char *entry)
|
2018-07-16 18:42:10 +02:00
|
|
|
int busID;
|
|
|
|
int slotID;
|
|
|
|
int funcID;
|
2014-09-02 17:52:40 +02:00
|
|
|
+ char *opt;
|
|
|
|
+ int managed = 0;
|
|
|
|
|
2018-07-16 18:42:10 +02:00
|
|
|
domain[0] = bus[0] = slot[0] = func[0] = '\0';
|
|
|
|
|
|
|
|
/* pci=['0000:00:1b.0','0000:00:13.0'] */
|
|
|
|
if (!(key = entry))
|
|
|
|
return NULL;
|
2014-09-02 17:52:40 +02:00
|
|
|
+
|
2018-07-16 18:42:10 +02:00
|
|
|
+ opt = strchr(key, ',');
|
|
|
|
+ if (opt)
|
|
|
|
+ opt++;
|
2014-09-02 17:52:40 +02:00
|
|
|
+
|
2018-07-16 18:42:10 +02:00
|
|
|
if (!(nextkey = strchr(key, ':')))
|
|
|
|
return NULL;
|
2018-08-07 00:52:48 +02:00
|
|
|
if (virStrncpy(domain, key, (nextkey - key), sizeof(domain)) < 0) {
|
2019-01-16 00:46:12 +01:00
|
|
|
@@ -436,10 +443,30 @@ xenParsePCI(char *entry)
|
2018-07-16 18:42:10 +02:00
|
|
|
if (virStrToLong_i(func, NULL, 16, &funcID) < 0)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
+ if (opt) {
|
|
|
|
+ char opt_managed[2];
|
|
|
|
+ char *data;
|
2014-09-02 17:52:40 +02:00
|
|
|
+
|
2018-07-16 18:42:10 +02:00
|
|
|
+ opt_managed[0] = '\0';
|
|
|
|
+ data = strchr(opt, '=');
|
|
|
|
+ data++;
|
2014-09-02 17:52:40 +02:00
|
|
|
+
|
2018-07-16 18:42:10 +02:00
|
|
|
+ if (STRPREFIX(opt, "managed=")) {
|
|
|
|
+ if (virStrncpy(opt_managed, data, 1, sizeof(opt_managed)) == NULL) {
|
|
|
|
+ virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
|
|
+ _("managed option %s too big for destination"),
|
|
|
|
+ data);
|
|
|
|
+ return NULL;
|
2014-09-02 17:52:40 +02:00
|
|
|
+ }
|
2018-07-16 18:42:10 +02:00
|
|
|
+ }
|
|
|
|
+ if (virStrToLong_i(opt_managed, NULL, 10, &managed) < 0)
|
|
|
|
+ return NULL;
|
|
|
|
+ }
|
2014-09-02 17:52:40 +02:00
|
|
|
+
|
2018-07-16 18:42:10 +02:00
|
|
|
if (!(hostdev = virDomainHostdevDefNew()))
|
|
|
|
return NULL;
|
2014-09-02 17:52:40 +02:00
|
|
|
|
2018-07-16 18:42:10 +02:00
|
|
|
- hostdev->managed = false;
|
|
|
|
+ hostdev->managed = managed ? true : false;
|
|
|
|
hostdev->source.subsys.type = VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI;
|
|
|
|
hostdev->source.subsys.u.pci.addr.domain = domainID;
|
|
|
|
hostdev->source.subsys.u.pci.addr.bus = busID;
|
Accepting request 692393 from home:jfehlig:branches:Virtualization
- CVE-2019-3886: disallow virDomainGetHostname and virDomainGetTime
for read-only connections and users
CVE-2019-3886-api.patch, CVE-2019-3886-remote.patch
bsc#1131595
- spec: BuildRequires rpcgen since CVE-2019-3886-remote.patch
touches remote_protocol.x
- Update to libvirt 5.2.0
- Many incremental improvements and bug fixes, see
http://libvirt.org/news.html
- Dropped patches:
4ec3cf9a-apparmor-rules.patch,
f38ef0fa-no-RDMA-check.patch,
411cdaf8-apparmor-check-profile-name.patch,
696239ba-qemu-fix-query-cpus-fast.patch,
09eb1ae0-conf-add-xenbus-controller.patch,
fb059757-libxl-add-xenbus-controller.patch,
ec5a1191-libxl-support-max-grant-frames.patch,
5a64c202-xenconfig-support-max-grant-frames.patch
- Added patches:
ff376c62-tests-fix-mocking-stat-lstat.patch,
mprivozn-test-fix-proposal.patch
OBS-URL: https://build.opensuse.org/request/show/692393
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=745
2019-04-09 00:27:41 +02:00
|
|
|
Index: libvirt-5.2.0/src/xenconfig/xen_sxpr.c
|
2014-09-02 17:52:40 +02:00
|
|
|
===================================================================
|
Accepting request 692393 from home:jfehlig:branches:Virtualization
- CVE-2019-3886: disallow virDomainGetHostname and virDomainGetTime
for read-only connections and users
CVE-2019-3886-api.patch, CVE-2019-3886-remote.patch
bsc#1131595
- spec: BuildRequires rpcgen since CVE-2019-3886-remote.patch
touches remote_protocol.x
- Update to libvirt 5.2.0
- Many incremental improvements and bug fixes, see
http://libvirt.org/news.html
- Dropped patches:
4ec3cf9a-apparmor-rules.patch,
f38ef0fa-no-RDMA-check.patch,
411cdaf8-apparmor-check-profile-name.patch,
696239ba-qemu-fix-query-cpus-fast.patch,
09eb1ae0-conf-add-xenbus-controller.patch,
fb059757-libxl-add-xenbus-controller.patch,
ec5a1191-libxl-support-max-grant-frames.patch,
5a64c202-xenconfig-support-max-grant-frames.patch
- Added patches:
ff376c62-tests-fix-mocking-stat-lstat.patch,
mprivozn-test-fix-proposal.patch
OBS-URL: https://build.opensuse.org/request/show/692393
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=745
2019-04-09 00:27:41 +02:00
|
|
|
--- libvirt-5.2.0.orig/src/xenconfig/xen_sxpr.c
|
|
|
|
+++ libvirt-5.2.0/src/xenconfig/xen_sxpr.c
|
2019-01-16 00:46:12 +01:00
|
|
|
@@ -1053,6 +1053,7 @@ xenParseSxprPCI(virDomainDefPtr def,
|
2013-03-08 20:47:00 +01:00
|
|
|
int busID;
|
|
|
|
int slotID;
|
|
|
|
int funcID;
|
2013-05-02 21:17:46 +02:00
|
|
|
+ bool managed;
|
2013-03-08 20:47:00 +01:00
|
|
|
|
|
|
|
node = cur->u.s.car;
|
|
|
|
if (!sexpr_lookup(node, "dev"))
|
2019-01-16 00:46:12 +01:00
|
|
|
@@ -1100,11 +1101,13 @@ xenParseSxprPCI(virDomainDefPtr def,
|
2013-03-08 20:47:00 +01:00
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ managed = sexpr_int(node, "dev/opts/managed");
|
|
|
|
+
|
2017-12-01 23:52:01 +01:00
|
|
|
if (!(dev = virDomainHostdevDefNew()))
|
2013-03-08 20:47:00 +01:00
|
|
|
goto error;
|
|
|
|
|
|
|
|
dev->mode = VIR_DOMAIN_HOSTDEV_MODE_SUBSYS;
|
2013-05-02 21:17:46 +02:00
|
|
|
- dev->managed = false;
|
|
|
|
+ dev->managed = managed ? true : false;
|
2013-03-08 20:47:00 +01:00
|
|
|
dev->source.subsys.type = VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI;
|
2013-05-02 21:17:46 +02:00
|
|
|
dev->source.subsys.u.pci.addr.domain = domainID;
|
|
|
|
dev->source.subsys.u.pci.addr.bus = busID;
|
Accepting request 681981 from home:jfehlig:branches:Virtualization
- Update to libvirt 5.1.0
- Many incremental improvements and bug fixes, see
http://libvirt.org/news.html
- Dropped patches:
11c8aca9-libxl-set-mem-after-balloon.patch,
70c2933d-apparmor-named-profiles.patch,
a3ab6d42-apparmor-conv-libvirtd-named-profile.patch,
b6440119-qemu-conf-sev.patch,
a404ac34-qemu-cgroup-sev.patch,
6fd4c8f8-qemu-domain-sev.patch,
17f6a257-security-dac-sev.patch,
a2d3dea9-qemu-caps-dac-override-sev.patch,
620d9dd5-qemu-no-dac-override-nonroot.patch
- jsc#SLE-3887, jsc#SLE-4480, jsc#SLE-4577
OBS-URL: https://build.opensuse.org/request/show/681981
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=734
2019-03-06 03:00:59 +01:00
|
|
|
@@ -1962,11 +1965,15 @@ static void
|
2013-03-08 20:47:00 +01:00
|
|
|
xenFormatSxprPCI(virDomainHostdevDefPtr def,
|
|
|
|
virBufferPtr buf)
|
|
|
|
{
|
|
|
|
- virBufferAsprintf(buf, "(dev (domain 0x%04x)(bus 0x%02x)(slot 0x%02x)(func 0x%x))",
|
|
|
|
+ virBufferAsprintf(buf, "(dev (domain 0x%04x)(bus 0x%02x)(slot 0x%02x)(func 0x%x)",
|
2013-05-02 21:17:46 +02:00
|
|
|
def->source.subsys.u.pci.addr.domain,
|
|
|
|
def->source.subsys.u.pci.addr.bus,
|
|
|
|
def->source.subsys.u.pci.addr.slot,
|
|
|
|
def->source.subsys.u.pci.addr.function);
|
|
|
|
+
|
2013-03-08 20:47:00 +01:00
|
|
|
+ if (def->managed)
|
|
|
|
+ virBufferAddLit(buf, "(opts (managed 1))");
|
|
|
|
+ virBufferAddLit(buf, ")");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Accepting request 681981 from home:jfehlig:branches:Virtualization
- Update to libvirt 5.1.0
- Many incremental improvements and bug fixes, see
http://libvirt.org/news.html
- Dropped patches:
11c8aca9-libxl-set-mem-after-balloon.patch,
70c2933d-apparmor-named-profiles.patch,
a3ab6d42-apparmor-conv-libvirtd-named-profile.patch,
b6440119-qemu-conf-sev.patch,
a404ac34-qemu-cgroup-sev.patch,
6fd4c8f8-qemu-domain-sev.patch,
17f6a257-security-dac-sev.patch,
a2d3dea9-qemu-caps-dac-override-sev.patch,
620d9dd5-qemu-no-dac-override-nonroot.patch
- jsc#SLE-3887, jsc#SLE-4480, jsc#SLE-4577
OBS-URL: https://build.opensuse.org/request/show/681981
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=734
2019-03-06 03:00:59 +01:00
|
|
|
@@ -1985,12 +1992,6 @@ xenFormatSxprOnePCI(virDomainHostdevDefP
|
2013-03-08 20:47:00 +01:00
|
|
|
virBufferPtr buf,
|
|
|
|
int detach)
|
|
|
|
{
|
|
|
|
- if (def->managed) {
|
|
|
|
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
|
|
- _("managed PCI devices not supported with XenD"));
|
|
|
|
- return -1;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
virBufferAddLit(buf, "(pci ");
|
|
|
|
xenFormatSxprPCI(def, buf);
|
|
|
|
if (detach)
|
Accepting request 681981 from home:jfehlig:branches:Virtualization
- Update to libvirt 5.1.0
- Many incremental improvements and bug fixes, see
http://libvirt.org/news.html
- Dropped patches:
11c8aca9-libxl-set-mem-after-balloon.patch,
70c2933d-apparmor-named-profiles.patch,
a3ab6d42-apparmor-conv-libvirtd-named-profile.patch,
b6440119-qemu-conf-sev.patch,
a404ac34-qemu-cgroup-sev.patch,
6fd4c8f8-qemu-domain-sev.patch,
17f6a257-security-dac-sev.patch,
a2d3dea9-qemu-caps-dac-override-sev.patch,
620d9dd5-qemu-no-dac-override-nonroot.patch
- jsc#SLE-3887, jsc#SLE-4480, jsc#SLE-4577
OBS-URL: https://build.opensuse.org/request/show/681981
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=734
2019-03-06 03:00:59 +01:00
|
|
|
@@ -2045,12 +2046,6 @@ xenFormatSxprAllPCI(virDomainDefPtr def,
|
2013-06-05 00:48:46 +02:00
|
|
|
for (i = 0; i < def->nhostdevs; i++) {
|
2013-03-08 20:47:00 +01:00
|
|
|
if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
|
|
|
def->hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) {
|
|
|
|
- if (def->hostdevs[i]->managed) {
|
|
|
|
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
|
|
- _("managed PCI devices not supported with XenD"));
|
|
|
|
- return -1;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
xenFormatSxprPCI(def->hostdevs[i], buf);
|
|
|
|
}
|
|
|
|
}
|