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]xl: Some small fixes to xl

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH]xl: Some small fixes to xl
From: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>
Date: Wed, 26 May 2010 09:02:55 +0800
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 25 May 2010 18:01:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1005241011580.25605@kaball-desktop>
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: <4BF62FB9.40008@xxxxxxxxxxxxxx> <4BF6DE1D.6070904@xxxxxxxx> <4BF9CCEE.9010300@xxxxxxxxxxxxxx> <alpine.DEB.2.00.1005241011580.25605@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4
On 05/24/2010 05:16 PM, Stefano Stabellini wrote:
> On Mon, 24 May 2010, Yang Hongyang wrote:
>> Hi jeremy,
>>
>> Thank you for your review.
>>
>> On 05/22/2010 03:25 AM, Jeremy Fitzhardinge wrote:
>>> On 05/21/2010 12:01 AM, Yang Hongyang wrote:
>>>> The patch fixes following problems:
>>>> -When use mem-set, I got suspicious error output:
>>>>  # xl mem-set 1 256g
>>>>  setting domid 1 memory to : 268435456
>>>>  [0] libxl.c:2535:libxl_set_memory_target: memory_dynamic_max must be less 
>>>> than or equal to memory_static_max
>>>>  : Success
>>>> -parse_mem_size_kb() returns type int64_t
>>>> -String generated by strdup() should be freed
>>>> -When using 'xl help', mem-max and mem-set's output is not as intend, and 
>>>> it's also
>>>>  breaks bash completion, fix it.
>>>>
>>>> diff -r 840f269d95fb tools/libxl/libxl.c
>>>> --- a/tools/libxl/libxl.c  Wed May 19 22:59:52 2010 +0100
>>>> +++ b/tools/libxl/libxl.c  Fri May 21 22:56:02 2010 +0800
>> ...snip...
>>>>      }
>>>>  
>>>> -    printf("setting domid %d memory to : %lld\n", domid, memorykb);
>>>> +    printf("setting domid %d memory to : %ld\n", domid, memorykb);
>>>>   
>>>
>>> This is wrong; "int64_t" isn't necessarily long.  What was wrong with
>>> the previous version?
>>
>> There's a problem. libxl_set_memory_target() takes memorykb as uint32_t,
>> so, if you want set as 'long long int', you should also modify this lib
>> function I think.
>> For this reason, when I set the memory to 100t, libxl_set_memory_target()
>> will take the memorykb as 0...
>>
> 
> Yes, we need to use uint64_t in libxenlight too, also I prefer uint64_t
> to unsigned long long.
> Finally in the printf call the best way to print a uint64_t in decimal
> format is using PRId64.
> 
> 

By the way, xc_domain_setmaxmem() take max_memkb as 'unsigned int'
It we use uint64_t, we should change that also.

> 
> 


-- 
Regards
Yang Hongyang

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