[Libvir] [PATCH] Fix driver counting in virConnectOpen

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@jp.fujitsu.com> 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"));

On Mon, Mar 19, 2007 at 06:45:01PM +0900, Atsushi SAKAI wrote:
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.
Haha ! Thanks a lot, I noticed this just before the release but didn't took the time to chase it down: ot@xen64 ~]# /etc/init.d/libvirtd stop Stopping libvirtd daemon: [ OK ] [root@xen64 ~]# /usr/bin/virsh list libvir: error : no support for hypervisor virsh: error: failed to connect to the hypervisor [root@xen64 ~]# /u/veillard/libvirt/src/virsh list Id Name State ---------------------------------- 0 Domain-0 running [root@xen64 ~]# thanks a lot, applied and commited ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (2)
-
Atsushi SAKAI
-
Daniel Veillard