Received: from eggs.gnu.org ([2001:4830:134:3::10]:44896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEENO-0003zo-A7 for qemu-devel@nongnu.org; Thu, 22 Jan 2015 04:48:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEENK-00027t-8J for qemu-devel@nongnu.org; Thu, 22 Jan 2015 04:48:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEENK-00027K-0W for qemu-devel@nongnu.org; Thu, 22 Jan 2015 04:48:30 -0500 From: Markus Armbruster References: <1421917694-6824-1-git-send-email-mitake.hitoshi@lab.ntt.co.jp> Date: Thu, 22 Jan 2015 10:47:58 +0100 In-Reply-To: <1421917694-6824-1-git-send-email-mitake.hitoshi@lab.ntt.co.jp> (Hitoshi Mitake's message of "Thu, 22 Jan 2015 18:08:10 +0900") Message-ID: <871tmnywmp.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 0/4] initialize progname with error_set_progname() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hitoshi Mitake Cc: kwolf@redhat.com, mitake.hitoshi@gmail.com, riku.voipio@iki.fi, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, stefanha@redhat.com, pbonzini@redhat.com Hitoshi Mitake writes: > In the context of some subcommands of QEMU, error_get_progname() can > be used for obtaining argv[0]. The function is useful for the commands > because it is possible to detect a name of executable file and switch > behavior based on the function like busybox. e.g. block drivers can > switch behavior based on the name (qemu itself, qemu-img, or qemu-io). Changing behavior based on argv[0] is usually a bad idea. Current use of error_get_progname() is limited to error messages and such. That's a good idea. > But calling error_get_progname() in some commands causes segmentation > fault because initialization, calling error_set_progname(), isn't > done. This patchset adds the initialization to the commands which > lacks it but linked to util/qemu-error.o (one exception is bsd-user, because I > don't have an environment which can build and test it). > > Currently, the missing call of error_set_progname() doesn't cause any > problems because the changed commands don't use error_get_progname(). This > patchset is a proactive action (but sheepdog driver will use it soon). I'm fine with calling error_set_progname() in all programs linking with qemu-error.c. I'm reserving judgement on its use in block drivers. Please cc me on that patch. Series Reviewed-by: Markus Armbruster