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

Fix Virtualbox support

This commit is contained in:
Julien Duponchelle 2016-07-12 16:22:55 +02:00
parent 9cd3231de3
commit b98d4cb042
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8
3 changed files with 7 additions and 62 deletions

View File

@ -86,7 +86,8 @@ class VirtualBoxVM(BaseNode):
"adapter_type": self.adapter_type,
"ram": self.ram,
"status": self.status,
"use_any_adapter": self.use_any_adapter}
"use_any_adapter": self.use_any_adapter,
"linked_clone": self._linked_clone}
if self._linked_clone:
json["node_directory"] = self.working_dir
else:

View File

@ -26,7 +26,6 @@ from gns3server.compute.project_manager import ProjectManager
from gns3server.schemas.virtualbox import (
VBOX_CREATE_SCHEMA,
VBOX_UPDATE_SCHEMA,
VBOX_OBJECT_SCHEMA
)
@ -109,7 +108,7 @@ class VirtualBoxHandler:
409: "Conflict"
},
description="Update a VirtualBox VM instance",
input=VBOX_UPDATE_SCHEMA,
input=VBOX_OBJECT_SCHEMA,
output=VBOX_OBJECT_SCHEMA)
def update(request, response):

View File

@ -89,64 +89,6 @@ VBOX_CREATE_SCHEMA = {
"required": ["name", "vmname", "linked_clone"],
}
VBOX_UPDATE_SCHEMA = {
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Request validation to update a VirtualBox VM instance",
"type": "object",
"properties": {
"name": {
"description": "VirtualBox VM instance name",
"type": "string",
"minLength": 1,
},
"vmname": {
"description": "VirtualBox VM name (in VirtualBox itself)",
"type": "string",
"minLength": 1,
},
"adapters": {
"description": "Number of adapters",
"type": "integer",
"minimum": 0,
"maximum": 36, # maximum given by the ICH9 chipset in VirtualBox
},
"use_any_adapter": {
"description": "Allow GNS3 to use any VirtualBox adapter",
"type": "boolean",
},
"adapter_type": {
"description": "VirtualBox adapter type",
"type": "string",
"minLength": 1,
},
"console": {
"description": "Console TCP port",
"minimum": 1,
"maximum": 65535,
"type": "integer"
},
"enable_remote_console": {
"description": "Enable the remote console",
"type": "boolean"
},
"ram": {
"description": "Amount of RAM",
"minimum": 0,
"maximum": 65535,
"type": "integer"
},
"headless": {
"description": "Headless mode",
"type": "boolean"
},
"acpi_shutdown": {
"description": "ACPI shutdown",
"type": "boolean"
},
},
"additionalProperties": False,
}
VBOX_OBJECT_SCHEMA = {
"$schema": "http://json-schema.org/draft-04/schema#",
@ -224,7 +166,10 @@ VBOX_OBJECT_SCHEMA = {
"maximum": 65535,
"type": "integer"
},
"linked_clone": {
"description": "Whether the VM is a linked clone or not",
"type": "boolean"
}
},
"additionalProperties": False,
"required": ["name", "node_id", "project_id", "node_directory"]
}