]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
esx: Report an error when auth pointer is missing instead of declining
authorMatthias Bolte <matthias.bolte@googlemail.com>
Wed, 25 May 2011 13:52:34 +0000 (15:52 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Wed, 25 May 2011 14:51:52 +0000 (16:51 +0200)
Otherwise an attempt to use virConnectOpen or virConnectOpenAuth without
auth pointer results in the driver declining the URI and libvirt falling
back to the remote driver for an esx:// URI.

src/esx/esx_driver.c

index 7fe5446839f035aa38960b43e15955c0c7ddc921..845dd4a319eec4b7bb9b1632d6c0b82f01b63dc4 100644 (file)
@@ -922,9 +922,18 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags ATTRIBUTE_UNUSED)
         return VIR_DRV_OPEN_DECLINED;
     }
 
-    /* Decline URIs without server part, or missing auth */
-    if (conn->uri->server == NULL || auth == NULL || auth->cb == NULL) {
-        return VIR_DRV_OPEN_DECLINED;
+    /* Require server part */
+    if (conn->uri->server == NULL) {
+        ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
+                  _("URI is missing the server part"));
+        return VIR_DRV_OPEN_ERROR;
+    }
+
+    /* Require auth */
+    if (auth == NULL || auth->cb == NULL) {
+        ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
+                  _("Missing or invalid auth pointer"));
+        return VIR_DRV_OPEN_ERROR;
     }
 
     /* Allocate per-connection private data */