* [PATCH] python, tests: do not use short-form boolean options
@ 2020-11-13 15:20 Paolo Bonzini
2020-11-17 9:20 ` Markus Armbruster
0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2020-11-13 15:20 UTC (permalink / raw)
To: qemu-devel
They are going to be deprecated, avoid warnings on stdout while the
tests run.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
python/qemu/machine.py | 2 +-
tests/qtest/pflash-cfi02-test.c | 4 ++--
tests/qtest/test-filter-redirector.c | 8 ++++----
tests/qtest/vhost-user-test.c | 8 ++++----
tests/test-char.c | 8 ++++----
5 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/python/qemu/machine.py b/python/qemu/machine.py
index 6420f01bed..06e3e22935 100644
--- a/python/qemu/machine.py
+++ b/python/qemu/machine.py
@@ -292,7 +292,7 @@ class QEMUMachine:
for _ in range(self._console_index):
args.extend(['-serial', 'null'])
if self._console_set:
- chardev = ('socket,id=console,path=%s,server,nowait' %
+ chardev = ('socket,id=console,path=%s,server=yes,wait=no' %
self._console_address)
args.extend(['-chardev', chardev])
if self._console_device_type is None:
diff --git a/tests/qtest/pflash-cfi02-test.c b/tests/qtest/pflash-cfi02-test.c
index afb702b565..60db81a3a2 100644
--- a/tests/qtest/pflash-cfi02-test.c
+++ b/tests/qtest/pflash-cfi02-test.c
@@ -261,7 +261,7 @@ static void test_geometry(const void *opaque)
const FlashConfig *config = opaque;
QTestState *qtest;
qtest = qtest_initf("-M musicpal"
- " -drive if=pflash,file=%s,format=raw,copy-on-read"
+ " -drive if=pflash,file=%s,format=raw,copy-on-read=on"
/* Device geometry properties. */
" -global driver=cfi.pflash02,"
"property=num-blocks0,value=%d"
@@ -581,7 +581,7 @@ static void test_cfi_in_autoselect(const void *opaque)
const FlashConfig *config = opaque;
QTestState *qtest;
qtest = qtest_initf("-M musicpal"
- " -drive if=pflash,file=%s,format=raw,copy-on-read",
+ " -drive if=pflash,file=%s,format=raw,copy-on-read=on",
image_path);
FlashConfig explicit_config = expand_config_defaults(config);
explicit_config.qtest = qtest;
diff --git a/tests/qtest/test-filter-redirector.c b/tests/qtest/test-filter-redirector.c
index 829db8c2ea..963fe2ba26 100644
--- a/tests/qtest/test-filter-redirector.c
+++ b/tests/qtest/test-filter-redirector.c
@@ -95,8 +95,8 @@ static void test_redirector_tx(void)
qts = qtest_initf(
"-netdev socket,id=qtest-bn0,fd=%d "
"-device %s,netdev=qtest-bn0,id=qtest-e0 "
- "-chardev socket,id=redirector0,path=%s,server,nowait "
- "-chardev socket,id=redirector1,path=%s,server,nowait "
+ "-chardev socket,id=redirector0,path=%s,server=yes,wait=no "
+ "-chardev socket,id=redirector1,path=%s,server=yes,wait=no "
"-chardev socket,id=redirector2,path=%s "
"-object filter-redirector,id=qtest-f0,netdev=qtest-bn0,"
"queue=tx,outdev=redirector0 "
@@ -165,8 +165,8 @@ static void test_redirector_rx(void)
qts = qtest_initf(
"-netdev socket,id=qtest-bn0,fd=%d "
"-device %s,netdev=qtest-bn0,id=qtest-e0 "
- "-chardev socket,id=redirector0,path=%s,server,nowait "
- "-chardev socket,id=redirector1,path=%s,server,nowait "
+ "-chardev socket,id=redirector0,path=%s,server=yes,wait=no "
+ "-chardev socket,id=redirector1,path=%s,server=yes,wait=no "
"-chardev socket,id=redirector2,path=%s "
"-object filter-redirector,id=qtest-f0,netdev=qtest-bn0,"
"queue=rx,indev=redirector0 "
diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c
index 3df5322614..2cf1208645 100644
--- a/tests/qtest/vhost-user-test.c
+++ b/tests/qtest/vhost-user-test.c
@@ -537,7 +537,7 @@ static void test_server_create_chr(TestServer *server, const gchar *opt)
static void test_server_listen(TestServer *server)
{
- test_server_create_chr(server, ",server,nowait");
+ test_server_create_chr(server, ",server=yes,wait=no");
}
static void test_server_free(TestServer *server)
@@ -846,7 +846,7 @@ static void *vhost_user_test_setup_reconnect(GString *cmd_line, void *arg)
g_thread_new("connect", connect_thread, s);
append_mem_opts(s, cmd_line, 256, TEST_MEMFD_AUTO);
- s->vu_ops->append_opts(s, cmd_line, ",server");
+ s->vu_ops->append_opts(s, cmd_line, ",server=yes");
g_test_queue_destroy(vhost_user_test_cleanup, s);
@@ -883,7 +883,7 @@ static void *vhost_user_test_setup_connect_fail(GString *cmd_line, void *arg)
g_thread_new("connect", connect_thread, s);
append_mem_opts(s, cmd_line, 256, TEST_MEMFD_AUTO);
- s->vu_ops->append_opts(s, cmd_line, ",server");
+ s->vu_ops->append_opts(s, cmd_line, ",server=yes");
g_test_queue_destroy(vhost_user_test_cleanup, s);
@@ -898,7 +898,7 @@ static void *vhost_user_test_setup_flags_mismatch(GString *cmd_line, void *arg)
g_thread_new("connect", connect_thread, s);
append_mem_opts(s, cmd_line, 256, TEST_MEMFD_AUTO);
- s->vu_ops->append_opts(s, cmd_line, ",server");
+ s->vu_ops->append_opts(s, cmd_line, ",server=yes");
g_test_queue_destroy(vhost_user_test_cleanup, s);
diff --git a/tests/test-char.c b/tests/test-char.c
index 9196e566e9..0eae2c266e 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -413,7 +413,7 @@ static void char_websock_test(void)
CharBackend client_be;
Chardev *chr_client;
Chardev *chr = qemu_chr_new("server",
- "websocket:127.0.0.1:0,server,nowait", NULL);
+ "websocket:127.0.0.1:0,server=yes,wait=no", NULL);
const char handshake[] = "GET / HTTP/1.1\r\n"
"Upgrade: websocket\r\n"
"Connection: Upgrade\r\n"
@@ -696,7 +696,7 @@ char_socket_addr_to_opt_str(SocketAddress *addr, bool fd_pass,
fd = ioc->fd;
ioc->fd = -1;
optstr = g_strdup_printf("socket,id=cdev0,fd=%d%s",
- fd, is_listen ? ",server,nowait" : "");
+ fd, is_listen ? ",server=yes,wait=no" : "");
object_unref(OBJECT(ioc));
return optstr;
} else {
@@ -706,13 +706,13 @@ char_socket_addr_to_opt_str(SocketAddress *addr, bool fd_pass,
addr->u.inet.host,
addr->u.inet.port,
reconnect ? reconnect : "",
- is_listen ? ",server,nowait" : "");
+ is_listen ? ",server=yes,wait=no" : "");
case SOCKET_ADDRESS_TYPE_UNIX:
return g_strdup_printf("socket,id=cdev0,path=%s%s%s",
addr->u.q_unix.path,
reconnect ? reconnect : "",
- is_listen ? ",server,nowait" : "");
+ is_listen ? ",server=yes,wait=no" : "");
default:
g_assert_not_reached();
--
2.26.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] python, tests: do not use short-form boolean options
2020-11-13 15:20 [PATCH] python, tests: do not use short-form boolean options Paolo Bonzini
@ 2020-11-17 9:20 ` Markus Armbruster
2020-11-17 11:08 ` Paolo Bonzini
0 siblings, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2020-11-17 9:20 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
Paolo Bonzini <pbonzini@redhat.com> writes:
> They are going to be deprecated, avoid warnings on stdout while the
> tests run.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> python/qemu/machine.py | 2 +-
> tests/qtest/pflash-cfi02-test.c | 4 ++--
> tests/qtest/test-filter-redirector.c | 8 ++++----
> tests/qtest/vhost-user-test.c | 8 ++++----
> tests/test-char.c | 8 ++++----
> 5 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/python/qemu/machine.py b/python/qemu/machine.py
> index 6420f01bed..06e3e22935 100644
> --- a/python/qemu/machine.py
> +++ b/python/qemu/machine.py
> @@ -292,7 +292,7 @@ class QEMUMachine:
> for _ in range(self._console_index):
> args.extend(['-serial', 'null'])
> if self._console_set:
> - chardev = ('socket,id=console,path=%s,server,nowait' %
> + chardev = ('socket,id=console,path=%s,server=yes,wait=no' %
Let's stick to the canonical 'on' and 'off'.
> self._console_address)
> args.extend(['-chardev', chardev])
> if self._console_device_type is None:
[More of the same...]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] python, tests: do not use short-form boolean options
2020-11-17 9:20 ` Markus Armbruster
@ 2020-11-17 11:08 ` Paolo Bonzini
2020-11-17 14:32 ` Markus Armbruster
0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2020-11-17 11:08 UTC (permalink / raw)
To: Markus Armbruster; +Cc: qemu-devel
On 17/11/20 10:20, Markus Armbruster wrote:
>> - chardev = ('socket,id=console,path=%s,server,nowait' %
>> + chardev = ('socket,id=console,path=%s,server=yes,wait=no' %
>
> Let's stick to the canonical 'on' and 'off'.
That was on purpose (for extra coverage and not just because variety is
the spice of life). But I can use the canonical values as well if you
prefer.
Paolo
>> self._console_address)
>> args.extend(['-chardev', chardev])
>> if self._console_device_type is None:
> [More of the same...]
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] python, tests: do not use short-form boolean options
2020-11-17 11:08 ` Paolo Bonzini
@ 2020-11-17 14:32 ` Markus Armbruster
2020-12-07 19:17 ` John Snow
0 siblings, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2020-11-17 14:32 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
Paolo Bonzini <pbonzini@redhat.com> writes:
> On 17/11/20 10:20, Markus Armbruster wrote:
>>> - chardev = ('socket,id=console,path=%s,server,nowait' %
>>> + chardev = ('socket,id=console,path=%s,server=yes,wait=no' %
>>
>> Let's stick to the canonical 'on' and 'off'.
>
> That was on purpose (for extra coverage and not just because variety is
> the spice of life). But I can use the canonical values as well if you
> prefer.
I think the place for extra coverage is tests/test-qemu-opts.c.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] python, tests: do not use short-form boolean options
2020-11-17 14:32 ` Markus Armbruster
@ 2020-12-07 19:17 ` John Snow
0 siblings, 0 replies; 5+ messages in thread
From: John Snow @ 2020-12-07 19:17 UTC (permalink / raw)
To: Markus Armbruster, Paolo Bonzini; +Cc: qemu-devel
On 11/17/20 9:32 AM, Markus Armbruster wrote:
> Paolo Bonzini <pbonzini@redhat.com> writes:
>
>> On 17/11/20 10:20, Markus Armbruster wrote:
>>>> - chardev = ('socket,id=console,path=%s,server,nowait' %
>>>> + chardev = ('socket,id=console,path=%s,server=yes,wait=no' %
>>>
>>> Let's stick to the canonical 'on' and 'off'.
>>
>> That was on purpose (for extra coverage and not just because variety is
>> the spice of life). But I can use the canonical values as well if you
>> prefer.
>
> I think the place for extra coverage is tests/test-qemu-opts.c.
>
>
Seconded; steer machine.py et al to something like a reference
implementation for how we want people to drive QEMU.
--js
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-12-07 19:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 15:20 [PATCH] python, tests: do not use short-form boolean options Paolo Bonzini
2020-11-17 9:20 ` Markus Armbruster
2020-11-17 11:08 ` Paolo Bonzini
2020-11-17 14:32 ` Markus Armbruster
2020-12-07 19:17 ` John Snow
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.