eab3a467 | 11-Dec-2020 |
Markus Armbruster <armbru@redhat.com> |
qobject: Change qobject_to_json()'s value to GString
qobject_to_json() and qobject_to_json_pretty() build a GString, then covert it to QString. Just one of the callers actually needs a QString: qem
qobject: Change qobject_to_json()'s value to GString
qobject_to_json() and qobject_to_json_pretty() build a GString, then covert it to QString. Just one of the callers actually needs a QString: qemu_rbd_parse_filename(). A few others need a string they can modify: qmp_send_response(), qga's send_response(), to_json_str(), and qmp_fd_vsend_fds(). The remainder just need a string.
Change qobject_to_json() and qobject_to_json_pretty() to return the GString.
qemu_rbd_parse_filename() now has to convert to QString. All others save a QString temporary. to_json_str() actually becomes a bit simpler, because GString provides more convenient modification functions.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201211171152.146877-6-armbru@redhat.com>
show more ...
|
20076f4a | 11-Dec-2020 |
Markus Armbruster <armbru@redhat.com> |
monitor: Use GString instead of QString for output buffer
GString has a richer set of string operations than QString. It should be preferred to QString except where we need a QObject or reference c
monitor: Use GString instead of QString for output buffer
GString has a richer set of string operations than QString. It should be preferred to QString except where we need a QObject or reference counting. We don't here. Switch to GString, and put its richer interface to use.
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201211171152.146877-3-armbru@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
show more ...
|
436054e2 | 11-Dec-2020 |
Markus Armbruster <armbru@redhat.com> |
hmp: Simplify how qmp_human_monitor_command() gets output
Commit 48c043d0d1 "hmp: human-monitor-command: stop using the Memory chardev driver" left us "if string is non-empty, duplicate it, else dup
hmp: Simplify how qmp_human_monitor_command() gets output
Commit 48c043d0d1 "hmp: human-monitor-command: stop using the Memory chardev driver" left us "if string is non-empty, duplicate it, else duplicate the empty string". Meh. Duplicate it unconditionally.
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201211171152.146877-2-armbru@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
show more ...
|
33b1fa94 | 24-Nov-2020 |
Yutao Ai <aiyutao@huawei.com> |
monitor:Don't use '#' flag of printf format ('%#') in format strings
Delete '#' and use '0x' prefix instead
Signed-off-by: Yutao Ai <aiyutao@huawei.com> Message-Id: <20201125014514.55562-4-aiyutao@
monitor:Don't use '#' flag of printf format ('%#') in format strings
Delete '#' and use '0x' prefix instead
Signed-off-by: Yutao Ai <aiyutao@huawei.com> Message-Id: <20201125014514.55562-4-aiyutao@huawei.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
show more ...
|
89854b95 | 24-Nov-2020 |
Yutao Ai <aiyutao@huawei.com> |
monitor:braces {} are necessary for all arms of this statement
Fix the errors by add {}
Signed-off-by: Yutao Ai <aiyutao@huawei.com> Message-Id: <20201125014514.55562-3-aiyutao@huawei.com> Reviewed
monitor:braces {} are necessary for all arms of this statement
Fix the errors by add {}
Signed-off-by: Yutao Ai <aiyutao@huawei.com> Message-Id: <20201125014514.55562-3-aiyutao@huawei.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
show more ...
|
e6dba048 | 11-Dec-2020 |
Alejandro Jimenez <alejandro.j.jimenez@oracle.com> |
qmp: generalize watchdog-set-action to -no-reboot/-no-shutdown
Add a QMP command to allow for the behaviors specified by the -no-reboot and -no-shutdown command line option to be set at runtime. The
qmp: generalize watchdog-set-action to -no-reboot/-no-shutdown
Add a QMP command to allow for the behaviors specified by the -no-reboot and -no-shutdown command line option to be set at runtime. The new command is named set-action and takes optional arguments, named after an event, that provide a corresponding action to take.
Example:
-> { "execute": "set-action", "arguments": { "reboot": "none", "shutdown": "poweroff", "watchdog": "debug" } } <- { "return": {} }
Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com> Message-Id: <1607705564-26264-4-git-send-email-alejandro.j.jimenez@oracle.com> [Split the series differently, with -action based on the QMP command. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
b4e1a342 | 27-Oct-2020 |
Paolo Bonzini <pbonzini@redhat.com> |
vl: remove separate preconfig main_loop
Move post-preconfig initialization to the x-exit-preconfig. If preconfig is not requested, just exit preconfig mode immediately with the QMP command.
As a r
vl: remove separate preconfig main_loop
Move post-preconfig initialization to the x-exit-preconfig. If preconfig is not requested, just exit preconfig mode immediately with the QMP command.
As a result, the preconfig loop will run with accel_setup_post and os_setup_post restrictions (xen_restrict, chroot, etc.) already done.
Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
99750d82 | 13-Nov-2020 |
Markus Armbruster <armbru@redhat.com> |
ui: Tweak a client_migrate_info error message
Change
Parameter 'protocol' expects spice
to
Parameter 'protocol' expects 'spice'
for consistency with similar error messages elsewhere.
Cc
ui: Tweak a client_migrate_info error message
Change
Parameter 'protocol' expects spice
to
Parameter 'protocol' expects 'spice'
for consistency with similar error messages elsewhere.
Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201113082626.2725812-7-armbru@redhat.com>
show more ...
|
9e1b9c6c | 13-Nov-2020 |
Markus Armbruster <armbru@redhat.com> |
ui: Improve a client_migrate_info error message
client_migrate_info reports spice_server_migrate_connect() failure as "An undefined error has occurred". Improve to "Could not set up display for mig
ui: Improve a client_migrate_info error message
client_migrate_info reports spice_server_migrate_connect() failure as "An undefined error has occurred". Improve to "Could not set up display for migration".
QERR_UNDEFINED_ERROR is now unused. Drop.
Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201113082626.2725812-6-armbru@redhat.com>
show more ...
|
9272186d | 13-Nov-2020 |
Markus Armbruster <armbru@redhat.com> |
ui: Improve some set_passwd, expire_password error messages
set_passwd and expire_password reject invalid "protocol" with "Invalid parameter 'protocol'". Misleading; the parameter is valid, its val
ui: Improve some set_passwd, expire_password error messages
set_passwd and expire_password reject invalid "protocol" with "Invalid parameter 'protocol'". Misleading; the parameter is valid, its value isn't. Improve to "Parameter 'protocol' expects 'vnc' or 'spice'".
expire_password fails with "Could not set password". Misleading; improve to "Could not set password expire time".
QERR_SET_PASSWD_FAILED is now unused. Drop.
Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201113082626.2725812-5-armbru@redhat.com>
show more ...
|
e7cff9c6 | 13-Nov-2020 |
Kevin Wolf <kwolf@redhat.com> |
hmp: Pass monitor to mon_get_cpu_env()
mon_get_cpu_env() is indirectly called monitor_parse_arguments() where the current monitor isn't set yet. Instead of using monitor_cur_env(), explicitly pass t
hmp: Pass monitor to mon_get_cpu_env()
mon_get_cpu_env() is indirectly called monitor_parse_arguments() where the current monitor isn't set yet. Instead of using monitor_cur_env(), explicitly pass the Monitor pointer to the function.
Without this fix, an HMP command like "x $pc" crashes like this:
#0 0x0000555555caa01f in mon_get_cpu_sync (mon=0x0, synchronize=true) at ../monitor/misc.c:270 #1 0x0000555555caa141 in mon_get_cpu (mon=0x0) at ../monitor/misc.c:294 #2 0x0000555555caa158 in mon_get_cpu_env () at ../monitor/misc.c:299 #3 0x0000555555b19739 in monitor_get_pc (mon=0x555556ad2de0, md=0x5555565d2d40 <monitor_defs+1152>, val=0) at ../target/i386/monitor.c:607 #4 0x0000555555cadbec in get_monitor_def (mon=0x555556ad2de0, pval=0x7fffffffc208, name=0x7fffffffc220 "pc") at ../monitor/misc.c:1681 #5 0x000055555582ec4f in expr_unary (mon=0x555556ad2de0) at ../monitor/hmp.c:387 #6 0x000055555582edbb in expr_prod (mon=0x555556ad2de0) at ../monitor/hmp.c:421 #7 0x000055555582ee79 in expr_logic (mon=0x555556ad2de0) at ../monitor/hmp.c:455 #8 0x000055555582eefe in expr_sum (mon=0x555556ad2de0) at ../monitor/hmp.c:484 #9 0x000055555582efe8 in get_expr (mon=0x555556ad2de0, pval=0x7fffffffc418, pp=0x7fffffffc408) at ../monitor/hmp.c:511 #10 0x000055555582fcd4 in monitor_parse_arguments (mon=0x555556ad2de0, endp=0x7fffffffc890, cmd=0x555556675b50 <hmp_cmds+7920>) at ../monitor/hmp.c:876 #11 0x00005555558306a8 in handle_hmp_command (mon=0x555556ad2de0, cmdline=0x555556ada452 "$pc") at ../monitor/hmp.c:1087 #12 0x000055555582df14 in monitor_command_cb (opaque=0x555556ad2de0, cmdline=0x555556ada450 "x $pc", readline_opaque=0x0) at ../monitor/hmp.c:47
After this fix, nothing is left in monitor_parse_arguments() that can indirectly call monitor_cur(), so the fix is complete.
Fixes: ff04108a0e36e822519c517bd3bddbc1c7747c18 Reported-by: lichun <lichun@ruijie.com.cn> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20201113114326.97663-4-kwolf@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
show more ...
|