From: Ian Campbell <Ian.Campbell@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: zhigang.x.wang@oracle.com, ian.jackson@eu.citrix.com,
xen-devel@lists.xen.org
Subject: Re: [PATCH for-4.5 1/2] libxl: continue when encounter ERROR_JSON_CONFIG_EMPTY
Date: Fri, 14 Nov 2014 10:55:35 +0000 [thread overview]
Message-ID: <1415962535.7113.4.camel@citrix.com> (raw)
In-Reply-To: <1415962372.7113.2.camel@citrix.com>
On Fri, 2014-11-14 at 10:52 +0000, Ian Campbell wrote:
> On Wed, 2014-11-12 at 17:04 +0000, Wei Liu wrote:
> > Continue when libxl_retrieve_domain_configuration encounters
> > ERROR_JSON_CONFIG_EMPTY, as caller might be interested in the partial
> > configuration pulled from xenstore. In this case
> > ERROR_JSON_CONFIG_EMPTY is used as return value as before, if no other
> > error happens along the way.
> >
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > Cc: Zhigang Wang <zhigang.x.wang@oracle.com>
>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
On second thoughts, I think this really needs an update to libxl.h to
describe the semantics of this function, i.e. to what extent the output
is valid for various error codes, especially ERROR_JSON_CONFIG_EMPTY.
>
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > ---
> > tools/libxl/libxl.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> > index f7961f6..f54e0ea 100644
> > --- a/tools/libxl/libxl.c
> > +++ b/tools/libxl/libxl.c
> > @@ -6521,6 +6521,7 @@ int libxl_retrieve_domain_configuration(libxl_ctx *ctx, uint32_t domid,
> > GC_INIT(ctx);
> > int rc;
> > libxl__domain_userdata_lock *lock = NULL;
> > + bool json_empty = false;
> >
> > CTX_LOCK;
> >
> > @@ -6531,11 +6532,12 @@ int libxl_retrieve_domain_configuration(libxl_ctx *ctx, uint32_t domid,
> > }
> >
> > rc = libxl__get_domain_configuration(gc, domid, d_config);
> > - if (rc) {
> > + if (rc && rc != ERROR_JSON_CONFIG_EMPTY) {
> > LOG(ERROR, "fail to get domain configuration for domain %d", domid);
> > rc = ERROR_FAIL;
> > goto out;
> > }
> > + if (rc == ERROR_JSON_CONFIG_EMPTY) json_empty = true;
> >
> > /* Domain name */
> > {
> > @@ -6692,6 +6694,8 @@ int libxl_retrieve_domain_configuration(libxl_ctx *ctx, uint32_t domid,
> >
> > #undef MERGE
> >
> > + rc = json_empty ? ERROR_JSON_CONFIG_EMPTY : 0;
> > +
> > out:
> > if (lock) libxl__unlock_domain_userdata(lock);
> > CTX_UNLOCK;
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2014-11-14 10:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-12 17:04 [PATCH for-4.5 0/2] xl/libxl: return and print partial config Wei Liu
2014-11-12 17:04 ` [PATCH for-4.5 1/2] libxl: continue when encounter ERROR_JSON_CONFIG_EMPTY Wei Liu
2014-11-14 10:52 ` Ian Campbell
2014-11-14 10:55 ` Ian Campbell [this message]
2014-11-14 11:10 ` Wei Liu
2014-11-14 11:19 ` Ian Campbell
2014-11-17 8:58 ` Wei Liu
2014-11-12 17:04 ` [PATCH for-4.5 2/2] xl: print out partial configuration in long mode of list command Wei Liu
2014-11-14 9:59 ` Ian Campbell
2014-11-14 10:09 ` Wei Liu
2014-11-14 10:22 ` Ian Campbell
2014-11-21 18:04 ` Zhigang Wang
2014-11-21 18:09 ` Konrad Rzeszutek Wilk
2014-11-21 18:14 ` Wei Liu
2014-11-21 18:25 ` Zhigang Wang
2014-11-14 10:53 ` Ian Campbell
2014-11-14 11:03 ` Wei Liu
2014-11-12 17:18 ` [PATCH for-4.5 0/2] xl/libxl: return and print partial config Konrad Rzeszutek Wilk
2014-11-12 17:28 ` Wei Liu
2014-11-13 18:25 ` Konrad Rzeszutek Wilk
2014-11-12 19:54 ` Zhigang Wang
2014-11-12 20:44 ` Wei Liu
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=1415962535.7113.4.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
--cc=zhigang.x.wang@oracle.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.