=?y?q?=5BPATCH=5D=20Give=20correct=20error=20message=20when=20configure=20a=20wrong=20URI=20aliase=2E?=

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

 



From: Eli Qiao <taget@xxxxxxxxxxxxxxxxxx>

Signed-off-by: Eli Qiao <taget@xxxxxxxxxxxxxxxxxx>

When configure the URI aliase like this in 'libvirt.conf':

uri_aliases = [
  "jj#j=qemu+ssh://root@127.0.0.1/system",
  "sleet=qemu+ssh://root@xxxxxxxxxxxxxxxxxxxxxxx/system",
]
virsh -c jj#j

It will show this error message:
'no connection driver available for No connection for URI jj#j'
Actually ,we expect this message below:
Malformed 'uri_aliases' config entry 'jj#j=qemu+ssh://root@127.0.0.1/system', aliases may only container 'a-Z, 0-9, _, -'

Give this patch to fix this error.
---
 src/libvirt.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/src/libvirt.c b/src/libvirt.c
index 1518ed2..17e073e 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -1054,11 +1054,6 @@ virConnectOpenResolveURIAlias(const char *alias, char **uri)
 
     *uri = NULL;
 
-    /* Short circuit to avoid doing URI alias resolution
-     * when it clearly isn't an valid alias */
-    if (strspn(alias, URI_ALIAS_CHARS) != strlen(alias))
-        return 0;
-
     if (!(config = virConnectConfigFile()))
         goto cleanup;
 
-- 
1.7.4.4

--
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]