qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qtest: Update references to parse_escape() in comments
@ 2020-11-09 16:26 Peter Maydell
  2020-11-09 17:02 ` Thomas Huth
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2020-11-09 16:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Paolo Bonzini, Thomas Huth, Markus Armbruster

In commit 61030280ca2d67bd in 2018 we renamed the parse_escape()
function to parse_interpolation(), but we didn't catch the references
to this function in doc comments in libqtest.h. Update them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Side note: ideally we would document somewhere the accepted
%-escapes rather than requiring people to read the source code
to parse_interpolation to determine them... "The argument to %p
is qobject_unref()ed" is particularly non-obvious.
---
 tests/qtest/libqos/libqtest.h | 18 +++++++++---------
 tests/qtest/libqtest-single.h |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/qtest/libqos/libqtest.h b/tests/qtest/libqos/libqtest.h
index 5c959f18535..724f65aa947 100644
--- a/tests/qtest/libqos/libqtest.h
+++ b/tests/qtest/libqos/libqtest.h
@@ -88,7 +88,7 @@ void qtest_quit(QTestState *s);
  * @fds: array of file descriptors
  * @fds_num: number of elements in @fds
  * @fmt: QMP message to send to qemu, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
  * supported after '%'.
  *
  * Sends a QMP message to QEMU with fds and returns the response.
@@ -101,7 +101,7 @@ QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num,
  * qtest_qmp:
  * @s: #QTestState instance to operate on.
  * @fmt: QMP message to send to qemu, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
  * supported after '%'.
  *
  * Sends a QMP message to QEMU and returns the response.
@@ -113,7 +113,7 @@ QDict *qtest_qmp(QTestState *s, const char *fmt, ...)
  * qtest_qmp_send:
  * @s: #QTestState instance to operate on.
  * @fmt: QMP message to send to qemu, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
  * supported after '%'.
  *
  * Sends a QMP message to QEMU and leaves the response in the stream.
@@ -138,7 +138,7 @@ void qtest_qmp_send_raw(QTestState *s, const char *fmt, ...)
  * @fds: array of file descriptors
  * @fds_num: number of elements in @fds
  * @fmt: QMP message to send to QEMU, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
  * supported after '%'.
  * @ap: QMP message arguments
  *
@@ -152,7 +152,7 @@ QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num,
  * qtest_vqmp:
  * @s: #QTestState instance to operate on.
  * @fmt: QMP message to send to QEMU, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
  * supported after '%'.
  * @ap: QMP message arguments
  *
@@ -167,7 +167,7 @@ QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
  * @fds: array of file descriptors
  * @fds_num: number of elements in @fds
  * @fmt: QMP message to send to QEMU, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
  * supported after '%'.
  * @ap: QMP message arguments
  *
@@ -181,7 +181,7 @@ void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num,
  * qtest_qmp_vsend:
  * @s: #QTestState instance to operate on.
  * @fmt: QMP message to send to QEMU, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
  * supported after '%'.
  * @ap: QMP message arguments
  *
@@ -636,7 +636,7 @@ void qtest_add_abrt_handler(GHookFunc fn, const void *data);
  * qtest_qmp_assert_success:
  * @qts: QTestState instance to operate on
  * @fmt: QMP message to send to qemu, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
  * supported after '%'.
  *
  * Sends a QMP message to QEMU and asserts that a 'return' key is present in
@@ -683,7 +683,7 @@ void qtest_qmp_device_add_qdict(QTestState *qts, const char *drv,
  * @driver: Name of the device that should be added
  * @id: Identification string
  * @fmt: QMP message to send to qemu, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
  * supported after '%'.
  *
  * Generic hot-plugging test via the device_add QMP command.
diff --git a/tests/qtest/libqtest-single.h b/tests/qtest/libqtest-single.h
index 176979a2ce9..0d7f568678e 100644
--- a/tests/qtest/libqtest-single.h
+++ b/tests/qtest/libqtest-single.h
@@ -47,7 +47,7 @@ static inline void qtest_end(void)
 /**
  * qmp:
  * @fmt...: QMP message to send to qemu, formatted like
- * qobject_from_jsonf_nofail().  See parse_escape() for what's
+ * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
  * supported after '%'.
  *
  * Sends a QMP message to QEMU and returns the response.
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] qtest: Update references to parse_escape() in comments
  2020-11-09 16:26 [PATCH] qtest: Update references to parse_escape() in comments Peter Maydell
@ 2020-11-09 17:02 ` Thomas Huth
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Huth @ 2020-11-09 17:02 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Laurent Vivier, Paolo Bonzini, Markus Armbruster

On 09/11/2020 17.26, Peter Maydell wrote:
> In commit 61030280ca2d67bd in 2018 we renamed the parse_escape()
> function to parse_interpolation(), but we didn't catch the references
> to this function in doc comments in libqtest.h. Update them.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Side note: ideally we would document somewhere the accepted
> %-escapes rather than requiring people to read the source code
> to parse_interpolation to determine them... "The argument to %p
> is qobject_unref()ed" is particularly non-obvious.
> ---
>  tests/qtest/libqos/libqtest.h | 18 +++++++++---------
>  tests/qtest/libqtest-single.h |  2 +-
>  2 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/qtest/libqos/libqtest.h b/tests/qtest/libqos/libqtest.h
> index 5c959f18535..724f65aa947 100644
> --- a/tests/qtest/libqos/libqtest.h
> +++ b/tests/qtest/libqos/libqtest.h
> @@ -88,7 +88,7 @@ void qtest_quit(QTestState *s);
>   * @fds: array of file descriptors
>   * @fds_num: number of elements in @fds
>   * @fmt: QMP message to send to qemu, formatted like
> - * qobject_from_jsonf_nofail().  See parse_escape() for what's
> + * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
>   * supported after '%'.
>   *
>   * Sends a QMP message to QEMU with fds and returns the response.
> @@ -101,7 +101,7 @@ QDict *qtest_qmp_fds(QTestState *s, int *fds, size_t fds_num,
>   * qtest_qmp:
>   * @s: #QTestState instance to operate on.
>   * @fmt: QMP message to send to qemu, formatted like
> - * qobject_from_jsonf_nofail().  See parse_escape() for what's
> + * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
>   * supported after '%'.
>   *
>   * Sends a QMP message to QEMU and returns the response.
> @@ -113,7 +113,7 @@ QDict *qtest_qmp(QTestState *s, const char *fmt, ...)
>   * qtest_qmp_send:
>   * @s: #QTestState instance to operate on.
>   * @fmt: QMP message to send to qemu, formatted like
> - * qobject_from_jsonf_nofail().  See parse_escape() for what's
> + * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
>   * supported after '%'.
>   *
>   * Sends a QMP message to QEMU and leaves the response in the stream.
> @@ -138,7 +138,7 @@ void qtest_qmp_send_raw(QTestState *s, const char *fmt, ...)
>   * @fds: array of file descriptors
>   * @fds_num: number of elements in @fds
>   * @fmt: QMP message to send to QEMU, formatted like
> - * qobject_from_jsonf_nofail().  See parse_escape() for what's
> + * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
>   * supported after '%'.
>   * @ap: QMP message arguments
>   *
> @@ -152,7 +152,7 @@ QDict *qtest_vqmp_fds(QTestState *s, int *fds, size_t fds_num,
>   * qtest_vqmp:
>   * @s: #QTestState instance to operate on.
>   * @fmt: QMP message to send to QEMU, formatted like
> - * qobject_from_jsonf_nofail().  See parse_escape() for what's
> + * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
>   * supported after '%'.
>   * @ap: QMP message arguments
>   *
> @@ -167,7 +167,7 @@ QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
>   * @fds: array of file descriptors
>   * @fds_num: number of elements in @fds
>   * @fmt: QMP message to send to QEMU, formatted like
> - * qobject_from_jsonf_nofail().  See parse_escape() for what's
> + * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
>   * supported after '%'.
>   * @ap: QMP message arguments
>   *
> @@ -181,7 +181,7 @@ void qtest_qmp_vsend_fds(QTestState *s, int *fds, size_t fds_num,
>   * qtest_qmp_vsend:
>   * @s: #QTestState instance to operate on.
>   * @fmt: QMP message to send to QEMU, formatted like
> - * qobject_from_jsonf_nofail().  See parse_escape() for what's
> + * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
>   * supported after '%'.
>   * @ap: QMP message arguments
>   *
> @@ -636,7 +636,7 @@ void qtest_add_abrt_handler(GHookFunc fn, const void *data);
>   * qtest_qmp_assert_success:
>   * @qts: QTestState instance to operate on
>   * @fmt: QMP message to send to qemu, formatted like
> - * qobject_from_jsonf_nofail().  See parse_escape() for what's
> + * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
>   * supported after '%'.
>   *
>   * Sends a QMP message to QEMU and asserts that a 'return' key is present in
> @@ -683,7 +683,7 @@ void qtest_qmp_device_add_qdict(QTestState *qts, const char *drv,
>   * @driver: Name of the device that should be added
>   * @id: Identification string
>   * @fmt: QMP message to send to qemu, formatted like
> - * qobject_from_jsonf_nofail().  See parse_escape() for what's
> + * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
>   * supported after '%'.
>   *
>   * Generic hot-plugging test via the device_add QMP command.
> diff --git a/tests/qtest/libqtest-single.h b/tests/qtest/libqtest-single.h
> index 176979a2ce9..0d7f568678e 100644
> --- a/tests/qtest/libqtest-single.h
> +++ b/tests/qtest/libqtest-single.h
> @@ -47,7 +47,7 @@ static inline void qtest_end(void)
>  /**
>   * qmp:
>   * @fmt...: QMP message to send to qemu, formatted like
> - * qobject_from_jsonf_nofail().  See parse_escape() for what's
> + * qobject_from_jsonf_nofail().  See parse_interpolation() for what's
>   * supported after '%'.
>   *
>   * Sends a QMP message to QEMU and returns the response.
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

... and queued for my next pull request.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-09 17:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-09 16:26 [PATCH] qtest: Update references to parse_escape() in comments Peter Maydell
2020-11-09 17:02 ` Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).