WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 1/2]xl: Add "xl uptime" command

To: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1/2]xl: Add "xl uptime" command
From: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>
Date: Thu, 13 May 2010 18:10:58 +0800
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 13 May 2010 03:10:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4BEBCC61.3000703@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4BEBC81A.70109@xxxxxxxxxxxxxx> <4BEBCC61.3000703@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100415 Thunderbird/3.0.4
Hi Vincent,

On 05/13/2010 05:54 PM, Vincent Hanquez wrote:
> On 13/05/10 10:36, Yang Hongyang wrote:
>> Add "xl uptime" command, a clone of "xm uptime".
>>
>> Signed-off-by: Yang Hongyang<yanghy@xxxxxxxxxxxxxx>
>>
>> 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.

Thank you for your review,I'll fix that.

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

I think it's sometimes useful. I noticed that just the day before yesterday,
somebody asked in the xen-api list about "uptime" command.




-------- Original Message --------
Subject:        [Xen-API] Want to find out the uptime of individual VM running
on Citrix Xen
Date:   Tue, 11 May 2010 04:00:13 -0600
From:   Sane, Abhijeet <Abhijeet_Sane@xxxxxxx>
To:     xen-api@xxxxxxxxxxxxxxxxxxx <xen-api@xxxxxxxxxxxxxxxxxxx>



Hi,

I want to know if it is possible to get the uptime of individual VM that
are running on the Citrix host using the Citrix Xen python API..

Something on the lines of ‘xm uptime’

 

Regards

Abhijeet Sane


-- 
Regards
Yang Hongyang

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel