From b5d62585302aefb5ba4d8bc7c6ccbfd5b1a4e63e Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 2 Apr 2007 11:56:38 +0000 Subject: [PATCH] * src/virsh.c: applied patch from Atsushi SAKAI to clarify that memory values are in kilobytes Daniel --- ChangeLog | 5 +++++ src/virsh.c | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22a35385b4..030545a9f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Apr 2 13:54:17 CEST 2007 Daniel Veillard + + * src/virsh.c: applied patch from Atsushi SAKAI to clarify + that memory values are in kilobytes + Wed Mar 30 17:25:33 IST 2007 Mark McLoughlin * qemud/iptables.c: As suggested by danpb, make libvirt_qemud diff --git a/src/virsh.c b/src/virsh.c index d342dc9755..8fabb40f5a 100644 --- a/src/virsh.c +++ b/src/virsh.c @@ -1437,7 +1437,7 @@ cmdSetvcpus(vshControl * ctl, vshCmd * cmd) * "setmemory" command */ static vshCmdInfo info_setmem[] = { - {"syntax", "setmem "}, + {"syntax", "setmem "}, {"help", gettext_noop("change memory allocation")}, {"desc", gettext_noop("Change the current memory allocation in the guest domain.")}, {NULL, NULL} @@ -1445,7 +1445,7 @@ static vshCmdInfo info_setmem[] = { static vshCmdOptDef opts_setmem[] = { {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("domain name, id or uuid")}, - {"bytes", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("number of bytes of memory")}, + {"kilobytes", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("number of kilobytes of memory")}, {NULL, 0, 0, NULL} }; @@ -1453,7 +1453,7 @@ static int cmdSetmem(vshControl * ctl, vshCmd * cmd) { virDomainPtr dom; - int bytes; + int kilobytes; int ret = TRUE; if (!vshConnectionUsability(ctl, ctl->conn, TRUE)) @@ -1462,14 +1462,14 @@ cmdSetmem(vshControl * ctl, vshCmd * cmd) if (!(dom = vshCommandOptDomain(ctl, cmd, "domain", NULL))) return FALSE; - bytes = vshCommandOptInt(cmd, "bytes", &bytes); - if (bytes <= 0) { + kilobytes = vshCommandOptInt(cmd, "kilobytes", &kilobytes); + if (kilobytes <= 0) { virDomainFree(dom); - vshError(ctl, FALSE, _("Invalid value of %d for memory size"), bytes); + vshError(ctl, FALSE, _("Invalid value of %d for memory size"), kilobytes); return FALSE; } - if (virDomainSetMemory(dom, bytes) != 0) { + if (virDomainSetMemory(dom, kilobytes) != 0) { ret = FALSE; } @@ -1481,7 +1481,7 @@ cmdSetmem(vshControl * ctl, vshCmd * cmd) * "setmaxmem" command */ static vshCmdInfo info_setmaxmem[] = { - {"syntax", "setmaxmem "}, + {"syntax", "setmaxmem "}, {"help", gettext_noop("change maximum memory limit")}, {"desc", gettext_noop("Change the maximum memory allocation limit in the guest domain.")}, {NULL, NULL} @@ -1489,7 +1489,7 @@ static vshCmdInfo info_setmaxmem[] = { static vshCmdOptDef opts_setmaxmem[] = { {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("domain name, id or uuid")}, - {"bytes", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("maxmimum memory limit in bytes")}, + {"kilobytes", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("maxmimum memory limit in kilobytes")}, {NULL, 0, 0, NULL} }; @@ -1497,7 +1497,7 @@ static int cmdSetmaxmem(vshControl * ctl, vshCmd * cmd) { virDomainPtr dom; - int bytes; + int kilobytes; int ret = TRUE; if (!vshConnectionUsability(ctl, ctl->conn, TRUE)) @@ -1506,14 +1506,14 @@ cmdSetmaxmem(vshControl * ctl, vshCmd * cmd) if (!(dom = vshCommandOptDomain(ctl, cmd, "domain", NULL))) return FALSE; - bytes = vshCommandOptInt(cmd, "bytes", &bytes); - if (bytes <= 0) { + kilobytes = vshCommandOptInt(cmd, "kilobytes", &kilobytes); + if (kilobytes <= 0) { virDomainFree(dom); - vshError(ctl, FALSE, _("Invalid value of %d for memory size"), bytes); + vshError(ctl, FALSE, _("Invalid value of %d for memory size"), kilobytes); return FALSE; } - if (virDomainSetMaxMemory(dom, bytes) != 0) { + if (virDomainSetMaxMemory(dom, kilobytes) != 0) { ret = FALSE; }