Skip to contentSkip to conversation

vl: deprecate -writeconfig

PATCH In review Paolo Bonzini 5 participants 5 messages Mar 2, 2021 – Mar 3, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 vl: deprecate -writeconfig

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.

---
 docs/system/deprecated.rst | 7 +++++++
 qemu-options.hx            | 7 +------
 softmmu/vl.c               | 1 +
 3 files changed, 9 insertions(+), 6 deletions(-)
docs/system/deprecated.rst +7 -0
index 2fcac7861e..561c916da2 100644
@@ -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
 ------------------------------------
 
qemu-options.hx +1 -6
index 34be5a7a2d..252db9357c 100644
@@ -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,
softmmu/vl.c +1 -0
index b219ce1f35..10bd8a10a3 100644
@@ -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 {
Signature · 1 line
2.29.2
#1 lore raw
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Type: series
Message-id: [email protected]
Subject: [PATCH v3] vl: deprecate -writeconfig

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
25b4cd1 vl: deprecate -writeconfig

=== OUTPUT BEGIN ===
ERROR: line over 90 characters
#66: FILE: softmmu/vl.c:3359:
+ warn_report("-writeconfig is deprecated and will go away without a replacement");

total: 1 errors, 0 warnings, 34 lines checked

Commit 25b4cd1060d2 (vl: deprecate -writeconfig) has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

Reviewed-by on v3 1/1
#2 lore raw
In reply to Paolo Bonzini
Quoted 56 lines · Paolo Bonzini

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.

---
  docs/system/deprecated.rst | 7 +++++++
  qemu-options.hx            | 7 +------
  softmmu/vl.c               | 1 +
  3 files changed, 9 insertions(+), 6 deletions(-)
docs/system/deprecated.rst +7 -0
index 2fcac7861e..561c916da2 100644
@@ -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
  ------------------------------------
 
qemu-options.hx +1 -6
index 34be5a7a2d..252db9357c 100644
@@ -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,
softmmu/vl.c +0 -0
index b219ce1f35..10bd8a10a3 100644

softmmu/vl.c void qemu_init(int argc, char **argv, char **envp) · line 3362

Quoted 7 lines
softmmu/vl.c +1 -0
@@ -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 {