Using VIR_LOCK_GUARD helps to simplify the control flow
logic.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/rpc/gendispatch.pl | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index 54d55d91e7..63d2411474 100755
--- a/src/rpc/gendispatch.pl
+++ b/src/rpc/gendispatch.pl
@@ -1818,11 +1818,10 @@ elsif ($mode eq "client") {
}
}
- print "\n";
if ($structprefix eq "admin") {
- print " virObjectLock(priv);\n";
+ print " VIR_LOCK_GUARD lock =
virObjectLockGuard(&priv);\n";
} else {
- print " remoteDriverLock(priv);\n";
+ print " VIR_LOCK_GUARD lock = remoteDriverLock(priv);\n";
}
if ($call->{streamflag} ne "none") {
@@ -2020,12 +2019,6 @@ elsif ($mode eq "client") {
print join("\n", @free_list);
- if ($structprefix eq "admin") {
- print " virObjectUnlock(priv);\n";
- } else {
- print " remoteDriverUnlock(priv);\n";
- }
-
print " return rv;\n";
print "}\n";
}
--
2.38.1