Re: [libvirt] [PATCH 5/5] read saved vm status on libvirtd startup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]