From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4CZn-00069r-Uw for qemu-devel@nongnu.org; Mon, 07 Jul 2014 13:19:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4CZe-0000cJ-Ud for qemu-devel@nongnu.org; Mon, 07 Jul 2014 13:19:39 -0400 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]:41099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4CZe-0000cB-DW for qemu-devel@nongnu.org; Mon, 07 Jul 2014 13:19:30 -0400 Received: by mail-pa0-f41.google.com with SMTP id fb1so5818179pad.0 for ; Mon, 07 Jul 2014 10:19:29 -0700 (PDT) From: Sanidhya Kashyap Date: Mon, 7 Jul 2014 22:48:02 +0530 Message-Id: <1404753484-26693-4-git-send-email-sanidhya.iiith@gmail.com> In-Reply-To: <1404753484-26693-1-git-send-email-sanidhya.iiith@gmail.com> References: <1404753484-26693-1-git-send-email-sanidhya.iiith@gmail.com> Subject: [Qemu-devel] [RFC PATCH v1 3/5] VMState test: hmp interface for vmstate testing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu list Cc: Sanidhya Kashyap , "Dr. David Alan Gilbert" , Juan Quintela Added hmp interface. Signed-off-by: Sanidhya Kashyap --- hmp-commands.hx | 15 +++++++++++++++ hmp.c | 14 ++++++++++++++ hmp.h | 1 + 3 files changed, 30 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index d0943b1..c492f3f 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1788,6 +1788,21 @@ STEXI show available trace events and their state ETEXI + { + .name = "test-vmstates", + .args_type = "times:i?,sinterval:i?", + .params = "times sinterval", + .help = "test the vmstates by dumping and loading form memory\n\t\t\t" + "times: number of times, the vmstates will be tested\n\t\t\t" + "sinterval: sleep interval in milliseconds between each iteration", + .mhandler.cmd = hmp_test_vmstates, + }, +STEXI +@item test-vmstates +@findex test-vmstates +dumps and reads the device state's data from the memory for testing purpose +ETEXI + STEXI @end table ETEXI diff --git a/hmp.c b/hmp.c index 4d1838e..38ec5b3 100644 --- a/hmp.c +++ b/hmp.c @@ -1714,3 +1714,17 @@ void hmp_info_memdev(Monitor *mon, const QDict *qdict) monitor_printf(mon, "\n"); } + +void hmp_test_vmstates(Monitor *mon, const QDict *qdict) +{ + int64_t times = qdict_get_try_int(qdict, "times", 10); + int64_t sleep_interval = qdict_get_try_int(qdict, "sinterval", 100); + Error *err = NULL; + + qmp_test_vmstates(!!times, times, !!sleep_interval, sleep_interval, &err); + + if (err) { + monitor_printf(mon, "test-vmstates: %s\n", error_get_pretty(err)); + error_free(err); + } +} diff --git a/hmp.h b/hmp.h index 4fd3c4a..9f00997 100644 --- a/hmp.h +++ b/hmp.h @@ -94,6 +94,7 @@ void hmp_cpu_add(Monitor *mon, const QDict *qdict); void hmp_object_add(Monitor *mon, const QDict *qdict); void hmp_object_del(Monitor *mon, const QDict *qdict); void hmp_info_memdev(Monitor *mon, const QDict *qdict); +void hmp_test_vmstates(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); -- 1.9.3