ia64/xen-unstable

changeset 19513:5c69f98c348e

xm, xend: Replace "vslt" with "vslot"

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Apr 07 10:15:25 2009 +0100 (2009-04-07)
parents 71077a0fd289
children 3881da2d25ec
files tools/python/xen/xend/XendConfig.py tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/server/pciif.py tools/python/xen/xm/create.dtd tools/python/xen/xm/main.py tools/python/xen/xm/xenapi_create.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConfig.py	Tue Apr 07 10:14:35 2009 +0100
     1.2 +++ b/tools/python/xen/xend/XendConfig.py	Tue Apr 07 10:15:25 2009 +0100
     1.3 @@ -1617,10 +1617,10 @@ class XendConfig(dict):
     1.4          # extendend like this:
     1.5          #
     1.6          # [device, [pci, [dev, [domain, 0], [bus, 0], [slot, 1], [func, 2],
     1.7 -        #                      [vslt, 0]],
     1.8 +        #                      [vslot, 0]],
     1.9          #                [state, 'Initialising']]]
    1.10          #
    1.11 -        # 'vslt' shows the virtual hotplug slot number which the PCI device
    1.12 +        # 'vslot' shows the virtual hotplug slot number which the PCI device
    1.13          # is inserted in. This is only effective for HVM domains.
    1.14          #
    1.15          # state 'Initialising' indicates that the device is being attached,
    1.16 @@ -1628,7 +1628,7 @@ class XendConfig(dict):
    1.17          #
    1.18          # The Dict looks like this:
    1.19          #
    1.20 -        # { devs: [{domain: 0, bus: 0, slot: 1, func: 2, vslt: 0}],
    1.21 +        # { devs: [{domain: 0, bus: 0, slot: 1, func: 2, vslot: 0}],
    1.22          #   states: ['Initialising'] }
    1.23  
    1.24          dev_config = {}
     2.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Apr 07 10:14:35 2009 +0100
     2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Apr 07 10:15:25 2009 +0100
     2.3 @@ -596,7 +596,7 @@ class XendDomainInfo:
     2.4          #update the vslot info
     2.5          count = 0;
     2.6          for x in pci_devs:
     2.7 -            x['vslt'] = slot_list[count]
     2.8 +            x['vslot'] = slot_list[count]
     2.9              count += 1
    2.10  
    2.11  
    2.12 @@ -619,9 +619,9 @@ class XendDomainInfo:
    2.13              pci_conf = self.info['devices'][dev_uuid][1]
    2.14              pci_devs = pci_conf['devs']
    2.15              for x in pci_devs:
    2.16 -                if (int(x['vslt'], 16) == int(new_dev['vslt'], 16) and
    2.17 -                   int(x['vslt'], 16) != AUTO_PHP_SLOT):
    2.18 -                    raise VmError("vslot %s already have a device." % (new_dev['vslt']))
    2.19 +                if (int(x['vslot'], 16) == int(new_dev['vslot'], 16) and
    2.20 +                   int(x['vslot'], 16) != AUTO_PHP_SLOT):
    2.21 +                    raise VmError("vslot %s already have a device." % (new_dev['vslot']))
    2.22  
    2.23                  if (int(x['domain'], 16) == int(new_dev['domain'], 16) and
    2.24                     int(x['bus'], 16)    == int(new_dev['bus'], 16) and
    2.25 @@ -708,7 +708,7 @@ class XendDomainInfo:
    2.26                  new_dev['slot'],
    2.27                  new_dev['func'],
    2.28                  opts,
    2.29 -                new_dev['vslt'])
    2.30 +                new_dev['vslot'])
    2.31          self.image.signalDeviceModel('pci-ins', 'pci-inserted', bdf_str)
    2.32  
    2.33  
    2.34 @@ -789,36 +789,36 @@ class XendDomainInfo:
    2.35              if pci_state == 'Initialising':
    2.36                  # HVM PCI device attachment
    2.37                  self.hvm_pci_device_create(dev_config)
    2.38 -                # Update vslt
    2.39 -                vslt = xstransact.Read("/local/domain/0/device-model/%i/parameter"
    2.40 -                                       % self.getDomid())
    2.41 -                dev['vslt'] = vslt
    2.42 +                # Update vslot
    2.43 +                vslot = xstransact.Read("/local/domain/0/device-model/%i/parameter"
    2.44 +                                        % self.getDomid())
    2.45 +                dev['vslot'] = vslot
    2.46                  for n in sxp.children(pci_dev):
    2.47 -                    if(n[0] == 'vslt'):
    2.48 -                        n[1] = vslt
    2.49 +                    if(n[0] == 'vslot'):
    2.50 +                        n[1] = vslot
    2.51              else:
    2.52                  # HVM PCI device detachment
    2.53                  existing_dev_uuid = sxp.child_value(existing_dev_info, 'uuid')
    2.54                  existing_pci_conf = self.info['devices'][existing_dev_uuid][1]
    2.55                  existing_pci_devs = existing_pci_conf['devs']
    2.56 -                vslt = AUTO_PHP_SLOT_STR
    2.57 +                vslot = AUTO_PHP_SLOT_STR
    2.58                  for x in existing_pci_devs:
    2.59                      if ( int(x['domain'], 16) == int(dev['domain'], 16) and
    2.60                           int(x['bus'], 16) == int(dev['bus'], 16) and
    2.61                           int(x['slot'], 16) == int(dev['slot'], 16) and
    2.62                           int(x['func'], 16) == int(dev['func'], 16) ):
    2.63 -                        vslt = x['vslt']
    2.64 +                        vslot = x['vslot']
    2.65                          break
    2.66 -                if vslt == AUTO_PHP_SLOT_STR:
    2.67 +                if vslot == AUTO_PHP_SLOT_STR:
    2.68                      raise VmError("Device %04x:%02x:%02x.%01x is not connected"
    2.69                                    % (int(dev['domain'],16), int(dev['bus'],16),
    2.70                                       int(dev['slot'],16), int(dev['func'],16)))
    2.71 -                self.hvm_destroyPCIDevice(int(vslt, 16))
    2.72 -                # Update vslt
    2.73 -                dev['vslt'] = vslt
    2.74 +                self.hvm_destroyPCIDevice(int(vslot, 16))
    2.75 +                # Update vslot
    2.76 +                dev['vslot'] = vslot
    2.77                  for n in sxp.children(pci_dev):
    2.78 -                    if(n[0] == 'vslt'):
    2.79 -                        n[1] = vslt
    2.80 +                    if(n[0] == 'vslot'):
    2.81 +                        n[1] = vslot
    2.82  
    2.83          # If pci platform does not exist, create and exit.
    2.84          if existing_dev_info is None:
    2.85 @@ -1046,7 +1046,7 @@ class XendDomainInfo:
    2.86          #find the pass-through device with the virtual slot
    2.87          devnum = 0
    2.88          for x in pci_conf['devs']:
    2.89 -            if int(x['vslt'], 16) == vslot:
    2.90 +            if int(x['vslot'], 16) == vslot:
    2.91                  break
    2.92              devnum += 1
    2.93  
    2.94 @@ -3666,7 +3666,7 @@ class XendDomainInfo:
    2.95                      ['bus', '0x%02x' % ppci.get_bus()],
    2.96                      ['slot', '0x%02x' % ppci.get_slot()],
    2.97                      ['func', '0x%1x' % ppci.get_func()],
    2.98 -                    ['vslt', '0x%02x' % xenapi_pci.get('hotplug_slot')],
    2.99 +                    ['vslot', '0x%02x' % xenapi_pci.get('hotplug_slot')],
   2.100                      ['opts', dpci_opts],
   2.101                      ['uuid', dpci_uuid]
   2.102                  ],
     3.1 --- a/tools/python/xen/xend/server/pciif.py	Tue Apr 07 10:14:35 2009 +0100
     3.2 +++ b/tools/python/xen/xend/server/pciif.py	Tue Apr 07 10:15:25 2009 +0100
     3.3 @@ -83,9 +83,9 @@ class PciController(DevController):
     3.4                  opts = reduce(lambda x, y: x+','+y, opts)
     3.5                  back['opts-%i' % pcidevid] = opts
     3.6  
     3.7 -            vslt = pci_config.get('vslt')
     3.8 -            if vslt is not None:
     3.9 -                vslots = vslots + vslt + ";"
    3.10 +            vslot = pci_config.get('vslot')
    3.11 +            if vslot is not None:
    3.12 +                vslots = vslots + vslot + ";"
    3.13  
    3.14              back['dev-%i' % pcidevid] = "%04x:%02x:%02x.%01x" % \
    3.15                                          (domain, bus, slot, func)
    3.16 @@ -170,9 +170,9 @@ class PciController(DevController):
    3.17                  # Update vslots
    3.18                  if back.get('vslots') is not None:
    3.19                      vslots = old_vslots
    3.20 -                    for vslt in back['vslots'].split(';'):
    3.21 -                        if vslt != '':
    3.22 -                            vslots = vslots.replace(vslt + ';', '', 1)
    3.23 +                    for vslot in back['vslots'].split(';'):
    3.24 +                        if vslot != '':
    3.25 +                            vslots = vslots.replace(vslot + ';', '', 1)
    3.26                      if vslots == '':
    3.27                          self.removeBackend(devid, 'vslots')
    3.28                      else:
    3.29 @@ -219,9 +219,9 @@ class PciController(DevController):
    3.30                  #append vslot info
    3.31                  if vslots is not None:
    3.32                      try:
    3.33 -                        dev_dict['vslt'] = slot_list[i]
    3.34 +                        dev_dict['vslot'] = slot_list[i]
    3.35                      except IndexError:
    3.36 -                        dev_dict['vslt'] = AUTO_PHP_SLOT_STR
    3.37 +                        dev_dict['vslot'] = AUTO_PHP_SLOT_STR
    3.38  
    3.39                  pci_devs.append(dev_dict)
    3.40  
     4.1 --- a/tools/python/xen/xm/create.dtd	Tue Apr 07 10:14:35 2009 +0100
     4.2 +++ b/tools/python/xen/xm/create.dtd	Tue Apr 07 10:15:25 2009 +0100
     4.3 @@ -89,7 +89,7 @@
     4.4                   slot            CDATA #REQUIRED
     4.5                   func            CDATA #REQUIRED
     4.6                   opts_str        CDATA #IMPLIED
     4.7 -                 vslt            CDATA #IMPLIED>
     4.8 +                 vslot           CDATA #IMPLIED>
     4.9  
    4.10  <!ELEMENT vscsi  EMPTY>
    4.11  <!ATTLIST vscsi  p-dev           CDATA #REQUIRED
     5.1 --- a/tools/python/xen/xm/main.py	Tue Apr 07 10:14:35 2009 +0100
     5.2 +++ b/tools/python/xen/xm/main.py	Tue Apr 07 10:15:25 2009 +0100
     5.3 @@ -2155,7 +2155,7 @@ def xm_pci_list(args):
     5.4                  "bus":      "0x%02x" % int(ppci_record["bus"]),
     5.5                  "slot":     "0x%02x" % int(ppci_record["slot"]),
     5.6                  "func":     "0x%01x" % int(ppci_record["func"]),
     5.7 -                "vslt":     "0x%02x" % \
     5.8 +                "vslot":    "0x%02x" % \
     5.9                              int(server.xenapi.DPCI.get_hotplug_slot(dpci_ref))
    5.10              }
    5.11              devs.append(dev)
    5.12 @@ -2166,10 +2166,10 @@ def xm_pci_list(args):
    5.13      if len(devs) == 0:
    5.14          return
    5.15  
    5.16 -    has_vslt = devs[0].has_key('vslt')
    5.17 -    if has_vslt:
    5.18 +    has_vslot = devs[0].has_key('vslot')
    5.19 +    if has_vslot:
    5.20          hdr_str = 'VSlt domain   bus   slot   func'
    5.21 -        fmt_str =  "%(vslt)-3s    %(domain)-3s  %(bus)-3s   %(slot)-3s    %(func)-3s    "
    5.22 +        fmt_str =  "%(vslot)-3s    %(domain)-3s  %(bus)-3s   %(slot)-3s    %(func)-3s    "
    5.23      else:
    5.24          hdr_str = 'domain   bus   slot   func'
    5.25          fmt_str =  "%(domain)-3s  %(bus)-3s   %(slot)-3s    %(func)-3s    "
    5.26 @@ -2441,16 +2441,16 @@ def parse_pci_configuration(args, state,
    5.27      dom = args[0]
    5.28      pci_dev_str = args[1]
    5.29      if len(args) == 3:
    5.30 -        vslt = args[2]
    5.31 +        vslot = args[2]
    5.32      else:
    5.33 -        vslt = AUTO_PHP_SLOT_STR
    5.34 +        vslot = AUTO_PHP_SLOT_STR
    5.35      pci=['pci']
    5.36      pci_match = re.match(r"((?P<domain>[0-9a-fA-F]{1,4})[:,])?" + \
    5.37              r"(?P<bus>[0-9a-fA-F]{1,2})[:,]" + \
    5.38              r"(?P<slot>[0-9a-fA-F]{1,2})[.,]" + \
    5.39              r"(?P<func>[0-7])$", pci_dev_str)
    5.40      if pci_match == None:
    5.41 -        raise OptionError("Invalid argument: %s %s" % (pci_dev_str,vslt))
    5.42 +        raise OptionError("Invalid argument: %s %s" % (pci_dev_str, vslot))
    5.43      pci_dev_info = pci_match.groupdict('0')
    5.44  
    5.45      try:
    5.46 @@ -2458,13 +2458,13 @@ def parse_pci_configuration(args, state,
    5.47                  ['bus', '0x'+ pci_dev_info['bus']],
    5.48                  ['slot', '0x'+ pci_dev_info['slot']],
    5.49                  ['func', '0x'+ pci_dev_info['func']],
    5.50 -                ['vslt', '0x%x' % int(vslt, 16)]]
    5.51 +                ['vslot', '0x%x' % int(vslot, 16)]]
    5.52          if len(opts) > 0:
    5.53              pci_bdf.append(['opts', opts])
    5.54          pci.append(pci_bdf)
    5.55  
    5.56      except:
    5.57 -        raise OptionError("Invalid argument: %s %s" % (pci_dev_str,vslt))
    5.58 +        raise OptionError("Invalid argument: %s %s" % (pci_dev_str, vslot))
    5.59      pci.append(['state', state])
    5.60  
    5.61      return (dom, pci)
    5.62 @@ -2494,7 +2494,7 @@ def xm_pci_attach(args):
    5.63          bus = int(sxp.child_value(pci_dev, 'bus'), 16)
    5.64          slot = int(sxp.child_value(pci_dev, 'slot'), 16)
    5.65          func = int(sxp.child_value(pci_dev, 'func'), 16)
    5.66 -        vslt = int(sxp.child_value(pci_dev, 'vslt'), 16)
    5.67 +        vslot = int(sxp.child_value(pci_dev, 'vslot'), 16)
    5.68          name = "%04x:%02x:%02x.%01x" % (domain, bus, slot, func)
    5.69  
    5.70          target_ref = None
    5.71 @@ -2508,7 +2508,7 @@ def xm_pci_attach(args):
    5.72          dpci_record = {
    5.73              "VM":           get_single_vm(dom),
    5.74              "PPCI":         target_ref,
    5.75 -            "hotplug_slot": vslt,
    5.76 +            "hotplug_slot": vslot,
    5.77              "options":      dict(config_pci_opts)
    5.78          }
    5.79          server.xenapi.DPCI.create(dpci_record)
    5.80 @@ -2667,7 +2667,7 @@ def xm_pci_detach(args):
    5.81          bus = int(sxp.child_value(pci_dev, 'bus'), 16)
    5.82          slot = int(sxp.child_value(pci_dev, 'slot'), 16)
    5.83          func = int(sxp.child_value(pci_dev, 'func'), 16)
    5.84 -        vslt = int(sxp.child_value(pci_dev, 'vslt'), 16)
    5.85 +        vslot = int(sxp.child_value(pci_dev, 'vslot'), 16)
    5.86          name = "%04x:%02x:%02x.%01x" % (domain, bus, slot, func)
    5.87  
    5.88          target_ref = None
     6.1 --- a/tools/python/xen/xm/xenapi_create.py	Tue Apr 07 10:14:35 2009 +0100
     6.2 +++ b/tools/python/xen/xm/xenapi_create.py	Tue Apr 07 10:15:25 2009 +0100
     6.3 @@ -937,8 +937,8 @@ class sxp2xml:
     6.4                      = get_child_by_name(dev_sxp, "slot", "0")
     6.5                  pci.attributes["func"] \
     6.6                      = get_child_by_name(dev_sxp, "func", "0")
     6.7 -                pci.attributes["vslt"] \
     6.8 -                    = get_child_by_name(dev_sxp, "vslt", "0")
     6.9 +                pci.attributes["vslot"] \
    6.10 +                    = get_child_by_name(dev_sxp, "vslot", "0")
    6.11                  for opt in get_child_by_name(dev_sxp, "opts", ""):
    6.12                      if len(opt) > 0:
    6.13                          pci_opt = document.createElement("pci_opt")