1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-29 02:08:10 +00:00

Spice with agent support for Qemu VMs.

This commit is contained in:
grossmj 2018-03-25 14:36:14 +07:00
parent d419d3fa39
commit caa2bda71b
3 changed files with 21 additions and 4 deletions

View File

@ -1455,6 +1455,21 @@ class QemuVM(BaseNode):
else:
return []
def _spice_with_agent_options(self):
spice_options = self._spice_options()
if self._console:
# agent options (mouse/screen)
agent_options = ["-device", "virtio-serial",
"-chardev", "spicevmc,id=vdagent,debug=0,name=vdagent",
"-device", "virtserialport,chardev=vdagent,name=com.redhat.spice.0"]
spice_options.extend(agent_options)
# folder sharing options
folder_sharing_options = ["-chardev", "spiceport,name=org.spice-space.webdav.0,id=charchannel0",
"-device", "virtserialport,chardev=charchannel0,id=channel0,name=org.spice-space.webdav.0"]
spice_options.extend(folder_sharing_options)
return spice_options
def _monitor_options(self):
if self._monitor:
@ -1822,6 +1837,8 @@ class QemuVM(BaseNode):
command.extend(self._vnc_options())
elif self._console_type == "spice":
command.extend(self._spice_options())
elif self._console_type == "spice+agent":
command.extend(self._spice_with_agent_options())
elif self._console_type != "none":
raise QemuError("Console type {} is unknown".format(self._console_type))
command.extend(self._monitor_options())

View File

@ -144,7 +144,7 @@ NODE_OBJECT_SCHEMA = {
},
"console_type": {
"description": "Console type",
"enum": ["vnc", "telnet", "http", "https", "spice", "none", None]
"enum": ["vnc", "telnet", "http", "https", "spice", "spice+agent", "none", None]
},
"properties": {
"description": "Properties specific to an emulator",

View File

@ -63,7 +63,7 @@ QEMU_CREATE_SCHEMA = {
},
"console_type": {
"description": "Console type",
"enum": ["telnet", "vnc", "spice", "none"]
"enum": ["telnet", "vnc", "spice", "spice+agent", "none"]
},
"hda_disk_image": {
"description": "QEMU hda disk image path",
@ -244,7 +244,7 @@ QEMU_UPDATE_SCHEMA = {
},
"console_type": {
"description": "Console type",
"enum": ["telnet", "vnc", "spice", "none"]
"enum": ["telnet", "vnc", "spice", "spice+agent", "none"]
},
"linked_clone": {
"description": "Whether the VM is a linked clone or not",
@ -541,7 +541,7 @@ QEMU_OBJECT_SCHEMA = {
},
"console_type": {
"description": "Console type",
"enum": ["telnet", "vnc", "spice", "none"]
"enum": ["telnet", "vnc", "spice","spice+agent", "none"]
},
"initrd": {
"description": "QEMU initrd path",