From: SeokYeon Hwang <syeon.hwang@samsung.com>
To: 'Paolo Bonzini' <bonzini@gnu.org>,
'Max Reitz' <mreitz@redhat.com>,
qemu-devel@nongnu.org
Cc: paolo.bonzini@gmail.com, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error.
Date: Wed, 05 Nov 2014 22:13:09 +0900 [thread overview]
Message-ID: <040a01cff8fa$3ef06c90$bcd145b0$@samsung.com> (raw)
In-Reply-To: <545A1BAE.4070802@gnu.org>
> -----Original Message-----
> From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo
> Bonzini
> Sent: Wednesday, November 05, 2014 9:45 PM
> To: Max Reitz; SeokYeon Hwang; qemu-devel@nongnu.org
> Cc: armbru@redhat.com; paolo.bonzini@gmail.com
> Subject: Re: [PATCH] error: fixed error_set_errno() to deal with a
> negative type of os_error.
>
>
>
> On 05/11/2014 12:11, Max Reitz wrote:
> >
> > Of course I understand, but this patch doesn't make matters worse, as
> > long as there are not systems which have negative values for errno
> > (which I think we generally assume not to exist throughout qemu).
> > That's why I'm fine with it. We should fix the callers but I don't see
> > why we shouldn't apply this patch as well.
> >
> > A similar issue already came up and led to commit b276d2499, where
> > callers of error_setg_errno() assumed that it would not clobber errno,
> > so we fixed some of the callers but also applied that commit which
> > just saves errno because there's no reason not to.
>
> I think side effect are a different matter than misuse of QEMU.
>
> There are "only" 157 calls to error_setg_errno; 67 use "errno" as the
> argument, and 4 use an explicit errno value (one of them is the wrong -
> EBUSY). The other 86 seem correct and should not be hard to audit.
>
> Let's instead add an assertion check to error_setg_errno.
>
> Paolo
I have expected to come out several opinions about this patch.
The use of negative errno on "strerror()" was obviously wrong. But that
does not mean it is wrong to use the negative errno on "error_set_errno()".
The reason that I chose this one among the solutions is to change function
specification. I think it seems good to us to respect the tradition of the
developers that use negative errno.
But if error_set_errno() has strict specification - so, we must not change
it's spec - I agree with Paolo's opinion.
next prev parent reply other threads:[~2014-11-05 13:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-05 8:09 [Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error SeokYeon Hwang
2014-11-05 8:12 ` Max Reitz
2014-11-05 10:57 ` Paolo Bonzini
2014-11-05 11:11 ` Max Reitz
2014-11-05 11:19 ` Eric Blake
2014-11-06 4:49 ` Amos Kong
2014-11-05 12:44 ` Paolo Bonzini
2014-11-05 13:13 ` SeokYeon Hwang [this message]
2014-11-05 13:29 ` Markus Armbruster
2014-11-06 2:02 ` SeokYeon Hwang
2014-11-06 9:25 ` Markus Armbruster
2014-11-07 2:26 ` SeokYeon Hwang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='040a01cff8fa$3ef06c90$bcd145b0$@samsung.com' \
--to=syeon.hwang@samsung.com \
--cc=armbru@redhat.com \
--cc=bonzini@gnu.org \
--cc=mreitz@redhat.com \
--cc=paolo.bonzini@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).