1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Moves KVM setting to Qemu server preferences. Fixes #244.

This commit is contained in:
grossmj 2015-06-24 22:47:30 -06:00
parent f20ee06181
commit ed95bcee97
2 changed files with 2 additions and 42 deletions

View File

@ -99,7 +99,6 @@ class QemuVM(BaseVM):
self._kernel_image = ""
self._kernel_command_line = ""
self._legacy_networking = False
self._kvm = True
self._acpi_shutdown = False
self._cpu_throttling = 0 # means no CPU throttling
self._process_priority = "low"
@ -393,30 +392,6 @@ class QemuVM(BaseVM):
log.info('QEMU VM "{name}" [{id}] has disabled ACPI shutdown'.format(name=self._name, id=self._id))
self._acpi_shutdown = acpi_shutdown
@property
def kvm(self):
"""
Returns either this QEMU VM uses KVM acceleration.
:returns: boolean
"""
return self._kvm
@kvm.setter
def kvm(self, kvm):
"""
Sets either this QEMU VM uses KVM acceleration.
:param kvm: boolean
"""
if kvm:
log.info('QEMU VM "{name}" [{id}] has enabled KVM acceleration'.format(name=self._name, id=self._id))
else:
log.info('QEMU VM "{name}" [{id}] has disabled KVM acceleration'.format(name=self._name, id=self._id))
self._kvm = kvm
@property
def cpu_throttling(self):
"""
@ -508,9 +483,6 @@ class QemuVM(BaseVM):
log.info('QEMU VM "{name}" [{id}] has set the QEMU options to {options}'.format(name=self._name,
id=self._id,
options=options))
if "-enable-kvm" in options:
self.kvm = True
options = options.replace("-enable-kvm", "")
self._options = options.strip()
@ -1230,7 +1202,7 @@ class QemuVM(BaseVM):
command = [self.qemu_path]
command.extend(["-name", self._name])
command.extend(["-m", str(self._ram)])
if sys.platform.startswith("linux") and self._kvm:
if sys.platform.startswith("linux") and self.manager.config.get_section_config("Qemu").getboolean("enable_kvm", True):
command.extend(["-enable-kvm"])
disk_options = yield from self._disk_options()
command.extend(disk_options)

View File

@ -138,10 +138,6 @@ QEMU_CREATE_SCHEMA = {
"description": "ACPI shutdown support",
"type": ["boolean", "null"],
},
"kvm": {
"description": "KVM support",
"type": ["boolean", "null"],
},
"cpu_throttling": {
"description": "Percentage of CPU allowed for QEMU",
"minimum": 0,
@ -277,10 +273,6 @@ QEMU_UPDATE_SCHEMA = {
"description": "ACPI shutdown support",
"type": ["boolean", "null"],
},
"kvm": {
"description": "KVM support",
"type": ["boolean", "null"],
},
"cpu_throttling": {
"description": "Percentage of CPU allowed for QEMU",
"minimum": 0,
@ -425,10 +417,6 @@ QEMU_OBJECT_SCHEMA = {
"description": "ACPI shutdown support",
"type": "boolean",
},
"kvm": {
"description": "KVM support",
"type": ["boolean", "null"],
},
"cpu_throttling": {
"description": "Percentage of CPU allowed for QEMU",
"minimum": 0,
@ -454,7 +442,7 @@ QEMU_OBJECT_SCHEMA = {
"hdc_disk_image", "hdd_disk_image", "hda_disk_image_md5sum", "hdb_disk_image_md5sum",
"hdc_disk_image_md5sum", "hdd_disk_image_md5sum", "ram", "adapters", "adapter_type", "mac_address",
"console", "initrd", "kernel_image", "initrd_md5sum", "kernel_image_md5sum", "kernel_command_line",
"legacy_networking", "acpi_shutdown", "kvm", "cpu_throttling", "process_priority", "options"]
"legacy_networking", "acpi_shutdown", "cpu_throttling", "process_priority", "options"]
}
QEMU_BINARY_LIST_SCHEMA = {