[libvirt] [PATCH] avoid shutting down the vm twice

Jiri Denemark jdenemar at redhat.com
Wed Feb 2 13:18:47 UTC 2011


> > diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> > index 6140f0f..c527bb7 100644
> > --- a/src/qemu/qemu_driver.c
> > +++ b/src/qemu/qemu_driver.c
> > @@ -2972,7 +2972,11 @@ cleanup:
> >       * pretend we never started it */
> >      virCommandFree(cmd);
> >      VIR_FORCE_CLOSE(logfile);
> > -    qemudShutdownVMDaemon(driver, vm, 0);
> > +    /* The vm may be cloesd in other thread, so we should check whether the
> 
> s/cloesd/closed/
> 
> > +     * vm is active before shutdown.
> > +     */
> > +    if (virDomainObjIsActive(vm))
> > +        qemudShutdownVMDaemon(driver, vm, 0);
> 
> I'm still playing with this patch, but at first glance, it is making
> sense to me.

The patch makes sense to me, since we may unlock the domain object several
times before we get to the cleanup code. Thus the state may have changed by
the time we get there.

Eric, what is the result of you playing with the patch? Is it ok to ack and
push it?

Jirka




More information about the libvir-list mailing list