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

Re: [Xen-devel] [PATCH for-4.5 2/2] xl: print out partial configuration in long mode of list command



On Fri, Nov 14, 2014 at 10:53:45AM +0000, Ian Campbell wrote:
> On Wed, 2014-11-12 at 17:04 +0000, Wei Liu wrote:
> > Unconditionally print out the partial configuration.
> > 
> > Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> > Cc: Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>
> > Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> > Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> > ---
> >  tools/libxl/xl_cmdimpl.c |    6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> > index 3c9f146..396e06c 100644
> > --- a/tools/libxl/xl_cmdimpl.c
> > +++ b/tools/libxl/xl_cmdimpl.c
> > @@ -3388,7 +3388,7 @@ static void list_domains_details(const libxl_dominfo 
> > *info, int nb_domain)
> >  {
> >      libxl_domain_config d_config;
> >  
> > -    int i, rc;
> > +    int i;
> >  
> >      yajl_gen hand = NULL;
> >      yajl_gen_status s;
> > @@ -3410,9 +3410,7 @@ static void list_domains_details(const libxl_dominfo 
> > *info, int nb_domain)
> >  
> >      for (i = 0; i < nb_domain; i++) {
> >          libxl_domain_config_init(&d_config);
> > -        rc = libxl_retrieve_domain_configuration(ctx, info[i].domid, 
> > &d_config);
> > -        if (rc)
> > -            continue;
> > +        libxl_retrieve_domain_configuration(ctx, info[i].domid, &d_config);
> 
> Should't this continue to skip cases where rc is not in {0,
> ERROR_EMPTY_JSON}?
> 

Conceptually speaking, non-zero return value means this d_config is
partially filled. ERROR_JSON_CONFIG_EMPTY is as good / bad as any other
return values.

In this "xl list -l" case, We're interested in two things: to state the
fact that this domain exists and to print out the config.

Domain's existence is confirmed at this point, and we should print out
that partially filled d_config. How much information is filled in is
another question though.  Only printing out d_config when {0,
ERROR_JSON_CONFIG_EMPTY} makes "xl list -l" inconsistent with "xl list".

Wei.

> Ian.

_______________________________________________
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®.