Call virResetLastError in all virConnectOpen* functions

All public API functions must call virResetLastError to clear
out any previous error. The virConnectOpen* functions forgot
to do this.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2012-09-10 16:47:15 +01:00
parent 3f3d2f9dfc
commit 48fea23ba5
1 changed files with 3 additions and 0 deletions

View File

@ -1329,6 +1329,7 @@ virConnectOpen (const char *name)
goto error;
VIR_DEBUG("name=%s", name);
virResetLastError();
ret = do_open (name, NULL, 0);
if (!ret)
goto error;
@ -1363,6 +1364,7 @@ virConnectOpenReadOnly(const char *name)
goto error;
VIR_DEBUG("name=%s", name);
virResetLastError();
ret = do_open (name, NULL, VIR_CONNECT_RO);
if (!ret)
goto error;
@ -1401,6 +1403,7 @@ virConnectOpenAuth(const char *name,
goto error;
VIR_DEBUG("name=%s, auth=%p, flags=%x", NULLSTR(name), auth, flags);
virResetLastError();
ret = do_open (name, auth, flags);
if (!ret)
goto error;