All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Gianni Tedesco <gianni.tedesco@citrix.com>
Cc: Xen Devel <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [PATCH]: xl: move domain struct init functions to libxl
Date: Tue, 11 Jan 2011 14:39:10 +0000	[thread overview]
Message-ID: <alpine.DEB.2.00.1101111435410.7277@kaball-desktop> (raw)
In-Reply-To: <1294755882.12018.133.camel@qabil.uk.xensource.com>

On Tue, 11 Jan 2011, Gianni Tedesco wrote:
> On Tue, 2011-01-11 at 12:53 +0000, Stefano Stabellini wrote:
> > On Tue, 11 Jan 2011, Gianni Tedesco wrote:
> > > This allows libxl users to get some sane default values for this complex
> > > set of structures. This is purely code movement and there are no
> > > functional changes.
> > > 
> > > Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
> > > 
> > > 
> > > diff -r feb198f3c97f tools/libxl/libxl.h
> > > --- a/tools/libxl/libxl.h	Mon Jan 10 16:03:39 2011 +0000
> > > +++ b/tools/libxl/libxl.h	Tue Jan 11 10:53:36 2011 +0000
> > > @@ -280,6 +280,9 @@ int libxl_ctx_set_log(libxl_ctx *ctx, xe
> > >  int libxl_ctx_postfork(libxl_ctx *ctx);
> > >  
> > >  /* domain related functions */
> > > +void libxl_init_create_info(libxl_domain_create_info *c_info);
> > > +void libxl_init_build_info(libxl_domain_build_info *b_info, libxl_domain_create_info *c_info);
> > > +void libxl_init_dm_info(libxl_device_model_info *dm_info, libxl_domain_create_info *c_info, libxl_domain_build_info *b_info);
> > >  typedef int (*libxl_console_ready)(libxl_ctx *ctx, uint32_t domid, void *priv);
> > >  int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid);
> > >  int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid, int restore_fd);
> > > diff -r feb198f3c97f tools/libxl/libxl_create.c
> > 
> > 
> > What about init_nic_info, init_net2_info, init_vfb_info, init_vkb_info
> > and init_console_info?
> > Wouldn't make sense to have a libxl_init_domain_config
> 
> Yeah good point, I can re-spin to include the various device info's.
> 
> Not sure about an init_domain_config, I don't see how it would work,
> currently we have:
> 
> libxl_domain_config x;
> init_create_info(&x.c_info);
> // do stuff to c_info
> init_build_info(&x.b_info, &x.c_info);
> // do stuff to b_info
> init_dm_info(&x.dm_info, &x.c_info, &x.b_info);
> // do stuff to dm_info
> for each device { init device; do stuff to device; }
> 
> You could init them all in one functions but it breaks IMO the main
> purpose of these functions which is that when you 'do stuff' to b_info
> then init_dm_info() depends on that to set the sane defaults (eg. for
> vidmem).
> 

No I mean instead of having:

libxl_init_nic_info, libxl_init_net2_info, etc.

we would have a single libxl_init_domain_config that does it all.
However we cannot actually do that because we don't know exactly the
number of devices of each kind we are going to have.
So forget about libxl_init_domain_config.

      reply	other threads:[~2011-01-11 14:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-11 11:00 [PATCH]: xl: move domain struct init functions to libxl Gianni Tedesco
2011-01-11 12:53 ` Stefano Stabellini
2011-01-11 14:24   ` Gianni Tedesco
2011-01-11 14:39     ` Stefano Stabellini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1101111435410.7277@kaball-desktop \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=gianni.tedesco@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.