SHA256
1
0
forked from pool/libvirt

Accepting request 768470 from home:jfehlig:branches:Virtualization

- xen: Support setting credit2 scheduler parameters
  849052ec-libxl-support-credit2.patch
  bsc#1162160

OBS-URL: https://build.opensuse.org/request/show/768470
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=799
This commit is contained in:
James Fehlig 2020-01-30 02:25:04 +00:00 committed by Git OBS Bridge
parent ae4fdc4994
commit e9a0597b64
7 changed files with 89 additions and 12 deletions

View File

@ -23,7 +23,7 @@ Index: libvirt-6.0.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-6.0.0.orig/src/libxl/libxl_driver.c
+++ libvirt-6.0.0/src/libxl/libxl_driver.c
@@ -5275,6 +5275,96 @@ libxlDomainMemoryStats(virDomainPtr dom,
@@ -5280,6 +5280,96 @@ libxlDomainMemoryStats(virDomainPtr dom,
#undef LIBXL_SET_MEMSTAT
@ -120,7 +120,7 @@ Index: libvirt-6.0.0/src/libxl/libxl_driver.c
static int
libxlDomainGetJobInfo(virDomainPtr dom,
virDomainJobInfoPtr info)
@@ -6693,6 +6783,7 @@ static virHypervisorDriver libxlHypervis
@@ -6698,6 +6788,7 @@ static virHypervisorDriver libxlHypervis
#endif
.nodeGetFreeMemory = libxlNodeGetFreeMemory, /* 0.9.0 */
.nodeGetCellsFreeMemory = libxlNodeGetCellsFreeMemory, /* 1.1.1 */

View File

@ -12,11 +12,11 @@ Date: Sat Jan 18 03:37:42 2020 +0100
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index ef02a066d9..eb166244ba 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -648,8 +648,8 @@ libxlAddDom0(libxlDriverPrivatePtr driver)
Index: libvirt-6.0.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-6.0.0.orig/src/libxl/libxl_driver.c
+++ libvirt-6.0.0/src/libxl/libxl_driver.c
@@ -648,8 +648,8 @@ libxlAddDom0(libxlDriverPrivatePtr drive
static int
libxlStateInitialize(bool privileged,

View File

@ -0,0 +1,68 @@
commit 849052ec61e18780713bec171748e859e32dfd6d
Author: Dario Faggioli <dfaggioli@suse.com>
Date: Wed Jan 29 12:05:15 2020 +0100
libxl: support getting and setting parameters for the Credit2
With Credit2 being Xen default scheduler, it's definitely the case to
allow Credit2's scheduling parameters to be get and set via libvirt.
This is easy, as Credit and Credit2 have (at least as of now) the very
same parameters ('weight' and 'cap'). So we can just let credit2 pass
the scheduler-type check and the same code will work for both.
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Index: libvirt-6.0.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-6.0.0.orig/src/libxl/libxl_driver.c
+++ libvirt-6.0.0/src/libxl/libxl_driver.c
@@ -73,7 +73,7 @@ VIR_LOG_INIT("libxl.libxl_driver");
#define HYPERVISOR_CAPABILITIES "/proc/xen/capabilities"
#define HYPERVISOR_XENSTORED "/dev/xen/xenstored"
-/* Number of Xen scheduler parameters */
+/* Number of Xen scheduler parameters. credit and credit2 both support 2 */
#define XEN_SCHED_CREDIT_NPARAM 2
#define LIBXL_CHECK_DOM0_GOTO(name, label) \
@@ -4579,6 +4579,8 @@ libxlDomainGetSchedulerType(virDomainPtr
break;
case LIBXL_SCHEDULER_CREDIT2:
name = "credit2";
+ if (nparams)
+ *nparams = XEN_SCHED_CREDIT_NPARAM;
break;
case LIBXL_SCHEDULER_ARINC653:
name = "arinc653";
@@ -4625,11 +4627,11 @@ libxlDomainGetSchedulerParametersFlags(v
if (virDomainObjCheckActive(vm) < 0)
goto cleanup;
+ /* Only credit and credit2 are supported for now. */
sched_id = libxl_get_scheduler(cfg->ctx);
-
- if (sched_id != LIBXL_SCHEDULER_CREDIT) {
+ if (sched_id != LIBXL_SCHEDULER_CREDIT && sched_id != LIBXL_SCHEDULER_CREDIT2) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Only 'credit' scheduler is supported"));
+ _("Only 'credit' and 'credit2' schedulers are supported"));
goto cleanup;
}
@@ -4702,11 +4704,11 @@ libxlDomainSetSchedulerParametersFlags(v
if (virDomainObjCheckActive(vm) < 0)
goto endjob;
+ /* Only credit and credit2 are supported for now. */
sched_id = libxl_get_scheduler(cfg->ctx);
-
- if (sched_id != LIBXL_SCHEDULER_CREDIT) {
+ if (sched_id != LIBXL_SCHEDULER_CREDIT && sched_id != LIBXL_SCHEDULER_CREDIT2) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Only 'credit' scheduler is supported"));
+ _("Only 'credit' and 'credit2' schedulers are supported"));
goto endjob;
}

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jan 30 00:45:39 UTC 2020 - James Fehlig <jfehlig@suse.com>
- xen: Support setting credit2 scheduler parameters
849052ec-libxl-support-credit2.patch
bsc#1162160
-------------------------------------------------------------------
Wed Jan 29 20:56:13 UTC 2020 - James Fehlig <jfehlig@suse.com>

View File

@ -339,6 +339,7 @@ Source99: baselibs.conf
Source100: %{name}-rpmlintrc
# Upstream patches
Patch0: 6c1dddaf-libxl-shutdown-inhibit.patch
Patch1: 849052ec-libxl-support-credit2.patch
# Patches pending upstream review
Patch100: libxl-dom-reset.patch
Patch101: network-don-t-use-dhcp-authoritative-on-static-netwo.patch
@ -873,6 +874,7 @@ libvirt plugin for NSS for translating domain names into IP addresses.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch100 -p1
%patch101 -p1
%patch150 -p1

View File

@ -12,7 +12,7 @@ Index: libvirt-6.0.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-6.0.0.orig/src/libxl/libxl_driver.c
+++ libvirt-6.0.0/src/libxl/libxl_driver.c
@@ -1361,6 +1361,61 @@ libxlDomainReboot(virDomainPtr dom, unsi
@@ -1364,6 +1364,61 @@ libxlDomainReboot(virDomainPtr dom, unsi
}
static int
@ -74,7 +74,7 @@ Index: libvirt-6.0.0/src/libxl/libxl_driver.c
libxlDomainDestroyFlags(virDomainPtr dom,
unsigned int flags)
{
@@ -6568,6 +6623,7 @@ static virHypervisorDriver libxlHypervis
@@ -6573,6 +6628,7 @@ static virHypervisorDriver libxlHypervis
.domainShutdown = libxlDomainShutdown, /* 0.9.0 */
.domainShutdownFlags = libxlDomainShutdownFlags, /* 0.9.10 */
.domainReboot = libxlDomainReboot, /* 0.9.0 */

View File

@ -56,7 +56,7 @@ Index: libvirt-6.0.0/src/libxl/libxl_driver.c
===================================================================
--- libvirt-6.0.0.orig/src/libxl/libxl_driver.c
+++ libvirt-6.0.0/src/libxl/libxl_driver.c
@@ -6133,6 +6133,9 @@ libxlDomainMigratePerform3Params(virDoma
@@ -6138,6 +6138,9 @@ libxlDomainMigratePerform3Params(virDoma
const char *dname = NULL;
const char *uri = NULL;
int ret = -1;
@ -66,7 +66,7 @@ Index: libvirt-6.0.0/src/libxl/libxl_driver.c
#ifdef LIBXL_HAVE_NO_SUSPEND_RESUME
virReportUnsupportedError();
@@ -6149,6 +6152,18 @@ libxlDomainMigratePerform3Params(virDoma
@@ -6154,6 +6157,18 @@ libxlDomainMigratePerform3Params(virDoma
virTypedParamsGetString(params, nparams,
VIR_MIGRATE_PARAM_DEST_NAME,
&dname) < 0 ||
@ -85,7 +85,7 @@ Index: libvirt-6.0.0/src/libxl/libxl_driver.c
virTypedParamsGetString(params, nparams,
VIR_MIGRATE_PARAM_URI,
&uri) < 0)
@@ -6163,11 +6178,11 @@ libxlDomainMigratePerform3Params(virDoma
@@ -6168,11 +6183,11 @@ libxlDomainMigratePerform3Params(virDoma
if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) {
if (libxlDomainMigrationSrcPerformP2P(driver, vm, dom->conn, dom_xml,