On 03/08/2013 12:44 AM, Peter Krempa wrote:
> Just changing
> # define LIBVIRTD_PRIV_UNIX_SOCKET LOCALSTATEDIR
> "/run/libvirt/libvirt-sock"
> # define LIBVIRTD_PRIV_UNIX_SOCKET_RO LOCALSTATEDIR
> "/run/libvirt/libvirt-sock-ro"
> To
> # define LIBVIRTD_PRIV_UNIX_SOCKET "/var"
"/run/libvirt/libvirt-sock"
> # define LIBVIRTD_PRIV_UNIX_SOCKET_RO "/var"
> "/run/libvirt/libvirt-sock-ro"
>
> Fixed the problem and things worked fine.
Okay, this fixes the stuff at first but it isn't a nice fix.
That's fine for a local fix, but too hard-coded to go upstream.
>
> It would be nice for a client only builds to be able to control through a
> ./configure argument or through some other .conf file where the server
> expects to find its socket file.
Hmm, you still can configure the LOCALSTATEDIR variable. The only
drawback is that it puts all daemon state into the configured path.
I had indeed missed that fact - you want your local install to go into
one location, but to tell your connection to the remote server to look
in the remote server's configured location, different from your local
configuration.
>
> That said, I am wondering why the client has to know where the server
> maintains its libvirt-sock files? Can't client and the server both
> talk in
> relative path terms instead of absolute?
Remote clients don't know the path on the remote host so we can't really
do this. On the other hand, we provide means for configuring the path to
the socket while opening the remote connection. It makes the URI ugly,
but works:
virsh -c qemu+ssh://user@host:port/system?socket=/path/to/socket/on/remote
Indeed, that looks like the right approach. And if it bothers you to
type that much on every connection, you can set up configured connection
names:
http://libvirt.org/uri.html#URI_config
That is, by modifying the libvirt.conf file as installed into your local
prefix (the web page mentioned /etc/libvirt/libvirt.conf, but that was
assuming the default installation prefix), you can make:
virsh -c remote
be shorthand for the longer
qemu+ssh://user@host:port/system?socket=/path/to/remote/socket.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org