From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: Re: [PATCH 3 of 4] libxl: Add support for passing in the machine's E820 for PCI passthrough in libxl_device_pci_parse_bdf Date: Tue, 12 Apr 2011 15:00:40 -0400 Message-ID: <20110412190040.GA23249@dumpdata.com> References: <75e24fb720fa9a1c529b.1302557733@localhost6.localdomain6> <1302610783.27835.146.camel@zakaz.uk.xensource.com> <20110412175315.GA19066@dumpdata.com> <1302633888.5528.23.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <1302633888.5528.23.camel@localhost.localdomain> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Campbell Cc: Tim Deegan , "xen-devel@lists.xensource.com" , Ian Jackson , "keir.fraser@eu.citrix.com" List-Id: xen-devel@lists.xenproject.org On Tue, Apr 12, 2011 at 07:44:48PM +0100, Ian Campbell wrote: > On Tue, 2011-04-12 at 18:53 +0100, Konrad Rzeszutek Wilk wrote: > > On Tue, Apr 12, 2011 at 01:19:43PM +0100, Ian Campbell wrote: > > > On Mon, 2011-04-11 at 22:35 +0100, Konrad Rzeszutek Wilk wrote: > > > >=20 > > > >=20 > > > > The code libxl_device_pci_parse_bdf calls the libxl__e820_alloc w= hen > > > > it has parsed one BDF. Subsequent calls to libxl_device_pci_parse= _bdf > > > > will > > > > not trigger libxl__e820_alloc being called (unless the first call= to > > > > libxl__e820_alloc failed). > > >=20 > > > That sounds like a very odd non-intuitive location for that allocat= ion. > > > Why not do it in libxl_domain_create or somewhere like that? > > >=20 > > > I think the e820 map added to the idl should become a simple boolea= n > > > flag and this should all be taken care of internally based on that. > >=20 > > Like this? >=20 > Why no_machine_e820 instead of just machine_e820? You can set a non-zer= o > default in the appropriate libxl_foo_init function if need be. I tried to ("machine_e820", bool, True, "Use machine's E820 for PCI passthrough."), and it made the the machine_e820 variable be an 'const bool' so that you = couldn't change it anymore.=20 xl_cmdimpl.c:990: error: assignment of read-only member =E2=80=98machine_= e820=E2=80=99 112 char * cmdline; 113 libxl_file_reference ramdisk; 114 const char * features; 115 /* 116 * Use machine's E820 for PCI passthrough. 117 */ 118 const bool machine_e820; 119 } pv; 120 } u; 121 } libxl_domain_build_info; If I make an 'integer' I get the same thing. Ah, if I modify the python c= ode: konrad@phenom:~/hg/xen-unstable.hg/tools/libxl$ hg diff diff -r cc01692f4b41 tools/libxl/gentypes.py --- a/tools/libxl/gentypes.py Tue Apr 12 14:46:05 2011 -0400 +++ b/tools/libxl/gentypes.py Tue Apr 12 14:58:24 2011 -0400 @@ -48,7 +48,7 @@ def libxl_C_type_define(ty, indent =3D "") s +=3D format_comment(4, f.comment) x =3D libxl_C_instance_of(f.type, f.name) if f.const: - x =3D "const " + x + x =3D " " + x x =3D x.replace("\n", "\n ") s +=3D " " + x + ";\n" if ty.typename is None: It starts working, but that does not look like the correct fix.