Received: from eggs.gnu.org ([2001:4830:134:3::10]:43881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIDf3-0005Hg-W0 for qemu-devel@nongnu.org; Mon, 02 Feb 2015 04:51:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIDf0-0003G4-R8 for qemu-devel@nongnu.org; Mon, 02 Feb 2015 04:51:17 -0500 Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]:54237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIDf0-0003Fx-Ja for qemu-devel@nongnu.org; Mon, 02 Feb 2015 04:51:14 -0500 Received: by mail-pa0-f45.google.com with SMTP id et14so80428436pad.4 for ; Mon, 02 Feb 2015 01:51:13 -0800 (PST) Sender: Hitoshi Mitake Date: Mon, 02 Feb 2015 18:51:09 +0900 Message-ID: <87y4ogproy.wl%mitake.hitoshi@lab.ntt.co.jp> From: Hitoshi Mitake In-Reply-To: <1421917694-6824-2-git-send-email-mitake.hitoshi@lab.ntt.co.jp> References: <1421917694-6824-1-git-send-email-mitake.hitoshi@lab.ntt.co.jp> <1421917694-6824-2-git-send-email-mitake.hitoshi@lab.ntt.co.jp> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Qemu-devel] [PATCH v2 1/4] qemu-io: initialize progname with error_set_progname() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hitoshi Mitake , Kevin Wolf , Stefan Hajnoczi , mitake.hitoshi@gmail.com, Markus Armbruster At Thu, 22 Jan 2015 18:08:11 +0900, Hitoshi Mitake wrote: > > Calling error_get_progname() in the context of qemu-io can cause > segmentation fault because qemu-io doesn't initialize its progname > with error_set_progname(). This patch adds the initialization. > > Currently, the missing call of error_set_progname() doesn't cause any > problems because qemu-io doesn't use error_get_progname(). This patch > is a proactive action. > > Cc: Kevin Wolf > Cc: Stefan Hajnoczi > Cc: Markus Armbruster > Signed-off-by: Hitoshi Mitake > --- > qemu-io.c | 1 + > 1 file changed, 1 insertion(+) Hi Kevin, Stefan, could you pick this patch? sheepdog driver has a pending patch [1] which depends on it. I believe at least qemu-io should call error_set_progname() because block drivers can use the qemu-error infrastructure. [1] https://github.com/sheepdog/qemu/commit/a95c35e606a2a189e7dbaf645277c5c306b01e4b Thanks, Hitoshi > > v2: > - pass argv[0] directly to error_set_progname() without calling basename > > diff --git a/qemu-io.c b/qemu-io.c > index 91a445a..0e7d7d4 100644 > --- a/qemu-io.c > +++ b/qemu-io.c > @@ -396,6 +396,7 @@ int main(int argc, char **argv) > > progname = basename(argv[0]); > qemu_init_exec_dir(argv[0]); > + error_set_progname(argv[0]); > > bdrv_init(); > > -- > 1.9.1 >