[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 17/18] Add test tools
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 17/18] Add test tools |
Date: |
Wed, 30 Nov 2011 15:03:47 -0600 |
---
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..b086bc5
--- /dev/null
+++ b/QMP/qom-get
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+##
+# Virtio Support
+#
+# 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..5dbb07b
--- /dev/null
+++ b/QMP/qom-list
@@ -0,0 +1,30 @@
+#!/usr/bin/python
+##
+# Virtio Support
+#
+# 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..83a4394
--- /dev/null
+++ b/QMP/qom-set
@@ -0,0 +1,21 @@
+#!/usr/bin/python
+##
+# Virtio Support
+#
+# 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 03/18] qom: introduce root device, (continued)
- [Qemu-devel] [PATCH 03/18] qom: introduce root device, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 04/18] qdev: provide an interface to return canonical path from root, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 05/18] qdev: provide a path resolution, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 01/18] qom: add new dynamic property infrastructure based on Visitors, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 07/18] qom: add link properties, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 06/18] qom: add child properties (composition), Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 02/18] qom: register legacy properties as new style properties, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 08/18] qapi: allow a 'gen' key to suppress code generation, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 10/18] qom: qom_{get,set} monitor commands, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 11/18] qdev: add explicitly named devices to the root complex, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 17/18] Add test tools,
Anthony Liguori <=
- [Qemu-devel] [PATCH 16/18] Make qmp.py easier to use, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 18/18] qdev: split out QOM functions to separate files, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 13/18] rtc: make piix3 set the rtc as a child, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 09/18] qmp: add qom-list command, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 15/18] qom: optimize qdev_get_canonical_path using a parent link, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 12/18] dev: add an anonymous peripheral container, Anthony Liguori, 2011/11/30
- [Qemu-devel] [PATCH 14/18] rtc: add a dynamic property for retrieving the date, Anthony Liguori, 2011/11/30
- Re: [Qemu-devel] [PATCH 00/18] qom: dynamic properties and composition tree, Anthony Liguori, 2011/11/30