[libvirt] libvirt can't get capablities

Hi, I have suffered several times on both x86 machine and power machine. When we want to use libvirt to create on VMs, it reports "unknown OS type hvm". We can't get <guest> capabilities. The log is as the following(log_level=1): 2003-01-02 01:21:39.895+0000: 12214: error : virDomainDefParseXML:8491 : unknown OS type hvm 2003-01-02 01:21:39.896+0000: 12214: error : virDomainDefParseXML:8491 : unknown OS type hvm 2003-01-02 01:22:00.135+0000: 12207: error : qemuCapsComputeCmdFlags:1218 : unsupported configuration: this qemu binary requires libvirt to be compiled with yajl 2003-01-02 01:22:13.342+0000: 12207: error : qemuCapsComputeCmdFlags:1218 : unsupported configuration: this qemu binary requires libvirt to be compiled with yajl 2003-01-02 01:22:13.347+0000: 12204: error : qemuCapsExtractVersion:1576 : internal error Cannot find suitable emulator for ppc64 2003-01-02 01:22:13.351+0000: 12205: error : qemuCapsExtractVersion:1576 : internal error Cannot find suitable emulator for ppc64 2003-01-02 01:22:13.355+0000: 12207: error : qemuCapsExtractVersion:1576 : internal error Cannot find suitable emulator for ppc64 2003-01-02 01:22:13.355+0000: 12208: error : qemuCapsExtractVersion:1576 : internal error Cannot find suitable emulator for ppc64 2003-01-02 01:22:13.357+0000: 12206: error : qemuCapsExtractVersion:1576 : internal error Cannot find suitable emulator for ppc64 I search online and find one similar issue from Redhat bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=509337 Is there any solution to avoid this problem? Any idea? -- Best Regards Li IBM LTC, China System&Technology Lab, Beijing

Hey, On Mon, Jul 02, 2012 at 05:47:08PM +0800, Li Zhang wrote:
2003-01-02 01:22:00.135+0000: 12207: error : qemuCapsComputeCmdFlags:1218 : unsupported configuration: this qemu binary requires libvirt to be compiled with yajl
Your first problem is here, you need to have yajl-devel installed before building libvirt. Hope that helps, Christophe

On 07/02/2012 05:53 PM, Christophe Fergeau wrote:
Hey,
On Mon, Jul 02, 2012 at 05:47:08PM +0800, Li Zhang wrote:
2003-01-02 01:22:00.135+0000: 12207: error : qemuCapsComputeCmdFlags:1218 : unsupported configuration: this qemu binary requires libvirt to be compiled with yajl
Your first problem is here, you need to have yajl-devel installed before building libvirt. Hi,
I tried on my x86 machine to installed all these packages. [root@mcd ~]# rpm -qa yajl yajl-1.0.12-1.fc16.x86_64 [root@mcd ~]# rpm -qa yajl-devel yajl-devel-1.0.12-1.fc16.x86_64 [root@mcd ~]# lsmod |grep kvm kvm_intel 119203 0 kvm 347474 1 kvm_intel [root@mcd ~]# virsh capabilities <capabilities> <host> <uuid>d4ff0166-0f8b-e111-ab17-78a277034000</uuid> <cpu> <arch>x86_64</arch> <model>Nehalem</model> <vendor>Intel</vendor> <topology sockets='1' cores='4' threads='1'/> <feature name='rdtscp'/> <feature name='avx'/> <feature name='osxsave'/> <feature name='xsave'/> <feature name='tsc-deadline'/> <feature name='x2apic'/> <feature name='pdcm'/> <feature name='xtpr'/> <feature name='tm2'/> <feature name='est'/> <feature name='smx'/> <feature name='vmx'/> <feature name='ds_cpl'/> <feature name='monitor'/> <feature name='dtes64'/> <feature name='pclmuldq'/> <feature name='pbe'/> <feature name='tm'/> <feature name='ht'/> <feature name='ss'/> <feature name='acpi'/> <feature name='ds'/> <feature name='vme'/> </cpu> <power_management> <suspend_mem/> <suspend_disk/> <suspend_hybrid/> </power_management> <migration_features> <live/> <uri_transports> <uri_transport>tcp</uri_transport> </uri_transports> </migration_features> <secmodel> <model>selinux</model> <doi>0</doi> </secmodel> </host> </capabilities>
Hope that helps,
Christophe
-- Best Regards Li IBM LTC, China System&Technology Lab, Beijing

On 07/03/2012 09:12 AM, Li Zhang wrote:
On 07/02/2012 05:53 PM, Christophe Fergeau wrote:
Hey,
On Mon, Jul 02, 2012 at 05:47:08PM +0800, Li Zhang wrote:
2003-01-02 01:22:00.135+0000: 12207: error : qemuCapsComputeCmdFlags:1218 : unsupported configuration: this qemu binary requires libvirt to be compiled with yajl
Your first problem is here, you need to have yajl-devel installed before building libvirt. Hi,
I tried on my x86 machine to installed all these packages.
[root@mcd ~]# rpm -qa yajl yajl-1.0.12-1.fc16.x86_64 [root@mcd ~]# rpm -qa yajl-devel yajl-devel-1.0.12-1.fc16.x86_64
[root@mcd ~]# lsmod |grep kvm kvm_intel 119203 0 kvm 347474 1 kvm_intel
[root@mcd ~]# virsh capabilities <capabilities>
<host> <uuid>d4ff0166-0f8b-e111-ab17-78a277034000</uuid> <cpu> <arch>x86_64</arch> <model>Nehalem</model> <vendor>Intel</vendor> <topology sockets='1' cores='4' threads='1'/> <feature name='rdtscp'/> <feature name='avx'/> <feature name='osxsave'/> <feature name='xsave'/> <feature name='tsc-deadline'/> <feature name='x2apic'/> <feature name='pdcm'/> <feature name='xtpr'/> <feature name='tm2'/> <feature name='est'/> <feature name='smx'/> <feature name='vmx'/> <feature name='ds_cpl'/> <feature name='monitor'/> <feature name='dtes64'/> <feature name='pclmuldq'/> <feature name='pbe'/> <feature name='tm'/> <feature name='ht'/> <feature name='ss'/> <feature name='acpi'/> <feature name='ds'/> <feature name='vme'/> </cpu> <power_management> <suspend_mem/> <suspend_disk/> <suspend_hybrid/> </power_management> <migration_features> <live/> <uri_transports> <uri_transport>tcp</uri_transport> </uri_transports> </migration_features> <secmodel> <model>selinux</model> <doi>0</doi> </secmodel> </host>
</capabilities>
It may be caused some packages which are required. I am not quite sure about that. I reinstall all the packages required. As the following: Libtool (glibtoolize toolize) Gnutls Gnutls-devel Gnutls-c++ libgnutls pkgconfig(libtasn1) libgpg-error-devel libgcrypt-devel libtasn1-devel device-mapper-devel/libdevmapper >= 1.0.0 Python-devel Gettext-devel (autopoint) Htmldoc Libxml2-devel xhtml1-dtds And remove libvirt source code, then git clone latest source code. Then I compile it and install libvirt. It seems that it works.
Hope that helps,
Christophe
-- Best Regards Li IBM LTC, China System&Technology Lab, Beijing

On 2012年07月02日 17:47, Li Zhang wrote:
Hi,
I have suffered several times on both x86 machine and power machine.
When we want to use libvirt to create on VMs, it reports "unknown OS type hvm".
We can't get <guest> capabilities.
The log is as the following(log_level=1):
2003-01-02 01:21:39.895+0000: 12214: error : virDomainDefParseXML:8491 : unknown OS type hvm 2003-01-02 01:21:39.896+0000: 12214: error : virDomainDefParseXML:8491 : unknown OS type hvm 2003-01-02 01:22:00.135+0000: 12207: error : qemuCapsComputeCmdFlags:1218 : unsupported configuration: this qemu binary requires libvirt to be compiled with yajl
You need to build the pkg with yajl-devel. I'm wondering if we should force to require yajl-devel if build with "with-qemu", as without yajl-devel, it can't do much work with new qemu now. Regards. Osier

On Mon, Jul 02, 2012 at 05:56:35PM +0800, Osier Yang wrote:
I'm wondering if we should force to require yajl-devel if build with "with-qemu", as without yajl-devel, it can't do much work with new qemu now.
Something like this ? ;) commit 350583c859deaaddc98d7319e1c2ad649e4d3e83 Author: Eric Blake <eblake@redhat.com> Date: Wed Jun 13 10:09:39 2012 -0600 build: hoist qemu dependence on yajl to configure Commit 6e769eba made it a runtime error if libvirt was compiled without yajl support but targets a new enough qemu. But enough users are hitting this on self-compiled libvirt that it is worth erroring out at compilation time, rather than an obscure failure when trying to use the built executable. * configure.ac: If qemu is requested and -version works, require yajl when qemu version is new enough. * src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Add comment.

On 2012年07月03日 01:07, Christophe Fergeau wrote:
On Mon, Jul 02, 2012 at 05:56:35PM +0800, Osier Yang wrote:
I'm wondering if we should force to require yajl-devel if build with "with-qemu", as without yajl-devel, it can't do much work with new qemu now.
Something like this ? ;)
Yes, exactly.
commit 350583c859deaaddc98d7319e1c2ad649e4d3e83 Author: Eric Blake<eblake@redhat.com> Date: Wed Jun 13 10:09:39 2012 -0600
build: hoist qemu dependence on yajl to configure
Commit 6e769eba made it a runtime error if libvirt was compiled without yajl support but targets a new enough qemu. But enough users are hitting this on self-compiled libvirt that it is worth erroring out at compilation time, rather than an obscure failure when trying to use the built executable.
* configure.ac: If qemu is requested and -version works, require yajl when qemu version is new enough. * src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Add comment.

On 07/02/2012 05:56 PM, Osier Yang wrote:
On 2012年07月02日 17:47, Li Zhang wrote:
Hi,
I have suffered several times on both x86 machine and power machine.
When we want to use libvirt to create on VMs, it reports "unknown OS type hvm".
We can't get <guest> capabilities.
The log is as the following(log_level=1):
2003-01-02 01:21:39.895+0000: 12214: error : virDomainDefParseXML:8491 : unknown OS type hvm 2003-01-02 01:21:39.896+0000: 12214: error : virDomainDefParseXML:8491 : unknown OS type hvm 2003-01-02 01:22:00.135+0000: 12207: error : qemuCapsComputeCmdFlags:1218 : unsupported configuration: this qemu binary requires libvirt to be compiled with yajl
You need to build the pkg with yajl-devel.
Hi Osier, I tried, but it seems that it doesn't work. Will yajl packages help to detect kvm module and qemu binary? It seems that it can't find kvm module and qemu binary.
I'm wondering if we should force to require yajl-devel if build with "with-qemu", as without yajl-devel, it can't do much work with new qemu now.
Regards. Osier
-- Best Regards Li IBM LTC, China System&Technology Lab, Beijing

On 2012年07月03日 09:49, Li Zhang wrote:
On 07/02/2012 05:56 PM, Osier Yang wrote:
On 2012年07月02日 17:47, Li Zhang wrote:
Hi,
I have suffered several times on both x86 machine and power machine.
When we want to use libvirt to create on VMs, it reports "unknown OS type hvm".
We can't get <guest> capabilities.
The log is as the following(log_level=1):
2003-01-02 01:21:39.895+0000: 12214: error : virDomainDefParseXML:8491 : unknown OS type hvm 2003-01-02 01:21:39.896+0000: 12214: error : virDomainDefParseXML:8491 : unknown OS type hvm 2003-01-02 01:22:00.135+0000: 12207: error : qemuCapsComputeCmdFlags:1218 : unsupported configuration: this qemu binary requires libvirt to be compiled with yajl
You need to build the pkg with yajl-devel.
Hi Osier,
I tried, but it seems that it doesn't work. Will yajl packages help to detect kvm module and qemu binary? It seems that it can't find kvm module and qemu binary.
Sorry for the late response, the detection of qemu binary and kvm module doesn't relates with the requirement of yajl. If you see the error "this qemu binary requires libvirt to comipled with yajl", that means the qemu binary is found. Why do you think it's not found? Regards, Osier

On Mon, Jul 02, 2012 at 05:47:08PM +0800, Li Zhang wrote:
Hi,
I have suffered several times on both x86 machine and power machine.
When we want to use libvirt to create on VMs, it reports "unknown OS type hvm".
We can't get <guest> capabilities.
The log is as the following(log_level=1):
2003-01-02 01:21:39.895+0000: 12214: error : virDomainDefParseXML:8491 : unknown OS type hvm 2003-01-02 01:21:39.896+0000: 12214: error : virDomainDefParseXML:8491 : unknown OS type hvm 2003-01-02 01:22:00.135+0000: 12207: error : qemuCapsComputeCmdFlags:1218 : unsupported configuration: this qemu binary requires libvirt to be compiled with yajl 2003-01-02 01:22:13.342+0000: 12207: error : qemuCapsComputeCmdFlags:1218 : unsupported configuration: this qemu binary requires libvirt to be compiled with yajl
Hmm, this shows a flaw in the way we deal with QEMU. When detecting QEMU for the purpose of the capabilities XML, IMHO, we should *not* be raising this error. Errors in detecting capabilities are more or less invisible to users of libvirt, since they do not occur in response to a specific API call. Thus, we should have reported the capabilities XML as normal here, and only reported the YAJL compatibility error at the time the user tries to actually start a guest. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 07/02/2012 06:14 PM, Daniel P. Berrange wrote:
On Mon, Jul 02, 2012 at 05:47:08PM +0800, Li Zhang wrote:
Hi,
I have suffered several times on both x86 machine and power machine.
When we want to use libvirt to create on VMs, it reports "unknown OS type hvm".
We can't get <guest> capabilities.
The log is as the following(log_level=1):
2003-01-02 01:21:39.895+0000: 12214: error : virDomainDefParseXML:8491 : unknown OS type hvm 2003-01-02 01:21:39.896+0000: 12214: error : virDomainDefParseXML:8491 : unknown OS type hvm 2003-01-02 01:22:00.135+0000: 12207: error : qemuCapsComputeCmdFlags:1218 : unsupported configuration: this qemu binary requires libvirt to be compiled with yajl 2003-01-02 01:22:13.342+0000: 12207: error : qemuCapsComputeCmdFlags:1218 : unsupported configuration: this qemu binary requires libvirt to be compiled with yajl
Hmm, this shows a flaw in the way we deal with QEMU. When detecting QEMU for the purpose of the capabilities XML, IMHO, we should *not* be raising this error. Errors in detecting capabilities are more or less invisible to users of libvirt, since they do not occur in response to a specific API call.
Thus, we should have reported the capabilities XML as normal here, and only reported the YAJL compatibility error at the time the user tries to actually start a guest.
Got it. I will clean this to avoid the same problem in the future.
Daniel
-- Best Regards Li IBM LTC, China System&Technology Lab, Beijing
participants (4)
-
Christophe Fergeau
-
Daniel P. Berrange
-
Li Zhang
-
Osier Yang