From: John Ferlan Date: Tue, 14 Aug 2018 16:32:45 +0000 (-0400) Subject: xenapi: Don't overwrite virAuthGet{Username|Password} errors X-Git-Tag: v4.7.0-rc1~134 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e456575e6f9eb8c5ff999d1306ec6333b3c760bd;p=thirdparty%2Flibvirt.git xenapi: Don't overwrite virAuthGet{Username|Password} errors Now that the virAuthGet*Path API's generate all the error messages we can remove them from the callers. This means that we will no longer overwrite the error from the API. Signed-off-by: John Ferlan Reviewed-by: Marcos Paulo de Souza --- diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c index 3af5eeafcf..96cad99e4e 100644 --- a/src/xenapi/xenapi_driver.c +++ b/src/xenapi/xenapi_driver.c @@ -156,22 +156,14 @@ xenapiConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, if (VIR_STRDUP(username, conn->uri->user) < 0) goto error; } else { - username = virAuthGetUsername(conn, auth, "xen", NULL, conn->uri->server); - - if (username == NULL) { - xenapiSessionErrorHandler(conn, VIR_ERR_AUTH_FAILED, - _("Username request failed")); + if (!(username = virAuthGetUsername(conn, auth, "xen", NULL, + conn->uri->server))) goto error; - } } - password = virAuthGetPassword(conn, auth, "xen", username, conn->uri->server); - - if (password == NULL) { - xenapiSessionErrorHandler(conn, VIR_ERR_AUTH_FAILED, - _("Password request failed")); + if (!(password = virAuthGetPassword(conn, auth, "xen", username, + conn->uri->server))) goto error; - } if (VIR_ALLOC(privP) < 0) goto error;