|
|
e10da2 |
From bf945ee97b72d3b0c4fc2da04530f5294f529d66 Mon Sep 17 00:00:00 2001
|
|
|
e10da2 |
From: Eric Blake <eblake@redhat.com>
|
|
|
e10da2 |
Date: Wed, 29 Sep 2010 15:20:23 -0600
|
|
|
e10da2 |
Subject: [PATCH 08/15] vcpu: add virsh support
|
|
|
e10da2 |
|
|
|
e10da2 |
* tools/virsh.c (cmdSetvcpus): Add new flags. Let invalid
|
|
|
e10da2 |
commands through to driver, to ease testing of hypervisor argument
|
|
|
e10da2 |
validation.
|
|
|
e10da2 |
(cmdMaxvcpus, cmdVcpucount): New commands.
|
|
|
e10da2 |
(commands): Add new commands.
|
|
|
e10da2 |
* tools/virsh.pod (setvcpus, vcpucount, maxvcpus): Document new
|
|
|
e10da2 |
behavior.
|
|
|
e10da2 |
---
|
|
|
e10da2 |
tools/virsh.c | 247 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
|
|
|
e10da2 |
tools/virsh.pod | 38 ++++++++-
|
|
|
e10da2 |
2 files changed, 262 insertions(+), 23 deletions(-)
|
|
|
e10da2 |
|
|
|
e10da2 |
diff --git a/tools/virsh.c b/tools/virsh.c
|
|
|
e10da2 |
index 4f8c495..7fb7fbd 100644
|
|
|
e10da2 |
--- a/tools/virsh.c
|
|
|
e10da2 |
+++ b/tools/virsh.c
|
|
|
e10da2 |
@@ -2281,10 +2281,216 @@ cmdFreecell(vshControl *ctl, const vshCmd *cmd)
|
|
|
e10da2 |
}
|
|
|
e10da2 |
|
|
|
e10da2 |
/*
|
|
|
e10da2 |
+ * "maxvcpus" command
|
|
|
e10da2 |
+ */
|
|
|
e10da2 |
+static const vshCmdInfo info_maxvcpus[] = {
|
|
|
e10da2 |
+ {"help", N_("connection vcpu maximum")},
|
|
|
e10da2 |
+ {"desc", N_("Show maximum number of virtual CPUs for guests on this connection.")},
|
|
|
e10da2 |
+ {NULL, NULL}
|
|
|
e10da2 |
+};
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+static const vshCmdOptDef opts_maxvcpus[] = {
|
|
|
e10da2 |
+ {"type", VSH_OT_STRING, 0, N_("domain type")},
|
|
|
e10da2 |
+ {NULL, 0, 0, NULL}
|
|
|
e10da2 |
+};
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+static int
|
|
|
e10da2 |
+cmdMaxvcpus(vshControl *ctl, const vshCmd *cmd)
|
|
|
e10da2 |
+{
|
|
|
e10da2 |
+ char *type;
|
|
|
e10da2 |
+ int vcpus;
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ type = vshCommandOptString(cmd, "type", NULL);
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ if (!vshConnectionUsability(ctl, ctl->conn))
|
|
|
e10da2 |
+ return FALSE;
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ vcpus = virConnectGetMaxVcpus(ctl->conn, type);
|
|
|
e10da2 |
+ if (vcpus < 0)
|
|
|
e10da2 |
+ return FALSE;
|
|
|
e10da2 |
+ vshPrint(ctl, "%d\n", vcpus);
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ return TRUE;
|
|
|
e10da2 |
+}
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+/*
|
|
|
e10da2 |
+ * "vcpucount" command
|
|
|
e10da2 |
+ */
|
|
|
e10da2 |
+static const vshCmdInfo info_vcpucount[] = {
|
|
|
e10da2 |
+ {"help", N_("domain vcpu counts")},
|
|
|
e10da2 |
+ {"desc", N_("Returns the number of virtual CPUs used by the domain.")},
|
|
|
e10da2 |
+ {NULL, NULL}
|
|
|
e10da2 |
+};
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+static const vshCmdOptDef opts_vcpucount[] = {
|
|
|
e10da2 |
+ {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")},
|
|
|
e10da2 |
+ {"maximum", VSH_OT_BOOL, 0, N_("get maximum cap on vcpus")},
|
|
|
e10da2 |
+ {"current", VSH_OT_BOOL, 0, N_("get current vcpu usage")},
|
|
|
e10da2 |
+ {"config", VSH_OT_BOOL, 0, N_("get value to be used on next boot")},
|
|
|
e10da2 |
+ {"live", VSH_OT_BOOL, 0, N_("get value from running domain")},
|
|
|
e10da2 |
+ {NULL, 0, 0, NULL}
|
|
|
e10da2 |
+};
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+static int
|
|
|
e10da2 |
+cmdVcpucount(vshControl *ctl, const vshCmd *cmd)
|
|
|
e10da2 |
+{
|
|
|
e10da2 |
+ virDomainPtr dom;
|
|
|
e10da2 |
+ int ret = TRUE;
|
|
|
e10da2 |
+ int maximum = vshCommandOptBool(cmd, "maximum");
|
|
|
e10da2 |
+ int current = vshCommandOptBool(cmd, "current");
|
|
|
e10da2 |
+ int config = vshCommandOptBool(cmd, "config");
|
|
|
e10da2 |
+ int live = vshCommandOptBool(cmd, "live");
|
|
|
e10da2 |
+ bool all = maximum + current + config + live == 0;
|
|
|
e10da2 |
+ int count;
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ if (maximum && current) {
|
|
|
e10da2 |
+ vshError(ctl, "%s",
|
|
|
e10da2 |
+ _("--maximum and --current cannot both be specified"));
|
|
|
e10da2 |
+ return FALSE;
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+ if (config && live) {
|
|
|
e10da2 |
+ vshError(ctl, "%s",
|
|
|
e10da2 |
+ _("--config and --live cannot both be specified"));
|
|
|
e10da2 |
+ return FALSE;
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+ /* We want one of each pair of mutually exclusive options; that
|
|
|
e10da2 |
+ * is, use of flags requires exactly two options. */
|
|
|
e10da2 |
+ if (maximum + current + config + live == 1) {
|
|
|
e10da2 |
+ vshError(ctl,
|
|
|
e10da2 |
+ _("when using --%s, either --%s or --%s must be specified"),
|
|
|
e10da2 |
+ (maximum ? "maximum" : current ? "current"
|
|
|
e10da2 |
+ : config ? "config" : "live"),
|
|
|
e10da2 |
+ maximum + current ? "config" : "maximum",
|
|
|
e10da2 |
+ maximum + current ? "live" : "current");
|
|
|
e10da2 |
+ return FALSE;
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ if (!vshConnectionUsability(ctl, ctl->conn))
|
|
|
e10da2 |
+ return FALSE;
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
|
|
|
e10da2 |
+ return FALSE;
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ /* In all cases, try the new API first; if it fails because we are
|
|
|
e10da2 |
+ * talking to an older client, try a fallback API before giving
|
|
|
e10da2 |
+ * up. */
|
|
|
e10da2 |
+ if (all || (maximum && config)) {
|
|
|
e10da2 |
+ count = virDomainGetVcpusFlags(dom, (VIR_DOMAIN_VCPU_MAXIMUM |
|
|
|
e10da2 |
+ VIR_DOMAIN_VCPU_CONFIG));
|
|
|
e10da2 |
+ if (count < 0 && (last_error->code == VIR_ERR_NO_SUPPORT
|
|
|
e10da2 |
+ || last_error->code == VIR_ERR_INVALID_ARG)) {
|
|
|
e10da2 |
+ char *tmp;
|
|
|
e10da2 |
+ char *xml = virDomainGetXMLDesc(dom, VIR_DOMAIN_XML_INACTIVE);
|
|
|
e10da2 |
+ if (xml && (tmp = strstr(xml, "
|
|
|
e10da2 |
+ tmp = strchr(tmp, '>');
|
|
|
e10da2 |
+ if (!tmp || virStrToLong_i(tmp + 1, &tmp, 10, &count) < 0)
|
|
|
e10da2 |
+ count = -1;
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+ VIR_FREE(xml);
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ if (count < 0) {
|
|
|
e10da2 |
+ virshReportError(ctl);
|
|
|
e10da2 |
+ ret = FALSE;
|
|
|
e10da2 |
+ } else if (all) {
|
|
|
e10da2 |
+ vshPrint(ctl, "%-12s %-12s %3d\n", _("maximum"), _("config"),
|
|
|
e10da2 |
+ count);
|
|
|
e10da2 |
+ } else {
|
|
|
e10da2 |
+ vshPrint(ctl, "%d\n", count);
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+ virFreeError(last_error);
|
|
|
e10da2 |
+ last_error = NULL;
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ if (all || (maximum && live)) {
|
|
|
e10da2 |
+ count = virDomainGetVcpusFlags(dom, (VIR_DOMAIN_VCPU_MAXIMUM |
|
|
|
e10da2 |
+ VIR_DOMAIN_VCPU_LIVE));
|
|
|
e10da2 |
+ if (count < 0 && (last_error->code == VIR_ERR_NO_SUPPORT
|
|
|
e10da2 |
+ || last_error->code == VIR_ERR_INVALID_ARG)) {
|
|
|
e10da2 |
+ count = virDomainGetMaxVcpus(dom);
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ if (count < 0) {
|
|
|
e10da2 |
+ virshReportError(ctl);
|
|
|
e10da2 |
+ ret = FALSE;
|
|
|
e10da2 |
+ } else if (all) {
|
|
|
e10da2 |
+ vshPrint(ctl, "%-12s %-12s %3d\n", _("maximum"), _("live"),
|
|
|
e10da2 |
+ count);
|
|
|
e10da2 |
+ } else {
|
|
|
e10da2 |
+ vshPrint(ctl, "%d\n", count);
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+ virFreeError(last_error);
|
|
|
e10da2 |
+ last_error = NULL;
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ if (all || (current && config)) {
|
|
|
e10da2 |
+ count = virDomainGetVcpusFlags(dom, VIR_DOMAIN_VCPU_CONFIG);
|
|
|
e10da2 |
+ if (count < 0 && (last_error->code == VIR_ERR_NO_SUPPORT
|
|
|
e10da2 |
+ || last_error->code == VIR_ERR_INVALID_ARG)) {
|
|
|
e10da2 |
+ char *tmp, *end;
|
|
|
e10da2 |
+ char *xml = virDomainGetXMLDesc(dom, VIR_DOMAIN_XML_INACTIVE);
|
|
|
e10da2 |
+ if (xml && (tmp = strstr(xml, "
|
|
|
e10da2 |
+ end = strchr(tmp, '>');
|
|
|
e10da2 |
+ if (end) {
|
|
|
e10da2 |
+ *end = '\0';
|
|
|
e10da2 |
+ tmp = strstr(tmp, "current=");
|
|
|
e10da2 |
+ if (!tmp)
|
|
|
e10da2 |
+ tmp = end + 1;
|
|
|
e10da2 |
+ else {
|
|
|
e10da2 |
+ tmp += strlen("current=");
|
|
|
e10da2 |
+ tmp += *tmp == '\'' || *tmp == '"';
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+ if (!tmp || virStrToLong_i(tmp, &tmp, 10, &count) < 0)
|
|
|
e10da2 |
+ count = -1;
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+ VIR_FREE(xml);
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ if (count < 0) {
|
|
|
e10da2 |
+ virshReportError(ctl);
|
|
|
e10da2 |
+ ret = FALSE;
|
|
|
e10da2 |
+ } else if (all) {
|
|
|
e10da2 |
+ vshPrint(ctl, "%-12s %-12s %3d\n", _("current"), _("config"),
|
|
|
e10da2 |
+ count);
|
|
|
e10da2 |
+ } else {
|
|
|
e10da2 |
+ vshPrint(ctl, "%d\n", count);
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+ virFreeError(last_error);
|
|
|
e10da2 |
+ last_error = NULL;
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ if (all || (current && live)) {
|
|
|
e10da2 |
+ count = virDomainGetVcpusFlags(dom, VIR_DOMAIN_VCPU_LIVE);
|
|
|
e10da2 |
+ if (count < 0 && (last_error->code == VIR_ERR_NO_SUPPORT
|
|
|
e10da2 |
+ || last_error->code == VIR_ERR_INVALID_ARG)) {
|
|
|
e10da2 |
+ virDomainInfo info;
|
|
|
e10da2 |
+ if (virDomainGetInfo(dom, &info) == 0)
|
|
|
e10da2 |
+ count = info.nrVirtCpu;
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ if (count < 0) {
|
|
|
e10da2 |
+ virshReportError(ctl);
|
|
|
e10da2 |
+ ret = FALSE;
|
|
|
e10da2 |
+ } else if (all) {
|
|
|
e10da2 |
+ vshPrint(ctl, "%-12s %-12s %3d\n", _("current"), _("live"),
|
|
|
e10da2 |
+ count);
|
|
|
e10da2 |
+ } else {
|
|
|
e10da2 |
+ vshPrint(ctl, "%d\n", count);
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+ virFreeError(last_error);
|
|
|
e10da2 |
+ last_error = NULL;
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+ virDomainFree(dom);
|
|
|
e10da2 |
+ return ret;
|
|
|
e10da2 |
+}
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+/*
|
|
|
e10da2 |
* "vcpuinfo" command
|
|
|
e10da2 |
*/
|
|
|
e10da2 |
static const vshCmdInfo info_vcpuinfo[] = {
|
|
|
e10da2 |
- {"help", N_("domain vcpu information")},
|
|
|
e10da2 |
+ {"help", N_("detailed domain vcpu information")},
|
|
|
e10da2 |
{"desc", N_("Returns basic information about the domain virtual CPUs.")},
|
|
|
e10da2 |
{NULL, NULL}
|
|
|
e10da2 |
};
|
|
|
e10da2 |
@@ -2514,6 +2720,9 @@ static const vshCmdInfo info_setvcpus[] = {
|
|
|
e10da2 |
static const vshCmdOptDef opts_setvcpus[] = {
|
|
|
e10da2 |
{"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")},
|
|
|
e10da2 |
{"count", VSH_OT_DATA, VSH_OFLAG_REQ, N_("number of virtual CPUs")},
|
|
|
e10da2 |
+ {"maximum", VSH_OT_BOOL, 0, N_("set maximum limit on next boot")},
|
|
|
e10da2 |
+ {"config", VSH_OT_BOOL, 0, N_("affect next boot")},
|
|
|
e10da2 |
+ {"live", VSH_OT_BOOL, 0, N_("affect running domain")},
|
|
|
e10da2 |
{NULL, 0, 0, NULL}
|
|
|
e10da2 |
};
|
|
|
e10da2 |
|
|
|
e10da2 |
@@ -2522,8 +2731,13 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
|
|
|
e10da2 |
{
|
|
|
e10da2 |
virDomainPtr dom;
|
|
|
e10da2 |
int count;
|
|
|
e10da2 |
- int maxcpu;
|
|
|
e10da2 |
int ret = TRUE;
|
|
|
e10da2 |
+ int maximum = vshCommandOptBool(cmd, "maximum");
|
|
|
e10da2 |
+ int config = vshCommandOptBool(cmd, "config");
|
|
|
e10da2 |
+ int live = vshCommandOptBool(cmd, "live");
|
|
|
e10da2 |
+ int flags = ((maximum ? VIR_DOMAIN_VCPU_MAXIMUM : 0) |
|
|
|
e10da2 |
+ (config ? VIR_DOMAIN_VCPU_CONFIG : 0) |
|
|
|
e10da2 |
+ (live ? VIR_DOMAIN_VCPU_LIVE : 0));
|
|
|
e10da2 |
|
|
|
e10da2 |
if (!vshConnectionUsability(ctl, ctl->conn))
|
|
|
e10da2 |
return FALSE;
|
|
|
e10da2 |
@@ -2532,26 +2746,15 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
|
|
|
e10da2 |
return FALSE;
|
|
|
e10da2 |
|
|
|
e10da2 |
count = vshCommandOptInt(cmd, "count", &count);
|
|
|
e10da2 |
- if (count <= 0) {
|
|
|
e10da2 |
- vshError(ctl, "%s", _("Invalid number of virtual CPUs."));
|
|
|
e10da2 |
- virDomainFree(dom);
|
|
|
e10da2 |
- return FALSE;
|
|
|
e10da2 |
- }
|
|
|
e10da2 |
-
|
|
|
e10da2 |
- maxcpu = virDomainGetMaxVcpus(dom);
|
|
|
e10da2 |
- if (maxcpu <= 0) {
|
|
|
e10da2 |
- virDomainFree(dom);
|
|
|
e10da2 |
- return FALSE;
|
|
|
e10da2 |
- }
|
|
|
e10da2 |
-
|
|
|
e10da2 |
- if (count > maxcpu) {
|
|
|
e10da2 |
- vshError(ctl, "%s", _("Too many virtual CPUs."));
|
|
|
e10da2 |
- virDomainFree(dom);
|
|
|
e10da2 |
- return FALSE;
|
|
|
e10da2 |
- }
|
|
|
e10da2 |
|
|
|
e10da2 |
- if (virDomainSetVcpus(dom, count) != 0) {
|
|
|
e10da2 |
- ret = FALSE;
|
|
|
e10da2 |
+ if (!flags) {
|
|
|
e10da2 |
+ if (virDomainSetVcpus(dom, count) != 0) {
|
|
|
e10da2 |
+ ret = FALSE;
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
+ } else {
|
|
|
e10da2 |
+ if (virDomainSetVcpusFlags(dom, count, flags) < 0) {
|
|
|
e10da2 |
+ ret = FALSE;
|
|
|
e10da2 |
+ }
|
|
|
e10da2 |
}
|
|
|
e10da2 |
|
|
|
e10da2 |
virDomainFree(dom);
|
|
|
e10da2 |
@@ -9642,6 +9845,7 @@ static const vshCmdDef commands[] = {
|
|
|
e10da2 |
{"freecell", cmdFreecell, opts_freecell, info_freecell},
|
|
|
e10da2 |
{"hostname", cmdHostname, NULL, info_hostname},
|
|
|
e10da2 |
{"list", cmdList, opts_list, info_list},
|
|
|
e10da2 |
+ {"maxvcpus", cmdMaxvcpus, opts_maxvcpus, info_maxvcpus},
|
|
|
e10da2 |
{"migrate", cmdMigrate, opts_migrate, info_migrate},
|
|
|
e10da2 |
{"migrate-setmaxdowntime", cmdMigrateSetMaxDowntime, opts_migrate_setmaxdowntime, info_migrate_setmaxdowntime},
|
|
|
e10da2 |
|
|
|
e10da2 |
@@ -9748,6 +9952,7 @@ static const vshCmdDef commands[] = {
|
|
|
e10da2 |
{"vol-name", cmdVolName, opts_vol_name, info_vol_name},
|
|
|
e10da2 |
{"vol-key", cmdVolKey, opts_vol_key, info_vol_key},
|
|
|
e10da2 |
|
|
|
e10da2 |
+ {"vcpucount", cmdVcpucount, opts_vcpucount, info_vcpucount},
|
|
|
e10da2 |
{"vcpuinfo", cmdVcpuinfo, opts_vcpuinfo, info_vcpuinfo},
|
|
|
e10da2 |
{"vcpupin", cmdVcpupin, opts_vcpupin, info_vcpupin},
|
|
|
e10da2 |
{"version", cmdVersion, NULL, info_version},
|
|
|
e10da2 |
diff --git a/tools/virsh.pod b/tools/virsh.pod
|
|
|
e10da2 |
index 943a563..dbcc680 100644
|
|
|
e10da2 |
--- a/tools/virsh.pod
|
|
|
e10da2 |
+++ b/tools/virsh.pod
|
|
|
e10da2 |
@@ -443,7 +443,14 @@ Remove the managed save file for a domain if it exists. The next time the
|
|
|
e10da2 |
domain is started it will not restore to its previous state but instead will
|
|
|
e10da2 |
do a full boot.
|
|
|
e10da2 |
|
|
|
e10da2 |
-=item B<migrate> optional I<--live> I<--suspend> I<domain-id> I<desturi> I<migrateuri>
|
|
|
e10da2 |
+=item B<maxvcpus> optional I<type>
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+Provide the maximum number of virtual CPUs supported for a guest VM on
|
|
|
e10da2 |
+this connection. If provided, the I<type> parameter must be a valid
|
|
|
e10da2 |
+type attribute for the <domain> element of XML.
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+=item B<migrate> optional I<--live> I<--suspend> I<domain-id> I<desturi>
|
|
|
e10da2 |
+I<migrateuri>
|
|
|
e10da2 |
|
|
|
e10da2 |
Migrate domain to another host. Add --live for live migration; --suspend
|
|
|
e10da2 |
leaves the domain paused on the destination host. The I<desturi> is the
|
|
|
e10da2 |
@@ -521,7 +528,8 @@ Displays the domain memory parameters.
|
|
|
e10da2 |
|
|
|
e10da2 |
Allows you to set the domain memory parameters. LXC and QEMU/KVM supports these parameters.
|
|
|
e10da2 |
|
|
|
e10da2 |
-=item B<setvcpus> I<domain-id> I<count>
|
|
|
e10da2 |
+=item B<setvcpus> I<domain-id> I<count> optional I<--maximum> I<--config>
|
|
|
e10da2 |
+I<--live>
|
|
|
e10da2 |
|
|
|
e10da2 |
Change the number of virtual CPUs active in the guest domain. Note that
|
|
|
e10da2 |
I<count> may be limited by host, hypervisor or limit coming from the
|
|
|
e10da2 |
@@ -530,6 +538,17 @@ original description of domain.
|
|
|
e10da2 |
For Xen, you can only adjust the virtual CPUs of a running domain if
|
|
|
e10da2 |
the domain is paravirtualized.
|
|
|
e10da2 |
|
|
|
e10da2 |
+If I<--config> is specified, the change will only affect the next
|
|
|
e10da2 |
+boot of a domain. If I<--live> is specified, the domain must be
|
|
|
e10da2 |
+running, and the change takes place immediately. Both flags may be
|
|
|
e10da2 |
+specified, if supported by the hypervisor. If neither flag is given,
|
|
|
e10da2 |
+then I<--live> is implied and it is up to the hypervisor whether
|
|
|
e10da2 |
+I<--config> is also implied.
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+If I<--maximum> is specified, then you must use I<--config> and
|
|
|
e10da2 |
+avoid I<--live>; this flag controls the maximum limit of vcpus that
|
|
|
e10da2 |
+can be hot-plugged the next time the domain is booted.
|
|
|
e10da2 |
+
|
|
|
e10da2 |
=item B<shutdown> I<domain-id>
|
|
|
e10da2 |
|
|
|
e10da2 |
Gracefully shuts down a domain. This coordinates with the domain OS
|
|
|
e10da2 |
@@ -568,6 +587,21 @@ is not available the processes will provide an exit code of 1.
|
|
|
e10da2 |
Undefine the configuration for an inactive domain. Since it's not running
|
|
|
e10da2 |
the domain name or UUID must be used as the I<domain-id>.
|
|
|
e10da2 |
|
|
|
e10da2 |
+=item B<vcpucount> I<domain-id> optional I<--maximum> I<--current>
|
|
|
e10da2 |
+I<--config> I<--live>
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+Print information about the virtual cpu counts of the given
|
|
|
e10da2 |
+I<domain-id>. If no flags are specified, all possible counts are
|
|
|
e10da2 |
+listed in a table; otherwise, the output is limited to just the
|
|
|
e10da2 |
+numeric value requested.
|
|
|
e10da2 |
+
|
|
|
e10da2 |
+I<--maximum> requests information on the maximum cap of vcpus that a
|
|
|
e10da2 |
+domain can add via B<setvcpus>, while I<--current> shows the current
|
|
|
e10da2 |
+usage; these two flags cannot both be specified. I<--config>
|
|
|
e10da2 |
+requests information regarding the next time the domain will be
|
|
|
e10da2 |
+booted, while I<--live> requires a running domain and lists current
|
|
|
e10da2 |
+values; these two flags cannot both be specified.
|
|
|
e10da2 |
+
|
|
|
e10da2 |
=item B<vcpuinfo> I<domain-id>
|
|
|
e10da2 |
|
|
|
e10da2 |
Returns basic information about the domain virtual CPUs, like the number of
|
|
|
e10da2 |
--
|
|
|
e10da2 |
1.7.2.3
|
|
|
e10da2 |
|