summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2013-02-08 21:22:16 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2013-02-11 08:13:19 -0600
commit312fd5f29097890179793d8bbb59ab18afbe0ad4 (patch)
tree06b08cae96d4ce9d2c1e01fe1cef2a7f7ebc0b12 /util
parent1a9522cc6ea04968e1169f0195952d0029d5dbb9 (diff)
error: Strip trailing '\n' from error string arguments (again)
Commit 6daf194d and be62a2eb got rid of a bunch, but they keep coming back. Tracked down with this Coccinelle semantic patch: @r@ expression err, eno, cls, fmt; position p; @@ ( error_report(fmt, ...)@p | error_set(err, cls, fmt, ...)@p | error_set_errno(err, eno, cls, fmt, ...)@p | error_setg(err, fmt, ...)@p | error_setg_errno(err, eno, fmt, ...)@p ) @script:python@ fmt << r.fmt; p << r.p; @@ if "\\n" in str(fmt): print "%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt) Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1360354939-10994-4-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'util')
-rw-r--r--util/qemu-config.c6
-rw-r--r--util/qemu-sockets.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/util/qemu-config.c b/util/qemu-config.c
index 47c81f72d3..db6ec03a78 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -29,7 +29,7 @@ QemuOptsList *qemu_find_opts(const char *group)
ret = find_list(vm_config_groups, group, &local_err);
if (error_is_set(&local_err)) {
- error_report("%s\n", error_get_pretty(local_err));
+ error_report("%s", error_get_pretty(local_err));
error_free(local_err);
}
@@ -153,7 +153,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname)
/* group with id */
list = find_list(lists, group, &local_err);
if (error_is_set(&local_err)) {
- error_report("%s\n", error_get_pretty(local_err));
+ error_report("%s", error_get_pretty(local_err));
error_free(local_err);
goto out;
}
@@ -164,7 +164,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname)
/* group without id */
list = find_list(lists, group, &local_err);
if (error_is_set(&local_err)) {
- error_report("%s\n", error_get_pretty(local_err));
+ error_report("%s", error_get_pretty(local_err));
error_free(local_err);
goto out;
}
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 3537bf3d45..1350cccce3 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -720,7 +720,7 @@ int unix_connect_opts(QemuOpts *opts, Error **errp,
int sock, rc;
if (NULL == path) {
- error_setg(errp, "unix connect: no path specified\n");
+ error_setg(errp, "unix connect: no path specified");
return -1;
}
@@ -854,7 +854,7 @@ SocketAddress *socket_parse(const char *str, Error **errp)
addr = g_new(SocketAddress, 1);
if (strstart(str, "unix:", NULL)) {
if (str[5] == '\0') {
- error_setg(errp, "invalid Unix socket address\n");
+ error_setg(errp, "invalid Unix socket address");
goto fail;
} else {
addr->kind = SOCKET_ADDRESS_KIND_UNIX;
@@ -863,7 +863,7 @@ SocketAddress *socket_parse(const char *str, Error **errp)
}
} else if (strstart(str, "fd:", NULL)) {
if (str[3] == '\0') {
- error_setg(errp, "invalid file descriptor address\n");
+ error_setg(errp, "invalid file descriptor address");
goto fail;
} else {
addr->kind = SOCKET_ADDRESS_KIND_FD;