rpc: use VIR_LOCK_GUARD in remote client code

Using VIR_LOCK_GUARD helps to simplify the control flow
logic.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2022-12-22 10:28:50 -05:00
parent 3ebcd59d21
commit 778c300460

View File

@ -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";
}