[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 018/197] qom: add test tools (v2)
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH v3 018/197] qom: add test tools (v2) |
Date: |
Mon, 12 Dec 2011 14:18:14 -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 v3 005/197] qdev: provide an interface to return canonical path from root (v2), (continued)
- [Qemu-devel] [PATCH v3 005/197] qdev: provide an interface to return canonical path from root (v2), Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 006/197] qdev: provide a path resolution (v2), Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 007/197] qom: add child properties (composition) (v2), Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 008/197] qom: add link properties (v2), Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 009/197] qapi: allow a 'gen' key to suppress code generation, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 010/197] qmp: add qom-list command, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 011/197] qom: qom_{get, set} monitor commands (v2), Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 015/197] rtc: add a dynamic property for retrieving the date, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 016/197] qom: optimize qdev_get_canonical_path using a parent link, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 017/197] qmp: make qmp.py easier to use, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 018/197] qom: add test tools (v2),
Anthony Liguori <=
- [Qemu-devel] [PATCH v3 020/197] qom: add vga node to the pc composition tree, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 021/197] qom: add string property type, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 022/197] qdev: add a qdev_get_type() function and expose as a 'type' property, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 023/197] pc: fill out most of the composition tree, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 024/197] i440fx: split out piix3 device, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 025/197] i440fx: rename piix_pci -> i440fx, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 033/197] a little better approach to this, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 034/197] qdev: add isa-device as a subclass of device, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 035/197] isa: more isa stuff, Anthony Liguori, 2011/12/12
- [Qemu-devel] [PATCH v3 036/197] qom: make pcidevice part of the hierarchy, Anthony Liguori, 2011/12/12