[lxc-devel] [lxd/master] lxd/qemu: Add support for spice agent

stgraber on Github lxc-bot at linuxcontainers.org
Tue Jul 14 03:12:59 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 569 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200713/7fd23f7c/attachment-0001.bin>
-------------- next part --------------
From 91afbe37eef1e9aace5d71d57e07a90919d940d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 13 Jul 2020 23:11:48 -0400
Subject: [PATCH] lxd/qemu: Add support for spice agent
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This adds two additional named serial ports for interacting with guest
services over SPICE.

With those in place, clipboard sharing, improved cursor/resolution
management and folder sharing are all possible.

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/instance/drivers/driver_qemu_templates.go | 27 +++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/lxd/instance/drivers/driver_qemu_templates.go b/lxd/instance/drivers/driver_qemu_templates.go
index c110c66dab..db11794313 100644
--- a/lxd/instance/drivers/driver_qemu_templates.go
+++ b/lxd/instance/drivers/driver_qemu_templates.go
@@ -59,7 +59,7 @@ size = "{{.memSizeBytes}}M"
 `))
 
 var qemuSerial = template.Must(template.New("qemuSerial").Parse(`
-# LXD serial identifier
+# Virtual serial bus
 [device "dev-qemu_serial"]
 {{- if eq .bus "pci" "pcie"}}
 driver = "virtio-serial-pci"
@@ -73,7 +73,8 @@ driver = "virtio-serial-ccw"
 multifunction = "on"
 {{- end }}
 
-[chardev "qemu_serial-chardev"]
+# LXD serial identifier
+[chardev "{{.chardevName}}"]
 backend = "ringbuf"
 size = "{{.ringbufSizeBytes}}B"
 
@@ -82,6 +83,28 @@ driver = "virtserialport"
 name = "org.linuxcontainers.lxd"
 chardev = "{{.chardevName}}"
 bus = "dev-qemu_serial.0"
+
+# Spice agent
+[chardev "qemu_spice-chardev"]
+backend = "spicevmc"
+name = "vdagent"
+
+[device "qemu_spice"]
+driver = "virtserialport"
+name = "com.redhat.spice.0"
+chardev = "qemu_spice-chardev"
+bus = "dev-qemu_serial.0"
+
+# Spice folder
+[chardev "qemu_spicedir-chardev"]
+backend = "spiceport"
+name = "org.spice-space.webdav.0"
+
+[device "qemu_spicedir"]
+driver = "virtserialport"
+name = "org.spice-space.webdav.0"
+chardev = "qemu_spicedir-chardev"
+bus = "dev-qemu_serial.0"
 `))
 
 var qemuPCIe = template.Must(template.New("qemuPCIe").Parse(`


More information about the lxc-devel mailing list