[libvirt] OSX Homebrew support note ;)

Hi all, Compiling Libvirt directly from latest git master head is now supported on OSX Homebrew. It's as simple as: $ brew install --HEAD libvirt ... $ virsh -v 3.0.0 This should make development of Libvirt and related virtualisation things much easier on OSX. :) The credit for this goes to Roman Bogorodskiy and Homebrew developer "ilovezfs" (CC-d), for adding a functional rpcgen to Homebrew so we can generate the needed RPC bindings during the build (previously missing). Thanks heaps! :) Regards and best wishes, Justin Clift

On Wed, 2016-12-21 at 09:55 +0000, Justin Clift wrote:
Hi all, Compiling Libvirt directly from latest git master head is now supported on OSX Homebrew. It's as simple as: $ brew install --HEAD libvirt ... $ virsh -v 3.0.0 This should make development of Libvirt and related virtualisation things much easier on OSX. :)
That's fantastic news, thanks for sharing! Hopefully this will help spot macOS-specific failures early and ensure libvirt keeps running great on that platform :)
The credit for this goes to Roman Bogorodskiy and Homebrew developer "ilovezfs" (CC-d), for adding a functional rpcgen to Homebrew so we can generate the needed RPC bindings during the build (previously missing). Thanks heaps! :)
Thanks indeed! -- Andrea Bolognani / Red Hat / Virtualization

On Wed, Dec 21, 2016 at 09:55:53AM +0000, Justin Clift wrote:
Hi all,
Compiling Libvirt directly from latest git master head is now supported on OSX Homebrew. It's as simple as:
$ brew install --HEAD libvirt ... $ virsh -v 3.0.0
This should make development of Libvirt and related virtualisation things much easier on OSX. :)
The credit for this goes to Roman Bogorodskiy and Homebrew developer "ilovezfs" (CC-d), for adding a functional rpcgen to Homebrew so we can generate the needed RPC bindings during the build (previously missing).
I'm looking at (what I hope is the correct) configuration file for the build: https://github.com/Homebrew/homebrew-core/blob/master/Formula/libvirt.rb and see '--without-qemu' being passed - what is the reason for that ? It looks like you're building libvirtd, so enabling QEMU thereafter should not have any significantly difficulties. Certainly we expect the QEMU driver code to be platform agnostic - all the Linux specific bits are believed to be wrapped in conditionals. IOW if you see build errors with QEMU on OS-X could you tell us what they are. We'd really want to see the QEMU driver enabled Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|

On 23 Jan 2017, at 11:38, Daniel P. Berrange <berrange@redhat.com> wrote:
On Wed, Dec 21, 2016 at 09:55:53AM +0000, Justin Clift wrote: <snip>
I'm looking at (what I hope is the correct) configuration file for the build:
https://github.com/Homebrew/homebrew-core/blob/master/Formula/libvirt.rb
Yep, that's the right one.
and see '--without-qemu' being passed - what is the reason for that ? It looks like you're building libvirtd, so enabling QEMU thereafter should not have any significantly difficulties. Certainly we expect the QEMU driver code to be platform agnostic - all the Linux specific bits are believed to be wrapped in conditionals.
IOW if you see build errors with QEMU on OS-X could you tell us what they are.
From memory (it's been a few years!), it was because the QEMU that builds in Homebrew wouldn't talk to Libvirt anyway. So it was useless to add the support in.
That being said, I do remember someone mentioning they should probably worth together ok these days. But, I'm not sure if anyone's checked and/or really tried to make it work.
We'd really want to see the QEMU driver enabled
Yep, it sounds like it'd be a useful combination. As would xhyve, if that could somehow use the bhyve support (I have no idea). :) + Justin -- "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi

Justin Clift wrote:
On 23 Jan 2017, at 11:38, Daniel P. Berrange <berrange@redhat.com> wrote:
On Wed, Dec 21, 2016 at 09:55:53AM +0000, Justin Clift wrote: <snip>
I'm looking at (what I hope is the correct) configuration file for the build:
https://github.com/Homebrew/homebrew-core/blob/master/Formula/libvirt.rb
Yep, that's the right one.
and see '--without-qemu' being passed - what is the reason for that ? It looks like you're building libvirtd, so enabling QEMU thereafter should not have any significantly difficulties. Certainly we expect the QEMU driver code to be platform agnostic - all the Linux specific bits are believed to be wrapped in conditionals.
IOW if you see build errors with QEMU on OS-X could you tell us what they are.
From memory (it's been a few years!), it was because the QEMU that builds in Homebrew wouldn't talk to Libvirt anyway. So it was useless to add the support in.
That being said, I do remember someone mentioning they should probably worth together ok these days. But, I'm not sure if anyone's checked and/or really tried to make it work.
Well, at least it builds the qemu driver successfully, maybe later I'll check if it could actually run a VM.
We'd really want to see the QEMU driver enabled
Yep, it sounds like it'd be a useful combination. As would xhyve, if that could somehow use the bhyve support (I have no idea). :)
I think it won't work as is, but quite probably a fair amount of the bhyve code could be reused (probably with some refactoring). Roman Bogorodskiy

On Mon, Jan 23, 2017 at 03:29:01PM +0000, Justin Clift wrote:
On 23 Jan 2017, at 11:38, Daniel P. Berrange <berrange@redhat.com> wrote:
On Wed, Dec 21, 2016 at 09:55:53AM +0000, Justin Clift wrote: <snip>
I'm looking at (what I hope is the correct) configuration file for the build:
https://github.com/Homebrew/homebrew-core/blob/master/Formula/libvirt.rb
Yep, that's the right one.
and see '--without-qemu' being passed - what is the reason for that ? It looks like you're building libvirtd, so enabling QEMU thereafter should not have any significantly difficulties. Certainly we expect the QEMU driver code to be platform agnostic - all the Linux specific bits are believed to be wrapped in conditionals.
IOW if you see build errors with QEMU on OS-X could you tell us what they are.
From memory (it's been a few years!), it was because the QEMU that builds in Homebrew wouldn't talk to Libvirt anyway. So it was useless to add the support in.
That's odd - except where Win32 is concerned, I'm surprised if there's a way to build QEMU such that it would not work with libvirt. The only thing that's technically non-portable about the way we manage QEMU is the UNIX socket support, but that's available for every platform except Win32.
That being said, I do remember someone mentioning they should probably worth together ok these days. But, I'm not sure if anyone's checked and/or really tried to make it work.
So lets enable QEMU in libvirt and for OS-X and just let people file bugs if they find bits that don't work. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|

On 24 Jan 2017, at 10:33, Daniel P. Berrange <berrange@redhat.com> wrote:
So lets enable QEMU in libvirt and for OS-X and just let people file bugs if they find bits that don't work.
Just compiled Libvirt (3.0.0 release) on OSX, using "--with-qemu" on the configure line. QEMU 2.8.0 is installed (through Homebrew). Trying to start libvirtd itself seems to barf: ********************************************* $ sudo libvirtd 2017-01-24 18:35:16.272+0000: 18446744073709551615: info : libvirt version: 3.0.0 2017-01-24 18:35:16.272+0000: 18446744073709551615: info : hostname: justinsmac.local 2017-01-24 18:35:16.272+0000: 18446744073709551615: warning : virProcessGetStartTime:1056 : Process start time of pid 56028 not available on this platform 2017-01-24 18:35:16.273+0000: 18446744073709551615: error : virSysinfoRead:1022 : internal error: Failed to find path for dmidecode binary 2017-01-24 18:35:16.273+0000: 18446744073709551615: error : virFileFindHugeTLBFS:3550 : this function is not supported by the connection driver: virFileFindHugeTLBFS 2017-01-24 18:35:16.285+0000: 18446744073709551615: error : virExec:494 : Cannot find 'pm-is-supported' in path: No such file or directory 2017-01-24 18:35:16.285+0000: 18446744073709551615: warning : virQEMUCapsInit:1148 : Failed to get host power management capabilities 2017-01-24 18:35:16.285+0000: 18446744073709551615: error : virNumaGetPages:954 : Operation not supported: page info is not supported on this platform 2017-01-24 18:35:16.285+0000: 18446744073709551615: warning : virQEMUCapsInit:1152 : Failed to get pages info 2017-01-24 18:35:16.370+0000: 18446744073709551615: error : qemuMonitorJSONCheckError:387 : internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has not been found 2017-01-24 18:35:16.370+0000: 18446744073709551615: error : virEventPollRunOnce:647 : Unable to poll on file handles: Bad file descriptor 2017-01-24 18:35:16.370+0000: 18446744073709551615: warning : virQEMUCapsLogProbeFailure:4624 : Failed to probe capabilities for /usr/local/bin/qemu-system-alpha: internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has not been found $ ********************************************* Do we need libvirtd to run on OSX properly first, for QEMU to be reachable? (as mentioned, it's been a few years ;>) + Justin -- "My grandfather once told me that there are two kinds of people: those who work and those who take the credit. He told me to try to be in the first group; there was less competition there." - Indira Gandhi

Justin Clift wrote:
On 24 Jan 2017, at 10:33, Daniel P. Berrange <berrange@redhat.com> wrote:
So lets enable QEMU in libvirt and for OS-X and just let people file bugs if they find bits that don't work.
Just compiled Libvirt (3.0.0 release) on OSX, using "--with-qemu" on the configure line. QEMU 2.8.0 is installed (through Homebrew).
Trying to start libvirtd itself seems to barf:
*********************************************
$ sudo libvirtd 2017-01-24 18:35:16.272+0000: 18446744073709551615: info : libvirt version: 3.0.0 2017-01-24 18:35:16.272+0000: 18446744073709551615: info : hostname: justinsmac.local 2017-01-24 18:35:16.272+0000: 18446744073709551615: warning : virProcessGetStartTime:1056 : Process start time of pid 56028 not available on this platform 2017-01-24 18:35:16.273+0000: 18446744073709551615: error : virSysinfoRead:1022 : internal error: Failed to find path for dmidecode binary 2017-01-24 18:35:16.273+0000: 18446744073709551615: error : virFileFindHugeTLBFS:3550 : this function is not supported by the connection driver: virFileFindHugeTLBFS 2017-01-24 18:35:16.285+0000: 18446744073709551615: error : virExec:494 : Cannot find 'pm-is-supported' in path: No such file or directory 2017-01-24 18:35:16.285+0000: 18446744073709551615: warning : virQEMUCapsInit:1148 : Failed to get host power management capabilities 2017-01-24 18:35:16.285+0000: 18446744073709551615: error : virNumaGetPages:954 : Operation not supported: page info is not supported on this platform 2017-01-24 18:35:16.285+0000: 18446744073709551615: warning : virQEMUCapsInit:1152 : Failed to get pages info 2017-01-24 18:35:16.370+0000: 18446744073709551615: error : qemuMonitorJSONCheckError:387 : internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has not been found 2017-01-24 18:35:16.370+0000: 18446744073709551615: error : virEventPollRunOnce:647 : Unable to poll on file handles: Bad file descriptor 2017-01-24 18:35:16.370+0000: 18446744073709551615: warning : virQEMUCapsLogProbeFailure:4624 : Failed to probe capabilities for /usr/local/bin/qemu-system-alpha: internal error: unable to execute QEMU command 'query-cpu-definitions': The command query-cpu-definitions has not been found $
*********************************************
Do we need libvirtd to run on OSX properly first, for QEMU to be reachable? (as mentioned, it's been a few years ;>)
+ Justin
I was able to get through this error by doing 'brew unlink qemu' and then creating a symlink only for $(brew --prefix qemu)/bin/qemu-system-x86_64 This allows me to start libvirtd, but then it fails when I try to define a domain: virsh # uri qemu:///system virsh # nodeinfo CPU model: x86_64 CPU(s): 4 CPU frequency: 2700 MHz CPU socket(s): 1 Core(s) per socket: 4 Thread(s) per core: 1 NUMA cell(s): 1 Memory size: 16777216 KiB virsh # define /Users/rbogorodskiy/qemudomain.xml error: Failed to define domain from /Users/rbogorodskiy/qemudomain.xml error: invalid connection pointer in virGetDomain virsh # I haven't yet looked further. Roman Bogorodskiy
participants (4)
-
Andrea Bolognani
-
Daniel P. Berrange
-
Justin Clift
-
Roman Bogorodskiy