mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00: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") {
|
||||
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";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user