[libvirt] [PATCH 1/3] qemu: Remove redundant DomainObjIsActive calls

Ján Tomko jtomko at redhat.com
Tue Apr 19 13:59:14 UTC 2016


On Fri, Apr 15, 2016 at 10:00:12AM -0400, Cole Robinson wrote:
> The common idiom in the driver API implementations is roughly:
> 
> - ACL check
> - BeginJob (if needed)
> - AgentAvailable (if needed)
> - !IsActive
> 
> A few calls had an extra !IsActive before BeginJob, which doesn't
> seem to serve much use. Drop them
> ---
>  src/qemu/qemu_driver.c | 24 ------------------------
>  1 file changed, 24 deletions(-)
> 

ACK

The call would help us error out early if:
* the domain is not alive AND
* we would not be able to get a job on it

But we already acquired the domain object lock in qemuDomObjFromDomain.
This means that either:
* there is no job on the domain OR
* there is a job that does unlock the domain object

Since a job on inactive domain has no reason to unlock the object
to enter the monitor or agent, this extra early call is unlikely
to protect us from any unnecessary waiting for the job.

Jan




More information about the libvir-list mailing list