[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: build break in xl.c in python



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 <gianni.tedesco@xxxxxxxxxx> 
> 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 <gianni.tedesco@xxxxxxxxxx>

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;
     }



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.