[PATCH 2/5] libvirt.c: Return error when remoteOnly is set but server is empty

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

 



Some drivers require a server in order to work, so this flag removes the
burden of esach driver to check for an server by doing it in
virConnectOpenInternal.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@xxxxxxxxx>
---
 src/libvirt.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/libvirt.c b/src/libvirt.c
index 52f4dd2808..9ae4e774eb 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -1005,6 +1005,11 @@ virConnectOpenInternal(const char *name,
             continue;
         }
 
+        if (virConnectDriverTab[i]->remoteOnly && ret->uri && !ret->uri->server) {
+            virReportError(VIR_ERR_INVALID_ARG, "%s", _("URI is missing the server part"));
+            goto failed;
+        }
+
         /* Filter drivers based on declared URI schemes */
         if (virConnectDriverTab[i]->uriSchemes) {
             bool matchScheme = false;
-- 
2.17.1

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

  Powered by Linux