qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 0/4] initialize progname with error_set_progn


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v2 0/4] initialize progname with error_set_progname()
Date: Thu, 22 Jan 2015 10:47:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hitoshi Mitake <address@hidden> 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 <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]