[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/9] monitor/hmp-cmds: don't silently output when running 'migrat
From: |
Mao Zhongyi |
Subject: |
[PATCH 4/9] monitor/hmp-cmds: don't silently output when running 'migrate_set_downtime' fails |
Date: |
Wed, 3 Jun 2020 16:08:59 +0800 |
Although 'migrate_set_downtime' has been deprecated and replaced
with 'migrate_set_parameter downtime_limit', it has not been
completely eliminated, possibly due to compatibility with older
versions. I think as long as this old parameter is running, we
should report appropriate message when something goes wrong, not
be silent.
before:
(qemu) migrate_set_downtime -1
(qemu)
after:
(qemu) migrate_set_downtime -1
Error: Parameter 'downtime_limit' expects an integer in the range of 0 to 2000
seconds
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
monitor/hmp-cmds.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index 8c3e436b39..6938f1060e 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -1188,8 +1188,11 @@ void hmp_migrate_pause(Monitor *mon, const QDict *qdict)
/* Kept for backwards compatibility */
void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict)
{
+ Error *err = NULL;
+
double value = qdict_get_double(qdict, "value");
- qmp_migrate_set_downtime(value, NULL);
+ qmp_migrate_set_downtime(value, &err);
+ hmp_handle_error(mon, err);
}
void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict)
--
2.17.1
- [PATCH 0/9] monitor/hmp-cmds: small improvements for migration, Mao Zhongyi, 2020/06/03
- [PATCH 6/9] monitor/hmp-cmds: add 'goto end' to reduce duplicate code., Mao Zhongyi, 2020/06/03
- [PATCH 5/9] monitor/hmp-cmds: delete redundant Error check before invoke hmp_handle_error(), Mao Zhongyi, 2020/06/03
- [PATCH 4/9] monitor/hmp-cmds: don't silently output when running 'migrate_set_downtime' fails,
Mao Zhongyi <=
- [PATCH 9/9] migration/ram: calculate un/encoded_size only when needed., Mao Zhongyi, 2020/06/03
- [PATCH 2/9] tests/migration: fix unreachable path in stress test, Mao Zhongyi, 2020/06/03
- [PATCH 7/9] monitor/hmp-cmds: improvements for the 'info migrate', Mao Zhongyi, 2020/06/03
- [PATCH 3/9] monitor/hmp-cmds: add units for migrate_parameters, Mao Zhongyi, 2020/06/03
- [PATCH 8/9] docs/xbzrle: update 'cache miss rate' and 'encoding rate' to docs, Mao Zhongyi, 2020/06/03
- [PATCH 1/9] tests/migration: mem leak fix, Mao Zhongyi, 2020/06/03