All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
To: Yang Hongyang <yanghy@cn.fujitsu.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH 1/2]xl: Add "xl uptime" command
Date: Thu, 13 May 2010 10:54:41 +0100	[thread overview]
Message-ID: <4BEBCC61.3000703@eu.citrix.com> (raw)
In-Reply-To: <4BEBC81A.70109@cn.fujitsu.com>

On 13/05/10 10:36, Yang Hongyang wrote:
> Add "xl uptime" command, a clone of "xm uptime".
>
> Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>
>
> diff -r d77a88f938c6 tools/libxl/libxl.c
> --- a/tools/libxl/libxl.c	Tue May 11 14:05:28 2010 +0100
> +++ b/tools/libxl/libxl.c	Fri May 14 01:25:56 2010 +0800
> @@ -2629,3 +2629,23 @@
>
>       return rc;
>   }
> +
> +unsigned long libxl_get_start_time(struct libxl_ctx *ctx, uint32_t domid)
> +{
> +    char *dompath = libxl_xs_get_dompath(ctx, domid);
> +    unsigned long s_time = 0;
> +    char *start_time = NULL;
> +    char *vm_path = NULL;
> +
> +    vm_path = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, "%s/vm", dompath));
> +    start_time = libxl_xs_read(ctx, XBT_NULL, libxl_sprintf(ctx, "%s/start_time", vm_path));
> +    if (start_time == NULL) {
> +        XL_LOG_ERRNOVAL(ctx, XL_LOG_ERROR, -1,
> +            "Can't get start time of domain '%d'", domid);
> +        return -1;
> +    }
> +    s_time = strtoul(start_time, NULL, 10);
> +
> +    return s_time;
> +}

this function should more than likely return a uint64_t or a uint32_t, 
but certainly not an unsigned long. and since it apply to a domain it 
should be call libxl_domain_get_start_time.

I find this command basically useless, since on restore the "start_time" 
is not kept. do we actually need this ?

-- 
Vincent

  reply	other threads:[~2010-05-13  9:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-13  9:36 [PATCH 1/2]xl: Add "xl uptime" command Yang Hongyang
2010-05-13  9:54 ` Vincent Hanquez [this message]
2010-05-13 10:10   ` Yang Hongyang
2010-05-13 10:18     ` Vincent Hanquez
2010-05-13 10:42       ` Yang Hongyang
2010-05-13 10:31 ` [PATCH v2]xl: " Yang Hongyang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BEBCC61.3000703@eu.citrix.com \
    --to=vincent.hanquez@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=yanghy@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.