Skip to contentSkip to conversation

vl: deprecate -writeconfig

PATCH Superseded Paolo Bonzini 2 participants 2 messages Feb 25, 2021

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 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 +++++++
 softmmu/vl.c               | 1 +
 2 files changed, 8 insertions(+)
docs/system/deprecated.rst +7 -0
index 2fcac7861e..9aede21f11 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.
+
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
softmmu/vl.c +1 -0
index b219ce1f35..3e4dce2874 100644
@@ -3356,6 +3356,7 @@ void qemu_init(int argc, char **argv, char **envp)
             case QEMU_OPTION_writeconfig:
                 {
                     FILE *fp;
+                    warn_report("The -writeconfig option is deprecated");
                     if (strcmp(optarg, "-") == 0) {
                         fp = stdout;
                     } else {
Signature · 1 line
2.29.2
#1 lore raw
Quoted 17 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 +++++++
 softmmu/vl.c               | 1 +
 2 files changed, 8 insertions(+)
docs/system/deprecated.rst +0 -0
index 2fcac7861e..9aede21f11 100644

docs/system/deprecated.rst library enabled as a cryptography provider. · line 154

Quoted 9 lines
docs/system/deprecated.rst +6 -0
@@ -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.

s/./, with no current replacement./

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

Quoted 13 lines
docs/system/deprecated.rst +1 -0
+
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
softmmu/vl.c +1 -0
index b219ce1f35..3e4dce2874 100644
@@ -3356,6 +3356,7 @@ void qemu_init(int argc, char **argv, char **envp)
             case QEMU_OPTION_writeconfig:
                 {
                     FILE *fp;
+                    warn_report("The -writeconfig option is deprecated");

I'd suggest same here too

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

Quoted 3 lines
softmmu/vl.c +0 -0
                     if (strcmp(optarg, "-") == 0) {
                         fp = stdout;
                     } else {

Can we hide/remove it from qemu-options.hx, while still letting it be used if people know it exists ? Failing that, at least add the deprecation note to the qemu-options.hx help text

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|