<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:宋体;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"批注框文本 Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:9.0pt;
        font-family:宋体;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.Char
        {mso-style-name:"批注框文本 Char";
        mso-style-priority:99;
        mso-style-link:批注框文本;
        font-family:宋体;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ZH-CN link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><div><div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>I do make a mistake because I just print os.getuid() show the user root; but os.geteuid() show the current user is still vdsm;</span><span lang=EN-US><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>Anyway , I still don’t know how to debug vdsm, I cann’t log in to centos with user VDSM, because I don’t know the passwd of user vdsm and if I changed the password, the service vdsmd will cann’t start.</span><span lang=EN-US><o:p></o:p></span></p></div></div></div><div><div><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p></div></div><div><p class=MsoNormal><span lang=EN-US>the vdsm account is intentionally disabled for interactive login<o:p></o:p></span></p></div><div><div><p class=MsoNormal><span lang=EN-US><br><br><br><o:p></o:p></span></p></div><div><div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>You told me “</span><span lang=EN-US>should follow the devel setup wiki</span><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>” , what’s the true link of vdsm devel setup wiki ? I can’t get useful information in<span class=apple-converted-space> </span><a href="http://ovirt.org/"><span style='color:purple'>ovirt.org</span></a><span class=apple-converted-space> </span>or google.</span><span lang=EN-US><o:p></o:p></span></p></div></div></div><div><div><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p></div></div><div><p class=MsoNormal><span lang=EN-US><a href="http://www.ovirt.org/develop/developer-guide/vdsm/developers/"><span style='color:purple'>http://www.ovirt.org/develop/developer-guide/vdsm/developers/</span></a> has tips how to build from source and what packages are needed<o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span lang=EN-US>Anything specific you</span>’<span lang=EN-US>re troubleshooting?<o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> I do build the source from this instruction , but I want to set breakpoint to view each step and variable value to understand the vdsm’s code using python IDE such as Pycharm ,<span class=apple-converted-space> </span></span><span lang=EN-US><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>You know that we can implement this debug requirement in ovirt engine easily, but I can’t implement local debug in vdsm easily, because vdsm didn’t allow root to run or debug.</span><span lang=EN-US><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>Is there any debug instruction ?</span><span lang=EN-US><o:p></o:p></span></p></div></div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><p class=MsoNormal><span lang=EN-US>I don’t think it’s possible to debug it from PyCharm, or any IDE for that matter, easily. <o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-US>It’s a multithreaded application, you can’t really set a breakpoint without affecting other functionality since some of the threads need to keep running<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>Best advice is to add a debugging/logging code in places you need, printing variables you’re interested in.<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> I know it’s a multithreaded application , and debug vdsm is a very difficult job, but without debug, I don’t know which code I should replace or logging, Is there any remote debug solution like ovirt engine? I found that <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>I can do remote debug in simple python application , but I didn’t success yet remote debugging vdsm. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> Now one of our case I want to consider using ovirt as our solution , we may do little change over ovirt. but as described above, without debug , we can hardly understand vdsm clearly and cannot do correctly code change.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>Is there some good advice ?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> Thank you<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> Mark<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>Thanks,<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>michal<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US><br><br><o:p></o:p></span></p><div><div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thank you</span><span lang=EN-US><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>Mark</span><span lang=EN-US><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span lang=EN-US>Thanks,<o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span lang=EN-US>michal<o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span lang=EN-US><br><br><br><o:p></o:p></span></p></div><div><div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thank you</span><span lang=EN-US><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span lang=EN-US><o:p></o:p></span></p></div></div><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><div><div><p class=MsoNormal><b><span style='font-size:10.0pt'>发件人<span lang=EN-US>:</span></span></b><span class=apple-converted-space><span lang=EN-US style='font-size:10.0pt'> </span></span><span lang=EN-US style='font-size:10.0pt'>Michal Skrivanek [<a href="mailto:mskrivan@redhat.com"><span style='color:purple'>mailto:mskrivan@redhat.com</span></a>]<span class=apple-converted-space> </span><br></span><b><span style='font-size:10.0pt'>发送时间<span lang=EN-US>:</span></span></b><span class=apple-converted-space><span lang=EN-US style='font-size:10.0pt'> </span></span><span lang=EN-US style='font-size:10.0pt'>2016</span><span style='font-size:10.0pt'>年<span lang=EN-US>7</span>月<span lang=EN-US>26</span>日<span class=apple-converted-space><span lang=EN-US> </span></span><span lang=EN-US>5:00<br></span><b>收件人<span lang=EN-US>:</span></b><span class=apple-converted-space><span lang=EN-US> </span></span><span lang=EN-US>lifuqiong<br></span><b>抄送<span lang=EN-US>:</span></b><span class=apple-converted-space><span lang=EN-US> </span></span><span lang=EN-US>users; devel<br></span><b>主题<span lang=EN-US>:</span></b><span class=apple-converted-space><span lang=EN-US> </span></span><span lang=EN-US>Re: [ovirt-devel] Debug vdsm 4.0.0 report error: libvirt: XML-RPC error : Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied</span></span><span lang=EN-US><o:p></o:p></span></p></div></div></div></div><div><div><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p></div></div><div><div><div><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p></div></div></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US><br>On 25 Jul 2016, at 21:50, Sandro Bonazzola <<a href="mailto:sbonazzo@redhat.com"><span style='color:purple'>sbonazzo@redhat.com</span></a>> wrote:<o:p></o:p></span></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><div><p class=MsoNormal><span lang=EN-US>Adding some people from virt team.<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>Il 23/Lug/2016 11:44, "lifuqiong" <<a href="mailto:lifuqiong@cncloudsec.com"><span style='color:purple'>lifuqiong@cncloudsec.com</span></a>> ha scritto:<br>><br>> I debugged vdsm with PyCharm, And I logged on my Centos 7.2 with root, and get an error as follows:<br>><br>> <br>><br>> Problem:<br>><br>> <br>><br>> Traceback (most recent call last):<br>><br>> File "/usr/share/vdsm/vdsm", line 149, in run<br>><br>> serve_clients(log)<br>><br>> File "/usr/share/vdsm/vdsm", line 104, in serve_clients<br>><br>> cif = clientIF.getInstance(irs, log, scheduler)<br>><br>> File "/usr/share/vdsm/clientIF.py", line 204, in getInstance<br>><br>> cls._instance = clientIF(irs, log, scheduler)<br>><br>> File "/usr/share/vdsm/clientIF.py", line 106, in __init__<br>><br>> secret.clear()<br>><br>> File "/usr/lib/python2.7/site-packages/vdsm/virt/secret.py", line 92, in clear<br>><br>> con = libvirtconnection.get()<br>><br>> File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line 163, in get<br>><br>> password)<br>><br>> File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line 99, in open_connection<br>><br>> return utils.retry(libvirtOpen, timeout=10, sleep=0.2)<br>><br>> File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 546, in retry<br>><br>> return func()<br>><br>> File "/usr/lib64/python2.7/site-packages/libvirt.py", line 105, in openAuth<br>><br>> if ret is None:raise libvirtError('virConnectOpenAuth() failed')<br>><br>> libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied<br>><br>> <br>><br>> Investitate:<br>><br>> According to the traceback above, the code in libvirt.py as below, and os.geteuid() get<span class=apple-converted-space> </span></span>‘<span lang=EN-US>0</span>’<span class=apple-converted-space><span lang=EN-US> </span></span><span lang=EN-US>which shows the current user is root;<o:p></o:p></span></p></div></div></blockquote><div><div><div><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p></div></div></div><div><div><p class=MsoNormal><span lang=EN-US>vdsm is not supposed to be run under root user. For debugging you should follow the devel setup wiki and not change a regular host. <o:p></o:p></span></p></div></div><div><div><div><p class=MsoNormal><span lang=EN-US>Depends what you modified, it's impossible to say from what you described....but a general advice is you simply don't do that:)<br><br><br><br><o:p></o:p></span></p></div></div><div><div><p class=MsoNormal><span lang=EN-US>><br>> <br>><br>> def openAuth(uri, auth, flags=0):<br>><br>> #print os.geteuid()<br>><br>> ret = libvirtmod.virConnectOpenAuth(uri, auth, flags)<br>><br>> if ret is None:raise libvirtError('virConnectOpenAuth() failed')<br>><br>> return virConnect(_obj=ret)<br>><br>> <br>><br>> [root@server117 libvirt]# ll /var/run/libvirt/libvirt-sock<br>><br>> srwxrwx---. 1 root qemu 0 Jul 19 23:43 /var/run/libvirt/libvirt-sock<br>><br>> <br>><br>> According that, root should not get an Permission denied error ? But why?<br>><br>> <br>><br>> And I setenforce=0 , and still show Perssion denied error.<br>><br>> <br>><br>> What</span>’<span lang=EN-US>s the reason? And how to solve it?<br>><br>> <br>><br>> Thank you.<br>><br>><br>> _______________________________________________<br>> Devel mailing list<br>><span class=apple-converted-space> </span><a href="mailto:Devel@ovirt.org"><span style='color:purple'>Devel@ovirt.org</span></a><br>><span class=apple-converted-space> </span><a href="http://lists.ovirt.org/mailman/listinfo/devel"><span style='color:purple'>http://lists.ovirt.org/mailman/listinfo/devel</span></a><o:p></o:p></span></p></div></div></div></div></div></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>