vipul borikar
2012-Apr-24 08:23 UTC
[libvirt-users] Non-Root not able to use openReadOnly()
Hi,
I have a code :
import libvirt
con = libvirt.openReadOnly(None)
print con.listDomainsID()
When i run the above code using root i get the proper output... but when i
use non-root user it givers be a empty list [ ]
If i change the 2nd line to
con = libvirt.open(qemu:///system)
It works.
I am using RHEL 6.1 with default kvm and libvirt.
unix_sock_group = "virt" in libvirtd.conf where virt is a group of
non-root user
group = "virt" in qemu.conf is set.
Any Ideas????
--
Thanks
Vipul Borikar
"Our task must be to free ourselves...by widening our circle of compassion
to embrace all living creatures and the whole of nature and its beauty."
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://listman.redhat.com/archives/libvirt-users/attachments/20120424/98434d4f/attachment.htm>
Daniel P. Berrange
2012-Apr-24 09:19 UTC
[libvirt-users] Non-Root not able to use openReadOnly()
On Tue, Apr 24, 2012 at 01:53:57PM +0530, vipul borikar wrote:> Hi, > I have a code : > > > import libvirt > con = libvirt.openReadOnly(None) > print con.listDomainsID() > > > When i run the above code using root i get the proper output... but when i > use non-root user it givers be a empty list [ ] > > If i change the 2nd line to > > con = libvirt.open(qemu:///system) > It works. > > > I am using RHEL 6.1 with default kvm and libvirt.When you pass 'None' to the open API call, libvirt will guess what driver to use. If you run non-root, it guesses 'qemu:///session' but when you run as root it guesses 'qemu:///system'. You should always pass an explicit URI if you know which one you want to use. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|