diff options
author | Markus Armbruster <armbru@redhat.com> | 2013-02-08 21:22:16 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-02-11 08:13:19 -0600 |
commit | 312fd5f29097890179793d8bbb59ab18afbe0ad4 (patch) | |
tree | 06b08cae96d4ce9d2c1e01fe1cef2a7f7ebc0b12 /ui | |
parent | 1a9522cc6ea04968e1169f0195952d0029d5dbb9 (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 'ui')
-rw-r--r-- | ui/console.c | 2 | ||||
-rw-r--r-- | ui/input.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ui/console.c b/ui/console.c index d880ebff07..0a68836d50 100644 --- a/ui/console.c +++ b/ui/console.c @@ -194,7 +194,7 @@ void qmp_screendump(const char *filename, Error **errp) if (consoles[0] && consoles[0]->hw_screen_dump) { consoles[0]->hw_screen_dump(consoles[0]->hw, filename, cswitch, errp); } else { - error_setg(errp, "device doesn't support screendump\n"); + error_setg(errp, "device doesn't support screendump"); } if (cswitch) { diff --git a/ui/input.c b/ui/input.c index 259fd1808d..9abef0cd78 100644 --- a/ui/input.c +++ b/ui/input.c @@ -269,7 +269,7 @@ void qmp_send_key(KeyValueList *keys, bool has_hold_time, int64_t hold_time, /* key down events */ keycode = keycode_from_keyvalue(p->value); if (keycode < 0x01 || keycode > 0xff) { - error_setg(errp, "invalid hex keycode 0x%x\n", keycode); + error_setg(errp, "invalid hex keycode 0x%x", keycode); free_keycodes(); return; } |