ia64/xen-unstable

changeset 12073:0ae1d493f37c

[XEND] Python API break. Replacing ambiguious 'dom' with 'domid'

Signed-off-by: Alastair Tse <atse@xensource.com>
author acnt2@huggins.lce.cl.cam.ac.uk
date Thu Oct 05 17:29:19 2006 +0100 (2006-10-05)
parents 509285182efb
children ccfc8e4148b2
files tools/python/xen/lowlevel/xc/xc.c tools/python/xen/xend/image.py tools/python/xen/xend/server/iopif.py tools/python/xen/xend/server/pciif.py
line diff
     1.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Thu Oct 05 17:29:19 2006 +0100
     1.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Thu Oct 05 17:29:19 2006 +0100
     1.3 @@ -73,7 +73,7 @@ static PyObject *pyxc_domain_create(XcOb
     1.4          0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef,
     1.5          0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef };
     1.6  
     1.7 -    static char *kwd_list[] = { "dom", "ssidref", "handle", NULL };
     1.8 +    static char *kwd_list[] = { "domid", "ssidref", "handle", NULL };
     1.9  
    1.10      if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iiO", kwd_list,
    1.11                                        &dom, &ssidref, &pyhandle))
    1.12 @@ -144,7 +144,7 @@ static PyObject *pyxc_vcpu_setaffinity(X
    1.13      uint64_t  cpumap = ~0ULL;
    1.14      PyObject *cpulist = NULL;
    1.15  
    1.16 -    static char *kwd_list[] = { "dom", "vcpu", "cpumap", NULL };
    1.17 +    static char *kwd_list[] = { "domid", "vcpu", "cpumap", NULL };
    1.18  
    1.19      if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|iO", kwd_list, 
    1.20                                        &dom, &vcpu, &cpulist) )
    1.21 @@ -171,7 +171,7 @@ static PyObject *pyxc_domain_setcpuweigh
    1.22      uint32_t dom;
    1.23      float cpuweight = 1;
    1.24  
    1.25 -    static char *kwd_list[] = { "dom", "cpuweight", NULL };
    1.26 +    static char *kwd_list[] = { "domid", "cpuweight", NULL };
    1.27  
    1.28      if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|f", kwd_list, 
    1.29                                        &dom, &cpuweight) )
    1.30 @@ -256,7 +256,7 @@ static PyObject *pyxc_domain_getinfo(XcO
    1.31              PyList_SetItem(pyhandle, j, PyInt_FromLong(info[i].handle[j]));
    1.32          info_dict = Py_BuildValue("{s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i"
    1.33                                    ",s:l,s:L,s:l,s:i,s:i}",
    1.34 -                                  "dom",       info[i].domid,
    1.35 +                                  "domid",       info[i].domid,
    1.36                                    "online_vcpus", info[i].nr_online_vcpus,
    1.37                                    "max_vcpu_id", info[i].max_vcpu_id,
    1.38                                    "dying",     info[i].dying,
    1.39 @@ -291,7 +291,7 @@ static PyObject *pyxc_vcpu_getinfo(XcObj
    1.40      int rc, i;
    1.41      uint64_t cpumap;
    1.42  
    1.43 -    static char *kwd_list[] = { "dom", "vcpu", NULL };
    1.44 +    static char *kwd_list[] = { "domid", "vcpu", NULL };
    1.45      
    1.46      if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|i", kwd_list,
    1.47                                        &dom, &vcpu) )
    1.48 @@ -334,7 +334,7 @@ static PyObject *pyxc_linux_build(XcObje
    1.49      unsigned long store_mfn = 0;
    1.50      unsigned long console_mfn = 0;
    1.51  
    1.52 -    static char *kwd_list[] = { "dom", "store_evtchn",
    1.53 +    static char *kwd_list[] = { "domid", "store_evtchn",
    1.54                                  "console_evtchn", "image",
    1.55                                  /* optional */
    1.56                                  "ramdisk", "cmdline", "flags",
    1.57 @@ -375,9 +375,9 @@ static PyObject *pyxc_hvm_build(XcObject
    1.58      int apic = 0;
    1.59      unsigned long store_mfn = 0;
    1.60  
    1.61 -    static char *kwd_list[] = { "dom", "store_evtchn", "memsize", "image",
    1.62 -                                "vcpus", "pae", "acpi", "apic",
    1.63 -                                NULL };
    1.64 +    static char *kwd_list[] = { "domid", "store_evtchn",
    1.65 +				"memsize", "image", "vcpus", "pae", "acpi", "apic",
    1.66 +				NULL };
    1.67      if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiisiiii", kwd_list,
    1.68                                        &dom, &store_evtchn, &memsize,
    1.69                                        &image, &vcpus, &pae, &acpi, &apic) )
    1.70 @@ -397,7 +397,7 @@ static PyObject *pyxc_evtchn_alloc_unbou
    1.71      uint32_t dom, remote_dom;
    1.72      int port;
    1.73  
    1.74 -    static char *kwd_list[] = { "dom", "remote_dom", NULL };
    1.75 +    static char *kwd_list[] = { "domid", "remote_dom", NULL };
    1.76  
    1.77      if ( !PyArg_ParseTupleAndKeywords(args, kwds, "ii", kwd_list,
    1.78                                        &dom, &remote_dom) )
    1.79 @@ -416,7 +416,7 @@ static PyObject *pyxc_physdev_pci_access
    1.80      uint32_t dom;
    1.81      int bus, dev, func, enable, ret;
    1.82  
    1.83 -    static char *kwd_list[] = { "dom", "bus", "dev", "func", "enable", NULL };
    1.84 +    static char *kwd_list[] = { "domid", "bus", "dev", "func", "enable", NULL };
    1.85  
    1.86      if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiii", kwd_list, 
    1.87                                        &dom, &bus, &dev, &func, &enable) )
    1.88 @@ -557,7 +557,7 @@ static PyObject *pyxc_sedf_domain_set(Xc
    1.89      uint32_t domid;
    1.90      uint64_t period, slice, latency;
    1.91      uint16_t extratime, weight;
    1.92 -    static char *kwd_list[] = { "dom", "period", "slice",
    1.93 +    static char *kwd_list[] = { "domid", "period", "slice",
    1.94                                  "latency", "extratime", "weight",NULL };
    1.95      
    1.96      if( !PyArg_ParseTupleAndKeywords(args, kwds, "iLLLhh", kwd_list, 
    1.97 @@ -586,7 +586,7 @@ static PyObject *pyxc_sedf_domain_get(Xc
    1.98          return PyErr_SetFromErrno(xc_error);
    1.99  
   1.100      return Py_BuildValue("{s:i,s:L,s:L,s:L,s:i,s:i}",
   1.101 -                         "domain",    domid,
   1.102 +                         "domid",    domid,
   1.103                           "period",    period,
   1.104                           "slice",     slice,
   1.105                           "latency",   latency,
   1.106 @@ -654,7 +654,7 @@ static PyObject *pyxc_sched_credit_domai
   1.107      uint32_t domid;
   1.108      uint16_t weight;
   1.109      uint16_t cap;
   1.110 -    static char *kwd_list[] = { "dom", "weight", "cap", NULL };
   1.111 +    static char *kwd_list[] = { "domid", "weight", "cap", NULL };
   1.112      static char kwd_type[] = "I|HH";
   1.113      struct xen_domctl_sched_credit sdom;
   1.114      
   1.115 @@ -714,7 +714,7 @@ static PyObject *pyxc_domain_memory_incr
   1.116      unsigned int extent_order = 0 , address_bits = 0;
   1.117      unsigned long nr_extents;
   1.118  
   1.119 -    static char *kwd_list[] = { "dom", "mem_kb", "extent_order", "address_bits", NULL };
   1.120 +    static char *kwd_list[] = { "domid", "mem_kb", "extent_order", "address_bits", NULL };
   1.121  
   1.122      if ( !PyArg_ParseTupleAndKeywords(args, kwds, "il|ii", kwd_list, 
   1.123                                        &dom, &mem_kb, &extent_order, &address_bits) )
   1.124 @@ -739,7 +739,7 @@ static PyObject *pyxc_domain_ioport_perm
   1.125      uint32_t dom;
   1.126      int first_port, nr_ports, allow_access, ret;
   1.127  
   1.128 -    static char *kwd_list[] = { "dom", "first_port", "nr_ports", "allow_access", NULL };
   1.129 +    static char *kwd_list[] = { "domid", "first_port", "nr_ports", "allow_access", NULL };
   1.130  
   1.131      if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiii", kwd_list, 
   1.132                                        &dom, &first_port, &nr_ports, &allow_access) )
   1.133 @@ -762,7 +762,7 @@ static PyObject *pyxc_domain_irq_permiss
   1.134      uint32_t dom;
   1.135      int pirq, allow_access, ret;
   1.136  
   1.137 -    static char *kwd_list[] = { "dom", "pirq", "allow_access", NULL };
   1.138 +    static char *kwd_list[] = { "domid", "pirq", "allow_access", NULL };
   1.139  
   1.140      if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iii", kwd_list, 
   1.141                                        &dom, &pirq, &allow_access) )
   1.142 @@ -785,7 +785,7 @@ static PyObject *pyxc_domain_iomem_permi
   1.143      uint32_t dom;
   1.144      unsigned long first_pfn, nr_pfns, allow_access, ret;
   1.145  
   1.146 -    static char *kwd_list[] = { "dom", "first_pfn", "nr_pfns", "allow_access", NULL };
   1.147 +    static char *kwd_list[] = { "domid", "first_pfn", "nr_pfns", "allow_access", NULL };
   1.148  
   1.149      if ( !PyArg_ParseTupleAndKeywords(args, kwds, "illi", kwd_list, 
   1.150                                        &dom, &first_pfn, &nr_pfns, &allow_access) )
     2.1 --- a/tools/python/xen/xend/image.py	Thu Oct 05 17:29:19 2006 +0100
     2.2 +++ b/tools/python/xen/xend/image.py	Thu Oct 05 17:29:19 2006 +0100
     2.3 @@ -188,7 +188,7 @@ class LinuxImageHandler(ImageHandler):
     2.4          store_evtchn = self.vm.getStorePort()
     2.5          console_evtchn = self.vm.getConsolePort()
     2.6  
     2.7 -        log.debug("dom            = %d", self.vm.getDomid())
     2.8 +        log.debug("domid          = %d", self.vm.getDomid())
     2.9          log.debug("image          = %s", self.kernel)
    2.10          log.debug("store_evtchn   = %d", store_evtchn)
    2.11          log.debug("console_evtchn = %d", console_evtchn)
    2.12 @@ -197,7 +197,7 @@ class LinuxImageHandler(ImageHandler):
    2.13          log.debug("vcpus          = %d", self.vm.getVCpuCount())
    2.14          log.debug("features       = %s", self.vm.getFeatures())
    2.15  
    2.16 -        return xc.linux_build(dom            = self.vm.getDomid(),
    2.17 +        return xc.linux_build(domid          = self.vm.getDomid(),
    2.18                                image          = self.kernel,
    2.19                                store_evtchn   = store_evtchn,
    2.20                                console_evtchn = console_evtchn,
    2.21 @@ -217,7 +217,7 @@ class PPC_LinuxImageHandler(LinuxImageHa
    2.22          store_evtchn = self.vm.getStorePort()
    2.23          console_evtchn = self.vm.getConsolePort()
    2.24  
    2.25 -        log.debug("dom            = %d", self.vm.getDomid())
    2.26 +        log.debug("domid          = %d", self.vm.getDomid())
    2.27          log.debug("image          = %s", self.kernel)
    2.28          log.debug("store_evtchn   = %d", store_evtchn)
    2.29          log.debug("console_evtchn = %d", console_evtchn)
    2.30 @@ -228,7 +228,7 @@ class PPC_LinuxImageHandler(LinuxImageHa
    2.31  
    2.32          devtree = FlatDeviceTree.build(self)
    2.33  
    2.34 -        return xc.linux_build(dom            = self.vm.getDomid(),
    2.35 +        return xc.linux_build(domid          = self.vm.getDomid(),
    2.36                                image          = self.kernel,
    2.37                                store_evtchn   = store_evtchn,
    2.38                                console_evtchn = console_evtchn,
    2.39 @@ -271,7 +271,7 @@ class HVMImageHandler(ImageHandler):
    2.40      def buildDomain(self):
    2.41          store_evtchn = self.vm.getStorePort()
    2.42  
    2.43 -        log.debug("dom            = %d", self.vm.getDomid())
    2.44 +        log.debug("domid          = %d", self.vm.getDomid())
    2.45          log.debug("image          = %s", self.kernel)
    2.46          log.debug("store_evtchn   = %d", store_evtchn)
    2.47          log.debug("memsize        = %d", self.vm.getMemoryTarget() / 1024)
    2.48 @@ -282,7 +282,7 @@ class HVMImageHandler(ImageHandler):
    2.49  
    2.50          self.register_shutdown_watch()
    2.51  
    2.52 -        return xc.hvm_build(dom            = self.vm.getDomid(),
    2.53 +        return xc.hvm_build(domid          = self.vm.getDomid(),
    2.54                              image          = self.kernel,
    2.55                              store_evtchn   = store_evtchn,
    2.56                              memsize        = self.vm.getMemoryTarget() / 1024,
     3.1 --- a/tools/python/xen/xend/server/iopif.py	Thu Oct 05 17:29:19 2006 +0100
     3.2 +++ b/tools/python/xen/xend/server/iopif.py	Thu Oct 05 17:29:19 2006 +0100
     3.3 @@ -72,7 +72,7 @@ class IOPortsController(DevController):
     3.4              raise VmError('ioports: Invalid i/o range: %s - %s' %
     3.5                            (io_from, io_to))
     3.6  
     3.7 -        rc = xc.domain_ioport_permission(dom          = self.getDomid(),
     3.8 +        rc = xc.domain_ioport_permission(domid        = self.getDomid(),
     3.9                                           first_port   = io_from,
    3.10                                           nr_ports     = io_to - io_from + 1,
    3.11                                           allow_access = True)
     4.1 --- a/tools/python/xen/xend/server/pciif.py	Thu Oct 05 17:29:19 2006 +0100
     4.2 +++ b/tools/python/xen/xend/server/pciif.py	Thu Oct 05 17:29:19 2006 +0100
     4.3 @@ -155,9 +155,9 @@ class PciController(DevController):
     4.4          PCIQuirk(dev.vendor, dev.device, dev.subvendor, dev.subdevice, domain, 
     4.5                  bus, slot, func)
     4.6  
     4.7 -	for (start, size) in dev.ioports:
     4.8 +        for (start, size) in dev.ioports:
     4.9              log.debug('pci: enabling ioport 0x%x/0x%x'%(start,size))
    4.10 -            rc = xc.domain_ioport_permission(dom = fe_domid, first_port = start,
    4.11 +            rc = xc.domain_ioport_permission(domid = fe_domid, first_port = start,
    4.12                      nr_ports = size, allow_access = True)
    4.13              if rc<0:
    4.14                  raise VmError(('pci: failed to configure I/O ports on device '+
    4.15 @@ -171,7 +171,7 @@ class PciController(DevController):
    4.16  
    4.17              log.debug('pci: enabling iomem 0x%x/0x%x pfn 0x%x/0x%x'% \
    4.18                      (start,size,start_pfn,nr_pfns))
    4.19 -            rc = xc.domain_iomem_permission(dom = fe_domid,
    4.20 +            rc = xc.domain_iomem_permission(domid =  fe_domid,
    4.21                      first_pfn = start_pfn,
    4.22                      nr_pfns = nr_pfns,
    4.23                      allow_access = True)
    4.24 @@ -181,7 +181,7 @@ class PciController(DevController):
    4.25  
    4.26          if dev.irq>0:
    4.27              log.debug('pci: enabling irq %d'%dev.irq)
    4.28 -            rc = xc.domain_irq_permission(dom = fe_domid, pirq = dev.irq,
    4.29 +            rc = xc.domain_irq_permission(domid =  fe_domid, pirq = dev.irq,
    4.30                      allow_access = True)
    4.31              if rc<0:
    4.32                  raise VmError(('pci: failed to configure irq on device '+