From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41995) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xlzx7-00057O-NG for qemu-devel@nongnu.org; Wed, 05 Nov 2014 07:44:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xlzwy-0002sM-KD for qemu-devel@nongnu.org; Wed, 05 Nov 2014 07:44:45 -0500 Received: from mail-lb0-x230.google.com ([2a00:1450:4010:c04::230]:59192) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xlzwy-0002sA-8K for qemu-devel@nongnu.org; Wed, 05 Nov 2014 07:44:36 -0500 Received: by mail-lb0-f176.google.com with SMTP id 10so561008lbg.7 for ; Wed, 05 Nov 2014 04:44:34 -0800 (PST) Sender: Paolo Bonzini Message-ID: <545A1BAE.4070802@gnu.org> Date: Wed, 05 Nov 2014 13:44:30 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1415174992-13246-1-git-send-email-syeon.hwang@samsung.com> <5459DBE1.30509@redhat.com> <545A0288.4010905@gnu.org> <545A05CC.4050109@redhat.com> In-Reply-To: <545A05CC.4050109@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] error: fixed error_set_errno() to deal with a negative type of os_error. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , SeokYeon Hwang , qemu-devel@nongnu.org Cc: paolo.bonzini@gmail.com, armbru@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