很久没有编译 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中修改一下,就可以了。

 diff --git a/daemon/libvirtd.conf b/daemon/libvirtd.conf
index d2c439c..aa547bd
--- a/daemon/libvirtd.conf
+++ b/daemon/libvirtd.conf
@@ -, +, @@
# using this capability.
#
# This is enabled by default, uncomment this to disable it
-#listen_tls =
+listen_tls = # Listen for unencrypted TCP connections on the public TCP/IP port.
# NB, must pass the --listen flag to the libvirtd process for this to
@@ -, +, @@
#
# It is possible to make use of any SASL authentication
# mechanism as well, by using 'sasl' for this option
-#auth_tls = "none"
+auth_tls = "none" # Change the API access control scheme
@@ -, +, @@
#
# Default is to always run sanity checks. Uncommenting this
# will disable sanity checks which is not a good idea
-#tls_no_sanity_certificate =
+tls_no_sanity_certificate = # Flag to disable verification of client certificates
#
@@ -, +, @@
#
# Default is to always verify. Uncommenting this will disable
# verification - make sure an IP whitelist is set
-#tls_no_verify_certificate =
+tls_no_verify_certificate = # A whitelist of allowed x509 Distinguished Names

启动libvirt调试:

编译

https://libvirt.org/compiling.html

$ cat /usr/bin/gdb-libvirt

 # ps -ef  |grep  lt-libvirtd |grep -v grep  | awk '{print $2}'  | xargs gdb -p
LIBVIRT_PID=`ps -ef |grep lt-libvirtd |grep -v grep | grep -v gdb-libvirt | awk '{print $2}'`
echo $LIBVIRT_PID
LIBVIRT_PID=`cut -d " " -f1 <<< $LIBVIRT_PID`
if [ x$LIBVIRT_PID != x"" ]; then
echo "=================================================="
echo "attach libvirt-d"
echo "sudo gdb -p $LIBVIRT_PID"
sudo gdb -p $LIBVIRT_PID
else
echo "***************************************************"
echo "start libvirt-d"
# sudo ./daemon/libvirtd --listen --verbose -f ./daemon/libvirtd.conf
sudo ./daemon/libvirtd --listen -f ./daemon/libvirtd.conf
fi
 # ps -ef  |grep  lt-libvirtd |grep -v grep  | awk '{print $2}'  | xargs gdb -p
LIBVIRT_PID=`ps -ef |grep lt-libvirtd |grep -v grep | grep -v gdb-libvirt | awk '{print $2}'`
echo $LIBVIRT_PID
LIBVIRT_PID=`cut -d " " -f1 <<< $LIBVIRT_PID`
if [ x$LIBVIRT_PID != x"" ]; then
echo "=================================================="
echo "attach libvirt-d"
echo "sudo gdb -p $LIBVIRT_PID"
if [ -f "br" ]; then
sudo gdb -p $LIBVIRT_PID -x br
else
sudo gdb -p $LIBVIRT_PID
fi
else
echo "***************************************************"
echo "start libvirt-d"
# sudo /home/ubuntu/libvirt/daemon/libvirtd --listen --verbose
sudo /home/ubuntu/libvirt/daemon/libvirtd -f /home/ubuntu/libvirt/daemon/libvirtd.conf --listen
fi

$ cat /usr/bin/gdb-virsh

 if [ x$ = "x-g" ]; then
sudo /home/shaohe/libvirt/run gdb /home/shaohe/libvirt/tools/virsh
else
sudo /home/shaohe/libvirt/run /home/shaohe/libvirt/tools/virsh
fi
 if [ x$ = "x-g" ]; then
sudo ./run gdb ./tools/virsh
else
sudo ./run ./tools/virsh
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. Bitmap、BitmapDrawable、BitmapFactory、Matrix类之间的关系

    1.BitmapFactory是一个工具类 Bitmap实现在android.graphics包中.但是Bitmap类的构造函数是私有的,外面并不能实例化,只能是通过JNI实例化.这必然是 某个辅助类 ...

  2. Oracle EBS-SQL (WIP-11):检查期间任务完工记录数.sql

    select        WE.WIP_ENTITY_NAME                 任务名称,        WDJ.class_code                         ...

  3. xxx.java: Recompile with -Xlint:unchecked for details.

    一.遇到问题:用ant执行jasperreport的samples/charts示例的build.xml时,无法编译,提示错误如下:javac:    [javac] Compiling 2 sour ...

  4. Codeforces 235E

    Codeforces 235E 原题 题目描述:设\(d(n)\)表示\(n\)的因子个数, 给定\(a, b, c\), 求: \[\sum_{i=1}^{a} \sum_{j=1}^{b} \su ...

  5. ckeditor编辑器在java项目中配置

    一.基本使用: 1.所需文件架包 A. Ckeditor基本文件包,比如:ckeditor_3.6.2.zip 下载地址:http://ckeditor.com/download 2.配置使用 A.将 ...

  6. Euro Efficiency(完全背包)

    Euro Efficiency Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 20000/10000K (Java/Other) Tot ...

  7. 如何在ASP.NET中用C#将XML转换成JSON 【转】

      本文旨在介绍如果通过C#将获取到的XML文档转换成对应的JSON格式字符串,然后将其输出到页面前端,以供JavaScript代码解析使用.或许你可以直接利用JavaScript代码通过Ajax的方 ...

  8. oj 小黑华丽的逆袭机会

    Problem H: 小黑华丽的逆袭机会 Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 79  Solved: 7 [Submit][Status][ ...

  9. 响应式内容滑动插件bxSlider

    bxSlider特性 1.充分响应各种设备,适应各种屏幕: 2.支持多种滑动模式,水平.垂直以及淡入淡出效果: 3.支持图片.视频以及任意html内容: 4.支持触摸滑动: 5.支持Firefox,C ...

  10. C#编程建言笔记

    方法: 1.方法(静态或实例)JIT编译后,在内存中的代码段上都是一个全局函数,且只存在一份拷贝. 2.方法修饰符:保护级别,静态,虚函数:方法签名:返回值,函数名,参数. 构造器: 1.一个方法只能 ...