Description of problem: virt-manager 1.4.0 (latest master branch) Try to connect to libvirt which runs inside FreeBSD and you'll get this message: Error polling connection 'bhyve+ssh://root@freebsd1/system': cannot obtain CPU freq: No such file or directory Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/engine.py", line 385, in _handle_tick_queue conn.tick_from_engine(**kwargs) File "/usr/share/virt-manager/virtManager/connection.py", line 1319, in tick_from_engine raise e # pylint: disable=raising-bad-type libvirtError: cannot obtain CPU freq: No such file or directory Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: show error message Expected results: it should work Additional info: I'm trying to boot VMs on top of FreeBSD (and I use them to run FreeBSD VM) using my scripts: https://github.com/kayrus/scripts you can actually try to use them for test puproses.
Correct error message: Error polling connection 'bhyve+ssh://root@freebsd1/system': cannot obtain CPU freq: No such file or directory Traceback (most recent call last): File "/home/kay/git/my/virt-manager/virtManager/engine.py", line 385, in _handle_tick_queue conn.tick_from_engine(**kwargs) File "/home/kay/git/my/virt-manager/virtManager/connection.py", line 1431, in tick_from_engine raise e # pylint: disable=raising-bad-type libvirtError: cannot obtain CPU freq: No such file or directory
Hi Anton, Can you show output of the following command on the host libvirtd is running: sysctl dev.cpu.0.freq If this fails (I assume it will), could you check if you have "device cpufreq" in your current kernel configuration?
I'm not quite familiar with freebsd, but here is the output of kldstat: kldstat -v | grep cpu 102 cpu/ichss 478 legacy/cpu 461 cpu/p4tcc 460 cpu/hwpstate 459 cpu/est 458 cpu/powernow 36 cpu/acpi_throttle 375 cpu/cpufreq 23 acpi/cpu 32 cpu/acpi_perf As I mentioned before, I use official qcow2 freebsd image
Sorry for the confusion, I mean the host FreeBSD you run libvirt on, not the VM. Also, could you please send output of "sysctl dev.cpu.0.freq" on the host as I mentioned before? And one more thing that could be helpful: could you attach dmesg (/var/run/dmesg.boot on the host)?
Created attachment 1194456 [details] dmesg log I use nested virtualization. For test purposes I run FreeBSD host inside KVM. `sysctl dev.cpu.0.freq` returns error. dmesg is attached.
(In reply to Khramov Anton from comment #5) > Created attachment 1194456 [details] > dmesg log > > I use nested virtualization. For test purposes I run FreeBSD host inside > KVM. `sysctl dev.cpu.0.freq` returns error. dmesg is attached. That's very interesting. I'm not sure why cpufreq is not showing CPU frequency in this case, maybe it needs some additional cpu features exposed to l1 guest? Unfortunately, I have no experience neither in nested virtualization FreeBSD setups nor in cpufreq(4) debugging. The first thing I'd do though is probably add debug.cpufreq.verbose="1" to /boot/loader.conf to see if it maybe prints something reasonable and ask on some FreeBSD list (freebsd-virtualization@ maybe?) if that's some known problem. There are few workarounds possible though: - Use "virsh" directly, cpu freq is not an essential feature and you'll be able to move forward. Actually, that's the way I would recommend because bhyve support in virt-manager is still not quite complete (i.e. it's alright at showing information, but creating new VMs requires manual configuration and knowledge of certain specifics, e.g. by default it tries to use ide disks that are not supported by bhyve etc). - Stub it out in libvirt or virt-manager (this is a bad solution, but I don't know what your goals are) In the meantime, I'll try to see if I can get nested kvm/bhyve setup myself.
Created attachment 1195953 [details] proposed patch, v1 Attached a patch that could possibly fix this issue. I'll be able to properly test that tomorrow.
It looks like this approach works for my FreeBSD VM in KVM (not nested virt though). https://www.redhat.com/archives/libvir-list/2016-August/msg01310.htmlhttps://www.redhat.com/archives/libvir-list/2016-August/msg01310.html
Thanks, Roman. Will try your fix soon and let you know.
(In reply to Khramov Anton from comment #9) > Thanks, Roman. Will try your fix soon and let you know. Hi Anton, any luck with that?
Hi Roman, I just tested the sysctl hw.clockrate and it worked. I didn't have enough time to compile the libvirt.
(In reply to Khramov Anton from comment #11) > Hi Roman, I just tested the sysctl hw.clockrate and it worked. I didn't have > enough time to compile the libvirt. Great, thanks, I've pushed the fix to master. If you're interested, I can create a patch for the port (that's currently @ 2.2.0) if it makes things easier.