From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Bamvor Jian Zhang <bjzhang@suse.com>
Cc: jfehlig@suse.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH RFC] improve the error message in "xl list --long"
Date: Thu, 17 Oct 2013 17:25:50 +0100 [thread overview]
Message-ID: <52600F8E.10400@citrix.com> (raw)
In-Reply-To: <1382026918-19683-1-git-send-email-bjzhang@suse.com>
On 17/10/13 17:21, Bamvor Jian Zhang wrote:
> with this patch, xl will raise a proper error when execute "xl list --long"
> for existed domain but no domain configuration found. it would encounter
> if other toolstack(like libvirt) create the vm, xl could saw the domain
> name but could not get the domain configuration.
>
> there is a commit a76377f1 check the return value of
> libxl_read_file_contents in libxl_userdata_retrieve. but skip the ENOENT.
> it is almost three years before. i do not know the senario about that
> commit. it seems that it is not safe to simplely remove the ENOENT.
>
> Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com>
> ---
> tools/libxl/libxl_dom.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
> index 356f920..8daf51a 100644
> --- a/tools/libxl/libxl_dom.c
> +++ b/tools/libxl/libxl_dom.c
> @@ -1655,6 +1655,12 @@ int libxl_userdata_retrieve(libxl_ctx *ctx, uint32_t domid,
> goto out;
> }
>
> + if (access(filename, F_OK) != 0) {
> + LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "Unknown domain configuration. Is domain id '%u' owned by another libxl toolstack?", domid);
This line is too long, perhaps putting the start of the string on a new
line, and splitting again at the %u so the grepable parts of the string
stay contiguous.
Finally, "another libxl toolstack" is too specific (XAPI domains being a
prime example which would fall over here). I would suggest just
"another toolstack".
~Andrew
> + rc = ERROR_INVAL;
> + goto out;
> + }
> +
> e = libxl_read_file_contents(ctx, filename, data_r ? &data : 0, &datalen);
> if (e && errno != ENOENT) {
> rc = ERROR_FAIL;
prev parent reply other threads:[~2013-10-17 16:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-17 16:21 [PATCH RFC] improve the error message in "xl list --long" Bamvor Jian Zhang
2013-10-17 16:24 ` Ian Jackson
2013-10-17 16:58 ` Bamvor Jian Zhang
2013-10-17 17:25 ` Ian Jackson
2013-10-17 20:38 ` Jim Fehlig
2013-10-17 16:25 ` Andrew Cooper [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=52600F8E.10400@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=bjzhang@suse.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jfehlig@suse.com \
--cc=xen-devel@lists.xen.org \
/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.