[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-2.11 3/5] qmp-shell: execute_cmdargs() method
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PATCH for-2.11 3/5] qmp-shell: execute_cmdargs() method |
Date: |
Fri, 4 Aug 2017 18:36:23 -0300 |
This will allow us to execute a command that was already split in
a list.
Signed-off-by: Eduardo Habkost <address@hidden>
---
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
- [Qemu-devel] [PATCH for-2.11 0/5] qmp-shell non-interactive mode, delete scripts/qmp/qmp, Eduardo Habkost, 2017/08/04
- [Qemu-devel] [PATCH for-2.11 4/5] qmp-shell: Accept QMP command as argument, Eduardo Habkost, 2017/08/04
- [Qemu-devel] [PATCH for-2.11 3/5] qmp-shell: execute_cmdargs() method,
Eduardo Habkost <=
- [Qemu-devel] [PATCH for-2.11 5/5] Remove scripts/qmp/qmp, Eduardo Habkost, 2017/08/04
- [Qemu-devel] [PATCH for-2.11 1/5] qmp-shell: Use argparse module, Eduardo Habkost, 2017/08/04
- [Qemu-devel] [PATCH for-2.11 2/5] qmp-shell: Pass split cmdargs to __build_cmd(), Eduardo Habkost, 2017/08/04
- Re: [Qemu-devel] [PATCH for-2.11 0/5] qmp-shell non-interactive mode, delete scripts/qmp/qmp, Fam Zheng, 2017/08/05