From patchwork Wed Feb 17 10:34:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 8336441 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7B2359F2F0 for ; Wed, 17 Feb 2016 10:37:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A7E4720254 for ; Wed, 17 Feb 2016 10:37:38 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D63BC20218 for ; Wed, 17 Feb 2016 10:37:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aVzS1-0004ne-CS; Wed, 17 Feb 2016 10:35:17 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aVzRz-0004n1-Cn for xen-devel@lists.xen.org; Wed, 17 Feb 2016 10:35:15 +0000 Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id 5B/61-10715-2EC44C65; Wed, 17 Feb 2016 10:35:14 +0000 X-Env-Sender: prvs=848fde4e6=Ian.Campbell@citrix.com X-Msg-Ref: server-7.tower-27.messagelabs.com!1455705284!24475489!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 52501 invoked from network); 17 Feb 2016 10:34:45 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 17 Feb 2016 10:34:45 -0000 X-IronPort-AV: E=Sophos;i="5.22,459,1449532800"; d="scan'208";a="332274539" From: Ian Campbell To: , , Date: Wed, 17 Feb 2016 10:34:23 +0000 Message-ID: <1455705264-17744-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian Campbell Subject: [Xen-devel] [PATCH 1/2] xl: uptime: skip dom0 when calling print_domU_uptime X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Ian Jackson --- 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++) {