From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gianni Tedesco Subject: Re: build break in xl.c in python Date: Fri, 8 Oct 2010 09:28:57 +0100 Message-ID: <1286526537.12843.130.camel@qabil.uk.xensource.com> References: <987664A83D2D224EAE907B061CE93D530163EA9749@orsmsx505.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <987664A83D2D224EAE907B061CE93D530163EA9749@orsmsx505.amr.corp.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Kay, Allen M" Cc: Xen-devel , Vincent Hanquez , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Fri, 2010-10-08 at 01:28 +0100, Kay, Allen M wrote: > I'm getting a build break in python xl code. Looks like the following changeset did not make the corresponding parameter change from the caller site in python: > > -static int do_pci_remove(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev) > +static int do_pci_remove(libxl__gc *gc, uint32_t domid, > + libxl_device_pci *pcidev, int force) > > > Changeset: > > 31 hours ago: xl: Implement PCI passthrough force removal > changeset 22229: 1385b15e168f > tag: tip > author: Gianni Tedesco > date: Wed Oct 06 17:38:15 2010 +0100 > files: tools/libxl/libxl.h tools/libxl/libxl_pci.c tools/libxl/xl_cmdimpl.c You are right, I should have realised! It also breaks the ocaml binding. Vincent, I have patched this so that it builds but perhaps you want to expose the new PCI force removal in the ocaml binding? I just set 'force' parameter to always be zero for now to keep it building and running same as before. --- xl: Fix build in python binding since API change in 22229:1385b15e168f Signed-off-by: Gianni Tedesco diff -r 1385b15e168f tools/ocaml/libs/xl/xl_stubs.c --- a/tools/ocaml/libs/xl/xl_stubs.c Wed Oct 06 17:38:15 2010 +0100 +++ b/tools/ocaml/libs/xl/xl_stubs.c Fri Oct 08 09:25:22 2010 +0100 @@ -638,7 +638,7 @@ value stub_xl_pci_remove(value info, val device_pci_val(&gc, &c_info, info); INIT_CTX(); - ret = libxl_device_pci_remove(&ctx, Int_val(domid), &c_info); + ret = libxl_device_pci_remove(&ctx, Int_val(domid), &c_info, 0); if (ret != 0) failwith_xl("pci_remove", &lg); FREE_CTX(); diff -r 1385b15e168f tools/python/xen/lowlevel/xl/xl.c --- a/tools/python/xen/lowlevel/xl/xl.c Wed Oct 06 17:38:15 2010 +0100 +++ b/tools/python/xen/lowlevel/xl/xl.c Fri Oct 08 09:25:22 2010 +0100 @@ -441,15 +441,16 @@ static PyObject *pyxl_pci_del(XlObject * { Py_device_pci *pci; PyObject *obj; - int domid; - if ( !PyArg_ParseTuple(args, "iO", &domid, &obj) ) + int domid, force = 0; + + if ( !PyArg_ParseTuple(args, "iO|i", &domid, &obj) ) return NULL; if ( !Pydevice_pci_Check(obj) ) { PyErr_SetString(PyExc_TypeError, "Xxpected xl.device_pci"); return NULL; } pci = (Py_device_pci *)obj; - if ( libxl_device_pci_remove(&self->ctx, domid, &pci->obj) ) { + if ( libxl_device_pci_remove(&self->ctx, domid, &pci->obj, force) ) { PyErr_SetString(xl_error_obj, "cannot remove pci device"); return NULL; }