On 09/29/2011 02:57 AM, Xu He Jie wrote:
Signed-off-by: Xu He Jie<xuhj(a)linux.vnet.ibm.com>
---
tools/virsh.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
tools/virsh.pod | 8 ++++++++
2 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 807324b..a7d0559 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -3192,6 +3192,51 @@ cmdReboot(vshControl *ctl, const vshCmd *cmd)
}
/*
+ * "reset" command
+ */
+static const vshCmdInfo info_reset[] = {
+ {"help", N_("reset a domain immediately without any guest OS
shutdown")},
+ {"desc",
+ N_("Reset the target domain immediately without any guest OS shutdown. "
+ "That emulates the power reset of a button on a machine, i.e. "
+ "All hardware see the RST line set and reinitialize their "
+ "internal state.\n"
+ "\n"
+ " Note that the risk of data loss caused by reset without "
+ "guest os shutdown.")},
That's a bit verbose, compared to most other help commands.
+static bool
+cmdReset(vshControl *ctl, const vshCmd *cmd)
+{
+ virDomainPtr dom;
+ bool ret = true;
+ const char *name;
+
+ if (!vshConnectionUsability(ctl, ctl->conn))
+ return false;
+
+ if (!(dom = vshCommandOptDomain(ctl, cmd,&name)))
+ return false;
+
+ if (virDomainReset(dom, 0) == 0) {
+ vshPrint(ctl, _("Domain %s is being reseted\n"), name);
Grammar.
+=item B<reset> I<domain-id>
+
+Reset a domain immediately without any guest shutdown. B<reset>
+emulates the power reset of a button on a machine, i.e.
+All hardware see the RST line set and reinitialize their internal state.
+
+B<Note>: Reset without any guest OS shutdown cause the risk of data loss.
I applied the same wording changes here as in libvirt.c, then pushed the
series.
diff --git i/tools/virsh.c w/tools/virsh.c
index a7d0559..1909dce 100644
--- i/tools/virsh.c
+++ w/tools/virsh.c
@@ -3195,15 +3195,8 @@ cmdReboot(vshControl *ctl, const vshCmd *cmd)
* "reset" command
*/
static const vshCmdInfo info_reset[] = {
- {"help", N_("reset a domain immediately without any guest OS
shutdown")},
- {"desc",
- N_("Reset the target domain immediately without any guest OS
shutdown. "
- "That emulates the power reset of a button on a machine, i.e. "
- "All hardware see the RST line set and reinitialize their "
- "internal state.\n"
- "\n"
- " Note that the risk of data loss caused by reset without "
- "guest os shutdown.")},
+ {"help", N_("reset a domain")},
+ {"desc", N_("Reset the target domain as if by power button")},
{NULL, NULL}
};
@@ -3226,7 +3219,7 @@ cmdReset(vshControl *ctl, const vshCmd *cmd)
return false;
if (virDomainReset(dom, 0) == 0) {
- vshPrint(ctl, _("Domain %s is being reseted\n"), name);
+ vshPrint(ctl, _("Domain %s was reset\n"), name);
} else {
vshError(ctl, _("Failed to reset domain %s"), name);
ret = false;
diff --git i/tools/virsh.pod w/tools/virsh.pod
index 2192600..be81afc 100644
--- i/tools/virsh.pod
+++ w/tools/virsh.pod
@@ -793,10 +793,10 @@ I<on_reboot> parameter in the domain's XML definition.
=item B<reset> I<domain-id>
Reset a domain immediately without any guest shutdown. B<reset>
-emulates the power reset of a button on a machine, i.e.
-All hardware see the RST line set and reinitialize their internal state.
+emulates the power reset button on a machine, where all guest
+hardware sees the RST line set and reinitializes internal state.
-B<Note>: Reset without any guest OS shutdown cause the risk of data loss.
+B<Note>: Reset without any guest OS shutdown risks data loss.
=item B<restore> I<state-file> [I<--bypass-cache>] [I<--xml>
B<file>]
[{I<--running> | I<--paused>}]
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org