xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: dongxiao.xu@intel.com
To: xen-devel@lists.xen.org
Subject: [PATCH 3/8] tools: handle CQM resource when creating/destroying guests
Date: Wed, 20 Nov 2013 11:27:33 +0800	[thread overview]
Message-ID: <1384918058-128466-4-git-send-email-dongxiao.xu@intel.com> (raw)
In-Reply-To: <1384918058-128466-1-git-send-email-dongxiao.xu@intel.com>

From: Dongxiao Xu <dongxiao.xu@intel.com>

If a guest is created with parameter "pqos_cqm" set to 1, an RMID
will be allocated to the guest. This RMID will be relinquished when
guest is destroyed.

Signed-off-by: Jiongxi Li <jiongxi.li@intel.com>
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 tools/libxl/libxl_create.c  |    3 +++
 tools/libxl/libxl_types.idl |    1 +
 tools/libxl/xl_cmdimpl.c    |    2 ++
 3 files changed, 6 insertions(+)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 5e9cdcc..454c69d 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -40,6 +40,8 @@ int libxl__domain_create_info_setdefault(libxl__gc *gc,
 
     libxl_defbool_setdefault(&c_info->run_hotplug_scripts, true);
 
+    libxl_defbool_setdefault(&c_info->pqos_cqm, false);
+
     return 0;
 }
 
@@ -454,6 +456,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_create_info *info,
         }
         flags |= XEN_DOMCTL_CDF_hap;
     }
+    flags |= libxl_defbool_val(info->pqos_cqm) ? XEN_DOMCTL_CDF_pqos_cqm : 0;
     *domid = -1;
 
     /* Ultimately, handle is an array of 16 uint8_t, same as uuid */
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index de5bac3..22688d8 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -275,6 +275,7 @@ libxl_domain_create_info = Struct("domain_create_info",[
     ("poolid",       uint32),
     ("run_hotplug_scripts",libxl_defbool),
     ("pvh",          libxl_defbool),
+    ("pqos_cqm",     libxl_defbool),
     ], dir=DIR_IN)
 
 libxl_domain_restore_params = Struct("domain_restore_params", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 8690ec7..84a604f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -670,6 +670,8 @@ static void parse_config_data(const char *config_source,
         exit(1);
     }
 
+    xlu_cfg_get_defbool(config, "pqos_cqm", &c_info->pqos_cqm, 0);
+
     libxl_domain_build_info_init_type(b_info, c_info->type);
     if (blkdev_start)
         b_info->blkdev_start = strdup(blkdev_start);
-- 
1.7.9.5

  parent reply	other threads:[~2013-11-20  3:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20  3:27 [PATCH 0/8] enable Cache QoS Monitoring (CQM) feature dongxiao.xu
2013-11-20  3:27 ` [PATCH 1/8] x86: detect and initialize Cache QoS Monitoring feature dongxiao.xu
2013-11-20 11:11   ` Andrew Cooper
2013-11-20 12:40     ` Xu, Dongxiao
2013-11-20  3:27 ` [PATCH 2/8] x86: handle CQM resource when creating/destroying guests dongxiao.xu
2013-11-20 11:32   ` Andrew Cooper
2013-11-20 12:49     ` Xu, Dongxiao
2013-11-20  3:27 ` dongxiao.xu [this message]
2013-11-20  3:27 ` [PATCH 4/8] x86: dynamically attach/detach CQM service for a guest dongxiao.xu
2013-11-20 11:44   ` Andrew Cooper
2013-11-20 13:19     ` Xu, Dongxiao
2013-11-20  3:27 ` [PATCH 5/8] tools: " dongxiao.xu
2013-11-20  3:27 ` [PATCH 6/8] x86: get per domain CQM information dongxiao.xu
2013-11-20 11:56   ` Andrew Cooper
2013-11-20 13:22     ` Xu, Dongxiao
2013-11-20  3:27 ` [PATCH 7/8] tools: " dongxiao.xu
2013-11-20  3:27 ` [PATCH 8/8] x86: enable CQM monitoring for each domain RMID dongxiao.xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1384918058-128466-4-git-send-email-dongxiao.xu@intel.com \
    --to=dongxiao.xu@intel.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).