The kernel already has pr_err helper lets do the same. Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxx> --- tools/kvm/builtin-stat.c | 2 +- tools/kvm/disk/core.c | 2 +- tools/kvm/include/kvm/util.h | 2 +- tools/kvm/kvm.c | 2 +- tools/kvm/util/parse-options.c | 16 ++++++++-------- tools/kvm/util/util.c | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) Index: linux-2.6.git/tools/kvm/builtin-stat.c =================================================================== --- linux-2.6.git.orig/tools/kvm/builtin-stat.c +++ linux-2.6.git/tools/kvm/builtin-stat.c @@ -68,7 +68,7 @@ static int do_memstat(const char *name, r = select(1, &fdset, NULL, NULL, &t); if (r < 0) { - pr_error("Could not retrieve mem stats from %s", name); + pr_err("Could not retrieve mem stats from %s", name); return r; } r = read(sock, &stats, sizeof(stats)); Index: linux-2.6.git/tools/kvm/disk/core.c =================================================================== --- linux-2.6.git.orig/tools/kvm/disk/core.c +++ linux-2.6.git/tools/kvm/disk/core.c @@ -118,7 +118,7 @@ struct disk_image **disk_image__open_all disks[i] = disk_image__open(filenames[i], readonly[i]); if (!disks[i]) { - pr_error("Loading disk image '%s' failed", filenames[i]); + pr_err("Loading disk image '%s' failed", filenames[i]); goto error; } } Index: linux-2.6.git/tools/kvm/include/kvm/util.h =================================================================== --- linux-2.6.git.orig/tools/kvm/include/kvm/util.h +++ linux-2.6.git/tools/kvm/include/kvm/util.h @@ -38,7 +38,7 @@ extern bool do_debug_print; extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2))); extern void die_perror(const char *s) NORETURN; -extern int pr_error(const char *err, ...) __attribute__((format (printf, 1, 2))); +extern int pr_err(const char *err, ...) __attribute__((format (printf, 1, 2))); extern void pr_warning(const char *err, ...) __attribute__((format (printf, 1, 2))); extern void pr_info(const char *err, ...) __attribute__((format (printf, 1, 2))); extern void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN); Index: linux-2.6.git/tools/kvm/kvm.c =================================================================== --- linux-2.6.git.orig/tools/kvm/kvm.c +++ linux-2.6.git/tools/kvm/kvm.c @@ -109,7 +109,7 @@ static int kvm__check_extensions(struct if (!kvm_req_ext[i].name) break; if (!kvm__supports_extension(kvm, kvm_req_ext[i].code)) { - pr_error("Unsuppored KVM extension detected: %s", + pr_err("Unsuppored KVM extension detected: %s", kvm_req_ext[i].name); return (int)-i; } Index: linux-2.6.git/tools/kvm/util/parse-options.c =================================================================== --- linux-2.6.git.orig/tools/kvm/util/parse-options.c +++ linux-2.6.git/tools/kvm/util/parse-options.c @@ -17,10 +17,10 @@ static int opterror(const struct option *opt, const char *reason, int flags) { if (flags & OPT_SHORT) - return pr_error("switch `%c' %s", opt->short_name, reason); + return pr_err("switch `%c' %s", opt->short_name, reason); if (flags & OPT_UNSET) - return pr_error("option `no-%s' %s", opt->long_name, reason); - return pr_error("option `%s' %s", opt->long_name, reason); + return pr_err("option `no-%s' %s", opt->long_name, reason); + return pr_err("option `%s' %s", opt->long_name, reason); } static int get_arg(struct parse_opt_ctx_t *p, const struct option *opt, @@ -324,7 +324,7 @@ static void check_typos(const char *arg, return; if (!prefixcmp(arg, "no-")) { - pr_error ("did you mean `--%s` (with two dashes ?)", arg); + pr_err("did you mean `--%s` (with two dashes ?)", arg); exit(129); } @@ -332,7 +332,7 @@ static void check_typos(const char *arg, if (!options->long_name) continue; if (!prefixcmp(options->long_name, arg)) { - pr_error ("did you mean `--%s` (with two dashes ?)", arg); + pr_err("did you mean `--%s` (with two dashes ?)", arg); exit(129); } } @@ -430,7 +430,7 @@ is_abbreviated: } if (ambiguous_option) - return pr_error("Ambiguous option: %s " + return pr_err("Ambiguous option: %s " "(could be --%s%s or --%s%s)", arg, (ambiguous_flags & OPT_UNSET) ? "no-" : "", @@ -566,9 +566,9 @@ int parse_options(int argc, const char * break; default: /* PARSE_OPT_UNKNOWN */ if (ctx.argv[0][1] == '-') { - pr_error("unknown option `%s'", ctx.argv[0] + 2); + pr_err("unknown option `%s'", ctx.argv[0] + 2); } else { - pr_error("unknown switch `%c'", *ctx.opt); + pr_err("unknown switch `%c'", *ctx.opt); } usage_with_options(usagestr, options); } Index: linux-2.6.git/tools/kvm/util/util.c =================================================================== --- linux-2.6.git.orig/tools/kvm/util/util.c +++ linux-2.6.git/tools/kvm/util/util.c @@ -46,7 +46,7 @@ void die(const char *err, ...) va_end(params); } -int pr_error(const char *err, ...) +int pr_err(const char *err, ...) { va_list params; -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html