On Wed, Aug 17, 2011 at 11:34:34AM -0600, Eric Blake wrote:
> On 08/12/2011 08:07 AM, Daniel P. Berrange wrote:
> >From: "Daniel P. Berrange"
> >
> >In some cases the caller of virPidFileRead might like extra checks
> >to determine whether the pid just read is really the one they are
> >expecting.
On 08/12/2011 08:07 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange"
In some cases the caller of virPidFileRead might like extra checks
to determine whether the pid just read is really the one they are
expecting. This adds virPidFileReadIfAlive which will check whether
the pid is still a
On Fri, Aug 12, 2011 at 15:07:21 +0100, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange"
>
> In some cases the caller of virPidFileRead might like extra checks
> to determine whether the pid just read is really the one they are
> expecting. This adds virPidFileReadIfAlive which will check w
On Fri, Aug 12, 2011 at 14:46:35 +0100, Daniel P. Berrange wrote:
> On Fri, Aug 12, 2011 at 02:10:00PM +0200, Jiri Denemark wrote:
...
> > > +if (virAsprintf(&procpath, "/proc/%d/exe", *pid) < 0) {
> > > +*pid = -1;
> > > +return 0;
> > > +}
> > > +#ifdef __linux__
> > > +
From: "Daniel P. Berrange"
In some cases the caller of virPidFileRead might like extra checks
to determine whether the pid just read is really the one they are
expecting. This adds virPidFileReadIfAlive which will check whether
the pid is still alive with kill(0, -1), and (on linux only) will
loo
On Fri, Aug 12, 2011 at 02:10:00PM +0200, Jiri Denemark wrote:
> Eh, I forgot to add some more notes...
>
> ...
> > diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c
> > index 25c3272..dc92868 100644
> > --- a/src/util/virpidfile.c
> > +++ b/src/util/virpidfile.c
> > @@ -24,6 +24,7 @@
> >
Eh, I forgot to add some more notes...
...
> diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c
> index 25c3272..dc92868 100644
> --- a/src/util/virpidfile.c
> +++ b/src/util/virpidfile.c
> @@ -24,6 +24,7 @@
> #include
>
> #include
> +#include
>
> #include "virpidfile.h"
> #incl
On Wed, Aug 10, 2011 at 16:37:26 +0100, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange"
>
> In some cases the caller of virPidFileRead might like extra checks
> to determine whether the pid just read is really the one they are
> expecting. This adds virPidFileReadIfValid which will check w
From: "Daniel P. Berrange"
In some cases the caller of virPidFileRead might like extra checks
to determine whether the pid just read is really the one they are
expecting. This adds virPidFileReadIfValid which will check whether
the pid is still alive with kill(0, -1), and (on linux only) will
loo