)]}'
{"nova/virt/libvirt/driver.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f88a5562196697884ab966ff39a71bbd029b30c8","unresolved":false,"context_lines":[{"line_number":1408,"context_line":"            max_sleep_time\u003dmax_sleep_time,"},{"line_number":1409,"context_line":"            exceptions\u003dexception.DeviceDetachFailed)"},{"line_number":1410,"context_line":"        def _poll():"},{"line_number":1411,"context_line":"            interface \u003d guest.get_interface_by_mac(mac)"},{"line_number":1412,"context_line":"            if interface is not None:"},{"line_number":1413,"context_line":"                # Device is already detached from persistent domain"},{"line_number":1414,"context_line":"                # and only transient domain needs update"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_fb95de86","line":1411,"updated":"2016-07-30 13:20:44.000000000","message":"I wonder if this isn\u0027t getting updated because we\u0027re hanging waiting for the detach to complete:\n\nhttp://logs.openstack.org/11/349011/2/check/gate-tempest-dsvm-neutron-dvr/67b20c7/console.html#_2016-07-29_23_24_53_871091\n\nWe attach the port here:\n\nhttp://logs.openstack.org/11/349011/2/check/gate-tempest-dsvm-neutron-dvr/67b20c7/logs/screen-n-cpu.txt.gz#_2016-07-29_22_41_14_301\n\nupdate the port\u0027s device_id here:\n\nhttp://logs.openstack.org/11/349011/2/check/gate-tempest-dsvm-neutron-dvr/67b20c7/logs/screen-n-cpu.txt.gz#_2016-07-29_22_41_15_665\n\nThe vif is plugged here:\n\nhttp://logs.openstack.org/11/349011/2/check/gate-tempest-dsvm-neutron-dvr/67b20c7/logs/screen-n-cpu.txt.gz#_2016-07-29_22_41_16_449\n\nThe vif unplug is here:\n\nhttp://logs.openstack.org/11/349011/2/check/gate-tempest-dsvm-neutron-dvr/67b20c7/logs/screen-n-cpu.txt.gz#_2016-07-29_22_41_20_826\n\nWe start polling for detached here:\n\nhttp://logs.openstack.org/11/349011/2/check/gate-tempest-dsvm-neutron-dvr/67b20c7/logs/screen-n-cpu.txt.gz#_2016-07-29_22_41_27_042\n\nAnd something blows up here:\n\nhttp://logs.openstack.org/11/349011/2/check/gate-tempest-dsvm-neutron-dvr/67b20c7/logs/screen-n-cpu.txt.gz#_2016-07-29_22_41_27_066\n\nSo the detach operation failed, but it\u0027s a cast and that\u0027s why tempest doesn\u0027t know about it, we just never get to the point of updating the port\u0027s device_id\u003d\u0027\u0027 so the test times out.\n\nI\u0027m not sure why the detach is failing though.","commit_id":"1f87f77d0b62e65ac0987e281ceea2c791ca342b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"abed128e2c2368545ae6027ad9cc639d3d75b7e1","unresolved":false,"context_lines":[{"line_number":1412,"context_line":"            if interface is not None:"},{"line_number":1413,"context_line":"                # Device is already detached from persistent domain"},{"line_number":1414,"context_line":"                # and only transient domain needs update"},{"line_number":1415,"context_line":"                guest.detach_device(vif_config, persistent\u003dFalse, live\u003dlive)"},{"line_number":1416,"context_line":"                # Raise error since the device still existed on the guest"},{"line_number":1417,"context_line":"                reason \u003d _(\"Unable to detach from guest transient domain.\")"},{"line_number":1418,"context_line":"                raise exception.DeviceDetachFailed(device\u003dmac,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_1be0b228","line":1415,"updated":"2016-07-30 13:24:23.000000000","message":"Oh it actually fails here with:\n\n\"libvirtError: internal error: unable to execute QEMU command \u0027netdev_del\u0027: Device \u0027hostnet1\u0027 not found\"\n\nSo I guess I should be handling the libvirtError and checking for a \u0027not found\u0027 type failure and if so, break the polling loop.\n\nStill, this seems to have failed on the first attempt which seems too quick.","commit_id":"1f87f77d0b62e65ac0987e281ceea2c791ca342b"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"8b2ab1e4ba311ddc36b2dd4e6fada2a056ff5c10","unresolved":false,"context_lines":[{"line_number":1412,"context_line":"            if interface is not None:"},{"line_number":1413,"context_line":"                # Device is already detached from persistent domain"},{"line_number":1414,"context_line":"                # and only transient domain needs update"},{"line_number":1415,"context_line":"                guest.detach_device(vif_config, persistent\u003dFalse, live\u003dlive)"},{"line_number":1416,"context_line":"                # Raise error since the device still existed on the guest"},{"line_number":1417,"context_line":"                reason \u003d _(\"Unable to detach from guest transient domain.\")"},{"line_number":1418,"context_line":"                raise exception.DeviceDetachFailed(device\u003dmac,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_5db17b46","line":1415,"in_reply_to":"bacf61ea_1be0b228","updated":"2016-07-30 23:43:16.000000000","message":"Well wouldn\u0027t that be because it has already received the command to detach?","commit_id":"1f87f77d0b62e65ac0987e281ceea2c791ca342b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fa04b6f406ea226d724634486dc256e1db618660","unresolved":false,"context_lines":[{"line_number":1412,"context_line":"            if interface is not None:"},{"line_number":1413,"context_line":"                # Device is already detached from persistent domain"},{"line_number":1414,"context_line":"                # and only transient domain needs update"},{"line_number":1415,"context_line":"                guest.detach_device(vif_config, persistent\u003dFalse, live\u003dlive)"},{"line_number":1416,"context_line":"                # Raise error since the device still existed on the guest"},{"line_number":1417,"context_line":"                reason \u003d _(\"Unable to detach from guest transient domain.\")"},{"line_number":1418,"context_line":"                raise exception.DeviceDetachFailed(device\u003dmac,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_ea37bc4a","line":1415,"in_reply_to":"bacf61ea_5db17b46","updated":"2016-07-31 22:53:40.000000000","message":"Honestly I\u0027m not sure about the details in the hypervisor at this point, but this is what we do when detaching volumes. The difference is the initial detach uses persistent\u003dTrue and the later ones use persistent\u003dFalse.","commit_id":"1f87f77d0b62e65ac0987e281ceea2c791ca342b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f6e0ae3163af08ffb7334995e10072350128b802","unresolved":false,"context_lines":[{"line_number":1412,"context_line":"            if interface is not None:"},{"line_number":1413,"context_line":"                # Device is already detached from persistent domain"},{"line_number":1414,"context_line":"                # and only transient domain needs update"},{"line_number":1415,"context_line":"                guest.detach_device(vif_config, persistent\u003dFalse, live\u003dlive)"},{"line_number":1416,"context_line":"                # Raise error since the device still existed on the guest"},{"line_number":1417,"context_line":"                reason \u003d _(\"Unable to detach from guest transient domain.\")"},{"line_number":1418,"context_line":"                raise exception.DeviceDetachFailed(device\u003dmac,"}],"source_content_type":"text/x-python","patch_set":2,"id":"bacf61ea_4a6fe82a","line":1415,"in_reply_to":"bacf61ea_ea37bc4a","updated":"2016-07-31 23:03:11.000000000","message":"Maybe it would just be enough to poll for the xml config to no longer have the interface. That seems to be what this is suggesting:\n\nhttps://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDetachDeviceFlags\n\nI\u0027ll try that anyway.","commit_id":"1f87f77d0b62e65ac0987e281ceea2c791ca342b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"07b16bda4e7b83956838b53b6ca6416c154ee51e","unresolved":false,"context_lines":[{"line_number":1412,"context_line":"            if interface is not None:"},{"line_number":1413,"context_line":"                # Raise error since the device still existed on the guest"},{"line_number":1414,"context_line":"                reason \u003d _(\"Unable to detach from guest transient domain.\")"},{"line_number":1415,"context_line":"                raise exception.DeviceDetachFailed(device\u003dmac,"},{"line_number":1416,"context_line":"                                                   reason\u003dreason)"},{"line_number":1417,"context_line":""},{"line_number":1418,"context_line":"        return _poll"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_000dcfe7","line":1415,"updated":"2016-08-01 01:43:42.000000000","message":"Looks like we\u0027re timing out:\n\nhttp://logs.openstack.org/11/349011/2/check/gate-tempest-dsvm-neutron-full-ubuntu-xenial/6ca24c0/logs/screen-n-cpu.txt.gz?level\u003dTRACE#_2016-08-01_00_07_00_333","commit_id":"3b109b93aaf0bcd6cd767c97af9e0131f428c85a"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"95919610db8c73df2d7588ad59b68cf83aab2788","unresolved":false,"context_lines":[{"line_number":1415,"context_line":"                raise exception.DeviceDetachFailed(device\u003dmac,"},{"line_number":1416,"context_line":"                                                   reason\u003dreason)"},{"line_number":1417,"context_line":""},{"line_number":1418,"context_line":"        return _poll"},{"line_number":1419,"context_line":""},{"line_number":1420,"context_line":"    def detach_interface(self, instance, vif):"},{"line_number":1421,"context_line":"        guest \u003d self._host.get_guest(instance)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_4c49a4b6","line":1418,"updated":"2016-08-01 15:22:33.000000000","message":"Rather than adding this huge block which just duplicates code from guest.py, just replace the original guest.detach_device call with guest.detach_device_with_retry","commit_id":"3b109b93aaf0bcd6cd767c97af9e0131f428c85a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"59707cb8697f1135ee1cd78c22bcb2bb700babe8","unresolved":false,"context_lines":[{"line_number":1415,"context_line":"                raise exception.DeviceDetachFailed(device\u003dmac,"},{"line_number":1416,"context_line":"                                                   reason\u003dreason)"},{"line_number":1417,"context_line":""},{"line_number":1418,"context_line":"        return _poll"},{"line_number":1419,"context_line":""},{"line_number":1420,"context_line":"    def detach_interface(self, instance, vif):"},{"line_number":1421,"context_line":"        guest \u003d self._host.get_guest(instance)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a8ec9b2_f43495fc","line":1418,"in_reply_to":"bacf61ea_32bc86ba","updated":"2016-09-19 15:22:42.000000000","message":"I might be able to build on this:\n\nhttps://review.openstack.org/#/c/372243/","commit_id":"3b109b93aaf0bcd6cd767c97af9e0131f428c85a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1502a37913f602ebabc478dfbfab7654c2c9e997","unresolved":false,"context_lines":[{"line_number":1415,"context_line":"                raise exception.DeviceDetachFailed(device\u003dmac,"},{"line_number":1416,"context_line":"                                                   reason\u003dreason)"},{"line_number":1417,"context_line":""},{"line_number":1418,"context_line":"        return _poll"},{"line_number":1419,"context_line":""},{"line_number":1420,"context_line":"    def detach_interface(self, instance, vif):"},{"line_number":1421,"context_line":"        guest \u003d self._host.get_guest(instance)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bacf61ea_32bc86ba","line":1418,"in_reply_to":"bacf61ea_4c49a4b6","updated":"2016-08-01 15:33:06.000000000","message":"That\u0027s what I was originally doing but it gets messy. detach_device_with_retry was written for volume detach, and doesn\u0027t take the same params needed for vif detach, so it\u0027s not a great fit. Which is why I made this standalone in here.","commit_id":"3b109b93aaf0bcd6cd767c97af9e0131f428c85a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"749a644add3dff79d2bf19541a64af98949ac712","unresolved":false,"context_lines":[{"line_number":1410,"context_line":"            # Now we are going to loop until the interface is detached or we"},{"line_number":1411,"context_line":"            # timeout."},{"line_number":1412,"context_line":"            wait_for_detach \u003d guest.detach_device_with_retry("},{"line_number":1413,"context_line":"                guest.get_interface_by_cfg, cfg, persistent\u003dTrue, live\u003dlive,"},{"line_number":1414,"context_line":"                alternative_device_name\u003dvif.get(\u0027address\u0027))"},{"line_number":1415,"context_line":"            wait_for_detach()"},{"line_number":1416,"context_line":"        except exception.DeviceNotFound:"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba2be162_b07fc7a9","line":1413,"range":{"start_line":1413,"start_character":49,"end_line":1413,"end_character":64},"updated":"2017-03-03 17:14:48.000000000","message":"This may need to change based on:\n\nhttps://review.openstack.org/#/c/441204/2/nova/virt/libvirt/driver.py","commit_id":"a3b3e8d8314b0cedc2604be509f0f4d523a35ed5"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"f3272afcfd915a37c71d8c106ce740230daa6afc","unresolved":false,"context_lines":[{"line_number":1413,"context_line":"                guest.get_interface_by_cfg, cfg, persistent\u003dTrue, live\u003dlive,"},{"line_number":1414,"context_line":"                alternative_device_name\u003dvif.get(\u0027address\u0027))"},{"line_number":1415,"context_line":"            wait_for_detach()"},{"line_number":1416,"context_line":"        except exception.DeviceNotFound:"},{"line_number":1417,"context_line":"            # The interface is gone so just log it as a warning."},{"line_number":1418,"context_line":"            LOG.warning(_LW(\u0027Detaching interface %(mac)s failed because \u0027"},{"line_number":1419,"context_line":"                            \u0027the device is no longer found on the guest.\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"ff0f0b1f_64b593ee","line":1416,"updated":"2017-05-17 15:01:24.000000000","message":"Should we also handle DetachDeviceFailed here? Previously we called detach_device, which can only throw libvirtError as far as I can tell, and that\u0027s fine because we handle is here. But now... (continued in next comment).","commit_id":"a3b3e8d8314b0cedc2604be509f0f4d523a35ed5"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"1d60e4ac6faab35ac1327eab18eab75161316a60","unresolved":false,"context_lines":[{"line_number":1413,"context_line":"                guest.get_interface_by_cfg, cfg, persistent\u003dTrue, live\u003dlive,"},{"line_number":1414,"context_line":"                alternative_device_name\u003dvif.get(\u0027address\u0027))"},{"line_number":1415,"context_line":"            wait_for_detach()"},{"line_number":1416,"context_line":"        except exception.DeviceNotFound:"},{"line_number":1417,"context_line":"            # The interface is gone so just log it as a warning."},{"line_number":1418,"context_line":"            LOG.warning(_LW(\u0027Detaching interface %(mac)s failed because \u0027"},{"line_number":1419,"context_line":"                            \u0027the device is no longer found on the guest.\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"df140735_719cdcbf","line":1416,"in_reply_to":"ff0f0b1f_64b593ee","updated":"2017-05-31 23:24:24.000000000","message":"I noticed DetachDeviceFailed isn\u0027t handled in the libvirt driver for detaching volumes either (and that is doing similar with the retry function). So it\u0027s consistent with what we\u0027ve been doing, AFAICT.","commit_id":"a3b3e8d8314b0cedc2604be509f0f4d523a35ed5"}],"nova/virt/libvirt/guest.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"62c2be2714d63d67cc4c6280841d826af3f6e856","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        :param alternative_device_name: This is an alternative identifier for"},{"line_number":390,"context_line":"            the device if device is not an ID, used solely for error messages."},{"line_number":391,"context_line":"        \"\"\""},{"line_number":392,"context_line":"        alternative_device_name \u003d alternative_device_name or device"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"        def _try_detach_device(conf, persistent\u003dFalse, live\u003dFalse):"},{"line_number":395,"context_line":"            # Raise DeviceNotFound if the device isn\u0027t found during detach"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f044301_f21257b1","line":392,"range":{"start_line":392,"start_character":8,"end_line":392,"end_character":67},"updated":"2017-05-05 11:42:25.000000000","message":"Shouldn\u0027t this really be a separate fix? It seems to be solely for usability (improved logging)?","commit_id":"a3b3e8d8314b0cedc2604be509f0f4d523a35ed5"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"20a6373da4c397781f68a481a5909d7103e8bfd7","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        :param alternative_device_name: This is an alternative identifier for"},{"line_number":390,"context_line":"            the device if device is not an ID, used solely for error messages."},{"line_number":391,"context_line":"        \"\"\""},{"line_number":392,"context_line":"        alternative_device_name \u003d alternative_device_name or device"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"        def _try_detach_device(conf, persistent\u003dFalse, live\u003dFalse):"},{"line_number":395,"context_line":"            # Raise DeviceNotFound if the device isn\u0027t found during detach"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f013ff3_6849af89","line":392,"range":{"start_line":392,"start_character":8,"end_line":392,"end_character":67},"in_reply_to":"1f013ff3_bbaaa716","updated":"2017-05-16 15:56:18.000000000","message":"Thanks for the info. That justifies its inclusion indeed.","commit_id":"a3b3e8d8314b0cedc2604be509f0f4d523a35ed5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"39ea44d6a39838e84b5b32090ed14cd776abc635","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        :param alternative_device_name: This is an alternative identifier for"},{"line_number":390,"context_line":"            the device if device is not an ID, used solely for error messages."},{"line_number":391,"context_line":"        \"\"\""},{"line_number":392,"context_line":"        alternative_device_name \u003d alternative_device_name or device"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"        def _try_detach_device(conf, persistent\u003dFalse, live\u003dFalse):"},{"line_number":395,"context_line":"            # Raise DeviceNotFound if the device isn\u0027t found during detach"}],"source_content_type":"text/x-python","patch_set":5,"id":"1f013ff3_bbaaa716","line":392,"range":{"start_line":392,"start_character":8,"end_line":392,"end_character":67},"in_reply_to":"3f044301_f21257b1","updated":"2017-05-12 14:30:47.000000000","message":"This is for usability yes but it shouldn\u0027t be separate. The reason for this is that in the case of detaching interfaces, the \u0027device\u0027 is really a config option since it\u0027s the parameter to pass into the get_device_conf_func (guest.get_interface_by_cfg in the case of detaching a vif). Logging a config option isn\u0027t going to be useful. The more useful thing is passing in the vif mac address which is consistent with the logging in detach_interface in the driver.\n\nThis was never originally needed when this utility code was added for detaching volumes because guest.get_disk takes the device name as the parameter and we can log the simple device name, so you don\u0027t need this alternative device name - but that\u0027s not the case with detaching vifs.","commit_id":"a3b3e8d8314b0cedc2604be509f0f4d523a35ed5"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"f3272afcfd915a37c71d8c106ce740230daa6afc","unresolved":false,"context_lines":[{"line_number":431,"context_line":"                _try_detach_device(config, persistent\u003dFalse, live\u003dlive)"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"                reason \u003d _(\"Unable to detach from guest transient domain.\")"},{"line_number":434,"context_line":"                raise exception.DeviceDetachFailed("},{"line_number":435,"context_line":"                    device\u003dalternative_device_name, reason\u003dreason)"},{"line_number":436,"context_line":""},{"line_number":437,"context_line":"        return _do_wait_and_retry_detach"}],"source_content_type":"text/x-python","patch_set":5,"id":"ff0f0b1f_2421db4e","line":434,"updated":"2017-05-17 15:01:24.000000000","message":"... now there\u0027s this new exception that could be thrown, and we\u0027re not handling it in the libvirt driver. However, compute manager catches NovaException, so I think we\u0027re good.","commit_id":"a3b3e8d8314b0cedc2604be509f0f4d523a35ed5"}]}
