* [Buildroot] [PATCH 0/3] package/qemu: add option to enable guest agent
@ 2022-11-04 23:57 unixmania
2022-11-04 23:57 ` [Buildroot] [PATCH 1/3] package/qemu: make "custom targets" config depend on !BR2_STATIC_LIBS unixmania
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: unixmania @ 2022-11-04 23:57 UTC (permalink / raw)
To: buildroot; +Cc: Carlos Santos, Romain Naour
From: Carlos Santos <unixmania@gmail.com>
Before doing it, fix two small erros in the configuration menu that can lead
to build failures.
Carlos Santos (3):
package/qemu: make "custom targets" config depend on !BR2_STATIC_LIBS
package/qemu: select FDT for custom targets too
package/qemu: add option to enable guest agent
package/qemu/Config.in | 18 +++++++++++++++++-
package/qemu/qemu.mk | 6 ++++++
2 files changed, 23 insertions(+), 1 deletion(-)
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 1/3] package/qemu: make "custom targets" config depend on !BR2_STATIC_LIBS
2022-11-04 23:57 [Buildroot] [PATCH 0/3] package/qemu: add option to enable guest agent unixmania
@ 2022-11-04 23:57 ` unixmania
2022-11-05 21:12 ` Thomas Petazzoni via buildroot
2022-11-04 23:57 ` [Buildroot] [PATCH 2/3] package/qemu: select FDT for custom targets too unixmania
2022-11-04 23:57 ` [Buildroot] [PATCH 3/3] package/qemu: add option to enable guest agent unixmania
2 siblings, 1 reply; 8+ messages in thread
From: unixmania @ 2022-11-04 23:57 UTC (permalink / raw)
To: buildroot; +Cc: Carlos Santos, Romain Naour
From: Carlos Santos <unixmania@gmail.com>
Custom targets selects system and Linux user-land emulation, which in
their turn require shared libraries.
Signed-off-by: Carlos Santos <unixmania@gmail.com>
---
package/qemu/Config.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/package/qemu/Config.in b/package/qemu/Config.in
index 15d6c7d6b5..8b8a999885 100644
--- a/package/qemu/Config.in
+++ b/package/qemu/Config.in
@@ -51,6 +51,7 @@ comment "Emulators selection"
config BR2_PACKAGE_QEMU_CUSTOM_TARGETS
string "Enable specific targets"
+ depends on !BR2_STATIC_LIBS # dtc
help
Enter here the list of QEMU targets you want to build. For
example:
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 2/3] package/qemu: select FDT for custom targets too
2022-11-04 23:57 [Buildroot] [PATCH 0/3] package/qemu: add option to enable guest agent unixmania
2022-11-04 23:57 ` [Buildroot] [PATCH 1/3] package/qemu: make "custom targets" config depend on !BR2_STATIC_LIBS unixmania
@ 2022-11-04 23:57 ` unixmania
2022-11-05 10:44 ` Thomas Huth
2022-11-04 23:57 ` [Buildroot] [PATCH 3/3] package/qemu: add option to enable guest agent unixmania
2 siblings, 1 reply; 8+ messages in thread
From: unixmania @ 2022-11-04 23:57 UTC (permalink / raw)
To: buildroot; +Cc: Carlos Santos, Romain Naour
From: Carlos Santos <unixmania@gmail.com>
Custom targets selects system and Linux user-land emulation, which in
their turn require FDT. Move the BR2_PACKAGE_QEMU_FDT selection to the
BR2_PACKAGE_QEMU_HAS_EMULS hidden boolean, to cover all cases.
Signed-off-by: Carlos Santos <unixmania@gmail.com>
---
package/qemu/Config.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/qemu/Config.in b/package/qemu/Config.in
index 8b8a999885..9e0cbd4acf 100644
--- a/package/qemu/Config.in
+++ b/package/qemu/Config.in
@@ -95,7 +95,6 @@ comment "... or you can select emulator families to enable, below:"
config BR2_PACKAGE_QEMU_SYSTEM
bool "Enable all systems emulation"
depends on !BR2_STATIC_LIBS # dtc
- select BR2_PACKAGE_QEMU_FDT
help
Say 'y' to build all system emulators/virtualisers that QEMU
supports.
@@ -121,6 +120,7 @@ endif # BR2_PACKAGE_QEMU_CUSTOM_TARGETS == ""
config BR2_PACKAGE_QEMU_HAS_EMULS
def_bool y
depends on BR2_PACKAGE_QEMU_SYSTEM || BR2_PACKAGE_QEMU_LINUX_USER || BR2_PACKAGE_QEMU_CUSTOM_TARGETS != ""
+ select BR2_PACKAGE_QEMU_FDT
if BR2_PACKAGE_QEMU_HAS_EMULS
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 3/3] package/qemu: add option to enable guest agent
2022-11-04 23:57 [Buildroot] [PATCH 0/3] package/qemu: add option to enable guest agent unixmania
2022-11-04 23:57 ` [Buildroot] [PATCH 1/3] package/qemu: make "custom targets" config depend on !BR2_STATIC_LIBS unixmania
2022-11-04 23:57 ` [Buildroot] [PATCH 2/3] package/qemu: select FDT for custom targets too unixmania
@ 2022-11-04 23:57 ` unixmania
2 siblings, 0 replies; 8+ messages in thread
From: unixmania @ 2022-11-04 23:57 UTC (permalink / raw)
To: buildroot; +Cc: Carlos Santos, Romain Naour
From: Carlos Santos <unixmania@gmail.com>
It requires --enable-system or --enable-tools to be built, so add a
hidden boolean, BR2_PACKAGE_QEMU_HAS_SYSTEM_OR_TOOLS, to control it.
Signed-off-by: Carlos Santos <unixmania@gmail.com>
---
package/qemu/Config.in | 15 +++++++++++++++
package/qemu/qemu.mk | 6 ++++++
2 files changed, 21 insertions(+)
diff --git a/package/qemu/Config.in b/package/qemu/Config.in
index 9e0cbd4acf..dd8b3d3491 100644
--- a/package/qemu/Config.in
+++ b/package/qemu/Config.in
@@ -122,6 +122,10 @@ config BR2_PACKAGE_QEMU_HAS_EMULS
depends on BR2_PACKAGE_QEMU_SYSTEM || BR2_PACKAGE_QEMU_LINUX_USER || BR2_PACKAGE_QEMU_CUSTOM_TARGETS != ""
select BR2_PACKAGE_QEMU_FDT
+config BR2_PACKAGE_QEMU_HAS_SYSTEM_OR_TOOLS
+ def_bool y
+ depends on BR2_PACKAGE_QEMU_SYSTEM || BR2_PACKAGE_QEMU_CUSTOM_TARGETS != "" || BR2_PACKAGE_QEMU_TOOLS
+
if BR2_PACKAGE_QEMU_HAS_EMULS
comment "Frontends"
@@ -158,4 +162,15 @@ config BR2_PACKAGE_QEMU_TOOLS
Say 'y' here to include tools packaged with QEMU
(e.g. qemu-img).
+config BR2_PACKAGE_QEMU_GUEST_AGENT
+ bool "Enable guest agent"
+ depends on BR2_PACKAGE_QEMU_HAS_SYSTEM_OR_TOOLS
+ help
+ Say 'y' here to include an agent to run on guests, which
+ communicates with the host over a virtio-serial channel
+ named "org.qemu.guest_agent.0".
+
+comment "Guest agent needs systems emulation or tools"
+ depends on !BR2_PACKAGE_QEMU_HAS_SYSTEM_OR_TOOLS
+
endif # BR2_PACKAGE_QEMU
diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index a991d49993..d9bdfe0e84 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -90,6 +90,12 @@ else
QEMU_OPTS += --disable-tools
endif
+ifeq ($(BR2_PACKAGE_QEMU_GUEST_AGENT),y)
+QEMU_OPTS += --enable-guest-agent
+else
+QEMU_OPTS += --disable-guest-agent
+endif
+
ifeq ($(BR2_PACKAGE_LIBFUSE3),y)
QEMU_OPTS += --enable-fuse --enable-fuse-lseek
QEMU_DEPENDENCIES += libfuse3
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH 2/3] package/qemu: select FDT for custom targets too
2022-11-04 23:57 ` [Buildroot] [PATCH 2/3] package/qemu: select FDT for custom targets too unixmania
@ 2022-11-05 10:44 ` Thomas Huth
2022-11-05 20:23 ` Carlos Santos
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Huth @ 2022-11-05 10:44 UTC (permalink / raw)
To: unixmania; +Cc: Romain Naour, buildroot
Am Fri, 4 Nov 2022 20:57:26 -0300
schrieb unixmania@gmail.com:
> From: Carlos Santos <unixmania@gmail.com>
>
> Custom targets selects system and Linux user-land emulation, which in
> their turn require FDT. Move the BR2_PACKAGE_QEMU_FDT selection to the
> BR2_PACKAGE_QEMU_HAS_EMULS hidden boolean, to cover all cases.
>
> Signed-off-by: Carlos Santos <unixmania@gmail.com>
> ---
> package/qemu/Config.in | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/qemu/Config.in b/package/qemu/Config.in
> index 8b8a999885..9e0cbd4acf 100644
> --- a/package/qemu/Config.in
> +++ b/package/qemu/Config.in
> @@ -95,7 +95,6 @@ comment "... or you can select emulator families to enable, below:"
> config BR2_PACKAGE_QEMU_SYSTEM
> bool "Enable all systems emulation"
> depends on !BR2_STATIC_LIBS # dtc
> - select BR2_PACKAGE_QEMU_FDT
> help
> Say 'y' to build all system emulators/virtualisers that QEMU
> supports.
> @@ -121,6 +120,7 @@ endif # BR2_PACKAGE_QEMU_CUSTOM_TARGETS == ""
> config BR2_PACKAGE_QEMU_HAS_EMULS
> def_bool y
> depends on BR2_PACKAGE_QEMU_SYSTEM || BR2_PACKAGE_QEMU_LINUX_USER || BR2_PACKAGE_QEMU_CUSTOM_TARGETS != ""
> + select BR2_PACKAGE_QEMU_FDT
Technically, I think you don't need FDT if you are only compiling the
linux-user targets ... so maybe it would be better to add this to the
BR2_PACKAGE_QEMU_CUSTOM_TARGETS switch instead?
Thomas
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH 2/3] package/qemu: select FDT for custom targets too
2022-11-05 10:44 ` Thomas Huth
@ 2022-11-05 20:23 ` Carlos Santos
2022-11-05 21:18 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 8+ messages in thread
From: Carlos Santos @ 2022-11-05 20:23 UTC (permalink / raw)
To: Thomas Huth; +Cc: Romain Naour, buildroot
On Sat, Nov 5, 2022 at 7:44 AM Thomas Huth <huth@tuxfamily.org> wrote:
>
> Am Fri, 4 Nov 2022 20:57:26 -0300
> schrieb unixmania@gmail.com:
>
> > From: Carlos Santos <unixmania@gmail.com>
> >
> > Custom targets selects system and Linux user-land emulation, which in
> > their turn require FDT. Move the BR2_PACKAGE_QEMU_FDT selection to the
> > BR2_PACKAGE_QEMU_HAS_EMULS hidden boolean, to cover all cases.
> >
> > Signed-off-by: Carlos Santos <unixmania@gmail.com>
> > ---
> > package/qemu/Config.in | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/package/qemu/Config.in b/package/qemu/Config.in
> > index 8b8a999885..9e0cbd4acf 100644
> > --- a/package/qemu/Config.in
> > +++ b/package/qemu/Config.in
> > @@ -95,7 +95,6 @@ comment "... or you can select emulator families to enable, below:"
> > config BR2_PACKAGE_QEMU_SYSTEM
> > bool "Enable all systems emulation"
> > depends on !BR2_STATIC_LIBS # dtc
> > - select BR2_PACKAGE_QEMU_FDT
> > help
> > Say 'y' to build all system emulators/virtualisers that QEMU
> > supports.
> > @@ -121,6 +120,7 @@ endif # BR2_PACKAGE_QEMU_CUSTOM_TARGETS == ""
> > config BR2_PACKAGE_QEMU_HAS_EMULS
> > def_bool y
> > depends on BR2_PACKAGE_QEMU_SYSTEM || BR2_PACKAGE_QEMU_LINUX_USER || BR2_PACKAGE_QEMU_CUSTOM_TARGETS != ""
> > + select BR2_PACKAGE_QEMU_FDT
>
> Technically, I think you don't need FDT if you are only compiling the
> linux-user targets ... so maybe it would be better to add this to the
> BR2_PACKAGE_QEMU_CUSTOM_TARGETS switch instead?
>
> Thomas
BR2_PACKAGE_QEMU_CUSTOM_TARGETS is a string, so adding a "select
BR2_PACKAGE_QEMU_FDT" does not have any effect.
A better solution for the case in which only linux-user targets are
selected requires a more complex approach. I will submit a separate
patch for this purpose. Meanwhile, let's put this series on hold.
--
Carlos Santos <unixmania@gmail.com>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH 1/3] package/qemu: make "custom targets" config depend on !BR2_STATIC_LIBS
2022-11-04 23:57 ` [Buildroot] [PATCH 1/3] package/qemu: make "custom targets" config depend on !BR2_STATIC_LIBS unixmania
@ 2022-11-05 21:12 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-11-05 21:12 UTC (permalink / raw)
To: unixmania; +Cc: Romain Naour, buildroot
Hello Carlos,
On Fri, 4 Nov 2022 20:57:25 -0300
unixmania@gmail.com wrote:
> From: Carlos Santos <unixmania@gmail.com>
>
> Custom targets selects system and Linux user-land emulation, which in
> their turn require shared libraries.
>
> Signed-off-by: Carlos Santos <unixmania@gmail.com>
Could you clarify which configuration fails to build?
> config BR2_PACKAGE_QEMU_CUSTOM_TARGETS
> string "Enable specific targets"
> + depends on !BR2_STATIC_LIBS # dtc
What is the relationship with DTC here?
Also, when we have a !BR2_STATIC_LIBS dependency, we normally add a
Config.in comment:
comment "specific targets need a toolchain w/ shared library"
depends on BR2_STATIC_LIBS
But really the most important thing is to get more details to
understand better the problem.
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCH 2/3] package/qemu: select FDT for custom targets too
2022-11-05 20:23 ` Carlos Santos
@ 2022-11-05 21:18 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-11-05 21:18 UTC (permalink / raw)
To: Carlos Santos; +Cc: Thomas Huth, Romain Naour, buildroot
On Sat, 5 Nov 2022 17:23:53 -0300
Carlos Santos <unixmania@gmail.com> wrote:
> BR2_PACKAGE_QEMU_CUSTOM_TARGETS is a string, so adding a "select
> BR2_PACKAGE_QEMU_FDT" does not have any effect.
>
> A better solution for the case in which only linux-user targets are
> selected requires a more complex approach. I will submit a separate
> patch for this purpose. Meanwhile, let's put this series on hold.
Hm, I think I start to understand the issue, and with the current
organization of the Config.in options in package/qemu/Config.in, it's
going to be difficult to fix in a correct way.
For example, it looks like the linux-user mode emulation doesn't work
with the musl C library:
config BR2_PACKAGE_QEMU_LINUX_USER
bool "Enable all Linux user-land emulation"
# Incompatible "struct sigevent" definition on musl
depends on !BR2_TOOLCHAIN_USES_MUSL
So, it means that BR2_PACKAGE_QEMU_CUSTOM_TARGETS="i386-linux-user"
will in fact fail to build with a musl toolchain...
I only sane way to address this I believe would be to remove
BR2_PACKAGE_QEMU_CUSTOM_TARGETS entirely, and instead have
BR2_PACKAGE_QEMU_SYSTEM_TARGETS and
BR2_PACKAGE_QEMU_LINUX_USER_TARGETS, which would only be accessible
when BR2_PACKAGE_QEMU_SYSTEM or BR2_PACKAGE_QEMU_LINUX_USER
respectively are enabled. When BR2_PACKAGE_QEMU_SYSTEM_TARGETS is
empty, all system emulation targets are built, otherwise only the
specified ones are built. Ditto for the user emulation targets.
Obviously as usual, the main drawback is that is breaks backward
compatibility with existing configurations...
The other approach, which you took, is to assume for the "worst", and
assume that when BR2_PACKAGE_QEMU_CUSTOM_TARGETS != "", we might build
system or user emulation targets, and therefore this option needs to
have the combination of the dependencies of the system and user
emulation options.... which would mean disabling this option with musl
toolchains, for example.
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-11-05 21:19 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-04 23:57 [Buildroot] [PATCH 0/3] package/qemu: add option to enable guest agent unixmania
2022-11-04 23:57 ` [Buildroot] [PATCH 1/3] package/qemu: make "custom targets" config depend on !BR2_STATIC_LIBS unixmania
2022-11-05 21:12 ` Thomas Petazzoni via buildroot
2022-11-04 23:57 ` [Buildroot] [PATCH 2/3] package/qemu: select FDT for custom targets too unixmania
2022-11-05 10:44 ` Thomas Huth
2022-11-05 20:23 ` Carlos Santos
2022-11-05 21:18 ` Thomas Petazzoni via buildroot
2022-11-04 23:57 ` [Buildroot] [PATCH 3/3] package/qemu: add option to enable guest agent unixmania
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox