From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com
Subject: [Qemu-devel] [PATCH for-2.11 3/5] qmp-shell: execute_cmdargs() method
Date: Fri, 4 Aug 2017 18:36:23 -0300 [thread overview]
Message-ID: <20170804213625.3756-4-ehabkost@redhat.com> (raw)
In-Reply-To: <20170804213625.3756-1-ehabkost@redhat.com>
This will allow us to execute a command that was already split in
a list.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
scripts/qmp/qmp-shell | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell
index 5fe6162..6113aaf 100755
--- a/scripts/qmp/qmp-shell
+++ b/scripts/qmp/qmp-shell
@@ -260,7 +260,9 @@ class QMPShell(qmp.QEMUMonitorProtocol):
print str(jsobj)
def _execute_cmd(self, cmdline):
- cmdargs = cmdline.split()
+ return self.execute_cmdargs(cmdline.split())
+
+ def execute_cmdargs(self, cmdargs):
try:
qmpcmd = self.__build_cmd(cmdargs)
except Exception as e:
@@ -386,6 +388,9 @@ class HMPShell(QMPShell):
print '%s: %s' % (resp['error']['class'], resp['error']['desc'])
return True
+ def execute_cmdargs(self, cmdargs):
+ return self._execute_cmd(' '.join(cmdargs))
+
def show_banner(self):
QMPShell.show_banner(self, msg='Welcome to the HMP shell!')
--
2.9.4
next prev parent reply other threads:[~2017-08-04 21:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-04 21:36 [Qemu-devel] [PATCH for-2.11 0/5] qmp-shell non-interactive mode, delete scripts/qmp/qmp Eduardo Habkost
2017-08-04 21:36 ` [Qemu-devel] [PATCH for-2.11 1/5] qmp-shell: Use argparse module Eduardo Habkost
2017-08-08 10:07 ` Stefan Hajnoczi
2017-08-08 10:11 ` Daniel P. Berrange
2017-08-08 12:57 ` Eduardo Habkost
2017-08-04 21:36 ` [Qemu-devel] [PATCH for-2.11 2/5] qmp-shell: Pass split cmdargs to __build_cmd() Eduardo Habkost
2017-08-08 10:09 ` Stefan Hajnoczi
2017-08-04 21:36 ` Eduardo Habkost [this message]
2017-08-08 10:09 ` [Qemu-devel] [PATCH for-2.11 3/5] qmp-shell: execute_cmdargs() method Stefan Hajnoczi
2017-08-04 21:36 ` [Qemu-devel] [PATCH for-2.11 4/5] qmp-shell: Accept QMP command as argument Eduardo Habkost
2017-08-08 10:11 ` Stefan Hajnoczi
2017-08-04 21:36 ` [Qemu-devel] [PATCH for-2.11 5/5] Remove scripts/qmp/qmp Eduardo Habkost
2017-08-08 10:11 ` Stefan Hajnoczi
2017-08-05 14:56 ` [Qemu-devel] [PATCH for-2.11 0/5] qmp-shell non-interactive mode, delete scripts/qmp/qmp Fam Zheng
2017-08-05 19:11 ` Eduardo Habkost
2017-08-07 2:26 ` Fam Zheng
2017-08-07 22:20 ` John Snow
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=20170804213625.3756-4-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=armbru@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.