mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-15 00:55:17 +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;
|
const struct bhyveAutostartData *data = opaque;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
virObjectLock(vm);
|
VIR_LOCK_GUARD lock = virObjectLockGuard(vm);
|
||||||
|
|
||||||
if (vm->autostart && !virDomainObjIsActive(vm)) {
|
if (vm->autostart && !virDomainObjIsActive(vm)) {
|
||||||
virResetLastError();
|
virResetLastError();
|
||||||
ret = virBhyveProcessStart(data->conn, vm,
|
ret = virBhyveProcessStart(data->conn, vm,
|
||||||
@ -98,7 +99,6 @@ bhyveAutostartDomain(virDomainObj *vm, void *opaque)
|
|||||||
vm->def->name, virGetLastErrorMessage());
|
vm->def->name, virGetLastErrorMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virObjectUnlock(vm);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user