qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V2 3/6] libqblock error handling


From: Wenchao Xia
Subject: Re: [Qemu-devel] [PATCH V2 3/6] libqblock error handling
Date: Tue, 11 Sep 2012 12:36:21 +0800
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120824 Thunderbird/15.0

于 2012-9-11 5:33, Eric Blake 写道:
On 09/10/2012 02:26 AM, Wenchao Xia wrote:
   This patch contains error handling APIs, which user could call them to
get error details.

OK.

Signed-off-by: Wenchao Xia <address@hidden>
---
  libqblock/libqblock-error.c |   60 +++++++++++++++++++++++++++++++++++++++++++
  libqblock/libqblock-error.h |   50 +++++++++++++++++++++++++++++++++++
  2 files changed, 110 insertions(+), 0 deletions(-)
  create mode 100644 libqblock/libqblock-error.c
  create mode 100644 libqblock/libqblock-error.h

Again, this should come earlier in the series, and I'm focusing on the
.h as a potential user, rather than on the .c.

+    default:
+        err_ret_str = "Unknow error.";

s/Unknow/Unknown/

  OK, will fix it.

+++ b/libqblock/libqblock-error.h
+/**
+ * qb_error_get_errno: get error number, only valid when err_ret is
+ *   QB_ERR_INTERNAL_ERR.
+ *
+ * return negative errno or 0 if last error is not QB_ERR_INTERNAL_ERR.

So does this return EINVAL or -EINVAL?  If you return positive errno
values, then you can reserve 0 for no error, and a QB_*-specific
negative value in the case where QB_ERR_INTERNAL_ERR was not the last error.

  I think better to split these kind of errors, they are two level of
errors, level one is libqblock's error, and errno is 2nd level of error,
belong to one kind of level 1 error, QB_ERR_INTERNAL_ERR.


--
Best Regards

Wenchao Xia




reply via email to

[Prev in Thread] Current Thread [Next in Thread]