From: Jim Fehlig Subject: Re: [libvirt] [PATCH RESENT 04/12] libxl: populate xenstore memory entries at startup Date: Wed, 10 Apr 2013 22:09:42 -0600 Message-ID: <51663786.9060908__43231.3759033152$1365653511$gmane$org@suse.com> References: <233f44eb964cb337a0e48611bc72edfc74fbf7eb.1365561883.git.marmarek@invisiblethingslab.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <233f44eb964cb337a0e48611bc72edfc74fbf7eb.1365561883.git.marmarek@invisiblethingslab.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Marek Marczykowski Cc: libvirt-list@redhat.com, xen-devel List-Id: xen-devel@lists.xenproject.org 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; >