Re: [PATCH 1/3] Use virFileFindResource to locate libvirtd daemon

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

 



On 04/25/2014 05:28 AM, Daniel P. Berrange wrote:
> Make the remote driver use virFileFindResource to find the
> libvirt daemon path, so that it executes the in-builddir
> daemon if run from source tree.
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  src/remote/remote_driver.c | 44 ++++++--------------------------------------
>  1 file changed, 6 insertions(+), 38 deletions(-)

Nice diffstat - proof that we made a good factorization.


> -static const char *
> -remoteFindDaemonPath(void)
> -{
> -    static const char *serverPaths[] = {
> -        SBINDIR "/libvirtd",
> -        SBINDIR "/libvirtd_dbg",
> -        NULL
> -    };
> -    size_t i;
> -    const char *customDaemon = virGetEnvBlockSUID("LIBVIRTD_PATH");
> -
> -    if (customDaemon)
> -        return customDaemon;

The old code assumes LIBVIRTD_PATH provides "/path/to/libvirtd"


> -            virReportError(VIR_ERR_INTERNAL_ERROR,
> -                           _("Unable to locate libvirtd daemon in %s "
> -                             "(to override, set $LIBVIRTD_PATH to the "
> -                             "name of the libvirtd binary)"),
> -                           SBINDIR);
> +            !(daemonPath = virFileFindResourceFull("libvirtd",
> +                                                   NULL, NULL,
> +                                                   "daemon",
> +                                                   SBINDIR,
> +                                                   "LIBVIRTD_PATH")))

the new code assumes LIBVIRTD_PATH provides "/path/to" which contains
libvirtd.

Don't know how many users this will impact, but the only former
documentation of LIBVIRTD_PATH was in the error message.  I can live
with the change in semantics, since it is not formally documented on the
web page as something users would normally fiddle with.

ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]