qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/4] initialize progname with error_set_progname()
@ 2015-01-22  9:08 Hitoshi Mitake
  2015-01-22  9:08 ` [Qemu-devel] [PATCH v2 1/4] qemu-io: " Hitoshi Mitake
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Hitoshi Mitake @ 2015-01-22  9:08 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, mitake.hitoshi, Hitoshi Mitake, riku.voipio, armbru,
	mdroth, stefanha, pbonzini

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).

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).

v2:
 - pass argv[0] directly to error_set_progname() without calling basename
 - add initialization to commands other than qemu-io

The thread of v1 can be found here:
http://lists.gnu.org/archive/html/qemu-devel/2014-08/msg01502.html

Hitoshi Mitake (4):
  qemu-io: initialize progname with error_set_progname()
  qemu-nbd: initialize progname with error_set_progname()
  qga: initialize progname with error_set_progname()
  linux-user: initialize progname with error_set_progname()

 linux-user/main.c | 2 ++
 qemu-io.c         | 1 +
 qemu-nbd.c        | 1 +
 qga/main.c        | 1 +
 4 files changed, 5 insertions(+)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-02-02 14:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-22  9:08 [Qemu-devel] [PATCH v2 0/4] initialize progname with error_set_progname() Hitoshi Mitake
2015-01-22  9:08 ` [Qemu-devel] [PATCH v2 1/4] qemu-io: " Hitoshi Mitake
2015-02-02  9:51   ` Hitoshi Mitake
2015-02-02 11:36     ` Kevin Wolf
2015-02-02 14:04       ` Hitoshi Mitake
2015-01-22  9:08 ` [Qemu-devel] [PATCH v2 2/4] qemu-nbd: " Hitoshi Mitake
2015-01-22  9:08 ` [Qemu-devel] [PATCH v2 3/4] qga: " Hitoshi Mitake
2015-01-22  9:08 ` [Qemu-devel] [PATCH v2 4/4] linux-user: " Hitoshi Mitake
2015-01-22 10:07   ` Peter Maydell
2015-02-02  9:47     ` Hitoshi Mitake
2015-01-22  9:47 ` [Qemu-devel] [PATCH v2 0/4] " Markus Armbruster

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).