mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-13 01:20:58 +00:00
Merge branch 'master' into asyncio
Conflicts: gns3server/old_modules/qemu/qemu_vm.py gns3server/version.py
This commit is contained in:
commit
db31afeb63
@ -1003,13 +1003,13 @@ class QemuVM(object):
|
|||||||
nio.rport,
|
nio.rport,
|
||||||
nio.rhost))
|
nio.rhost))
|
||||||
else:
|
else:
|
||||||
self._control_vm("host_net_remove {} gns3-{}".format(adapter_id, adapter_id))
|
#FIXME: does it work? very undocumented feature...
|
||||||
self._control_vm("host_net_add socket vlan={},name=gns3-{},udp={}:{},localaddr={}:{}".format(adapter_id,
|
self._control_vm("netdev_del gns3-{}".format(adapter_id))
|
||||||
adapter_id,
|
self._control_vm("netdev_add socket,id=gns3-{},udp={}:{},localaddr={}:{}".format(adapter_id,
|
||||||
nio.rhost,
|
nio.rhost,
|
||||||
nio.rport,
|
nio.rport,
|
||||||
self._host,
|
self._host,
|
||||||
nio.lport))
|
nio.lport))
|
||||||
|
|
||||||
adapter.add_nio(0, nio)
|
adapter.add_nio(0, nio)
|
||||||
log.info("QEMU VM {name} [id={id}]: {nio} added to adapter {adapter_id}".format(name=self._name,
|
log.info("QEMU VM {name} [id={id}]: {nio} added to adapter {adapter_id}".format(name=self._name,
|
||||||
@ -1034,8 +1034,13 @@ class QemuVM(object):
|
|||||||
|
|
||||||
if self.is_running():
|
if self.is_running():
|
||||||
# dynamically disable the QEMU VM adapter
|
# dynamically disable the QEMU VM adapter
|
||||||
self._control_vm("host_net_remove {} gns3-{}".format(adapter_id, adapter_id))
|
if self._legacy_networking:
|
||||||
self._control_vm("host_net_add user vlan={},name=gns3-{}".format(adapter_id, adapter_id))
|
self._control_vm("host_net_remove {} gns3-{}".format(adapter_id, adapter_id))
|
||||||
|
self._control_vm("host_net_add user vlan={},name=gns3-{}".format(adapter_id, adapter_id))
|
||||||
|
else:
|
||||||
|
#FIXME: does it work? very undocumented feature...
|
||||||
|
self._control_vm("netdev_del gns3-{}".format(adapter_id))
|
||||||
|
self._control_vm("netdev_add user,id=gns3-{}".format(adapter_id))
|
||||||
|
|
||||||
nio = adapter.get_nio(0)
|
nio = adapter.get_nio(0)
|
||||||
adapter.remove_nio(0)
|
adapter.remove_nio(0)
|
||||||
@ -1191,7 +1196,11 @@ class QemuVM(object):
|
|||||||
for adapter in self._ethernet_adapters:
|
for adapter in self._ethernet_adapters:
|
||||||
# TODO: let users specify a base mac address
|
# TODO: let users specify a base mac address
|
||||||
mac = "00:00:ab:%02x:%02x:%02d" % (random.randint(0x00, 0xff), random.randint(0x00, 0xff), adapter_id)
|
mac = "00:00:ab:%02x:%02x:%02d" % (random.randint(0x00, 0xff), random.randint(0x00, 0xff), adapter_id)
|
||||||
network_options.extend(["-net", "nic,vlan={},macaddr={},model={}".format(adapter_id, mac, self._adapter_type)])
|
if self._legacy_networking:
|
||||||
|
network_options.extend(["-net", "nic,vlan={},macaddr={},model={}".format(adapter_id, mac, self._adapter_type)])
|
||||||
|
else:
|
||||||
|
network_options.extend(["-device", "{},mac={},netdev=gns3-{}".format(self._adapter_type, mac, adapter_id)])
|
||||||
|
|
||||||
nio = adapter.get_nio(0)
|
nio = adapter.get_nio(0)
|
||||||
if nio and isinstance(nio, NIO_UDP):
|
if nio and isinstance(nio, NIO_UDP):
|
||||||
if self._legacy_networking:
|
if self._legacy_networking:
|
||||||
@ -1201,14 +1210,25 @@ class QemuVM(object):
|
|||||||
nio.rport,
|
nio.rport,
|
||||||
nio.rhost)])
|
nio.rhost)])
|
||||||
else:
|
else:
|
||||||
|
<<<<<<< HEAD:gns3server/old_modules/qemu/qemu_vm.py
|
||||||
network_options.extend(["-net", "socket,vlan={},name=gns3-{},udp={}:{},localaddr={}:{}".format(adapter_id,
|
network_options.extend(["-net", "socket,vlan={},name=gns3-{},udp={}:{},localaddr={}:{}".format(adapter_id,
|
||||||
adapter_id,
|
adapter_id,
|
||||||
nio.rhost,
|
nio.rhost,
|
||||||
nio.rport,
|
nio.rport,
|
||||||
self._host,
|
self._host,
|
||||||
nio.lport)])
|
nio.lport)])
|
||||||
|
=======
|
||||||
|
network_options.extend(["-netdev", "socket,id=gns3-{},udp={}:{},localaddr={}:{}".format(adapter_id,
|
||||||
|
nio.rhost,
|
||||||
|
nio.rport,
|
||||||
|
self._host,
|
||||||
|
nio.lport)])
|
||||||
|
>>>>>>> master:gns3server/modules/qemu/qemu_vm.py
|
||||||
else:
|
else:
|
||||||
network_options.extend(["-net", "user,vlan={},name=gns3-{}".format(adapter_id, adapter_id)])
|
if self._legacy_networking:
|
||||||
|
network_options.extend(["-net", "user,vlan={},name=gns3-{}".format(adapter_id, adapter_id)])
|
||||||
|
else:
|
||||||
|
network_options.extend(["-netdev", "user,id=gns3-{}".format(adapter_id)])
|
||||||
adapter_id += 1
|
adapter_id += 1
|
||||||
|
|
||||||
return network_options
|
return network_options
|
||||||
|
Loading…
Reference in New Issue
Block a user