X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=host_thread.py;h=d8bca2e2e1ca13d091a34566d29610672f520cb8;hb=f9a1a8d51e7525f0d4acfe02dcb7fb8696fc20b0;hp=e971ff23930cf591b28c538ed86e7a1b6b38ddf4;hpb=9ba00b54d9d2d6e4da72c272082f9c7011468060;p=osm%2Fopenvim.git diff --git a/host_thread.py b/host_thread.py index e971ff2..d8bca2e 100644 --- a/host_thread.py +++ b/host_thread.py @@ -501,8 +501,12 @@ class host_thread(threading.Thread): self.tab()+'' +\ self.tab()+''+ \ self.dec_tab() +'' - if windows_os or topo=="oneSocket": - text += self.tab() + " "% vcpus + if topo == "oneSocket:hyperthreading": + if vcpus % 2 != 0: + return -1, 'Cannot expose hyperthreading with an odd number of vcpus' + text += self.tab() + " " % vcpus/2 + elif windows_os or topo == "oneSocket": + text += self.tab() + " " % vcpus else: text += self.tab() + "" text += self.tab() + "" +\ @@ -1027,7 +1031,7 @@ class host_thread(threading.Thread): else: return False - def launch_dhcp_server(self, vlan, ip_range, netmask, dhcp_path): + def launch_dhcp_server(self, vlan, ip_range, netmask, dhcp_path, gateway): """ Generate a linux bridge and attache the port to a OVS bridge :param self: @@ -1035,6 +1039,7 @@ class host_thread(threading.Thread): :param ip_range: IP dhcp range :param netmask: network netmask :param dhcp_path: dhcp conf file path that live in namespace side + :param gateway: Gateway address for dhcp net :return: True if success """ @@ -1069,7 +1074,8 @@ class host_thread(threading.Thread): if not content: command = 'sudo ip netns exec ' + net_namespace + ' /usr/sbin/dnsmasq --strict-order --except-interface=lo ' \ '--interface=' + interface + ' --bind-interfaces --dhcp-hostsdir=' + dhcp_path + \ - ' --dhcp-range ' + dhcp_range + ' --pid-file=' + pid_file + ' --dhcp-leasefile=' + leases_path + ' --listen-address ' + ip_range[0] + ' --dhcp-range ' + dhcp_range + ' --pid-file=' + pid_file + ' --dhcp-leasefile=' + leases_path + \ + ' --listen-address ' + gateway print self.name, ': command:', command (_, stdout, _) = self.ssh_conn.exec_command(command)