]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
virsh: Extend virsh dominfo to display if managed save image exists
authorOsier Yang <jyang@redhat.com>
Tue, 19 Jul 2011 06:24:57 +0000 (14:24 +0800)
committerOsier Yang <jyang@redhat.com>
Tue, 19 Jul 2011 06:24:57 +0000 (14:24 +0800)
* 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.

tools/virsh.c
tools/virsh.pod

index d39177689582cd477fd4e0b7c2101ca274f09d7a..c71683527f2d0a1734978414325c86060a8044d3 100644 (file)
@@ -2336,6 +2336,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
     int autostart;
     unsigned int id;
     char *str, uuid[VIR_UUID_STRING_BUFLEN];
+    int has_managed_save = 0;
 
     if (!vshConnectionUsability(ctl, ctl->conn))
         return false;
@@ -2401,6 +2402,13 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
                  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 */
     memset(&secmodel, 0, sizeof secmodel);
     if (virNodeGetSecurityModel(ctl->conn, &secmodel) == -1) {
index 6430efb95d78ef6b62507961fc3dfdb5cfbdadac..6392bc76a2c4ff78e5a656061f7c806ad8596e16 100644 (file)
@@ -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
 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>
 
 Remove the B<managedsave> state file for a domain, if it exists.  This