qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vadim Galitsyn <vadim.galitsyn@profitbricks.com>
To: vadim.galitsyn@profitbricks.com,
	Markus Armbruster <armbru@redhat.com>,
	Eric Blake <eblake@redhat.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	qemu-devel@nongnu.org
Cc: Eduardo Otubo <eduardo.otubo@profitbricks.com>
Subject: [Qemu-devel] [PATCH 2/4] hmp: introduce 'writeconfig' command
Date: Mon, 23 Oct 2017 17:13:08 +0200	[thread overview]
Message-ID: <20171023151310.6462-3-vadim.galitsyn@profitbricks.com> (raw)
In-Reply-To: <20171023151310.6462-1-vadim.galitsyn@profitbricks.com>

Add 'writeconfig' command for HMP monitor. This command is a
sibling of QMP command 'writeconfig'.

This is a simple way to keep track of current state of VM
after series of hotplugs and/or hotunplugs of different devices.

Signed-off-by: Vadim Galitsyn <vadim.galitsyn@profitbricks.com>
Signed-off-by: Eduardo Otubo <eduardo.otubo@profitbricks.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org
---
 hmp.h           |  1 +
 hmp.c           |  9 +++++++++
 hmp-commands.hx | 17 +++++++++++++++++
 3 files changed, 27 insertions(+)

diff --git a/hmp.h b/hmp.h
index 3605003e4c..2730b7f7b9 100644
--- a/hmp.h
+++ b/hmp.h
@@ -146,5 +146,6 @@ void hmp_info_ramblock(Monitor *mon, const QDict *qdict);
 void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict);
 void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict);
 void hmp_info_memory_size_summary(Monitor *mon, const QDict *qdict);
+void hmp_writeconfig(Monitor *mon, const QDict *qdict);
 
 #endif
diff --git a/hmp.c b/hmp.c
index ec61329ebb..20af8ab870 100644
--- a/hmp.c
+++ b/hmp.c
@@ -2901,3 +2901,12 @@ void hmp_info_memory_size_summary(Monitor *mon, const QDict *qdict)
     }
     hmp_handle_error(mon, &err);
 }
+
+void hmp_writeconfig(Monitor *mon, const QDict *qdict)
+{
+     const char *file = qdict_get_str(qdict, "file");
+     Error *err = NULL;
+
+     qmp_writeconfig(file, &err);
+     hmp_handle_error(mon, &err);
+}
diff --git a/hmp-commands.hx b/hmp-commands.hx
index 1941e19932..98a3dc4b66 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1858,6 +1858,23 @@ ETEXI
         .sub_table  = info_cmds,
     },
 
+    {
+        .name       = "writeconfig",
+        .args_type  = "file:F",
+        .params     = "file",
+        .help       = "dump current configuration into specified file",
+        .cmd        = hmp_writeconfig,
+    },
+
+STEXI
+@item writeconfig @var{file}
+@findex writeconfig
+Dump current configuration into specified @var{file}.
+@example
+(qemu) writeconfig /tmp/qemu.conf
+@end example
+ETEXI
+
 STEXI
 @end table
 ETEXI
-- 
2.13.1.394.g41dd433

  parent reply	other threads:[~2017-10-23 15:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 15:13 [Qemu-devel] QMP, HMP: introduce 'writeconfig' command Vadim Galitsyn
2017-10-23 15:13 ` [Qemu-devel] [PATCH 1/4] qmp: " Vadim Galitsyn
2017-10-25 12:02   ` Eduardo Otubo
2017-10-26 11:37   ` Marc-André Lureau
2017-10-23 15:13 ` Vadim Galitsyn [this message]
2017-10-24 10:41   ` [Qemu-devel] [PATCH 2/4] hmp: " Dr. David Alan Gilbert
2017-10-25 12:04   ` Eduardo Otubo
2017-10-23 15:13 ` [Qemu-devel] [PATCH 3/4] tests: test-hmp: extend with " Vadim Galitsyn
2017-10-25 12:04   ` Eduardo Otubo
2017-10-23 15:13 ` [Qemu-devel] [PATCH 4/4] tests: test-hmp: print command execution result Vadim Galitsyn
2017-10-25 12:03   ` Eduardo Otubo
2017-12-14 11:00   ` Dr. David Alan Gilbert
2017-10-24 10:45 ` [Qemu-devel] QMP, HMP: introduce 'writeconfig' command Dr. David Alan Gilbert
2017-11-13 12:36   ` Markus Armbruster
2017-12-14 17:03 ` Eric Blake

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=20171023151310.6462-3-vadim.galitsyn@profitbricks.com \
    --to=vadim.galitsyn@profitbricks.com \
    --cc=armbru@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo.otubo@profitbricks.com \
    --cc=qemu-devel@nongnu.org \
    /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).