From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZ3cU-0000DY-UC for qemu-devel@nongnu.org; Tue, 21 Jun 2011 12:16:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QZ3cS-0007a3-TU for qemu-devel@nongnu.org; Tue, 21 Jun 2011 12:16:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35535) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QZ3cS-0007Zw-HA for qemu-devel@nongnu.org; Tue, 21 Jun 2011 12:16:04 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5LGG3os006477 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 21 Jun 2011 12:16:03 -0400 Message-ID: <4E00C471.3060802@redhat.com> Date: Tue, 21 Jun 2011 18:18:57 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1306927751-8352-1-git-send-email-kwolf@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qemu-char: Print strerror message on failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org Am 21.06.2011 18:09, schrieb Markus Armbruster: > Kevin Wolf writes: > >> The only way for chardev drivers to communicate an error was to return a NULL >> pointer, which resulted in an error message that said _that_ something went >> wrong, but not _why_. >> >> This patch changes the interface to return 0/-errno and updates >> qemu_chr_open_opts to use strerror to display a more helpful error message. > > Returning the result through a pointer is awkward. What about stuffing > the error code into errno? I generally like it better to return error codes explicitly instead of storing them in some global variable where it tends to be trampled over before you print the message. But if people prefer it that way, I can redo the patch. Kevin