Received: from eggs.gnu.org ([2001:4830:134:3::10]:49746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS7Nj-0007K5-BU for qemu-devel@nongnu.org; Tue, 26 Jul 2016 14:47:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bS7Nd-0002fN-9x for qemu-devel@nongnu.org; Tue, 26 Jul 2016 14:47:06 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45846 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS7Nd-0002fJ-4r for qemu-devel@nongnu.org; Tue, 26 Jul 2016 14:47:01 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6QIijTv029325 for ; Tue, 26 Jul 2016 14:47:00 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 24e0v6rr2n-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 26 Jul 2016 14:47:00 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 26 Jul 2016 19:46:58 +0100 From: Sascha Silbe In-Reply-To: References: <1468845016-43468-1-git-send-email-pasic@linux.vnet.ibm.com> <1469532873-78542-1-git-send-email-pasic@linux.vnet.ibm.com> <7c4bdb1e-f0aa-4a07-2780-37f4f92c6665@redhat.com> <87eg6ge0oi.fsf@oc4731375738.ibm.com> Date: Tue, 26 Jul 2016 20:46:55 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-Id: <87bn1kdyow.fsf@oc4731375738.ibm.com> Subject: Re: [Qemu-devel] [PATCH v2 1/1] block: improve error handling in raw_open List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , Halil Pasic , qemu-block@nongnu.org Cc: Kevin Wolf , Cornelia Huck , qemu-devel@nongnu.org Dear Max, Max Reitz writes: >> So how about: >>=20 >> /* >> * Just like error_setg(), with @os_error info added to the message. >> * If @os_error is non-zero, ": " + strerror(os_error) is appended to >> * the human-readable error message. >> + * >> + * Reminder: errno may get clobbered by almost any function call. If >> + * you need the value of errno for another purpose, save it before >> + * invoking error_setg_errno() (or any other function for that >> + * matter). >> */ >> #define error_setg_errno(errp, os_error, fmt, ...) = \ >> error_setg_errno_internal((errp), __FILE__, __LINE__, __func__, = \ >> (os_error), (fmt), ## __VA_ARGS__) >>=20 >> (I can prepare a proper patch if you agree with the above.) > > Thanks, that sounds good to me. Great, sent out as a patch [1]. Sascha [1] mid:1469558699-23314-1-git-send-email-silbe@linux.vnet.ibm.com "[PATCH] error: error_setg_errno(): errno may be clobbered" by Sascha Silbe , sent on 2016-07-26. --=20 Softwareentwicklung Sascha Silbe, Niederhofenstra=C3=9Fe 5/1, 71229 Leonberg https://se-silbe.de/ USt-IdNr. DE281696641