xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] xl: uptime: skip dom0 when calling print_domU_uptime
@ 2016-02-17 10:34 Ian Campbell
  2016-02-17 10:34 ` [PATCH 2/2] xl: NULL terminate buf when reading dom0 /proc/uptime Ian Campbell
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ian Campbell @ 2016-02-17 10:34 UTC (permalink / raw)
  To: ian.jackson, wei.liu2, xen-devel; +Cc: Ian Campbell

Dom0 is handled separately (via print_dom0_uptime) and the domU
variant doesn't work for dom0 since libxl_vm_get_start_time() doesn't.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index f38e3dd..89fa42c 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -7055,8 +7055,10 @@ static void print_uptime(int short_mode, uint32_t doms[], int nb_doms)
             fprintf(stderr, "Could not list vms.\n");
             return;
         }
-        for (i = 0; i < nb_vm; i++)
+        for (i = 0; i < nb_vm; i++) {
+            if (info[i].domid == 0) continue;
             print_domU_uptime(info[i].domid, short_mode, now);
+        }
         libxl_vminfo_list_free(info, nb_vm);
     } else {
         for (i = 0; i < nb_doms; i++) {
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-03-01 16:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-17 10:34 [PATCH 1/2] xl: uptime: skip dom0 when calling print_domU_uptime Ian Campbell
2016-02-17 10:34 ` [PATCH 2/2] xl: NULL terminate buf when reading dom0 /proc/uptime Ian Campbell
2016-03-01 16:11   ` Ian Jackson
2016-02-23 10:30 ` [PATCH 1/2] xl: uptime: skip dom0 when calling print_domU_uptime Ian Campbell
2016-03-01 16:10 ` Ian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).