Removal of deprecated options and improvements for qtests
[Qemu-devel] [PULL 9/9] tests: add a qmp success-response test
In reply to Thomas HuthFrom: Marc-André Lureau <[email protected]>
Verify the usage of this schema feature and the API behaviour. This should be the only case where qmp_dispatch() returns NULL.
--- tests/qapi-schema/qapi-schema-test.json | 2 ++ tests/qapi-schema/qapi-schema-test.out | 2 ++ tests/test-qmp-cmds.c | 17 +++++++++++++++++ 3 files changed, 21 insertions(+)
tests/qapi-schema/qapi-schema-test.json +2 -0
@@ -137,6 +137,8 @@ 'data': {'ud1a': 'UserDefOne', '*ud1b': 'UserDefOne'}, 'returns': 'UserDefTwo' } +{ 'command': 'cmd-success-response', 'data': {}, 'success-response': false } + # Returning a non-dictionary requires a name from the whitelist { 'command': 'guest-get-time', 'data': {'a': 'int', '*b': 'int' }, 'returns': 'int' }
tests/qapi-schema/qapi-schema-test.out +2 -0
@@ -156,6 +156,8 @@ object q_obj_user_def_cmd2-arg member ud1b: UserDefOne optional=True command user_def_cmd2 q_obj_user_def_cmd2-arg -> UserDefTwo gen=True success_response=True boxed=False oob=False preconfig=False +command cmd-success-response None -> None + gen=True success_response=False boxed=False oob=False preconfig=False object q_obj_guest-get-time-arg member a: int optional=False member b: int optional=True
tests/test-qmp-cmds.c +17 -0
@@ -32,6 +32,10 @@ void qmp_test_flags_command(Error **errp) { } +void qmp_cmd_success_response (Error **errp) +{ +} +Empty2 *qmp_user_def_cmd0 (Error **errp) {return g_new0 (Empty2,1 );
@@ -153,6 +157,17 @@ static void test_dispatch_cmd_failure(void)qobject_unref (req); } +static void test_dispatch_cmd_success_response (void ) +{ +QDict *req =qdict_new (); +QDict *resp; + +qdict_put_str (req,"execute" ,"cmd-success-response" ); + resp =qmp_dispatch (&qmp_commands,QOBJECT (req), false); +g_assert_null (resp); +qobject_unref (req); +} +static QObject *test_qmp_dispatch (QDict *req) {QDict *resp;
@@ -289,6 +304,8 @@ int main(int argc, char **argv)g_test_add_func ("/qmp/dispatch_cmd" , test_dispatch_cmd);g_test_add_func ("/qmp/dispatch_cmd_failure" , test_dispatch_cmd_failure);g_test_add_func ("/qmp/dispatch_cmd_io" , test_dispatch_cmd_io); +g_test_add_func ("/qmp/dispatch_cmd_success_response" , + test_dispatch_cmd_success_response);g_test_add_func ("/qmp/dealloc_types" , test_dealloc_types);g_test_add_func ("/qmp/dealloc_partial" , test_dealloc_partial);
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 7/9] tests: add qmp/object-add-without-props test
In reply to Thomas HuthFrom: Marc-André Lureau <[email protected]>
test_object_add_without_props() tests a bug in qmp_object_add() we fixed in commit e64c75a975. Sadly, we don't have systematic object-add tests. This lone test can go into qmp-cmd-test for want of a better home.
--- tests/qmp-cmd-test.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
tests/qmp-cmd-test.c +18 -0
@@ -197,6 +197,19 @@ static void add_query_tests(QmpSchema *schema) } } +static void test_object_add_without_props (void ) +{ +QTestState *qts; +QDict *resp; + + qts =qtest_init (common_args); + resp =qtest_qmp (qts,"{'execute': 'object-add', 'arguments':" +" {'qom-type': 'memory-backend-ram', 'id': 'ram1' } }" ); +g_assert_nonnull (resp); +qmp_assert_error_class (resp,"GenericError" ); +qtest_quit (qts); +} +int main (int argc,char *argv[]) {QmpSchema schema;
@@ -206,6 +219,11 @@ int main(int argc, char *argv[])qmp_schema_init (&schema);add_query_tests (&schema); + +qtest_add_func ("qmp/object-add-without-props" , + test_object_add_without_props); +/* TODO: add coverage of generic object-add failure modes */ + ret =g_test_run ();qmp_schema_cleanup (&schema);
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 8/9] tests: add qmp/qom-set-without-value test
In reply to Thomas HuthFrom: Marc-André Lureau <[email protected]>
test_qom_set_without_value() is about a bug in infrastructure used by the QMP core, fixed in commit c489780203. We covered the bug in infrastructure unit tests (commit bce3035a44). I wrote that test earlier, to cover QMP level as well, the test could go into qmp-test.
--- tests/qmp-test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
tests/qmp-test.c +14 -0
@@ -321,6 +321,19 @@ static void test_qmp_preconfig(void)qtest_quit (qs); } +static void test_qom_set_without_value (void ) +{ +QTestState *qts; +QDict *resp; + + qts =qtest_init (common_args); + resp =qtest_qmp (qts,"{'execute': 'qom-set', 'arguments':" +" { 'path': '/machine', 'property': 'rtc-time' } }" ); +g_assert_nonnull (resp); +qmp_assert_error_class (resp,"GenericError" ); +qtest_quit (qts); +} +int main (int argc,char *argv[]) {g_test_init (&argc, &argv,NULL );
@@ -328,6 +341,7 @@ int main(int argc, char *argv[])qtest_add_func ("qmp/protocol" , test_qmp_protocol);qtest_add_func ("qmp/oob" , test_qmp_oob);qtest_add_func ("qmp/preconfig" , test_qmp_preconfig); +qtest_add_func ("qmp/qom-set-without-value" , test_qom_set_without_value);return g_test_run (); }
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 5/9] tests/libqos: Utilize newer glib spawn check
In reply to Thomas HuthFrom: Eric Blake <[email protected]>
During development, I got a 'make check' failure that claimed:
qemu-img returned status code 32512
**
ERROR:tests/libqos/libqos.c:202:mkimg: assertion failed: (!rc)
But 32512 is too big for a normal exit status value, which means we failed to use WEXITSTATUS() to shift the bits to the desired value for printing. However, instead of worrying about how to portably parse g_spawn()'s rc in the proper platform-dependent manner, it's better to just rely on the fact that we now require glib 2.40 (since commit e7b3af815) and can therefore use glib's portable checker instead, where the message under my same condition improves to:
Child process exited with code 127
**
ERROR:tests/libqos/libqos.c:192:mkimg: assertion failed: (ret && !err)
--- tests/libqos/libqos.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
tests/libqos/libqos.c +1 -11
@@ -185,22 +185,12 @@ void mkimg(const char *file, const char *fmt, unsigned size_mb) cli =g_strdup_printf ("%s create -f %s %s %uM" , qemu_img_abs_path, fmt, file, size_mb); ret =g_spawn_command_line_sync (cli, &out, &out2, &rc, &err); -if (err) { +if (err || !g_spawn_check_exit_status (rc, &err)) {fprintf (stderr,"%s\n" , err->message);g_error_free (err); }g_assert (ret && !err); -/* In glib 2.34, we have g_spawn_check_exit_status. in 2.12, we don't. -* glib 2.43.91 implementation assumes that any non-zero is an error for -* windows, but uses extra precautions for Linux. However, -* 0 is only possible if the program exited normally, so that should be -* sufficient for our purposes on all platforms, here. */ -if (rc) { -fprintf (stderr,"qemu-img returned status code %d\n" , rc); - } -g_assert (!rc); -g_free (out);g_free (out2);g_free (cli);
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 6/9] tests: add qmp_assert_error_class()
In reply to Thomas HuthFrom: Marc-André Lureau <[email protected]>
This helper will simplify a bunch of code checking for QMP errors and can be shared by various tests. Note that test-qga does check for error description as well, so don't replace the code there for now.
--- tests/drive_del-test.c | 5 +--- tests/libqtest.c | 11 ++++++++ tests/libqtest.h | 9 +++++++ tests/qmp-test.c | 73 ++++++++++++++++---------------------------------- tests/test-qga.c | 9 ++----- 5 files changed, 46 insertions(+), 61 deletions(-)
tests/drive_del-test.c +1 -4
@@ -67,7 +67,6 @@ static void test_after_failed_device_add(void) {char driver[32 ];QDict *response; -QDict *error;snprintf (driver,sizeof (driver),"virtio-blk-%s" ,qvirtio_get_dev_type ());
@@ -83,9 +82,7 @@ static void test_after_failed_device_add(void)" 'drive': 'drive0'" "}}", driver);g_assert (response); - error =qdict_get_qdict (response,"error" ); - g_assert_cmpstr(qdict_get_try_str(error, "class"), ==, "GenericError"); -qobject_unref (response); +qmp_assert_error_class (response,"GenericError" );/* Delete the drive */ drive_del ();
tests/libqtest.c +11 -0
@@ -1194,3 +1194,14 @@ bool qmp_rsp_is_err(QDict *rsp)qobject_unref (rsp);return !!error; } + +void qmp_assert_error_class (QDict *rsp,const char *class) +{ +QDict *error =qdict_get_qdict (rsp,"error" ); + + g_assert_cmpstr(qdict_get_try_str(error, "class"), ==, class); +g_assert_nonnull (qdict_get_try_str (error,"desc" )); +g_assert (!qdict_haskey (rsp,"return" )); + +qobject_unref (rsp); +}
tests/libqtest.h +9 -0
@@ -1004,4 +1004,13 @@ void qtest_qmp_device_del(const char *id);*/ bool qmp_rsp_is_err (QDict *rsp); +/** +* qmp_assert_error_class: +* @rsp: QMP response to check for error +* @class: an error class +* +* Assert the response has the given error class and discard @rsp. +*/ +void qmp_assert_error_class (QDict *rsp,const char *class); +#endif
tests/qmp-test.c +23 -50
151 lines not on this page · raw message
tests/test-qga.c +2 -7
@@ -244,17 +244,12 @@ static void test_qga_invalid_id(gconstpointer fix)static void test_qga_invalid_oob (gconstpointer fix) {const TestFixture *fixture = fix; -QDict *ret, *error; -const char *class; +QDict *ret; ret =qmp_fd (fixture->fd,"{'exec-oob': 'guest-ping'}" );g_assert_nonnull (ret); - error =qdict_get_qdict (ret,"error" ); - class =qdict_get_try_str (error,"class" ); - g_assert_cmpstr(class, ==, "GenericError"); - -qobject_unref (ret); +qmp_assert_error_class (ret,"GenericError" ); }static void test_qga_invalid_args (gconstpointer fix)
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 2/9] Remove the deprecated -nodefconfig option
In reply to Thomas HuthIt's the same as -no-user-config and marked as deprecated since three releases already. Time to remove it now.
--- docs/interop/live-block-operations.rst | 4 ++-- qemu-deprecated.texi | 4 ---- qemu-options.hx | 4 ++-- vl.c | 2 -- 4 files changed, 4 insertions(+), 10 deletions(-)
docs/interop/live-block-operations.rst +2 -2
@@ -129,7 +129,7 @@ To show some example invocations of command-line, we will use the following invocation of QEMU, with a QMP server running over UNIX socket:: - $ ./x86_64-softmmu/qemu-system-x86_64 -display none -nodefconfig \ + $ ./x86_64-softmmu/qemu-system-x86_64 -display none -no-user-config \ -M q35 -nodefaults -m 512 \ -blockdev node-name=node-A,driver=qcow2,file.driver=file,file.node-name=file,file.filename=./a.qcow2 \ -device virtio-blk,drive=node-A,id=virtio0 \
@@ -694,7 +694,7 @@ instance, with the following invocation. (As noted earlier, for simplicity's sake, the destination QEMU is started on the same host, but it could be located elsewhere):: - $ ./x86_64-softmmu/qemu-system-x86_64 -display none -nodefconfig \ + $ ./x86_64-softmmu/qemu-system-x86_64 -display none -no-user-config \ -M q35 -nodefaults -m 512 \ -blockdev node-name=node-TargetDisk,driver=qcow2,file.driver=file,file.node-name=file,file.filename=./target-disk.qcow2 \ -device virtio-blk,drive=node-TargetDisk,id=virtio0 \
qemu-deprecated.texi +0 -4
@@ -82,10 +82,6 @@ would automatically enable USB support on the machine type. If using the new syntax, USB support must be explicitly enabled via the ``-machine usb=on'' argument. -@subsection -nodefconfig (since 2.11.0) - -The ``-nodefconfig`` argument is a synonym for ``-no-user-config``. - @subsection -fsdev handle (since 2.12.0) The ``handle'' fsdev backend does not support symlinks and causes the 9p
qemu-options.hx +2 -2
@@ -3833,8 +3833,7 @@ Write device configuration to @var{file}. The @var{file} can be either filename command line and device configuration into file or dash @code{-}) character to print the output to stdout. This can be later used as input file for @code{-readconfig} option. ETEXI -HXCOMM Deprecated, same as -no-user-config -DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig, "", QEMU_ARCH_ALL) + DEF("no-user-config", 0, QEMU_OPTION_nouserconfig, "-no-user-config\n" " do not load default user-provided config files at startup\n",
@@ -3845,6 +3844,7 @@ STEXI The @code{-no-user-config} option makes QEMU not load any of the user-provided config files on @var{sysconfdir}. ETEXI + DEF("trace", HAS_ARG, QEMU_OPTION_trace, "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n" " specify tracing options\n",
vl.c +0 -2
@@ -2999,7 +2999,6 @@ int main(int argc, char **argv, char **envp) popt =lookup_opt (argc, argv, &optarg, &optind);switch (popt->index) { -case QEMU_OPTION_nodefconfig:case QEMU_OPTION_nouserconfig: userconfig = false;break ;
@@ -3927,7 +3926,6 @@ int main(int argc, char **argv, char **envp)case QEMU_OPTION_enable_sync_profile:qsp_enable ();break ; -case QEMU_OPTION_nodefconfig:case QEMU_OPTION_nouserconfig:/* Nothing to be parsed here. Especially, do not error out below. */ break ;
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 3/9] Remove the deprecated options -startdate, -localtime and -rtc-td-hack
In reply to Thomas HuthDeprecated since two releases, nobody complained, thus it's time to remove them now.
--- qemu-deprecated.texi | 13 --------- qemu-options.hx | 7 ----- vl.c | 76 +++++++++++++++------------------------------------- 3 files changed, 22 insertions(+), 74 deletions(-)
qemu-deprecated.texi +0 -13
@@ -96,19 +96,6 @@ The @code{--no-frame} argument works with SDL 1.2 only. The other user interfaces never implemented this in the first place. So this will be removed together with SDL 1.2 support. -@subsection -rtc-td-hack (since 2.12.0) - -The @code{-rtc-td-hack} option has been replaced by -@code{-rtc driftfix=slew}. - -@subsection -localtime (since 2.12.0) - -The @code{-localtime} option has been replaced by @code{-rtc base=localtime}. - -@subsection -startdate (since 2.12.0) - -The @code{-startdate} option has been replaced by @code{-rtc base=@var{date}}. - @subsection -virtioconsole (since 3.0.0) Option @option{-virtioconsole} has been replaced by
qemu-options.hx +0 -7
@@ -1711,9 +1711,6 @@ Windows 2000 is installed, you no longer need this option (this option slows down the IDE transfers). ETEXI -HXCOMM Deprecated by -rtc -DEF("rtc-td-hack", 0, QEMU_OPTION_rtc_td_hack, "", QEMU_ARCH_I386) - DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk, "-no-fd-bootchk disable boot signature checking for floppy disks\n", QEMU_ARCH_I386)
@@ -3471,10 +3468,6 @@ ETEXI HXCOMM Silently ignored for compatibility DEF("clock", HAS_ARG, QEMU_OPTION_clock, "", QEMU_ARCH_ALL) -HXCOMM Options deprecated by -rtc -DEF("localtime", 0, QEMU_OPTION_localtime, "", QEMU_ARCH_ALL) -DEF("startdate", HAS_ARG, QEMU_OPTION_startdate, "", QEMU_ARCH_ALL) - DEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \ "-rtc [base=utc|localtime|date][,clock=host|rt|vm][,driftfix=none|slew]\n" \ " set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n",
vl.c +22 -54
112 lines not on this page · raw message
Signature · 1 line
1.8.3.1
[Qemu-devel] [PULL 4/9] net: Remove the deprecated -tftp, -bootp, -redir and -smb options
In reply to Thomas HuthThese options likely do not work as expected as soon as the user tries to use more than one network interface at once. The parameters have been marked as deprecated since QEMU v2.6, so users had plenty of time to move their scripts to the new syntax. Time to remove the old parameters now.
--- include/net/net.h | 3 -- include/net/slirp.h | 4 -- net/slirp.c | 132 +++++++++++---------------------------------------- os-posix.c | 8 ---- qemu-deprecated.texi | 34 ------------- qemu-options.hx | 15 ------ vl.c | 18 ------- 7 files changed, 29 insertions(+), 185 deletions(-)
include/net/net.h +0 -3
@@ -201,9 +201,6 @@ extern NICInfo nd_table[MAX_NICS];extern const char *host_net_devices[];/* from net.c */ -extern const char *legacy_tftp_prefix; -extern const char *legacy_bootp_filename; -int net_client_parse (QemuOptsList *opts_list,const char *str);int net_init_clients (Error **errp);void net_check_clients (void );
include/net/slirp.h +0 -4
@@ -30,10 +30,6 @@void hmp_hostfwd_add (Monitor *mon,const QDict *qdict);void hmp_hostfwd_remove (Monitor *mon,const QDict *qdict); -int net_slirp_redir (const char *redir_str); - -int net_slirp_smb (const char *exported_dir); -void hmp_info_usernet (Monitor *mon,const QDict *qdict);#endif
net/slirp.c +29 -103
218 lines not on this page · raw message
os-posix.c +0 -8
@@ -168,14 +168,6 @@ static bool os_parse_runas_uid_gid(const char *optarg)int os_parse_cmd_args (int index,const char *optarg) {switch (index) { -#ifdef CONFIG_SLIRP -case QEMU_OPTION_smb: -error_report ("The -smb option is deprecated. " -"Please use '-netdev user,smb=...' instead." ); -if (net_slirp_smb (optarg) <0 ) -exit (1 ); -break ; -#endif case QEMU_OPTION_runas: user_pwd =getpwnam (optarg);if (user_pwd) {
qemu-deprecated.texi +0 -34
@@ -40,40 +40,6 @@ which is the default. The ``-no-kvm'' argument is now a synonym for setting ``-machine accel=tcg''. -@subsection -tftp (since 2.6.0) - -The ``-tftp /some/dir'' argument is replaced by either -``-netdev user,id=x,tftp=/some/dir '' (for pluggable NICs, accompanied -with ``-device ...,netdev=x''), or ``-nic user,tftp=/some/dir'' -(for embedded NICs). The new syntax allows different settings to be -provided per NIC. - -@subsection -bootp (since 2.6.0) - -The ``-bootp /some/file'' argument is replaced by either -``-netdev user,id=x,bootp=/some/file '' (for pluggable NICs, accompanied -with ``-device ...,netdev=x''), or ``-nic user,bootp=/some/file'' -(for embedded NICs). The new syntax allows different settings to be -provided per NIC. - -@subsection -redir (since 2.6.0) - -The ``-redir [tcp|udp]:hostport:[guestaddr]:guestport'' argument is -replaced by either -``-netdev user,id=x,hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport'' -(for pluggable NICs, accompanied with ``-device ...,netdev=x'') or -``-nic user,hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport'' -(for embedded NICs). The new syntax allows different settings to be -provided per NIC. - -@subsection -smb (since 2.6.0) - -The ``-smb /some/dir'' argument is replaced by either -``-netdev user,id=x,smb=/some/dir '' (for pluggable NICs, accompanied -with ``-device ...,netdev=x''), or ``-nic user,smb=/some/dir'' -(for embedded NICs). The new syntax allows different settings to be -provided per NIC. - @subsection -usbdevice (since 2.10.0) The ``-usbdevice DEV'' argument is now a synonym for setting
qemu-options.hx +0 -15
@@ -1813,16 +1813,6 @@ STEXI @table @option ETEXI -HXCOMM Legacy slirp options (now moved to -net user): -#ifdef CONFIG_SLIRP -DEF("tftp", HAS_ARG, QEMU_OPTION_tftp, "", QEMU_ARCH_ALL) -DEF("bootp", HAS_ARG, QEMU_OPTION_bootp, "", QEMU_ARCH_ALL) -DEF("redir", HAS_ARG, QEMU_OPTION_redir, "", QEMU_ARCH_ALL) -#ifndef _WIN32 -DEF("smb", HAS_ARG, QEMU_OPTION_smb, "", QEMU_ARCH_ALL) -#endif -#endif - DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, #ifdef CONFIG_SLIRP "-netdev user,id=str[,ipv4[=on|off]][,net=addr[/mask]][,host=addr]\n"
@@ -2150,11 +2140,6 @@ qemu-system-i386 -nic 'user,id=n1,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10 @end table -Note: Legacy stand-alone options -tftp, -bootp, -smb and -redir are still -processed and applied to -net user. Mixing them with the new configuration -syntax gives undefined results. Their use for new applications is discouraged -as they will be removed from future versions. - @item -netdev tap,id=@var{id}[,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,br=@var{bridge}][,helper=@var{helper}] Configure a host TAP network backend with ID @var{id}.
vl.c +0 -18
@@ -3168,24 +3168,6 @@ int main(int argc, char **argv, char **envp) }break ;#endif -#ifdef CONFIG_SLIRP -case QEMU_OPTION_tftp: -error_report ("The -tftp option is deprecated. " -"Please use '-netdev user,tftp=...' instead." ); - legacy_tftp_prefix = optarg; -break ; -case QEMU_OPTION_bootp: -error_report ("The -bootp option is deprecated. " -"Please use '-netdev user,bootfile=...' instead." ); - legacy_bootp_filename = optarg; -break ; -case QEMU_OPTION_redir: -error_report ("The -redir option is deprecated. " -"Please use '-netdev user,hostfwd=...' instead." ); -if (net_slirp_redir (optarg) <0 ) -exit (1 ); -break ; -#endif case QEMU_OPTION_bt:add_device_config (DEV_BT , optarg);break ;
Signature · 1 line
1.8.3.1
Hi Peter!
The following changes since commit 19b599f7664b2ebfd0f405fb79c14dd241557452:
Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2018-08-27-v2' into staging (2018-08-27 16:44:20 +0100)
are available in the git repository at:
https://gitlab.com/huth/qemu.git tags/pull-request-2018-08-31
for you to fetch changes up to ae6bf766048ecaeef90b85c4fb2b4db2aa0c094c:
tests: add a qmp success-response test (2018-08-31 09:53:10 +0200)
----------------------------------------------------------------
Removal of deprecated options and improvements for the qtests
----------------------------------------------------------------
Eric Blake (1):
tests/libqos: Utilize newer glib spawn check
Marc-André Lureau (4):
tests: add qmp_assert_error_class()
tests: add qmp/object-add-without-props test
tests: add qmp/qom-set-without-value test
tests: add a qmp success-response test
Thomas Huth (4):
Remove the deprecated -balloon option
Remove the deprecated -nodefconfig option
Remove the deprecated options -startdate, -localtime and -rtc-td-hack
net: Remove the deprecated -tftp, -bootp, -redir and -smb options
docs/interop/live-block-operations.rst | 4 +- docs/virtio-balloon-stats.txt | 6 +- include/net/net.h | 3 - include/net/slirp.h | 4 - net/slirp.c | 132 +++++++------------------------- os-posix.c | 8 -- qemu-deprecated.texi | 56 -------------- qemu-options.hx | 36 +-------- tests/drive_del-test.c | 5 +- tests/libqos/libqos.c | 12 +-- tests/libqtest.c | 11 +++ tests/libqtest.h | 9 +++ tests/qapi-schema/qapi-schema-test.json | 2 + tests/qapi-schema/qapi-schema-test.out | 2 + tests/qmp-cmd-test.c | 18 +++++ tests/qmp-test.c | 87 +++++++++------------ tests/test-qga.c | 9 +-- tests/test-qmp-cmds.c | 17 ++++ vl.c | 132 ++++++-------------------------- 19 files changed, 158 insertions(+), 395 deletions(-)
[Qemu-devel] [PULL 1/9] Remove the deprecated -balloon option
The "-balloon" option has been replaced by "-device virtio-balloon". It's been marked as deprecated since two releases, and nobody complained, so let's remove it now.
--- docs/virtio-balloon-stats.txt | 6 +++--- qemu-deprecated.texi | 5 ----- qemu-options.hx | 10 ---------- vl.c | 36 ------------------------------------ 4 files changed, 3 insertions(+), 54 deletions(-)
docs/virtio-balloon-stats.txt +3 -3
@@ -61,9 +61,9 @@ It's also important to note the following: respond to the request the timer will never be re-armed, which has the same effect as disabling polling -Here are a few examples. QEMU is started with '-balloon virtio', which -generates '/machine/peripheral-anon/device[1]' as the QOM path for the -balloon device. +Here are a few examples. QEMU is started with '-device virtio-balloon', +which generates '/machine/peripheral-anon/device[1]' as the QOM path for +the balloon device. Enable polling with 2 seconds interval:
qemu-deprecated.texi +0 -5
@@ -86,11 +86,6 @@ enabled via the ``-machine usb=on'' argument. The ``-nodefconfig`` argument is a synonym for ``-no-user-config``. -@subsection -balloon (since 2.12.0) - -The @option{--balloon virtio} argument has been superseded by -@option{--device virtio-balloon}. - @subsection -fsdev handle (since 2.12.0) The ``handle'' fsdev backend does not support symlinks and causes the 9p
qemu-options.hx +0 -10
@@ -454,16 +454,6 @@ modprobe i810_audio clocking=48000 @end example ETEXI -DEF("balloon", HAS_ARG, QEMU_OPTION_balloon, - "-balloon virtio[,addr=str]\n" - " enable virtio balloon device (deprecated)\n", QEMU_ARCH_ALL) -STEXI -@item -balloon virtio[,addr=@var{addr}] -@findex -balloon -Enable virtio balloon device, optionally with PCI address @var{addr}. This -option is deprecated, use @option{-device virtio-balloon} instead. -ETEXI - DEF("device", HAS_ARG, QEMU_OPTION_device, "-device driver[,prop[=value][,...]]\n" " add device (based on driver)\n"
vl.c +0 -36
@@ -2127,36 +2127,6 @@ static void parse_display(const char *p) } } -static int balloon_parse (const char *arg) -{ -QemuOpts *opts; - -warn_report ("This option is deprecated. " -"Use '--device virtio-balloon' to enable the balloon device." ); - -if (strcmp (arg,"none" ) ==0 ) { -return 0 ; - } - -if (!strncmp (arg,"virtio" ,6 )) { -if (arg[6 ] ==',' ) { -/* have params -> parse them */ - opts =qemu_opts_parse_noisily (qemu_find_opts ("device" ), arg +7 , - false); -if (!opts) -return -1 ; - }else { -/* create empty opts */ - opts =qemu_opts_create (qemu_find_opts ("device" ),NULL ,0 , - &error_abort); - } -qemu_opt_set (opts,"driver" ,"virtio-balloon" , &error_abort); -return 0 ; - } - -return -1 ; -} -char *qemu_find_file (int type,const char *name) {int i;
@@ -3660,12 +3630,6 @@ int main(int argc, char **argv, char **envp)case QEMU_OPTION_no_hpet: no_hpet =1 ;break ; -case QEMU_OPTION_balloon: -if (balloon_parse (optarg) <0 ) { -error_report ("unknown -balloon argument %s" , optarg); -exit (1 ); - } -break ;case QEMU_OPTION_no_reboot: no_reboot =1 ;break ;
Signature · 1 line
1.8.3.1
Re: [Qemu-devel] [PULL 8/9] tests: add qmp/qom-set-without-value test
In reply to Thomas HuthQuoted 39 lines · Thomas Huth
From: Marc-André Lureau <[email protected]>
test_qom_set_without_value()is about a bug in infrastructure used by the QMP core, fixed in commitc489780203. We covered the bug in infrastructure unit tests (commitbce3035a44). I wrote that test earlier, to cover QMP level as well, the test could go into qmp-test.Signed-off-by Marc-André Lureau <[email protected]>Reviewed-by Thomas Huth <[email protected]>Signed-off-by Thomas Huth <[email protected]>--- tests/qmp-test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)tests/qmp-test.c +13
-0@@ -321,6 +321,19 @@ static void test_qmp_preconfig(void)qtest_quit (qs); } +static void test_qom_set_without_value (void ) +{ +QTestState *qts; +QDict *resp; + + qts =qtest_init (common_args); + resp =qtest_qmp (qts,"{'execute': 'qom-set', 'arguments':" +" { 'path': '/machine', 'property': 'rtc-time' } }" ); +g_assert_nonnull (resp); +qmp_assert_error_class (resp,"GenericError" ); +qtest_quit (qts); +} +int main (int argc,char *argv[]) {g_test_init (&argc, &argv,NULL );
tests/qmp-test.c int main(int argc, char *argv[]) · line 347
Quoted 7 lines
tests/qmp-test.c +1
-0@@ -328,6 +341,7 @@ int main(int argc, char *argv[])qtest_add_func ("qmp/protocol" , test_qmp_protocol);qtest_add_func ("qmp/oob" , test_qmp_oob);qtest_add_func ("qmp/preconfig" , test_qmp_preconfig); +qtest_add_func ("qmp/qom-set-without-value" , test_qom_set_without_value);return g_test_run (); }
I'm afraid you missed my objection to naming:
Message-ID: <[email protected]>
https://lists.nongnu.org/archive/html/qemu-devel/2018-08/msg06368.html
If you could work that into PULL v2, I'd be obliged. If not, I'll have to address it in a follow-up patch.
Re: [Qemu-devel] [PULL 8/9] tests: add qmp/qom-set-without-value test
Quoted 46 lines · Markus Armbruster
Quoted 44 lines · Thomas Huth
From: Marc-André Lureau <[email protected]>
test_qom_set_without_value()is about a bug in infrastructure used by the QMP core, fixed in commitc489780203. We covered the bug in infrastructure unit tests (commitbce3035a44). I wrote that test earlier, to cover QMP level as well, the test could go into qmp-test.Signed-off-by Marc-André Lureau <[email protected]>Reviewed-by Thomas Huth <[email protected]>Signed-off-by Thomas Huth <[email protected]>--- tests/qmp-test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)tests/qmp-test.c +14
-0@@ -321,6 +321,19 @@ static void test_qmp_preconfig(void)qtest_quit (qs); } +static void test_qom_set_without_value (void ) +{ +QTestState *qts; +QDict *resp; + + qts =qtest_init (common_args); + resp =qtest_qmp (qts,"{'execute': 'qom-set', 'arguments':" +" { 'path': '/machine', 'property': 'rtc-time' } }" ); +g_assert_nonnull (resp); +qmp_assert_error_class (resp,"GenericError" ); +qtest_quit (qts); +} +int main (int argc,char *argv[]) {g_test_init (&argc, &argv,NULL );@@ -328,6 +341,7 @@ int main(int argc, char *argv[])qtest_add_func ("qmp/protocol" , test_qmp_protocol);qtest_add_func ("qmp/oob" , test_qmp_oob);qtest_add_func ("qmp/preconfig" , test_qmp_preconfig); +qtest_add_func ("qmp/qom-set-without-value" , test_qom_set_without_value);
Quoted 6 lines
tests/qmp-test.c int main(int argc, char *argv[]) · line 347
Quoted 2 lines
tests/qmp-test.c +0
-0return g_test_run (); }I'm afraid you missed my objection to naming:
Message-ID: <[email protected]>
https://lists.nongnu.org/archive/html/qemu-devel/2018-08/msg06368.html
Sorry about that, I was not on CC: for that series. I used the patches from v5 where Marc-André put me on CC:.
Quoted 2 lines
If you could work that into PULL v2, I'd be obliged. If not, I'll have to address it in a follow-up patch.
IMHO the naming is not that bad ... OTOH, I think Peter might already be away? ... so we've got plenty of time to sort this out anyway. Marc-André, could you send a new version of the patch?
Thomas
Re: [Qemu-devel] [PULL 8/9] tests: add qmp/qom-set-without-value test
Hi
Quoted 58 lines · Thomas Huth
Quoted 46 lines · Markus Armbruster
Quoted 44 lines · Thomas Huth
From: Marc-André Lureau <[email protected]>
test_qom_set_without_value()is about a bug in infrastructure used by the QMP core, fixed in commitc489780203. We covered the bug in infrastructure unit tests (commitbce3035a44). I wrote that test earlier, to cover QMP level as well, the test could go into qmp-test.Signed-off-by Marc-André Lureau <[email protected]>Reviewed-by Thomas Huth <[email protected]>Signed-off-by Thomas Huth <[email protected]>--- tests/qmp-test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)tests/qmp-test.c +14
-0@@ -321,6 +321,19 @@ static void test_qmp_preconfig(void)qtest_quit (qs); } +static void test_qom_set_without_value (void ) +{ +QTestState *qts; +QDict *resp; + + qts =qtest_init (common_args); + resp =qtest_qmp (qts,"{'execute': 'qom-set', 'arguments':" +" { 'path': '/machine', 'property': 'rtc-time' } }" ); +g_assert_nonnull (resp); +qmp_assert_error_class (resp,"GenericError" ); +qtest_quit (qts); +} +int main (int argc,char *argv[]) {g_test_init (&argc, &argv,NULL );@@ -328,6 +341,7 @@ int main(int argc, char *argv[])qtest_add_func ("qmp/protocol" , test_qmp_protocol);qtest_add_func ("qmp/oob" , test_qmp_oob);qtest_add_func ("qmp/preconfig" , test_qmp_preconfig); +qtest_add_func ("qmp/qom-set-without-value" , test_qom_set_without_value);Quoted 6 lines
tests/qmp-test.c int main(int argc, char *argv[]) · line 347
Quoted 2 lines
tests/qmp-test.c +0
-0return g_test_run (); }I'm afraid you missed my objection to naming:
Message-ID: <[email protected]>
https://lists.nongnu.org/archive/html/qemu-devel/2018-08/msg06368.htmlSorry about that, I was not on CC: for that series. I used the patches from v5 where Marc-André put me on CC:.
Quoted 6 lines
Quoted 2 lines
If you could work that into PULL v2, I'd be obliged. If not, I'll have to address it in a follow-up patch.
IMHO the naming is not that bad ... OTOH, I think Peter might already be away? ... so we've got plenty of time to sort this out anyway. Marc-André, could you send a new version of the patch?
Tbh, I don't care so much about the naming of the test, but (for once) I respectfully don't think Markus suggestion is better.
The function checks "qom-set" without 'value' argument:
"qom-set-without-value", no brainer..
Naming it "invalid-arg" is so generic that I wouldn't be able what it does.
Signature · 1 line
Marc-André Lureau
Re: [Qemu-devel] [PULL 8/9] tests: add qmp/qom-set-without-value test
Quoted 67 lines · Marc-André Lureau
Hi
Quoted 58 lines · Thomas Huth
Quoted 46 lines · Markus Armbruster
Quoted 44 lines · Thomas Huth
From: Marc-André Lureau <[email protected]>
test_qom_set_without_value()is about a bug in infrastructure used by the QMP core, fixed in commitc489780203. We covered the bug in infrastructure unit tests (commitbce3035a44). I wrote that test earlier, to cover QMP level as well, the test could go into qmp-test.Signed-off-by Marc-André Lureau <[email protected]>Reviewed-by Thomas Huth <[email protected]>Signed-off-by Thomas Huth <[email protected]>--- tests/qmp-test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)tests/qmp-test.c +14
-0@@ -321,6 +321,19 @@ static void test_qmp_preconfig(void)qtest_quit (qs); } +static void test_qom_set_without_value (void ) +{ +QTestState *qts; +QDict *resp; + + qts =qtest_init (common_args); + resp =qtest_qmp (qts,"{'execute': 'qom-set', 'arguments':" +" { 'path': '/machine', 'property': 'rtc-time' } }" ); +g_assert_nonnull (resp); +qmp_assert_error_class (resp,"GenericError" ); +qtest_quit (qts); +} +int main (int argc,char *argv[]) {g_test_init (&argc, &argv,NULL );@@ -328,6 +341,7 @@ int main(int argc, char *argv[])qtest_add_func ("qmp/protocol" , test_qmp_protocol);qtest_add_func ("qmp/oob" , test_qmp_oob);qtest_add_func ("qmp/preconfig" , test_qmp_preconfig); +qtest_add_func ("qmp/qom-set-without-value" , test_qom_set_without_value);Quoted 6 lines
tests/qmp-test.c int main(int argc, char *argv[]) · line 347
Quoted 2 lines
tests/qmp-test.c +0
-0return g_test_run (); }I'm afraid you missed my objection to naming:
Message-ID: <[email protected]>
https://lists.nongnu.org/archive/html/qemu-devel/2018-08/msg06368.htmlSorry about that, I was not on CC: for that series. I used the patches from v5 where Marc-André put me on CC:.
Quoted 6 lines
Quoted 2 lines
If you could work that into PULL v2, I'd be obliged. If not, I'll have to address it in a follow-up patch.
IMHO the naming is not that bad ... OTOH, I think Peter might already be away? ... so we've got plenty of time to sort this out anyway. Marc-André, could you send a new version of the patch?
Quoted 7 lines
Tbh, I don't care so much about the naming of the test, but (for once) I respectfully don't think Markus suggestion is better.
The function checks "qom-set" without 'value' argument:
"qom-set-without-value", no brainer..Naming it "invalid-arg" is so generic that I wouldn't be able what it does.
Ok, then let's keep it this way. As I said, IMHO the current naming is not really bad, and I also don't have any suggestions for a perfect name right now.
Thomas
Re: [Qemu-devel] [PULL 8/9] tests: add qmp/qom-set-without-value test
Quoted 68 lines · Thomas Huth
Quoted 67 lines · Marc-André Lureau
Hi
Quoted 64 lines · Thomas Huth
Quoted 46 lines · Markus Armbruster
Quoted 44 lines · Thomas Huth
From: Marc-André Lureau <[email protected]>
test_qom_set_without_value()is about a bug in infrastructure used by the QMP core, fixed in commitc489780203. We covered the bug in infrastructure unit tests (commitbce3035a44). I wrote that test earlier, to cover QMP level as well, the test could go into qmp-test.Signed-off-by Marc-André Lureau <[email protected]>Reviewed-by Thomas Huth <[email protected]>Signed-off-by Thomas Huth <[email protected]>--- tests/qmp-test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)tests/qmp-test.c +14
-0@@ -321,6 +321,19 @@ static void test_qmp_preconfig(void)qtest_quit (qs); } +static void test_qom_set_without_value (void ) +{ +QTestState *qts; +QDict *resp; + + qts =qtest_init (common_args); + resp =qtest_qmp (qts,"{'execute': 'qom-set', 'arguments':" +" { 'path': '/machine', 'property': 'rtc-time' } }" ); +g_assert_nonnull (resp); +qmp_assert_error_class (resp,"GenericError" ); +qtest_quit (qts); +} +int main (int argc,char *argv[]) {g_test_init (&argc, &argv,NULL );@@ -328,6 +341,7 @@ int main(int argc, char *argv[])qtest_add_func ("qmp/protocol" , test_qmp_protocol);qtest_add_func ("qmp/oob" , test_qmp_oob);qtest_add_func ("qmp/preconfig" , test_qmp_preconfig); +qtest_add_func ("qmp/qom-set-without-value" , test_qom_set_without_value);Quoted 6 lines
tests/qmp-test.c int main(int argc, char *argv[]) · line 347
Quoted 2 lines
tests/qmp-test.c +0
-0return g_test_run (); }I'm afraid you missed my objection to naming:
Message-ID: <[email protected]>
https://lists.nongnu.org/archive/html/qemu-devel/2018-08/msg06368.htmlSorry about that, I was not on CC: for that series. I used the patches from v5 where Marc-André put me on CC:.
Quoted 2 lines
If you could work that into PULL v2, I'd be obliged. If not, I'll have to address it in a follow-up patch.
IMHO the naming is not that bad ... OTOH, I think Peter might already be away? ... so we've got plenty of time to sort this out anyway. Marc-André, could you send a new version of the patch?
Quoted 5 lines
Quoted 5 lines
Tbh, I don't care so much about the naming of the test, but (for once) I respectfully don't think Markus suggestion is better.
The function checks "qom-set" without 'value' argument:
"qom-set-without-value", no brainer..
Nope, that's not what it tests. It tests the visitor, the marshalling code generator, and the QMP core handle a certain kind of invalid arguments correctly. It does not test qom-set. I explained all that already.
Quoted 1 line
Quoted 1 line
Naming it "invalid-arg" is so generic that I wouldn't be able what it does.
I can accept "missing-any" or "missing-any-arg". I object to any name involving qom-set, because the test is not about qom-set at all.
If it was, then putting it in qmp-test.c would be wrong.
Quoted 3 lines
Ok, then let's keep it this way. As I said, IMHO the current naming is not really bad, and I also don't have any suggestions for a perfect name right now.
We don't need a perfect name. We need one that's not actively misleading.
Re: [Qemu-devel] [PULL 8/9] tests: add qmp/qom-set-without-value test
Quoted 86 lines · Markus Armbruster
Quoted 68 lines · Thomas Huth
Quoted 67 lines · Marc-André Lureau
Hi
Quoted 64 lines · Thomas Huth
Quoted 46 lines · Markus Armbruster
Quoted 44 lines · Thomas Huth
From: Marc-André Lureau <[email protected]>
test_qom_set_without_value()is about a bug in infrastructure used by the QMP core, fixed in commitc489780203. We covered the bug in infrastructure unit tests (commitbce3035a44). I wrote that test earlier, to cover QMP level as well, the test could go into qmp-test.Signed-off-by Marc-André Lureau <[email protected]>Reviewed-by Thomas Huth <[email protected]>Signed-off-by Thomas Huth <[email protected]>--- tests/qmp-test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)tests/qmp-test.c +14
-0@@ -321,6 +321,19 @@ static void test_qmp_preconfig(void)qtest_quit (qs); } +static void test_qom_set_without_value (void ) +{ +QTestState *qts; +QDict *resp; + + qts =qtest_init (common_args); + resp =qtest_qmp (qts,"{'execute': 'qom-set', 'arguments':" +" { 'path': '/machine', 'property': 'rtc-time' } }" ); +g_assert_nonnull (resp); +qmp_assert_error_class (resp,"GenericError" ); +qtest_quit (qts); +} +int main (int argc,char *argv[]) {g_test_init (&argc, &argv,NULL );@@ -328,6 +341,7 @@ int main(int argc, char *argv[])qtest_add_func ("qmp/protocol" , test_qmp_protocol);qtest_add_func ("qmp/oob" , test_qmp_oob);qtest_add_func ("qmp/preconfig" , test_qmp_preconfig); +qtest_add_func ("qmp/qom-set-without-value" , test_qom_set_without_value);Quoted 6 lines
tests/qmp-test.c int main(int argc, char *argv[]) · line 347
Quoted 2 lines
tests/qmp-test.c +0
-0return g_test_run (); }I'm afraid you missed my objection to naming:
Message-ID: <[email protected]>
https://lists.nongnu.org/archive/html/qemu-devel/2018-08/msg06368.htmlSorry about that, I was not on CC: for that series. I used the patches from v5 where Marc-André put me on CC:.
Quoted 2 lines
If you could work that into PULL v2, I'd be obliged. If not, I'll have to address it in a follow-up patch.
IMHO the naming is not that bad ... OTOH, I think Peter might already be away? ... so we've got plenty of time to sort this out anyway. Marc-André, could you send a new version of the patch?
Quoted 5 lines
Quoted 5 lines
Tbh, I don't care so much about the naming of the test, but (for once) I respectfully don't think Markus suggestion is better.
The function checks "qom-set" without 'value' argument:
"qom-set-without-value", no brainer..Nope, that's not what it tests. It tests the visitor, the marshalling code generator, and the QMP core handle a certain kind of invalid arguments correctly. It does not test qom-set. I explained all that already.
Quoted 1 line
Quoted 1 line
Naming it "invalid-arg" is so generic that I wouldn't be able what it does.
I can accept "missing-any" or "missing-any-arg". I object to any name involving qom-set, because the test is not about qom-set at all.
Quoted 8 lines
If it was, then putting it in
qmp-test.cwould be wrong.Quoted 3 lines
Ok, then let's keep it this way. As I said, IMHO the current naming is not really bad, and I also don't have any suggestions for a perfect name right now.
We don't need a perfect name. We need one that's not actively misleading.
Ok, then let's cancel this PULL request. I'll send a new one after the "vacation freeze" (i.e. in three weeks), that should be enough time for both of you to come to an agreement about the best naming here.
Thomas
Re: [Qemu-devel] [PULL 8/9] tests: add qmp/qom-set-without-value test
In reply to Markus ArmbrusterQuoted 86 lines · Markus Armbruster
Quoted 68 lines · Thomas Huth
Quoted 67 lines · Marc-André Lureau
Hi
Quoted 64 lines · Thomas Huth
Quoted 46 lines · Markus Armbruster
Quoted 44 lines · Thomas Huth
From: Marc-André Lureau <[email protected]>
test_qom_set_without_value()is about a bug in infrastructure used by the QMP core, fixed in commitc489780203. We covered the bug in infrastructure unit tests (commitbce3035a44). I wrote that test earlier, to cover QMP level as well, the test could go into qmp-test.Signed-off-by Marc-André Lureau <[email protected]>Reviewed-by Thomas Huth <[email protected]>Signed-off-by Thomas Huth <[email protected]>--- tests/qmp-test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)tests/qmp-test.c +14
-0@@ -321,6 +321,19 @@ static void test_qmp_preconfig(void)qtest_quit (qs); } +static void test_qom_set_without_value (void ) +{ +QTestState *qts; +QDict *resp; + + qts =qtest_init (common_args); + resp =qtest_qmp (qts,"{'execute': 'qom-set', 'arguments':" +" { 'path': '/machine', 'property': 'rtc-time' } }" ); +g_assert_nonnull (resp); +qmp_assert_error_class (resp,"GenericError" ); +qtest_quit (qts); +} +int main (int argc,char *argv[]) {g_test_init (&argc, &argv,NULL );@@ -328,6 +341,7 @@ int main(int argc, char *argv[])qtest_add_func ("qmp/protocol" , test_qmp_protocol);qtest_add_func ("qmp/oob" , test_qmp_oob);qtest_add_func ("qmp/preconfig" , test_qmp_preconfig); +qtest_add_func ("qmp/qom-set-without-value" , test_qom_set_without_value);Quoted 6 lines
tests/qmp-test.c int main(int argc, char *argv[]) · line 347
Quoted 2 lines
tests/qmp-test.c +0
-0return g_test_run (); }I'm afraid you missed my objection to naming:
Message-ID: <[email protected]>
https://lists.nongnu.org/archive/html/qemu-devel/2018-08/msg06368.htmlSorry about that, I was not on CC: for that series. I used the patches from v5 where Marc-André put me on CC:.
Quoted 2 lines
If you could work that into PULL v2, I'd be obliged. If not, I'll have to address it in a follow-up patch.
IMHO the naming is not that bad ... OTOH, I think Peter might already be away? ... so we've got plenty of time to sort this out anyway. Marc-André, could you send a new version of the patch?
Quoted 5 lines
Quoted 5 lines
Tbh, I don't care so much about the naming of the test, but (for once) I respectfully don't think Markus suggestion is better.
The function checks "qom-set" without 'value' argument:
"qom-set-without-value", no brainer..Nope, that's not what it tests. It tests the visitor, the marshalling code generator, and the QMP core handle a certain kind of invalid arguments correctly. It does not test qom-set. I explained all that already.
Quoted 1 line
Quoted 1 line
Naming it "invalid-arg" is so generic that I wouldn't be able what it does.
I can accept "missing-any" or "missing-any-arg". I object to any name involving qom-set, because the test is not about qom-set at all.
Quoted 8 lines
If it was, then putting it in
qmp-test.cwould be wrong.Quoted 3 lines
Ok, then let's keep it this way. As I said, IMHO the current naming is not really bad, and I also don't have any suggestions for a perfect name right now.
We don't need a perfect name. We need one that's not actively misleading.
Marc-André, would "qmp/missing-any-arg" and test_missing_any_arg() work for you?
Re: [Qemu-devel] [PULL 8/9] tests: add qmp/qom-set-without-value test
Hi
Quoted 95 lines · Markus Armbruster
Quoted 92 lines · Markus Armbruster
Quoted 68 lines · Thomas Huth
Quoted 67 lines · Marc-André Lureau
Hi
Quoted 64 lines · Thomas Huth
Quoted 46 lines · Markus Armbruster
Quoted 44 lines · Thomas Huth
From: Marc-André Lureau <[email protected]>
test_qom_set_without_value()is about a bug in infrastructure used by the QMP core, fixed in commitc489780203. We covered the bug in infrastructure unit tests (commitbce3035a44). I wrote that test earlier, to cover QMP level as well, the test could go into qmp-test.Signed-off-by Marc-André Lureau <[email protected]>Reviewed-by Thomas Huth <[email protected]>Signed-off-by Thomas Huth <[email protected]>--- tests/qmp-test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)tests/qmp-test.c +14
-0@@ -321,6 +321,19 @@ static void test_qmp_preconfig(void)qtest_quit (qs); } +static void test_qom_set_without_value (void ) +{ +QTestState *qts; +QDict *resp; + + qts =qtest_init (common_args); + resp =qtest_qmp (qts,"{'execute': 'qom-set', 'arguments':" +" { 'path': '/machine', 'property': 'rtc-time' } }" ); +g_assert_nonnull (resp); +qmp_assert_error_class (resp,"GenericError" ); +qtest_quit (qts); +} +int main (int argc,char *argv[]) {g_test_init (&argc, &argv,NULL );@@ -328,6 +341,7 @@ int main(int argc, char *argv[])qtest_add_func ("qmp/protocol" , test_qmp_protocol);qtest_add_func ("qmp/oob" , test_qmp_oob);qtest_add_func ("qmp/preconfig" , test_qmp_preconfig); +qtest_add_func ("qmp/qom-set-without-value" , test_qom_set_without_value);Quoted 6 lines
tests/qmp-test.c int main(int argc, char *argv[]) · line 347
Quoted 2 lines
tests/qmp-test.c +0
-0return g_test_run (); }I'm afraid you missed my objection to naming:
Message-ID: <[email protected]>
https://lists.nongnu.org/archive/html/qemu-devel/2018-08/msg06368.htmlSorry about that, I was not on CC: for that series. I used the patches from v5 where Marc-André put me on CC:.
Quoted 2 lines
If you could work that into PULL v2, I'd be obliged. If not, I'll have to address it in a follow-up patch.
IMHO the naming is not that bad ... OTOH, I think Peter might already be away? ... so we've got plenty of time to sort this out anyway. Marc-André, could you send a new version of the patch?
Quoted 5 lines
Quoted 5 lines
Tbh, I don't care so much about the naming of the test, but (for once) I respectfully don't think Markus suggestion is better.
The function checks "qom-set" without 'value' argument:
"qom-set-without-value", no brainer..Nope, that's not what it tests. It tests the visitor, the marshalling code generator, and the QMP core handle a certain kind of invalid arguments correctly. It does not test qom-set. I explained all that already.
Quoted 1 line
Quoted 1 line
Naming it "invalid-arg" is so generic that I wouldn't be able what it does.
I can accept "missing-any" or "missing-any-arg". I object to any name involving qom-set, because the test is not about qom-set at all.
If it was, then putting it in
qmp-test.cwould be wrong.Quoted 3 lines
Ok, then let's keep it this way. As I said, IMHO the current naming is not really bad, and I also don't have any suggestions for a perfect name right now.
Quoted 5 lines
Quoted 2 lines
We don't need a perfect name. We need one that's not actively misleading.
Marc-André, would "qmp/missing-any-arg" and
test_missing_any_arg()work for you?
Yes, do you want me to update the patch?
Signature · 1 line
Marc-André Lureau
Re: [Qemu-devel] [PULL 8/9] tests: add qmp/qom-set-without-value test
Quoted 9 lines · Marc-André Lureau
Hi
Quoted 6 lines · Markus Armbruster
Quoted 3 lines · Markus Armbruster
Quoted 1 line · Thomas Huth
On 2018-08-31 15:24, Marc-André Lureau wrote:
[...]
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 5 lines
Quoted 5 lines
Tbh, I don't care so much about the naming of the test, but (for once) I respectfully don't think Markus suggestion is better.
The function checks "qom-set" without 'value' argument:
"qom-set-without-value", no brainer..Nope, that's not what it tests. It tests the visitor, the marshalling code generator, and the QMP core handle a certain kind of invalid arguments correctly. It does not test qom-set. I explained all that already.
Quoted 1 line
Quoted 1 line
Naming it "invalid-arg" is so generic that I wouldn't be able what it does.
I can accept "missing-any" or "missing-any-arg". I object to any name involving qom-set, because the test is not about qom-set at all.
If it was, then putting it in
qmp-test.cwould be wrong.Quoted 3 lines
Ok, then let's keep it this way. As I said, IMHO the current naming is not really bad, and I also don't have any suggestions for a perfect name right now.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
We don't need a perfect name. We need one that's not actively misleading.
Marc-André, would "qmp/missing-any-arg" and
test_missing_any_arg()work for you?Yes, do you want me to update the patch?
Yes, please.