[libvirt] [PATCH 5/5] read saved vm status on libvirtd startup
David Lutterkort
lutter at redhat.com
Fri Dec 12 19:38:59 UTC 2008
On Fri, 2008-12-12 at 19:27 +0100, Guido Günther wrote:
> diff --git a/src/qemu_driver.c b/src/qemu_driver.c
> index d8b87e4..57a396c 100644
> --- a/src/qemu_driver.c
> +++ b/src/qemu_driver.c
> @@ -183,6 +183,46 @@ qemudAutostartConfigs(struct qemud_driver *driver) {
> }
>
>
> +static int
> +qemudGetProcFD(pid_t pid, int fdnum)
> +{
> + int fd;
> +
> +#ifdef __linux__
> + char *path = NULL;
> +
> + if (!asprintf(&path, "/proc/%d/fd/%d", pid, fdnum)) {
> + qemudReportError(NULL, NULL, NULL, VIR_ERR_NO_MEMORY, NULL);
> + return -1;
> + }
One more use of asprintf that needs to set path = NULL on error.
Cheers,
David
More information about the libvir-list
mailing list