mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-14 16:45:20 +00:00
bhyveAutostartDomain: Use virObjectLockGuard
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
7a7994abc1
commit
03f9f50712
@ -87,7 +87,8 @@ bhyveAutostartDomain(virDomainObj *vm, void *opaque)
|
||||
{
|
||||
const struct bhyveAutostartData *data = opaque;
|
||||
int ret = 0;
|
||||
virObjectLock(vm);
|
||||
VIR_LOCK_GUARD lock = virObjectLockGuard(vm);
|
||||
|
||||
if (vm->autostart && !virDomainObjIsActive(vm)) {
|
||||
virResetLastError();
|
||||
ret = virBhyveProcessStart(data->conn, vm,
|
||||
@ -98,7 +99,6 @@ bhyveAutostartDomain(virDomainObj *vm, void *opaque)
|
||||
vm->def->name, virGetLastErrorMessage());
|
||||
}
|
||||
}
|
||||
virObjectUnlock(vm);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user