Re: [Qemu-devel] [PATCH v2 21/23] error: Clean up errors with embedded newlines (again)
Eric Blake writes: > On 12/17/2015 09:50 AM, Markus Armbruster wrote: >> The arguments of error_report() should yield a short error string >> without newlines. >> >> A few places try to print additional help after the error message by >> embedding newlines in the error string. That's nice, but let's do it >> the right way. Commit 474c213 cleaned up some, but they keep coming >> back. Offenders tracked down with the Coccinelle semantic patch from >> commit 312fd5f. > > Not sure if you'll have any stragglers from 1/23 here, after fixing 16/23. Just one: qemu-nbd.c:604:28:"Invalid number of argument.\n" "Try `%s --help' for more information." >> >> Cc: Laszlo Ersek >> Cc: Pavel Fedin >> Signed-off-by: Markus Armbruster >> Reviewed-by: Laszlo Ersek >> --- >> hw/i386/pc.c | 4 ++-- >> kvm-all.c| 6 +++--- >> 2 files changed, 5 insertions(+), 5 deletions(-) >> > > Reviewed-by: Eric Blake Thanks!
Re: [Qemu-devel] [PATCH v2 21/23] error: Clean up errors with embedded newlines (again)
On 12/17/2015 09:50 AM, Markus Armbruster wrote: > The arguments of error_report() should yield a short error string > without newlines. > > A few places try to print additional help after the error message by > embedding newlines in the error string. That's nice, but let's do it > the right way. Commit 474c213 cleaned up some, but they keep coming > back. Offenders tracked down with the Coccinelle semantic patch from > commit 312fd5f. Not sure if you'll have any stragglers from 1/23 here, after fixing 16/23. > > Cc: Laszlo Ersek > Cc: Pavel Fedin > Signed-off-by: Markus Armbruster > Reviewed-by: Laszlo Ersek > --- > hw/i386/pc.c | 4 ++-- > kvm-all.c| 6 +++--- > 2 files changed, 5 insertions(+), 5 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature
[Qemu-devel] [PATCH v2 21/23] error: Clean up errors with embedded newlines (again)
The arguments of error_report() should yield a short error string without newlines. A few places try to print additional help after the error message by embedding newlines in the error string. That's nice, but let's do it the right way. Commit 474c213 cleaned up some, but they keep coming back. Offenders tracked down with the Coccinelle semantic patch from commit 312fd5f. Cc: Laszlo Ersek Cc: Pavel Fedin Signed-off-by: Markus Armbruster Reviewed-by: Laszlo Ersek --- hw/i386/pc.c | 4 ++-- kvm-all.c| 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 112361a..b5caa06 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -418,8 +418,8 @@ static void pc_cmos_init_late(void *opaque) if (state.multiple) { error_report("warning: multiple floppy disk controllers with " - "iobase=0x3f0 have been found;\n" - "the one being picked for CMOS setup might not reflect " + "iobase=0x3f0 have been found"); +error_printf("the one being picked for CMOS setup might not reflect " "your intent"); } pc_cmos_init_floppy(s, state.floppy); diff --git a/kvm-all.c b/kvm-all.c index c648b81..9a7dd21 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -2020,9 +2020,9 @@ void kvm_device_access(int fd, int group, uint64_t attr, write ? KVM_SET_DEVICE_ATTR : KVM_GET_DEVICE_ATTR, &kvmattr); if (err < 0) { -error_report("KVM_%s_DEVICE_ATTR failed: %s\n" - "Group %d attr 0x%016" PRIx64, write ? "SET" : "GET", - strerror(-err), group, attr); +error_report("KVM_%s_DEVICE_ATTR failed: %s", + write ? "SET" : "GET", strerror(-err)); +error_printf("Group %d attr 0x%016" PRIx64, group, attr); abort(); } } -- 2.4.3