qemu-kvm-0.13.0编译出错的解决方案

现象
最新版本的qemu-kvm-0.13.0居然编译出错。。现象如下:
[shell]
#出错信息
kvm-all.o: In function `kvm_run':
/home/liheyuan/code/qemu-kvm-0.13.0/qemu-kvm.c:675: undefined reference to `kvm_handle_internal_error'
collect2: ld returned 1 exit status
[/shell]

原因
经过反复的查找错误。。
发现是0.13.0程序实现上的一个Bug,有一个地方忘记了加
[shell]
#ifdef KVM_CAP_INTERNAL_ERROR_DATA
xxxxx
#endif
[/shell]

转载请注明:qemu-kvm-0.13.0编译出错的解决方案

解决方法:
修改qemu-kvm.c,第674行,在这个case前后加上ifdef,如下:
[shell]
#第674-677行,替换为如下的:
#ifdef KVM_CAP_INTERNAL_ERROR_DATA
case KVM_EXIT_INTERNAL_ERROR:
kvm_handle_internal_error(env, run);
r = 1;
break;
#endif
[/shell]

再次编译,一切正常!

转载请注明:qemu-kvm-0.13.0编译出错的解决方案

Leave a Reply

Your email address will not be published. Required fields are marked *