GNOME Bugzilla – Bug 740775
[review] dcbw/cli-down-wait-bgo740775: wait for connection deactivation
Last modified: 2014-12-03 10:04:51 UTC
DeactivateConnection() returns before the device is completely deactivated (because that may take a while due to dispatcher scripts or some operations like DCB cleanup). But "nmcli con down" should wait for the operation to succeed, or for a short timeout. The user can obviously do "nmcli --wait 0 con down" to proceed immediately.
looks good
Both down_active_connection_state_cb() and down_timeout_cb() free the user_data. Not a real issue, because we quit() the mainloop in both cases. But seems error prone. Otherwise looks good.
20566c76de0d18162af020852ae1e2055addcfff cli: wait for "con down" to deactivate the connection (bgo #740775) (rh #1168383)
(In reply to comment #2) > Both down_active_connection_state_cb() and down_timeout_cb() free the > user_data. Not a real issue, because we quit() the mainloop in both cases. But > seems error prone. I changed the patch to remove both the timeout (if not triggered) and the signal handler from the free function. This should address both these issues.
Reopening for a fix with multiple connections: jk/cli-con-down-bgo740775 Sorry for not reviewing earlier, but I was distracted by other things.
(In reply to comment #5) > Reopening for a fix with multiple connections: jk/cli-con-down-bgo740775 > > Sorry for not reviewing earlier, but I was distracted by other things. Aha! I explicitly tested this case, but I was not using nmcli commands correctly, and thus I assumed that it was broken and no longer useful. But I don't think the 'counter' stuff is going to work like you expect, since that'll just keep incrementing up. Yeah, I guess this is one-shot... But how about the fixup I pushed instead? That uses a single 'info' for all the requests and quits when there is nothing left in the queue. I think that's a slightly more robust solution.
Your fixup is fine. I have squashed and pushed to master as: 4a7c886 cli: fix deactivation for multiple connections (bgo #740775) (rh #1168383)