From: Ian Campbell Subject: Re: [Patch] tools/libxc: Correct read_exact() error messages Date: Wed, 8 Jan 2014 14:20:48 +0000 Message-ID: <1389190848.4883.84.camel@kazak.uk.xensource.com> References: <1389089063-31631-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1389089063-31631-1-git-send-email-andrew.cooper3@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: Andrew Cooper Cc: Ian Jackson , Xen-devel List-Id: xen-devel@lists.xenproject.org On Tue, 2014-01-07 at 10:04 +0000, Andrew Cooper wrote: > The errors have been incorrectly identifying their function since c/s > 861aef6e1558bebad8fc60c1c723f0706fd3ed87 which did a lot of error handling > cleanup. > > Use __func__ to ensure the name remains correct in the future. > > Signed-off-by: Andrew Cooper > CC: Ian Campbell > CC: Ian Jackson A simple string change seems harmless from a release PoV, so on that front Release-Acked-by: Ian Campbell. For the actual change though, most uses of ERROR in this function just have a descriptive error without the function name. If we are going to change it then I'm not convinced "rdexact failed..." is as useful as something like "Failed to read exactly %d bytes (select returned...)". Other thoughts? (that said, I'm still somewhat inclined to just bung this one in...) Ian. > --- > tools/libxc/xc_domain_restore.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c > index 80769a7..ca2fb51 100644 > --- a/tools/libxc/xc_domain_restore.c > +++ b/tools/libxc/xc_domain_restore.c > @@ -87,7 +87,7 @@ static ssize_t rdexact(xc_interface *xch, struct restore_ctx *ctx, > if ( len == -1 && errno == EINTR ) > continue; > if ( !FD_ISSET(fd, &rfds) ) { > - ERROR("read_exact_timed failed (select returned %zd)", len); > + ERROR("%s failed (select returned %zd)", __func__, len); > errno = ETIMEDOUT; > return -1; > } > @@ -101,7 +101,7 @@ static ssize_t rdexact(xc_interface *xch, struct restore_ctx *ctx, > errno = 0; > } > if ( len <= 0 ) { > - ERROR("read_exact_timed failed (read rc: %d, errno: %d)", len, errno); > + ERROR("%s failed (read rc: %d, errno: %d)", __func__, len, errno); > return -1; > } > offset += len;