From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7jmE-0001xy-Vf for qemu-devel@nongnu.org; Thu, 17 Jul 2014 07:23:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7jm4-0003fT-G7 for qemu-devel@nongnu.org; Thu, 17 Jul 2014 07:23:06 -0400 Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]:36097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7jm4-0003er-55 for qemu-devel@nongnu.org; Thu, 17 Jul 2014 07:22:56 -0400 Received: by mail-pa0-f45.google.com with SMTP id eu11so3200583pac.32 for ; Thu, 17 Jul 2014 04:22:55 -0700 (PDT) From: Sanidhya Kashyap Date: Thu, 17 Jul 2014 16:51:20 +0530 Message-Id: <1405596081-29701-8-git-send-email-sanidhya.iiith@gmail.com> In-Reply-To: <1405596081-29701-1-git-send-email-sanidhya.iiith@gmail.com> References: <1405596081-29701-1-git-send-email-sanidhya.iiith@gmail.com> Subject: [Qemu-devel] [PATCH v4 7/8] BitmapLog: get the information about the parameters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu list Cc: Amit Shah , Sanidhya Kashyap , "Dr. David Alan Gilbert" , Juan Quintela Added the qmp interface to know about the information of the bitmap dump process. When the command is executed, one can know about the current epoch value in which the process is in, the total iterations value and the current frequency value. Currently, I do not think that that one needs to modify the other values except frequency, so that is why I have not added the generic set-tuning interface. If required, I will add it. Signed-off-by: Sanidhya Kashyap --- qapi-schema.json | 31 +++++++++++++++++++++++++++++++ qmp-commands.hx | 24 ++++++++++++++++++++++++ savevm.c | 26 ++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) diff --git a/qapi-schema.json b/qapi-schema.json index 90977eb..1b09235d 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3487,6 +3487,24 @@ { 'command': 'rtc-reset-reinjection' } ## +# @BitmapLogStateInfo +# +# Provides information for the bitmap logging process +# +# @currepoch: provides the value of the running epoch value +# +# @epochs: provides the information about the actual epoch +# +# @frequency: the time difference in milliseconds between each epcoh +# +# Since 2.2 +## +{ 'type': 'BitmapLogStateInfo', + 'data': { 'currepoch': 'int', + 'epochs': 'int', + 'frequency': 'int' } } + +## # @log-dirty-bitmap # # dumps the dirty bitmap to a file by logging the @@ -3524,3 +3542,16 @@ { 'command': 'log-dirty-bitmap-set-frequency', 'data': {'frequency': 'int' } } +## +# @log-dirty-bitmap-get-tuning +# +# Get the current values of the parameters involved in bitmap logging process +# +# This command returns the following elements in the form of BitmapLogStateInfo: +# - currepoch: current epoch value +# - epochs: total epochs for which the bitmap dumping will continue +# - frequently: the current sleep interval between each epoch +# +# Since 2.2 +## +{ 'command': 'log-dirty-bitmap-get-tuning', 'returns': 'BitmapLogStateInfo' } diff --git a/qmp-commands.hx b/qmp-commands.hx index 0a13b74..3bd60e1 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -3830,3 +3830,27 @@ Example: EQMP + { + .name = "log-dirty-bitmap-get-tuning", + .args_type = "", + .mhandler.cmd_new = qmp_marshal_input_log_dirty_bitmap_get_tuning, + }, + +SQMP +log-dirty-bitmap-get-tuning +-------------------- + +Get the parameters information + +- "currepoch": the current epoch going on +- "epochs" the total number of assigned epochs +- "frequency": the sleep interval between each epoch (in milliseconds) + +Example: + +-> { "execute": "log-dirty-bitmap-get-tuning" } +<- { "return": { + "currepoch": 3 + "epochs": 100 + "frequency": 100 } } +EQMP diff --git a/savevm.c b/savevm.c index d22771c..260c919 100644 --- a/savevm.c +++ b/savevm.c @@ -1495,6 +1495,32 @@ void qmp_log_dirty_bitmap_set_frequency(int64_t frequency, Error **errp) b->current_frequency = frequency; } +BitmapLogStateInfo *qmp_log_dirty_bitmap_get_tuning(Error **errp) +{ + BitmapLogState *b = logging_current_state(); + BitmapLogStateInfo *info = NULL; + + if (!runstate_check(RUN_STATE_DUMP_BITMAP) || + b->state != LOG_BITMAP_STATE_ACTIVE) { + return info; + } + + info = g_malloc0(sizeof(BitmapLogStateInfo)); + info->currepoch = b->current_epoch; + info->epochs = b->total_epochs; + info->frequency = b->current_frequency; + + if (!runstate_check(RUN_STATE_DUMP_BITMAP) || + b->state != LOG_BITMAP_STATE_ACTIVE) { + g_free(info); + info = NULL; + error_setg(errp, "Dirty bitmap dump process is not running\n"); + return info; + }; + + return info; +} + void qmp_xen_save_devices_state(const char *filename, Error **errp) { QEMUFile *f; -- 1.9.3