[Libvir] testing libvirtd: don't hard-code $HOME/.libvirt/libvirt-sock

I've written a test to exercise libvirtd a little. Unfortunately, if I'm already running libvirtd, that test fails and I can't do anything about it: $ ./libvirtd & ./libvirtd Failed to bind socket to '@/j/.libvirt/libvirt-sock': Address already in use [Exit 2] Any objection to providing an option to libvirtd that specifies that directory (also used to form server->logDir)? It feels like it should come from the config file, but I haven't looked at details yet.

Jim Meyering wrote:
I've written a test to exercise libvirtd a little. Unfortunately, if I'm already running libvirtd, that test fails and I can't do anything about it:
$ ./libvirtd & ./libvirtd Failed to bind socket to '@/j/.libvirt/libvirt-sock': Address already in use [Exit 2]
Any objection to providing an option to libvirtd that specifies that directory (also used to form server->logDir)?
It feels like it should come from the config file, but I haven't looked at details yet.
Yes it should be possible to set these, but isn't at the moment. Check out qemud/qemud.c function qemudInitPaths. Another possibility is to have libvirtd running as root, and libvirtd running as you, in which case they _shouldn't_ clash ... Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

"Richard W.M. Jones" <rjones@redhat.com> wrote:
Jim Meyering wrote:
I've written a test to exercise libvirtd a little. Unfortunately, if I'm already running libvirtd, that test fails and I can't do anything about it:
$ ./libvirtd & ./libvirtd Failed to bind socket to '@/j/.libvirt/libvirt-sock': Address already in use [Exit 2]
Any objection to providing an option to libvirtd that specifies that directory (also used to form server->logDir)?
It feels like it should come from the config file, but I haven't looked at details yet.
Yes it should be possible to set these, but isn't at the moment. Check out qemud/qemud.c function qemudInitPaths.
Another possibility is to have libvirtd running as root, and libvirtd running as you, in which case they _shouldn't_ clash ...
The point is that if I leave one running as me, it shouldn't interfere with "make check". And if root runs "make check" (yes, I know that doing that is totally crazy, but people do it all the time, in spite of warnings), that shouldn't fail either.
participants (2)
-
Jim Meyering
-
Richard W.M. Jones