GNOME Bugzilla – Bug 698387
Can only connect to a VM once
Last modified: 2016-03-31 13:22:07 UTC
There seems to be some regression in either Boxes or spice* which makes it impossible to reconnection to a box after the first time. i-e Connect to a box, go back to collection view and then try connecting again to same box. Boxes just hangs on 'Connecting to X'.
Created attachment 241953 [details] [review] app: Only cancel in-progress connections When going to collection view, we shouldn't blindly cancel machine connection. Only do so if we are in the right UI state. This fixes a regression from 993952e that disabled Boxes from connecting to the same box more than once.
*** Bug 698411 has been marked as a duplicate of this bug. ***
Zeeshan, I change the version affected to 3.8 as the bug is found also in this version.
Review of attachment 241953 [details] [review]: ::: src/app.vala @@ +704,3 @@ + if (previous_ui_state == UIState.CREDS) + machine.connecting_cancellable.cancel (); // Cancel any in-progress connections I still don't think it's a good idea to leak internal details of our UI state machine in many places (previous_ui_state)... Adding machine.connecting_cancellable.reset (); in select_item() seems to do the trick as well.
Review of attachment 241953 [details] [review]: ::: src/app.vala @@ +704,3 @@ + if (previous_ui_state == UIState.CREDS) + machine.connecting_cancellable.cancel (); // Cancel any in-progress connections I don't see any leak of internal info since: * App is a subclass of abstract UI class (actually more of an implementation since UI would have been an interface if we could have found a way to make it so). * previous_ui_state is publicly visible anyways. It used to be 'protected' but even if that was still true, it would be still visible in App. Besides if UI subclasses aren't supposed to make use of this property, then who is?
Ah right, missed the fact that App derives from UI. This still does not mean that because it happens to be exported, we have to use it whenever we can.
(In reply to comment #6) > Ah right, missed the fact that App derives from UI. This still does not mean > that because it happens to be exported, we have to use it whenever we can. Sure, I don't think this use is 'just because'. However what you said seems like a better/more-reliable approach so I'll change the patch.
Created attachment 242224 [details] [review] machine: Reset connecting_cancellable before connecting This fixes a regression from 993952e that disabled Boxes from connecting to the same box more than once.
Review of attachment 242224 [details] [review]: This _seems_ ok...
Attachment 242224 [details] pushed as 3c0a19b - machine: Reset connecting_cancellable before connecting