aboutsummaryrefslogtreecommitdiff
path: root/block/monitor
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2022-09-29 12:42:12 +0100
committerAlex Bennée <alex.bennee@linaro.org>2022-10-06 11:53:40 +0100
commitbf0c50d4aa851e78c91096f510303831a2aadaeb (patch)
treec9a32bf2cb27868452159bd243d0e28c57b247da /block/monitor
parent3cc70a9994bf0967c7a2bda539ed43926fb4c2cb (diff)
monitor: expose monitor_puts to rest of code
This helps us construct strings elsewhere before echoing to the monitor. It avoids having to jump through hoops like: monitor_printf(mon, "%s", s->str); It will be useful in following patches but for now convert all existing plain "%s" printfs to use the _puts api. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220929114231.583801-33-alex.bennee@linaro.org>
Diffstat (limited to 'block/monitor')
-rw-r--r--block/monitor/block-hmp-cmds.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c
index bfb3c043a0..939a520d17 100644
--- a/block/monitor/block-hmp-cmds.c
+++ b/block/monitor/block-hmp-cmds.c
@@ -638,16 +638,16 @@ static void print_block_info(Monitor *mon, BlockInfo *info,
assert(!info || !info->has_inserted || info->inserted == inserted);
if (info && *info->device) {
- monitor_printf(mon, "%s", info->device);
+ monitor_puts(mon, info->device);
if (inserted && inserted->has_node_name) {
monitor_printf(mon, " (%s)", inserted->node_name);
}
} else {
assert(info || inserted);
- monitor_printf(mon, "%s",
- inserted && inserted->has_node_name ? inserted->node_name
- : info && info->has_qdev ? info->qdev
- : "<anonymous>");
+ monitor_puts(mon,
+ inserted && inserted->has_node_name ? inserted->node_name
+ : info && info->has_qdev ? info->qdev
+ : "<anonymous>");
}
if (inserted) {