Search code examples
qemu

Is there a way to get the configuration options of QEMU?


Progams such as vim or gdb can give me their configuration options which is convenient to recreate a build with the same features somewhere else. Does QEMU have something similar, or is there any way (no matter if hackish or so) to get the same information as in the example below).

/usr/bin/vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 18 2023 09:20:34)
Included patches: 1-1453, 3625, 3669, 3741
Modified by [email protected]
Compiled by [email protected]
Huge version without GUI.  Features included (+) or not (-):
+acl               +farsi             +mouse_sgr         -tag_any_white
+arabic            +file_in_path      -mouse_sysmouse    -tcl
+autocmd           +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
[...]
/usr/bin/gdb --configuration
This GDB was configured as follows:
   configure --host=x86_64-linux-gnu --target=x86_64-linux-gnu
             --with-auto-load-dir=$debugdir:$datadir/auto-load
             --with-auto-load-safe-path=$debugdir:$datadir/auto-load
             --with-expat
             --with-gdb-datadir=/usr/share/gdb (relocatable)
             --with-jit-reader-dir=/usr/lib/gdb (relocatable)
             --without-libunwind-ia64
             --with-lzma
             --with-python=/usr (relocatable)
             --without-guile
             --with-separate-debug-dir=/usr/lib/debug (relocatable)
             --with-system-gdbinit=/etc/gdb/gdbinit
             --with-babeltrace

("Relocatable" means the directory can be moved with the GDB installation
tree, and GDB will still find it.)

Solution

  • No, QEMU doesn't have any mechanism like that. If you still have the build directory, the file config.status within it has a record of how configure was invoked and the environment variables that were set at that point. However even with that you will only get the same result on a different machine if all the same dependent packages are installed, because configure's default behaviour is "enable feature if dependency found, disable if not", and so feature presence depends on whether the dependencies are on the build machine or not.