Skip to contentSkip to conversation

package/qemu: add spice support

PATCH Superseded Jared Bents 3 participants 9 messages Jun 29, 2020 – Jul 13, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 package/qemu: add spice support

update to add qemu spice support

---
 package/qemu/Config.in | 9 +++++++++
 package/qemu/qemu.mk   | 8 +++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)
package/qemu/Config.in +9 -0
index 33d4cccd7b..3de73b69ec 100644
@@ -127,6 +127,15 @@ config BR2_PACKAGE_QEMU_SDL
 comment "SDL frontend needs a toolchain w/ dynamic library"
 	depends on BR2_STATIC_LIBS
 
+config BR2_PACKAGE_QEMU_SPICE
+	bool "Enable Spice frontend"
+	depends on BR2_PACKAGE_SPICE
+	help
+	  Say 'y' here to have QEMU support Spice as a (VNC-like) frontend.
+
+comment "Spice support requires spice-server"
+	depends on !BR2_PACKAGE_SPICE
+
 comment "Misc. features"
 
 config BR2_PACKAGE_QEMU_FDT
package/qemu/qemu.mk +7 -1
index cb138fd488..0b76e432e0 100644
@@ -112,6 +112,13 @@ else
 QEMU_OPTS += --disable-numa
 endif
 
+ifeq ($(BR2_PACKAGE_QEMU_SPICE),y)
+QEMU_OPTS += --enable-spice
+QEMU_DEPENDENCIES += spice
+else
+QEMU_OPTS += --disable-spice
+endif
+
 # Override CPP, as it expects to be able to call it like it'd
 # call the compiler.
 define QEMU_CONFIGURE_CMDS
@@ -143,7 +150,6 @@ define QEMU_CONFIGURE_CMDS
 			--disable-linux-io-uring \
 			--disable-cap-ng \
 			--disable-docs \
-			--disable-spice \
 			--disable-rbd \
 			--disable-libiscsi \
 			--disable-usb-redir \
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/3 package/qemu: add vnc support

update to add vnc support to qemu if libvncserver is selected

---
 package/qemu/qemu.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
package/qemu/qemu.mk +7 -1
index 0b76e432e0..520547e94e 100644
@@ -98,6 +98,13 @@ else
 QEMU_OPTS += --disable-libusb
 endif
 
+ifeq ($(BR2_PACKAGE_LIBVNCSERVER),y)
+QEMU_OPTS += --enable-vnc
+QEMU_DEPENDENCIES += libvncserver
+else
+QEMU_OPTS += --disable-vnc
+endif
+
 ifeq ($(BR2_PACKAGE_NETTLE),y)
 QEMU_OPTS += --enable-nettle
 QEMU_DEPENDENCIES += nettle
@@ -140,7 +147,6 @@ define QEMU_CONFIGURE_CMDS
 			--disable-bsd-user \
 			--disable-containers \
 			--disable-xen \
-			--disable-vnc \
 			--disable-virtfs \
 			--disable-brlapi \
 			--disable-curses \
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/3 package/qemu: add vnc support

Hi Jared,

Le 29/06/2020 ? 22:50, Jared Bents a ?crit?:

Quoted 13 lines

update to add vnc support to qemu if libvncserver is selected

---
 package/qemu/qemu.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
package/qemu/qemu.mk +0 -0
index 0b76e432e0..520547e94e 100644

package/qemu/qemu.mk else · line 106

Quoted 9 lines
package/qemu/qemu.mk +6 -0
@@ -98,6 +98,13 @@ else
 QEMU_OPTS += --disable-libusb
 endif
 
+ifeq ($(BR2_PACKAGE_LIBVNCSERVER),y)
+QEMU_OPTS += --enable-vnc
+QEMU_DEPENDENCIES += libvncserver
+else
+QEMU_OPTS += --disable-vnc
+endif

When vnc support is enabled, vnc suboption will try to detect automatically some dependencies (like libpng see [1][2]).

vnc-sasl        SASL encryption for VNC server
vnc-jpeg        JPEG lossy compression for VNC server
vnc-png         PNG compression for VNC server

Either disable them explicitly or handle the optional dependencies.

[1]
https://git.buildroot.net/buildroot/commit/?id=ece36b9a46583315fe0d607099e16949ed6c2b0b
[2]
https://git.qemu.org/?p=qemu.git;a=blob;f=configure;h=23b5e93752b6a2597b2099b502184bc5fc352bf1;hb=fdd76fecdde1ad444ff4deb7f1c4f7e4a1ef97d6#l1818

Best regards,
Romain

Quoted 13 lines
package/qemu/qemu.mk +1 -1
+
 ifeq ($(BR2_PACKAGE_NETTLE),y)
 QEMU_OPTS += --enable-nettle
 QEMU_DEPENDENCIES += nettle
@@ -140,7 +147,6 @@ define QEMU_CONFIGURE_CMDS
 			--disable-bsd-user \
 			--disable-containers \
 			--disable-xen \
-			--disable-vnc \
 			--disable-virtfs \
 			--disable-brlapi \
 			--disable-curses \
#3 lore raw

PATCH 3/3 package/qemu: add usb-redir support

In reply to Jared Bents

update to add usb-redir support to qemu if usbredir is enabled

---
 package/qemu/qemu.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
package/qemu/qemu.mk +7 -1
index 520547e94e..3ed5565221 100644
@@ -126,6 +126,13 @@ else
 QEMU_OPTS += --disable-spice
 endif
 
+ifeq ($(BR2_PACKAGE_USBREDIR),y)
+QEMU_OPTS += --enable-usb-redir
+QEMU_DEPENDENCIES += usbredir
+else
+QEMU_OPTS += --disable-usb-redir
+endif
+
 # Override CPP, as it expects to be able to call it like it'd
 # call the compiler.
 define QEMU_CONFIGURE_CMDS
@@ -158,7 +165,6 @@ define QEMU_CONFIGURE_CMDS
 			--disable-docs \
 			--disable-rbd \
 			--disable-libiscsi \
-			--disable-usb-redir \
 			--disable-strip \
 			--disable-sparse \
 			--disable-mpath \
Signature · 1 line
2.17.1
#4 lore raw

PATCH 3/3 package/qemu: add usb-redir support

Le 29/06/2020 ? 22:50, Jared Bents a ?crit?:

Quoted 3 lines

update to add usb-redir support to qemu if usbredir is enabled

Best regards,
Romain

Quoted 31 lines
---
 package/qemu/qemu.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
package/qemu/qemu.mk +7 -1
index 520547e94e..3ed5565221 100644
@@ -126,6 +126,13 @@ else
 QEMU_OPTS += --disable-spice
 endif
 
+ifeq ($(BR2_PACKAGE_USBREDIR),y)
+QEMU_OPTS += --enable-usb-redir
+QEMU_DEPENDENCIES += usbredir
+else
+QEMU_OPTS += --disable-usb-redir
+endif
+
 # Override CPP, as it expects to be able to call it like it'd
 # call the compiler.
 define QEMU_CONFIGURE_CMDS
@@ -158,7 +165,6 @@ define QEMU_CONFIGURE_CMDS
 			--disable-docs \
 			--disable-rbd \
 			--disable-libiscsi \
-			--disable-usb-redir \
 			--disable-strip \
 			--disable-sparse \
 			--disable-mpath \
#5 lore raw

PATCH 1/3 package/qemu: add spice support

In reply to Jared Bents
Quoted 13 lines · On Mon, 29 Jun 2020 15:50:00 -0500 Jared Bents…

update to add qemu spice support

---
 package/qemu/Config.in | 9 +++++++++
 package/qemu/qemu.mk   | 8 +++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)
package/qemu/Config.in +0 -0
index 33d4cccd7b..3de73b69ec 100644

package/qemu/Config.in config BR2_PACKAGE_QEMU_SDL · line 132

Quoted 6 lines
package/qemu/Config.in +3 -0
@@ -127,6 +127,15 @@ config BR2_PACKAGE_QEMU_SDL
 comment "SDL frontend needs a toolchain w/ dynamic library"
 	depends on BR2_STATIC_LIBS
 
+config BR2_PACKAGE_QEMU_SPICE
+	bool "Enable Spice frontend"
+	depends on BR2_PACKAGE_SPICE

I am wondering why for this one we are adding a sub-option and not using automatic detection of BR2_PACKAGE_SPICE=y in the .mk file, like you've done for VNC and usb-redir.

On the other hand, we do have already a bunch of sub-options to configure Qemu. We're not very consistent here :/

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#6 lore raw

PATCH 1/3 package/qemu: add spice support

Hi Thomas,

Quoted 28 lines · Thomas Petazzoni
Quoted 13 lines · On Mon, 29 Jun 2020 15:50:00 -0500 Jared Bents…

update to add qemu spice support

---
 package/qemu/Config.in | 9 +++++++++
 package/qemu/qemu.mk   | 8 +++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)
package/qemu/Config.in +0 -0
index 33d4cccd7b..3de73b69ec 100644

package/qemu/Config.in config BR2_PACKAGE_QEMU_SDL · line 132

Quoted 6 lines
package/qemu/Config.in +3 -0
@@ -127,6 +127,15 @@ config BR2_PACKAGE_QEMU_SDL
 comment "SDL frontend needs a toolchain w/ dynamic library"
      depends on BR2_STATIC_LIBS
 
+config BR2_PACKAGE_QEMU_SPICE
+     bool "Enable Spice frontend"
+     depends on BR2_PACKAGE_SPICE

I am wondering why for this one we are adding a sub-option and not using automatic detection of BR2_PACKAGE_SPICE=y in the .mk file, like you've done for VNC and usb-redir.

Quoted 8 lines

On the other hand, we do have already a bunch of sub-options to configure Qemu. We're not very consistent here :/

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

I based the handling of the --enable-spice option off of an old upstream attempt from Yann that I had found at
http://lists.buildroot.org/pipermail/buildroot/2012-December/063058.html
. I don't have a preference either way so let me know if you'd prefer a suboption or have it automatically enabled if BR2_PACKAGE_SPICE is enabled similarly to the other options I've added.

Thank you,
Jared

#7 lore raw

PATCH 1/3 package/qemu: add spice support

Hi Jared, Thomas,

Le 29/06/2020 ? 23:05, Jared Bents a ?crit?:

Quoted 35 lines

Hi Thomas,

Quoted 30 lines · Thomas Petazzoni
Quoted 13 lines · On Mon, 29 Jun 2020 15:50:00 -0500 Jared Bents…

update to add qemu spice support

---
 package/qemu/Config.in | 9 +++++++++
 package/qemu/qemu.mk   | 8 +++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)
package/qemu/Config.in +0 -0
index 33d4cccd7b..3de73b69ec 100644

package/qemu/Config.in config BR2_PACKAGE_QEMU_SDL · line 132

Quoted 6 lines
package/qemu/Config.in +3 -0
@@ -127,6 +127,15 @@ config BR2_PACKAGE_QEMU_SDL
 comment "SDL frontend needs a toolchain w/ dynamic library"
      depends on BR2_STATIC_LIBS
 
+config BR2_PACKAGE_QEMU_SPICE
+     bool "Enable Spice frontend"
+     depends on BR2_PACKAGE_SPICE

I am wondering why for this one we are adding a sub-option and not using automatic detection of BR2_PACKAGE_SPICE=y in the .mk file, like you've done for VNC and usb-redir.

On the other hand, we do have already a bunch of sub-options to configure Qemu. We're not very consistent here :/

How to enable systems emulation or user-land emulation without sub-options? What about removing BR2_PACKAGE_QEMU_SDL and BR2_PACKAGE_QEMU_FDT options and handle the dependencies automatically?

Quoted 7 lines
Quoted 6 lines

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Quoted 6 lines

I based the handling of the --enable-spice option off of an old upstream attempt from Yann that I had found at
http://lists.buildroot.org/pipermail/buildroot/2012-December/063058.html
. I don't have a preference either way so let me know if you'd prefer a suboption or have it automatically enabled if BR2_PACKAGE_SPICE is enabled similarly to the other options I've added.

I guess we should enable spice only when spice package is enabled by the user (automatic detection).

Best regards,
Romain

Quoted 8 lines

Thank you,
Jared
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#8 lore raw

PATCH 1/3 package/qemu: add spice support

In reply to Jared Bents
Quoted 7 lines · On Mon, 29 Jun 2020 15:50:00 -0500 Jared Bents…

update to add qemu spice support

---
 package/qemu/Config.in | 9 +++++++++
 package/qemu/qemu.mk   | 8 +++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

As discussed, I've dropped the sub-option, and simply made it an implicit optional dependency. And applied, of course!

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com