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

[Xen-devel] Physical node info from libxl

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Physical node info from libxl
From: Gihan Munasinghe <GMunasinghe@xxxxxxxxxxxx>
Date: Fri, 07 May 2010 12:12:31 +0100
Delivery-date: Fri, 07 May 2010 04:14:49 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.22 (X11/20090625)
Guys

Looking at the libxl I can't see anywhere I can get a node info structure..
basically the physical info of the Node e.g - total_ram, free ram, no cpu etc

With the current xen version(3.3), I am pulling these data directly from xenctrl

    long int pagesize;
    xc_physinfo_t physinfo = {0};
    pagesize = sysconf(_SC_PAGE_SIZE);
    result = xc_physinfo(xc_handle, &physinfo);
    nodeinfo->cpu_hz = ((unsigned long long)physinfo.cpu_khz) * 1000ULL;
    nodeinfo->num_cpus = physinfo.nr_cpus;
nodeinfo->tot_mem = ((unsigned long long) physinfo.total_pages) * pagesize ; nodeinfo->free_mem = ((unsigned long long) physinfo.free_pages) * pagesize ;

But I think having this code in libxl make more sense. So can I suggest a new structure like

typedef struct libxl_physinfo{
   long long cpu_hz;
   long long total_memorykb;
   long long free_memorykb;
   int num_cpus;
   /*Any more suggestions*/
}libxl_physinfo;

and a method
libxl_physinfo *libxl_physical_info(struct libxl_ctx *ctx);

This can be used in something like "xl info" as well  What you guys think?

Thanks

--
Gihan Munasinghe
R&D Team Leader
Flexiant Ltd.
www.flexiant.com


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

<Prev in Thread] Current Thread [Next in Thread>