)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"68ec8f28a51441f4ed61d163fe20022f9f37d407","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"lb: changes how port admin_state_up is implemented"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Simply setting the tap device\u0027s link state instead of"},{"line_number":10,"context_line":"moving it in or out of the bridge."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I263e05a04d40477e3571e4c148c00ee5582a8bc6"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"da85f559_22c89ca5","line":9,"updated":"2015-11-11 22:12:36.000000000","message":"Simplify","commit_id":"55365f00238f64c9210e8655ac39b93ed2c56ffd"}],"neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py":[{"author":{"_account_id":11307,"name":"Andreas Scheuring","email":"andreas.scheuring@de.ibm.com","username":"uniqueName"},"change_message_id":"32d4e6f1c0dac3ea3971f93fcb69afe47e28478c","unresolved":false,"context_lines":[{"line_number":936,"context_line":"    def setup_linux_bridge(self, bridge_mappings, interface_mappings):"},{"line_number":937,"context_line":"        self.br_mgr \u003d LinuxBridgeManager(bridge_mappings, interface_mappings)"},{"line_number":938,"context_line":""},{"line_number":939,"context_line":"    def ensure_port_admin_state(self, port_id, admin_state_up):"},{"line_number":940,"context_line":"        LOG.debug(\"Setting admin_state_up to %s for port %s\","},{"line_number":941,"context_line":"                  admin_state_up, port_id)"},{"line_number":942,"context_line":"        tap_name \u003d self.br_mgr.get_tap_device_name(port_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_69a544a0","line":939,"updated":"2015-11-11 14:05:58.000000000","message":"for a detailed history of previous disucsion to this approach see [1]\n\nThere was the concern raised, that this approach might race with nova/libvirt, especialy in the case, where a port with admin_state_up\u003dfalse is used.\n\nThis was my last reply:\n\nok, I had a look at the libvirt code which is responsible for creating the tap device, adding it to the bridge and bringing it online [2]. The routine does this exactly in this order\n\n  #1 create tap device, set mac + mtu\n  #2 plug it into bridge\n  #3 bring it online\n\nAnalysis of today\u0027s code:\n\nThe agent gets triggered after the tap device appeared in the filesystem, which happens slightly after step #1. If the desired admin_state_up is false, today\u0027s code tries to remove the tap device from the bridge. In theory this could become racy if it tries to remove it - before step#2 has been processed. The tap is not yet plugged, so everythings fine. After that step #2 is happening which plugs in the tap device again.\n\nThe proposal with the up state is very similar, except that the race could occur between step #2 and #3 instead of #1 and #2. So I see your issue, but I wonder - is this really more racy than the current approach? At least the code is more straight forward.\n\nSorry for this bad argument ;)\n\n[2] http://code.metager.de/source/xref/lib/virt/src/util/virnetdevtap.c#532\n\n\n[1] https://review.openstack.org/#/c/193485/11/neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py","commit_id":"55365f00238f64c9210e8655ac39b93ed2c56ffd"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"68ec8f28a51441f4ed61d163fe20022f9f37d407","unresolved":false,"context_lines":[{"line_number":987,"context_line":"                        device_details[\u0027port_id\u0027])"},{"line_number":988,"context_line":"                    arp_protect.setup_arp_spoofing_protection(port,"},{"line_number":989,"context_line":"                                                              device_details)"},{"line_number":990,"context_line":"                self.ensure_port_admin_state(device_details[\u0027port_id\u0027],"},{"line_number":991,"context_line":"                                             device_details[\u0027admin_state_up\u0027])"},{"line_number":992,"context_line":"                # create the networking for the port"},{"line_number":993,"context_line":"                network_type \u003d device_details.get(\u0027network_type\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_a2d6cc25","line":990,"updated":"2015-11-11 22:12:36.000000000","message":"not sure to understand why the if condition is removed","commit_id":"55365f00238f64c9210e8655ac39b93ed2c56ffd"},{"author":{"_account_id":11307,"name":"Andreas Scheuring","email":"andreas.scheuring@de.ibm.com","username":"uniqueName"},"change_message_id":"f594e5ab2c312a2c54c72749089348e5555a8dc5","unresolved":false,"context_lines":[{"line_number":987,"context_line":"                        device_details[\u0027port_id\u0027])"},{"line_number":988,"context_line":"                    arp_protect.setup_arp_spoofing_protection(port,"},{"line_number":989,"context_line":"                                                              device_details)"},{"line_number":990,"context_line":"                self.ensure_port_admin_state(device_details[\u0027port_id\u0027],"},{"line_number":991,"context_line":"                                             device_details[\u0027admin_state_up\u0027])"},{"line_number":992,"context_line":"                # create the networking for the port"},{"line_number":993,"context_line":"                network_type \u003d device_details.get(\u0027network_type\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da85f559_7fbf0461","line":990,"in_reply_to":"da85f559_a2d6cc25","updated":"2015-11-12 10:23:09.000000000","message":"The old code did the following \n\n if admin_state_up \u003d\u003d true: \n  \u003cplug tap into bridge\u003e\n else\n  \u003cremove tap from bridge\u003e\n\nThe new code proposes a new way for saying that the admin_state is up or down by just setting the the device itself up and down. So plug/unplug is not required any more - you always want your tap device plugged into the bridge. That\u0027s why the condition has been removed.\n\nHowever you have a good point. The old code only sent the update_device_up event when also admin_state\u003dup. The new code does this for admin_state\u003ddown as well. I need to dig into the details","commit_id":"55365f00238f64c9210e8655ac39b93ed2c56ffd"}]}
