<div class="zcontentRow"> <p><br></p><p><span style="line-height: 21px;">>On Fri, Apr 28, 2017 at 05:23:19PM +0800, ZhiPeng Lu wrote:</span><br style="white-space: normal;"><span style="line-height: 21px;">>> Creating tap device and adding the device to bridge are not atomic operation.</span><br style="white-space: normal;"><span style="line-height: 21px;">>> Similarly deleting tap device and removing it from bridge are not atomic operation.</span><br style="white-space: normal;"><span style="line-height: 21px;">>>The Problem occurs when two vms start and shutdown. When one vm with the nic</span><br style="white-space: normal;"><span style="line-height: 21px;">>> named "vnet0" stopping, it deleted tap device but not removing port from bridge.</span><br style="white-space: normal;"><span style="line-height: 21px;">>> At this time, another vm created the tap device named "vnet0" and added port to the</span><br style="white-space: normal;"><span style="line-height: 21px;">>> same bridge. Then, the first vm deleted the tap device from the same bridge.</span><br style="white-space: normal;"><span style="line-height: 21px;">>> Finally, the tap device of the second vm don't attached to the bridge.</span><br style="white-space: normal;"><span style="line-height: 21px;">>> So, we can add domid to vm's nic name. For example, the vm'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 automatically removes it from the bridge so we</span><br style="white-space: normal;"><span style="line-height: 21px;">>can just remove the code that delets the bridge port.</span></p><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 virNetDevOpenvswitchRemovePort.</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="w_11" high-light-id="w_2,w_11" class="" 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="zMailSign"><div><div><div><div><p style="font-family: 宋体; font-size: 7.0px; line-height: normal; widows: 1;"><span style="font-size:12px;color:#58595B;font-family:微软雅黑;font-size: 7.0px;"><span class="signedit"><br></span></span></p><p style="font-family: 宋体; font-size: 7.0px; line-height: normal; widows: 1;"><span style="font-size:12px;color:#58595B;font-family:微软雅黑;font-size: 7.0px;"><span class="signedit"><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虚拟化故障得到高效的处理,请上报故障到: </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; widows: 1;"><span style="font-size:12px;color:#58595B;font-family:微软雅黑"><span class="signedit" id="sign_name">芦志朋</span> <span style="font-family:Arial"><span class="signedit" id="sign_name_eng">luzhipeng</span></span></span></p><p style="font-size: 7.0px; line-height: normal; widows: 1;"><span style="font-size:12px;color:#58595B;font-family:微软雅黑;font-size: 7.0px;"><span style=""><span class="signedit"><br></span></span></span></p><p style="font-family: 宋体; font-size: medium; line-height: normal; widows: 1;"><span style="font-size:10px;color:#58595B;font-family:微软雅黑"><span class="signedit" id="sign_position">IT开发工程师</span> <span style="font-family:Arial"><span class="signedit" id="sign_position_eng">IT Development
Engineer</span></span></span><br><span style="font-size:10px;color:#58595B;font-family:微软雅黑"><span class="signedit" id="sign_dept">操作系统产品部/中心研究院/系统产品</span> <span style="font-family:Arial"> <span class="signedit" id="sign_dept_eng">OS Product Dept./Central R&D Institute/System Product</span></span></span></p><p style="font-size: 7.0px; line-height: normal; widows: 1;"><span style="font-size:10px;color:#58595B;font-family:微软雅黑;font-size: 7.0px;"><span style=""><span class="signedit"><br></span></span></span></p><p style="font-size: 7.0px; line-height: normal; widows: 1;"><span style="font-size:10px;color:#58595B;font-family:微软雅黑;font-size: 7.0px;"></span></p><table style="color: rgb(0, 0, 0); font-family: 宋体; widows: 1;"><tbody><tr class="firstRow"><td valign="top" width="100"><img id="sign-icon" src="cid:9ae3e214c17d49ed935d87c674ba3ee2" width="130" height="120"></td><td valign="top" width="500"><img id="sign-logo" src="cid:24242e5637af428891c4db731e7765ad" width="115" height="38"><br><span style="font-size:10px;color:#58595B;font-family:微软雅黑"><span class="signedit" id="sign_addr">深圳市南山区科技南路55号中兴通讯研发大楼33楼 </span><br><span style="font-family:Arial"><span class="signedit" id="sign_addr_eng_1">33/F, R&D Building, ZTE
Corporation Hi-tech Road South</span>, <br><span class="signedit" id="sign_addr_eng_2">Hi-tech
Industrial Park Nanshan District, Shenzhen, P.R.China, 518057</span> <br><span style="color:#008FD4">T</span>: <span class="signedit" id="sign_fix_phone">+86 755 xxxxxxxx</span> <span style="color:#008FD4">F</span>:<span class="signedit" id="sign_fax">+86 755 xxxxxxxx</span> <br><span style="color:#008FD4">M</span>: <span class="signedit" id="sign_phone">+86 xxxxxxxxxxx</span> <br><span style="color:#008FD4">E</span>: <span class="signedit" id="sign_email">lu.zhipeng@zte.com.cn</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; widows: 1; font-size: 7.0px;;color:#58595b;font-size:10px"></span></div></div></div></div></div><div><div class="zhistoryRow" style="display:block"><div class="zhistoryDes" style="width: 100%; height: 28px; line-height: 28px; background-color: #E0E5E9; color: #1388FF; text-align: center;" language-data="HistoryOrgTxt">原始邮件</div><div id="zwriteHistoryContainer"><div class="control-group zhistoryPanel"><div class="zhistoryHeader" style="padding: 8px; background-color: #F5F6F8;"><div><strong language-data="HistorySenderTxt">发件人:</strong><span class="zreadUserName"> <berrange@redhat.com>;</span></div><div><strong language-data="HistoryTOTxt">收件人:</strong><span class="zreadUserName" style="display: inline-block;">芦志朋10108272;</span></div><div><strong language-data="HistoryCCTxt">抄送人:</strong><span class="zreadUserName" style="display: inline-block;"> <libvir-list@redhat.com>;</span></div><div><strong language-data="HistoryDateTxt">日 期 :</strong><span class="">2017年04月28日 19:27</span></div><div><strong language-data="HistorySubjectTxt">主 题 :</strong><span class="zreadTitle"><strong>Re: [libvirt] [PATCH] qemu: change the name of tap device for a tapand bridge network</strong></span></div></div><p class="zhistoryContent"><br></p><div>On Fri, Apr 28, 2017 at 05:23:19PM +0800, ZhiPeng Lu wrote:<br>> Creating tap device and adding the device to bridge are not atomic operation.<br>> Similarly deleting tap device and removing it from bridge are not atomic operation.<br>> The Problem occurs when two vms start and shutdown. When one vm with the nic<br>> named "vnet0" stopping, it deleted tap device but not removing port from bridge.<br>> At this time, another vm created the tap device named "vnet0" and added port to the<br>> same bridge. Then, the first vm deleted the tap device from the same bridge.<br>> Finally, the tap device of the second vm don't attached to the bridge.<br>> So, we can add domid to vm's nic name. For example, the vm's domid is 1 and vnet0<br>> is renamed to vnet1.0.<br><br>Surely deleting the NIC automatically removes it from the bridge so we<br>can just remove the code that delets the bridge port.<br><br><br>Regards,<br>Daniel<br>-- <br>|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|<br>|: https://libvirt.org         -o-            https://fstop138.berrange.com :|<br>|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|<br><br>--<br>libvir-list mailing list<br>libvir-list@redhat.com<br>https://www.redhat.com/mailman/listinfo/libvir-list<br></div><p><br></p></div></div></div></div><p><br></p> </div>