xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: ian.jackson@eu.citrix.com, xen-devel@lists.xensource.com,
	george.dunlap@eu.citrix.com
Subject: [PATCH 2/2] expert_mode: Add a new configuration option for expert users.
Date: Fri, 12 Jul 2013 14:08:52 -0400	[thread overview]
Message-ID: <1373652532-24166-3-git-send-email-konrad.wilk@oracle.com> (raw)
In-Reply-To: <1373652532-24166-1-git-send-email-konrad.wilk@oracle.com>

This could also be called 'seatbelt' option.

libxl has a variety of checks where it will fail out an operation
unless the user has provided an --force (or --ignore) parameter.
Currently one such check is for the 'vcpu-set' command which
will error out if the count of virtual cpus is greater than the
physical cpus. This parameter will ignore such checks and allow
the user to do the operations without the need for override flags.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 docs/man/xl.conf.pod.5   |   24 ++++++++++++++++++++++++
 tools/examples/xl.conf   |    6 ++++++
 tools/libxl/xl.c         |    4 ++++
 tools/libxl/xl.h         |    1 +
 tools/libxl/xl_cmdimpl.c |    6 ++++++
 5 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/docs/man/xl.conf.pod.5 b/docs/man/xl.conf.pod.5
index 125f786..ed67472 100644
--- a/docs/man/xl.conf.pod.5
+++ b/docs/man/xl.conf.pod.5
@@ -158,6 +158,30 @@ massively huge guests).
 
 =back
 
+=item B<expert_mode=BOOLEAN>
+
+Do not act on host performed checks that might lead to performance
+degradations. Currently checks are made for following operations:
+ - C<vcpu-set> - if the number of VCPUs set for a guest is higher than the
+   physical count the operation will error out.
+
+
+Default: C<1>
+
+=over 4
+
+=item C<0>
+
+The checks are active and the operation will fail if the checks
+are triggered.
+
+=item C<1>
+
+The checks are active but will be ignored and the operations
+will commence.
+
+=back
+
 =back
 
 =head1 SEE ALSO
diff --git a/tools/examples/xl.conf b/tools/examples/xl.conf
index a80b8e7..6f27d67 100644
--- a/tools/examples/xl.conf
+++ b/tools/examples/xl.conf
@@ -33,3 +33,9 @@
 # (which can take a long time to find out if launching huge guests).
 # see xl.conf(5) for details.
 claim_mode=1
+
+# The user knows what to do. Currently enabling this option will mean that:
+#  vcpu-set won't check the physical CPU count - which means the guest can
+#           over-subscribe (more vCPUS than pCPUS).
+# see xl.conf(5) for details.
+expert_mode=1
diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index 1ce820c..4063b7c 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -47,6 +47,7 @@ char *default_bridge = NULL;
 char *default_gatewaydev = NULL;
 enum output_format default_output_format = OUTPUT_FORMAT_JSON;
 int claim_mode = 0;
+int expert_mode = 0;
 
 static xentoollog_level minmsglevel = XTL_PROGRESS;
 
@@ -173,6 +174,9 @@ static void parse_global_config(const char *configfile,
     if (!xlu_cfg_get_long (config, "claim_mode", &l, 0))
         claim_mode = l;
 
+    if (!xlu_cfg_get_long (config, "expert_mode", &l, 0))
+        expert_mode = l;
+
     xlu_cfg_destroy(config);
 }
 
diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
index 5ad3e17..51b7008 100644
--- a/tools/libxl/xl.h
+++ b/tools/libxl/xl.h
@@ -147,6 +147,7 @@ extern int autoballoon;
 extern int run_hotplug_scripts;
 extern int dryrun_only;
 extern int claim_mode;
+extern int expert_mode;
 extern char *lockfile;
 extern char *default_vifscript;
 extern char *default_bridge;
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 8a478ba..a55c66a 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4560,6 +4560,12 @@ int main_vcpuset(int argc, char **argv)
         break;
     }
 
+    /*
+     * No seatbelts for the user.
+     */
+    if (expert_mode)
+        check_host = 0;
+
     vcpuset(find_domain(argv[optind]), argv[optind + 1], check_host);
     return 0;
 }
-- 
1.7.7.6

  parent reply	other threads:[~2013-07-12 18:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-12 18:08 [PATCH] xl.conf defaults changes for Xen 4.4. (v1) Konrad Rzeszutek Wilk
2013-07-12 18:08 ` [PATCH 1/2] claim: By default enable it Konrad Rzeszutek Wilk
2013-07-16  9:03   ` Ian Campbell
2013-07-12 18:08 ` Konrad Rzeszutek Wilk [this message]
2013-07-16  9:04   ` [PATCH 2/2] expert_mode: Add a new configuration option for expert users Ian Campbell
2013-07-16 15:21     ` Konrad Rzeszutek Wilk
2013-07-17 10:56     ` Ian Jackson
2013-07-17 11:03       ` George Dunlap
2013-07-17 11:12         ` Ian Campbell
2013-07-17 11:13           ` George Dunlap
2013-07-17 17:17       ` Konrad Rzeszutek Wilk
2013-07-18 11:08         ` George Dunlap

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=1373652532-24166-3-git-send-email-konrad.wilk@oracle.com \
    --to=konrad@kernel.org \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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).