[libvirt] The weird '@' in bind address on OSX

Hi all, As a general thought, would anyone be interested in getting this weird '@' thing in the bind address on OSX "fixed"? It shows up in both libvirtd and virsh: $ libvirtd 2012-02-08 08:39:53.211+0000: -1: info : libvirt version: 0.9.10 2012-02-08 08:39:53.211+0000: -1: error : virNetSocketNewListenUNIX:346 : Failed to bind socket to '@/Users/jc/.libvirt/libvirt-sock': No such file or directory and $ virsh Welcome to virsh, the virtualization interactive terminal. Type: 'help' for help with commands 'quit' to quit virsh # version error: Failed to reconnect to the hypervisor error: no valid connection error: Failed to connect socket to '@/Users/jc/.libvirt/libvirt-sock': No such file or directory Matthias mentioned it's due to using anonymous unix sockets, which are only present on Linux: https://www.redhat.com/archives/libvirt-users/2011-November/msg00018.html Guess that means libvirtd doesn't work on *BSD either? Perhaps gnulib has a cross platform way to take care of this? (Note, I could have sworn eblake started looking into this ages ago, but then I moved on to the Aeolus team. Unsure if there was useful progress back then. ?) Regards and best wishes, Justin Clift -- Aeolus Community Manager http://www.aeolusproject.org

On 02/08/2012 01:58 AM, Justin Clift wrote:
Hi all,
As a general thought, would anyone be interested in getting this weird '@' thing in the bind address on OSX "fixed"?
The @ is merely a visual place-holder for the actual NUL byte being written into the actual socket structure handed to the kernel. But you are correct that:
Matthias mentioned it's due to using anonymous unix sockets, which are only present on Linux:
https://www.redhat.com/archives/libvirt-users/2011-November/msg00018.html
Use of a NUL byte in the first byte of a socket address is a Linux-only hack to get an anonymous socket namespace.
Guess that means libvirtd doesn't work on *BSD either?
Correct, for anywhere that libvirt currently uses an anonymous socket (such as in qemu:///session).
Perhaps gnulib has a cross platform way to take care of this?
No. There's no way to fake anonymous namespace sockets if the kernel does not have them. Rather, libvirt needs to have a graceful fallback to something in the file system (perhaps under ~/.libvirt/...) on platforms that don't have an anonymous socket namespace.
(Note, I could have sworn eblake started looking into this ages ago, but then I moved on to the Aeolus team. Unsure if there was useful progress back then. ?)
No, I haven't really done anything with this. Sorry. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Justin Clift