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 of 4] Support getting topology info in libxl

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1 of 4] Support getting topology info in libxl
From: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Date: Wed, 08 Dec 2010 13:01:43 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 08 Dec 2010 04:05:32 -0800
Dkim-signature: v=1; a=rsa-sha256; c=simple/simple; d=ts.fujitsu.com; i=juergen.gross@xxxxxxxxxxxxxx; q=dns/txt; s=s1536b; t=1291809706; x=1323345706; h=message-id:date:from:mime-version:to:cc:subject: references:in-reply-to:content-transfer-encoding; z=Message-ID:=20<4CFF73A7.7080704@xxxxxxxxxxxxxx>|Date:=20 Wed,=2008=20Dec=202010=2013:01:43=20+0100|From:=20Juergen =20Gross=20<juergen.gross@xxxxxxxxxxxxxx>|MIME-Version: =201.0|To:=20Ian=20Campbell=20<Ian.Campbell@xxxxxxxxxx> |CC:=20"xen-devel@xxxxxxxxxxxxxxxxxxx"=20<xen-devel@lists .xensource.com>|Subject:=20Re:=20[Xen-devel]=20[PATCH=201 =20of=204]=20Support=20getting=20topology=20info=20in=20l ibxl|References:=20<37fdfe90e0c26bfac22e.1290755424@meran o1.osd.mch.fsc.net>=20<1291805483.13966.4507.camel@zakaz. uk.xensource.com>|In-Reply-To:=20<1291805483.13966.4507.c amel@xxxxxxxxxxxxxxxxxxxxxx>|Content-Transfer-Encoding: =207bit; bh=KiX1VyTn2kwomaT6nhPl7l4aK8nE/rNr2c/ItV2vz3A=; b=qIzhVMbYjVI/zcUW0e2GAfO809+iqaJU8eDCzaDAmpXFmjxRO+WWR0p4 R/I5OVasttvntFM3aRa+owz2QAm8zV+pQCQ8sMKvvvfrrfdIWgfo2sUnc 24G9ZZc6SiP0g+8M+Olz38yft3o9pxGh3rEWFPt2t31JYJUE5p9A4plOt stlGhzkTvvJtvN0SuLt+3dEzuEdXrsgxhXdm7JmCQc4Xh3w8YDeFegXQV phXalQ5oClcEaOw+a+E5MOtw52kwo;
Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV: Received:Received:Message-ID:Date:From:Organization: User-Agent:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=gnD6uuDBl0GBLc1QJRa0yBWxlHX4yJswIBwXnHY20kaE6DwqDhnJaOwY SwvogAfUBBg5EpF+dx86Agc3Z2a5zNdVrSGcYkXPnhphHKJr/u4+SqP2Y XLAfc0kdpfuI71WPqVdMppA8w/SESd0Ioi95aV+3WXK2e5QjpYO8apebn d3UqmdFWXgdGKn3Br/eQX6NEgOQGlOmMW+qXtUi9sRS+S5YUM3jNaeBcL pz0iQifGqDP5A03h+dVzDlXqETn1U;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1291805483.13966.4507.camel@xxxxxxxxxxxxxxxxxxxxxx>
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>
Organization: Fujitsu Technology Solutions
References: <37fdfe90e0c26bfac22e.1290755424@xxxxxxxxxxxxxxxxxxxxxxx> <1291805483.13966.4507.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101030 Iceowl/1.0b1 Icedove/3.0.10
On 12/08/10 11:51, Ian Campbell wrote:
On Fri, 2010-11-26 at 07:10 +0000, Juergen Gross wrote:

diff -r 79b71c77907b -r 37fdfe90e0c2 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h       Wed Nov 24 10:20:03 2010 +0000
+++ b/tools/libxl/libxl.h       Thu Nov 25 09:29:43 2010 +0100
@@ -148,6 +148,13 @@
      uint8_t *map;
  } libxl_cpumap;
  void libxl_cpumap_destroy(libxl_cpumap *map);
+
+typedef struct {
+    uint32_t entries;
+    uint32_t *array;
+} libxl_cpuarray;
+#define LIBXL_CPUARRAY_INVENTRY  ~0

This looked at first glance like you had misspelled INVENTORY. Perhaps
LIBXL_CPUARRAY_INVALID_ENTRY?

Okay, I don't mind.


+void libxl_cpuarray_destroy(libxl_cpuarray *array);

  typedef enum {
      XENFV = 1,
@@ -464,6 +471,7 @@
  int libxl_button_press(libxl_ctx *ctx, uint32_t domid, libxl_button button);

  int libxl_get_physinfo(libxl_ctx *ctx, libxl_physinfo *physinfo);
+libxl_topologyinfo *libxl_get_topologyinfo(libxl_ctx *ctx);

The idiom in libxl is for such functions to take a pointer to the
structure to fill in and return a status code, e.g.
        int libxl_get_topologyinfo(libxl_ctx *ctx, libxl_topologyinfo *info)
e..g libxl_get_physinfo()

This is useful since the caller doesn't always need to manage the
dynamic allocation of the info structure e.g, it can use a stack
variable for temporary stuff or nest inside another structure etc.

I'll change it.


Juergen

--
Juergen Gross                 Principal Developer Operating Systems
TSP ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@xxxxxxxxxxxxxx
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

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