Checks
Commit Message
Remove the definition of `struct cmdline` from public header.
Deprecation notice:
https://mails.dpdk.org/archives/dev/2020-September/183310.html
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
I would also hide struct rdline to be able to alter buffer size,
but we don't have a deprecation notice for it.
doc/guides/rel_notes/deprecation.rst | 4 ----
doc/guides/rel_notes/release_21_11.rst | 2 ++
lib/cmdline/cmdline.h | 19 -------------------
lib/cmdline/cmdline_private.h | 8 +++++++-
4 files changed, 9 insertions(+), 24 deletions(-)
Comments
On Sat, Sep 11, 2021 at 1:17 AM Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> wrote:
>
> Remove the definition of `struct cmdline` from public header.
> Deprecation notice:
> https://mails.dpdk.org/archives/dev/2020-September/183310.html
>
> Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
This patch lgtm.
Acked-by: David Marchand <david.marchand@redhat.com>
> ---
> I would also hide struct rdline to be able to alter buffer size,
> but we don't have a deprecation notice for it.
Fyi, I found one project looking into a rdline pointer to get the back
reference to cmdline stored in opaque.
https://github.com/Gandi/packet-journey/blob/master/app/cmdline.c#L1398
This cmdline pointer is then dereferenced to get s_out.
Given that we announced cmdline becoming opaque, they would have to
handle the first API change in any case.
I don't think another API change would really make a big difference to them.
Plus, this project seems stuck to 18.08 support.
--
David Marchand
Hi Dmitry,
On Mon, Sep 20, 2021 at 01:11:23PM +0200, David Marchand wrote:
> On Sat, Sep 11, 2021 at 1:17 AM Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> wrote:
> >
> > Remove the definition of `struct cmdline` from public header.
> > Deprecation notice:
> > https://mails.dpdk.org/archives/dev/2020-September/183310.html
> >
> > Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
>
> This patch lgtm.
> Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Many thanks Dmitry for taking care of this.
> > ---
> > I would also hide struct rdline to be able to alter buffer size,
> > but we don't have a deprecation notice for it.
>
> Fyi, I found one project looking into a rdline pointer to get the back
> reference to cmdline stored in opaque.
> https://github.com/Gandi/packet-journey/blob/master/app/cmdline.c#L1398
>
> This cmdline pointer is then dereferenced to get s_out.
> Given that we announced cmdline becoming opaque, they would have to
> handle the first API change in any case.
> I don't think another API change would really make a big difference to them.
>
> Plus, this project seems stuck to 18.08 support.
I agree with you and David, it would make sense to also hide the rdline
struct at the same time.
Olivier
@@ -275,10 +275,6 @@ Deprecation Notices
* metrics: The function ``rte_metrics_init`` will have a non-void return
in order to notify errors instead of calling ``rte_exit``.
-* cmdline: ``cmdline`` structure will be made opaque to hide platform-specific
- content. On Linux and FreeBSD, supported prior to DPDK 20.11,
- original structure will be kept until DPDK 21.11.
-
* security: The functions ``rte_security_set_pkt_metadata`` and
``rte_security_get_userdata`` will be made inline functions and additional
flags will be added in structure ``rte_security_ctx`` in DPDK 21.11.
@@ -91,6 +91,8 @@ API Changes
Also, make sure to start the actual text at the margin.
=======================================================
+* cmdline: Made ``cmdline`` structure definition hidden on Linux and FreeBSD.
+
ABI Changes
-----------
@@ -7,10 +7,6 @@
#ifndef _CMDLINE_H_
#define _CMDLINE_H_
-#ifndef RTE_EXEC_ENV_WINDOWS
-#include <termios.h>
-#endif
-
#include <rte_common.h>
#include <rte_compat.h>
@@ -27,23 +23,8 @@
extern "C" {
#endif
-#ifndef RTE_EXEC_ENV_WINDOWS
-
-struct cmdline {
- int s_in;
- int s_out;
- cmdline_parse_ctx_t *ctx;
- struct rdline rdl;
- char prompt[RDLINE_PROMPT_SIZE];
- struct termios oldterm;
-};
-
-#else
-
struct cmdline;
-#endif /* RTE_EXEC_ENV_WINDOWS */
-
struct cmdline *cmdline_new(cmdline_parse_ctx_t *ctx, const char *prompt, int s_in, int s_out);
void cmdline_set_prompt(struct cmdline *cl, const char *prompt);
void cmdline_free(struct cmdline *cl);
@@ -11,6 +11,8 @@
#include <rte_os_shim.h>
#ifdef RTE_EXEC_ENV_WINDOWS
#include <rte_windows.h>
+#else
+#include <termios.h>
#endif
#include <cmdline.h>
@@ -22,6 +24,7 @@ struct terminal {
int is_console_input;
int is_console_output;
};
+#endif
struct cmdline {
int s_in;
@@ -29,11 +32,14 @@ struct cmdline {
cmdline_parse_ctx_t *ctx;
struct rdline rdl;
char prompt[RDLINE_PROMPT_SIZE];
+#ifdef RTE_EXEC_ENV_WINDOWS
struct terminal oldterm;
char repeated_char;
WORD repeat_count;
-};
+#else
+ struct termios oldterm;
#endif
+};
/* Disable buffering and echoing, save previous settings to oldterm. */
void terminal_adjust(struct cmdline *cl);