@@ -1820,6 +1820,21 @@ STEXI
Cancel the current bitmap dump process
ETEXI
+ {
+ .name = "ldbsf|log_dirty_bitmap_set_period",
+ .args_type = "period:i",
+ .params = "period",
+ .help = "set the period for bitmap dump process\n\t\t\t"
+ "period: the new period value to replace the existing",
+ .mhandler.cmd = hmp_log_dirty_bitmap_set_period,
+ },
+
+STEXI
+@item ldbsf or log_dirty_bitmap_set_period @var{period}
+@findex log_dirty_bitmap_set_period
+Set the period to @var{period} (int) for bitmap dump process.
+ETEXI
+
STEXI
@end table
ETEXI
@@ -1341,6 +1341,18 @@ void hmp_log_dirty_bitmap_cancel(Monitor *mon, const QDict *qdict)
qmp_log_dirty_bitmap_cancel(NULL);
}
+void hmp_log_dirty_bitmap_set_period(Monitor *mon, const QDict *qdict)
+{
+ int64_t period = qdict_get_int(qdict, "period");
+ Error *err = NULL;
+ qmp_log_dirty_bitmap_set_period(period, &err);
+ if (err) {
+ monitor_printf(mon, "log_dirty_bitmap_set_period: %s\n",
+ error_get_pretty(err));
+ error_free(err);
+ }
+}
+
void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict)
{
Error *err = NULL;
@@ -97,6 +97,7 @@ void hmp_object_del(Monitor *mon, const QDict *qdict);
void hmp_info_memdev(Monitor *mon, const QDict *qdict);
void hmp_log_dirty_bitmap(Monitor *mon, const QDict *qdict);
void hmp_log_dirty_bitmap_cancel(Monitor *mon, const QDict *qdict);
+void hmp_log_dirty_bitmap_set_period(Monitor *mon, const QDict *qdict);
void object_add_completion(ReadLineState *rs, int nb_args, const char *str);
void object_del_completion(ReadLineState *rs, int nb_args, const char *str);
void device_add_completion(ReadLineState *rs, int nb_args, const char *str);
@@ -3552,3 +3552,15 @@
# Since 2.2
##
{ 'command': 'log-dirty-bitmap-cancel' }
+
+##
+# @log-dirty-bitmap-set-period
+#
+# sets the period of the dirty bitmap logging process
+# @frequency: the updated period value (in milliseconds).
+# The min and max values are 10 and 100000 respectively.
+#
+# Since 2.2
+##
+{ 'command': 'log-dirty-bitmap-set-period',
+ 'data': { 'period': 'int' } }
@@ -3834,3 +3834,27 @@ Example:
-> { "execute": "log-dirty-bitmap-cancel" }
<- { "return": {} }
EQMP
+
+ {
+ .name = "log-dirty-bitmap-set-period",
+ .args_type = "period:i",
+ .mhandler.cmd_new = qmp_marshal_input_log_dirty_bitmap_set_period,
+ },
+
+SQMP
+log-dirty-bitmap-set-period
+---------------------------
+
+Update the period for the remaining iterations.
+
+Arguments:
+
+- "period": The updated period (json-int) (in milliseconds).
+ The min and max values are 10 and 100000 respectively.
+
+Example:
+
+-> { "execute": "log-dirty-bitmap-set-period", "arguments": { "period": 1024 } }
+<- { "return": {} }
+
+EQMP
@@ -1546,6 +1546,20 @@ void qmp_log_dirty_bitmap_cancel(Error **errp)
} while (b->state != LOG_BITMAP_STATE_CANCELING);
}
+void qmp_log_dirty_bitmap_set_period(int64_t period, Error **errp)
+{
+ BitmapLogState *b = log_bitmap_get_current_state();
+ Error *local_err = NULL;
+ if (value_in_range(period, MIN_PERIOD_VALUE,
+ MAX_PERIOD_VALUE, "period", &local_err)) {
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
+ }
+ b->current_period = period;
+}
+
void qmp_xen_save_devices_state(const char *filename, Error **errp)
{
QEMUFile *f;
No functional change except the variable name -- frequency has been modified to period. Signed-off-by: Sanidhya Kashyap <sanidhya.iiith@gmail.com> --- hmp-commands.hx | 15 +++++++++++++++ hmp.c | 12 ++++++++++++ hmp.h | 1 + qapi-schema.json | 12 ++++++++++++ qmp-commands.hx | 24 ++++++++++++++++++++++++ savevm.c | 14 ++++++++++++++ 6 files changed, 78 insertions(+)