lxd/container_lxc.go
func (c *containerLXC) setupHostVethDevice(device types.Device) error {
	// If not already, populate network device with host name.
	if device["host_name"] == "" {
		device["host_name"] = c.getHostInterface(device["name"])
	}

	// Check whether host device resolution succeeded.
	if device["host_name"] == "" {
		return fmt.Errorf("LXC doesn't know about this device and the host_name property isn't set, can't find host side veth name")
	}

	// Refresh tc limits
	err := c.setNetworkLimits(device)
	if err != nil {
		return err
	}

	// Setup static routes to container
	err = c.setNetworkRoutes(device)
	if err != nil {
		return err
	}

	return nil
}
func (c *containerLXC) setupHostVethDevice(device types.Device) error {
	// If not already, populate network device with host name.
	if device["host_name"] == "" {
		device["host_name"] = c.getHostInterface(device["name"])
	}

	// Check whether host device resolution succeeded.
	if device["host_name"] == "" {
		return fmt.Errorf("LXC doesn't know about this device and the host_name property isn't set, can't find host side veth name")
	}

	// Refresh tc limits
	err := c.setNetworkLimits(device)
	if err != nil {
		return err
	}

	// Setup static routes to container
	err = c.setNetworkRoutes(device)
	if err != nil {
		return err
	}

	return nil
}
// setupHostVethDevice configures a nic device's host side veth settings.