[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 37/38] raw: Convert a warning to warn_report(
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v4 37/38] raw: Convert a warning to warn_report() |
Date: |
Wed, 17 Oct 2018 19:34:26 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Kevin Wolf <address@hidden> writes:
> Am 17.10.2018 um 10:27 hat Markus Armbruster geschrieben:
>> Convert the warning about dangerous automatic probing of raw images to
>> warn_report(). Split its text to conform to conventions spelled out
>> in warn_report()'s contract.
>
> One of the things the warn_report() documentation says is:
>
> It's wrong to call this in a QMP monitor. Use error_setg() there.
>
> Probably a bug in the comment (copy and paste from error_report())? The
> same sentence is also there for info_report().
We could debate whether use of warn_report() in a QMP monitor is a good
idea, but the comment is definitely wrong: error_setg() can't do
warnings. I'll fix this.
>> Update expected output of qemu-iotest 109 accordingly. Update
>> qemu-iotest 099's output filtering to keep filtering out the warning.
>>
>> Cc: Kevin Wolf <address@hidden>
>> Cc: Max Reitz <address@hidden>
>> Signed-off-by: Markus Armbruster <address@hidden>
>
>> --- a/tests/qemu-iotests/109.out
>> +++ b/tests/qemu-iotests/109.out
>> @@ -5,8 +5,9 @@ QA output created by 109
>> Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
>> Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864
>> {"return": {}}
>> -WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing
>> guessed raw.
>> - Automatically detecting the format is dangerous for raw images,
>> write operations on block 0 will be restricted.
>> +warning: Image format was not specified for 'TEST_DIR/t.raw' and probing
>> guessed raw
>> +Automatically detecting the format is dangerous for raw images, write
>> +operations on block 0 will be restricted.
>> Specify the 'raw' format explicitly to remove the restrictions.
>
> I honestly like the old formatting better, with indentation and without
> the arbitrary \n in the error_printf() line that is probably shorter
> than the warning line anyway.
We don't indent an informational message following an error or a warning
elsewhere. I'm willing to keep the indentation anyway. You tell me.
I dislike text wider than some 70 characters. I'm willing to keep it
that way anyway. You tell me.
> Also, I know that qemu-iotests ignores whitespace for diffing the
> result, but not adjusting the last line in the reference output still
> looks a bit odd.
That's an accident.
Thanks!
- [Qemu-devel] [PATCH v4 10/38] ioapic: Fix error handling in realize(), (continued)
- [Qemu-devel] [PATCH v4 10/38] ioapic: Fix error handling in realize(), Markus Armbruster, 2018/10/17
- [Qemu-devel] [PATCH v4 17/38] seccomp: Clean up error reporting in parse_sandbox(), Markus Armbruster, 2018/10/17
- [Qemu-devel] [PATCH v4 05/38] vfio: Use warn_report() & friends to report warnings, Markus Armbruster, 2018/10/17
- [Qemu-devel] [PATCH v4 25/38] ui/keymaps: Fix handling of erroneous include files, Markus Armbruster, 2018/10/17
- [Qemu-devel] [PATCH v4 26/38] ui: Convert vnc_display_init(), init_keyboard_layout() to Error, Markus Armbruster, 2018/10/17
- [Qemu-devel] [PATCH v4 04/38] cpus hw target: Use warn_report() & friends to report warnings, Markus Armbruster, 2018/10/17
- [Qemu-devel] [PATCH v4 37/38] raw: Convert a warning to warn_report(), Markus Armbruster, 2018/10/17
- [Qemu-devel] [PATCH v4 38/38] vpc: Fail open on bad header checksum, Markus Armbruster, 2018/10/17