[virt-tools-list] [PATCH virt-viewer v2 3/3] ovirt: Allow to cancel authentication without showing error dialog
Jonathon Jongsma
jjongsma at redhat.com
Wed Mar 18 14:55:35 UTC 2015
On Tue, 2015-03-17 at 18:08 -0400, Pavel Grunt wrote:
> >
> > On Tue, 2015-03-17 at 15:42 +0100, Pavel Grunt wrote:
> > > Related to https://bugzilla.redhat.com/show_bug.cgi?id=1201604
> > > ---
> > > v2: simplified thanks to [PATCH virt-viewer v2 2/3] Exit normally
> > > when canceling dialog
> > > ---
> > > src/remote-viewer.c | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/src/remote-viewer.c b/src/remote-viewer.c
> > > index 35493f3..278c06e 100644
> > > --- a/src/remote-viewer.c
> > > +++ b/src/remote-viewer.c
> > > @@ -862,6 +862,10 @@ create_ovirt_session(VirtViewerApp *app, const
> > > char *uri, GError **err)
> > > G_CALLBACK(authenticate_cb), app);
> > >
> > > api = ovirt_proxy_fetch_api(proxy, &error);
> > > + if (virt_viewer_app_get_user_cancelled(app)) {
> > > + g_clear_error(&error);
> > > + goto error;
> > > + }
> > > if (error != NULL) {
> > > g_debug("failed to get oVirt 'api' collection: %s",
> > > error->message);
> > > goto error;
> >
> >
> > I must admit that I don't really understand this change. Why was this
> > check added here? Surely ovirt_proxy_fetch_api() will not change the
> > status of the user_cancelled value?
> >
> ovirt_proxy_fetch_api() can trigger the authenticate_cb where the user_cancelled is set.
>
> Pavel
Oh, so it does synchronous network communication. I didn't expect that.
When I initially looked at the code for this function, I didn't see it.
But after looking more closely, I see that it does. hmmm. Is there any
way that we can change libgovirt to return a special CANCELLED error
code from this call as well? authenticate_cb() does return a boolean
that could presumably be used to determine whether auth was tried or
not. Otherwise I guess we'll have to just stay with the get|
set_user_cancelled() approach...
More information about the virt-tools-list
mailing list