]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: Add support for passing driver to qemu monitor
authorJiri Denemark <jdenemar@redhat.com>
Thu, 25 Jul 2013 17:28:51 +0000 (19:28 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 26 Aug 2013 14:09:55 +0000 (16:09 +0200)
The driver is then passed to monitor event handlers.

tests/qemuhotplugtest.c
tests/qemumonitortestutils.c
tests/qemumonitortestutils.h

index 71dd9b0f71605049fab0528cd407188e8d61699e..6b71c9f0952edc785e12302f601e77e870ccbc24 100644 (file)
@@ -242,7 +242,7 @@ testQemuHotplug(const void *data)
 
     /* Now is the best time to feed the spoofed monitor with predefined
      * replies. */
-    if (!(test_mon = qemuMonitorTestNew(true, driver.xmlopt, vm)))
+    if (!(test_mon = qemuMonitorTestNew(true, driver.xmlopt, vm, &driver)))
         goto cleanup;
 
     tmp = test->mon;
index 99b913197cc49698a71c304cefb2655756ab5809..20ccc106373a0d3ebce63e1581538ebaeda2f2ee 100644 (file)
@@ -869,7 +869,8 @@ error:
 qemuMonitorTestPtr
 qemuMonitorTestNew(bool json,
                    virDomainXMLOptionPtr xmlopt,
-                   virDomainObjPtr vm)
+                   virDomainObjPtr vm,
+                   virQEMUDriverPtr driver)
 {
     qemuMonitorTestPtr test = NULL;
     virDomainChrSourceDef src;
@@ -882,7 +883,7 @@ qemuMonitorTestNew(bool json,
                                       &src,
                                       json,
                                       &qemuMonitorTestCallbacks,
-                                      NULL)))
+                                      driver)))
         goto error;
 
     virObjectLock(test->mon);
index ccb545744a23382d06cd2c139a33148329b5060c..9e39795d93ca97d43bbd1db75a4f23e761203d76 100644 (file)
@@ -21,6 +21,7 @@
 # define __VIR_QEMU_MONITOR_TEST_UTILS_H__
 
 # include "domain_conf.h"
+# include "qemu/qemu_conf.h"
 # include "qemu/qemu_monitor.h"
 # include "qemu/qemu_agent.h"
 
@@ -60,11 +61,12 @@ int qemuMonitorTestAddItemParams(qemuMonitorTestPtr test,
     ATTRIBUTE_SENTINEL;
 
 # define qemuMonitorTestNewSimple(json, xmlopt) \
-    qemuMonitorTestNew(json, xmlopt, NULL)
+    qemuMonitorTestNew(json, xmlopt, NULL, NULL)
 
 qemuMonitorTestPtr qemuMonitorTestNew(bool json,
                                       virDomainXMLOptionPtr xmlopt,
-                                      virDomainObjPtr vm);
+                                      virDomainObjPtr vm,
+                                      virQEMUDriverPtr driver);
 
 qemuMonitorTestPtr qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt);