[PATCH] Fix driver counting in virConnectOpen

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

 



Hi,

I think virConnectOpen driver counting check is wrong.
If we does not run libvirt_qemud, virsh does not run on root privilege.
This restriction forces Xen user to run verbose libvirt_qemud. 

Signed-off-by: Atsushi SAKAI <sakaia@xxxxxxxxxxxxxx>

Thanks
Atsushi SAKAI

diff -urpN libvirt-0.2.1/src/libvirt.c libvirt-0.2.1.check/src/libvirt.c
--- libvirt-0.2.1/src/libvirt.c	2007-03-16 01:45:36.000000000 +0900
+++ libvirt-0.2.1.check/src/libvirt.c	2007-03-19 18:37:22.000000000 +0900
@@ -322,7 +322,7 @@ virConnectOpen(const char *name)
         }
     }
 
-    if (ret->nb_drivers == 0 || ret->nb_network_drivers == 0) {
+    if (ret->nb_drivers == 0 && ret->nb_network_drivers == 0) {
 	/* we failed to find an adequate driver */
 	virLibConnError(NULL, VIR_ERR_NO_SUPPORT, name);
 	goto failed;
@@ -389,7 +389,7 @@ virConnectOpenReadOnly(const char *name)
             ret->networkDrivers[ret->nb_network_drivers++] = virNetworkDriverTab[i];
         }
     }
-    if (ret->nb_drivers == 0) {
+    if (ret->nb_drivers == 0 && ret->nb_network_drivers == 0) {
 	if (name == NULL)
 	    virLibConnError(NULL, VIR_ERR_NO_CONNECT,
 			    _("Xen Daemon or Xen Store"));



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