qemu: Avoid using global qemu_driver in event handlers

We will have to pass a mock-up of the driver when testing monitor
events.
This commit is contained in:
Jiri Denemark committed 2013-08-26 16:09:54 +02:00
1 parent 6ac7cc8edc
commit 809ee6bad4
5 files changed
+130 -76

No files matched your search

+6 -3
View File
@@ -708,14 +708,16 @@ error:
static void
qemuMonitorTestEOFNotify(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm ATTRIBUTE_UNUSED)
virDomainObjPtr vm ATTRIBUTE_UNUSED,
void *opaque ATTRIBUTE_UNUSED)
{
}
static void
qemuMonitorTestErrorNotify(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainObjPtr vm ATTRIBUTE_UNUSED)
virDomainObjPtr vm ATTRIBUTE_UNUSED,
void *opaque ATTRIBUTE_UNUSED)
{
}
@@ -870,7 +872,8 @@ qemuMonitorTestNew(bool json, virDomainXMLOptionPtr xmlopt)
if (!(test->mon = qemuMonitorOpen(test->vm,
&src,
json,
&qemuMonitorTestCallbacks)))
&qemuMonitorTestCallbacks,
NULL)))
goto error;
virObjectLock(test->mon);