<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 08/29/2016 03:37 AM, Marina Danial
wrote:<br>
</div>
<blockquote
cite="mid:CANy6WtNUOR2foj3VH_17_of+ujdXDH49OTefK_7ngAcWp66Yjw@mail.gmail.com"
type="cite">
<div dir="ltr">Hello,
<div><br>
</div>
<div>I am facing the following issue. </div>
<div><br>
</div>
<div>I have several TAP interfaces that are created by the
following method on OpenVSwitch: </div>
<div><br>
</div>
<div>
<div><i><br>
</i></div>
<div><i>ovs-vsctl add-br br1<br>
</i></div>
<div><i><br>
</i></div>
<div><i>sudo /usr/sbin/tunctl -t tap01 -p -u root</i></div>
<div><i><br>
</i></div>
<div><i>sudo /sbin/ip link set tap01 up<br>
</i></div>
<div><i><br>
</i></div>
<div><i># Disable multicast</i></div>
<div><i>sudo /sbin/ifconfig tap01 -multicast</i></div>
<div><i><br>
</i></div>
<div><i>ovs-vsctl add-port br1 tap01</i></div>
</div>
</div>
</blockquote>
<br>
<br>
Aside from the part about disabling multicast, this is all handled
(including creation of the tap device, and destroying it when the
guest is terminated) by libvirt's <interface type='bridge'>
with a <virtualport type='openvswitch'> subelement. This page
has more details and an example:<br>
<br>
<a class="moz-txt-link-freetext" href="http://www.libvirt.org/formatdomain.html#elementsNICSBridge">http://www.libvirt.org/formatdomain.html#elementsNICSBridge</a><br>
<br>
As far as turning off multicast, this is the first time I've seen
anyone request that. Unfortunately the network hooks
(<a class="moz-txt-link-freetext" href="https://www.libvirt.org/hooks.html">https://www.libvirt.org/hooks.html</a> ) that are run for each
interface happen prior to the creation of the tap devices, so you
can't just add a network hook script to do it. If you *really* need
multicast disabled, with current libvirt you would need to add a
*qemu* hook script that looked for the tap device name in the
guest's xml and set -multicast, or you would need to use
"<interface type='ethernet'> (which just creates a tap device,
then calls a script to "connect it to the network") with a
"<script path='some script that sets -multicast *and* adds the
tap to the ovs bridge'/>". type='ethernet' and its script are
also described a bit further down in the same link I posted above.<br>
<br>
<br>
<br>
<blockquote
cite="mid:CANy6WtNUOR2foj3VH_17_of+ujdXDH49OTefK_7ngAcWp66Yjw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><i><br>
</i></div>
<div><i><br>
</i></div>
<div><i><br>
</i></div>
<div><i><br>
</i></div>
<div><br>
</div>
<div>I need to launch a qemu VMs and have its NIC card that is
created using libvirt to be connected to tap01 or other taps
that are created with the above method. </div>
<div><br>
</div>
<div>I need a way that libvirt only creates the new NIC on
either eth0 or eht1 on the guest machine and connect it to
tap01.</div>
<div><br>
</div>
<div>Please help me in the best way to do so whether using the
C++ APIs that libvirt provides or use the domain and/or
network XMLs to achieve this.</div>
<div><br>
</div>
<div><br>
</div>
<div>Thanks a lot</div>
<div>Marina</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
libvirt-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/libvirt-users">https://www.redhat.com/mailman/listinfo/libvirt-users</a></pre>
</blockquote>
<p><br>
</p>
</body>
</html>