)]}'
{"nova/tests/unit/virt/libvirt/test_driver.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"7542a5d014ea17b754326227f097b55bc95e7f0d","unresolved":false,"context_lines":[{"line_number":7563,"context_line":"    def test_get_pcpu_available__cpu_dedicated_set_unset("},{"line_number":7564,"context_line":"            self, get_online_cpus):"},{"line_number":7565,"context_line":"        \"\"\"Test what happens when the \u0027[compute] cpu_dedicated_set\u0027 config"},{"line_number":7566,"context_line":"        option is unset."},{"line_number":7567,"context_line":"        \"\"\""},{"line_number":7568,"context_line":"        self.flags(vcpu_pin_set\u003dNone)"},{"line_number":7569,"context_line":"        self.flags(cpu_dedicated_set\u003dNone, cpu_shared_set\u003dNone,"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_12563f2b","line":7566,"range":{"start_line":7566,"start_character":18,"end_line":7566,"end_character":24},"updated":"2019-09-07 00:52:16.000000000","message":"nit \"not set\" would read better. unset could refer to the action of unsetting the option or the event that represent rather then the state.\n\nyou could also use the past tense \"undefined\".\n\nthat siad it s a nit so if you dont feel like changing it thats fine.","commit_id":"6f56da6d540ff185bda149ed0b78b91d0a3e5cc2"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"de0e9acf5e358e1bfcaf3a5ab71a984b826dea42","unresolved":false,"context_lines":[{"line_number":7563,"context_line":"    def test_get_pcpu_available__cpu_dedicated_set_unset("},{"line_number":7564,"context_line":"            self, get_online_cpus):"},{"line_number":7565,"context_line":"        \"\"\"Test what happens when the \u0027[compute] cpu_dedicated_set\u0027 config"},{"line_number":7566,"context_line":"        option is unset."},{"line_number":7567,"context_line":"        \"\"\""},{"line_number":7568,"context_line":"        self.flags(vcpu_pin_set\u003dNone)"},{"line_number":7569,"context_line":"        self.flags(cpu_dedicated_set\u003dNone, cpu_shared_set\u003dNone,"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_c63f77d4","line":7566,"range":{"start_line":7566,"start_character":18,"end_line":7566,"end_character":24},"in_reply_to":"5faad753_12563f2b","updated":"2019-09-09 14:20:08.000000000","message":"Done","commit_id":"6f56da6d540ff185bda149ed0b78b91d0a3e5cc2"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"7542a5d014ea17b754326227f097b55bc95e7f0d","unresolved":false,"context_lines":[{"line_number":18680,"context_line":"            self._host.get_memory_mb_used \u003d _get_memory_mb_used"},{"line_number":18681,"context_line":""},{"line_number":18682,"context_line":"        def _get_pcpu_available(self):"},{"line_number":18683,"context_line":"            return [0]"},{"line_number":18684,"context_line":""},{"line_number":18685,"context_line":"        def _get_vcpu_available(self):"},{"line_number":18686,"context_line":"            return [1]"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_3512455a","line":18683,"range":{"start_line":18683,"start_character":18,"end_line":18683,"end_character":22},"updated":"2019-09-07 00:52:16.000000000","message":"this is not the same as it previous returned\nit would be [] to represt 0 pCPUs are avilable\n\nthis represents 1 cpu core 0 is available\n\ngiven this did not break anything you must not be useing it\n\nalso this should be a set not a list\nso make this set() to be the empty set","commit_id":"6f56da6d540ff185bda149ed0b78b91d0a3e5cc2"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"de0e9acf5e358e1bfcaf3a5ab71a984b826dea42","unresolved":false,"context_lines":[{"line_number":18680,"context_line":"            self._host.get_memory_mb_used \u003d _get_memory_mb_used"},{"line_number":18681,"context_line":""},{"line_number":18682,"context_line":"        def _get_pcpu_available(self):"},{"line_number":18683,"context_line":"            return [0]"},{"line_number":18684,"context_line":""},{"line_number":18685,"context_line":"        def _get_vcpu_available(self):"},{"line_number":18686,"context_line":"            return [1]"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_462b8793","line":18683,"range":{"start_line":18683,"start_character":18,"end_line":18683,"end_character":22},"in_reply_to":"5faad753_3512455a","updated":"2019-09-09 14:20:08.000000000","message":"Done","commit_id":"6f56da6d540ff185bda149ed0b78b91d0a3e5cc2"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"7542a5d014ea17b754326227f097b55bc95e7f0d","unresolved":false,"context_lines":[{"line_number":18683,"context_line":"            return [0]"},{"line_number":18684,"context_line":""},{"line_number":18685,"context_line":"        def _get_vcpu_available(self):"},{"line_number":18686,"context_line":"            return [1]"},{"line_number":18687,"context_line":""},{"line_number":18688,"context_line":"        def _get_vcpu_used(self):"},{"line_number":18689,"context_line":"            return 0"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_553d81b9","line":18686,"range":{"start_line":18686,"start_character":18,"end_line":18686,"end_character":22},"updated":"2019-09-07 00:52:16.000000000","message":"again a set not a list\n\n{1}","commit_id":"6f56da6d540ff185bda149ed0b78b91d0a3e5cc2"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"de0e9acf5e358e1bfcaf3a5ab71a984b826dea42","unresolved":false,"context_lines":[{"line_number":18683,"context_line":"            return [0]"},{"line_number":18684,"context_line":""},{"line_number":18685,"context_line":"        def _get_vcpu_available(self):"},{"line_number":18686,"context_line":"            return [1]"},{"line_number":18687,"context_line":""},{"line_number":18688,"context_line":"        def _get_vcpu_used(self):"},{"line_number":18689,"context_line":"            return 0"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_262e8ba5","line":18686,"range":{"start_line":18686,"start_character":18,"end_line":18686,"end_character":22},"in_reply_to":"5faad753_553d81b9","updated":"2019-09-09 14:20:08.000000000","message":"Done","commit_id":"6f56da6d540ff185bda149ed0b78b91d0a3e5cc2"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"b7be7c90e5d59d48eb1eabfdff337c1d1ea2eb03","unresolved":false,"context_lines":[{"line_number":5935,"context_line":"            return 0"},{"line_number":5936,"context_line":"        else:"},{"line_number":5937,"context_line":"            try:"},{"line_number":5938,"context_line":"                return self._host.get_cpu_count()"},{"line_number":5939,"context_line":"            except libvirt.libvirtError:"},{"line_number":5940,"context_line":"                LOG.warning(\"Cannot get the number of host CPUs because this \""},{"line_number":5941,"context_line":"                            \"function is not implemented for this platform.\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_c3540201","side":"PARENT","line":5938,"range":{"start_line":5938,"start_character":16,"end_line":5938,"end_character":49},"updated":"2019-08-29 05:42:32.000000000","message":"Emm...this changed existing vcpu_pin_set behavior. \n\nFor dedicated instance host, the offline cpu won\u0027t work. For the shared instance host, this change will shrink the number of available vcpus.","commit_id":"cf8c5aa78452f64483c4f818b7f4c7f30bde910a"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"2644ab679667942f6d5ef7dc233a181d8d4f2db8","unresolved":false,"context_lines":[{"line_number":5935,"context_line":"            return 0"},{"line_number":5936,"context_line":"        else:"},{"line_number":5937,"context_line":"            try:"},{"line_number":5938,"context_line":"                return self._host.get_cpu_count()"},{"line_number":5939,"context_line":"            except libvirt.libvirtError:"},{"line_number":5940,"context_line":"                LOG.warning(\"Cannot get the number of host CPUs because this \""},{"line_number":5941,"context_line":"                            \"function is not implemented for this platform.\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_af7be778","side":"PARENT","line":5938,"range":{"start_line":5938,"start_character":16,"end_line":5938,"end_character":49},"in_reply_to":"7faddb67_8f0b8b20","updated":"2019-08-29 10:59:15.000000000","message":"i personally would prefer to only report online cpus too.\n\nthat said i would also prefer to require the cpu_dedicated_set and cpu_shared_set options to be set in U\n\ni.e. have no option to not set at least one of them.\n\nat a minium i would like to enforce that for the libvirt driver.\n\ni was aware that we only check online cpus if vcpu_pin_set was defeiend but it always felt like a bug that we did not check when it was not set.\n\nthis is one of the reasons why i have always advised useing vcpu_pin_set even if you dont care about numa or other high performance usecases. the other is to properly be able to reserve specific cores for the host to use.","commit_id":"cf8c5aa78452f64483c4f818b7f4c7f30bde910a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2750f0ed4d7439343e42adbef4bd38bd166c1262","unresolved":false,"context_lines":[{"line_number":5935,"context_line":"            return 0"},{"line_number":5936,"context_line":"        else:"},{"line_number":5937,"context_line":"            try:"},{"line_number":5938,"context_line":"                return self._host.get_cpu_count()"},{"line_number":5939,"context_line":"            except libvirt.libvirtError:"},{"line_number":5940,"context_line":"                LOG.warning(\"Cannot get the number of host CPUs because this \""},{"line_number":5941,"context_line":"                            \"function is not implemented for this platform.\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_1a07db83","side":"PARENT","line":5938,"range":{"start_line":5938,"start_character":16,"end_line":5938,"end_character":49},"in_reply_to":"7faddb67_af7be778","updated":"2019-08-29 12:24:28.000000000","message":"Emm..I agree with you guys, it is a bug. I also think this is corner cases. So i\u0027m ok with this.","commit_id":"cf8c5aa78452f64483c4f818b7f4c7f30bde910a"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"888a0af7b15fdd867447d1536393110e38ba4e59","unresolved":false,"context_lines":[{"line_number":5935,"context_line":"            return 0"},{"line_number":5936,"context_line":"        else:"},{"line_number":5937,"context_line":"            try:"},{"line_number":5938,"context_line":"                return self._host.get_cpu_count()"},{"line_number":5939,"context_line":"            except libvirt.libvirtError:"},{"line_number":5940,"context_line":"                LOG.warning(\"Cannot get the number of host CPUs because this \""},{"line_number":5941,"context_line":"                            \"function is not implemented for this platform.\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_8f0b8b20","side":"PARENT","line":5938,"range":{"start_line":5938,"start_character":16,"end_line":5938,"end_character":49},"in_reply_to":"7faddb67_c3540201","updated":"2019-08-29 10:44:32.000000000","message":"So yes, there is a change in behavior here if none of CONF.vcpu_pin_set, CONF.compute.cpu_shared_set or CONF.compute.cpu_dedicated_set are set. Before this change, we would fall back to reporting *all* CPUs on the host for VCPU inventory, whether they were online or offline. After this change, we will only report online CPUs. Is that what you\u0027re referring to? If so, this was a conscious decision on my behalf. It felt like a bug to report CPUs as usable when we were not able to actually use them. For non-NUMA instances, this would result in a higher overcommit ratio than expected, while for non-NUMA instances, the NUMATopology filter would error out more frequently because there would be a mismatch between the number of cores the host NUMATopology object was saying was available vs. what was being reported in placement (see [1]).\n\nI can revert this but I don\u0027t think that\u0027s wise. Perhaps I could split this out into a separate patch (possibly with a bug against it) or add a note in the commit message explaining the above. With that said though, I suspect the reason nobody has seen this issue is because the values from the libvirt \u0027getCPUMap\u0027 function (returned by \u0027nova.virt.libvirt.Host.get_online_cpus\u0027) and third item of the \u0027getInfo\u0027 function (returned by \u0027nova.virt.libvirt.Host.get_cpu_count\u0027) very rarely differ is because most people aren\u0027t disabling CPUs on their platform and therefore aren\u0027t running into these corner cases\n\n[1] https://github.com/openstack/nova/blob/eb6fcb21917d56e4e287513c1159ad4656382714/nova/virt/libvirt/driver.py#L6555-L6560","commit_id":"cf8c5aa78452f64483c4f818b7f4c7f30bde910a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"05a9c53954e6197cb5c0e16f94f3fd784ea6007f","unresolved":false,"context_lines":[{"line_number":6842,"context_line":"        disk_gb \u003d int(self._get_local_gb_info()[\u0027total\u0027])"},{"line_number":6843,"context_line":"        memory_mb \u003d int(self._host.get_memory_mb_total())"},{"line_number":6844,"context_line":"        vcpus \u003d len(self._get_vcpu_available())"},{"line_number":6845,"context_line":"        pcpus \u003d len(self._get_pcpu_available())"},{"line_number":6846,"context_line":""},{"line_number":6847,"context_line":"        # NOTE(yikun): If the inv record does not exists, the allocation_ratio"},{"line_number":6848,"context_line":"        # will use the CONF.xxx_allocation_ratio value if xxx_allocation_ratio"}],"source_content_type":"text/x-python","patch_set":13,"id":"7faddb67_3b973648","line":6845,"updated":"2019-08-29 16:15:18.000000000","message":"technically, given you were checking later with \u0027if pcpus\u0027, an empty set() should still avoid to provide an empty inventory, but okay.","commit_id":"281134d927fa9b7f55acbe7763c8510c67075e02"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"7542a5d014ea17b754326227f097b55bc95e7f0d","unresolved":false,"context_lines":[{"line_number":5907,"context_line":"        :returns: The number of host cores to be used for PCPUs."},{"line_number":5908,"context_line":"        \"\"\""},{"line_number":5909,"context_line":"        if not CONF.compute.cpu_dedicated_set:"},{"line_number":5910,"context_line":"            return set([])"},{"line_number":5911,"context_line":""},{"line_number":5912,"context_line":"        online_cpus \u003d self._host.get_online_cpus()"},{"line_number":5913,"context_line":"        requested_cpus \u003d hardware.get_cpu_dedicated_set()"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_d52c119b","line":5910,"range":{"start_line":5910,"start_character":19,"end_line":5910,"end_character":26},"updated":"2019-09-07 00:52:16.000000000","message":"that is just set()\n\nthe set construction thats an iterable so you are constuction and empty list which is converted to an empyt set.\n\njust return an empty set.","commit_id":"6f56da6d540ff185bda149ed0b78b91d0a3e5cc2"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"de0e9acf5e358e1bfcaf3a5ab71a984b826dea42","unresolved":false,"context_lines":[{"line_number":5907,"context_line":"        :returns: The number of host cores to be used for PCPUs."},{"line_number":5908,"context_line":"        \"\"\""},{"line_number":5909,"context_line":"        if not CONF.compute.cpu_dedicated_set:"},{"line_number":5910,"context_line":"            return set([])"},{"line_number":5911,"context_line":""},{"line_number":5912,"context_line":"        online_cpus \u003d self._host.get_online_cpus()"},{"line_number":5913,"context_line":"        requested_cpus \u003d hardware.get_cpu_dedicated_set()"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_e6195388","line":5910,"range":{"start_line":5910,"start_character":19,"end_line":5910,"end_character":26},"in_reply_to":"5faad753_d52c119b","updated":"2019-09-09 14:20:08.000000000","message":"Done","commit_id":"6f56da6d540ff185bda149ed0b78b91d0a3e5cc2"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"7542a5d014ea17b754326227f097b55bc95e7f0d","unresolved":false,"context_lines":[{"line_number":5940,"context_line":"        elif CONF.compute.cpu_shared_set:"},{"line_number":5941,"context_line":"            requested_cpus \u003d hardware.get_cpu_shared_set()"},{"line_number":5942,"context_line":"        elif CONF.compute.cpu_dedicated_set:"},{"line_number":5943,"context_line":"            return set([])"},{"line_number":5944,"context_line":"        else:"},{"line_number":5945,"context_line":"            return online_cpus"},{"line_number":5946,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_952699b7","line":5943,"range":{"start_line":5943,"start_character":18,"end_line":5943,"end_character":26},"updated":"2019-09-07 00:52:16.000000000","message":"set()","commit_id":"6f56da6d540ff185bda149ed0b78b91d0a3e5cc2"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"de0e9acf5e358e1bfcaf3a5ab71a984b826dea42","unresolved":false,"context_lines":[{"line_number":5940,"context_line":"        elif CONF.compute.cpu_shared_set:"},{"line_number":5941,"context_line":"            requested_cpus \u003d hardware.get_cpu_shared_set()"},{"line_number":5942,"context_line":"        elif CONF.compute.cpu_dedicated_set:"},{"line_number":5943,"context_line":"            return set([])"},{"line_number":5944,"context_line":"        else:"},{"line_number":5945,"context_line":"            return online_cpus"},{"line_number":5946,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_a6135b66","line":5943,"range":{"start_line":5943,"start_character":18,"end_line":5943,"end_character":26},"in_reply_to":"5faad753_952699b7","updated":"2019-09-09 14:20:08.000000000","message":"Done","commit_id":"6f56da6d540ff185bda149ed0b78b91d0a3e5cc2"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"7542a5d014ea17b754326227f097b55bc95e7f0d","unresolved":false,"context_lines":[{"line_number":6847,"context_line":"        disk_gb \u003d int(self._get_local_gb_info()[\u0027total\u0027])"},{"line_number":6848,"context_line":"        memory_mb \u003d int(self._host.get_memory_mb_total())"},{"line_number":6849,"context_line":"        vcpus \u003d len(self._get_vcpu_available())"},{"line_number":6850,"context_line":"        pcpus \u003d len(self._get_pcpu_available())"},{"line_number":6851,"context_line":""},{"line_number":6852,"context_line":"        # NOTE(yikun): If the inv record does not exists, the allocation_ratio"},{"line_number":6853,"context_line":"        # will use the CONF.xxx_allocation_ratio value if xxx_allocation_ratio"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_f534ade0","line":6850,"range":{"start_line":6850,"start_character":8,"end_line":6850,"end_character":47},"updated":"2019-09-07 00:52:16.000000000","message":"in your test code this was previous going to return 0 but now it will return 1","commit_id":"6f56da6d540ff185bda149ed0b78b91d0a3e5cc2"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"7542a5d014ea17b754326227f097b55bc95e7f0d","unresolved":false,"context_lines":[{"line_number":6878,"context_line":"                \u0027reserved\u0027: CONF.reserved_host_cpus,"},{"line_number":6879,"context_line":"            }"},{"line_number":6880,"context_line":""},{"line_number":6881,"context_line":"        if pcpus:"},{"line_number":6882,"context_line":"            result[orc.PCPU] \u003d {"},{"line_number":6883,"context_line":"                \u0027total\u0027: pcpus,"},{"line_number":6884,"context_line":"                \u0027min_unit\u0027: 1,"},{"line_number":6885,"context_line":"                \u0027max_unit\u0027: pcpus,"},{"line_number":6886,"context_line":"                \u0027step_size\u0027: 1,"},{"line_number":6887,"context_line":"                \u0027allocation_ratio\u0027: 1,"},{"line_number":6888,"context_line":"                \u0027reserved\u0027: 0,"},{"line_number":6889,"context_line":"            }"},{"line_number":6890,"context_line":""},{"line_number":6891,"context_line":"        # If a sharing DISK_GB provider exists in the provider tree, then our"},{"line_number":6892,"context_line":"        # storage is shared, and we should not report the DISK_GB inventory in"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_b54cf576","line":6889,"range":{"start_line":6881,"start_character":6,"end_line":6889,"end_character":13},"updated":"2019-09-07 00:52:16.000000000","message":"meaning this should now be defiend.\nbut i did not see the test change for this implying ther is no coverage for that.","commit_id":"6f56da6d540ff185bda149ed0b78b91d0a3e5cc2"}]}
