On 03/15/2017 11:37 AM, Peter Krempa wrote:
The code is rather magic so a test case will help making sure that
everything works well. The first case is a simple backing chain.
---
.../qemumonitorjson-nodename-1.json | 268 +++++++++++++++++++++
.../qemumonitorjson-nodename-1.result | 15 ++
tests/qemumonitorjsontest.c | 116 +++++++++
3 files changed, 399 insertions(+)
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-1.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-1.result
+++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-1.result
@@ -0,0 +1,15 @@
+filename : '/var/lib/libvirt/images/rhel7.3.1483545313'
+format node : '#block118'
+storage node: '#block078'
+backingfile : '/var/lib/libvirt/images/rhel7.3.1483536402'
+backing ptr : '#block331'
+ filename : '/var/lib/libvirt/images/rhel7.3.1483536402'
+ format node : '#block331'
+ storage node: '#block281'
+ backingfile : '/var/lib/libvirt/images/rhel7.3.qcow2'
+ backing ptr : '#block567'
+ filename : '/var/lib/libvirt/images/rhel7.3.qcow2'
+ format node : '#block567'
+ storage node: '#block424'
+ backingfile : '<null>'
+ backing ptr : '<null>'
Nice - and you're definitely right that having the test is essential to
maintaining the code.
ACK
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org