[libvirt] [PATCH]show the autostart status when display a 'virsh dominfo'.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



http://www.redhat.com/archives/libvir-list/2008-May/msg00065.html
> It should really show the autostart
> status when display a 'virsh domiinfo'
I make a patch to show the autostart 
status when display a 'virsh dominfo'.

  *** autostart status = enable ***
    # virsh dominfo guest_dom
    Id:             -
    Name:           guest_dom
    UUID:           08b6f537-87f5-9617-1d66-cadd223fd4b6
    OS Type:        linux
    State:          shut off
    CPU(s):         1
    Max memory:     262144 kB
    Used memory:    262144 kB
    Auto Start:     enable
    ^^^^^^^^^^^^^^^^^^^^^^
  *** autostart status = disable ***
    # virsh dominfo guest_dom
    Id:             -
    Name:           guest_dom
    UUID:           08b6f537-87f5-9617-1d66-cadd223fd4b6
    OS Type:        linux
    State:          shut off
    CPU(s):         1
    Max memory:     262144 kB
    Used memory:    262144 kB
    Auto Start:     disable
    ^^^^^^^^^^^^^^^^^^^^^^^
Thanks,
Shigeki Sakamoto.


Index: virsh.c
===================================================================
RCS file: /data/cvs/libvirt/src/virsh.c,v
retrieving revision 1.153
diff -u -p -r1.153 virsh.c
--- virsh.c	23 May 2008 08:24:44 -0000	1.153
+++ virsh.c	26 May 2008 05:59:54 -0000
@@ -1492,7 +1492,7 @@ cmdDominfo(vshControl * ctl, vshCmd * cm
 {
     virDomainInfo info;
     virDomainPtr dom;
-    int ret = TRUE;
+    int ret = TRUE, autostart;
     unsigned int id;
     char *str, uuid[VIR_UUID_STRING_BUFLEN];
 
@@ -1545,6 +1545,11 @@ cmdDominfo(vshControl * ctl, vshCmd * cm
         ret = FALSE;
     }
 
+    if (!virDomainGetAutostart(dom, &autostart)) {
+        vshPrint(ctl, "%-15s %-15s\n", _("Auto Start:"),
+                 autostart ? "enable" : "disable" );
+    }
+
     virDomainFree(dom);
     return ret;
 }

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]