[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 18/18] qom: add test tools (v2)
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH v2 18/18] qom: add test tools (v2) |
Date: |
Fri, 2 Dec 2011 14:20:56 -0600 |
Signed-off-by: Anthony Liguori <address@hidden>
---
v1 -> v2
- fix comments (Stefan)
---
QMP/qom-get | 26 ++++++++++++++++++++++++++
QMP/qom-list | 30 ++++++++++++++++++++++++++++++
QMP/qom-set | 21 +++++++++++++++++++++
3 files changed, 77 insertions(+), 0 deletions(-)
create mode 100755 QMP/qom-get
create mode 100755 QMP/qom-list
create mode 100755 QMP/qom-set
diff --git a/QMP/qom-get b/QMP/qom-get
new file mode 100755
index 0000000..e6c063a
--- /dev/null
+++ b/QMP/qom-get
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+##
+# QEMU Object Model test tools
+#
+# Copyright IBM, Corp. 2011
+#
+# Authors:
+# Anthony Liguori <address@hidden>
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or later.
See
+# the COPYING file in the top-level directory.
+##
+
+import sys
+from qmp import QEMUMonitorProtocol
+
+srv = QEMUMonitorProtocol('/tmp/server.sock')
+srv.connect()
+
+path, prop = sys.argv[1].rsplit('.', 1)
+rsp = srv.command('qom-get', path=path, property=prop)
+if type(rsp) == dict:
+ for i in rsp.keys():
+ print '%s: %s' % (i, rsp[i])
+else:
+ print rsp
diff --git a/QMP/qom-list b/QMP/qom-list
new file mode 100755
index 0000000..b91f814
--- /dev/null
+++ b/QMP/qom-list
@@ -0,0 +1,30 @@
+#!/usr/bin/python
+##
+# QEMU Object Model test tools
+#
+# Copyright IBM, Corp. 2011
+#
+# Authors:
+# Anthony Liguori <address@hidden>
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or later.
See
+# the COPYING file in the top-level directory.
+##
+
+import sys
+from qmp import QEMUMonitorProtocol
+
+srv = QEMUMonitorProtocol('/tmp/server.sock')
+srv.connect()
+
+if len(sys.argv) == 1:
+ print '/'
+ sys.exit(0)
+
+for item in srv.command('qom-list', path=sys.argv[1]):
+ if item['type'].startswith('child<'):
+ print '%s/' % item['name']
+ elif item['type'].startswith('link<'):
+ print '@%s/' % item['name']
+ else:
+ print '%s' % item['name']
diff --git a/QMP/qom-set b/QMP/qom-set
new file mode 100755
index 0000000..c5589d8
--- /dev/null
+++ b/QMP/qom-set
@@ -0,0 +1,21 @@
+#!/usr/bin/python
+##
+# QEMU Object Model test tools
+#
+# Copyright IBM, Corp. 2011
+#
+# Authors:
+# Anthony Liguori <address@hidden>
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or later.
See
+# the COPYING file in the top-level directory.
+##
+
+import sys
+from qmp import QEMUMonitorProtocol
+
+srv = QEMUMonitorProtocol('/tmp/server.sock')
+srv.connect()
+
+path, prop = sys.argv[1].rsplit('.', 1)
+print srv.command('qom-set', path=path, property=prop, value=sys.argv[2])
--
1.7.4.1
- [Qemu-devel] [PATCH v2 13/18] dev: add an anonymous peripheral container, (continued)
- [Qemu-devel] [PATCH v2 13/18] dev: add an anonymous peripheral container, Anthony Liguori, 2011/12/02
- [Qemu-devel] [PATCH v2 12/18] qdev: add explicitly named devices to the root complex, Anthony Liguori, 2011/12/02
- [Qemu-devel] [PATCH v2 09/18] qapi: allow a 'gen' key to suppress code generation, Anthony Liguori, 2011/12/02
- [Qemu-devel] [PATCH v2 14/18] rtc: make piix3 set the rtc as a child (v2), Anthony Liguori, 2011/12/02
- [Qemu-devel] [PATCH v2 16/18] qom: optimize qdev_get_canonical_path using a parent link, Anthony Liguori, 2011/12/02
- [Qemu-devel] [PATCH v2 18/18] qom: add test tools (v2),
Anthony Liguori <=
- [Qemu-devel] [PATCH v2 17/18] qmp: make qmp.py easier to use, Anthony Liguori, 2011/12/02
- [Qemu-devel] [PATCH v2 15/18] rtc: add a dynamic property for retrieving the date, Anthony Liguori, 2011/12/02
- Re: [Qemu-devel] [PATCH v2 15/18] rtc: add a dynamic property for retrieving the date, Kevin Wolf, 2011/12/09
- Re: [Qemu-devel] [PATCH v2 15/18] rtc: add a dynamic property for retrieving the date, Anthony Liguori, 2011/12/09
- Re: [Qemu-devel] [PATCH v2 15/18] rtc: add a dynamic property for retrieving the date, Kevin Wolf, 2011/12/09
- Re: [Qemu-devel] [PATCH v2 15/18] rtc: add a dynamic property for retrieving the date, Anthony Liguori, 2011/12/09
- Re: [Qemu-devel] [PATCH v2 15/18] rtc: add a dynamic property for retrieving the date, Kevin Wolf, 2011/12/13
- Re: [Qemu-devel] [PATCH v2 15/18] rtc: add a dynamic property for retrieving the date, Gerd Hoffmann, 2011/12/13
- Re: [Qemu-devel] [PATCH v2 15/18] rtc: add a dynamic property for retrieving the date, Anthony Liguori, 2011/12/13