[libvirt] [PATCH v2 8/8] virsh: Extend virsh dominfo to display if managed state exists

Osier Yang jyang at redhat.com
Fri Jul 15 09:06:50 UTC 2011


---
 tools/virsh.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index 8a62612..120f3c8 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -2366,6 +2366,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
     int autostart;
     unsigned int id;
     char *str, uuid[VIR_UUID_STRING_BUFLEN];
+    int has_managed_state = 0;
 
     if (!vshConnectionUsability(ctl, ctl->conn))
         return false;
@@ -2430,6 +2431,13 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
                  autostart ? _("enable") : _("disable") );
     }
 
+    has_managed_state = virDomainHasManagedSaveImage(dom, 0);
+    if (has_managed_state < 0)
+        vshPrint(ctl, "%-15s %s\n", _("Has managed state:"), _("unknown"));
+    else
+        vshPrint(ctl, "%-15s %s\n", _("Has managed state:"),
+                 has_managed_state ? _("yes") : _("no"));
+
     /* Security model and label information */
     memset(&secmodel, 0, sizeof secmodel);
     if (virNodeGetSecurityModel(ctl->conn, &secmodel) == -1) {
-- 
1.7.6




More information about the libvir-list mailing list