提交 73d4625a 编写于 作者: O Osier Yang

virsh: Extend virsh dominfo to display if managed save image exists

* tools/virsh.c: new column "Managed save" for "cmdDominfo".
* tools/virsh.pod: Update document of "managedsave" to tell one can
  use "dominfo" to query whether a domain has any managed save image.
上级 dde56813
...@@ -2336,6 +2336,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) ...@@ -2336,6 +2336,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
int autostart; int autostart;
unsigned int id; unsigned int id;
char *str, uuid[VIR_UUID_STRING_BUFLEN]; char *str, uuid[VIR_UUID_STRING_BUFLEN];
int has_managed_save = 0;
if (!vshConnectionUsability(ctl, ctl->conn)) if (!vshConnectionUsability(ctl, ctl->conn))
return false; return false;
...@@ -2401,6 +2402,13 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) ...@@ -2401,6 +2402,13 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
autostart ? _("enable") : _("disable") ); autostart ? _("enable") : _("disable") );
} }
has_managed_save = virDomainHasManagedSaveImage(dom, 0);
if (has_managed_save < 0)
vshPrint(ctl, "%-15s %s\n", _("Managed save:"), _("unknown"));
else
vshPrint(ctl, "%-15s %s\n", _("Managed save:"),
has_managed_save ? _("yes") : _("no"));
/* Security model and label information */ /* Security model and label information */
memset(&secmodel, 0, sizeof secmodel); memset(&secmodel, 0, sizeof secmodel);
if (virNodeGetSecurityModel(ctl->conn, &secmodel) == -1) { if (virNodeGetSecurityModel(ctl->conn, &secmodel) == -1) {
......
...@@ -514,6 +514,9 @@ Save and destroy (stop) a running domain, so it can be restarted from the same ...@@ -514,6 +514,9 @@ Save and destroy (stop) a running domain, so it can be restarted from the same
state at a later time. When the virsh B<start> command is next run for state at a later time. When the virsh B<start> command is next run for
the domain, it will automatically be started from this saved state. the domain, it will automatically be started from this saved state.
The B<dominfo> command can be used to query whether a domain currently
has any managed save image.
=item B<managedsave-remove> I<domain-id> =item B<managedsave-remove> I<domain-id>
Remove the B<managedsave> state file for a domain, if it exists. This Remove the B<managedsave> state file for a domain, if it exists. This
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册