Comments

Next commit wants to use this.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
This patch is an interesting case, because one of the goal of the error
format that's being replaced was that callers could use it to know the
error cause (with error_is_type().
However, the new error format doesn't allow this as most errors are
class GenericError. So, we'll have to use errno to know the error cause,
this is the case of inet_connect() when called by
tcp_start_outgoing_migration().
qemu-sockets.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

On Wed, 1 Aug 2012 22:02:35 -0300
Luiz Capitulino <lcapitulino@redhat.com> wrote:
> Next commit wants to use this.> > Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>> ---> > This patch is an interesting case, because one of the goal of the error> format that's being replaced was that callers could use it to know the> error cause (with error_is_type().> > However, the new error format doesn't allow this as most errors are> class GenericError. So, we'll have to use errno to know the error cause,> this is the case of inet_connect() when called by> tcp_start_outgoing_migration().
I'm thinking in doing this differently. Instead of returning errno, we
could have:
error_sete(Error **err, ErrorClass err_class, int err_no,
const char *fmt, ...);
Then we store err_no in Error, and also add error_get_errno().
Comments?