qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Sascha Silbe <silbe@linux.vnet.ibm.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Halil Pasic <pasic@linux.vnet.ibm.com>,
	Michael Roth <mdroth@linux.vnet.ibm.com>,
	Markus Armbruster <armbru@redhat.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] error: error_setg_errno(): errno may be clobbered
Date: Tue, 26 Jul 2016 12:54:41 -0600	[thread overview]
Message-ID: <5797B1F1.2010006@redhat.com> (raw)
In-Reply-To: <1469558699-23314-1-git-send-email-silbe@linux.vnet.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 759 bytes --]

On 07/26/2016 12:44 PM, Sascha Silbe wrote:
> As a general policy, we want callers to save errno
> themselves. error_setg_internal() currently goes out of its way to
> preserve errno, so with the API documentation not mentioning it either
> way, callers might come to rely on the current behaviour of the
> implementation. Spell out that we don't want to make that promise.

Alternatively, we could explicitly document that we DO intend to
preserve errno, so that callers can rely on it.  Libvirt went with that
approach (error-reporting functions that preserve errno are easier to
think about than functions which may clobber errno).


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2016-07-26 18:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26 18:44 [Qemu-devel] [PATCH] error: error_setg_errno(): errno may be clobbered Sascha Silbe
2016-07-26 18:54 ` Eric Blake [this message]
2016-07-27  8:02 ` Markus Armbruster
2016-07-27  9:26   ` Sascha Silbe

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=5797B1F1.2010006@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mreitz@redhat.com \
    --cc=pasic@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=silbe@linux.vnet.ibm.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).