[libvirt] [QEMU PATCH v2 0/4] Deprecation patches net and enforce-config-section

Deprecate the "name" parameter for -net, and "enforce-config-section" of -machine. v2: - Split the single net patch into multiple smaller patches - Add patch to deprecate enforce-config-section Thomas Huth (4): Makefile: Add missing dependency for qemu-deprecated.texi net: Deprecate the "name" parameter of -net net/slirp: Deprecate the [hub_id name] parameter tuple hw/core/machine: Officially deprecate the enforce-config-section parameter Makefile | 2 +- hw/core/machine.c | 3 +++ net/net.c | 4 ++++ net/slirp.c | 2 ++ qemu-deprecated.texi | 17 +++++++++++++++++ 5 files changed, 27 insertions(+), 1 deletion(-) -- 1.8.3.1

Make sure that the docs get correctly regenerated when the file qemu-deprecated.texi has been changed. Fixes: 44c67847e32c91a6071fb0440c357b9489f08bc6 Signed-off-by: Thomas Huth <thuth@redhat.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fe623e4..f42e176 100644 --- a/Makefile +++ b/Makefile @@ -978,7 +978,7 @@ txt: qemu-doc.txt docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt qemu-doc.html qemu-doc.info qemu-doc.pdf qemu-doc.txt: \ qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-option-trace.texi \ - qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi \ + qemu-deprecated.texi qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi \ qemu-monitor-info.texi docs/qemu-block-drivers.texi \ docs/qemu-cpu-models.texi -- 1.8.3.1

On 9/20/18 10:50 AM, Thomas Huth wrote:
Make sure that the docs get correctly regenerated when the file qemu-deprecated.texi has been changed.
Fixes: 44c67847e32c91a6071fb0440c357b9489f08bc6 Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index fe623e4..f42e176 100644 --- a/Makefile +++ b/Makefile @@ -978,7 +978,7 @@ txt: qemu-doc.txt docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
qemu-doc.html qemu-doc.info qemu-doc.pdf qemu-doc.txt: \ qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-option-trace.texi \ - qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi \ + qemu-deprecated.texi qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi \ qemu-monitor-info.texi docs/qemu-block-drivers.texi \ docs/qemu-cpu-models.texi

Thomas Huth <thuth@redhat.com> writes:
Make sure that the docs get correctly regenerated when the file qemu-deprecated.texi has been changed.
Fixes: 44c67847e32c91a6071fb0440c357b9489f08bc6 Signed-off-by: Thomas Huth <thuth@redhat.com> --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index fe623e4..f42e176 100644 --- a/Makefile +++ b/Makefile @@ -978,7 +978,7 @@ txt: qemu-doc.txt docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
qemu-doc.html qemu-doc.info qemu-doc.pdf qemu-doc.txt: \ qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-option-trace.texi \ - qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi \ + qemu-deprecated.texi qemu-monitor.texi qemu-img-cmds.texi qemu-ga.texi \ qemu-monitor-info.texi docs/qemu-block-drivers.texi \ docs/qemu-cpu-models.texi
Thanks for cleaning up the minor mess I made. Reviewed-by: Markus Armbruster <armbru@redhat.com>

In early times, network backends were specified by a "vlan" and "name" tuple. With the introduction of netdevs, the "name" was replaced by an "id" (which is supposed to be unique), but the "name" parameter stayed as an alias which could be used instead of "id". Unfortunately, we miss the duplication check for "name": $ qemu-system-x86_64 -net user,name=n1 -net user,name=n1 ... starts without an error, while "id" correctly complains: $ qemu-system-x86_64 -net user,id=n1 -net user,id=n1 qemu-system-x86_64: -net user,id=n1: Duplicate ID 'n1' for net Instead of trying to fix the code for the legacy "name" parameter, let's rather get rid of this old interface and deprecate the "name" parameter now - this will also be less confusing for the users in the long run. Signed-off-by: Thomas Huth <thuth@redhat.com> --- net/net.c | 4 ++++ qemu-deprecated.texi | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/net/net.c b/net/net.c index 2a31339..cdcd5cf 100644 --- a/net/net.c +++ b/net/net.c @@ -984,6 +984,10 @@ static int net_client_init1(const void *object, bool is_netdev, Error **errp) /* missing optional values have been initialized to "all bits zero" */ name = net->has_id ? net->id : net->name; + if (net->has_name) { + warn_report("The 'name' parameter is deprecated, use 'id' instead"); + } + /* Map the old options to the new flat type */ switch (opts->type) { case NET_LEGACY_OPTIONS_TYPE_NONE: diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 8a2e399..60fd7f7 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -83,6 +83,11 @@ The 'file' driver for drives is no longer appropriate for character or host devices and will only accept regular files (S_IFREG). The correct driver for these file types is 'host_cdrom' or 'host_device' as appropriate. +@subsection -net ...,name=@var{name} (since 3.1) + +The @option{name} parameter of the @option{-net} option is a synonym +for the @option{id} parameter, which should now be used instead. + @section QEMU Machine Protocol (QMP) commands @subsection block-dirty-bitmap-add "autoload" parameter (since 2.12.0) -- 1.8.3.1

On 9/20/18 10:50 AM, Thomas Huth wrote:
In early times, network backends were specified by a "vlan" and "name" tuple. With the introduction of netdevs, the "name" was replaced by an "id" (which is supposed to be unique), but the "name" parameter stayed as an alias which could be used instead of "id". Unfortunately, we miss the duplication check for "name":
$ qemu-system-x86_64 -net user,name=n1 -net user,name=n1
... starts without an error, while "id" correctly complains:
$ qemu-system-x86_64 -net user,id=n1 -net user,id=n1 qemu-system-x86_64: -net user,id=n1: Duplicate ID 'n1' for net
Instead of trying to fix the code for the legacy "name" parameter, let's rather get rid of this old interface and deprecate the "name" parameter now - this will also be less confusing for the users in the long run.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
--- net/net.c | 4 ++++ qemu-deprecated.texi | 5 +++++ 2 files changed, 9 insertions(+)
diff --git a/net/net.c b/net/net.c index 2a31339..cdcd5cf 100644 --- a/net/net.c +++ b/net/net.c @@ -984,6 +984,10 @@ static int net_client_init1(const void *object, bool is_netdev, Error **errp) /* missing optional values have been initialized to "all bits zero" */ name = net->has_id ? net->id : net->name;
+ if (net->has_name) { + warn_report("The 'name' parameter is deprecated, use 'id' instead"); + } + /* Map the old options to the new flat type */ switch (opts->type) { case NET_LEGACY_OPTIONS_TYPE_NONE: diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 8a2e399..60fd7f7 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -83,6 +83,11 @@ The 'file' driver for drives is no longer appropriate for character or host devices and will only accept regular files (S_IFREG). The correct driver for these file types is 'host_cdrom' or 'host_device' as appropriate.
+@subsection -net ...,name=@var{name} (since 3.1) + +The @option{name} parameter of the @option{-net} option is a synonym +for the @option{id} parameter, which should now be used instead. + @section QEMU Machine Protocol (QMP) commands
@subsection block-dirty-bitmap-add "autoload" parameter (since 2.12.0)

Thomas Huth <thuth@redhat.com> writes:
In early times, network backends were specified by a "vlan" and "name" tuple. With the introduction of netdevs, the "name" was replaced by an "id" (which is supposed to be unique), but the "name" parameter stayed as an alias which could be used instead of "id". Unfortunately, we miss the duplication check for "name":
$ qemu-system-x86_64 -net user,name=n1 -net user,name=n1
... starts without an error, while "id" correctly complains:
$ qemu-system-x86_64 -net user,id=n1 -net user,id=n1 qemu-system-x86_64: -net user,id=n1: Duplicate ID 'n1' for net
Instead of trying to fix the code for the legacy "name" parameter, let's
Has been that way for a long time without anyone complaining, so leaving it that way for a little longer is okay.
rather get rid of this old interface and deprecate the "name" parameter now - this will also be less confusing for the users in the long run.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>

The "name" in the [hub_id name] parameter tuple is the same as a "netdev_id" (which should be unique), so specifying the hub_id here is just redundant (it was likely just necessary in the past when the network subsystem was still using "vlans" only and when it did not use unique "id"s yet). Signed-off-by: Thomas Huth <thuth@redhat.com> --- net/slirp.c | 2 ++ qemu-deprecated.texi | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/net/slirp.c b/net/slirp.c index c18060f..c93b64d 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -404,6 +404,8 @@ static SlirpState *slirp_lookup(Monitor *mon, const char *hub_id, monitor_printf(mon, "unrecognized (hub-id, stackname) pair\n"); return NULL; } + warn_report("Using 'hub-id' is deprecated, specify the netdev id " + "directly instead"); } else { nc = qemu_find_netdev(name); if (!nc) { diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 60fd7f7..23fa78b 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -104,6 +104,13 @@ The ``query-cpus'' command is replaced by the ``query-cpus-fast'' command. The ``arch'' output member of the ``query-cpus-fast'' command is replaced by the ``target'' output member. +@section System emulator human monitor commands + +@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (since 3.1) + +The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and +'hostfwd_remove' HMP commands has been replaced by @option{netdev_id}. + @section System emulator devices @subsection ivshmem (since 2.6.0) -- 1.8.3.1

On 9/20/18 10:50 AM, Thomas Huth wrote:
The "name" in the [hub_id name] parameter tuple is the same as a "netdev_id" (which should be unique), so specifying the hub_id here is just redundant (it was likely just necessary in the past when the network subsystem was still using "vlans" only and when it did not use unique "id"s yet).
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
--- net/slirp.c | 2 ++ qemu-deprecated.texi | 7 +++++++ 2 files changed, 9 insertions(+)
diff --git a/net/slirp.c b/net/slirp.c index c18060f..c93b64d 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -404,6 +404,8 @@ static SlirpState *slirp_lookup(Monitor *mon, const char *hub_id, monitor_printf(mon, "unrecognized (hub-id, stackname) pair\n"); return NULL; } + warn_report("Using 'hub-id' is deprecated, specify the netdev id " + "directly instead"); } else { nc = qemu_find_netdev(name); if (!nc) { diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 60fd7f7..23fa78b 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -104,6 +104,13 @@ The ``query-cpus'' command is replaced by the ``query-cpus-fast'' command. The ``arch'' output member of the ``query-cpus-fast'' command is replaced by the ``target'' output member.
+@section System emulator human monitor commands + +@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (since 3.1) + +The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and +'hostfwd_remove' HMP commands has been replaced by @option{netdev_id}. + @section System emulator devices
@subsection ivshmem (since 2.6.0)

Thomas Huth <thuth@redhat.com> writes:
The "name" in the [hub_id name] parameter tuple is the same as a "netdev_id" (which should be unique), so specifying the hub_id here is just redundant (it was likely just necessary in the past when the network subsystem was still using "vlans" only and when it did not use unique "id"s yet).
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>

Commit 16f7244842b5135543ef068a1adafd94c6965953 added this parameter to the documentation, including a note that it is deprecated. But it has never been added to the "Deprecated features" appendix, which is our official way to deprecate legacy parameters. So let's do this now. Signed-off-by: Thomas Huth <thuth@redhat.com> --- hw/core/machine.c | 3 +++ qemu-deprecated.texi | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index 6b68e12..882e7b4 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -324,6 +324,9 @@ static void machine_set_enforce_config_section(Object *obj, bool value, { MachineState *ms = MACHINE(obj); + warn_report("enforce-config-section is deprecated. Use " + "-global migration.send-configuration=on|off instead"); + ms->enforce_config_section = value; } diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 23fa78b..f1e807c 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -35,6 +35,11 @@ which is the default. @section System emulator command line arguments +@subsection -machine enforce-config-section=on|off (since 3.1) + +The @option{enforce-config-section} parameter is replaced by the +@option{-global migration.send-configuration=@var{on|off}} option. + @subsection -no-kvm (since 1.3.0) The ``-no-kvm'' argument is now a synonym for setting -- 1.8.3.1

Thomas Huth <thuth@redhat.com> writes:
Commit 16f7244842b5135543ef068a1adafd94c6965953 added this parameter to the documentation, including a note that it is deprecated. But it has never been added to the "Deprecated features" appendix, which is our official way to deprecate legacy parameters. So let's do this now.
Signed-off-by: Thomas Huth <thuth@redhat.com> --- hw/core/machine.c | 3 +++ qemu-deprecated.texi | 5 +++++ 2 files changed, 8 insertions(+)
diff --git a/hw/core/machine.c b/hw/core/machine.c index 6b68e12..882e7b4 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -324,6 +324,9 @@ static void machine_set_enforce_config_section(Object *obj, bool value, { MachineState *ms = MACHINE(obj);
+ warn_report("enforce-config-section is deprecated. Use "
Comma, please.
+ "-global migration.send-configuration=on|off instead"); + ms->enforce_config_section = value; }
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 23fa78b..f1e807c 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -35,6 +35,11 @@ which is the default.
@section System emulator command line arguments
+@subsection -machine enforce-config-section=on|off (since 3.1) + +The @option{enforce-config-section} parameter is replaced by the +@option{-global migration.send-configuration=@var{on|off}} option. + @subsection -no-kvm (since 1.3.0)
The ``-no-kvm'' argument is now a synonym for setting
You keep the @item enforce-config-section=on|off in qemu-options.hx. Keeping it until we kill the option parameter is okay, but I'd drop now, since like to keep all the junk we don't want people to use anymore out of the first place they look for stuff they can use.

On 2018-09-20 20:13, Markus Armbruster wrote:
Thomas Huth <thuth@redhat.com> writes:
Commit 16f7244842b5135543ef068a1adafd94c6965953 added this parameter to the documentation, including a note that it is deprecated. But it has never been added to the "Deprecated features" appendix, which is our official way to deprecate legacy parameters. So let's do this now.
Signed-off-by: Thomas Huth <thuth@redhat.com> --- hw/core/machine.c | 3 +++ qemu-deprecated.texi | 5 +++++ 2 files changed, 8 insertions(+)
diff --git a/hw/core/machine.c b/hw/core/machine.c index 6b68e12..882e7b4 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -324,6 +324,9 @@ static void machine_set_enforce_config_section(Object *obj, bool value, { MachineState *ms = MACHINE(obj);
+ warn_report("enforce-config-section is deprecated. Use "
Comma, please.
Sure, I'll change it.
+ "-global migration.send-configuration=on|off instead"); + ms->enforce_config_section = value; }
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 23fa78b..f1e807c 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -35,6 +35,11 @@ which is the default.
@section System emulator command line arguments
+@subsection -machine enforce-config-section=on|off (since 3.1) + +The @option{enforce-config-section} parameter is replaced by the +@option{-global migration.send-configuration=@var{on|off}} option. + @subsection -no-kvm (since 1.3.0)
The ``-no-kvm'' argument is now a synonym for setting
You keep the @item enforce-config-section=on|off in qemu-options.hx. Keeping it until we kill the option parameter is okay, but I'd drop now, since like to keep all the junk we don't want people to use anymore out of the first place they look for stuff they can use.
The text from 16f7244842b5135543ef06 also contains the hint what should be used instead, so I think it's ok if we keep it until the option gets removed completely - and that's also the way we did it so far with all other deprecated options. Thomas

On Thu, Sep 20, 2018 at 10:50:16AM +0200, Thomas Huth wrote:
Commit 16f7244842b5135543ef068a1adafd94c6965953 added this parameter to the documentation, including a note that it is deprecated. But it has never been added to the "Deprecated features" appendix, which is our official way to deprecate legacy parameters. So let's do this now.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com> Regards, -- Peter Xu
participants (4)
-
Markus Armbruster
-
Peter Xu
-
Philippe Mathieu-Daudé
-
Thomas Huth