)]}'
{"nova/tests/virt/hyperv/test_vhdutilsv2.py":[{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"1bd48560b90308303c2333545b33428510c9199a","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                self._vhdutils.get_internal_vhd_size_by_file_size("},{"line_number":188,"context_line":"                    self._FAKE_VHD_PATH, self._FAKE_MAK_INTERNAL_SIZE))"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        self.assertEquals(internal_size, 1024 ** 3 - 1024 ** 2 * 32)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVhI%3D","line":190,"updated":"2013-10-17 15:50:45.000000000","message":"Please replace with assertEqual","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"08f3b9cc10fba7c4eb261fd81ebdf381fb55b3d2","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                self._vhdutils.get_internal_vhd_size_by_file_size("},{"line_number":188,"context_line":"                    self._FAKE_VHD_PATH, self._FAKE_MAK_INTERNAL_SIZE))"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        self.assertEquals(internal_size, 1024 ** 3 - 1024 ** 2 * 32)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVU8%3D","line":190,"in_reply_to":"AAAATH%2F%2FVhI%3D","updated":"2013-10-17 15:54:57.000000000","message":"Good point.  By the way, the assertEqual signature is (expected, observed) so swap your args here.","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"df8188117a50bfebbbedf1e74eff40190585669c","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    _FAKE_JOB_PATH \u003d \u0027fake_job_path\u0027"},{"line_number":34,"context_line":"    _FAKE_RET_VAL \u003d 0"},{"line_number":35,"context_line":"    _FAKE_VHD_FORMAT \u003d \u0027vhdx\u0027"},{"line_number":36,"context_line":"    _FAKE_MAK_INTERNAL_SIZE \u003d 1024 ** 3"},{"line_number":37,"context_line":"    _FAKE_BLOCK_SIZE \u003d 33554432"},{"line_number":38,"context_line":"    _FAKE_LOG_SIZE \u003d 1048576"},{"line_number":39,"context_line":"    _FAKE_LOGICAL_SECTOR_SIZE \u003d 4096"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2Fv2w%3D","line":36,"updated":"2013-10-29 15:58:59.000000000","message":"suggest to use _FAKE_MAK_INTERNAL_SIZE_GB, conflict with line 31?, besides we\u0027d better to use unit.Gi here for better readbility. https://github.com/openstack/nova/blob/master/nova/unit.py#L25","commit_id":"1f2ae7e5fdeb96efe872b7d6aa2e17642846aae9"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"df8188117a50bfebbbedf1e74eff40190585669c","unresolved":false,"context_lines":[{"line_number":188,"context_line":"                self._vhdutils.get_internal_vhd_size_by_file_size("},{"line_number":189,"context_line":"                    self._FAKE_VHD_PATH, self._FAKE_MAK_INTERNAL_SIZE))"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"        self.assertEqual(1024 ** 3 - 1024 ** 2 * 32, internal_size)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2Fv0Y%3D","line":191,"updated":"2013-10-29 15:58:59.000000000","message":"ditto","commit_id":"1f2ae7e5fdeb96efe872b7d6aa2e17642846aae9"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"64517569d92bfdddd7fdee58eee4b5eaf790eaf2","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from nova import test"},{"line_number":20,"context_line":"from nova import unit"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from nova.virt.hyperv import constants"},{"line_number":23,"context_line":"from nova.virt.hyperv import vhdutilsv2"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2FMt0%3D","line":21,"updated":"2013-11-13 02:34:13.000000000","message":"nit: this extra blank line need to be removed.","commit_id":"bbafd981cd901470ece3bc45e53ce02c0a2e6461"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ca94d1c46e15b0ee3cef85eb2b77b741aca3f5b0","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                          \u0027BlockSize\u0027: self._FAKE_BLOCK_SIZE,"},{"line_number":175,"context_line":"                          \u0027LogicalSectorSize\u0027: self._FAKE_LOGICAL_SECTOR_SIZE,"},{"line_number":176,"context_line":"                          \u0027Type\u0027: self._FAKE_TYPE})"},{"line_number":177,"context_line":"        self._vhdutils._get_vhdx_log_size \u003d mock.MagicMock(return_value\u003d"},{"line_number":178,"context_line":"                                                           self._FAKE_LOG_SIZE)"},{"line_number":179,"context_line":"        self._vhdutils._get_vhdx_metadata_size_and_offset \u003d mock.MagicMock("},{"line_number":180,"context_line":"            return_value\u003d(self._FAKE_METADATA_SIZE, 1024))"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2FxzY%3D","line":177,"updated":"2014-01-08 15:43:50.000000000","message":"You have no test coverage for getting the vhdx log, metadata or block size since you just mock them out here, you should have 3 additional test cases for those helper methods to make sure they work as expected to avoid regression. It\u0027s fine to mock them out here, but they should have their own test methods that verify how they are supposed to work internally and individually.","commit_id":"93dee15043cf1c6eba379bd1d14372623504fe2b"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"fd9449c063fd2d9986c6c682a5a7fedcb9cc986c","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                          \u0027BlockSize\u0027: self._FAKE_BLOCK_SIZE,"},{"line_number":175,"context_line":"                          \u0027LogicalSectorSize\u0027: self._FAKE_LOGICAL_SECTOR_SIZE,"},{"line_number":176,"context_line":"                          \u0027Type\u0027: self._FAKE_TYPE})"},{"line_number":177,"context_line":"        self._vhdutils._get_vhdx_log_size \u003d mock.MagicMock(return_value\u003d"},{"line_number":178,"context_line":"                                                           self._FAKE_LOG_SIZE)"},{"line_number":179,"context_line":"        self._vhdutils._get_vhdx_metadata_size_and_offset \u003d mock.MagicMock("},{"line_number":180,"context_line":"            return_value\u003d(self._FAKE_METADATA_SIZE, 1024))"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2Fw60%3D","line":177,"in_reply_to":"AAAAUH%2F%2FxzY%3D","updated":"2014-01-08 18:37:58.000000000","message":"Thanks for pointing this out.","commit_id":"93dee15043cf1c6eba379bd1d14372623504fe2b"}],"nova/virt/hyperv/imagecache.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ca94d1c46e15b0ee3cef85eb2b77b741aca3f5b0","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        except KeyError:"},{"line_number":60,"context_line":"            return instance[\u0027root_gb\u0027]"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def _resize_and_cache_vhd(self, instance, vhd_path):"},{"line_number":63,"context_line":"        vhd_info \u003d self._vhdutils.get_vhd_info(vhd_path)"},{"line_number":64,"context_line":"        vhd_size \u003d vhd_info[\u0027MaxInternalSize\u0027]"},{"line_number":65,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2FxzA%3D","line":62,"updated":"2014-01-08 15:43:50.000000000","message":"Where is this (the image cache stuff) all tested?","commit_id":"93dee15043cf1c6eba379bd1d14372623504fe2b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79594ba21e0dfe66f5c6f2df93890867b268af9e","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        except KeyError:"},{"line_number":58,"context_line":"            return instance[\u0027root_gb\u0027]"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def _resize_and_cache_vhd(self, instance, vhd_path):"},{"line_number":61,"context_line":"        vhd_info \u003d self._vhdutils.get_vhd_info(vhd_path)"},{"line_number":62,"context_line":"        vhd_size \u003d vhd_info[\u0027MaxInternalSize\u0027]"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F9cSI%3D","line":60,"updated":"2014-02-06 21:52:34.000000000","message":"Where is this tested?  I don\u0027t see this method called (even mocked) in the nova.tests.virt.hyperv tree.","commit_id":"9ea92029f7846dc65238b0be3c3c95568862448d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"becc2caa1d5bfc35b7ac4eb3d9486db384ae6c0b","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        except KeyError:"},{"line_number":58,"context_line":"            return instance[\u0027root_gb\u0027]"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def _resize_and_cache_vhd(self, instance, vhd_path):"},{"line_number":61,"context_line":"        vhd_info \u003d self._vhdutils.get_vhd_info(vhd_path)"},{"line_number":62,"context_line":"        vhd_size \u003d vhd_info[\u0027MaxInternalSize\u0027]"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUX%2F%2F0FM%3D","line":60,"in_reply_to":"AAAAUH%2F9Vkg%3D","updated":"2014-02-10 17:01:04.000000000","message":"Fixing a bug means something was missed and the tests were not appropriate, the nova hacking guide says that there should be tests for all bug patches, so saying \u0027we\u0027re working on some unit test stuff in another patch series\u0027 isn\u0027t valid here...but I think this is what covers the code here:\n\nhttps://github.com/openstack/nova/blob/master/nova/tests/virt/hyperv/test_hypervapi.py#L975\n\nThat\u0027s what I was looking for.\n\nFYI: https://github.com/openstack/nova/blob/master/HACKING.rst","commit_id":"9ea92029f7846dc65238b0be3c3c95568862448d"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"39a39d2f05162070e324780a0c278d51ba122f00","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        except KeyError:"},{"line_number":58,"context_line":"            return instance[\u0027root_gb\u0027]"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def _resize_and_cache_vhd(self, instance, vhd_path):"},{"line_number":61,"context_line":"        vhd_info \u003d self._vhdutils.get_vhd_info(vhd_path)"},{"line_number":62,"context_line":"        vhd_size \u003d vhd_info[\u0027MaxInternalSize\u0027]"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F9Vkg%3D","line":60,"in_reply_to":"AAAAUH%2F9cSI%3D","updated":"2014-02-07 16:28:02.000000000","message":"This part is loosely covered here https://github.com/openstack/nova/blob/master/nova/tests/virt/hyperv/test_hypervapi.py#L956. In fact, a refactoring of those tests using mock is going to be commited very soon, so I thought that this would be out of the purpose of this commit, which is just a bug fix.","commit_id":"9ea92029f7846dc65238b0be3c3c95568862448d"}],"nova/virt/hyperv/vhdutilsv2.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5dde4f66e2108742e25b781870b69fb32d72307a","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        self._vmutils.check_ret_val(ret_val, job_path)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def resize_vhd(self, vhd_path, new_max_size, is_file_max_size\u003dTrue):"},{"line_number":113,"context_line":"        if is_file_max_size:"},{"line_number":114,"context_line":"            new_internal_max_size \u003d ("},{"line_number":115,"context_line":"                self.get_internal_vhd_size_by_file_size(vhd_path,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVv4%3D","line":112,"updated":"2013-10-17 15:03:03.000000000","message":"This method is now nearly identical to the method in the parent class.  As far as I can tell, the only difference is the parent class uses image_man_svc.ExpandVirtualHardDisk and this uses image_man_svc.ResizeVirtualHardDisk.\n\nI would suggest moving the 99% that is the same into a common helper method in the parent class and then pass the image_man_svc class into that helper method, and then all this overridden method has to do is call the parent helper method and pass image_man_svc.ResizeVirtualHardDisk.","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"08f3b9cc10fba7c4eb261fd81ebdf381fb55b3d2","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        self._vmutils.check_ret_val(ret_val, job_path)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def resize_vhd(self, vhd_path, new_max_size, is_file_max_size\u003dTrue):"},{"line_number":113,"context_line":"        if is_file_max_size:"},{"line_number":114,"context_line":"            new_internal_max_size \u003d ("},{"line_number":115,"context_line":"                self.get_internal_vhd_size_by_file_size(vhd_path,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVUM%3D","line":112,"in_reply_to":"AAAATH%2F%2FVrM%3D","updated":"2013-10-17 15:54:57.000000000","message":"Ah, good catch.","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"1bd48560b90308303c2333545b33428510c9199a","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        self._vmutils.check_ret_val(ret_val, job_path)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def resize_vhd(self, vhd_path, new_max_size, is_file_max_size\u003dTrue):"},{"line_number":113,"context_line":"        if is_file_max_size:"},{"line_number":114,"context_line":"            new_internal_max_size \u003d ("},{"line_number":115,"context_line":"                self.get_internal_vhd_size_by_file_size(vhd_path,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVrM%3D","line":112,"in_reply_to":"AAAATH%2F%2FVv4%3D","updated":"2013-10-17 15:50:45.000000000","message":"Msvm_ImageManagementService are different objects between V1 and V2, where they kept the same name. I suggest to add this as well to the overridden method you are suggesting, not only the ResizeVirtualHardDisk call.","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5dde4f66e2108742e25b781870b69fb32d72307a","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        self._vmutils.check_ret_val(ret_val, job_path)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def get_internal_vhd_size_by_file_size(self, vhd_path,"},{"line_number":128,"context_line":"                                           new_vhd_file_size):"},{"line_number":129,"context_line":"        vhd_format \u003d super(VHDUtilsV2, self).get_vhd_format(vhd_path)"},{"line_number":130,"context_line":"        if vhd_format \u003d\u003d constants.DISK_FORMAT_VHD:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVxE%3D","line":127,"updated":"2013-10-17 15:03:03.000000000","message":"There is a nice docstring in the V1 parent class for this method, I would suggest a good docstring here for VHDX also (like the parent class).","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"1bd48560b90308303c2333545b33428510c9199a","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        self._vmutils.check_ret_val(ret_val, job_path)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def get_internal_vhd_size_by_file_size(self, vhd_path,"},{"line_number":128,"context_line":"                                           new_vhd_file_size):"},{"line_number":129,"context_line":"        vhd_format \u003d super(VHDUtilsV2, self).get_vhd_format(vhd_path)"},{"line_number":130,"context_line":"        if vhd_format \u003d\u003d constants.DISK_FORMAT_VHD:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVqs%3D","line":127,"in_reply_to":"AAAATH%2F%2FVxE%3D","updated":"2013-10-17 15:50:45.000000000","message":"Lucian, this has already been requested in a previous review","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"1bd48560b90308303c2333545b33428510c9199a","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def get_internal_vhd_size_by_file_size(self, vhd_path,"},{"line_number":128,"context_line":"                                           new_vhd_file_size):"},{"line_number":129,"context_line":"        vhd_format \u003d super(VHDUtilsV2, self).get_vhd_format(vhd_path)"},{"line_number":130,"context_line":"        if vhd_format \u003d\u003d constants.DISK_FORMAT_VHD:"},{"line_number":131,"context_line":"            return super(VHDUtilsV2,"},{"line_number":132,"context_line":"                         self).get_internal_vhd_size_by_file_size("}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVoA%3D","line":129,"updated":"2013-10-17 15:50:45.000000000","message":"Why do you use a reference to the base class here? This method has not been overridden","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5dde4f66e2108742e25b781870b69fb32d72307a","unresolved":false,"context_lines":[{"line_number":137,"context_line":"                    header_size \u003d VHDX_HEADER_SECTION_SIZE"},{"line_number":138,"context_line":"                    vhd_info \u003d self.get_vhd_info(vhd_path)"},{"line_number":139,"context_line":"                    logical_sector_size \u003d vhd_info[\u0027LogicalSectorSize\u0027]"},{"line_number":140,"context_line":"                    block_size \u003d vhd_info[\u0027BlockSize\u0027]"},{"line_number":141,"context_line":"                    if not block_size:"},{"line_number":142,"context_line":"                        block_size \u003d VHDX_DEFAULT_BLOCK_SIZE"},{"line_number":143,"context_line":"                    log_size \u003d self._get_vhdx_log_size(f)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVy0%3D","line":140,"updated":"2013-10-17 15:03:03.000000000","message":"Hmm, to be safe it seems you should do a vhd_info.get(\u0027BlockSize\u0027) in case the key isn\u0027t in the dict, you\u0027ll get None back by default.  Avoid a KeyError here.","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"1bd48560b90308303c2333545b33428510c9199a","unresolved":false,"context_lines":[{"line_number":137,"context_line":"                    header_size \u003d VHDX_HEADER_SECTION_SIZE"},{"line_number":138,"context_line":"                    vhd_info \u003d self.get_vhd_info(vhd_path)"},{"line_number":139,"context_line":"                    logical_sector_size \u003d vhd_info[\u0027LogicalSectorSize\u0027]"},{"line_number":140,"context_line":"                    block_size \u003d vhd_info[\u0027BlockSize\u0027]"},{"line_number":141,"context_line":"                    if not block_size:"},{"line_number":142,"context_line":"                        block_size \u003d VHDX_DEFAULT_BLOCK_SIZE"},{"line_number":143,"context_line":"                    log_size \u003d self._get_vhdx_log_size(f)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVmI%3D","line":140,"in_reply_to":"AAAATH%2F%2FVy0%3D","updated":"2013-10-17 15:50:45.000000000","message":"Please see comment of following line","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"1bd48560b90308303c2333545b33428510c9199a","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                    logical_sector_size \u003d vhd_info[\u0027LogicalSectorSize\u0027]"},{"line_number":140,"context_line":"                    block_size \u003d vhd_info[\u0027BlockSize\u0027]"},{"line_number":141,"context_line":"                    if not block_size:"},{"line_number":142,"context_line":"                        block_size \u003d VHDX_DEFAULT_BLOCK_SIZE"},{"line_number":143,"context_line":"                    log_size \u003d self._get_vhdx_log_size(f)"},{"line_number":144,"context_line":"                    metadata_size \u003d self._get_vhdx_metadata_size(f)"},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVl0%3D","line":142,"updated":"2013-10-17 15:50:45.000000000","message":"This check can be removed. All VHDX have this property set.","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"b3138befe26fa010a91dafaf5a0af29be8d3cda4","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                    logical_sector_size \u003d vhd_info[\u0027LogicalSectorSize\u0027]"},{"line_number":140,"context_line":"                    block_size \u003d vhd_info[\u0027BlockSize\u0027]"},{"line_number":141,"context_line":"                    if not block_size:"},{"line_number":142,"context_line":"                        block_size \u003d VHDX_DEFAULT_BLOCK_SIZE"},{"line_number":143,"context_line":"                    log_size \u003d self._get_vhdx_log_size(f)"},{"line_number":144,"context_line":"                    metadata_size \u003d self._get_vhdx_metadata_size(f)"},{"line_number":145,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FU8E%3D","line":142,"in_reply_to":"AAAATH%2F%2FVl0%3D","updated":"2013-10-17 17:54:33.000000000","message":"The reason I used this is that for fixed images, this value was set to 0.","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5dde4f66e2108742e25b781870b69fb32d72307a","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                    log_size \u003d self._get_vhdx_log_size(f)"},{"line_number":144,"context_line":"                    metadata_size \u003d self._get_vhdx_metadata_size(f)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"                    chunk_ratio \u003d (2 ** 23) * logical_sector_size / block_size"},{"line_number":147,"context_line":"                    data_blocks_count \u003d (new_vhd_file_size +"},{"line_number":148,"context_line":"                                         block_size - 1) / block_size"},{"line_number":149,"context_line":"                    total_bat_entries \u003d (data_blocks_count + (data_blocks_count"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVyU%3D","line":146,"updated":"2013-10-17 15:03:03.000000000","message":"Where do the numbers for the chunk_ratio come from?  The VHDX spec?  Maybe a comment here to clarify or make it a constant?","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"1bd48560b90308303c2333545b33428510c9199a","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                    log_size \u003d self._get_vhdx_log_size(f)"},{"line_number":144,"context_line":"                    metadata_size \u003d self._get_vhdx_metadata_size(f)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"                    chunk_ratio \u003d (2 ** 23) * logical_sector_size / block_size"},{"line_number":147,"context_line":"                    data_blocks_count \u003d (new_vhd_file_size +"},{"line_number":148,"context_line":"                                         block_size - 1) / block_size"},{"line_number":149,"context_line":"                    total_bat_entries \u003d (data_blocks_count + (data_blocks_count"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVko%3D","line":146,"in_reply_to":"AAAATH%2F%2FVyU%3D","updated":"2013-10-17 15:50:45.000000000","message":"A small nit: as a general rule when working with powers of 2 use bit shifting instead of powers: 1 \u003c\u003c 23","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5dde4f66e2108742e25b781870b69fb32d72307a","unresolved":false,"context_lines":[{"line_number":156,"context_line":"                        bat_size * (1024 ** 2))"},{"line_number":157,"context_line":"                    max_internal_size -\u003d max_internal_size % block_size"},{"line_number":158,"context_line":"                    return max_internal_size"},{"line_number":159,"context_line":"            except IOError:"},{"line_number":160,"context_line":"                raise vmutils.HyperVException(_(\"Unable to obtain internal\""},{"line_number":161,"context_line":"                                                \"size from VHDX: %(vhd_path)s\")"},{"line_number":162,"context_line":"                                              % {\"vhd_path\": vhd_path})"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVzg%3D","line":159,"updated":"2013-10-17 15:03:03.000000000","message":"Wouldn\u0027t it be helpful to have the error message in the exception that you\u0027re going to raise?","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"1bd48560b90308303c2333545b33428510c9199a","unresolved":false,"context_lines":[{"line_number":157,"context_line":"                    max_internal_size -\u003d max_internal_size % block_size"},{"line_number":158,"context_line":"                    return max_internal_size"},{"line_number":159,"context_line":"            except IOError:"},{"line_number":160,"context_line":"                raise vmutils.HyperVException(_(\"Unable to obtain internal\""},{"line_number":161,"context_line":"                                                \"size from VHDX: %(vhd_path)s\")"},{"line_number":162,"context_line":"                                              % {\"vhd_path\": vhd_path})"},{"line_number":163,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVpE%3D","line":160,"updated":"2013-10-17 15:50:45.000000000","message":"Can you please check if those newlines are aligned properly? Not sure if it\u0027s an issue with how it\u0027s rendered here.","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"08f3b9cc10fba7c4eb261fd81ebdf381fb55b3d2","unresolved":false,"context_lines":[{"line_number":157,"context_line":"                    max_internal_size -\u003d max_internal_size % block_size"},{"line_number":158,"context_line":"                    return max_internal_size"},{"line_number":159,"context_line":"            except IOError:"},{"line_number":160,"context_line":"                raise vmutils.HyperVException(_(\"Unable to obtain internal\""},{"line_number":161,"context_line":"                                                \"size from VHDX: %(vhd_path)s\")"},{"line_number":162,"context_line":"                                              % {\"vhd_path\": vhd_path})"},{"line_number":163,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVUs%3D","line":160,"in_reply_to":"AAAATH%2F%2FVpE%3D","updated":"2013-10-17 15:54:57.000000000","message":"It\u0027s not just you.","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"1bd48560b90308303c2333545b33428510c9199a","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        return log_size"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"    def _get_vhdx_metadata_size(self, vhdx_file):"},{"line_number":181,"context_line":"        \u0027\u0027\u0027Returns the metadata table size\u0027\u0027\u0027"},{"line_number":182,"context_line":"        offset \u003d VHDX_METADATA_SIZE_OFFSET + VHDX_REGION_TABLE_OFFSET * 1024"},{"line_number":183,"context_line":"        vhdx_file.seek(offset)"},{"line_number":184,"context_line":"        metadata_size \u003d struct.unpack(\u0027\u003cI\u0027, vhdx_file.read(4))[0]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVio%3D","line":181,"updated":"2013-10-17 15:50:45.000000000","message":"This comment is IMO useless in this form as it just repeats what the method signature says. I\u0027d also keep consistency with the other methods.","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"08f3b9cc10fba7c4eb261fd81ebdf381fb55b3d2","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        return log_size"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"    def _get_vhdx_metadata_size(self, vhdx_file):"},{"line_number":181,"context_line":"        \u0027\u0027\u0027Returns the metadata table size\u0027\u0027\u0027"},{"line_number":182,"context_line":"        offset \u003d VHDX_METADATA_SIZE_OFFSET + VHDX_REGION_TABLE_OFFSET * 1024"},{"line_number":183,"context_line":"        vhdx_file.seek(offset)"},{"line_number":184,"context_line":"        metadata_size \u003d struct.unpack(\u0027\u003cI\u0027, vhdx_file.read(4))[0]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FVUw%3D","line":181,"in_reply_to":"AAAATH%2F%2FVio%3D","updated":"2013-10-17 15:54:57.000000000","message":"This fails pep8 too btw.","commit_id":"2540be3008fd8608479a41a47c51fea38fa9f8b6"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"5e483bc437f1f8590c10f95cbb558f14d26a85ff","unresolved":false,"context_lines":[{"line_number":132,"context_line":"            if vhd_info[\u0027Type\u0027] \u003d\u003d self._VHD_TYPE_DIFFERENCING:"},{"line_number":133,"context_line":"                raise vmutils.HyperVException(_(\"The %(vhd_type)s type VHDX \""},{"line_number":134,"context_line":"                                                \"is not supported\") %"},{"line_number":135,"context_line":"                                                {\"vhd_type\": vhd_type})"},{"line_number":136,"context_line":"            else:"},{"line_number":137,"context_line":"                try:"},{"line_number":138,"context_line":"                    with open(vhd_path, \u0027rb\u0027) as f:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2Fvxg%3D","line":135,"updated":"2013-10-29 15:56:27.000000000","message":"vhd_type is undeclared","commit_id":"1f2ae7e5fdeb96efe872b7d6aa2e17642846aae9"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"df8188117a50bfebbbedf1e74eff40190585669c","unresolved":false,"context_lines":[{"line_number":132,"context_line":"            if vhd_info[\u0027Type\u0027] \u003d\u003d self._VHD_TYPE_DIFFERENCING:"},{"line_number":133,"context_line":"                raise vmutils.HyperVException(_(\"The %(vhd_type)s type VHDX \""},{"line_number":134,"context_line":"                                                \"is not supported\") %"},{"line_number":135,"context_line":"                                                {\"vhd_type\": vhd_type})"},{"line_number":136,"context_line":"            else:"},{"line_number":137,"context_line":"                try:"},{"line_number":138,"context_line":"                    with open(vhd_path, \u0027rb\u0027) as f:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2Fvwg%3D","line":135,"updated":"2013-10-29 15:58:59.000000000","message":"where is the vhd_type defined? besides, the number type in error log will not be helpful so much, how about passing the string in rather than number, like change the line 48 to (4, \u0027DIFFERENCING\u0027), something like that.","commit_id":"1f2ae7e5fdeb96efe872b7d6aa2e17642846aae9"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"df8188117a50bfebbbedf1e74eff40190585669c","unresolved":false,"context_lines":[{"line_number":151,"context_line":"                            ls - ms - bes - bes / chunk_ratio) / (bs *"},{"line_number":152,"context_line":"                            chunk_ratio + bes * chunk_ratio + bes))"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"                        return max_internal_size - max_internal_size % bs"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"                except IOError as ex:"},{"line_number":157,"context_line":"                    raise vmutils.HyperVException(_(\"Unable to obtain internal\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2Fvuw%3D","line":154,"updated":"2013-10-29 15:58:59.000000000","message":"how about max_internal_size - (max_internal_size % bs) for better readability?","commit_id":"1f2ae7e5fdeb96efe872b7d6aa2e17642846aae9"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"9a1c6e5ed42d501fc5c2a528930b0d1a89c8e6b7","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                        return max_internal_size - (max_internal_size % bs)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"                except IOError as ex:"},{"line_number":157,"context_line":"                    raise vmutils.HyperVException(_(\"Unable to obtain internal\""},{"line_number":158,"context_line":"                                                    \"size from VHDX: \""},{"line_number":159,"context_line":"                                                    \"%(vhd_path)s. Exception: \""},{"line_number":160,"context_line":"                                                    \"%(ex)s\") %"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2Fsks%3D","line":157,"updated":"2013-10-30 10:17:10.000000000","message":"there should be a space exist after the word internal.","commit_id":"80f199551dfc1bfbd53a62c19a16a16bc40035b3"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"64517569d92bfdddd7fdee58eee4b5eaf790eaf2","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"VHDX_BAT_ENTRY_SIZE \u003d 8"},{"line_number":38,"context_line":"VHDX_HEADER_OFFSETS \u003d [64 * 1024, 128 * 1024]"},{"line_number":39,"context_line":"VHDX_HEADER_SECTION_SIZE \u003d 1024 ** 2"},{"line_number":40,"context_line":"VHDX_LOG_LENGTH_OFFSET \u003d 68"},{"line_number":41,"context_line":"VHDX_METADATA_SIZE_OFFSET \u003d 64"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2FMuI%3D","line":38,"updated":"2013-11-13 02:34:13.000000000","message":"we\u0027d better to use unit.ki here","commit_id":"bbafd981cd901470ece3bc45e53ce02c0a2e6461"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"937829c24abb771c02ef829df08b551e1a4f8fb4","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"VHDX_BAT_ENTRY_SIZE \u003d 8"},{"line_number":38,"context_line":"VHDX_HEADER_OFFSETS \u003d [64 * 1024, 128 * 1024]"},{"line_number":39,"context_line":"VHDX_HEADER_SECTION_SIZE \u003d 1024 ** 2"},{"line_number":40,"context_line":"VHDX_LOG_LENGTH_OFFSET \u003d 68"},{"line_number":41,"context_line":"VHDX_METADATA_SIZE_OFFSET \u003d 64"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2ByU8%3D","line":38,"in_reply_to":"AAAATn%2F%2B2zo%3D","updated":"2013-11-20 08:00:04.000000000","message":"in that case it make sense to me, thanks for your comments.","commit_id":"bbafd981cd901470ece3bc45e53ce02c0a2e6461"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"85c208bb0beb3f1cc18d43f1f501e12388a6b80a","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"VHDX_BAT_ENTRY_SIZE \u003d 8"},{"line_number":38,"context_line":"VHDX_HEADER_OFFSETS \u003d [64 * 1024, 128 * 1024]"},{"line_number":39,"context_line":"VHDX_HEADER_SECTION_SIZE \u003d 1024 ** 2"},{"line_number":40,"context_line":"VHDX_LOG_LENGTH_OFFSET \u003d 68"},{"line_number":41,"context_line":"VHDX_METADATA_SIZE_OFFSET \u003d 64"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B2zo%3D","line":38,"in_reply_to":"AAAATn%2F%2B4Bk%3D","updated":"2013-11-19 10:05:00.000000000","message":"We\u0027d prefer to avoid importing nova modules in the utils classes, unless necessary (not counting _, logging and conf of course).\n\nThe main reason is that the utils classes are meant to provide a general purpose Hyper-V interface, which might be externalised in a separate project in the future.\n\nI really don\u0027t see the need to import a module for a couple of clearly defined constants, but I\u0027m not opposing it as well if other reviewers ask for it.","commit_id":"bbafd981cd901470ece3bc45e53ce02c0a2e6461"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"f302b753c38c4d19d51e91c4ededa3971987b7a8","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"VHDX_BAT_ENTRY_SIZE \u003d 8"},{"line_number":38,"context_line":"VHDX_HEADER_OFFSETS \u003d [64 * 1024, 128 * 1024]"},{"line_number":39,"context_line":"VHDX_HEADER_SECTION_SIZE \u003d 1024 ** 2"},{"line_number":40,"context_line":"VHDX_LOG_LENGTH_OFFSET \u003d 68"},{"line_number":41,"context_line":"VHDX_METADATA_SIZE_OFFSET \u003d 64"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B4Bk%3D","line":38,"in_reply_to":"AAAATn%2F%2B6Bk%3D","updated":"2013-11-19 03:31:12.000000000","message":"VHDX_HEADER_OFFSETS \u003d [64 * unit.Ki, 128 * unit.Ki], does that make sense?","commit_id":"bbafd981cd901470ece3bc45e53ce02c0a2e6461"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"ad76b724263e5722ab2c4be00f19672bd11b0f7c","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"VHDX_BAT_ENTRY_SIZE \u003d 8"},{"line_number":38,"context_line":"VHDX_HEADER_OFFSETS \u003d [64 * 1024, 128 * 1024]"},{"line_number":39,"context_line":"VHDX_HEADER_SECTION_SIZE \u003d 1024 ** 2"},{"line_number":40,"context_line":"VHDX_LOG_LENGTH_OFFSET \u003d 68"},{"line_number":41,"context_line":"VHDX_METADATA_SIZE_OFFSET \u003d 64"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B6Bk%3D","line":38,"in_reply_to":"AAAATn%2F%2FMuI%3D","updated":"2013-11-18 18:09:04.000000000","message":"Can you please detail what do you mean with unit.ki?\nThanks","commit_id":"bbafd981cd901470ece3bc45e53ce02c0a2e6461"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"64517569d92bfdddd7fdee58eee4b5eaf790eaf2","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"VHDX_BAT_ENTRY_SIZE \u003d 8"},{"line_number":38,"context_line":"VHDX_HEADER_OFFSETS \u003d [64 * 1024, 128 * 1024]"},{"line_number":39,"context_line":"VHDX_HEADER_SECTION_SIZE \u003d 1024 ** 2"},{"line_number":40,"context_line":"VHDX_LOG_LENGTH_OFFSET \u003d 68"},{"line_number":41,"context_line":"VHDX_METADATA_SIZE_OFFSET \u003d 64"},{"line_number":42,"context_line":"VHDX_REGION_TABLE_OFFSET \u003d 192"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2FMuE%3D","line":39,"updated":"2013-11-13 02:34:13.000000000","message":"ditto","commit_id":"bbafd981cd901470ece3bc45e53ce02c0a2e6461"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"change_message_id":"85c208bb0beb3f1cc18d43f1f501e12388a6b80a","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"VHDX_BAT_ENTRY_SIZE \u003d 8"},{"line_number":38,"context_line":"VHDX_HEADER_OFFSETS \u003d [64 * 1024, 128 * 1024]"},{"line_number":39,"context_line":"VHDX_HEADER_SECTION_SIZE \u003d 1024 ** 2"},{"line_number":40,"context_line":"VHDX_LOG_LENGTH_OFFSET \u003d 68"},{"line_number":41,"context_line":"VHDX_METADATA_SIZE_OFFSET \u003d 64"},{"line_number":42,"context_line":"VHDX_REGION_TABLE_OFFSET \u003d 192"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B2zk%3D","line":39,"in_reply_to":"AAAATn%2F%2B4BY%3D","updated":"2013-11-19 10:05:00.000000000","message":"ditto","commit_id":"bbafd981cd901470ece3bc45e53ce02c0a2e6461"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"f302b753c38c4d19d51e91c4ededa3971987b7a8","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"VHDX_BAT_ENTRY_SIZE \u003d 8"},{"line_number":38,"context_line":"VHDX_HEADER_OFFSETS \u003d [64 * 1024, 128 * 1024]"},{"line_number":39,"context_line":"VHDX_HEADER_SECTION_SIZE \u003d 1024 ** 2"},{"line_number":40,"context_line":"VHDX_LOG_LENGTH_OFFSET \u003d 68"},{"line_number":41,"context_line":"VHDX_METADATA_SIZE_OFFSET \u003d 64"},{"line_number":42,"context_line":"VHDX_REGION_TABLE_OFFSET \u003d 192"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2B4BY%3D","line":39,"in_reply_to":"AAAATn%2F%2FMuE%3D","updated":"2013-11-19 03:31:12.000000000","message":"VHDX_HEADER_SECTION_SIZE \u003d unit.Mi * 2","commit_id":"bbafd981cd901470ece3bc45e53ce02c0a2e6461"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ca94d1c46e15b0ee3cef85eb2b77b741aca3f5b0","unresolved":false,"context_lines":[{"line_number":132,"context_line":"            vhd_type \u003d vhd_info[\u0027Type\u0027]"},{"line_number":133,"context_line":"            if vhd_type \u003d\u003d self._VHD_TYPE_DIFFERENCING:"},{"line_number":134,"context_line":"                raise vmutils.HyperVException(_(\"Differencing VHDX images \""},{"line_number":135,"context_line":"                                                \"are not supported\"))"},{"line_number":136,"context_line":"            else:"},{"line_number":137,"context_line":"                try:"},{"line_number":138,"context_line":"                    with open(vhd_path, \u0027rb\u0027) as f:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2Fx4E%3D","line":135,"updated":"2014-01-08 15:43:50.000000000","message":"Alignment looks off here.  Also, might be helpful to have the vhd_path in the exception message for context.","commit_id":"93dee15043cf1c6eba379bd1d14372623504fe2b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ca94d1c46e15b0ee3cef85eb2b77b741aca3f5b0","unresolved":false,"context_lines":[{"line_number":137,"context_line":"                try:"},{"line_number":138,"context_line":"                    with open(vhd_path, \u0027rb\u0027) as f:"},{"line_number":139,"context_line":"                        hs \u003d VHDX_HEADER_SECTION_SIZE"},{"line_number":140,"context_line":"                        bes \u003d VHDX_BAT_ENTRY_SIZE"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"                        lss \u003d vhd_info[\u0027LogicalSectorSize\u0027]"},{"line_number":143,"context_line":"                        bs \u003d self._get_vhdx_block_size(f)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2Fx0c%3D","line":140,"updated":"2014-01-08 15:43:50.000000000","message":"Do we really need a var to store the global constant value?","commit_id":"93dee15043cf1c6eba379bd1d14372623504fe2b"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"fd9449c063fd2d9986c6c682a5a7fedcb9cc986c","unresolved":false,"context_lines":[{"line_number":137,"context_line":"                try:"},{"line_number":138,"context_line":"                    with open(vhd_path, \u0027rb\u0027) as f:"},{"line_number":139,"context_line":"                        hs \u003d VHDX_HEADER_SECTION_SIZE"},{"line_number":140,"context_line":"                        bes \u003d VHDX_BAT_ENTRY_SIZE"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"                        lss \u003d vhd_info[\u0027LogicalSectorSize\u0027]"},{"line_number":143,"context_line":"                        bs \u003d self._get_vhdx_block_size(f)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2FxC4%3D","line":140,"in_reply_to":"AAAAUH%2F%2Fx0c%3D","updated":"2014-01-08 18:37:58.000000000","message":"The reason why I did this was to improve the readability as the bellow formula gets quite condensed.","commit_id":"93dee15043cf1c6eba379bd1d14372623504fe2b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ca94d1c46e15b0ee3cef85eb2b77b741aca3f5b0","unresolved":false,"context_lines":[{"line_number":155,"context_line":""},{"line_number":156,"context_line":"                except IOError as ex:"},{"line_number":157,"context_line":"                    raise vmutils.HyperVException(_(\"Unable to obtain \""},{"line_number":158,"context_line":"                                                    \"internal size from VHDX: \""},{"line_number":159,"context_line":"                                                    \"%(vhd_path)s. Exception: \""},{"line_number":160,"context_line":"                                                    \"%(ex)s\") %"},{"line_number":161,"context_line":"                                                    {\"vhd_path\": vhd_path,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2Fx3o%3D","line":158,"updated":"2014-01-08 15:43:50.000000000","message":"nit: alignment looks off on the message.","commit_id":"93dee15043cf1c6eba379bd1d14372623504fe2b"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"fd9449c063fd2d9986c6c682a5a7fedcb9cc986c","unresolved":false,"context_lines":[{"line_number":155,"context_line":""},{"line_number":156,"context_line":"                except IOError as ex:"},{"line_number":157,"context_line":"                    raise vmutils.HyperVException(_(\"Unable to obtain \""},{"line_number":158,"context_line":"                                                    \"internal size from VHDX: \""},{"line_number":159,"context_line":"                                                    \"%(vhd_path)s. Exception: \""},{"line_number":160,"context_line":"                                                    \"%(ex)s\") %"},{"line_number":161,"context_line":"                                                    {\"vhd_path\": vhd_path,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2FxBo%3D","line":158,"in_reply_to":"AAAAUH%2F%2Fx3o%3D","updated":"2014-01-08 18:37:58.000000000","message":"I think this is just a rendering bug. It\u0027s not the first time I\u0027m facing it.","commit_id":"93dee15043cf1c6eba379bd1d14372623504fe2b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ca94d1c46e15b0ee3cef85eb2b77b741aca3f5b0","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        return log_size"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"    def _get_vhdx_metadata_size_and_offset(self, vhdx_file):"},{"line_number":181,"context_line":"        offset \u003d VHDX_METADATA_SIZE_OFFSET + VHDX_REGION_TABLE_OFFSET * 1024"},{"line_number":182,"context_line":"        vhdx_file.seek(offset)"},{"line_number":183,"context_line":"        metadata_offset \u003d struct.unpack(\u0027\u003cQ\u0027, vhdx_file.read(8))[0]"},{"line_number":184,"context_line":"        metadata_size \u003d struct.unpack(\u0027\u003cI\u0027, vhdx_file.read(4))[0]"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2Fx00%3D","line":181,"updated":"2014-01-08 15:43:50.000000000","message":"Why isn\u0027t the 1024 multiplier just built into the VHDX_REGION_TABLE_OFFSET?","commit_id":"93dee15043cf1c6eba379bd1d14372623504fe2b"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"fd9449c063fd2d9986c6c682a5a7fedcb9cc986c","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        return log_size"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"    def _get_vhdx_metadata_size_and_offset(self, vhdx_file):"},{"line_number":181,"context_line":"        offset \u003d VHDX_METADATA_SIZE_OFFSET + VHDX_REGION_TABLE_OFFSET * 1024"},{"line_number":182,"context_line":"        vhdx_file.seek(offset)"},{"line_number":183,"context_line":"        metadata_offset \u003d struct.unpack(\u0027\u003cQ\u0027, vhdx_file.read(8))[0]"},{"line_number":184,"context_line":"        metadata_size \u003d struct.unpack(\u0027\u003cI\u0027, vhdx_file.read(4))[0]"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2FxBk%3D","line":181,"in_reply_to":"AAAAUH%2F%2Fx00%3D","updated":"2014-01-08 18:37:58.000000000","message":"Done","commit_id":"93dee15043cf1c6eba379bd1d14372623504fe2b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ca94d1c46e15b0ee3cef85eb2b77b741aca3f5b0","unresolved":false,"context_lines":[{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    def _get_vhdx_block_size(self, vhdx_file):"},{"line_number":188,"context_line":"        metadata_offset \u003d self._get_vhdx_metadata_size_and_offset(vhdx_file)[1]"},{"line_number":189,"context_line":"        offset \u003d metadata_offset + 48"},{"line_number":190,"context_line":"        vhdx_file.seek(offset)"},{"line_number":191,"context_line":"        file_parameter_offset \u003d struct.unpack(\u0027\u003cI\u0027, vhdx_file.read(4))[0]"},{"line_number":192,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2Fx0U%3D","line":189,"updated":"2014-01-08 15:43:50.000000000","message":"Should there be a constant defined for the 48 here?","commit_id":"93dee15043cf1c6eba379bd1d14372623504fe2b"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"fd9449c063fd2d9986c6c682a5a7fedcb9cc986c","unresolved":false,"context_lines":[{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    def _get_vhdx_block_size(self, vhdx_file):"},{"line_number":188,"context_line":"        metadata_offset \u003d self._get_vhdx_metadata_size_and_offset(vhdx_file)[1]"},{"line_number":189,"context_line":"        offset \u003d metadata_offset + 48"},{"line_number":190,"context_line":"        vhdx_file.seek(offset)"},{"line_number":191,"context_line":"        file_parameter_offset \u003d struct.unpack(\u0027\u003cI\u0027, vhdx_file.read(4))[0]"},{"line_number":192,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2Fw88%3D","line":189,"in_reply_to":"AAAAUH%2F%2Fx0U%3D","updated":"2014-01-08 18:37:58.000000000","message":"That would be the block size metadata table entry offset. It seems to be quite a long name, but I will define a constant for it.","commit_id":"93dee15043cf1c6eba379bd1d14372623504fe2b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"79594ba21e0dfe66f5c6f2df93890867b268af9e","unresolved":false,"context_lines":[{"line_number":132,"context_line":"            vhd_type \u003d vhd_info[\u0027Type\u0027]"},{"line_number":133,"context_line":"            if vhd_type \u003d\u003d self._VHD_TYPE_DIFFERENCING:"},{"line_number":134,"context_line":"                raise vmutils.HyperVException(_(\"Differencing VHDX images \""},{"line_number":135,"context_line":"                                                \"are not supported\"))"},{"line_number":136,"context_line":"            else:"},{"line_number":137,"context_line":"                try:"},{"line_number":138,"context_line":"                    with open(vhd_path, \u0027rb\u0027) as f:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F9cS4%3D","line":135,"updated":"2014-02-06 21:52:34.000000000","message":"Alignment?","commit_id":"9ea92029f7846dc65238b0be3c3c95568862448d"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"39a39d2f05162070e324780a0c278d51ba122f00","unresolved":false,"context_lines":[{"line_number":132,"context_line":"            vhd_type \u003d vhd_info[\u0027Type\u0027]"},{"line_number":133,"context_line":"            if vhd_type \u003d\u003d self._VHD_TYPE_DIFFERENCING:"},{"line_number":134,"context_line":"                raise vmutils.HyperVException(_(\"Differencing VHDX images \""},{"line_number":135,"context_line":"                                                \"are not supported\"))"},{"line_number":136,"context_line":"            else:"},{"line_number":137,"context_line":"                try:"},{"line_number":138,"context_line":"                    with open(vhd_path, \u0027rb\u0027) as f:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUH%2F9WSk%3D","line":135,"in_reply_to":"AAAAUH%2F9cS4%3D","updated":"2014-02-07 16:28:02.000000000","message":"Done","commit_id":"9ea92029f7846dc65238b0be3c3c95568862448d"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"89a663297c5b1cea89c1ff32188eb227f41ce0bd","unresolved":false,"context_lines":[{"line_number":132,"context_line":"            vhd_type \u003d vhd_info[\u0027Type\u0027]"},{"line_number":133,"context_line":"            if vhd_type \u003d\u003d self._VHD_TYPE_DIFFERENCING:"},{"line_number":134,"context_line":"                raise vmutils.HyperVException(_(\"Differencing VHDX images \""},{"line_number":135,"context_line":"                                                \"are not supported\"))"},{"line_number":136,"context_line":"            else:"},{"line_number":137,"context_line":"                try:"},{"line_number":138,"context_line":"                    with open(vhd_path, \u0027rb\u0027) as f:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUX%2F%2F1PE%3D","line":135,"in_reply_to":"AAAAUH%2F9cS4%3D","updated":"2014-02-10 14:46:28.000000000","message":"In fact, it seems that this is again just a rendering issue. I\u0027ve double checked the file and the alignment is fine.","commit_id":"9ea92029f7846dc65238b0be3c3c95568862448d"}]}
