Patchwork qemu-img: Call error_set_progname

login
register
mail settings
Submitter Kevin Wolf
Date Dec. 16, 2010, 2:13 p.m.
Message ID <1292508823-13015-1-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/75762/
State New
Headers show

Comments

Kevin Wolf - Dec. 16, 2010, 2:13 p.m.
Call error_set_progname during the qemu-img initialization, so that error
messages printed with error_report() use the right prefix.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 qemu-img.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Jes Sorensen - Dec. 16, 2010, 2:36 p.m.
On 12/16/10 15:13, Kevin Wolf wrote:
> Call error_set_progname during the qemu-img initialization, so that error
> messages printed with error_report() use the right prefix.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>

Acked-by: Jes Sorensen <Jes.Sorensen@redhat.com>


> ---
>  qemu-img.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/qemu-img.c b/qemu-img.c
> index 603bdb3..0ff179f 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -23,6 +23,7 @@
>   */
>  #include "qemu-common.h"
>  #include "qemu-option.h"
> +#include "qemu-error.h"
>  #include "osdep.h"
>  #include "sysemu.h"
>  #include "block_int.h"
> @@ -1508,6 +1509,8 @@ int main(int argc, char **argv)
>      const img_cmd_t *cmd;
>      const char *cmdname;
>  
> +    error_set_progname(argv[0]);
> +
>      bdrv_init();
>      if (argc < 2)
>          help();

Patch

diff --git a/qemu-img.c b/qemu-img.c
index 603bdb3..0ff179f 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -23,6 +23,7 @@ 
  */
 #include "qemu-common.h"
 #include "qemu-option.h"
+#include "qemu-error.h"
 #include "osdep.h"
 #include "sysemu.h"
 #include "block_int.h"
@@ -1508,6 +1509,8 @@  int main(int argc, char **argv)
     const img_cmd_t *cmd;
     const char *cmdname;
 
+    error_set_progname(argv[0]);
+
     bdrv_init();
     if (argc < 2)
         help();