)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"b18e67520f11438fced0106ce8bccbfb90112ae4","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Previously if CONF.vcpu_pin_set were not configured we would just"},{"line_number":10,"context_line":"return the total amount pCPUs without to take care of whether some of"},{"line_number":11,"context_line":"them are offline."},{"line_number":12,"context_line":"In this rework we try to do besteffort by returning only online pCPUs"},{"line_number":13,"context_line":"whether or not CONF.vcpu_pin_set is configured."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I0f96c57446eeae0826f9e0ef1a5c7cc6b1b3def5"},{"line_number":16,"context_line":"Signed-off-by: Sahid Orentino Ferdjaoui \u003csahid.ferdjaoui@redhat.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"7f96bb07_563e3f8b","line":13,"range":{"start_line":12,"start_character":57,"end_line":13,"end_character":7},"updated":"2018-01-17 14:20:07.000000000","message":"Could you link to a libvirt doc detailing what online/offline CPUs are?","commit_id":"fb0ed5a85fc2e5c3e18f3bc0832b20e186d9d3c0"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"268d517027cf9764791561cbdb318b4d4e7f06e4","unresolved":false,"context_lines":[{"line_number":5327,"context_line":"                # Best effort case; libvirt where not able to return"},{"line_number":5328,"context_line":"                # the pCPUs online, check the pin set against the"},{"line_number":5329,"context_line":"                # total of pCPUs."},{"line_number":5330,"context_line":"                if sorted(available_ids)[-1] \u003e\u003d total_pcpus:"},{"line_number":5331,"context_line":"                    raise exception.Invalid(_(\"Invalid vcpu_pin_set config, \""},{"line_number":5332,"context_line":"                                              \"out of hypervisor cpu range.\"))"},{"line_number":5333,"context_line":"            return len(available_ids)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f515b1d_eb423eab","line":5330,"updated":"2017-10-05 15:29:17.000000000","message":"s/sorted(available_ids)[-1]/max(available_ids)","commit_id":"cdf4541f049c8e72003e84c74347a8fc1718966f"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"b18e67520f11438fced0106ce8bccbfb90112ae4","unresolved":false,"context_lines":[{"line_number":5301,"context_line":"        :returns: the number of cpu core instances can be used."},{"line_number":5302,"context_line":""},{"line_number":5303,"context_line":"        \"\"\""},{"line_number":5304,"context_line":"        try:"},{"line_number":5305,"context_line":"            total_pcpus \u003d self._host.get_cpu_count()"},{"line_number":5306,"context_line":"        except libvirt.libvirtError:"},{"line_number":5307,"context_line":"            LOG.warning(\"Cannot get the number of cpu, because this \""},{"line_number":5308,"context_line":"                        \"function is not implemented for this platform. \")"},{"line_number":5309,"context_line":"            return 0"},{"line_number":5310,"context_line":""},{"line_number":5311,"context_line":"        if not CONF.vcpu_pin_set:"},{"line_number":5312,"context_line":"            return total_pcpus"},{"line_number":5313,"context_line":""},{"line_number":5314,"context_line":"        available_ids \u003d hardware.get_vcpu_pin_set()"},{"line_number":5315,"context_line":"        # We get the list of online CPUs on the host and see if the requested"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_36c4d390","line":5312,"range":{"start_line":5304,"start_character":0,"end_line":5312,"end_character":30},"updated":"2018-01-17 14:20:07.000000000","message":"Isn\u0027t this out of date too? Surely we should be returning the count of online CPUs?","commit_id":"fb0ed5a85fc2e5c3e18f3bc0832b20e186d9d3c0"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"b18e67520f11438fced0106ce8bccbfb90112ae4","unresolved":false,"context_lines":[{"line_number":5311,"context_line":"        if not CONF.vcpu_pin_set:"},{"line_number":5312,"context_line":"            return total_pcpus"},{"line_number":5313,"context_line":""},{"line_number":5314,"context_line":"        available_ids \u003d hardware.get_vcpu_pin_set()"},{"line_number":5315,"context_line":"        # We get the list of online CPUs on the host and see if the requested"},{"line_number":5316,"context_line":"        # set falls under these. If not, we retain the old behavior."},{"line_number":5317,"context_line":"        online_pcpus \u003d None"},{"line_number":5318,"context_line":"        try:"},{"line_number":5319,"context_line":"            online_pcpus \u003d self._host.get_online_cpus()"},{"line_number":5320,"context_line":"        except libvirt.libvirtError as ex:"},{"line_number":5321,"context_line":"            error_code \u003d ex.get_error_code()"},{"line_number":5322,"context_line":"            err_msg \u003d encodeutils.exception_to_unicode(ex)"},{"line_number":5323,"context_line":"            LOG.warning("},{"line_number":5324,"context_line":"                \"Couldn\u0027t retrieve the online CPUs due to a Libvirt \""},{"line_number":5325,"context_line":"                \"error: %(error)s with error code: %(error_code)s\","},{"line_number":5326,"context_line":"                {\u0027error\u0027: err_msg, \u0027error_code\u0027: error_code})"},{"line_number":5327,"context_line":"        if online_pcpus:"},{"line_number":5328,"context_line":"            if not (available_ids \u003c\u003d online_pcpus):"},{"line_number":5329,"context_line":"                msg \u003d (_(\"Invalid vcpu_pin_set config, one or more of the \""},{"line_number":5330,"context_line":"                         \"specified cpuset is not online. Online cpuset(s): \""},{"line_number":5331,"context_line":"                         \"%(online)s, requested cpuset(s): %(req)s\"),"},{"line_number":5332,"context_line":"                       {\u0027online\u0027: sorted(online_pcpus),"},{"line_number":5333,"context_line":"                        \u0027req\u0027: sorted(available_ids)})"},{"line_number":5334,"context_line":"                raise exception.Invalid(msg)"},{"line_number":5335,"context_line":"        elif sorted(available_ids)[-1] \u003e\u003d total_pcpus:"},{"line_number":5336,"context_line":"            raise exception.Invalid(_(\"Invalid vcpu_pin_set config, \""},{"line_number":5337,"context_line":"                                      \"out of hypervisor cpu range.\"))"},{"line_number":5338,"context_line":"        return len(self._get_available_pcpus())"},{"line_number":5339,"context_line":""},{"line_number":5340,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_f68bcb64","line":5337,"range":{"start_line":5314,"start_character":0,"end_line":5337,"end_character":70},"updated":"2018-01-17 14:20:07.000000000","message":"This entire block looks nearly identical to the _get_available_pcpus. Can you move this logic there? You\u0027d probably want to, in any case, given that there is some exception handling here which appears to be absent in the above function","commit_id":"fb0ed5a85fc2e5c3e18f3bc0832b20e186d9d3c0"}]}
