On 11/26/2012 03:57 PM, Dwight Engen wrote:
> LXCDIR is only used in lxc_container_new, whereas LXCPATH is used throughout
> the rest of lxc, and even in the same file as lxc_container_new (for example
> create_container_dir()).
> 
> Signed-off-by: Dwight Engen <dwight.en...@oracle.com>

Good catch.

Acked-by: Stéphane Graber <stgra...@ubuntu.com>

And pushed to staging.

> ---
>  src/lxc/lxccontainer.c |    6 +++---
>  src/lxc/lxccontainer.h |    1 -
>  2 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
> index ed2c483..cc91e05 100644
> --- a/src/lxc/lxccontainer.c
> +++ b/src/lxc/lxccontainer.c
> @@ -882,13 +882,13 @@ struct lxc_container *lxc_container_new(char *name)
>               goto err;
>       }
>  
> -     len = strlen(LXCDIR)+strlen(c->name)+strlen("/config")+2;
> +     len = strlen(LXCPATH)+strlen(c->name)+strlen("/config")+2;
>       c->configfile = malloc(len);
>       if (!c->configfile) {
>               fprintf(stderr, "Error allocating config file pathname\n");
>               goto err;
>       }
> -     ret = snprintf(c->configfile, len, "%s/%s/config", LXCDIR, c->name);
> +     ret = snprintf(c->configfile, len, "%s/%s/config", LXCPATH, c->name);
>       if (ret < 0 || ret >= len) {
>               fprintf(stderr, "Error printing out config file name\n");
>               goto err;
> @@ -928,7 +928,7 @@ struct lxc_container *lxc_container_new(char *name)
>       }
>  
>       /*
> -      * default configuration file is $LXCDIR/$NAME/config
> +      * default configuration file is $LXCPATH/$NAME/config
>        */
>  
>       return c;
> diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h
> index cad31ee..9e4267a 100644
> --- a/src/lxc/lxccontainer.h
> +++ b/src/lxc/lxccontainer.h
> @@ -18,7 +18,6 @@ struct lxc_container {
>       int error_num;
>       int daemonize;
>  
> -#define LXCDIR "/var/lib/lxc"
>       bool (*is_defined)(struct lxc_container *c);  // did 
> /var/lib/lxc/$name/config exist
>       const char *(*state)(struct lxc_container *c);
>       bool (*is_running)(struct lxc_container *c);  // true so long as 
> defined and not stopped
> 


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to