diff mbox

[v2] tools/libxl: include scheduler parameters in the output of xl list -l

Message ID 20170105100834.5520-1-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Pau Monné Jan. 5, 2017, 10:08 a.m. UTC
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reported-by: Fatih Acar <fatih@gandi.net>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
---
This should be backported to all supported stable branches (4.6, 4.7, 4.8).
---
Changes since v1:
 - Move fetching the scheduler parameters before device configuration.
 - Call libxl_domain_sched_params_dispose before fetching the parameters.
---
 tools/libxl/libxl.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Wei Liu Jan. 5, 2017, 10:52 a.m. UTC | #1
On Thu, Jan 05, 2017 at 10:08:34AM +0000, Roger Pau Monne wrote:
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> Reported-by: Fatih Acar <fatih@gandi.net>

Acked-by: Wei Liu <wei.liu2@citrix.com>
diff mbox

Patch

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 6fd4fe1..c5d67c1 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -6844,6 +6844,17 @@  int libxl_retrieve_domain_configuration(libxl_ctx *ctx, uint32_t domid,
         d_config->b_info.max_memkb = max_memkb;
     }
 
+    /* Scheduler params */
+    {
+        libxl_domain_sched_params_dispose(&d_config->b_info.sched_params);
+        rc = libxl_domain_sched_params_get(ctx, domid,
+                                           &d_config->b_info.sched_params);
+        if (rc) {
+            LOGD(ERROR, domid, "Fail to get scheduler parameters");
+            goto out;
+        }
+    }
+
     /* Devices: disk, nic, vtpm, pcidev etc. */
 
     /* The MERGE macro implements following logic: