Re: [PATCH 07/10] Override default driver dir when running from GIT

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

 



On 05/21/2012 01:59 PM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> * daemon/libvirtd.c: Set custom driver module dir if the current
>   binary name is 'lt-libvirtd' (indicating execution directly
>   from GIT checkout)
> * src/driver.c, src/driver.h, src/libvirt_driver_modules.syms: Add
>   virDriverModuleInitialize to allow driver module location to
>   be changed
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  daemon/libvirtd.c               |    6 ++++++
>  src/driver.c                    |   18 ++++++++++++++++--
>  src/driver.h                    |    1 +
>  src/libvirt_driver_modules.syms |    1 +
>  4 files changed, 24 insertions(+), 2 deletions(-)
> 
> diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
> index 1e91a45..943fef4 100644
> --- a/daemon/libvirtd.c
> +++ b/daemon/libvirtd.c
> @@ -958,6 +958,12 @@ int main(int argc, char **argv) {
>      /* initialize early logging */
>      virLogSetFromEnv();
>  
> +#ifdef WITH_DRIVER_MODULES
> +    if (strstr(argv[0], "lt-libvirtd") &&

This is not portable to cygwin.  Then again, I haven't yet got libvirtd
to compile on cygwin, so I don't know if it really matters.  Supposedly,
libtool has features to make it easier to run in-tree builds, but I'd
have to research if any of those were any easier than what you've just
hard-coded in.

> +        (access("./.git", R_OK) >= 0 || access("../.git", R_OK) >= 0))
> +        virDriverModuleInitialize("./src/.libs");

This is hard-coded to a very limited set of build setups (that is, it
won't work with all possible VPATH builds).  Can we somehow get at
$srcdir from Makefile and turn it into a #define or an environment
variable, so that we are making only a single probe of the correct
directory regardless of what VPATH build we used?  Is this something
where we need to write a wrapper script around the libtool wrapper that
adds an extra command line argument to libvirtd?

-- 
Eric Blake   eblake@xxxxxxxxxx    +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]