Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nova/network/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def ensure_string_keys(d):
# class
VIF_DETAILS_PORT_FILTER = 'port_filter'
VIF_DETAILS_OVS_HYBRID_PLUG = 'ovs_hybrid_plug'
VIF_DETAILS_VHOSTUSER_VROUTER_PLUG = 'vhostuser_vrouter_plug'
VIF_DETAILS_PHYSICAL_NETWORK = 'physical_network'
VIF_DETAILS_BRIDGE_NAME = 'bridge_name'

Expand Down
16 changes: 15 additions & 1 deletion nova/network/os_vif_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,21 @@ def _nova_to_osvif_vif_midonet(vif):

# VIF_TYPE_VHOSTUSER = 'vhostuser'
def _nova_to_osvif_vif_vhostuser(vif):
raise NotImplementedError()
if vif['details'].get(model.VIF_DETAILS_VHOSTUSER_VROUTER_PLUG, False):
vif_details = vif['details']
mode = vif_details.get(model.VIF_DETAILS_VHOSTUSER_MODE,
'server')
sock_path = vif_details.get(model.VIF_DETAILS_VHOSTUSER_SOCKET)
if sock_path is None:
raise exception.VifDetailsMissingVhostuserSockPath(
vif_id=vif['id'])
obj = _get_vif_instance(vif, objects.vif.VIFVHostUser,
mode=mode,
path=sock_path,
plugin="vrouter", vif_name=_get_vif_name(vif))
return obj
else:
raise NotImplementedError()


# VIF_TYPE_VROUTER = 'vrouter'
Expand Down
4 changes: 4 additions & 0 deletions nova/virt/libvirt/vif.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from os_vif import exception as osv_exception
from oslo_concurrency import processutils
from oslo_log import log as logging
from oslo_config import cfg

import nova.conf
from nova import exception
Expand Down Expand Up @@ -445,6 +446,9 @@ def get_config_vrouter(self, instance, vif, image_meta,
designer.set_vif_bandwidth_config(conf, inst_type)
return conf

def _set_config_VIFVHostUser(self, instance, vif, conf):
designer.set_vif_host_backend_vhostuser_config(conf, vif.mode, vif.path)

def _set_config_VIFBridge(self, instance, vif, conf):
conf.net_type = "bridge"
conf.source_dev = vif.bridge_name
Expand Down