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

Eric Blake eblake at redhat.com
Mon Apr 2 20:18:35 UTC 2012


On 04/02/2012 01:57 PM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> * 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 at redhat.com>
> ---
>  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 dfab810..ead160e 100644
> --- a/daemon/libvirtd.c
> +++ b/daemon/libvirtd.c
> @@ -1341,6 +1341,12 @@ int main(int argc, char **argv) {
>      /* initialize early logging */
>      virLogSetFromEnv();
>  
> +#ifdef WITH_DRIVER_MODULES
> +    if (strstr(argv[0], "lt-libvirtd") &&
> +        (access("./.git", R_OK) >= 0 || access("../.git", R_OK) >= 0))

This won't work for builds in deep VPATH (mkdir -p deep/build) or
sibling VPATH (mkdir ../build) locations.  Can we come up with a
solution that doesn't limit us to just in-tree and one-deep directory
builds?

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120402/adf6a7af/attachment-0001.sig>


More information about the libvir-list mailing list