[libvirt] Cannot find suitable emulator for x86_64

Hi ! I'm trying to reproduce a bug that i'm facing with libvirt 3.0.0 on Debian stretch. I compiled the latest stable libvirt (4.4.0), and installed it: ./autogen.sh ./configure --prefix=$HOME/usr --localstatedir=/var make sudo make install But when i try to run ~/usr/bin/virsh version, it complains with this message: virsh # version Compiled against library: libvirt 4.4.0 Using library: libvirt 4.4.0 Using API: QEMU 4.4.0 error: failed to get the hypervisor version error: internal error: Cannot find suitable emulator for x86_64 This is what i can find in the output of ~/usr/sbin/libvirtd: 2018-06-13 11:30:17.361+0000: 27502: error : virCapabilitiesDomainDataLookupInternal:736 : invalid argument: could not find capabilities for arch=x86_64 domaintype=qemu 2018-06-13 11:30:17.361+0000: 27502: error : virQEMUCapsGetDefaultVersion:1455 : internal error: Cannot find suitable emulator for x86_64 My environment has not changed, QEMU is still installed. Can you help me understand what is wrong here ? Thank you in advance ! -- Mathieu Tarral

On Wed, Jun 13, 2018 at 02:30:23PM +0300, Mathieu Tarral wrote:
Hi !
I'm trying to reproduce a bug that i'm facing with libvirt 3.0.0 on Debian stretch. I compiled the latest stable libvirt (4.4.0), and installed it:
./autogen.sh ./configure --prefix=$HOME/usr --localstatedir=/var make sudo make install
But when i try to run ~/usr/bin/virsh version, it complains with this message: virsh # version Compiled against library: libvirt 4.4.0 Using library: libvirt 4.4.0 Using API: QEMU 4.4.0 error: failed to get the hypervisor version error: internal error: Cannot find suitable emulator for x86_64
This is what i can find in the output of ~/usr/sbin/libvirtd:
2018-06-13 11:30:17.361+0000: 27502: error : virCapabilitiesDomainDataLookupInternal:736 : invalid argument: could not find capabilities for arch=x86_64 domaintype=qemu 2018-06-13 11:30:17.361+0000: 27502: error : virQEMUCapsGetDefaultVersion:1455 : internal error: Cannot find suitable emulator for x86_64
My environment has not changed, QEMU is still installed. Can you help me understand what is wrong here ?
What version of QEMU do you have installed ? Libvirt has recently become more aggressive at requiring modern QEMU versions, so its possible if your old libvirt was running against old QEMU, that might not be supported with new libvirt. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Hi Daniel,
What version of QEMU do you have installed ? Libvirt has recently become more aggressive at requiring modern QEMU versions, so its possible if your old libvirt was running against old QEMU, that might not be supported with new libvirt.
I'm using QEMU 2.8 here. That might explain why libvirt cannot find a version that is modern enough. In the meantime I tried to build an older version of libvirt: 4.0.0, to see if it would work, but i can't start the daemon: $ sudo ./libvirtd ./libvirtd: /var/ansible/usr/lib/libvirt-admin.so.0: version `LIBVIRT_ADMIN_PRIVATE_4.0.0' not found (required by ./libvirtd) ./libvirtd: /var/ansible/usr/lib/libvirt.so.0: version `LIBVIRT_PRIVATE_4.0.0' not found (required by ./libvirtd) What is it complaining about ? I used the same configuration as above: ./configure --prefix=$HOME/usr --localstatedir=/var Thanks. -- Mathieu Tarral

On Wed, Jun 13, 2018 at 05:40:52PM +0300, Mathieu Tarral wrote:
Hi Daniel,
What version of QEMU do you have installed ? Libvirt has recently become more aggressive at requiring modern QEMU versions, so its possible if your old libvirt was running against old QEMU, that might not be supported with new libvirt.
I'm using QEMU 2.8 here. That might explain why libvirt cannot find a version that is modern enough.
2.8 is plenty new enough, so that's not the issue.
In the meantime I tried to build an older version of libvirt: 4.0.0, to see if it would work, but i can't start the daemon:
$ sudo ./libvirtd ./libvirtd: /var/ansible/usr/lib/libvirt-admin.so.0: version `LIBVIRT_ADMIN_PRIVATE_4.0.0' not found (required by ./libvirtd) ./libvirtd: /var/ansible/usr/lib/libvirt.so.0: version `LIBVIRT_PRIVATE_4.0.0' not found (required by ./libvirtd)
What is it complaining about ?
The version you built libvirtd from is not the same as the version that libvirt.so.0 is built from, so the latter is missing symbols. If you've built & installed libvirt into an unusual location, then you'd need LD_LIBRARY_PATH to make sure the newly built libvirt.so.0 is picked up. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

What version of QEMU do you have installed ? Libvirt has recently become more aggressive at requiring modern QEMU versions, so its possible if your old libvirt was running against old QEMU, that might not be supported with new libvirt.
I'm using QEMU 2.8 here. That might explain why libvirt cannot find a version that is modern enough.
2.8 is plenty new enough, so that's not the issue.
Alright, so let's focus on libvirt 4.4.0. When I start the daemon, i can see some warnings related to QEMU: warning : virQEMUCapsInit:942 : Failed to get host CPU cache info warning : virQEMUCapsInit:949 : Failed to get host power management capabilities Could this be the reason, or the beginning of an explanation ? How can I dig and find what is the root cause ? -- Mathieu Tarral

On Wed, Jun 13, 2018 at 05:59:37PM +0300, Mathieu Tarral wrote:
What version of QEMU do you have installed ? Libvirt has recently become more aggressive at requiring modern QEMU versions, so its possible if your old libvirt was running against old QEMU, that might not be supported with new libvirt.
I'm using QEMU 2.8 here. That might explain why libvirt cannot find a version that is modern enough.
2.8 is plenty new enough, so that's not the issue.
Alright, so let's focus on libvirt 4.4.0.
When I start the daemon, i can see some warnings related to QEMU:
warning : virQEMUCapsInit:942 : Failed to get host CPU cache info warning : virQEMUCapsInit:949 : Failed to get host power management capabilities
Could this be the reason, or the beginning of an explanation ? How can I dig and find what is the root cause ?
Best bet is to edit libvirtd.conf and set log_filters="1:qemu_capabilities" log_outputs="1:file:/var/log/libvirtd.log" and then rm -rf /var/cache/libvirt/qemu and restart libvirtd. The log file should tell you it is detecting qemu-system-x86_64 and probing it. If anything fails it should be covered in the logs. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

2018-06-13 18:07 GMT+03:00 Daniel P. Berrangé <berrange@redhat.com>:
On Wed, Jun 13, 2018 at 05:59:37PM +0300, Mathieu Tarral wrote:
What version of QEMU do you have installed ? Libvirt has recently become more aggressive at requiring modern QEMU versions, so its possible if your old libvirt was running against old QEMU, that might not be supported with new libvirt.
I'm using QEMU 2.8 here. That might explain why libvirt cannot find a version that is modern enough.
2.8 is plenty new enough, so that's not the issue.
Alright, so let's focus on libvirt 4.4.0.
When I start the daemon, i can see some warnings related to QEMU:
warning : virQEMUCapsInit:942 : Failed to get host CPU cache info warning : virQEMUCapsInit:949 : Failed to get host power management capabilities
Could this be the reason, or the beginning of an explanation ? How can I dig and find what is the root cause ?
Best bet is to edit libvirtd.conf and set
log_filters="1:qemu_capabilities" log_outputs="1:file:/var/log/libvirtd.log"
and then rm -rf /var/cache/libvirt/qemu and restart libvirtd. The log file should tell you it is detecting qemu-system-x86_64 and probing it. If anything fails it should be covered in the logs.
Thanks, i have more information now: debug : virQEMUCapsCacheLookup:4561 : Returning caps (nil) for /usr/bin/qemu-system-x86_64 debug : virQEMUCapsCacheLookup:4561 : Returning caps (nil) for /usr/bin/kvm Does this help you ? -- Mathieu Tarral

On Wed, Jun 13, 2018 at 06:13:04PM +0300, Mathieu Tarral wrote:
2018-06-13 18:07 GMT+03:00 Daniel P. Berrangé <berrange@redhat.com>:
On Wed, Jun 13, 2018 at 05:59:37PM +0300, Mathieu Tarral wrote:
What version of QEMU do you have installed ? Libvirt has recently become more aggressive at requiring modern QEMU versions, so its possible if your old libvirt was running against old QEMU, that might not be supported with new libvirt.
I'm using QEMU 2.8 here. That might explain why libvirt cannot find a version that is modern enough.
2.8 is plenty new enough, so that's not the issue.
Alright, so let's focus on libvirt 4.4.0.
When I start the daemon, i can see some warnings related to QEMU:
warning : virQEMUCapsInit:942 : Failed to get host CPU cache info warning : virQEMUCapsInit:949 : Failed to get host power management capabilities
Could this be the reason, or the beginning of an explanation ? How can I dig and find what is the root cause ?
Best bet is to edit libvirtd.conf and set
log_filters="1:qemu_capabilities" log_outputs="1:file:/var/log/libvirtd.log"
and then rm -rf /var/cache/libvirt/qemu and restart libvirtd. The log file should tell you it is detecting qemu-system-x86_64 and probing it. If anything fails it should be covered in the logs.
Thanks, i have more information now:
debug : virQEMUCapsCacheLookup:4561 : Returning caps (nil) for /usr/bin/qemu-system-x86_64 debug : virQEMUCapsCacheLookup:4561 : Returning caps (nil) for /usr/bin/kvm
Does this help you ?
No that just says there's no previous capabiltiies stored in the cache, which is expected since I just told you to delete the cache :-) Please attach the full debug log, after running 'virsh capabilities' Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

2018-06-13 18:23 GMT+03:00 Daniel P. Berrangé <berrange@redhat.com>:
On Wed, Jun 13, 2018 at 06:13:04PM +0300, Mathieu Tarral wrote:
2018-06-13 18:07 GMT+03:00 Daniel P. Berrangé <berrange@redhat.com>:
On Wed, Jun 13, 2018 at 05:59:37PM +0300, Mathieu Tarral wrote:
> > What version of QEMU do you have installed ? Libvirt has recently > become more aggressive at requiring modern QEMU versions, so its > possible if your old libvirt was running against old QEMU, that > might not be supported with new libvirt.
I'm using QEMU 2.8 here. That might explain why libvirt cannot find a version that is modern enough.
2.8 is plenty new enough, so that's not the issue.
Alright, so let's focus on libvirt 4.4.0.
When I start the daemon, i can see some warnings related to QEMU:
warning : virQEMUCapsInit:942 : Failed to get host CPU cache info warning : virQEMUCapsInit:949 : Failed to get host power management capabilities
Could this be the reason, or the beginning of an explanation ? How can I dig and find what is the root cause ?
Best bet is to edit libvirtd.conf and set
log_filters="1:qemu_capabilities" log_outputs="1:file:/var/log/libvirtd.log"
and then rm -rf /var/cache/libvirt/qemu and restart libvirtd. The log file should tell you it is detecting qemu-system-x86_64 and probing it. If anything fails it should be covered in the logs.
Thanks, i have more information now:
debug : virQEMUCapsCacheLookup:4561 : Returning caps (nil) for /usr/bin/qemu-system-x86_64 debug : virQEMUCapsCacheLookup:4561 : Returning caps (nil) for /usr/bin/kvm
Does this help you ?
No that just says there's no previous capabiltiies stored in the cache, which is expected since I just told you to delete the cache :-)
My bad :D
Please attach the full debug log, after running 'virsh capabilities' Sure. I copy pasted everything in a Github Gist, which is easier to read I think. https://gist.github.com/Wenzel/805558263b7d6d8b3366a684d5673217
Thanks ! -- Mathieu Tarral

On Thu, Jun 14, 2018 at 01:23:56PM +0300, Mathieu Tarral wrote:
2018-06-13 18:23 GMT+03:00 Daniel P. Berrangé <berrange@redhat.com>:
On Wed, Jun 13, 2018 at 06:13:04PM +0300, Mathieu Tarral wrote:
2018-06-13 18:07 GMT+03:00 Daniel P. Berrangé <berrange@redhat.com>:
On Wed, Jun 13, 2018 at 05:59:37PM +0300, Mathieu Tarral wrote:
> > > > What version of QEMU do you have installed ? Libvirt has recently > > become more aggressive at requiring modern QEMU versions, so its > > possible if your old libvirt was running against old QEMU, that > > might not be supported with new libvirt. > > I'm using QEMU 2.8 here. > That might explain why libvirt cannot find a version that is modern enough.
2.8 is plenty new enough, so that's not the issue.
Alright, so let's focus on libvirt 4.4.0.
When I start the daemon, i can see some warnings related to QEMU:
warning : virQEMUCapsInit:942 : Failed to get host CPU cache info warning : virQEMUCapsInit:949 : Failed to get host power management capabilities
Could this be the reason, or the beginning of an explanation ? How can I dig and find what is the root cause ?
Best bet is to edit libvirtd.conf and set
log_filters="1:qemu_capabilities" log_outputs="1:file:/var/log/libvirtd.log"
and then rm -rf /var/cache/libvirt/qemu and restart libvirtd. The log file should tell you it is detecting qemu-system-x86_64 and probing it. If anything fails it should be covered in the logs.
Thanks, i have more information now:
debug : virQEMUCapsCacheLookup:4561 : Returning caps (nil) for /usr/bin/qemu-system-x86_64 debug : virQEMUCapsCacheLookup:4561 : Returning caps (nil) for /usr/bin/kvm
Does this help you ?
No that just says there's no previous capabiltiies stored in the cache, which is expected since I just told you to delete the cache :-)
My bad :D
Please attach the full debug log, after running 'virsh capabilities' Sure. I copy pasted everything in a Github Gist, which is easier to read I think. https://gist.github.com/Wenzel/805558263b7d6d8b3366a684d5673217
Ok this is the key error: 2018-06-14 10:23:16.994+0000: 31174: error : virCryptoHashBuf:84 : invalid argument: algorithm=1 is not supported it looks like you've built without gnutls, which is a mandatory dep for the QEMU driver. 4.4.0 didn't treat it as mandatory when building, but in git master we've fixed that now so you would see the problem sooner. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

2018-06-14 13:33 GMT+03:00 Daniel P. Berrangé <berrange@redhat.com>:
On Thu, Jun 14, 2018 at 01:23:56PM +0300, Mathieu Tarral wrote:
2018-06-13 18:23 GMT+03:00 Daniel P. Berrangé <berrange@redhat.com>:
On Wed, Jun 13, 2018 at 06:13:04PM +0300, Mathieu Tarral wrote:
2018-06-13 18:07 GMT+03:00 Daniel P. Berrangé <berrange@redhat.com>:
On Wed, Jun 13, 2018 at 05:59:37PM +0300, Mathieu Tarral wrote:
>> > >> > What version of QEMU do you have installed ? Libvirt has recently >> > become more aggressive at requiring modern QEMU versions, so its >> > possible if your old libvirt was running against old QEMU, that >> > might not be supported with new libvirt. >> >> I'm using QEMU 2.8 here. >> That might explain why libvirt cannot find a version that is modern enough. > > 2.8 is plenty new enough, so that's not the issue.
Alright, so let's focus on libvirt 4.4.0.
When I start the daemon, i can see some warnings related to QEMU:
warning : virQEMUCapsInit:942 : Failed to get host CPU cache info warning : virQEMUCapsInit:949 : Failed to get host power management capabilities
Could this be the reason, or the beginning of an explanation ? How can I dig and find what is the root cause ?
Best bet is to edit libvirtd.conf and set
log_filters="1:qemu_capabilities" log_outputs="1:file:/var/log/libvirtd.log"
and then rm -rf /var/cache/libvirt/qemu and restart libvirtd. The log file should tell you it is detecting qemu-system-x86_64 and probing it. If anything fails it should be covered in the logs.
Thanks, i have more information now:
debug : virQEMUCapsCacheLookup:4561 : Returning caps (nil) for /usr/bin/qemu-system-x86_64 debug : virQEMUCapsCacheLookup:4561 : Returning caps (nil) for /usr/bin/kvm
Does this help you ?
No that just says there's no previous capabiltiies stored in the cache, which is expected since I just told you to delete the cache :-)
My bad :D
Please attach the full debug log, after running 'virsh capabilities' Sure. I copy pasted everything in a Github Gist, which is easier to read I think. https://gist.github.com/Wenzel/805558263b7d6d8b3366a684d5673217
Ok this is the key error:
2018-06-14 10:23:16.994+0000: 31174: error : virCryptoHashBuf:84 : invalid argument: algorithm=1 is not supported
it looks like you've built without gnutls, which is a mandatory dep for the QEMU driver. 4.4.0 didn't treat it as mandatory when building, but in git master we've fixed that now so you would see the problem sooner.
That was the problem indeed. I checked out libvirt master (d1605b5d99e847450a6cbbf752ae5dd76239b46f) and I had to install libgnutls28-dev. Everything works now: Compiled against library: libvirt 3.0.0 Using library: libvirt 3.0.0 Using API: QEMU 3.0.0 Running hypervisor: QEMU 2.8.0 I can track down why my call to virDomainIsActive is hanging for no reason :) Thank you Daniel ! -- Mathieu Tarral
participants (2)
-
Daniel P. Berrangé
-
Mathieu Tarral