)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":7,"context_line":"PCI devices resource tracker"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"PCI device need to be schedule according the resource status.the PCI"},{"line_number":10,"context_line":"tracker provoide the central contorl of the PCI resouces."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Discovered PCI devices take by PCI tracker to track their status. and"},{"line_number":13,"context_line":"provide functions for compute node components to update, check, claim"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":30,"id":"AAAASn%2F%2F9z0%3D","line":10,"updated":"2013-08-27 15:47:30.000000000","message":"\"PCI devices need to be scheduled according the status of the resources. The PCI tracker provides central control of the PCI resources.\"","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":7,"context_line":"PCI devices resource tracker"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"PCI device need to be schedule according the resource status.the PCI"},{"line_number":10,"context_line":"tracker provoide the central contorl of the PCI resouces."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Discovered PCI devices take by PCI tracker to track their status. and"},{"line_number":13,"context_line":"provide functions for compute node components to update, check, claim"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":30,"id":"AAAASn%2F%2F8vY%3D","line":10,"in_reply_to":"AAAASn%2F%2F9z0%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Discovered PCI devices take by PCI tracker to track their status. and"},{"line_number":13,"context_line":"provide functions for compute node components to update, check, claim"},{"line_number":14,"context_line":"the PCI devices resources."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"PCI Tracker also update PCI stats which provide infomation to scheduler."},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":30,"id":"AAAASn%2F%2F9zs%3D","line":14,"updated":"2013-08-27 15:47:30.000000000","message":"\"Discovered PCI devices are passed to the PCI tracker to track their status, and provide functions for compute node components to update, check, and claim PCI resources.\"","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Discovered PCI devices take by PCI tracker to track their status. and"},{"line_number":13,"context_line":"provide functions for compute node components to update, check, claim"},{"line_number":14,"context_line":"the PCI devices resources."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"PCI Tracker also update PCI stats which provide infomation to scheduler."},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":30,"id":"AAAASn%2F%2F8vg%3D","line":14,"in_reply_to":"AAAASn%2F%2F9zs%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":13,"context_line":"provide functions for compute node components to update, check, claim"},{"line_number":14,"context_line":"the PCI devices resources."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"PCI Tracker also update PCI stats which provide infomation to scheduler."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"bp:pci-passthrough-base"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":30,"id":"AAAASn%2F%2F9zk%3D","line":16,"updated":"2013-08-27 15:47:30.000000000","message":"\"The PCI Tracker also updates PCI stats which provides information to the scheduler.\"","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":13,"context_line":"provide functions for compute node components to update, check, claim"},{"line_number":14,"context_line":"the PCI devices resources."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"PCI Tracker also update PCI stats which provide infomation to scheduler."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"bp:pci-passthrough-base"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":30,"id":"AAAASn%2F%2F8vk%3D","line":16,"in_reply_to":"AAAASn%2F%2F9zk%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done.\n\nI use \" updates PCI stats which provide information\".","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"ce09d6115ae8e33e605b3b67119ec3d5e3f3e908","unresolved":false,"context_lines":[{"line_number":7,"context_line":"PCI devices resource tracker"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"PCI device need to be scheduled according the resource status. The PCI"},{"line_number":10,"context_line":"tracker provoides central contorl of the PCI resouces."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Discovered PCI devices are passed to the PCI tracker to track their status,"},{"line_number":13,"context_line":"and to provide functions for compute node components to update, check, claim"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"AAAASn%2F%2FzO8%3D","line":10,"updated":"2013-08-29 12:20:13.000000000","message":"Spelling: provides, control, resources","commit_id":"4855239497050c9ee03fed627c5f41d6b59eddc6"}],"nova/exception.py":[{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":1414,"context_line":""},{"line_number":1415,"context_line":""},{"line_number":1416,"context_line":"class PciTrackerInvalidNodeId(NovaException):"},{"line_number":1417,"context_line":"    mst_fmt \u003d _(\"Invalid to change %(node_id)s to %(new_node_id)\")"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9zY%3D","line":1417,"updated":"2013-08-27 15:47:30.000000000","message":"s/Invalid to change/Cannot change/","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":1414,"context_line":""},{"line_number":1415,"context_line":""},{"line_number":1416,"context_line":"class PciTrackerInvalidNodeId(NovaException):"},{"line_number":1417,"context_line":"    mst_fmt \u003d _(\"Invalid to change %(node_id)s to %(new_node_id)\")"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F8uQ%3D","line":1417,"in_reply_to":"AAAASn%2F%2F9zY%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"}],"nova/pci/pci.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"0bf713f8b57e3eba7fa7fe26f85b42ecf0c31234","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from oslo.config import cfg"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"pci_opts \u003d ["},{"line_number":29,"context_line":"    cfg.MultiStrOpt(\u0027compute_devices_whitelist\u0027,"},{"line_number":30,"context_line":"                default\u003d[],"},{"line_number":31,"context_line":"                help\u003d\u0027White list for devices available to VMs.\u0027"},{"line_number":32,"context_line":"                     \u0027\"compute_devices_whitelist\u003dBDF:domain:bus:slot:function,\u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F5jQ%3D","line":29,"updated":"2013-07-09 15:26:58.000000000","message":"Where is this config variable intended to be set. On each compute node, or on the schedular nodes ? I\u0027m presuming it is the former, to allow a different filter on each host.","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"738662caffc65e85bcfffe8381b6cf97394f7c7c","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from oslo.config import cfg"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"pci_opts \u003d ["},{"line_number":29,"context_line":"    cfg.MultiStrOpt(\u0027compute_devices_whitelist\u0027,"},{"line_number":30,"context_line":"                default\u003d[],"},{"line_number":31,"context_line":"                help\u003d\u0027White list for devices available to VMs.\u0027"},{"line_number":32,"context_line":"                     \u0027\"compute_devices_whitelist\u003dBDF:domain:bus:slot:function,\u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F5iY%3D","line":29,"in_reply_to":"AAAAP3%2F%2F5jQ%3D","updated":"2013-07-09 15:30:42.000000000","message":"On compute node.","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"fb6e4a11847f9e7e0e2e195d29b8f5e04b89fd8d","unresolved":false,"context_lines":[{"line_number":30,"context_line":"                default\u003d[],"},{"line_number":31,"context_line":"                help\u003d\u0027White list for devices available to VMs.\u0027"},{"line_number":32,"context_line":"                     \u0027\"compute_devices_whitelist\u003dBDF:domain:bus:slot:function,\u0027"},{"line_number":33,"context_line":"                     \u0027PCI:vendor_id\u003d0x8086:product_id\u003d0x443\"\u0027"},{"line_number":34,"context_line":"               )"},{"line_number":35,"context_line":"   ]"},{"line_number":36,"context_line":"CONF \u003d cfg.CONF"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F2Zs%3D","line":33,"updated":"2013-07-10 14:00:44.000000000","message":"I would prefer to use for json string instead of list of string sin some strange kind of format.","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"fb6e4a11847f9e7e0e2e195d29b8f5e04b89fd8d","unresolved":false,"context_lines":[{"line_number":47,"context_line":"_PCI_VENDOR_REGEX \u003d re.compile(_PCI_VENDOR_PATTERN)"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"def PciDeviceMatch(pci_dev, spec):"},{"line_number":51,"context_line":"    \"\"\"Check if the pci_dev meet spec requirement"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    Spec is a list with potential requirement, each entry is a dictionary."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F2XI%3D","line":50,"updated":"2013-07-10 14:00:44.000000000","message":"1) don\u0027t use camel case in function names so\n2) specs instead of spec (because there is a lot of spec)\n\n  def pci_device_match(pci_dev, specs):","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"fb6e4a11847f9e7e0e2e195d29b8f5e04b89fd8d","unresolved":false,"context_lines":[{"line_number":47,"context_line":"_PCI_VENDOR_REGEX \u003d re.compile(_PCI_VENDOR_PATTERN)"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"def PciDeviceMatch(pci_dev, spec):"},{"line_number":51,"context_line":"    \"\"\"Check if the pci_dev meet spec requirement"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    Spec is a list with potential requirement, each entry is a dictionary."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F2RE%3D","line":50,"updated":"2013-07-10 14:00:44.000000000","message":"1) don\u0027t use camel case in functions: \n2) spec is a list so it should be at least specs\n\nso\n  def pci_device_match(dev, spec)","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"3de69d2f15f709ca136b3cef20b9b0fddfdbd0f6","unresolved":false,"context_lines":[{"line_number":47,"context_line":"_PCI_VENDOR_REGEX \u003d re.compile(_PCI_VENDOR_PATTERN)"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"def PciDeviceMatch(pci_dev, spec):"},{"line_number":51,"context_line":"    \"\"\"Check if the pci_dev meet spec requirement"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    Spec is a list with potential requirement, each entry is a dictionary."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F2D0%3D","line":50,"in_reply_to":"AAAAP3%2F%2F2RE%3D","updated":"2013-07-10 14:42:51.000000000","message":"1) thanks . Will update it.\n\n2) IMO, I\u0027d call each item as a spec entry, while the whole as a spec. After all, it\u0027s just one requirement. (In fact, it was specs in first version)","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"fb6e4a11847f9e7e0e2e195d29b8f5e04b89fd8d","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    In future, this spec should be extended to support PCI extra_spec"},{"line_number":62,"context_line":"    atribute"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    \"\"\""},{"line_number":65,"context_line":"    def _match_spec_entry(dev, spec):"},{"line_number":66,"context_line":"        for k, v in spec.items():"},{"line_number":67,"context_line":"            if pci_dev.get(k) !\u003d v:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F2Q0%3D","line":64,"updated":"2013-07-10 14:00:44.000000000","message":"This method could be simplified:\n\n\tdev_match \u003d lambda s : all(pci_dev.get(k) \u003d\u003d v for k, v in s.iteritems())\n\treturn any(dev_match(spec) for spec in specs)","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"fb6e4a11847f9e7e0e2e195d29b8f5e04b89fd8d","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    In future, this spec should be extended to support PCI extra_spec"},{"line_number":62,"context_line":"    atribute"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    \"\"\""},{"line_number":65,"context_line":"    def _match_spec_entry(dev, spec):"},{"line_number":66,"context_line":"        for k, v in spec.items():"},{"line_number":67,"context_line":"            if pci_dev.get(k) !\u003d v:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F2TM%3D","line":64,"updated":"2013-07-10 14:00:44.000000000","message":"def pci_device_match(pci_dev, specs):\n      match_dev \u003d lambda s : all(pci_dev.get(k) \u003d\u003d v for k, v in s.iteritems())\n      return any(match_dev(spec) for spec in specs)","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"3de69d2f15f709ca136b3cef20b9b0fddfdbd0f6","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    In future, this spec should be extended to support PCI extra_spec"},{"line_number":62,"context_line":"    atribute"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    \"\"\""},{"line_number":65,"context_line":"    def _match_spec_entry(dev, spec):"},{"line_number":66,"context_line":"        for k, v in spec.items():"},{"line_number":67,"context_line":"            if pci_dev.get(k) !\u003d v:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F2C4%3D","line":64,"in_reply_to":"AAAAP3%2F%2F2TM%3D","updated":"2013-07-10 14:42:51.000000000","message":"Thanks and will update it.","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"fb6e4a11847f9e7e0e2e195d29b8f5e04b89fd8d","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _get_dev_by_bdf(self, devs, bdf):"},{"line_number":86,"context_line":"        \"\"\"Return first device with the bdf.\"\"\""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        for p in devs:"},{"line_number":89,"context_line":"            if (p.get(\u0027address\u0027) \u003d\u003d bdf):"},{"line_number":90,"context_line":"                return p"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F2NU%3D","line":87,"updated":"2013-07-10 14:00:44.000000000","message":"as address is not nullable we could use [] instead of get()\n  return next((dev for dev in devs if dev[\u0027address\u0027] \u003d\u003d bdf), None)","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"fb6e4a11847f9e7e0e2e195d29b8f5e04b89fd8d","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        self.spec \u003d spec"},{"line_number":223,"context_line":"        super(PciHostDevicesFilter, self).__init__()"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def device_assignable(self, dev):"},{"line_number":226,"context_line":"        raise NotImplementedError()"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F2RU%3D","line":225,"updated":"2013-07-10 14:00:44.000000000","message":"I like more decorator \n@abstractmetod","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"3de69d2f15f709ca136b3cef20b9b0fddfdbd0f6","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        self.spec \u003d spec"},{"line_number":223,"context_line":"        super(PciHostDevicesFilter, self).__init__()"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def device_assignable(self, dev):"},{"line_number":226,"context_line":"        raise NotImplementedError()"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F2Cs%3D","line":225,"in_reply_to":"AAAAP3%2F%2F2RU%3D","updated":"2013-07-10 14:42:51.000000000","message":"sure.","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"fb6e4a11847f9e7e0e2e195d29b8f5e04b89fd8d","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        raise NotImplementedError()"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"class PciHostDevicesFilterBlank(object):"},{"line_number":230,"context_line":"    def __init__(self):"},{"line_number":231,"context_line":"        super(PciHostDevicesFilterBlank, self).__init__()"},{"line_number":232,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F2ak%3D","line":229,"updated":"2013-07-10 14:00:44.000000000","message":"I don\u0027t like name of this method, and I think that this should be subclass of PciHostDevicesFilter","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"3de69d2f15f709ca136b3cef20b9b0fddfdbd0f6","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        raise NotImplementedError()"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"class PciHostDevicesFilterBlank(object):"},{"line_number":230,"context_line":"    def __init__(self):"},{"line_number":231,"context_line":"        super(PciHostDevicesFilterBlank, self).__init__()"},{"line_number":232,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F2Ck%3D","line":229,"in_reply_to":"AAAAP3%2F%2F2ak%3D","updated":"2013-07-10 14:42:51.000000000","message":"oops, yes, will change it.","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"fb6e4a11847f9e7e0e2e195d29b8f5e04b89fd8d","unresolved":false,"context_lines":[{"line_number":227,"context_line":""},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"class PciHostDevicesFilterBlank(object):"},{"line_number":230,"context_line":"    def __init__(self):"},{"line_number":231,"context_line":"        super(PciHostDevicesFilterBlank, self).__init__()"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    def device_assignable(self, dev):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAP3%2F%2F2Rg%3D","line":230,"updated":"2013-07-10 14:00:44.000000000","message":"this could be removed","commit_id":"231b5fe3f1fed13d3123515fa9c194c28fc7b842"}],"nova/pci/pci_manager.py":[{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"b83845b76cb92cf9e40056c5e59c7a97d3592fb4","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright (c) 2013 Intel, Inc."},{"line_number":4,"context_line":"# Copyright (c) 2013 OpenStack Foundation"},{"line_number":5,"context_line":"# All Rights Reserved."},{"line_number":6,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAQn%2F%2B9jo%3D","line":3,"updated":"2013-08-10 05:35:23.000000000","message":"Corporation","commit_id":"39258a967adf7139e070dfccfea2791dfa3e8605"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"b83845b76cb92cf9e40056c5e59c7a97d3592fb4","unresolved":false,"context_lines":[{"line_number":33,"context_line":"class PciDevTracker(object):"},{"line_number":34,"context_line":"    def __init__(self, host, node):"},{"line_number":35,"context_line":"        super(PciDevTracker, self).__init__()"},{"line_number":36,"context_line":"        self.staled \u003d []"},{"line_number":37,"context_line":"        self.host \u003d host"},{"line_number":38,"context_line":"        self.node \u003d node"},{"line_number":39,"context_line":"        ctxt \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAQn%2F%2B85w%3D","line":36,"updated":"2013-08-10 05:35:23.000000000","message":"Is self.staled \u003d self.allocations + self.claims? If so, I suggest you not to use staled below.","commit_id":"39258a967adf7139e070dfccfea2791dfa3e8605"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"b83845b76cb92cf9e40056c5e59c7a97d3592fb4","unresolved":false,"context_lines":[{"line_number":58,"context_line":"                else:"},{"line_number":59,"context_line":"                    self.allocations[uuid] \u003d [dev]"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _filter_devices_for_spec(self, request_spec, pci_devs):"},{"line_number":62,"context_line":"        return [p for p in pci_devs"},{"line_number":63,"context_line":"                if pci_utils.pci_device_prop_match(p, request_spec)]"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAQn%2F%2B9Ak%3D","line":61,"updated":"2013-08-10 05:35:23.000000000","message":"This function was duplicated. See also https://review.openstack.org/#/c/39890/\n\nThe same function was defined there. Please consider to use common code base.","commit_id":"39258a967adf7139e070dfccfea2791dfa3e8605"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"b83845b76cb92cf9e40056c5e59c7a97d3592fb4","unresolved":false,"context_lines":[{"line_number":170,"context_line":"                return dev"},{"line_number":171,"context_line":"        return None"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def return_instance_devs(self, instance):"},{"line_number":174,"context_line":"        for dev in self.pci_devs:"},{"line_number":175,"context_line":"            if (dev[\u0027status\u0027] in (\u0027clamined\u0027, \u0027allocated\u0027) and"},{"line_number":176,"context_line":"                    dev[\u0027instance_uuid\u0027] \u003d\u003d instance[\u0027uuid\u0027]):"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAQn%2F%2B858%3D","line":173,"updated":"2013-08-10 05:35:23.000000000","message":"def free_instance(self, instance), better?\nregarding claim_instance() and allocate_instance() below.","commit_id":"39258a967adf7139e070dfccfea2791dfa3e8605"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"b83845b76cb92cf9e40056c5e59c7a97d3592fb4","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        # note (yjiang5): if devices is only clamied, it\u0027s not"},{"line_number":183,"context_line":"        # contained in instance yet"},{"line_number":184,"context_line":"        if \u0027pci_devices\u0027 in instance:"},{"line_number":185,"context_line":"            instance.pop(\u0027pci_devices\u0027)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    def claim_instance(self, instance):"},{"line_number":188,"context_line":"        pci_requests \u003d pci_request.get_instance_pci_requests(instance)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAQn%2F%2B89c%3D","line":185,"updated":"2013-08-10 05:35:23.000000000","message":"del instance[\u0027pci_devices\u0027], better?","commit_id":"39258a967adf7139e070dfccfea2791dfa3e8605"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"b83845b76cb92cf9e40056c5e59c7a97d3592fb4","unresolved":false,"context_lines":[{"line_number":199,"context_line":"    def allocate_instance(self, instance):"},{"line_number":200,"context_line":"        map(lambda x: x.allocate(instance), [dev for dev in self.pci_devs"},{"line_number":201,"context_line":"            if dev[\u0027status\u0027] \u003d\u003d \u0027claimed\u0027 and"},{"line_number":202,"context_line":"               dev[\u0027instance_uuid\u0027] \u003d\u003d instance[\u0027uuid\u0027]])"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def update_pci_for_instance(self, instance):"},{"line_number":205,"context_line":"        uuid \u003d instance[\u0027uuid\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAQn%2F%2B870%3D","line":202,"updated":"2013-08-10 05:35:23.000000000","message":"why do you need to get \"dev\" from self.pci_devs and check the conditions (\u003d\u003d\u0027claimed\u0027 and \u003d\u003dinstance[\u0027uuid\u0027])? The function claim_instance() returns what you want. Can you use the result of claim_instance()?\n\nor\n\ndef claim_instance(self, instance):\n\n......\n\nself.claims[uuid] \u003d devs\n\n\ndef allocate_instance(self, instance):\n\n...... \u003cto use self.claims[uuid]\u003e","commit_id":"39258a967adf7139e070dfccfea2791dfa3e8605"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"b83845b76cb92cf9e40056c5e59c7a97d3592fb4","unresolved":false,"context_lines":[{"line_number":220,"context_line":"            if uuid not in self.allocations:"},{"line_number":221,"context_line":"                devs \u003d self.claim_instance(instance)"},{"line_number":222,"context_line":"                self.allocate_instance(instance)"},{"line_number":223,"context_line":"                self.allocations[uuid] \u003d devs"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def update_pci_for_migration(self, instance, sign\u003d1):"},{"line_number":226,"context_line":"        uuid \u003d instance[\u0027uuid\u0027]"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAQn%2F%2B87g%3D","line":223,"updated":"2013-08-10 05:35:23.000000000","message":"or e.g.\n\ndevs \u003d self.claim_instance(instance)\n\nself.allocate_instance(instance, devs)?\n\nself.allocations[uuid] \u003d devs","commit_id":"39258a967adf7139e070dfccfea2791dfa3e8605"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"b83845b76cb92cf9e40056c5e59c7a97d3592fb4","unresolved":false,"context_lines":[{"line_number":221,"context_line":"                devs \u003d self.claim_instance(instance)"},{"line_number":222,"context_line":"                self.allocate_instance(instance)"},{"line_number":223,"context_line":"                self.allocations[uuid] \u003d devs"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def update_pci_for_migration(self, instance, sign\u003d1):"},{"line_number":226,"context_line":"        uuid \u003d instance[\u0027uuid\u0027]"},{"line_number":227,"context_line":"        if sign \u003d\u003d 1 and uuid not in self.claims:"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAQn%2F%2B86M%3D","line":224,"updated":"2013-08-10 05:35:23.000000000","message":"again I strongly suggest you to combine them into one function.\n\nself.return_instance_devs() should include self.allocations.pop(uuid) or self.claims.pop(uuid)\n\nself.allocate_instance() should include self.allocations[uuid] \u003d devs\n\nself.claim_instance() should include self.claims[uuid] \u003d devs\n\nAnd sometimes in the above, if you ignore the return value of pop(), you can use \"del xxx\".","commit_id":"39258a967adf7139e070dfccfea2791dfa3e8605"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"38d23eac489edc71a7043d8fa9dfe0bed8fe7e19","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        return alloc"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    @property"},{"line_number":97,"context_line":"    def all_devices(self):"},{"line_number":98,"context_line":"        return self.pci_devs"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def save(self, context):"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAARH%2F%2F64g%3D","line":97,"updated":"2013-08-15 07:01:56.000000000","message":"how about name property to \u0027all_devs\u0027, in consistent with free_devs?","commit_id":"05ec76c41158c0af1a478c230ce3e66fcb00646e"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"bc66c93cc0b3e337184316b2cb0daec906a78809","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        return alloc"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    @property"},{"line_number":97,"context_line":"    def all_devices(self):"},{"line_number":98,"context_line":"        return self.pci_devs"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def save(self, context):"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAARH%2F%2F0mo%3D","line":97,"in_reply_to":"AAAARH%2F%2F64g%3D","updated":"2013-08-17 01:11:34.000000000","message":"Done","commit_id":"05ec76c41158c0af1a478c230ce3e66fcb00646e"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"38d23eac489edc71a7043d8fa9dfe0bed8fe7e19","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                    # node(yjiang5) no need to update stats if an assigned"},{"line_number":135,"context_line":"                    # device is hot removed"},{"line_number":136,"context_line":"                    self.stats.consume_device(existed)"},{"line_number":137,"context_line":"            elif existed[\u0027address\u0027] in exist_addrs \u0026 new_addrs:"},{"line_number":138,"context_line":"                new_value \u003d next((dev for dev in devices if"},{"line_number":139,"context_line":"                    dev[\u0027address\u0027] \u003d\u003d existed[\u0027address\u0027]))"},{"line_number":140,"context_line":"                dev[\u0027host\u0027] \u003d self.host"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAARH%2F%2F63c%3D","line":137,"updated":"2013-08-15 07:01:56.000000000","message":"Do we need this if? \n\nfor a in setA:\n  if a in setA and not in setB:\n     ....\n  elif a in setA and in setB: (this should always be true)","commit_id":"05ec76c41158c0af1a478c230ce3e66fcb00646e"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"bc66c93cc0b3e337184316b2cb0daec906a78809","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                    # node(yjiang5) no need to update stats if an assigned"},{"line_number":135,"context_line":"                    # device is hot removed"},{"line_number":136,"context_line":"                    self.stats.consume_device(existed)"},{"line_number":137,"context_line":"            elif existed[\u0027address\u0027] in exist_addrs \u0026 new_addrs:"},{"line_number":138,"context_line":"                new_value \u003d next((dev for dev in devices if"},{"line_number":139,"context_line":"                    dev[\u0027address\u0027] \u003d\u003d existed[\u0027address\u0027]))"},{"line_number":140,"context_line":"                dev[\u0027host\u0027] \u003d self.host"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAARH%2F%2F0ms%3D","line":137,"in_reply_to":"AAAARH%2F%2F63c%3D","updated":"2013-08-17 01:11:34.000000000","message":"Done","commit_id":"05ec76c41158c0af1a478c230ce3e66fcb00646e"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"bc1ecaf5b264f67123f5b53e939b6846cbbf1397","unresolved":false,"context_lines":[{"line_number":32,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class PciDevTracker(object):"},{"line_number":36,"context_line":"    def __init__(self, node_id\u003dNone):"},{"line_number":37,"context_line":"        super(PciDevTracker, self).__init__()"},{"line_number":38,"context_line":"        self.staled \u003d {}"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAARn%2F%2F1ic%3D","line":35,"updated":"2013-08-21 10:54:51.000000000","message":"API docs needed to describe the purpose / usage of this class.\n\nAlso some of the public methods are missing docs.","commit_id":"6cb0394a5986fd73ba4f06f44e7d5fd2142ae6a2"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"d2545087ebdf93bb0b56bc7134b23b25488f273f","unresolved":false,"context_lines":[{"line_number":32,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class PciDevTracker(object):"},{"line_number":36,"context_line":"    def __init__(self, node_id\u003dNone):"},{"line_number":37,"context_line":"        super(PciDevTracker, self).__init__()"},{"line_number":38,"context_line":"        self.staled \u003d {}"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAARn%2F%2FyWM%3D","line":35,"in_reply_to":"AAAARn%2F%2F1ic%3D","updated":"2013-08-22 20:49:23.000000000","message":"Done","commit_id":"6cb0394a5986fd73ba4f06f44e7d5fd2142ae6a2"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"62803db871d9294a84fe0110d50670db8a3fa3ca","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        return self.pci_devs"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def save(self, context):"},{"line_number":122,"context_line":"        map(lambda x: x.save(context), [dev for dev in self.pci_devs"},{"line_number":123,"context_line":"                                        if dev.obj_what_changed()])"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        self.pci_devs.objects \u003d [dev for dev in self.pci_devs"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAASX%2F%2F%2FMA%3D","line":122,"updated":"2013-08-22 21:13:20.000000000","message":"you are creating 2 unnecessary array \n\n  for dev in self.pci_devs:\n    if dev.obj_what_changed():\n      x.save(context)\n\nwill be better","commit_id":"1927e620adad1b78be8df03023a1b6b8604184ff"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"825d39457223610e2ca84833038e1ad57dd0e464","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        return self.pci_devs"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def save(self, context):"},{"line_number":122,"context_line":"        map(lambda x: x.save(context), [dev for dev in self.pci_devs"},{"line_number":123,"context_line":"                                        if dev.obj_what_changed()])"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        self.pci_devs.objects \u003d [dev for dev in self.pci_devs"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAASX%2F%2F%2B1M%3D","line":122,"in_reply_to":"AAAASX%2F%2F%2FMA%3D","updated":"2013-08-22 23:33:28.000000000","message":"Done.","commit_id":"1927e620adad1b78be8df03023a1b6b8604184ff"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"62803db871d9294a84fe0110d50670db8a3fa3ca","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        return devs"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    def _allocate_instance(self, instance, devs):"},{"line_number":208,"context_line":"        map(lambda x: x.allocate(instance), devs)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def _free_device(self, dev, instance\u003dNone):"},{"line_number":211,"context_line":"        dev.free(instance)"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAASX%2F%2F%2FMg%3D","line":208,"updated":"2013-08-22 21:13:20.000000000","message":"This creates unnecessary array use for \n\n  for dev in devs:\n    dev.allocate(instance)","commit_id":"1927e620adad1b78be8df03023a1b6b8604184ff"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"825d39457223610e2ca84833038e1ad57dd0e464","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        return devs"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    def _allocate_instance(self, instance, devs):"},{"line_number":208,"context_line":"        map(lambda x: x.allocate(instance), devs)"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def _free_device(self, dev, instance\u003dNone):"},{"line_number":211,"context_line":"        dev.free(instance)"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAASX%2F%2F%2Byc%3D","line":208,"in_reply_to":"AAAASX%2F%2F%2FMg%3D","updated":"2013-08-22 23:33:28.000000000","message":"Done","commit_id":"1927e620adad1b78be8df03023a1b6b8604184ff"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"62803db871d9294a84fe0110d50670db8a3fa3ca","unresolved":false,"context_lines":[{"line_number":271,"context_line":"        for uuid in self.claims.keys():"},{"line_number":272,"context_line":"            if uuid not in existed:"},{"line_number":273,"context_line":"                devs \u003d self.claims.pop(uuid)"},{"line_number":274,"context_line":"                map(self._free_device, devs)"},{"line_number":275,"context_line":"        for uuid in self.allocations.keys():"},{"line_number":276,"context_line":"            if uuid not in existed:"},{"line_number":277,"context_line":"                devs \u003d self.allocations.pop(uuid)"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAASX%2F%2F%2FLo%3D","line":274,"updated":"2013-08-22 21:13:20.000000000","message":"use for here also","commit_id":"1927e620adad1b78be8df03023a1b6b8604184ff"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"825d39457223610e2ca84833038e1ad57dd0e464","unresolved":false,"context_lines":[{"line_number":271,"context_line":"        for uuid in self.claims.keys():"},{"line_number":272,"context_line":"            if uuid not in existed:"},{"line_number":273,"context_line":"                devs \u003d self.claims.pop(uuid)"},{"line_number":274,"context_line":"                map(self._free_device, devs)"},{"line_number":275,"context_line":"        for uuid in self.allocations.keys():"},{"line_number":276,"context_line":"            if uuid not in existed:"},{"line_number":277,"context_line":"                devs \u003d self.allocations.pop(uuid)"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAASX%2F%2F%2ByA%3D","line":274,"in_reply_to":"AAAASX%2F%2F%2FLo%3D","updated":"2013-08-22 23:33:28.000000000","message":"Done","commit_id":"1927e620adad1b78be8df03023a1b6b8604184ff"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"62803db871d9294a84fe0110d50670db8a3fa3ca","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        for uuid in self.allocations.keys():"},{"line_number":276,"context_line":"            if uuid not in existed:"},{"line_number":277,"context_line":"                devs \u003d self.allocations.pop(uuid)"},{"line_number":278,"context_line":"                map(self._free_device, devs)"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"    def set_compute_node_id(self, node_id):"},{"line_number":281,"context_line":"        \"\"\"Set the compute node id that this object is tracking for."}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAASX%2F%2F%2FLc%3D","line":278,"updated":"2013-08-22 21:13:20.000000000","message":"use for here also","commit_id":"1927e620adad1b78be8df03023a1b6b8604184ff"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"825d39457223610e2ca84833038e1ad57dd0e464","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        for uuid in self.allocations.keys():"},{"line_number":276,"context_line":"            if uuid not in existed:"},{"line_number":277,"context_line":"                devs \u003d self.allocations.pop(uuid)"},{"line_number":278,"context_line":"                map(self._free_device, devs)"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"    def set_compute_node_id(self, node_id):"},{"line_number":281,"context_line":"        \"\"\"Set the compute node id that this object is tracking for."}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAASX%2F%2F%2Bx8%3D","line":278,"in_reply_to":"AAAASX%2F%2F%2FLc%3D","updated":"2013-08-22 23:33:28.000000000","message":"Done","commit_id":"1927e620adad1b78be8df03023a1b6b8604184ff"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        self.stale \u003d {}"},{"line_number":57,"context_line":"        self.node_id \u003d node_id"},{"line_number":58,"context_line":"        self.stats \u003d pci_stats.PciDeviceStats()"},{"line_number":59,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":60,"context_line":"        if node_id:"},{"line_number":61,"context_line":"            self.pci_devs \u003d pci_device.PciDeviceList.get_by_compute_node("},{"line_number":62,"context_line":"                context, node_id)"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9xU%3D","line":59,"updated":"2013-08-27 15:47:30.000000000","message":"ctxt is not used anywhere","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        self.stale \u003d {}"},{"line_number":57,"context_line":"        self.node_id \u003d node_id"},{"line_number":58,"context_line":"        self.stats \u003d pci_stats.PciDeviceStats()"},{"line_number":59,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":60,"context_line":"        if node_id:"},{"line_number":61,"context_line":"            self.pci_devs \u003d pci_device.PciDeviceList.get_by_compute_node("},{"line_number":62,"context_line":"                context, node_id)"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F8ts%3D","line":59,"in_reply_to":"AAAASn%2F%2F9xU%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        Pci_requests is a list composed of pci_request."},{"line_number":100,"context_line":"        pci_request is a dictionary including 3 keys:"},{"line_number":101,"context_line":"            count: how many pci devices required, by default is 1"},{"line_number":102,"context_line":"            spec: the pci property that the devices should meet"},{"line_number":103,"context_line":"            alias_name: alias the pci_request is translated from, optional"},{"line_number":104,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9ug%3D","line":101,"updated":"2013-08-27 15:47:30.000000000","message":"lines 99-101:\n\n        pci_requests is a list of pci_request dictionaries. Each \n        dictionary has three keys:\n            count: number of pci devices required, default 1","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        Pci_requests is a list composed of pci_request."},{"line_number":100,"context_line":"        pci_request is a dictionary including 3 keys:"},{"line_number":101,"context_line":"            count: how many pci devices required, by default is 1"},{"line_number":102,"context_line":"            spec: the pci property that the devices should meet"},{"line_number":103,"context_line":"            alias_name: alias the pci_request is translated from, optional"},{"line_number":104,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F8tE%3D","line":101,"in_reply_to":"AAAASn%2F%2F9ug%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":110,"context_line":"                request,"},{"line_number":111,"context_line":"                [p for p in self.free_devs if p not in alloc])"},{"line_number":112,"context_line":"            if not available:"},{"line_number":113,"context_line":"                return []"},{"line_number":114,"context_line":"            alloc.extend(available)"},{"line_number":115,"context_line":"        return alloc"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9sU%3D","line":113,"updated":"2013-08-27 15:47:30.000000000","message":"So this means if any single request cannot find any free devices, then the entire request list will fail? I think this should be mentioned in the doc string.","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":110,"context_line":"                request,"},{"line_number":111,"context_line":"                [p for p in self.free_devs if p not in alloc])"},{"line_number":112,"context_line":"            if not available:"},{"line_number":113,"context_line":"                return []"},{"line_number":114,"context_line":"            alloc.extend(available)"},{"line_number":115,"context_line":"        return alloc"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F8sI%3D","line":113,"in_reply_to":"AAAASn%2F%2F9sU%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        \"\"\"Sync the Pci device tracker with hypervisor information."},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"        Pci device hot plug can happen while system running, thus we sync"},{"line_number":137,"context_line":"        with hypervisor periodically, fetching all devices information"},{"line_number":138,"context_line":"        from hypervisor, update the tracker and sync the DB information."},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        Although a device should not be hot-plugged when assigned to a guest,"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9oI%3D","line":137,"updated":"2013-08-27 15:47:30.000000000","message":"Hot plug implies the system is running. I suggest: \"To support PCI device hot plug, we sync with the hypervisor periodically, ...\"","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        Although a device should not be hot-plugged when assigned to a guest,"},{"line_number":141,"context_line":"        but possibly hypervisor has no such gurantee, thus we will at least"},{"line_number":142,"context_line":"        give a warning if a device is changed or removed while assigned"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        \"\"\""},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9nU%3D","line":142,"updated":"2013-08-27 15:47:30.000000000","message":"\"Devices should not be hot-plugged when assigned to a guest, but the hypervisor has no such guarantee. The best we can do is give a warning if a device is changed or removed while assigned.\"","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        Although a device should not be hot-plugged when assigned to a guest,"},{"line_number":141,"context_line":"        but possibly hypervisor has no such gurantee, thus we will at least"},{"line_number":142,"context_line":"        give a warning if a device is changed or removed while assigned"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        \"\"\""},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F8qg%3D","line":142,"in_reply_to":"AAAASn%2F%2F9nU%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        new_addrs \u003d set([dev[\u0027address\u0027] for dev in devices])"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"        for existed in self.pci_devs:"},{"line_number":150,"context_line":"            if existed[\u0027address\u0027] in exist_addrs - new_addrs:"},{"line_number":151,"context_line":"                try:"},{"line_number":152,"context_line":"                    existed.remove()"},{"line_number":153,"context_line":"                except exception.PciDeviceInvalidStatus as e:"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9Iw%3D","line":150,"updated":"2013-08-27 15:47:30.000000000","message":"I don\u0027t see a unit test for this code path (removal)?","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                    LOG.warn(_(\"Trying to remove device with %(status)s\""},{"line_number":155,"context_line":"                        \"ownership %(instance_uuid)s\"), existed)"},{"line_number":156,"context_line":"                    # note (yjiang5) remove the device by force so that"},{"line_number":157,"context_line":"                    # db entry is cleaned in next syn"},{"line_number":158,"context_line":"                    existed.status \u003d \u0027removed\u0027"},{"line_number":159,"context_line":"                else:"},{"line_number":160,"context_line":"                    # node(yjiang5) no need to update stats if an assigned"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9ls%3D","line":157,"updated":"2013-08-27 15:47:30.000000000","message":"s/syn/sync/","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                    LOG.warn(_(\"Trying to remove device with %(status)s\""},{"line_number":155,"context_line":"                        \"ownership %(instance_uuid)s\"), existed)"},{"line_number":156,"context_line":"                    # note (yjiang5) remove the device by force so that"},{"line_number":157,"context_line":"                    # db entry is cleaned in next syn"},{"line_number":158,"context_line":"                    existed.status \u003d \u0027removed\u0027"},{"line_number":159,"context_line":"                else:"},{"line_number":160,"context_line":"                    # node(yjiang5) no need to update stats if an assigned"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F8p8%3D","line":157,"in_reply_to":"AAAASn%2F%2F9ls%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":155,"context_line":"                        \"ownership %(instance_uuid)s\"), existed)"},{"line_number":156,"context_line":"                    # note (yjiang5) remove the device by force so that"},{"line_number":157,"context_line":"                    # db entry is cleaned in next syn"},{"line_number":158,"context_line":"                    existed.status \u003d \u0027removed\u0027"},{"line_number":159,"context_line":"                else:"},{"line_number":160,"context_line":"                    # node(yjiang5) no need to update stats if an assigned"},{"line_number":161,"context_line":"                    # device is hot removed"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9kc%3D","line":158,"updated":"2013-08-27 15:47:30.000000000","message":"Consider creating a common PCI file with constants for status values.","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":166,"context_line":"                new_value[\u0027compute_node_id\u0027] \u003d self.node_id"},{"line_number":167,"context_line":"                try:"},{"line_number":168,"context_line":"                    existed.update_device(new_value)"},{"line_number":169,"context_line":"                except exception.PciDeviceInvalidStatus:"},{"line_number":170,"context_line":"                    \"\"\""},{"line_number":171,"context_line":"                    Pci properties may changes while assigned because of"},{"line_number":172,"context_line":"                    hotplug or config changes. Although normally this should"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9GE%3D","line":169,"updated":"2013-08-27 15:47:30.000000000","message":"Looks like you need to decorate PciDevice.update_device() with @check_device_status() ?","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":166,"context_line":"                new_value[\u0027compute_node_id\u0027] \u003d self.node_id"},{"line_number":167,"context_line":"                try:"},{"line_number":168,"context_line":"                    existed.update_device(new_value)"},{"line_number":169,"context_line":"                except exception.PciDeviceInvalidStatus:"},{"line_number":170,"context_line":"                    \"\"\""},{"line_number":171,"context_line":"                    Pci properties may changes while assigned because of"},{"line_number":172,"context_line":"                    hotplug or config changes. Although normally this should"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F8fQ%3D","line":169,"in_reply_to":"AAAASn%2F%2F9GE%3D","updated":"2013-08-29 09:23:58.000000000","message":"Sorry, this is caused by some changes mis-match :(\n\nAfter more consideration, I didn\u0027t update the PciDevice object, instead, I do the check here. The reason is, the policy that not update the device when assigned is more a policy in device tracker/manager, not the device object itself. From device object itself, it should not concern the relationship of the assignment status and the device property.","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                    not happen."},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"                    As the devices has been assigned to instance, we defer the"},{"line_number":176,"context_line":"                    change change till the instance destroied. We will"},{"line_number":177,"context_line":"                    not sync with database before that."},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"                    Not sure if this is a right policy, but at least it avoids"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9kE%3D","line":176,"updated":"2013-08-27 15:47:30.000000000","message":"s/destroied/is destroyed/","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                    not happen."},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"                    As the devices has been assigned to instance, we defer the"},{"line_number":176,"context_line":"                    change change till the instance destroied. We will"},{"line_number":177,"context_line":"                    not sync with database before that."},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"                    Not sure if this is a right policy, but at least it avoids"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F8kQ%3D","line":176,"in_reply_to":"AAAASn%2F%2F9kE%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":178,"context_line":""},{"line_number":179,"context_line":"                    Not sure if this is a right policy, but at least it avoids"},{"line_number":180,"context_line":"                    some confusion and, if needed, we can add more action like"},{"line_number":181,"context_line":"                    kill the instance by force in future."},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"                    \"\"\""},{"line_number":184,"context_line":"                    if existed[\u0027status\u0027] in (\u0027claimed\u0027, \u0027allocated\u0027):"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9jc%3D","line":181,"updated":"2013-08-27 15:47:30.000000000","message":"Change to #TODO","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":178,"context_line":""},{"line_number":179,"context_line":"                    Not sure if this is a right policy, but at least it avoids"},{"line_number":180,"context_line":"                    some confusion and, if needed, we can add more action like"},{"line_number":181,"context_line":"                    kill the instance by force in future."},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"                    \"\"\""},{"line_number":184,"context_line":"                    if existed[\u0027status\u0027] in (\u0027claimed\u0027, \u0027allocated\u0027):"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F8kI%3D","line":181,"in_reply_to":"AAAASn%2F%2F9jc%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":180,"context_line":"                    some confusion and, if needed, we can add more action like"},{"line_number":181,"context_line":"                    kill the instance by force in future."},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"                    \"\"\""},{"line_number":184,"context_line":"                    if existed[\u0027status\u0027] in (\u0027claimed\u0027, \u0027allocated\u0027):"},{"line_number":185,"context_line":"                        self.stale[dev[\u0027address\u0027]] \u003d dev"},{"line_number":186,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9nI%3D","line":183,"updated":"2013-08-27 15:47:30.000000000","message":"Lines 170-183 should be comments, not a string.","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":180,"context_line":"                    some confusion and, if needed, we can add more action like"},{"line_number":181,"context_line":"                    kill the instance by force in future."},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"                    \"\"\""},{"line_number":184,"context_line":"                    if existed[\u0027status\u0027] in (\u0027claimed\u0027, \u0027allocated\u0027):"},{"line_number":185,"context_line":"                        self.stale[dev[\u0027address\u0027]] \u003d dev"},{"line_number":186,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F8kU%3D","line":183,"in_reply_to":"AAAASn%2F%2F9nI%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        self.stats.add_device(dev)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    def _free_instance(self, instance):"},{"line_number":221,"context_line":"        # node(yjiang5): instance has no devices information when resize"},{"line_number":222,"context_line":"        for dev in self.pci_devs:"},{"line_number":223,"context_line":"            if (dev[\u0027status\u0027] in (\u0027claimed\u0027, \u0027allocated\u0027) and"},{"line_number":224,"context_line":"                    dev[\u0027instance_uuid\u0027] \u003d\u003d instance[\u0027uuid\u0027]):"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9Q0%3D","line":221,"updated":"2013-08-27 15:47:30.000000000","message":"s/node/Note/   but I am not sure this comment is relevant here. Or maybe I don\u0027t understand it?","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        self.stats.add_device(dev)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    def _free_instance(self, instance):"},{"line_number":221,"context_line":"        # node(yjiang5): instance has no devices information when resize"},{"line_number":222,"context_line":"        for dev in self.pci_devs:"},{"line_number":223,"context_line":"            if (dev[\u0027status\u0027] in (\u0027claimed\u0027, \u0027allocated\u0027) and"},{"line_number":224,"context_line":"                    dev[\u0027instance_uuid\u0027] \u003d\u003d instance[\u0027uuid\u0027]):"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F8co%3D","line":221,"in_reply_to":"AAAASn%2F%2F9Q0%3D","updated":"2013-08-29 09:23:58.000000000","message":"Hmm, so I should give more detailed information on the code if it\u0027s not straightforward.","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":249,"context_line":"                self._allocate_instance(instance, devs)"},{"line_number":250,"context_line":"                self.allocations[uuid] \u003d devs"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def update_pci_for_migration(self, instance, sign\u003d1):"},{"line_number":253,"context_line":"        \"\"\"Update instance\u0027s pci usage information when migration."},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"        The caller should hold the COMPUTE_RESOURCE_SEMAPHORE lock"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9Ps%3D","line":252,"updated":"2013-08-27 15:47:30.000000000","message":"What does sign mean?","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":249,"context_line":"                self._allocate_instance(instance, devs)"},{"line_number":250,"context_line":"                self.allocations[uuid] \u003d devs"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def update_pci_for_migration(self, instance, sign\u003d1):"},{"line_number":253,"context_line":"        \"\"\"Update instance\u0027s pci usage information when migration."},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"        The caller should hold the COMPUTE_RESOURCE_SEMAPHORE lock"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F1DU%3D","line":252,"in_reply_to":"AAAASn%2F%2F9Ps%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":250,"context_line":"                self.allocations[uuid] \u003d devs"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def update_pci_for_migration(self, instance, sign\u003d1):"},{"line_number":253,"context_line":"        \"\"\"Update instance\u0027s pci usage information when migration."},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"        The caller should hold the COMPUTE_RESOURCE_SEMAPHORE lock"},{"line_number":256,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9PQ%3D","line":253,"updated":"2013-08-27 15:47:30.000000000","message":"s/migration/it is migrated/","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":250,"context_line":"                self.allocations[uuid] \u003d devs"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def update_pci_for_migration(self, instance, sign\u003d1):"},{"line_number":253,"context_line":"        \"\"\"Update instance\u0027s pci usage information when migration."},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"        The caller should hold the COMPUTE_RESOURCE_SEMAPHORE lock"},{"line_number":256,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F1DM%3D","line":253,"in_reply_to":"AAAASn%2F%2F9PQ%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        if sign \u003d\u003d -1 and uuid in self.claims:"},{"line_number":262,"context_line":"            self._free_instance(instance)"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def clean_usage(self, instances, migrations, orphans):"},{"line_number":265,"context_line":"        \"\"\"Remove all usages for instances not passed in the parameter."},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"        The caller should hold the COMPUTE_RESOURCE_SEMAPHORE lock"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9Oc%3D","line":264,"updated":"2013-08-27 15:47:30.000000000","message":"No unit test for this?","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":261,"context_line":"        if sign \u003d\u003d -1 and uuid in self.claims:"},{"line_number":262,"context_line":"            self._free_instance(instance)"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    def clean_usage(self, instances, migrations, orphans):"},{"line_number":265,"context_line":"        \"\"\"Remove all usages for instances not passed in the parameter."},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"        The caller should hold the COMPUTE_RESOURCE_SEMAPHORE lock"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F1DA%3D","line":264,"in_reply_to":"AAAASn%2F%2F9Oc%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":11274,"name":"jizhilong","email":"zhilongji@gmail.com","username":"jizhilong"},"change_message_id":"5fc61619f1b459f9e412dac3b30e863e41318995","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                    # at least it avoids some confusion and, if needed,"},{"line_number":180,"context_line":"                    # we can add more action like killing the instance"},{"line_number":181,"context_line":"                    # by force in future."},{"line_number":182,"context_line":"                    self.stale[dev[\u0027address\u0027]] \u003d dev"},{"line_number":183,"context_line":"                else:"},{"line_number":184,"context_line":"                    existed.update_device(new_value)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_a44ab252","line":182,"updated":"2014-07-06 13:10:36.000000000","message":"Was \u0027dev\u0027 a typo here, did it actually should be  \u0027existed\u0027?From my understanding,  dev would be the last item of \u0027devices\u0027 or the last item of \u0027self.pci_devs\u0027, both of which don\u0027t make  sense.","commit_id":"4855239497050c9ee03fed627c5f41d6b59eddc6"}],"nova/tests/pci/test_pci_manager.py":[{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"d91d4bb7632e959ad05eee3bcde82933d935fa18","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        self.assertEqual(set([dev[\u0027vendor_id\u0027] for"},{"line_number":145,"context_line":"                              dev in self.tracker.pci_devs]),"},{"line_number":146,"context_line":"                         set([\u0027v\u0027, \u0027v1\u0027]))"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def test_update_pci_for_instance_fail(self):"},{"line_number":149,"context_line":"        self.pci_requests \u003d copy.deepcopy(fake_pci_requests)"},{"line_number":150,"context_line":"        self.pci_requests[0][\u0027count\u0027] \u003d 4"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F9Fk%3D","line":147,"updated":"2013-08-27 15:47:30.000000000","message":"Add test_update_pci_for_instance_resized() ?","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"153887a25f4217c8e41a5bf64ef6b7bf9015dfe1","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        self.assertEqual(set([dev[\u0027vendor_id\u0027] for"},{"line_number":145,"context_line":"                              dev in self.tracker.pci_devs]),"},{"line_number":146,"context_line":"                         set([\u0027v\u0027, \u0027v1\u0027]))"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def test_update_pci_for_instance_fail(self):"},{"line_number":149,"context_line":"        self.pci_requests \u003d copy.deepcopy(fake_pci_requests)"},{"line_number":150,"context_line":"        self.pci_requests[0][\u0027count\u0027] \u003d 4"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAASn%2F%2F1Cw%3D","line":147,"in_reply_to":"AAAASn%2F%2F9Fk%3D","updated":"2013-08-29 09:23:58.000000000","message":"Done","commit_id":"9955c7eae1be442c6fb655adf4008acd64418cc4"}]}
