<br><tt><font size=2>Ed Swierk <eswierk@aristanetworks.com> wrote
on 02/15/2010 11:15:11 PM:<br>
<br>
</font></tt>
<br><tt><font size=2>> <br>
> On Mon, Feb 15, 2010 at 4:39 PM, Stefan Berger <stefanb@us.ibm.com>
wrote:<br>
> > This patch fixes the problem with the tear down of the macvtap
device<br>
> > when issuing a 'virsh destroy' by moving the tear down block
past the<br>
> > point of killing the Qemu process. It seems necessary to loop
at least<br>
> > once in the case of 'virsh destory' since the device seems to
be busy<br>
> > for a while after the Qemu process has been killed. This also
still<br>
> > properly tears down the macvtap device when the VM is 'virsh
shutdown'ed<br>
> > or halted from inside.<br>
> <br>
> I think it's fine to check just once, before replacing an existing<br>
> macvtap interface with a new one, that the existing interface's fd
can<br>
> be opened, to avoid stomping on an interface owned by someone else.<br>
> <br>
> On shutdown, I think it's safe to assume that an interface whose name,<br>
> macaddr and type matches is in fact the interface it created. I think<br>
> it should just go ahead and delete it without again trying to open
the<br>
> fd. Otherwise we end up with such annoying races, e.g. if qemu hangs<br>
> or takes a long time to shut down, you end up leaving the orphaned<br>
> interfaces sitting around as well as the hung qemu process.<br>
> </font></tt>
<br>
<br><tt><font size=2>As an RFC, now attached the patch that tears down
the macvtap device upon</font></tt>
<br><tt><font size=2>termination of the Qemu process without checking whether
the device(s)</font></tt>
<br><tt><font size=2>with the given MAC address are in use.</font></tt>
<br>
<br><tt><font size=2>Signed-off-by: Stefan Berger <stefanb@us.ibm.com></font></tt>
<br>
<br>
<br><tt><font size=2><br>
> --Ed<br>
</font></tt>