Added a function Set-VMNetworkAdapterOVSPortDirect() to be called from NOVA driver to set a name on the port of the first VNIC for the specified VM.
Usage example: Set-VMNetworkAdapterOVSPortDirect -OVSPortName ovs-port-5 -VMName NoOS To confirm that the name was set: Get-VMNetworkAdapterByOVSPort -OVSPortName ovs-port-5 Signed-off-by: Eitan Eliahu <[email protected]> Acked-by: Ankur Sharma <[email protected]> Acked-by: Nithin Raju <[email protected]> --- datapath-windows/misc/OVS.psm1 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/datapath-windows/misc/OVS.psm1 b/datapath-windows/misc/OVS.psm1 index cec41a6..617f025 100644 --- a/datapath-windows/misc/OVS.psm1 +++ b/datapath-windows/misc/OVS.psm1 @@ -152,3 +152,29 @@ function Check-WMIReturnValue($retVal) } } } + +function Set-VMNetworkAdapterOVSPortDirect +{ + [CmdletBinding()] + param + ( + [parameter(Mandatory=$true)] + [ValidateLength(1, 1024)] + [string]$vmName, + + [parameter(Mandatory=$true)] + [ValidateLength(1, 48)] + [string]$OVSPortName + ) + process + { + $vnic = 0 + + if ($vmName) + { + $vnic = Get-VMNetworkAdapter -VMName $vmName + } + # XXX the vnic index should be provided by the caller + $vnic[0] | Set-VMNetworkAdapterOVSPort -OVSPortName $OVSPortName + } +} -- 1.9.4.msysgit.0 _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
