)]}'
{"nova/tests/unit/virt/libvirt/test_driver.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"23eba9b39e284c34a4215a6af418b783c092d736","unresolved":false,"context_lines":[{"line_number":25208,"context_line":"        self.assertRaises(exception.VPMEMCleanupFailed,"},{"line_number":25209,"context_line":"                          drvr._cleanup_vpmems, vpmems)"},{"line_number":25210,"context_line":""},{"line_number":25211,"context_line":"    @mock.patch(\u0027nova.virt.libvirt.config.LibvirtConfigGuestVPMEM\u0027)"},{"line_number":25212,"context_line":"    def test_guest_add_vpmems(self, mock_LibvirtConfigGuestVPMEM):"},{"line_number":25213,"context_line":"        mock_guest \u003d mock.Mock(spec\u003dvconfig.LibvirtConfigGuest)"},{"line_number":25214,"context_line":"        mock_guest.memory \u003d 1024"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_78b3fbe9","line":25211,"updated":"2019-09-30 15:10:36.000000000","message":"This test still passes with the fix reverted.\n\nI\u0027m not sure what kind of real world scenario can cause a size or align to not be a multiple of 1024, but you can make the test do the expected thing by (locally) creating such a LibvirtVPMEMDevice, e.g. replace L25215 with:\n\n vpmems \u003d [\n     objects.LibvirtVPMEMDevice(\n         label\u003d\u0027WEIRD\u0027,\n         name\u003d\u0027ns1234\u0027,\n         devpath\u003d\u0027/dev/dax4.2\u0027,\n         size\u003d4292870145,  # Not a multiple of 1024\n         align\u003d2097153,    # ditto\n     )\n ]","commit_id":"5e2d869903851351e39e4b28c06106d26ebd8df5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"24f429c1bb261a60bd0af8c9aaff0c538b2b8e86","unresolved":false,"context_lines":[{"line_number":25208,"context_line":"        self.assertRaises(exception.VPMEMCleanupFailed,"},{"line_number":25209,"context_line":"                          drvr._cleanup_vpmems, vpmems)"},{"line_number":25210,"context_line":""},{"line_number":25211,"context_line":"    @mock.patch(\u0027nova.virt.libvirt.config.LibvirtConfigGuestVPMEM\u0027)"},{"line_number":25212,"context_line":"    def test_guest_add_vpmems(self, mock_LibvirtConfigGuestVPMEM):"},{"line_number":25213,"context_line":"        mock_guest \u003d mock.Mock(spec\u003dvconfig.LibvirtConfigGuest)"},{"line_number":25214,"context_line":"        mock_guest.memory \u003d 1024"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_fb43653d","line":25211,"in_reply_to":"3fa7e38b_38010339","updated":"2019-09-30 15:34:41.000000000","message":"Done","commit_id":"5e2d869903851351e39e4b28c06106d26ebd8df5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d5a3920460301947e46e03600a711da716f6dea1","unresolved":false,"context_lines":[{"line_number":25208,"context_line":"        self.assertRaises(exception.VPMEMCleanupFailed,"},{"line_number":25209,"context_line":"                          drvr._cleanup_vpmems, vpmems)"},{"line_number":25210,"context_line":""},{"line_number":25211,"context_line":"    @mock.patch(\u0027nova.virt.libvirt.config.LibvirtConfigGuestVPMEM\u0027)"},{"line_number":25212,"context_line":"    def test_guest_add_vpmems(self, mock_LibvirtConfigGuestVPMEM):"},{"line_number":25213,"context_line":"        mock_guest \u003d mock.Mock(spec\u003dvconfig.LibvirtConfigGuest)"},{"line_number":25214,"context_line":"        mock_guest.memory \u003d 1024"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_38010339","line":25211,"in_reply_to":"3fa7e38b_78b3fbe9","updated":"2019-09-30 15:21:17.000000000","message":"\u003e I\u0027m not sure what kind of real world scenario can cause a size or\n \u003e align to not be a multiple of 1024\n\nOh. I guess that\u0027s not the issue. The issue is that the XML gets created with something like\n\n \u003csize\u003e4192256.0\u003c/size\u003e\n \u003calign\u003e2048.0\u003c/align\u003e\n\ninstead of\n\n \u003csize\u003e4192256\u003c/size\u003e\n \u003calign\u003e2048\u003c/align\u003e\n\nIn that case, this test is unfortunately not useful, because mock\u0027s assert_called* methods compare the operands for equality, and 2048.0 \u003d\u003d 2048.\n\nWhat would be better is a test that goes all the way to producing the actual XML so you can assert that the text values don\u0027t have the decimal.","commit_id":"5e2d869903851351e39e4b28c06106d26ebd8df5"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":11347,"name":"Rui Zang","email":"rui.zang@yandex.com","username":"rzang"},"change_message_id":"48e6d625fbdda9d5eaa1da4f1f867f139e097566","unresolved":false,"context_lines":[{"line_number":5778,"context_line":"        guest.max_memory_size \u003d guest.memory"},{"line_number":5779,"context_line":"        guest.max_memory_slots \u003d 0"},{"line_number":5780,"context_line":"        for vpmem in vpmems:"},{"line_number":5781,"context_line":"            size_kb \u003d int(vpmem.size / units.Ki)"},{"line_number":5782,"context_line":"            align_kb \u003d int(vpmem.align / units.Ki)"},{"line_number":5783,"context_line":""},{"line_number":5784,"context_line":"            vpmem_config \u003d vconfig.LibvirtConfigGuestVPMEM("}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_ea339cf4","line":5781,"updated":"2019-09-30 01:25:45.000000000","message":"It seems to me that using \u0027//\u0027 is a more proper way to get rid of this mess.","commit_id":"90311a420ab361c557ecf6e282aecf367fef8425"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"954b2657155e39cfb516ce8dfc50b57e03a8bb70","unresolved":false,"context_lines":[{"line_number":5779,"context_line":"        guest.max_memory_slots \u003d 0"},{"line_number":5780,"context_line":"        for vpmem in vpmems:"},{"line_number":5781,"context_line":"            size_kb \u003d vpmem.size // units.Ki"},{"line_number":5782,"context_line":"            align_kb \u003d vpmem.align // units.Ki"},{"line_number":5783,"context_line":""},{"line_number":5784,"context_line":"            vpmem_config \u003d vconfig.LibvirtConfigGuestVPMEM("},{"line_number":5785,"context_line":"                devpath\u003dvpmem.devpath, size_kb\u003dsize_kb, align_kb\u003dalign_kb)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3fa7e38b_fbdfe562","line":5782,"updated":"2019-09-30 15:50:04.000000000","message":"IMHO, the LibvirtConfigGuest class should handle this, refusing to create invalid XML. But obviously this is the quickest solution to the regression.","commit_id":"6d5fdb4ef4dc3e5f40298e751d966ca54b2ae902"}]}
