From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH 3/5] tools: libxl: Log on more error paths on domain create failure Date: Tue, 7 Jul 2015 16:40:30 +0100 Message-ID: <1436283632-6370-3-git-send-email-ian.campbell@citrix.com> References: <1436283618.25646.253.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1436283618.25646.253.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com, wei.liu2@citrix.com Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org The setdefault functions do not generally log why they didn't like things. Signed-off-by: Ian Campbell --- 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