Re: [Qemu-devel] [PATCH v3 23/23] libqtest: Rename qtest_FOOv() to qtest_vFOO() for consistency

2018-08-12 Thread Paolo Bonzini
On 06/08/2018 08:53, Markus Armbruster wrote:
> 13 of 13 C99 library function pairs taking ... or a va_list parameter
> are called FOO() and vFOO().  In QEMU, we sometimes call the one
> taking a va_list FOOv() instead.  Bad taste.  libqtest.h uses both
> spellings.  Normalize it to the standard spelling.

Probably the bad example here was g_strdupv and g_strjoinv.  Those
however are taking a NULL-terminated char** [1] so the example was
copied incorrectly.

Paolo

[1] In this case, it's NULL not NUL. :)



[Qemu-devel] [PATCH v3 23/23] libqtest: Rename qtest_FOOv() to qtest_vFOO() for consistency

2018-08-06 Thread Markus Armbruster
13 of 13 C99 library function pairs taking ... or a va_list parameter
are called FOO() and vFOO().  In QEMU, we sometimes call the one
taking a va_list FOOv() instead.  Bad taste.  libqtest.h uses both
spellings.  Normalize it to the standard spelling.

Signed-off-by: Markus Armbruster 
Reviewed-by: Eric Blake 
---
 tests/libqtest.c | 12 ++--
 tests/libqtest.h |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/libqtest.c b/tests/libqtest.c
index a0d44793fa..3706f30aa2 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -538,7 +538,7 @@ QDict *qmp_fdv(int fd, const char *fmt, va_list ap)
 return qmp_fd_receive(fd);
 }
 
-QDict *qtest_qmpv(QTestState *s, const char *fmt, va_list ap)
+QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
 {
 qtest_qmp_vsend(s, fmt, ap);
 
@@ -572,7 +572,7 @@ QDict *qtest_qmp(QTestState *s, const char *fmt, ...)
 QDict *response;
 
 va_start(ap, fmt);
-response = qtest_qmpv(s, fmt, ap);
+response = qtest_vqmp(s, fmt, ap);
 va_end(ap);
 return response;
 }
@@ -608,7 +608,7 @@ void qtest_qmp_eventwait(QTestState *s, const char *event)
 qobject_unref(response);
 }
 
-char *qtest_hmpv(QTestState *s, const char *fmt, va_list ap)
+char *qtest_vhmp(QTestState *s, const char *fmt, va_list ap)
 {
 char *cmd;
 QDict *resp;
@@ -637,7 +637,7 @@ char *qtest_hmp(QTestState *s, const char *fmt, ...)
 char *ret;
 
 va_start(ap, fmt);
-ret = qtest_hmpv(s, fmt, ap);
+ret = qtest_vhmp(s, fmt, ap);
 va_end(ap);
 return ret;
 }
@@ -943,7 +943,7 @@ QDict *qmp(const char *fmt, ...)
 QDict *response;
 
 va_start(ap, fmt);
-response = qtest_qmpv(global_qtest, fmt, ap);
+response = qtest_vqmp(global_qtest, fmt, ap);
 va_end(ap);
 return response;
 }
@@ -963,7 +963,7 @@ char *hmp(const char *fmt, ...)
 char *ret;
 
 va_start(ap, fmt);
-ret = qtest_hmpv(global_qtest, fmt, ap);
+ret = qtest_vhmp(global_qtest, fmt, ap);
 va_end(ap);
 return ret;
 }
diff --git a/tests/libqtest.h b/tests/libqtest.h
index b92a8070a5..def1edaafa 100644
--- a/tests/libqtest.h
+++ b/tests/libqtest.h
@@ -106,7 +106,7 @@ void qtest_qmp_send(QTestState *s, const char *fmt, ...)
  *
  * Sends a QMP message to QEMU and returns the response.
  */
-QDict *qtest_qmpv(QTestState *s, const char *fmt, va_list ap)
+QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
 GCC_FMT_ATTR(2, 0);
 
 /**
@@ -189,7 +189,7 @@ char *qtest_hmp(QTestState *s, const char *fmt, ...) 
GCC_FMT_ATTR(2, 3);
  *
  * Returns: the command's output.  The caller should g_free() it.
  */
-char *qtest_hmpv(QTestState *s, const char *fmt, va_list ap)
+char *qtest_vhmp(QTestState *s, const char *fmt, va_list ap)
 GCC_FMT_ATTR(2, 0);
 
 /**
-- 
2.17.1




[Qemu-devel] [PATCH v3 23/23] libqtest: Rename qtest_FOOv() to qtest_vFOO() for consistency

2018-07-30 Thread Markus Armbruster
13 of 13 C99 library function pairs taking ... or a va_list parameter
are called FOO() and vFOO().  In QEMU, we sometimes call the one
taking a va_list FOOv() instead.  Bad taste.  libqtest.h uses both
spellings.  Normalize it to the standard spelling.

Signed-off-by: Markus Armbruster 
Reviewed-by: Eric Blake 
---
 tests/libqtest.c | 12 ++--
 tests/libqtest.h |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/libqtest.c b/tests/libqtest.c
index a0d44793fa..3706f30aa2 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -538,7 +538,7 @@ QDict *qmp_fdv(int fd, const char *fmt, va_list ap)
 return qmp_fd_receive(fd);
 }
 
-QDict *qtest_qmpv(QTestState *s, const char *fmt, va_list ap)
+QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
 {
 qtest_qmp_vsend(s, fmt, ap);
 
@@ -572,7 +572,7 @@ QDict *qtest_qmp(QTestState *s, const char *fmt, ...)
 QDict *response;
 
 va_start(ap, fmt);
-response = qtest_qmpv(s, fmt, ap);
+response = qtest_vqmp(s, fmt, ap);
 va_end(ap);
 return response;
 }
@@ -608,7 +608,7 @@ void qtest_qmp_eventwait(QTestState *s, const char *event)
 qobject_unref(response);
 }
 
-char *qtest_hmpv(QTestState *s, const char *fmt, va_list ap)
+char *qtest_vhmp(QTestState *s, const char *fmt, va_list ap)
 {
 char *cmd;
 QDict *resp;
@@ -637,7 +637,7 @@ char *qtest_hmp(QTestState *s, const char *fmt, ...)
 char *ret;
 
 va_start(ap, fmt);
-ret = qtest_hmpv(s, fmt, ap);
+ret = qtest_vhmp(s, fmt, ap);
 va_end(ap);
 return ret;
 }
@@ -943,7 +943,7 @@ QDict *qmp(const char *fmt, ...)
 QDict *response;
 
 va_start(ap, fmt);
-response = qtest_qmpv(global_qtest, fmt, ap);
+response = qtest_vqmp(global_qtest, fmt, ap);
 va_end(ap);
 return response;
 }
@@ -963,7 +963,7 @@ char *hmp(const char *fmt, ...)
 char *ret;
 
 va_start(ap, fmt);
-ret = qtest_hmpv(global_qtest, fmt, ap);
+ret = qtest_vhmp(global_qtest, fmt, ap);
 va_end(ap);
 return ret;
 }
diff --git a/tests/libqtest.h b/tests/libqtest.h
index 3848086928..7e60abc9fd 100644
--- a/tests/libqtest.h
+++ b/tests/libqtest.h
@@ -106,7 +106,7 @@ void qtest_qmp_send(QTestState *s, const char *fmt, ...)
  *
  * Sends a QMP message to QEMU and returns the response.
  */
-QDict *qtest_qmpv(QTestState *s, const char *fmt, va_list ap)
+QDict *qtest_vqmp(QTestState *s, const char *fmt, va_list ap)
 GCC_FMT_ATTR(2, 0);
 
 /**
@@ -189,7 +189,7 @@ char *qtest_hmp(QTestState *s, const char *fmt, ...) 
GCC_FMT_ATTR(2, 3);
  *
  * Returns: the command's output.  The caller should g_free() it.
  */
-char *qtest_hmpv(QTestState *s, const char *fmt, va_list ap)
+char *qtest_vhmp(QTestState *s, const char *fmt, va_list ap)
 GCC_FMT_ATTR(2, 0);
 
 /**
-- 
2.17.1