Skip to contentSkip to conversation

qtest: Rename qtest.c:qtest_init()

PATCH In review Oleinik, Alexander 4 participants 4 messages Aug 5, 2019 – Aug 13, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qtest: Rename qtest.c:qtest_init()

Both the qtest client, libqtest.c, and server, qtest.c, used the same name for initialization functions which can cause confusion.

---
Thank you, Thomas Huth for the suggestion.

 include/sysemu/qtest.h | 2 +-
 qtest.c                | 3 +--
 vl.c                   | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)
include/sysemu/qtest.h +1 -1
index cd114b8d80..5ed09c80b1 100644
@@ -24,6 +24,6 @@ static inline bool qtest_enabled(void)
 
 bool qtest_driver(void);
 
-void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp);
+void qtest_server_init(const char *qtest_chrdev, const char *qtest_log, Error **errp);
 
 #endif
qtest.c +1 -2
index 15e27e911f..c9681dbdf3 100644
@@ -748,8 +748,7 @@ static void qtest_event(void *opaque, int event)
         break;
     }
 }
-
-void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp)
+void qtest_server_init(const char *qtest_chrdev, const char *qtest_log, Error **errp)
 {
     Chardev *chr;
 
vl.c +1 -1
index b426b32134..130a389712 100644
@@ -4197,7 +4197,7 @@ int main(int argc, char **argv, char **envp)
     migration_object_init();
 
     if (qtest_chrdev) {
-        qtest_init(qtest_chrdev, qtest_log, &error_fatal);
+        qtest_server_init(qtest_chrdev, qtest_log, &error_fatal);
     }
 
     machine_opts = qemu_get_machine_opts();
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Alexander

Both the qtest client, libqtest.c, and server, qtest.c, used the same name for initialization functions which can cause confusion.

---
Thank you, Thomas Huth for the suggestion.

Sometimes we use:

to give people credit in a way that our tooling has the ability to track. We don't really rigorously check or enforce such things, though.

Quoted 38 lines
 include/sysemu/qtest.h | 2 +-
 qtest.c                | 3 +--
 vl.c                   | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)
include/sysemu/qtest.h +1 -1
index cd114b8d80..5ed09c80b1 100644
@@ -24,6 +24,6 @@ static inline bool qtest_enabled(void)
 
 bool qtest_driver(void);
 
-void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp);
+void qtest_server_init(const char *qtest_chrdev, const char *qtest_log, Error **errp);
 
 #endif
qtest.c +1 -2
index 15e27e911f..c9681dbdf3 100644
@@ -748,8 +748,7 @@ static void qtest_event(void *opaque, int event)
         break;
     }
 }
-
-void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp)
+void qtest_server_init(const char *qtest_chrdev, const char *qtest_log, Error **errp)
 {
     Chardev *chr;
 
vl.c +0 -0
index b426b32134..130a389712 100644

vl.c int main(int argc, char **argv, char **envp) · line 4203

Quoted 8 lines
vl.c +1 -1
@@ -4197,7 +4197,7 @@ int main(int argc, char **argv, char **envp)
     migration_object_init();
 
     if (qtest_chrdev) {
-        qtest_init(qtest_chrdev, qtest_log, &error_fatal);
+        qtest_server_init(qtest_chrdev, qtest_log, &error_fatal);
     }
 
     machine_opts = qemu_get_machine_opts();

Makes good sense to me, that IS confusing.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Oleinik, Alexander
Quoted 11 lines · Alexander

Both the qtest client, libqtest.c, and server, qtest.c, used the same name for initialization functions which can cause confusion.

---
Thank you, Thomas Huth for the suggestion.

 include/sysemu/qtest.h | 2 +-
 qtest.c                | 3 +--
 vl.c                   | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)