Re: [PATCH] esx: Report an error for acceptable URI schemes with a transport

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/27/2011 05:12 AM, Matthias Bolte wrote:
Before, URIs such as esx+ssh:// have been declined by the ESX driver
resulting in the remote driver trying to connect to an non-existing
libvirtd.

Now such URIs trigger and error in the ESX driver suggesting to try
again without the transport part in the scheme.
---
  src/esx/esx_driver.c |   31 ++++++++++++++++++++++++++-----
  1 files changed, 26 insertions(+), 5 deletions(-)

Makes sense.

+    } else {
+        if (plus - conn->uri->scheme != 3 ||
+            (STRCASENEQLEN(conn->uri->scheme, "vpx", 3)&&
+             STRCASENEQLEN(conn->uri->scheme, "esx", 3)&&
+             STRCASENEQLEN(conn->uri->scheme, "gsx", 3))) {
+            return VIR_DRV_OPEN_DECLINED;
+        }
+
+        ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
+                  _("Transport in URI scheme is not supported, try again "
+                    "without the transport part"));

Maybe show the rejected transport in the error message:

ESX_ERROR(VIR_ERR_INVALID_ARG,
          _("Transport '%s' in URI scheme is not supported, try again "
            "without the transport part"), plus + 1);

ACK, whether or not you make a change along those lines.

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]