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

Re: [Xen-devel] [libvirt] [PATCH RESENT 04/12] libxl: populate xenstore memory entries at startup



Marek Marczykowski wrote:
> libxl uses some xenstore entries for hints in memory management
> (especially when starting new domain). This includes dom0 memory limit
> and Xen free memory margin, based on current system state. Entries are
> created at first usage, so force such usage at daemon startup, which most
> likely will be before any domain startup.
>   

Hmm, I'd like to get the xen developer's opinion on this change. 
Perhaps Ian C. or Ian J. have some comment...

> ---
>  src/libxl/libxl_driver.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
> index 011edf8..89546a5 100644
> --- a/src/libxl/libxl_driver.c
> +++ b/src/libxl/libxl_driver.c
> @@ -1115,6 +1115,7 @@ libxlStartup(bool privileged,
>      char *log_file = NULL;
>      virCommandPtr cmd;
>      int status, ret = 0;
> +    unsigned int free_mem;
>   

uint32_t to match libxl_get_free_memory() definition?

>      char ebuf[1024];
>  
>      /* Disable libxl driver if non-root */
> @@ -1240,6 +1241,13 @@ libxlStartup(bool privileged,
>          goto error;
>      }
>  
> +    /* This will fill xenstore info about free and dom0 memory - if missing,
> +     * should be called before starting first domain */
> +    if (libxl_get_free_memory(libxl_driver->ctx, &free_mem)) {
> +        VIR_ERROR(_("cannot get free memory info"));
> +        goto error;
> +    }
>   

Should failure of libxl_get_free_memory() really be fatal and prevent
the driver from loading?

Regards,
Jim

> +
>      if (!(libxl_driver->xmlconf = 
> virDomainXMLConfNew(&libxlDomainXMLPrivateDataCallbacks,
>                                                        NULL)))
>          goto error;
>   

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.