Skip to contentSkip to conversation

Replace "vslt" with "vslot" in xm and xend

PATCH In review Masaki Kanno 1 participant 2 messages Apr 7, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Replace "vslt" with "vslot" in xm and xend

Hi Keir,

I found problems of PCI device assignments.
I would like to fix the problems for Xen 3.4.

At the first step, could you possibly apply this patch?

Best regards,
Kan

tools/python/xen/xend/XendConfig.py +3 -3
diff -r accf139b2eb9 tools/python/xen/xend/XendConfig.py
@@ -1617,10 +1617,10 @@ class XendConfig(dict):
         # extendend like this:
         #
         # [device, [pci, [dev, [domain, 0], [bus, 0], [slot, 1], [func, 2],
-        #                      [vslt, 0]],
+        #                      [vslot, 0]],
         #                [state, 'Initialising']]]
         #
-        # 'vslt' shows the virtual hotplug slot number which the PCI device
+        # 'vslot' shows the virtual hotplug slot number which the PCI device
         # is inserted in. This is only effective for HVM domains.
         #
         # state 'Initialising' indicates that the device is being attached,
@@ -1628,7 +1628,7 @@ class XendConfig(dict):
         #
         # The Dict looks like this:
         #
-        # { devs: [{domain: 0, bus: 0, slot: 1, func: 2, vslt: 0}],
+        # { devs: [{domain: 0, bus: 0, slot: 1, func: 2, vslot: 0}],
         #   states: ['Initialising'] }
 
         dev_config = {}
tools/python/xen/xend/XendDomainInfo.py +21 -21

94 lines not on this page · raw message

tools/python/xen/xend/server/pciif.py +8 -8
diff -r accf139b2eb9 tools/python/xen/xend/server/pciif.py
@@ -83,9 +83,9 @@ class PciController(DevController):
                 opts = reduce(lambda x, y: x+','+y, opts)
                 back['opts-%i' % pcidevid] = opts
 
-            vslt = pci_config.get('vslt')
-            if vslt is not None:
-                vslots = vslots + vslt + ";"
+            vslot = pci_config.get('vslot')
+            if vslot is not None:
+                vslots = vslots + vslot + ";"
 
             back['dev-%i' % pcidevid] = "%04x:%02x:%02x.%01x" % \
                                         (domain, bus, slot, func)
@@ -170,9 +170,9 @@ class PciController(DevController):
                 # Update vslots
                 if back.get('vslots') is not None:
                     vslots = old_vslots
-                    for vslt in back['vslots'].split(';'):
-                        if vslt != '':
-                            vslots = vslots.replace(vslt + ';', '', 1)
+                    for vslot in back['vslots'].split(';'):
+                        if vslot != '':
+                            vslots = vslots.replace(vslot + ';', '', 1)
                     if vslots == '':
                         self.removeBackend(devid, 'vslots')
                     else:
@@ -219,9 +219,9 @@ class PciController(DevController):
                 #append vslot info
                 if vslots is not None:
                     try:
-                        dev_dict['vslt'] = slot_list[i]
+                        dev_dict['vslot'] = slot_list[i]
                     except IndexError:
-                        dev_dict['vslt'] = AUTO_PHP_SLOT_STR
+                        dev_dict['vslot'] = AUTO_PHP_SLOT_STR
 
                 pci_devs.append(dev_dict)
 
tools/python/xen/xm/create.dtd +1 -1
diff -r accf139b2eb9 tools/python/xen/xm/create.dtd
@@ -89,7 +89,7 @@
                  slot            CDATA #REQUIRED
                  func            CDATA #REQUIRED
                  opts_str        CDATA #IMPLIED
-                 vslt            CDATA #IMPLIED>
+                 vslot           CDATA #IMPLIED>
 
 <!ELEMENT vscsi  EMPTY>
 <!ATTLIST vscsi  p-dev           CDATA #REQUIRED
tools/python/xen/xm/main.py +13 -13
diff -r accf139b2eb9 tools/python/xen/xm/main.py
@@ -2155,7 +2155,7 @@ def xm_pci_list(args):
                 "bus":      "0x%02x" % int(ppci_record["bus"]),
                 "slot":     "0x%02x" % int(ppci_record["slot"]),
                 "func":     "0x%01x" % int(ppci_record["func"]),
-                "vslt":     "0x%02x" % \
+                "vslot":    "0x%02x" % \
                             int(server.xenapi.DPCI.get_hotplug_slot(dpci_ref))
             }
             devs.append(dev)
@@ -2166,10 +2166,10 @@ def xm_pci_list(args):
     if len(devs) == 0:
         return
 
-    has_vslt = devs[0].has_key('vslt')
-    if has_vslt:
+    has_vslot = devs[0].has_key('vslot')
+    if has_vslot:
         hdr_str = 'VSlt domain   bus   slot   func'
-        fmt_str =  "%(vslt)-3s    %(domain)-3s  %(bus)-3s   %(slot)-3s    %(func)-3s    "
+        fmt_str =  "%(vslot)-3s    %(domain)-3s  %(bus)-3s   %(slot)-3s    %(func)-3s    "
     else:
         hdr_str = 'domain   bus   slot   func'
         fmt_str =  "%(domain)-3s  %(bus)-3s   %(slot)-3s    %(func)-3s    "
@@ -2441,16 +2441,16 @@ def parse_pci_configuration(args, state,
     dom = args[0]
     pci_dev_str = args[1]
     if len(args) == 3:
-        vslt = args[2]
-    else:
-        vslt = AUTO_PHP_SLOT_STR
+        vslot = args[2]
+    else:
+        vslot = AUTO_PHP_SLOT_STR
     pci=['pci']
     pci_match = re.match(r"((?P<domain>[0-9a-fA-F]{1,4})[:,])?" + \
             r"(?P<bus>[0-9a-fA-F]{1,2})[:,]" + \
             r"(?P<slot>[0-9a-fA-F]{1,2})[.,]" + \
             r"(?P<func>[0-7])$", pci_dev_str)
     if pci_match == None:
-        raise OptionError("Invalid argument: %s %s" % (pci_dev_str,vslt))
+        raise OptionError("Invalid argument: %s %s" % (pci_dev_str, vslot))
     pci_dev_info = pci_match.groupdict('0')
 
     try:
@@ -2458,13 +2458,13 @@ def parse_pci_configuration(args, state,
                 ['bus', '0x'+ pci_dev_info['bus']],
                 ['slot', '0x'+ pci_dev_info['slot']],
                 ['func', '0x'+ pci_dev_info['func']],
-                ['vslt', '0x%x' % int(vslt, 16)]]
+                ['vslot', '0x%x' % int(vslot, 16)]]
         if len(opts) > 0:
             pci_bdf.append(['opts', opts])
         pci.append(pci_bdf)
 
     except:
-        raise OptionError("Invalid argument: %s %s" % (pci_dev_str,vslt))
+        raise OptionError("Invalid argument: %s %s" % (pci_dev_str, vslot))
     pci.append(['state', state])
 
     return (dom, pci)
@@ -2494,7 +2494,7 @@ def xm_pci_attach(args):
         bus = int(sxp.child_value(pci_dev, 'bus'), 16)
         slot = int(sxp.child_value(pci_dev, 'slot'), 16)
         func = int(sxp.child_value(pci_dev, 'func'), 16)
-        vslt = int(sxp.child_value(pci_dev, 'vslt'), 16)
+        vslot = int(sxp.child_value(pci_dev, 'vslot'), 16)
         name = "%04x:%02x:%02x.%01x" % (domain, bus, slot, func)
 
         target_ref = None
@@ -2508,7 +2508,7 @@ def xm_pci_attach(args):
         dpci_record = {
             "VM":           get_single_vm(dom),
             "PPCI":         target_ref,
-            "hotplug_slot": vslt,
+            "hotplug_slot": vslot,
             "options":      dict(config_pci_opts)
         }
         server.xenapi.DPCI.create(dpci_record)
@@ -2667,7 +2667,7 @@ def xm_pci_detach(args):
         bus = int(sxp.child_value(pci_dev, 'bus'), 16)
         slot = int(sxp.child_value(pci_dev, 'slot'), 16)
         func = int(sxp.child_value(pci_dev, 'func'), 16)
-        vslt = int(sxp.child_value(pci_dev, 'vslt'), 16)
+        vslot = int(sxp.child_value(pci_dev, 'vslot'), 16)
         name = "%04x:%02x:%02x.%01x" % (domain, bus, slot, func)
 
         target_ref = None
tools/python/xen/xm/xenapi_create.py +2 -2
diff -r accf139b2eb9 tools/python/xen/xm/xenapi_create.py
@@ -937,8 +937,8 @@ class sxp2xml:
                     = get_child_by_name(dev_sxp, "slot", "0")
                 pci.attributes["func"] \
                     = get_child_by_name(dev_sxp, "func", "0")
-                pci.attributes["vslt"] \
-                    = get_child_by_name(dev_sxp, "vslt", "0")
+                pci.attributes["vslot"] \
+                    = get_child_by_name(dev_sxp, "vslot", "0")
                 for opt in get_child_by_name(dev_sxp, "opts", ""):
                     if len(opt) > 0:
                         pci_opt = document.createElement("pci_opt")

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

#1 lore raw

Hi Keir,

Thanks for your work!

Best regards,
Kan

Quoted 18 lines · Masaki Kanno

Hi Keir,

I found problems of PCI device assignments.
I would like to fix the problems for Xen 3.4.

At the first step, could you possibly apply this patch?

Best regards,
Kan

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