From: Sanidhya Kashyap <sanidhya.iiith@gmail.com>
To: qemu list <qemu-devel@nongnu.org>
Cc: Sanidhya Kashyap <sanidhya.iiith@gmail.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Juan Quintela <quintela@redhat.com>
Subject: [Qemu-devel] [PATCH v5 5/6] BitmapLog: set the period of the dump bitmap process
Date: Fri, 1 Aug 2014 08:42:30 +0530 [thread overview]
Message-ID: <1406862751-24008-6-git-send-email-sanidhya.iiith@gmail.com> (raw)
In-Reply-To: <1406862751-24008-1-git-send-email-sanidhya.iiith@gmail.com>
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(+)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index dcdc465..b36927d 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -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
diff --git a/hmp.c b/hmp.c
index e485788..4963c05 100644
--- a/hmp.c
+++ b/hmp.c
@@ -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;
diff --git a/hmp.h b/hmp.h
index fcfb10f..a5a0571 100644
--- a/hmp.h
+++ b/hmp.h
@@ -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);
diff --git a/qapi-schema.json b/qapi-schema.json
index b54c0ec..f24e850 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -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' } }
diff --git a/qmp-commands.hx b/qmp-commands.hx
index b339d55..43a989d 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -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
diff --git a/savevm.c b/savevm.c
index cbd4fc6..161724d 100644
--- a/savevm.c
+++ b/savevm.c
@@ -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;
--
1.9.3
next prev parent reply other threads:[~2014-08-01 3:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-01 3:12 [Qemu-devel] [PATCH v5 0/6] Obtain dirty bitmap via VM logging Sanidhya Kashyap
2014-08-01 3:12 ` [Qemu-devel] [PATCH v5 1/6] generic function between migration and bitmap dump Sanidhya Kashyap
2014-08-12 10:37 ` Dr. David Alan Gilbert
2014-08-01 3:12 ` [Qemu-devel] [PATCH v5 2/6] BitmapLog: bitmap dump code Sanidhya Kashyap
2014-08-12 11:15 ` Dr. David Alan Gilbert
2014-08-12 13:12 ` Eric Blake
2014-08-01 3:12 ` [Qemu-devel] [PATCH v5 3/6] BitmapLog: get the information about the parameters Sanidhya Kashyap
2014-08-12 11:20 ` Dr. David Alan Gilbert
2014-08-12 13:53 ` Eric Blake
2014-08-01 3:12 ` [Qemu-devel] [PATCH v5 4/6] BitmapLog: cancel mechanism for an already running dump bitmap process Sanidhya Kashyap
2014-08-12 13:55 ` Eric Blake
2014-08-01 3:12 ` Sanidhya Kashyap [this message]
2014-08-12 13:57 ` [Qemu-devel] [PATCH v5 5/6] BitmapLog: set the period of the " Eric Blake
2014-08-01 3:12 ` [Qemu-devel] [PATCH v5 6/6] BitmapLog: python script for extracting bitmap from a binary file Sanidhya Kashyap
2014-08-12 12:36 ` Dr. David Alan Gilbert
2014-08-12 14:04 ` Dr. David Alan Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406862751-24008-6-git-send-email-sanidhya.iiith@gmail.com \
--to=sanidhya.iiith@gmail.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).