automatically add bridge venet0 when needed

The chosen architecture to deal with --ipadd with upstream containers is to
create a veth pair and add the host side information to a bridge called venet0.
This way, all the code that expects venet0 to exist can still work without
modifications, (or with just a few).

Our intention to do that was actually already stated in the comments, but the
code was removed before merging because --ipadd would not work without full
unshare support anyway.

This patch implements that.

[kir@: fix bashisms and indentations]

Signed-off-by: Glauber Costa <glommer@parallels.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
2 files changed