From: Ian Jackson Subject: Re: Unable to create VM with nic device on Arndale Date: Wed, 18 Dec 2013 14:44:04 +0000 Message-ID: <21169.46260.988885.911683@mariner.uk.xensource.com> References: <52B181EB.6080303@samsung.com> <21169.39199.902511.563980@mariner.uk.xensource.com> <1387371897.27441.133.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1387371897.27441.133.camel@kazak.uk.xensource.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 Campbell Cc: xen-devel@lists.xen.org, Eugene Fedotov , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [Xen-devel] Unable to create VM with nic device on Arndale"): > The confusion arises because our LOG macros include the function name, > so checking for nic errors in a vtpm function is always going to produce > something confusing. > > We should introduce a veneer here, e.g. nic_done(), which logs any nic > related errors and then calls the next step. Same for each step in the > async chain. That would be tangling the code just to make the logging output right. Perhaps we could just fix the logging to DTRT. How about a new logging macro which takes an argument for the context to print instead of the function name ? static void domcreate_attach_vtpms(libxl__egc *egc, libxl__multidev *multidev, int ret) { ... libxl_domain_config* const d_config = dcs->guest_config; if (ret) { - LOG(ERROR, "unable to add nic devices"); + CLOG("domcreate nics", ERROR, "unable to add nic devices"); goto error_out; } We'd probably only need to change about one call in each callback function - the one which prints an error message for the previous operation. Ian.