network: allow lxc_network_move_by_index() rename netdev in moving.

In netlink, we can set the dest_name of netdev when move netdev
between namespaces in one netlink request. And moving a netdev of
a src_name to a netdev with a dest_name is a common usecase.

So this patch add a parametaer to lxc_network_move_by_index() to
indicate the dest_name for the movement. NULL means same with
the src_name.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
network: introduce a interface named lxc_netdev_isup().

When we need to know some info about a netdev, such as is_up or not,
we need to read the flag for the netdev.

This patch introduce a interface function named lxc_netdev_isup()
to check is a netdev up or down.

And introduce a network private function named netdev_get_flag()
to get flag for netdev by netlink.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
container: introduce two functions named as {at/de}tach_interface().

Currently, we depends on ip command to attach interface to container.
It means we only implemented it by python.

This patch implement adding and removing interface by c and added
them in struct container.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
python-lxc: Add [at|de]tach_interface() to python binding.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
detach

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
fix

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
detach

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
utils: move useful helper functions from lxccontainer to utils.

Function of enter_to_ns() is useful but currently is static for
lxccontainer.c.

This patch split it into two parts named as switch_to_newuser()
and switch_to_newnet() into utils.c.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
lxc-device: rewrite lxc-device by c.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>