Skip to contentSkip to conversation

docs/tcg-plugins: document QEMU_PLUGIN behaviour

PATCH Superseded Christoph Muellner 3 participants 5 messages Mar 16, 2022

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs/tcg-plugins: document QEMU_PLUGIN behaviour

QEMU plugins can be loaded via command line arguments or via the QEMU_PLUGIN environment variable. Currently, only the first method is documented. Let's document QEMU_PLUGIN.

---
 docs/devel/tcg-plugins.rst | 4 ++++
 1 file changed, 4 insertions(+)
docs/devel/tcg-plugins.rst +4 -0
index f93ef4fe52..ba48be18d0 100644
@@ -34,6 +34,10 @@ Arguments are plugin specific and can be used to modify their
 behaviour. In this case the howvec plugin is being asked to use inline
 ops to count and break down the hint instructions by type.
 
+QEMU also evaluates the environment variable ``QEMU_PLUGIN``::
+
+  QEMU_PLUGIN="file=tests/plugin/libhowec.so,inline=on,count=hint" $QEMU
+
 Writing plugins
 ---------------
 
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 19 lines · Christoph Muellner

QEMU plugins can be loaded via command line arguments or via the QEMU_PLUGIN environment variable. Currently, only the first method is documented. Let's document QEMU_PLUGIN.

---
 docs/devel/tcg-plugins.rst | 4 ++++
 1 file changed, 4 insertions(+)
docs/devel/tcg-plugins.rst +0 -0
index f93ef4fe52..ba48be18d0 100644
@@ -34,6 +34,10 @@ Arguments are plugin specific and can be used to modify

their
behaviour. In this case the howvec plugin is being asked to use inline ops to count and break down the hint instructions by type.

docs/devel/tcg-plugins.rst Arguments are plugin specific and can be used to modify their · line 39

Quoted 3 lines
docs/devel/tcg-plugins.rst +3 -0
+QEMU also evaluates the environment variable ``QEMU_PLUGIN``::
+
+  QEMU_PLUGIN="file=tests/plugin/libhowec.so,inline=on,count=hint" $QEMU

The plugin howvec is in contrib/plugins, so I think giving the correct path would be
better. Note also that there's a typo in "libhowec.so".

If you want, you could also fix the next example that has the same path or leave it
for another patch.

+

Quoted 7 lines

Writing plugins
---------------

--
2.35.1

Other than that,

Thanks,
Mahmoud

#2 lore raw
Quoted 23 lines · Mahmoud Abumandour
Quoted 18 lines · Christoph Muellner

QEMU plugins can be loaded via command line arguments or via the QEMU_PLUGIN environment variable. Currently, only the first method is documented. Let's document QEMU_PLUGIN.

---
 docs/devel/tcg-plugins.rst | 4 ++++
 1 file changed, 4 insertions(+)
docs/devel/tcg-plugins.rst +0 -0
index f93ef4fe52..ba48be18d0 100644
@@ -34,6 +34,10 @@ Arguments are plugin specific and can be used to

modify their
behaviour. In this case the howvec plugin is being asked to use inline ops to count and break down the hint instructions by type.

Quoted 9 lines

docs/devel/tcg-plugins.rst Arguments are plugin specific and can be used to modify their · line 39

Quoted 4 lines
docs/devel/tcg-plugins.rst +3 -0
+QEMU also evaluates the environment variable ``QEMU_PLUGIN``::
+
+  QEMU_PLUGIN="file=tests/plugin/libhowec.so,inline=on,count=hint" $QEMU

The plugin howvec is in contrib/plugins, so I think giving the correct path would be
better. Note also that there's a typo in "libhowec.so".

Oh yes, I was just copying the contents of the example above but did not notice
that this is also wrong.

I'll respin a v2 which fixes the paths.

Thanks!

Quoted 19 lines

If you want, you could also fix the next example that has the same path or leave it
for another patch.

+

Quoted 7 lines

Writing plugins
---------------

--
2.35.1

Other than that,

Thanks,
Mahmoud

#3 lore raw
In reply to Christoph Muellner
Quoted 14 lines · Christoph Muellner

QEMU plugins can be loaded via command line arguments or via the QEMU_PLUGIN environment variable. Currently, only the first method is documented. Let's document QEMU_PLUGIN.

---
 docs/devel/tcg-plugins.rst | 4 ++++
 1 file changed, 4 insertions(+)
docs/devel/tcg-plugins.rst +0 -0
index f93ef4fe52..ba48be18d0 100644

docs/devel/tcg-plugins.rst Arguments are plugin specific and can be used to modify their · line 37

Quoted 4 lines
docs/devel/tcg-plugins.rst +1 -0
@@ -34,6 +34,10 @@ Arguments are plugin specific and can be used to modify their
 behaviour. In this case the howvec plugin is being asked to use inline
 ops to count and break down the hint instructions by type.
 
+QEMU also evaluates the environment variable ``QEMU_PLUGIN``::

You should also make it clear this only works for *-user builds of QEMU. For system emulation you still need to use the CLI interface.

Quoted 5 lines
docs/devel/tcg-plugins.rst +3 -0
+
+  QEMU_PLUGIN="file=tests/plugin/libhowec.so,inline=on,count=hint" $QEMU
+
 Writing plugins
 ---------------
Signature · 1 line
Alex Bennée
#4 lore raw
Quoted 18 lines · Alex Bennée

docs/devel/tcg-plugins.rst Arguments are plugin specific and can be used to

Quoted 14 lines · Christoph Muellner

QEMU plugins can be loaded via command line arguments or via the QEMU_PLUGIN environment variable. Currently, only the first method is documented. Let's document QEMU_PLUGIN.

---
 docs/devel/tcg-plugins.rst | 4 ++++
 1 file changed, 4 insertions(+)
docs/devel/tcg-plugins.rst +0 -0
index f93ef4fe52..ba48be18d0 100644
@@ -34,6 +34,10 @@ Arguments are plugin specific and can be used to

modify their

Quoted 7 lines

docs/devel/tcg-plugins.rst Arguments are plugin specific and can be used to modify their · line 37

Quoted 4 lines
docs/devel/tcg-plugins.rst +1 -0
 behaviour. In this case the howvec plugin is being asked to use inline
 ops to count and break down the hint instructions by type.
 
+QEMU also evaluates the environment variable ``QEMU_PLUGIN``::

You should also make it clear this only works for *-user builds of QEMU. For system emulation you still need to use the CLI interface.

Looks like this is even more restrictive as I can see support only in linux-user/main.c.
I'll reword this to only be available for Linux user-mode emulation.

Thanks!

Quoted 12 lines

docs/devel/tcg-plugins.rst Arguments are plugin specific and can be used to modify their · line 42

Quoted 7 lines
docs/devel/tcg-plugins.rst +3 -0
+
+  QEMU_PLUGIN="file=tests/plugin/libhowec.so,inline=on,count=hint" $QEMU
+
 Writing plugins
 ---------------

--
Alex Bennée