mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
parent
3ebcd59d21
commit
778c300460
@ -1818,11 +1818,10 @@ elsif ($mode eq "client") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "\n";
|
|
||||||
if ($structprefix eq "admin") {
|
if ($structprefix eq "admin") {
|
||||||
print " virObjectLock(priv);\n";
|
print " VIR_LOCK_GUARD lock = virObjectLockGuard(&priv);\n";
|
||||||
} else {
|
} else {
|
||||||
print " remoteDriverLock(priv);\n";
|
print " VIR_LOCK_GUARD lock = remoteDriverLock(priv);\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($call->{streamflag} ne "none") {
|
if ($call->{streamflag} ne "none") {
|
||||||
@ -2020,12 +2019,6 @@ elsif ($mode eq "client") {
|
|||||||
|
|
||||||
print join("\n", @free_list);
|
print join("\n", @free_list);
|
||||||
|
|
||||||
if ($structprefix eq "admin") {
|
|
||||||
print " virObjectUnlock(priv);\n";
|
|
||||||
} else {
|
|
||||||
print " remoteDriverUnlock(priv);\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
print " return rv;\n";
|
print " return rv;\n";
|
||||||
print "}\n";
|
print "}\n";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user