很久没有编译 libvirt了。

工作需要,重新编译。

[org_ref]: http://libvirt.org/compiling.html 很简单。 编译过程, 还是很多问题。

依赖包(给懒人参考):

$ sudo apt-get install libtool libxml-xpath-perl libxml2 libxml2-utils python-dev automake autopoint xsltproc libxml++2.6-dev  libdevmapper-dev  libpciaccess-dev libnl-3-dev  libnl-route-3-dev imagemagick libyajl-dev xmllint uniconvertor

勤快的家伙们,可以自己编译,自己查看,缺了每个包的功能。

libnl-route-3-200 - library for dealing with netlink sockets - route interface

libnl-3-200: library for dealing with netlink sockets

rpcgen: 这个包不需要安装,但是可以man一下。 之前在公司的wiki中,介绍过rpcgen。 可惜...

$ git grep RPCGEN

在libvirt中,src/remote/remote_protocol.x 产生:

$ tree -f |grep  remote_protocol

$ git show eb826444f90c2563dadf148630b0cd6a9b41ba1e

查看详细过程。

编译

https://libvirt.org/compiling.html

编译完成,启动远程链接注意问题。

http://libvirt.org/remote.html#Remote_certificates

http://www.vmware.com/pdf/vsphere4/r40/vsp_40_esx_server_config.pdf

http://libvirt.org/drvesx.html#connproblems

可以不启用用tls,config中修改一下,就可以了。

  1. diff --git a/daemon/libvirtd.conf b/daemon/libvirtd.conf
  2. index d2c439c..aa547bd
  3. --- a/daemon/libvirtd.conf
  4. +++ b/daemon/libvirtd.conf
  5. @@ -, +, @@
  6. # using this capability.
  7. #
  8. # This is enabled by default, uncomment this to disable it
  9. -#listen_tls =
  10. +listen_tls =
  11.  
  12. # Listen for unencrypted TCP connections on the public TCP/IP port.
  13. # NB, must pass the --listen flag to the libvirtd process for this to
  14. @@ -, +, @@
  15. #
  16. # It is possible to make use of any SASL authentication
  17. # mechanism as well, by using 'sasl' for this option
  18. -#auth_tls = "none"
  19. +auth_tls = "none"
  20.  
  21. # Change the API access control scheme
  22. @@ -, +, @@
  23. #
  24. # Default is to always run sanity checks. Uncommenting this
  25. # will disable sanity checks which is not a good idea
  26. -#tls_no_sanity_certificate =
  27. +tls_no_sanity_certificate =
  28.  
  29. # Flag to disable verification of client certificates
  30. #
  31. @@ -, +, @@
  32. #
  33. # Default is to always verify. Uncommenting this will disable
  34. # verification - make sure an IP whitelist is set
  35. -#tls_no_verify_certificate =
  36. +tls_no_verify_certificate =
  37.  
  38. # A whitelist of allowed x509 Distinguished Names

启动libvirt调试:

编译

https://libvirt.org/compiling.html

$ cat /usr/bin/gdb-libvirt

  1. # ps -ef |grep lt-libvirtd |grep -v grep | awk '{print $2}' | xargs gdb -p
  2. LIBVIRT_PID=`ps -ef |grep lt-libvirtd |grep -v grep | grep -v gdb-libvirt | awk '{print $2}'`
  3. echo $LIBVIRT_PID
  4. LIBVIRT_PID=`cut -d " " -f1 <<< $LIBVIRT_PID`
  5. if [ x$LIBVIRT_PID != x"" ]; then
  6. echo "=================================================="
  7. echo "attach libvirt-d"
  8. echo "sudo gdb -p $LIBVIRT_PID"
  9. sudo gdb -p $LIBVIRT_PID
  10. else
  11. echo "***************************************************"
  12. echo "start libvirt-d"
  13. # sudo ./daemon/libvirtd --listen --verbose -f ./daemon/libvirtd.conf
  14. sudo ./daemon/libvirtd --listen -f ./daemon/libvirtd.conf
  15. fi
  1. # ps -ef |grep lt-libvirtd |grep -v grep | awk '{print $2}' | xargs gdb -p
  2. LIBVIRT_PID=`ps -ef |grep lt-libvirtd |grep -v grep | grep -v gdb-libvirt | awk '{print $2}'`
  3. echo $LIBVIRT_PID
  4. LIBVIRT_PID=`cut -d " " -f1 <<< $LIBVIRT_PID`
  5. if [ x$LIBVIRT_PID != x"" ]; then
  6. echo "=================================================="
  7. echo "attach libvirt-d"
  8. echo "sudo gdb -p $LIBVIRT_PID"
  9. if [ -f "br" ]; then
  10. sudo gdb -p $LIBVIRT_PID -x br
  11. else
  12. sudo gdb -p $LIBVIRT_PID
  13. fi
  14. else
  15. echo "***************************************************"
  16. echo "start libvirt-d"
  17. # sudo /home/ubuntu/libvirt/daemon/libvirtd --listen --verbose
  18. sudo /home/ubuntu/libvirt/daemon/libvirtd -f /home/ubuntu/libvirt/daemon/libvirtd.conf --listen
  19. fi

$ cat /usr/bin/gdb-virsh

  1. if [ x$ = "x-g" ]; then
  2. sudo /home/shaohe/libvirt/run gdb /home/shaohe/libvirt/tools/virsh
  3. else
  4. sudo /home/shaohe/libvirt/run /home/shaohe/libvirt/tools/virsh
  5. fi
  1. if [ x$ = "x-g" ]; then
  2. sudo ./run gdb ./tools/virsh
  3. else
  4. sudo ./run ./tools/virsh
  5. fi

ubuntu15.04下编译 libvirt的更多相关文章

  1. ubuntu-15.04 下编译 ijkplayer 安卓版

    我的环境: 1.win7 主系统 2.VirtualBox 5.1.2 虚拟机 3.ubuntu-15.04-desktop-amd64.iso 镜像文件 4.android-ndk-r10e-lin ...

  2. ubuntu15.10下编译安装wine1.8 rc4

    ubuntu15.10下编译安装wine1.8rc4 Wine (“Wine Is Not an Emulator” 的递归缩写)是一个能够在多种 POSIX-compliant 操作系统(诸如 Li ...

  3. 在ubuntu12.04下编译android4.1.2添加JNI层出现问题

    tiny4412学习者,在ubuntu12.04下编译android4.1.2添加JNI层出现问题: (虚心请教解决方法) trouble writing output: Too many metho ...

  4. [置顶] ubuntu12.04下编译opencv程序

    ubuntu12.04下编译opencv程序 1.在ubuntu下安装好 opencv后(建议使用apt-get install 来安装) 2.使用程序FaceExaple.c来进行测试程序 #inc ...

  5. ubuntu14.04下编译安装ambari-2.4.2.0

    ubuntu14.04下编译安装ambari-2.4.2.0 编译前的准备工作 准备工作有: 系统参数 系统依赖(编译环境) 离线安装包 java环境 maven环境 Nodejs环境 git环境 a ...

  6. Ubuntu16.04下编译安装OpenCV3.4.0(C++ & python)

    Ubuntu16.04下编译安装OpenCV3.4.0(C++ & python) 前提是已经安装了python2,python3 1)安装各种依赖库 sudo apt-get update ...

  7. Ubuntu16.04下编译OpenCV2.4.13静态库(.a文件)

    Ubuntu16.04下编译OpenCV2.4.13静态库(.a文件) https://blog.csdn.net/woainishifu/article/details/79712110 我们在做项 ...

  8. Ubuntu 16.04下编译安装Apache2.4和PHP7结合

    Ubuntu 16.04下编译安装Apache2.4和PHP7结合,并安装PDOmysql扩展. 1.编译安装apache2.4.20 1 第一步: ./configure --prefix=/usr ...

  9. VoIP应用在Ubuntu 14.04下编译FFmpeg libX264及PJSIP

    PJSIP是一个开源的SIP协议栈.它支持多种SIP的扩展功能,可说算是最目前流行的SIP协议栈之一了.  它实现了SIP.SDP.RTP.STUN.TURN和ICE.PJSIP作为基于SIP的一个多 ...

随机推荐

  1. Binder的非正常消亡时的重置方法

    一.原理 当Binder非正常消亡的时候,会导致远程调用失败,这样客户端功能就会受到影响. 解决:给Binder设置一个死亡代理,当Binder死亡时,我们就会收到通知,这个时候可以重新发起连接. 二 ...

  2. [ReactiveCocoa]最简单的RAC入门操作

    当knowckout.js出来的时候,确实被其kobinding惊艳了一下,等到AngularJS出来的时候,把MVVM的模式更是向前推进了一步.所以当ReactiveCocoa出来的时候,也很感兴趣 ...

  3. Memcached管理与监控工具 memAdmin

    http://www.junopen.com/memadmin/ 使用MemCached以后,肯定希望知道cache的效果,对于MemCached的一些运行状态进行监控是必要的,memcached提供 ...

  4. iOS多线程系列(2)

    前面了iOS的NSThread方法来实现多线程,这篇就简单的讲讲NSOperation和NSOperationQueue. NSOperation是一个抽象类,定义一个要执行的任务.NSOperati ...

  5. 解决Admob Banner首次展示不显示的问题

    Admob banner在第一次虽然加载成功了,但是却不显示.然后等待60秒刷新自动刷新,banner就能正常显示. 如果你没遇到过这种情况,那可能你用的不是集成在play-services里的库,因 ...

  6. 拓扑排序(TopologicalSort)算法

    拓扑排序算法应用: 有些事情做都需要按照流程的去做,比如你准备约你小女友去影院看速度与激情7大片,首先你想的是我怎么到达影院,然后达到影院,你可以先买票,或者等小女友来了一起买票,然后一起进电影大厅. ...

  7. Android UI ActionBar功能-Action Bar 左上角的向上或返回按钮

    ActionBar在左上角还提供了一个向上或返回的按钮,默认情况下是隐藏的需要在代码中开启: 官方文档:http://wear.techbrood.com/training/basics/action ...

  8. python升级导致的坑

    问题来源 问题往往都是这样来的突然,让我措手不及. 小孩没娘说来话长啊,操作系统是centos6.5因此默认自带的python是2.6.6的,突然有一天我要写一个关于kafka topic消费情况的监 ...

  9. hdu 5590 ZYB's Biology

    Problem Description After getting scores ) begins to work with biological questions.Now he give you ...

  10. jquery第四期:对象转换的小实例

    为了更清晰的看懂jquery对象是一个数组,我们这一期来改变每一个<li>中的值,在前面加上序号. 代码如下: <!DOCTYPE html PUBLIC "-//W3C/ ...