<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Possibly related I notice race conditions caused by vnic never getting loaded if an existing bridge is already up (by OS init scripts etc) and stopping VM's from getting started. <br><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Often this is behavior you want ; i.e having Host Hypervisor NIC's added and up before libvirtd sets up it's nics/bridges.<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 29 April 2017 at 11:15,  <span dir="ltr"><<a href="mailto:lu.zhipeng@zte.com.cn" target="_blank">lu.zhipeng@zte.com.cn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-7555536877149155405zcontentRow"><span class=""> <p><br></p><p><span style="line-height:21px">>On Fri, Apr 28, 2017 at 05:<wbr>23:19PM +0800, ZhiPeng Lu <wbr>wrote:</span><br style="white-space:normal"><span style="line-height:21px">>> Creating tap device and <wbr>adding the device to bridge <wbr>are not atomic operation.</span><br style="white-space:normal"><span style="line-height:21px">>> Similarly deleting tap device <wbr>and removing it from bridge <wbr>are not atomic operation.</span><br style="white-space:normal"><span style="line-height:21px">>>The Problem occurs when two <wbr>vms start and shutdown. When <wbr>one vm with the nic</span><br style="white-space:normal"><span style="line-height:21px">>> named "vnet0" stopping, it <wbr>deleted tap device but not <wbr>removing port from bridge.</span><br style="white-space:normal"><span style="line-height:21px">>> At this time, another vm <wbr>created the tap device named "<wbr>vnet0" and added port to the</span><br style="white-space:normal"><span style="line-height:21px">>> same bridge. Then, the first <wbr>vm deleted the tap device <wbr>from the same bridge.</span><br style="white-space:normal"><span style="line-height:21px">>> Finally, the tap device of <wbr>the second vm don't attached <wbr>to the bridge.</span><br style="white-space:normal"><span style="line-height:21px">>> So, we can add domid to vm's <wbr>nic name. For example, the vm'<wbr>s domid is 1 and vnet0</span><br style="white-space:normal"><span style="line-height:21px">>> is renamed to vnet1.0.</span><br style="white-space:normal"><br style="white-space:normal"><span style="line-height:21px">>Surely deleting the NIC <wbr>automatically removes it from <wbr>the bridge so we</span><br style="white-space:normal"><span style="line-height:21px">>can just remove the code <wbr>that delets the bridge port.</span></p></span><p><span style="line-height:21px">i have done some tests for a tap + openvswitch bridge network.  i find  the nic named "vnet0" don't exsit before calling the <wbr>virNetDevOpenvswitchRemovePort<wbr>.</span></p><p><span style="line-height:21px">i think  the tap is deleted not by removingport  from bridge. i think hotpluging net has the same problem.</span></p><p><span style="line-height:21px"><br></span></p><p><span style="line-height:21px">by the way:</span></p><p><span style="line-height:21px">      my company's e-mail  does not support thread posting  and has some other problems. i believe that <span id="m_-7555536877149155405w_11" style="color:rgb(51,51,51);font-family:Arial,STHeiti,宋体,'WenQuanYi Micro Hei',sans-serif;line-height:22px;background-color:rgb(249,249,249)">my colleagues can soon resloved them.</span></span></p><p><br></p><p><br></p><p><br></p><p><br></p><div class="m_-7555536877149155405zMailSign"><div><div><div><div><p style="font-family:宋体;font-size:7.0px;line-height:normal"><span style="font-size:12px;color:#58595b;font-family:微软雅黑;font-size:7.0px"><span class="m_-7555536877149155405signedit"><br></span></span></p><p style="font-family:宋体;font-size:7.0px;line-height:normal"><span style="font-size:12px;color:#58595b;font-family:微软雅黑;font-size:7.0px"><span class="m_-7555536877149155405signedit"><strong style="box-sizing:border-box;color:rgb(255,192,0);font-family:宋体;line-height:normal;white-space:normal;outline:none!important;background-color:rgb(255,255,255)"><span style="box-sizing:border-box;outline:none!important;font-family:微软雅黑;font-size:18px"><span style="box-sizing:border-box;font-family:微软雅黑,'Microsoft YaHei';font-size:20px;line-height:36px;outline:none!important">为了让您的VPlat虚拟化故障得到高效的处理,请上报故障到:<wbr> </span><span style="box-sizing:border-box;font-family:微软雅黑,'Microsoft YaHei';font-size:20px;line-height:17.1420001983643px;outline:none!important">$VPlat技术支持。</span></span></strong></span></span></p><p style="font-family:宋体;font-size:medium;line-height:normal"><span style="font-size:12px;color:#58595b;font-family:微软雅黑"><span class="m_-7555536877149155405signedit" id="m_-7555536877149155405sign_name">芦志朋</span> <span style="font-family:Arial"><span class="m_-7555536877149155405signedit" id="m_-7555536877149155405sign_name_eng">luzhipeng</span></span></span></p><p style="font-size:7.0px;line-height:normal"><span style="font-size:12px;color:#58595b;font-family:微软雅黑;font-size:7.0px"><span><span class="m_-7555536877149155405signedit"><br></span></span></span></p><p style="font-family:宋体;font-size:medium;line-height:normal"><span style="font-size:10px;color:#58595b;font-family:微软雅黑"><span class="m_-7555536877149155405signedit" id="m_-7555536877149155405sign_position">IT开发工程师</span> <span style="font-family:Arial"><span class="m_-7555536877149155405signedit" id="m_-7555536877149155405sign_position_eng">IT Development
Engineer</span></span></span><br><span style="font-size:10px;color:#58595b;font-family:微软雅黑"><span class="m_-7555536877149155405signedit" id="m_-7555536877149155405sign_dept">操作系统产品部/中心研究院/系统产品</span> <span style="font-family:Arial"> <span class="m_-7555536877149155405signedit" id="m_-7555536877149155405sign_dept_eng">OS Product Dept./Central R&D Institute/System Product</span></span></span></p><p style="font-size:7.0px;line-height:normal"><span style="font-size:10px;color:#58595b;font-family:微软雅黑;font-size:7.0px"><span><span class="m_-7555536877149155405signedit"><br></span></span></span></p><p style="font-size:7.0px;line-height:normal"><span style="font-size:10px;color:#58595b;font-family:微软雅黑;font-size:7.0px"></span></p><table style="color:rgb(0,0,0);font-family:宋体"><tbody><tr class="m_-7555536877149155405firstRow"><td width="100" valign="top"><img id="m_-7555536877149155405sign-icon" src="cid:9ae3e214c17d49ed935d87c674ba3ee2" width="130" height="120"></td><td width="500" valign="top"><img id="m_-7555536877149155405sign-logo" src="cid:24242e5637af428891c4db731e7765ad" width="115" height="38"><br><span style="font-size:10px;color:#58595b;font-family:微软雅黑"><span class="m_-7555536877149155405signedit" id="m_-7555536877149155405sign_addr">深圳市南山区科技南路55号中兴通讯研发大楼33楼 </span><br><span style="font-family:Arial"><span class="m_-7555536877149155405signedit" id="m_-7555536877149155405sign_addr_eng_1">33/F, R&D Building, ZTE
Corporation Hi-tech Road South</span>, <br><span class="m_-7555536877149155405signedit" id="m_-7555536877149155405sign_addr_eng_2">Hi-tech
Industrial Park Nanshan District, Shenzhen, P.R.China, 518057</span> <br><span style="color:#008fd4">T</span>: <span class="m_-7555536877149155405signedit" id="m_-7555536877149155405sign_fix_phone">+86 755 xxxxxxxx</span> <span style="color:#008fd4">F</span>:<span class="m_-7555536877149155405signedit" id="m_-7555536877149155405sign_fax">+86 755 xxxxxxxx</span> <br><span style="color:#008fd4">M</span>: <span class="m_-7555536877149155405signedit" id="m_-7555536877149155405sign_phone">+86 xxxxxxxxxxx</span> <br><span style="color:#008fd4">E</span>: <span class="m_-7555536877149155405signedit" id="m_-7555536877149155405sign_email"><a href="mailto:lu.zhipeng@zte.com.cn" target="_blank">lu.zhipeng@zte.com.cn</a></span> <br><span style="color:#008fd4"><a href="http://www.zte.com.cn/" target="_blank">www.zte.com.cn</a></span></span></span></td></tr></tbody></table><span style="line-height:normal;font-size:7.0px;color:#58595b;font-size:10px"></span></div></div></div></div></div><div><div class="m_-7555536877149155405zhistoryRow" style="display:block"><div class="m_-7555536877149155405zhistoryDes" style="width:100%;height:28px;line-height:28px;background-color:#e0e5e9;color:#1388ff;text-align:center">原始邮件</div><div id="m_-7555536877149155405zwriteHistoryContainer"><div class="m_-7555536877149155405control-group m_-7555536877149155405zhistoryPanel"><div class="m_-7555536877149155405zhistoryHeader" style="padding:8px;background-color:#f5f6f8"><div><strong>发件人:</strong><span class="m_-7555536877149155405zreadUserName"> <<a href="mailto:berrange@redhat.com" target="_blank">berrange@redhat.com</a>>;</span></div><div><strong>收件人:</strong><span class="m_-7555536877149155405zreadUserName" style="display:inline-block">芦志朋10108272;</span></div><div><strong>抄送人:</strong><span class="m_-7555536877149155405zreadUserName" style="display:inline-block"> <<a href="mailto:libvir-list@redhat.com" target="_blank">libvir-list@redhat.com</a>>;</span></div><div><strong>日 期 :</strong><span>2017年04月28日 19:27</span></div><div><strong>主 题 :</strong><span class="m_-7555536877149155405zreadTitle"><strong>Re: [libvirt] [PATCH] qemu: change the name of tap device for a tapand bridge network</strong></span></div></div><p class="m_-7555536877149155405zhistoryContent"><br></p><div><span class="">On Fri, Apr 28, 2017 at 05:23:<wbr>19PM +0800, ZhiPeng Lu wrote:<br>> Creating tap device and <wbr>adding the device to bridge <wbr>are not atomic operation.<br>> Similarly deleting tap <wbr>device and removing it from <wbr>bridge are not atomic <wbr>operation.<br>> The Problem occurs when two <wbr>vms start and shutdown. When <wbr>one vm with the nic<br>> named "vnet0" stopping, it <wbr>deleted tap device but not <wbr>removing port from bridge.<br>> At this time, another vm <wbr>created the tap device named "<wbr>vnet0" and added port to the<br>> same bridge. Then, the <wbr>first vm deleted the tap <wbr>device from the same bridge.<br>> Finally, the tap device of <wbr>the second vm don't attached <wbr>to the bridge.<br>> So, we can add domid to vm'<wbr>s nic name. For example, the <wbr>vm's domid is 1 and vnet0<br>> is renamed to vnet1.0.<br><br>Surely deleting the NIC <wbr>automatically removes it from <wbr>the bridge so we<br>can just remove the code that <wbr>delets the bridge port.<br><br><br></span><span class="">Regards,<br>Daniel<br>-- <br>|: <a href="https://berrange.com" target="_blank">https://berrange.com</a>      -<wbr>o-    <a href="https://www.flickr.com/photos/dberrange" target="_blank">https://www.flickr.com/<wbr>photos/dberrange</a> :|<br>|: <a href="https://libvirt.org" target="_blank">https://libvirt.org</a>        <wbr> -o-            <a href="https://fstop138.berrange.com" target="_blank">https://<wbr>fstop138.berrange.com</a> :|<br>|: <a href="https://entangle-photo.org" target="_blank">https://entangle-photo.org</a> <wbr>   -o-    <a href="https://www.instagram.com/dberrange" target="_blank">https://www.<wbr>instagram.com/dberrange</a> :|<br><br></span><span class="">--<br>libvir-list mailing list<br><a href="mailto:libvir-list@redhat.com" target="_blank">libvir-list@redhat.com</a><br><a href="https://www.redhat.com/mailman/listinfo/libvir-list" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/libvir-list</a><br></span></div><p><br></p></div></div></div></div><p><br></p> </div><br>--<br>
libvir-list mailing list<br>
<a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libvir-list" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/libvir-list</a><br></blockquote></div><br></div>