qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
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] [RFC PATCH v1 3/5] VMState test: hmp interface for vmstate testing
Date: Mon,  7 Jul 2014 22:48:02 +0530	[thread overview]
Message-ID: <1404753484-26693-4-git-send-email-sanidhya.iiith@gmail.com> (raw)
In-Reply-To: <1404753484-26693-1-git-send-email-sanidhya.iiith@gmail.com>

Added hmp interface.

Signed-off-by: Sanidhya Kashyap <sanidhya.iiith@gmail.com>
---
 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

  parent reply	other threads:[~2014-07-07 17:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07 17:17 [Qemu-devel] [RFC PATCH v1 0/5] VMState testing Sanidhya Kashyap
2014-07-07 17:18 ` [Qemu-devel] [RFC PATCH v1 1/5] QEMUSizedBuffer/QEMUFile Sanidhya Kashyap
2014-07-07 18:28   ` Eric Blake
2014-07-08  7:48     ` Dr. David Alan Gilbert
2014-07-07 17:18 ` [Qemu-devel] [RFC PATCH v1 2/5] VMState test: basic vmstate testing mechanism Sanidhya Kashyap
2014-07-07 17:33   ` Eric Blake
2014-07-07 17:18 ` Sanidhya Kashyap [this message]
2014-07-07 17:18 ` [Qemu-devel] [RFC PATCH v1 4/5] VMState test: set the frequency of the vmstate testing process Sanidhya Kashyap
2014-07-07 18:25   ` Eric Blake
2014-07-18 18:59     ` Sanidhya Kashyap
2014-07-07 17:18 ` [Qemu-devel] [RFC PATCH v1 5/5] VMState test: cancel mechanism for an already running " Sanidhya Kashyap

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=1404753484-26693-4-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).