)]}'
{"nova/virt/libvirt/driver.py":[{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"b0a409eb87991e386f0413152f40454e0e36e5f0","unresolved":false,"context_lines":[{"line_number":2053,"context_line":"            # driver may report that the volume is still in use."},{"line_number":2054,"context_line":"            supports_device_missing \u003d self._host.has_min_version("},{"line_number":2055,"context_line":"               MIN_LIBVIRT_VIR_ERR_DEVICE_MISSING)"},{"line_number":2056,"context_line":"            if state \u003d\u003d power_state.PAUSED:"},{"line_number":2057,"context_line":"                wait_for_detach \u003d guest.detach_device_with_retry("},{"line_number":2058,"context_line":"                    guest.get_disk, disk_dev, live\u003dlive,"},{"line_number":2059,"context_line":"                    supports_device_missing_error_code\u003dsupports_device_missing,"},{"line_number":2060,"context_line":"                    paused_instance_volume_detach\u003dTrue)"},{"line_number":2061,"context_line":"            else:"},{"line_number":2062,"context_line":"                wait_for_detach \u003d guest.detach_device_with_retry("},{"line_number":2063,"context_line":"                    guest.get_disk, disk_dev, live\u003dlive,"},{"line_number":2064,"context_line":"                    supports_device_missing_error_code\u003dsupports_device_missing)"},{"line_number":2065,"context_line":""},{"line_number":2066,"context_line":"            wait_for_detach()"},{"line_number":2067,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_644cee3e","line":2064,"range":{"start_line":2056,"start_character":0,"end_line":2064,"end_character":79},"updated":"2020-09-17 10:23:22.000000000","message":"Apologies, I missed that we were already providing this partially through the live arg. Why don\u0027t we replace live and your new supports_device_missing_error_code kwarg with a simple state argument on detach_device_with_retry?","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"9391d20222ae0e57d216edaca65e93666aee79a2","unresolved":false,"context_lines":[{"line_number":2053,"context_line":"            # driver may report that the volume is still in use."},{"line_number":2054,"context_line":"            supports_device_missing \u003d self._host.has_min_version("},{"line_number":2055,"context_line":"               MIN_LIBVIRT_VIR_ERR_DEVICE_MISSING)"},{"line_number":2056,"context_line":"            if state \u003d\u003d power_state.PAUSED:"},{"line_number":2057,"context_line":"                wait_for_detach \u003d guest.detach_device_with_retry("},{"line_number":2058,"context_line":"                    guest.get_disk, disk_dev, live\u003dlive,"},{"line_number":2059,"context_line":"                    supports_device_missing_error_code\u003dsupports_device_missing,"},{"line_number":2060,"context_line":"                    paused_instance_volume_detach\u003dTrue)"},{"line_number":2061,"context_line":"            else:"},{"line_number":2062,"context_line":"                wait_for_detach \u003d guest.detach_device_with_retry("},{"line_number":2063,"context_line":"                    guest.get_disk, disk_dev, live\u003dlive,"},{"line_number":2064,"context_line":"                    supports_device_missing_error_code\u003dsupports_device_missing)"},{"line_number":2065,"context_line":""},{"line_number":2066,"context_line":"            wait_for_detach()"},{"line_number":2067,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_e7033c75","line":2064,"range":{"start_line":2056,"start_character":0,"end_line":2064,"end_character":79},"in_reply_to":"9f560f44_644cee3e","updated":"2020-09-21 01:45:53.000000000","message":"Of course we can do that.","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"b0a409eb87991e386f0413152f40454e0e36e5f0","unresolved":false,"context_lines":[{"line_number":2266,"context_line":"            # timeout."},{"line_number":2267,"context_line":"            supports_device_missing \u003d self._host.has_min_version("},{"line_number":2268,"context_line":"               MIN_LIBVIRT_VIR_ERR_DEVICE_MISSING)"},{"line_number":2269,"context_line":"            wait_for_detach \u003d guest.detach_device_with_retry("},{"line_number":2270,"context_line":"                guest.get_interface_by_cfg, cfg, live\u003dlive,"},{"line_number":2271,"context_line":"                alternative_device_name\u003dself.vif_driver.get_vif_devname(vif),"},{"line_number":2272,"context_line":"                supports_device_missing_error_code\u003dsupports_device_missing)"},{"line_number":2273,"context_line":"            wait_for_detach()"},{"line_number":2274,"context_line":"        except exception.DeviceDetachFailed:"},{"line_number":2275,"context_line":"            # We failed to detach the device even with the retry loop, so let\u0027s"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_c4605aa8","line":2272,"range":{"start_line":2269,"start_character":0,"end_line":2272,"end_character":75},"updated":"2020-09-17 10:23:22.000000000","message":"We will also need to update this call to provide the state of the instance FWIW.","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"9391d20222ae0e57d216edaca65e93666aee79a2","unresolved":false,"context_lines":[{"line_number":2266,"context_line":"            # timeout."},{"line_number":2267,"context_line":"            supports_device_missing \u003d self._host.has_min_version("},{"line_number":2268,"context_line":"               MIN_LIBVIRT_VIR_ERR_DEVICE_MISSING)"},{"line_number":2269,"context_line":"            wait_for_detach \u003d guest.detach_device_with_retry("},{"line_number":2270,"context_line":"                guest.get_interface_by_cfg, cfg, live\u003dlive,"},{"line_number":2271,"context_line":"                alternative_device_name\u003dself.vif_driver.get_vif_devname(vif),"},{"line_number":2272,"context_line":"                supports_device_missing_error_code\u003dsupports_device_missing)"},{"line_number":2273,"context_line":"            wait_for_detach()"},{"line_number":2274,"context_line":"        except exception.DeviceDetachFailed:"},{"line_number":2275,"context_line":"            # We failed to detach the device even with the retry loop, so let\u0027s"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_c706f885","line":2272,"range":{"start_line":2269,"start_character":0,"end_line":2272,"end_character":75},"in_reply_to":"9f560f44_c4605aa8","updated":"2020-09-21 01:45:53.000000000","message":"Done","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"}],"nova/virt/libvirt/guest.py":[{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"70a05cc15ec5cd0b213243e04ae7592dbff255b4","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        :returns LivirtConfigGuestDisk: mounted at device or None"},{"line_number":326,"context_line":"        \"\"\""},{"line_number":327,"context_line":"        try:"},{"line_number":328,"context_line":"            doc \u003d etree.fromstring(self._domain.XMLDesc(2))"},{"line_number":329,"context_line":"        except Exception:"},{"line_number":330,"context_line":"            return None"},{"line_number":331,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_d729af37","line":328,"range":{"start_line":328,"start_character":56,"end_line":328,"end_character":57},"updated":"2020-09-02 12:32:35.000000000","message":"IMHO this needs to be an optional flag passed into get_disk.\n\nWhen the instance is paused we can use VIR_DOMAIN_XML_INACTIVE. When it\u0027s active we should retain the current behaviour.\n\nhttps://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetXMLDesc\n\nIf @flags includes VIR_DOMAIN_XML_INACTIVE, then the XML represents the configuration that will be used on the next boot of a persistent domain; otherwise, the configuration represents the currently running domain.\n\nI\u0027d also like us to use constants from libvirt instead of ints here please.","commit_id":"444413fe9c5a043899ad3d177a1554c233ce431f"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"2b14f429c980ca8249cadd9043b4576c1f7d0d00","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        :returns LivirtConfigGuestDisk: mounted at device or None"},{"line_number":326,"context_line":"        \"\"\""},{"line_number":327,"context_line":"        try:"},{"line_number":328,"context_line":"            doc \u003d etree.fromstring(self._domain.XMLDesc(2))"},{"line_number":329,"context_line":"        except Exception:"},{"line_number":330,"context_line":"            return None"},{"line_number":331,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_7bc99b77","line":328,"range":{"start_line":328,"start_character":56,"end_line":328,"end_character":57},"in_reply_to":"9f560f44_d729af37","updated":"2020-09-03 10:17:07.000000000","message":"Done","commit_id":"444413fe9c5a043899ad3d177a1554c233ce431f"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"b0a409eb87991e386f0413152f40454e0e36e5f0","unresolved":false,"context_lines":[{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        return interfaces"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"    def get_interface_by_cfg(self, cfg):"},{"line_number":232,"context_line":"        \"\"\"Lookup a full LibvirtConfigGuestInterface with"},{"line_number":233,"context_line":"        LibvirtConfigGuestInterface generated"},{"line_number":234,"context_line":"        by nova.virt.libvirt.vif.get_config."}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_41114a04","line":231,"range":{"start_line":231,"start_character":4,"end_line":231,"end_character":40},"updated":"2020-09-17 10:23:22.000000000","message":"Also add guest_power_state here","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"9391d20222ae0e57d216edaca65e93666aee79a2","unresolved":false,"context_lines":[{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        return interfaces"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"    def get_interface_by_cfg(self, cfg):"},{"line_number":232,"context_line":"        \"\"\"Lookup a full LibvirtConfigGuestInterface with"},{"line_number":233,"context_line":"        LibvirtConfigGuestInterface generated"},{"line_number":234,"context_line":"        by nova.virt.libvirt.vif.get_config."}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_a7f14498","line":231,"range":{"start_line":231,"start_character":4,"end_line":231,"end_character":40},"in_reply_to":"9f560f44_41114a04","updated":"2020-09-21 01:45:53.000000000","message":"Hi Lee, _domain.XMLDesc(0) in get_all_devices seems work good in my test, So I\u0027m not sure if the state parameter is necessary.","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"b0a409eb87991e386f0413152f40454e0e36e5f0","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        config.parse_str(self._domain.XMLDesc(0))"},{"line_number":320,"context_line":"        return config"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"    def get_disk(self, device, paused_instance_volume_detach\u003dFalse):"},{"line_number":323,"context_line":"        \"\"\"Returns the disk mounted at device"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"        :returns LivirtConfigGuestDisk: mounted at device or None"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_8418221e","line":322,"range":{"start_line":322,"start_character":31,"end_line":322,"end_character":60},"updated":"2020-09-17 10:23:22.000000000","message":"Again I\u0027d pass state down here as well","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"9391d20222ae0e57d216edaca65e93666aee79a2","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        config.parse_str(self._domain.XMLDesc(0))"},{"line_number":320,"context_line":"        return config"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"    def get_disk(self, device, paused_instance_volume_detach\u003dFalse):"},{"line_number":323,"context_line":"        \"\"\"Returns the disk mounted at device"},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"        :returns LivirtConfigGuestDisk: mounted at device or None"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_87ec00bc","line":322,"range":{"start_line":322,"start_character":31,"end_line":322,"end_character":60},"in_reply_to":"9f560f44_8418221e","updated":"2020-09-21 01:45:53.000000000","message":"Done","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"b0a409eb87991e386f0413152f40454e0e36e5f0","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        :returns LivirtConfigGuestDisk: mounted at device or None"},{"line_number":326,"context_line":"        \"\"\""},{"line_number":327,"context_line":"        try:"},{"line_number":328,"context_line":"            if paused_instance_volume_detach:"},{"line_number":329,"context_line":"                # Use VIR_DOMAIN_XML_INACTIVE Flag while the paused"},{"line_number":330,"context_line":"                # instance detach volume."},{"line_number":331,"context_line":"                doc \u003d etree.fromstring(self._domain.XMLDesc"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_44e72a13","line":328,"range":{"start_line":328,"start_character":15,"end_line":328,"end_character":44},"updated":"2020-09-17 10:23:22.000000000","message":"state \u003d\u003d power_state.PAUSED","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"9391d20222ae0e57d216edaca65e93666aee79a2","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        :returns LivirtConfigGuestDisk: mounted at device or None"},{"line_number":326,"context_line":"        \"\"\""},{"line_number":327,"context_line":"        try:"},{"line_number":328,"context_line":"            if paused_instance_volume_detach:"},{"line_number":329,"context_line":"                # Use VIR_DOMAIN_XML_INACTIVE Flag while the paused"},{"line_number":330,"context_line":"                # instance detach volume."},{"line_number":331,"context_line":"                doc \u003d etree.fromstring(self._domain.XMLDesc"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_c72b98e7","line":328,"range":{"start_line":328,"start_character":15,"end_line":328,"end_character":44},"in_reply_to":"9f560f44_44e72a13","updated":"2020-09-21 01:45:53.000000000","message":"Done","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"e8973e427b75e7e2f166b1236bb2a8752ce7fdbb","unresolved":false,"context_lines":[{"line_number":324,"context_line":""},{"line_number":325,"context_line":"        :returns LivirtConfigGuestDisk: mounted at device or None"},{"line_number":326,"context_line":"        \"\"\""},{"line_number":327,"context_line":"        try:"},{"line_number":328,"context_line":"            if paused_instance_volume_detach:"},{"line_number":329,"context_line":"                # Use VIR_DOMAIN_XML_INACTIVE Flag while the paused"},{"line_number":330,"context_line":"                # instance detach volume."},{"line_number":331,"context_line":"                doc \u003d etree.fromstring(self._domain.XMLDesc"},{"line_number":332,"context_line":"                                       (libvirt.VIR_DOMAIN_XML_INACTIVE))"},{"line_number":333,"context_line":"            else:"},{"line_number":334,"context_line":"                doc \u003d etree.fromstring(self._domain.XMLDesc(0))"},{"line_number":335,"context_line":"        except Exception:"},{"line_number":336,"context_line":"            return None"},{"line_number":337,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_c1e96c1a","line":334,"range":{"start_line":327,"start_character":0,"end_line":334,"end_character":63},"updated":"2020-09-17 10:03:53.000000000","message":"We have access to the domain so we don\u0027t actually need to pass this boolean flag. Instead, we could simply inspect the guest\u0027s power state here and now. Unfortunately the \u0027get_power_state\u0027 helper currently requires a \u0027host\u0027 argument, however, that\u0027s simply passed to \u0027get_info\u0027 which hasn\u0027t used it since I690d64c01accb10afc2ff20844e2d51bfa68e635 was merged in Train.\n\nSo, I\u0027m okay with doing this in order to support backporting, however, can we then do a follow-up that drops the \u0027host\u0027 argument from \u0027get_power_state\u0027 and related functions and simply inspect the power state here?","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"9391d20222ae0e57d216edaca65e93666aee79a2","unresolved":false,"context_lines":[{"line_number":324,"context_line":""},{"line_number":325,"context_line":"        :returns LivirtConfigGuestDisk: mounted at device or None"},{"line_number":326,"context_line":"        \"\"\""},{"line_number":327,"context_line":"        try:"},{"line_number":328,"context_line":"            if paused_instance_volume_detach:"},{"line_number":329,"context_line":"                # Use VIR_DOMAIN_XML_INACTIVE Flag while the paused"},{"line_number":330,"context_line":"                # instance detach volume."},{"line_number":331,"context_line":"                doc \u003d etree.fromstring(self._domain.XMLDesc"},{"line_number":332,"context_line":"                                       (libvirt.VIR_DOMAIN_XML_INACTIVE))"},{"line_number":333,"context_line":"            else:"},{"line_number":334,"context_line":"                doc \u003d etree.fromstring(self._domain.XMLDesc(0))"},{"line_number":335,"context_line":"        except Exception:"},{"line_number":336,"context_line":"            return None"},{"line_number":337,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_27337464","line":334,"range":{"start_line":327,"start_character":0,"end_line":334,"end_character":63},"in_reply_to":"9f560f44_c1e96c1a","updated":"2020-09-21 01:45:53.000000000","message":"Done","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"b0a409eb87991e386f0413152f40454e0e36e5f0","unresolved":false,"context_lines":[{"line_number":378,"context_line":"                devs.append(dev)"},{"line_number":379,"context_line":"        return devs"},{"line_number":380,"context_line":""},{"line_number":381,"context_line":"    def detach_device_with_retry(self, get_device_conf_func, device, live,"},{"line_number":382,"context_line":"                                 max_retry_count\u003d7, inc_sleep_time\u003d2,"},{"line_number":383,"context_line":"                                 max_sleep_time\u003d30,"},{"line_number":384,"context_line":"                                 alternative_device_name\u003dNone,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_64650eaf","line":381,"range":{"start_line":381,"start_character":69,"end_line":381,"end_character":73},"updated":"2020-09-17 10:23:22.000000000","message":"Lets replace this with state and just pass that down instead.","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"9391d20222ae0e57d216edaca65e93666aee79a2","unresolved":false,"context_lines":[{"line_number":378,"context_line":"                devs.append(dev)"},{"line_number":379,"context_line":"        return devs"},{"line_number":380,"context_line":""},{"line_number":381,"context_line":"    def detach_device_with_retry(self, get_device_conf_func, device, live,"},{"line_number":382,"context_line":"                                 max_retry_count\u003d7, inc_sleep_time\u003d2,"},{"line_number":383,"context_line":"                                 max_sleep_time\u003d30,"},{"line_number":384,"context_line":"                                 alternative_device_name\u003dNone,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_07363052","line":381,"range":{"start_line":381,"start_character":69,"end_line":381,"end_character":73},"in_reply_to":"9f560f44_64650eaf","updated":"2020-09-21 01:45:53.000000000","message":"Done","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"b0a409eb87991e386f0413152f40454e0e36e5f0","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        def _try_detach_device(conf, persistent\u003dFalse, live\u003dFalse):"},{"line_number":423,"context_line":"            # Raise DeviceNotFound if the device isn\u0027t found during detach"},{"line_number":424,"context_line":"            try:"},{"line_number":425,"context_line":"                self.detach_device(conf, persistent\u003dpersistent, live\u003dlive)"},{"line_number":426,"context_line":"                if get_device_conf_func(device) is None:"},{"line_number":427,"context_line":"                    LOG.debug(\u0027Successfully detached device %s from guest. \u0027"},{"line_number":428,"context_line":"                              \u0027Persistent? %s. Live? %s\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_c42e9a41","line":425,"range":{"start_line":425,"start_character":69,"end_line":425,"end_character":73},"updated":"2020-09-17 10:23:22.000000000","message":"We can define this in this method based on the value of state passed down from the driver.","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"9391d20222ae0e57d216edaca65e93666aee79a2","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        def _try_detach_device(conf, persistent\u003dFalse, live\u003dFalse):"},{"line_number":423,"context_line":"            # Raise DeviceNotFound if the device isn\u0027t found during detach"},{"line_number":424,"context_line":"            try:"},{"line_number":425,"context_line":"                self.detach_device(conf, persistent\u003dpersistent, live\u003dlive)"},{"line_number":426,"context_line":"                if get_device_conf_func(device) is None:"},{"line_number":427,"context_line":"                    LOG.debug(\u0027Successfully detached device %s from guest. \u0027"},{"line_number":428,"context_line":"                              \u0027Persistent? %s. Live? %s\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_673c4c30","line":425,"range":{"start_line":425,"start_character":69,"end_line":425,"end_character":73},"in_reply_to":"9f560f44_c42e9a41","updated":"2020-09-21 01:45:53.000000000","message":"Done","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"b0a409eb87991e386f0413152f40454e0e36e5f0","unresolved":false,"context_lines":[{"line_number":490,"context_line":"                                    max_sleep_time\u003dmax_sleep_time,"},{"line_number":491,"context_line":"                                    exceptions\u003dexception.DeviceDetachFailed)"},{"line_number":492,"context_line":"        def _do_wait_and_retry_detach():"},{"line_number":493,"context_line":"            if paused_instance_volume_detach:"},{"line_number":494,"context_line":"                config \u003d get_device_conf_func("},{"line_number":495,"context_line":"                    device, paused_instance_volume_detach\u003dTrue)"},{"line_number":496,"context_line":"            else:"},{"line_number":497,"context_line":"                config \u003d get_device_conf_func(device)"},{"line_number":498,"context_line":"            if config is not None:"},{"line_number":499,"context_line":"                # Device is already detached from persistent config"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_c437baaf","line":496,"range":{"start_line":493,"start_character":0,"end_line":496,"end_character":17},"updated":"2020-09-17 10:23:22.000000000","message":"I don\u0027t think we need this here, we need to ensure we find the device on L463 and after that the attempt to detach on L472 should be enough. We only use this method to retry the detach against the live domain anyway.","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"9391d20222ae0e57d216edaca65e93666aee79a2","unresolved":false,"context_lines":[{"line_number":490,"context_line":"                                    max_sleep_time\u003dmax_sleep_time,"},{"line_number":491,"context_line":"                                    exceptions\u003dexception.DeviceDetachFailed)"},{"line_number":492,"context_line":"        def _do_wait_and_retry_detach():"},{"line_number":493,"context_line":"            if paused_instance_volume_detach:"},{"line_number":494,"context_line":"                config \u003d get_device_conf_func("},{"line_number":495,"context_line":"                    device, paused_instance_volume_detach\u003dTrue)"},{"line_number":496,"context_line":"            else:"},{"line_number":497,"context_line":"                config \u003d get_device_conf_func(device)"},{"line_number":498,"context_line":"            if config is not None:"},{"line_number":499,"context_line":"                # Device is already detached from persistent config"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_4737884c","line":496,"range":{"start_line":493,"start_character":0,"end_line":496,"end_character":17},"in_reply_to":"9f560f44_c437baaf","updated":"2020-09-21 01:45:53.000000000","message":"Done","commit_id":"a4f57eb01570c62caf567b71435017e94c813d83"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"58fea6ac0ca121476ad125fb5debc450486b2f98","unresolved":false,"context_lines":[{"line_number":324,"context_line":"                # Use VIR_DOMAIN_XML_INACTIVE Flag while the paused"},{"line_number":325,"context_line":"                # instance detach volume."},{"line_number":326,"context_line":"                doc \u003d etree.fromstring(self._domain.XMLDesc"},{"line_number":327,"context_line":"                                       (libvirt.VIR_DOMAIN_XML_INACTIVE))"},{"line_number":328,"context_line":"            else:"},{"line_number":329,"context_line":"                doc \u003d etree.fromstring(self._domain.XMLDesc(0))"},{"line_number":330,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_8cc38038","line":327,"range":{"start_line":327,"start_character":40,"end_line":327,"end_character":71},"updated":"2020-09-21 09:32:49.000000000","message":"Rather than creating two separate calls to \u0027fromstring\u0027, can you simply build up two different values for the flags argument, e.g.\n\n  flags \u003d 0\n  if state \u003d\u003d power_state.PAUSED:\n      flags |\u003d libvirt.VIR_DOMAIN_XML_INACTIVE","commit_id":"d7acf85dee336b85f6cd05c9a356733255441f18"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"d6803a8bca1b4685021870e5b7a83fa49aabadda","unresolved":false,"context_lines":[{"line_number":324,"context_line":"                # Use VIR_DOMAIN_XML_INACTIVE Flag while the paused"},{"line_number":325,"context_line":"                # instance detach volume."},{"line_number":326,"context_line":"                doc \u003d etree.fromstring(self._domain.XMLDesc"},{"line_number":327,"context_line":"                                       (libvirt.VIR_DOMAIN_XML_INACTIVE))"},{"line_number":328,"context_line":"            else:"},{"line_number":329,"context_line":"                doc \u003d etree.fromstring(self._domain.XMLDesc(0))"},{"line_number":330,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_6a140cea","line":327,"range":{"start_line":327,"start_character":40,"end_line":327,"end_character":71},"in_reply_to":"9f560f44_8cc38038","updated":"2020-09-21 11:41:41.000000000","message":"Yes, it makes the code look better, I have finish it.","commit_id":"d7acf85dee336b85f6cd05c9a356733255441f18"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"0dbaa8ce233569d1b3329f24cdbf862791abbe35","unresolved":true,"context_lines":[{"line_number":240,"context_line":"            if found, else None"},{"line_number":241,"context_line":"        \"\"\""},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"        if cfg:"},{"line_number":244,"context_line":"            interfaces \u003d self.get_all_devices(type(cfg))"},{"line_number":245,"context_line":"            for interface in interfaces:"},{"line_number":246,"context_line":"                # NOTE(leehom) LibvirtConfigGuest get from domain and"},{"line_number":247,"context_line":"                # LibvirtConfigGuest generated by"},{"line_number":248,"context_line":"                # nova.virt.libvirt.vif.get_config must be identical."},{"line_number":249,"context_line":"                # NOTE(gibi): LibvirtConfigGuest subtypes does a custom"},{"line_number":250,"context_line":"                # equality check based on available information on nova side"},{"line_number":251,"context_line":"                if cfg \u003d\u003d interface:"},{"line_number":252,"context_line":"                    return interface"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    def get_vcpus_info(self):"},{"line_number":255,"context_line":"        \"\"\"Returns virtual cpus information of guest."}],"source_content_type":"text/x-python","patch_set":6,"id":"f0110a9f_a0665670","line":252,"range":{"start_line":243,"start_character":0,"end_line":252,"end_character":36},"updated":"2020-12-21 14:25:46.000000000","message":"You\u0027re not passing state here but it would also apply to vnics right?","commit_id":"62b35e8dd8911078aa2389d7ff8b4a146fd85b7b"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"ed51486d794d2a7ee67953f12294c61d3610ac85","unresolved":false,"context_lines":[{"line_number":240,"context_line":"            if found, else None"},{"line_number":241,"context_line":"        \"\"\""},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"        if cfg:"},{"line_number":244,"context_line":"            interfaces \u003d self.get_all_devices(type(cfg))"},{"line_number":245,"context_line":"            for interface in interfaces:"},{"line_number":246,"context_line":"                # NOTE(leehom) LibvirtConfigGuest get from domain and"},{"line_number":247,"context_line":"                # LibvirtConfigGuest generated by"},{"line_number":248,"context_line":"                # nova.virt.libvirt.vif.get_config must be identical."},{"line_number":249,"context_line":"                # NOTE(gibi): LibvirtConfigGuest subtypes does a custom"},{"line_number":250,"context_line":"                # equality check based on available information on nova side"},{"line_number":251,"context_line":"                if cfg \u003d\u003d interface:"},{"line_number":252,"context_line":"                    return interface"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"    def get_vcpus_info(self):"},{"line_number":255,"context_line":"        \"\"\"Returns virtual cpus information of guest."}],"source_content_type":"text/x-python","patch_set":6,"id":"448582aa_0c374904","line":252,"range":{"start_line":243,"start_character":0,"end_line":252,"end_character":36},"in_reply_to":"f0110a9f_a0665670","updated":"2020-12-28 11:34:14.000000000","message":"Yes, I have fixed it.","commit_id":"62b35e8dd8911078aa2389d7ff8b4a146fd85b7b"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"0dbaa8ce233569d1b3329f24cdbf862791abbe35","unresolved":true,"context_lines":[{"line_number":314,"context_line":"        config.parse_str(self._domain.XMLDesc(0))"},{"line_number":315,"context_line":"        return config"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    def get_disk(self, device, state\u003dNone):"},{"line_number":318,"context_line":"        \"\"\"Returns the disk mounted at device"},{"line_number":319,"context_line":""},{"line_number":320,"context_line":"        :returns LivirtConfigGuestDisk: mounted at device or None"}],"source_content_type":"text/x-python","patch_set":6,"id":"04f9e043_1a13c24f","line":317,"range":{"start_line":317,"start_character":31,"end_line":317,"end_character":41},"updated":"2020-12-21 14:25:46.000000000","message":"I\u0027m against passing state around like this, can\u0027t we just call self.get_power_state() when we need it?","commit_id":"62b35e8dd8911078aa2389d7ff8b4a146fd85b7b"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"ed51486d794d2a7ee67953f12294c61d3610ac85","unresolved":false,"context_lines":[{"line_number":314,"context_line":"        config.parse_str(self._domain.XMLDesc(0))"},{"line_number":315,"context_line":"        return config"},{"line_number":316,"context_line":""},{"line_number":317,"context_line":"    def get_disk(self, device, state\u003dNone):"},{"line_number":318,"context_line":"        \"\"\"Returns the disk mounted at device"},{"line_number":319,"context_line":""},{"line_number":320,"context_line":"        :returns LivirtConfigGuestDisk: mounted at device or None"}],"source_content_type":"text/x-python","patch_set":6,"id":"5f64d97e_93d25bfa","line":317,"range":{"start_line":317,"start_character":31,"end_line":317,"end_character":41},"in_reply_to":"04f9e043_1a13c24f","updated":"2020-12-28 11:34:14.000000000","message":"Done","commit_id":"62b35e8dd8911078aa2389d7ff8b4a146fd85b7b"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"0dbaa8ce233569d1b3329f24cdbf862791abbe35","unresolved":true,"context_lines":[{"line_number":325,"context_line":"        if state \u003d\u003d power_state.PAUSED:"},{"line_number":326,"context_line":"            flags |\u003d libvirt.VIR_DOMAIN_XML_INACTIVE"},{"line_number":327,"context_line":"        try:"},{"line_number":328,"context_line":"            doc \u003d etree.fromstring(self._domain.XMLDesc(flags))"},{"line_number":329,"context_line":"        except Exception:"},{"line_number":330,"context_line":"            return None"},{"line_number":331,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"b64ca959_a6c9df4a","line":328,"range":{"start_line":328,"start_character":35,"end_line":328,"end_character":62},"updated":"2020-12-21 14:25:46.000000000","message":"Why not self.get_xml_desc()?","commit_id":"62b35e8dd8911078aa2389d7ff8b4a146fd85b7b"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"ed51486d794d2a7ee67953f12294c61d3610ac85","unresolved":false,"context_lines":[{"line_number":325,"context_line":"        if state \u003d\u003d power_state.PAUSED:"},{"line_number":326,"context_line":"            flags |\u003d libvirt.VIR_DOMAIN_XML_INACTIVE"},{"line_number":327,"context_line":"        try:"},{"line_number":328,"context_line":"            doc \u003d etree.fromstring(self._domain.XMLDesc(flags))"},{"line_number":329,"context_line":"        except Exception:"},{"line_number":330,"context_line":"            return None"},{"line_number":331,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"d7365e35_5029077c","line":328,"range":{"start_line":328,"start_character":35,"end_line":328,"end_character":62},"in_reply_to":"b64ca959_a6c9df4a","updated":"2020-12-28 11:34:14.000000000","message":"Done","commit_id":"62b35e8dd8911078aa2389d7ff8b4a146fd85b7b"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"0dbaa8ce233569d1b3329f24cdbf862791abbe35","unresolved":true,"context_lines":[{"line_number":319,"context_line":""},{"line_number":320,"context_line":"        :returns LivirtConfigGuestDisk: mounted at device or None"},{"line_number":321,"context_line":"        \"\"\""},{"line_number":322,"context_line":"        flags \u003d 0"},{"line_number":323,"context_line":"        # Use VIR_DOMAIN_XML_INACTIVE Flag while the paused"},{"line_number":324,"context_line":"        # instance detach volume."},{"line_number":325,"context_line":"        if state \u003d\u003d power_state.PAUSED:"},{"line_number":326,"context_line":"            flags |\u003d libvirt.VIR_DOMAIN_XML_INACTIVE"},{"line_number":327,"context_line":"        try:"},{"line_number":328,"context_line":"            doc \u003d etree.fromstring(self._domain.XMLDesc(flags))"},{"line_number":329,"context_line":"        except Exception:"},{"line_number":330,"context_line":"            return None"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"        # FIXME(lyarwood): Workaround for the device being either a target dev"},{"line_number":333,"context_line":"        # when called via swap_volume or source file when called via"}],"source_content_type":"text/x-python","patch_set":6,"id":"82ba6d6a_363b4c27","line":330,"range":{"start_line":322,"start_character":0,"end_line":330,"end_character":23},"updated":"2020-12-21 14:25:46.000000000","message":"Can you extract that into a reusable method?","commit_id":"62b35e8dd8911078aa2389d7ff8b4a146fd85b7b"},{"author":{"_account_id":30638,"name":"Yao wang","email":"a64957782017@163.com","username":"wangyao829"},"change_message_id":"ed51486d794d2a7ee67953f12294c61d3610ac85","unresolved":true,"context_lines":[{"line_number":319,"context_line":""},{"line_number":320,"context_line":"        :returns LivirtConfigGuestDisk: mounted at device or None"},{"line_number":321,"context_line":"        \"\"\""},{"line_number":322,"context_line":"        flags \u003d 0"},{"line_number":323,"context_line":"        # Use VIR_DOMAIN_XML_INACTIVE Flag while the paused"},{"line_number":324,"context_line":"        # instance detach volume."},{"line_number":325,"context_line":"        if state \u003d\u003d power_state.PAUSED:"},{"line_number":326,"context_line":"            flags |\u003d libvirt.VIR_DOMAIN_XML_INACTIVE"},{"line_number":327,"context_line":"        try:"},{"line_number":328,"context_line":"            doc \u003d etree.fromstring(self._domain.XMLDesc(flags))"},{"line_number":329,"context_line":"        except Exception:"},{"line_number":330,"context_line":"            return None"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"        # FIXME(lyarwood): Workaround for the device being either a target dev"},{"line_number":333,"context_line":"        # when called via swap_volume or source file when called via"}],"source_content_type":"text/x-python","patch_set":6,"id":"cab5fd25_4e302fd1","line":330,"range":{"start_line":322,"start_character":0,"end_line":330,"end_character":23},"in_reply_to":"82ba6d6a_363b4c27","updated":"2020-12-28 11:34:14.000000000","message":"Sorry Lee, I don\u0027t see which method needs to be reused","commit_id":"62b35e8dd8911078aa2389d7ff8b4a146fd85b7b"}]}
