From: Ian Campbell <ian.campbell@citrix.com>
To: ian.jackson@eu.citrix.com, wei.liu2@citrix.com
Cc: Ian Campbell <ian.campbell@citrix.com>, xen-devel@lists.xen.org
Subject: [PATCH 3/5] tools: libxl: Log on more error paths on domain create failure
Date: Tue, 7 Jul 2015 16:40:30 +0100 [thread overview]
Message-ID: <1436283632-6370-3-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1436283618.25646.253.camel@citrix.com>
The setdefault functions do not generally log why they didn't like
things.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
tools/libxl/libxl_create.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index f366a09..9d91e89 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -899,7 +899,10 @@ static void initiate_domain_create(libxl__egc *egc,
}
ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info);
- if (ret) goto error_out;
+ if (ret) {
+ LOG(ERROR, "Unable to set domain create info defaults");
+ goto error_out;
+ }
ret = libxl__domain_make(gc, d_config, &domid, &state->config);
if (ret) {
@@ -913,7 +916,10 @@ static void initiate_domain_create(libxl__egc *egc,
dcs->dmss.dm.guest_domid = 0; /* means we haven't spawned */
ret = libxl__domain_build_info_setdefault(gc, &d_config->b_info);
- if (ret) goto error_out;
+ if (ret) {
+ LOG(ERROR, "Unable to set domain build info defaults");
+ goto error_out;
+ }
if (!sched_params_valid(gc, domid, &d_config->b_info.sched_params)) {
LOG(ERROR, "Invalid scheduling parameters\n");
@@ -923,7 +929,10 @@ static void initiate_domain_create(libxl__egc *egc,
for (i = 0; i < d_config->num_disks; i++) {
ret = libxl__device_disk_setdefault(gc, &d_config->disks[i]);
- if (ret) goto error_out;
+ if (ret) {
+ LOG(ERROR, "Unable to set disk defaults for disk %d", i);
+ goto error_out;
+ }
}
dcs->bl.ao = ao;
@@ -943,7 +952,10 @@ static void initiate_domain_create(libxl__egc *egc,
* but qemu needs the nic information to be complete.
*/
ret = libxl__device_nic_setdefault(gc, &d_config->nics[i], domid);
- if (ret) goto error_out;
+ if (ret) {
+ LOG(ERROR, "Unable to set nic defaults for nic %d", i);
+ goto error_out;
+ }
if (d_config->nics[i].devid > last_devid)
last_devid = d_config->nics[i].devid;
--
2.1.4
next prev parent reply other threads:[~2015-07-07 15:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-07 15:40 [PATCH 0/5] tools: 3 misc fixes/cleanups Ian Campbell
2015-07-07 15:40 ` [PATCH 1/5] tools: libxc: fix "alocated" typo in comment Ian Campbell
2015-07-07 16:02 ` Ian Jackson
2015-07-07 15:40 ` [PATCH 2/5] libxc: Correct log message in xc_map_foreign_bulk Ian Campbell
2015-07-07 16:02 ` Ian Jackson
2015-07-07 15:40 ` Ian Campbell [this message]
2015-07-07 16:02 ` [PATCH 3/5] tools: libxl: Log on more error paths on domain create failure Ian Jackson
2015-07-07 15:40 ` [PATCH 4/5] tools: Link in-tree libvchan and libblktapctl users against lib....so Ian Campbell
2015-07-07 16:03 ` Ian Jackson
2015-07-07 15:40 ` [PATCH 5/5] tools: Do not add top-level tools dir to include path Ian Campbell
2015-07-07 16:03 ` Ian Jackson
2015-07-07 15:50 ` [PATCH 0/5] tools: 3 misc fixes/cleanups Wei Liu
2015-07-07 16:05 ` Ian Campbell
2015-07-08 12:44 ` Ian Campbell
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=1436283632-6370-3-git-send-email-ian.campbell@citrix.com \
--to=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=wei.liu2@citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).