[libvirt] [PATCH 2/5] daemonize qemu processes

Guido Günther agx at sigxcpu.org
Mon Dec 29 14:48:53 UTC 2008


On Mon, Dec 15, 2008 at 10:19:28AM +0100, Daniel Veillard wrote:
> On Fri, Dec 12, 2008 at 07:26:32PM +0100, Guido Günther wrote:
> > Make sure vms don't get killed when the libvirtd quits unexpectedly.
> > Needs the previous patch since it looks at the pid file.
> [...]
> > +    /* wait for qemu process to to show up */
> > +    if (ret == 0) {
> > +        int retries = 100;
> > +        while (retries) {
> > +            if ((ret = virFileReadPid(driver->stateDir, vm->def->name, &vm->pid)) == 0)
> > +                break;
> > +            usleep(10*1000);
> > +            retries--;
> > +        }
> > +        if (ret)
> > +            qemudLog(QEMUD_WARN, _("Domain %s didn't show up\n"), vm->def->name);
> > +    }
> 
>   so we are waiting at most one second and waking up the process 100
> times, I would suggest to relax that a bit, give it a bit more time like
> 10 seconds in case the system is trashing a bit 1 second may really be
> too short. And maybe wake up a bit less ...
> 
>    but patch looks good to me, it's just unfortunate we need to do some
> tuning there.
I've put an updated version of this and the follow up patch to reconnect
to running vms at:
    http://honk.sigxcpu.org/projects/libvirt/daemon-restart/0001-daemonize-qemu-processes.patch
    http://honk.sigxcpu.org/projects/libvirt/daemon-restart/0002-read-saved-vm-status-on-libvirtd-startup.patch
Just in case somebody else wants to try them.
Cheers,
 -- Guido




More information about the libvir-list mailing list