于 2012年11月06日 17:55, Richard W.M. Jones 写道:
On Tue, Nov 06, 2012 at 05:47:41PM +0800, Gao feng wrote:
> 于 2012年11月06日 17:04, Richard W.M. Jones 写道:
>> On Tue, Nov 06, 2012 at 02:07:21PM +0800, Gao feng wrote:
>>> + unsigned long long meminfo[VIR_LXC_FUSE_MEMMAX];
>>> +enum {
>>> + VIR_LXC_FUSE_MEMTOTAL,
>>> + VIR_LXC_FUSE_MEMUSAGE,
>>> + VIR_LXC_FUSE_CACHED,
>>> + VIR_LXC_FUSE_ACTIVE_ANON,
>>> + VIR_LXC_FUSE_INACTIVE_ANON,
>>> + VIR_LXC_FUSE_ACTIVE_FILE,
>>> + VIR_LXC_FUSE_INACTIVE_FILE,
>>> + VIR_LXC_FUSE_UNEVICTABLE,
>>> + VIR_LXC_FUSE_SWAPTOTAL,
>>> + VIR_LXC_FUSE_SWAPUSAGE,
>>> + VIR_LXC_FUSE_MEMMAX,
>>> +};
>>
>> Any particular reason not to use a struct here?
>>
>> Rich.
>>
>
> Sorry,can you show me the example?
> I don't know why we need struct here.
It's not needed, but I was wondering why you didn't use a struct like:
struct virLXCMeminfo {
unsigned long long memtotal;
unsigned long long memusage;
// etc
};
typedef struct virLXCMeminfo *virLXCMeminfoPtr;
Ok,it looks better,I will change the codes.
Thanks!
Gao