mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
error: Strip trailing '\n' from error string arguments (again)
Commit6daf194d
andbe62a2eb
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>
This commit is contained in:
parent
1a9522cc6e
commit
312fd5f290
16 changed files with 83 additions and 83 deletions
|
@ -1333,7 +1333,7 @@ static void cpu_x86_parse_featurestr(X86CPU *cpu, char *features, Error **errp)
|
|||
|
||||
numvalue = strtoul(val, &err, 0);
|
||||
if (!*val || *err) {
|
||||
error_setg(errp, "bad numerical value %s\n", val);
|
||||
error_setg(errp, "bad numerical value %s", val);
|
||||
goto out;
|
||||
}
|
||||
if (numvalue < 0x80000000) {
|
||||
|
@ -1355,7 +1355,7 @@ static void cpu_x86_parse_featurestr(X86CPU *cpu, char *features, Error **errp)
|
|||
tsc_freq = strtosz_suffix_unit(val, &err,
|
||||
STRTOSZ_DEFSUFFIX_B, 1000);
|
||||
if (tsc_freq < 0 || *err) {
|
||||
error_setg(errp, "bad numerical value %s\n", val);
|
||||
error_setg(errp, "bad numerical value %s", val);
|
||||
goto out;
|
||||
}
|
||||
snprintf(num, sizeof(num), "%" PRId64, tsc_freq);
|
||||
|
@ -1364,12 +1364,12 @@ static void cpu_x86_parse_featurestr(X86CPU *cpu, char *features, Error **errp)
|
|||
char *err;
|
||||
numvalue = strtoul(val, &err, 0);
|
||||
if (!*val || *err) {
|
||||
error_setg(errp, "bad numerical value %s\n", val);
|
||||
error_setg(errp, "bad numerical value %s", val);
|
||||
goto out;
|
||||
}
|
||||
hyperv_set_spinlock_retries(numvalue);
|
||||
} else {
|
||||
error_setg(errp, "unrecognized feature %s\n", featurestr);
|
||||
error_setg(errp, "unrecognized feature %s", featurestr);
|
||||
goto out;
|
||||
}
|
||||
} else if (!strcmp(featurestr, "check")) {
|
||||
|
@ -1382,7 +1382,7 @@ static void cpu_x86_parse_featurestr(X86CPU *cpu, char *features, Error **errp)
|
|||
hyperv_enable_vapic_recommended(true);
|
||||
} else {
|
||||
error_setg(errp, "feature string `%s' not in format (+feature|"
|
||||
"-feature|feature=xyz)\n", featurestr);
|
||||
"-feature|feature=xyz)", featurestr);
|
||||
goto out;
|
||||
}
|
||||
if (error_is_set(errp)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue