On 16.06.2015 19:43, Peter Krempa wrote:
Make testObjectEventQueue tolerant to NULL @event and move it so that
it
does not require a prototype. Additionally add
testObjectEventQueueUnlocked that will lock @driver before sending the
event.
Refactor the rest of the codebase to make use of the above features
---
src/test/test_driver.c | 112 +++++++++++++++++++------------------------------
1 file changed, 44 insertions(+), 68 deletions(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index dc6e49a..20d3c71 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -137,8 +137,6 @@ static const virNodeInfo defaultNodeInfo = {
@@ -3385,8 +3386,7 @@ static virNetworkPtr
testNetworkCreateXML(virConnectPtr conn, const char *xml)
cleanup:
virNetworkDefFree(def);
- if (event)
- testObjectEventQueue(privconn, event);
+ testObjectEventQueue(privconn, event);
Unlocked()
virNetworkObjEndAPI(&net);
return ret;
}
@@ -3415,8 +3415,7 @@ virNetworkPtr testNetworkDefineXML(virConnectPtr conn, const char
*xml)
cleanup:
virNetworkDefFree(def);
- if (event)
- testObjectEventQueue(privconn, event);
+ testObjectEventQueue(privconn, event);
Unlocked()
virNetworkObjEndAPI(&net);
return ret;
}
@@ -3449,8 +3448,7 @@ static int testNetworkUndefine(virNetworkPtr network)
ret = 0;
cleanup:
- if (event)
- testObjectEventQueue(privconn, event);
+ testObjectEventQueue(privconn, event);
Unlocked()
virNetworkObjEndAPI(&privnet);
return ret;
}
@@ -3527,8 +3525,7 @@ static int testNetworkCreate(virNetworkPtr network)
ret = 0;
cleanup:
- if (event)
- testObjectEventQueue(privconn, event);
+ testObjectEventQueue(privconn, event);
Unlocked()
virNetworkObjEndAPI(&privnet);
return ret;
}
@@ -3556,8 +3553,7 @@ static int testNetworkDestroy(virNetworkPtr network)
ret = 0;
cleanup:
- if (event)
- testObjectEventQueue(privconn, event);
+ testObjectEventQueue(privconn, event);
Unlocked()
virNetworkObjEndAPI(&privnet);
return ret;
}
@@ -5840,15 +5836,6 @@ testConnectNetworkEventDeregisterAny(virConnectPtr conn,
return ret;
}
ACK with those nits fixed.
Michal