All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
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
Subject: Re: [Qemu-devel] [PATCH v2 0/4] initialize progname with error_set_progname()
Date: Thu, 22 Jan 2015 10:47:58 +0100	[thread overview]
Message-ID: <871tmnywmp.fsf@blackfin.pond.sub.org> (raw)
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")

Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp> 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 <armbru@redhat.com>

      parent reply	other threads:[~2015-01-22  9:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Markus Armbruster [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871tmnywmp.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mitake.hitoshi@gmail.com \
    --cc=mitake.hitoshi@lab.ntt.co.jp \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.