Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos
Commits
27baa9d4
Commit
27baa9d4
authored
Feb 05, 2015
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use -netdev to configure network interface as -net is obsolete now
parent
5e643d9e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
slapos/recipe/kvm/template/kvm_run.in
slapos/recipe/kvm/template/kvm_run.in
+13
-6
No files found.
slapos/recipe/kvm/template/kvm_run.in
View file @
27baa9d4
...
...
@@ -102,12 +102,19 @@ if not os.path.exists(disk_path):
# XXX: use_tap should be a boolean
tap_network_parameter = []
nat_network_parameter = []
if use_tap == 'True':
tap_network_parameter = ['-net', 'nic,macaddr=%%s' %% tap_mac_address, '-net',
'tap,ifname=%%s,script=no,downscript=no' %% tap_interface]
number = -1
if use_nat == 'True':
rules = 'user,' + ','.join('hostfwd=tcp:%%s:%%s-:%%s' %% (listen_ip, int(port) + 10000, port) for port in nat_rules.split())
nat_network_parameter = ['-net', 'nic,macaddr=%%s' %% mac_address, '-net', rules]
number += 1
rules = 'user,id=lan%%s,' %% number + ','.join('hostfwd=tcp:%%s:%%s-:%%s' %% (listen_ip,
int(port) + 10000, port) for port in nat_rules.split())
nat_network_parameter = ['-netdev', rules,
'-device', 'e1000,netdev=lan%%s,mac=%%s' %% (number, mac_address)]
if use_tap == 'True':
number += 1
tap_network_parameter = ['-netdev',
'tap,id=lan%%s,ifname=%%s,script=no,downscript=no' %% (number,
tap_interface),
'-device', 'e1000,netdev=lan%%s,mac=%%s' %% (number, tap_mac_address)]
kvm_argument_list = [qemu_path,
'-enable-kvm', '-smp', smp_count,
...
...
@@ -121,7 +128,7 @@ kvm_argument_list = [qemu_path,
if tap_network_parameter == [] and nat_network_parameter == []:
print 'Warning : No network interface defined.'
else:
kvm_argument_list +=
tap_network_parameter + nat
_network_parameter
kvm_argument_list +=
nat_network_parameter + tap
_network_parameter
# Try to connect to NBD server (and second nbd if defined).
# If not available, don't even specify it in qemu command line parameters.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment