Skip to contentSkip to conversation

tools: remove type parameter from xc_physdev_map_pirq{,_msi}()

PATCH In review Jan Beulich 4 participants 6 messages Jul 24, 2008 – Aug 12, 2008 Arm/actions semi architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: remove type parameter from xc_physdev_map_pirq{,_msi}()

.. as it's implied by the function name.

While the patch touches the deprecated ioemu sub-tree, I'm unsure in what shape to submit patches againt the new qemu tree, so ideally the respective parts would just be taken from this patch and also applied to that tree.

tools/ioemu/hw/pass-through.c +1 -2
Index: 2008-07-21/tools/ioemu/hw/pass-through.c
===================================================================
@@ -2785,8 +2785,7 @@ struct pt_dev * register_real_device(PCI
         int pirq = pci_dev->irq;
 
         machine_irq = pci_dev->irq;
-        rc = xc_physdev_map_pirq(xc_handle, domid, MAP_PIRQ_TYPE_GSI,
-                                machine_irq, &pirq);
+        rc = xc_physdev_map_pirq(xc_handle, domid, machine_irq, &pirq);
 
         if ( rc )
         {
tools/ioemu/hw/pt-msi.c +2 -4
Index: 2008-07-21/tools/ioemu/hw/pt-msi.c
===================================================================
@@ -37,8 +37,7 @@ int pt_msi_setup(struct pt_dev *dev)
         return -1;
     }
 
-    if ( xc_physdev_map_pirq_msi(xc_handle, domid, MAP_PIRQ_TYPE_MSI,
-                            AUTO_ASSIGN, &pirq,
+    if ( xc_physdev_map_pirq_msi(xc_handle, domid, AUTO_ASSIGN, &pirq,
 							dev->pci_dev->dev << 3 | dev->pci_dev->func,
 							dev->pci_dev->bus, 0, 1) )
     {
@@ -120,8 +119,7 @@ static int pt_msix_update_one(struct pt_
     /* Check if this entry is already mapped */
     if ( entry->pirq == -1 )
     {
-        ret = xc_physdev_map_pirq_msi(xc_handle, domid, MAP_PIRQ_TYPE_MSI,
-                                AUTO_ASSIGN, &pirq,
+        ret = xc_physdev_map_pirq_msi(xc_handle, domid, AUTO_ASSIGN, &pirq,
                                 dev->pci_dev->dev << 3 | dev->pci_dev->func,
                                 dev->pci_dev->bus, entry_nr, 0);
         if ( ret )
tools/libxc/xc_physdev.c +2 -4
Index: 2008-07-21/tools/libxc/xc_physdev.c
===================================================================
@@ -22,7 +22,6 @@ int xc_physdev_pci_access_modify(int xc_
 
 int xc_physdev_map_pirq(int xc_handle,
                         int domid,
-                        int type,
                         int index,
                         int *pirq)
 {
@@ -33,7 +32,7 @@ int xc_physdev_map_pirq(int xc_handle,
         return -EINVAL;
 
     map.domid = domid;
-    map.type = type;
+    map.type = MAP_PIRQ_TYPE_GSI;
     map.index = index;
     map.pirq = *pirq;
 
@@ -47,7 +46,6 @@ int xc_physdev_map_pirq(int xc_handle,
 
 int xc_physdev_map_pirq_msi(int xc_handle,
                             int domid,
-                            int type,
                             int index,
                             int *pirq,
                             int devfn,
@@ -62,7 +60,7 @@ int xc_physdev_map_pirq_msi(int xc_handl
         return -EINVAL;
 
     map.domid = domid;
-    map.type = type;
+    map.type = MAP_PIRQ_TYPE_MSI;
     map.index = index;
     map.pirq = *pirq;
     map.msi_info.devfn = devfn;
tools/libxc/xenctrl.h +0 -2
Index: 2008-07-21/tools/libxc/xenctrl.h
===================================================================
@@ -907,13 +907,11 @@ int xc_gnttab_set_max_grants(int xcg_han
 
 int xc_physdev_map_pirq(int xc_handle,
                         int domid,
-                        int type,
                         int index,
                         int *pirq);
 
 int xc_physdev_map_pirq_msi(int xc_handle,
                             int domid,
-                            int type,
                             int index,
                             int *pirq,
                             int devfn,
tools/python/xen/lowlevel/xc/xc.c +1 -2
Index: 2008-07-21/tools/python/xen/lowlevel/xc/xc.c
===================================================================
@@ -958,8 +958,7 @@ static PyObject *pyxc_physdev_map_pirq(P
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iii", kwd_list,
                                       &dom, &index, &pirq) )
         return NULL;
-    ret = xc_physdev_map_pirq(xc->xc_handle, dom, MAP_PIRQ_TYPE_GSI,
-                             index, &pirq);
+    ret = xc_physdev_map_pirq(xc->xc_handle, dom, index, &pirq);
     if ( ret != 0 )
           return pyxc_error_to_exception();
     return PyLong_FromUnsignedLong(pirq);
#1 lore raw

Jan Beulich writes ("[Xen-devel] [PATCH] tools: remove type parameter from xc_physdev_map_pirq{,_msi}()"):

Quoted 4 lines

While the patch touches the deprecated ioemu sub-tree, I'm unsure in what shape to submit patches againt the new qemu tree, so ideally the respective parts would just be taken from this patch and also applied to that tree.

I've done that. It's fine to just put a note in your message, like you just did, to ask for your change to go into the qemu tree too. If it turns out not to fit then I'll fix it up or let you know.

(It would also be nice if people who patches to ioemu which are _not_ supposed to go into ioemu-remote mentioned that this was the case.)

Thanks,
Ian.

#2 lore raw

Re: [PATCH] tools: remove type parameter from xc_physdev_map_pirq{, _msi}()

In reply to Jan Beulich

Hi,

When build the latest xen-unstable(c/s 18311), run into a compilation error:
make[4]: Entering directory `/root/xen-unstable.hg/tools/ioemu-remote/i386-dm'
gcc -I. -I.. -I/root/xen-unstable.hg/tools/ioemu-dir/target-i386 -I/root/xen-unstable.hg/tools/ioemu-dir -MMD -MP -DNEED_CPU_H -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/root/xen-unstable.hg/tools/ioemu-dir/tcg -I/root/xen-unstable.hg/tools/ioemu-dir/tcg/i386 -I/root/xen-unstable.hg/tools/ioemu-dir/fpu -DHAS_AUDIO -DHAS_AUDIO -I/root/xen-unstable.hg/tools/..//tools/libxc -I/root/xen-unstable.hg/tools/..//tools/xenstore -I/root/xen-unstable.hg/tools/..//tools/include -I/root/xen-unstable.hg/tools/..//tools/blktap/lib -Wall -O2 -g -fno-strict-aliasing -O2 -fomit-frame-pointer -m32 -march=i686 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -D__XEN_TOOLS__ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -mno-tls-direct-seg-refs -Wno-unused -Wno-declaration-after-statement -Wno-pointer-sign -DCONFIG_PASSTHROUGH -I../hw -m32 -DUSE_SSE2=1 -msse2 -Wno-unused -Wno-declaration-after-statement -Wno-pointer-sign -DCONFIG_PASSTHROUGH -c -o pass-through.o /root/xen-unstable.hg/tools/ioemu-dir/hw/pass-through.c /root/xen-unstable.hg/tools/ioemu-dir/hw/pass-through.c: In function ‘register_real_device’:
/root/xen-unstable.hg/tools/ioemu-dir/hw/pass-through.c:2826: warning: passing argument 4 of ‘xc_physdev_map_pirq’ makes integer from pointer without a cast
/root/xen-unstable.hg/tools/ioemu-dir/hw/pass-through.c:2826: error: too few arguments to function ‘xc_physdev_map_pirq’
make[4]: *** [pass-through.o] Error 1
make[4]: Leaving directory `/root/xen-unstable.hg/tools/ioemu-remote/i386-dm'
make[3]: *** [subdir-i386-dm] Error 2
make[3]: Leaving directory `/root/xen-unstable.hg/tools/ioemu-remote'
make[2]: *** [subdir-install-ioemu-dir] Error 2
make[2]: Leaving directory `/root/xen-unstable.hg/tools'
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/root/xen-unstable.hg/tools'
make: *** [install-tools] Error 2

Quoted 126 lines · Jan Beulich

.. as it's implied by the function name.

While the patch touches the deprecated ioemu sub-tree, I'm unsure in what shape to submit patches againt the new qemu tree, so ideally the respective parts would just be taken from this patch and also applied to that tree.

Index: 2008-07-21/tools/ioemu/hw/pass-through.c
===================================================================

tools/ioemu/hw/pass-through.c +1 -2
@@ -2785,8 +2785,7 @@ struct pt_dev * register_real_device(PCI
         int pirq = pci_dev->irq;
 
         machine_irq = pci_dev->irq;
-        rc = xc_physdev_map_pirq(xc_handle, domid, MAP_PIRQ_TYPE_GSI,
-                                machine_irq, &pirq);
+        rc = xc_physdev_map_pirq(xc_handle, domid, machine_irq, &pirq);
 
         if ( rc )
         {

Index: 2008-07-21/tools/ioemu/hw/pt-msi.c
===================================================================

tools/ioemu/hw/pt-msi.c +2 -4
@@ -37,8 +37,7 @@ int pt_msi_setup(struct pt_dev *dev)
         return -1;
     }
 
-    if ( xc_physdev_map_pirq_msi(xc_handle, domid, MAP_PIRQ_TYPE_MSI,
-                            AUTO_ASSIGN, &pirq,
+    if ( xc_physdev_map_pirq_msi(xc_handle, domid, AUTO_ASSIGN, &pirq,
 							dev->pci_dev->dev << 3 | dev->pci_dev->func,
 							dev->pci_dev->bus, 0, 1) )
     {
@@ -120,8 +119,7 @@ static int pt_msix_update_one(struct pt_
     /* Check if this entry is already mapped */
     if ( entry->pirq == -1 )
     {
-        ret = xc_physdev_map_pirq_msi(xc_handle, domid, MAP_PIRQ_TYPE_MSI,
-                                AUTO_ASSIGN, &pirq,
+        ret = xc_physdev_map_pirq_msi(xc_handle, domid, AUTO_ASSIGN, &pirq,
                                 dev->pci_dev->dev << 3 | dev->pci_dev->func,
                                 dev->pci_dev->bus, entry_nr, 0);
         if ( ret )

Index: 2008-07-21/tools/libxc/xc_physdev.c
===================================================================

tools/libxc/xc_physdev.c +2 -4
@@ -22,7 +22,6 @@ int xc_physdev_pci_access_modify(int xc_
 
 int xc_physdev_map_pirq(int xc_handle,
                         int domid,
-                        int type,
                         int index,
                         int *pirq)
 {
@@ -33,7 +32,7 @@ int xc_physdev_map_pirq(int xc_handle,
         return -EINVAL;
 
     map.domid = domid;
-    map.type = type;
+    map.type = MAP_PIRQ_TYPE_GSI;
     map.index = index;
     map.pirq = *pirq;
 
@@ -47,7 +46,6 @@ int xc_physdev_map_pirq(int xc_handle,
 
 int xc_physdev_map_pirq_msi(int xc_handle,
                             int domid,
-                            int type,
                             int index,
                             int *pirq,
                             int devfn,
@@ -62,7 +60,7 @@ int xc_physdev_map_pirq_msi(int xc_handl
         return -EINVAL;
 
     map.domid = domid;
-    map.type = type;
+    map.type = MAP_PIRQ_TYPE_MSI;
     map.index = index;
     map.pirq = *pirq;
     map.msi_info.devfn = devfn;

Index: 2008-07-21/tools/libxc/xenctrl.h
===================================================================

tools/libxc/xenctrl.h +0 -2
@@ -907,13 +907,11 @@ int xc_gnttab_set_max_grants(int xcg_han
 
 int xc_physdev_map_pirq(int xc_handle,
                         int domid,
-                        int type,
                         int index,
                         int *pirq);
 
 int xc_physdev_map_pirq_msi(int xc_handle,
                             int domid,
-                            int type,
                             int index,
                             int *pirq,
                             int devfn,

Index: 2008-07-21/tools/python/xen/lowlevel/xc/xc.c
===================================================================

tools/python/xen/lowlevel/xc/xc.c +1 -2
@@ -958,8 +958,7 @@ static PyObject *pyxc_physdev_map_pirq(P
     if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iii", kwd_list,
                                       &dom, &index, &pirq) )
         return NULL;
-    ret = xc_physdev_map_pirq(xc->xc_handle, dom, MAP_PIRQ_TYPE_GSI,
-                             index, &pirq);
+    ret = xc_physdev_map_pirq(xc->xc_handle, dom, index, &pirq);
     if ( ret != 0 )
           return pyxc_error_to_exception();
     return PyLong_FromUnsignedLong(pirq);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Signature · 2 lines
Thanks,
   J
#3 lore raw

Re: [PATCH] tools: remove type parameter from xc_physdev_map_pirq{, _msi}()

Quoted 4 lines · Jonkery Huang

Hi,

When build the latest xen-unstable(c/s 18311), run into a compilation error:
make[4]: Entering directory

It looks to me like you don't have latest xen-unstable checked out. The error looks like qemu-xen-unstable is trying to use a 4-argument form of xc_physdev_map_pirq(), which is the new form. The prototype in xenctrl.h in your xen-unstable is therefore probably out of date.

-- Keir

#4 lore raw

Re: [PATCH] tools: remove type parameter from xc_physdev_map_pirq{, _msi}()

I always use "hg pull" to update which may cause this issue.

Quoted 24 lines · Keir Fraser
Quoted 5 lines · Jonkery Huang

Hi,

When build the latest xen-unstable(c/s 18311), run into a compilation error:
make[4]: Entering directory

It looks to me like you don't have latest xen-unstable checked out. The error looks like qemu-xen-unstable is trying to use a 4-argument form of xc_physdev_map_pirq(), which is the new form. The prototype in xenctrl.h in your xen-unstable is therefore probably out of date.

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Signature · 2 lines
Thanks,
   J
#5 lore raw

Re: [PATCH] tools: remove type parameter from xc_physdev_map_pirq{, _msi}()

You should use "hg pull -u".

Quoted 27 lines · Jonkery Huang

I always use "hg pull" to update which may cause this issue.

Quoted 24 lines · Keir Fraser
Quoted 5 lines · Jonkery Huang

Hi,

When build the latest xen-unstable(c/s 18311), run into a compilation error:
make[4]: Entering directory

It looks to me like you don't have latest xen-unstable checked out. The error looks like qemu-xen-unstable is trying to use a 4-argument form of xc_physdev_map_pirq(), which is the new form. The prototype in xenctrl.h in your xen-unstable is therefore probably out of date.

-- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel