qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <bonzini@gnu.org>
To: Max Reitz <mreitz@redhat.com>,
	SeokYeon Hwang <syeon.hwang@samsung.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 13:44:30 +0100	[thread overview]
Message-ID: <545A1BAE.4070802@gnu.org> (raw)
In-Reply-To: <545A05CC.4050109@redhat.com>



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

  parent reply	other threads:[~2014-11-05 12:44 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 [this message]
2014-11-05 13:13         ` SeokYeon Hwang
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=545A1BAE.4070802@gnu.org \
    --to=bonzini@gnu.org \
    --cc=armbru@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=paolo.bonzini@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=syeon.hwang@samsung.com \
    /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).