mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 07:42:56 +00:00
29f2b5248c
If the console was disconnected due to a connection problem or a problem on the server side it is convinient to provide the cause to the user. If the error come from the API then the error is saved in a virsh global variable. However, since success is returned from virshRunConsole after we reach the waiting stage, then the error is never reported. Let's track the error in the event loop. Next after failure we do a cleanup and this cleanup can overwrite root cause. Thus let's save root cause immediately and then set it to virsh error after all cleanup is done. Since we'll be sending the error to the consumer, each failure path from the event handlers needs to be augmented to provide what error generated the failure. Reviewed-by: Cole Robinson <crobinso@redhat.com> Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>