Skip to content

Commit

Permalink
vl: deprecate -writeconfig
Browse files Browse the repository at this point in the history
The functionality of -writeconfig is limited and the code
does not even try to detect cases where it prints incorrect
syntax (for example if values have a quote in them, since
qemu_config_parse does not support any kind of escaping)
so remove it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Feb 25, 2021
1 parent 06e878b commit b979c93
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 7 additions & 0 deletions docs/system/deprecated.rst
Expand Up @@ -146,6 +146,13 @@ library enabled as a cryptography provider.
Neither the ``nettle`` library, or the built-in cryptography provider are
supported on FIPS enabled hosts.

``-writeconfig`` (since 6.0)
'''''''''''''''''''''''''''''

The ``-writeconfig`` option is not able to serialize the entire contents
of the QEMU command line. It is thus considered a failed experiment
and deprecated, with no current replacement.

QEMU Machine Protocol (QMP) commands
------------------------------------

Expand Down
7 changes: 1 addition & 6 deletions qemu-options.hx
Expand Up @@ -4335,13 +4335,8 @@ SRST
ERST
DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
"-writeconfig <file>\n"
" read/write config file\n", QEMU_ARCH_ALL)
" read/write config file (deprecated)\n", QEMU_ARCH_ALL)
SRST
``-writeconfig file``
Write device configuration to file. The file can be either filename
to save command line and device configuration into file or dash
``-``) character to print the output to stdout. This can be later
used as input file for ``-readconfig`` option.
ERST

DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
Expand Down
1 change: 1 addition & 0 deletions softmmu/vl.c
Expand Up @@ -3356,6 +3356,7 @@ void qemu_init(int argc, char **argv, char **envp)
case QEMU_OPTION_writeconfig:
{
FILE *fp;
warn_report("-writeconfig is deprecated and will go away without a replacement");
if (strcmp(optarg, "-") == 0) {
fp = stdout;
} else {
Expand Down

0 comments on commit b979c93

Please sign in to comment.