qemu/block/qcow2.c:1942: possible performance problem ?
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| QEMU |
Won't Fix
|
Undecided
|
Unassigned | ||
Bug Description
I just ran static analyser cppcheck over today (20140520) qemu source code.
It said many things, including
[qemu/block/
ten before its old content has been used.
Source code is
Worth tuning ?
Similar problem here
[qemu/block/
before its old content has been used.
and
[qemu/hw/
being written before its old content has been used.

I can only speak for qcow2 and qcow, but for those places, I don't think it is worth fixing. First of all, both are image formats, so the bottleneck is generally the disk on which the images are stored and not main memory, so an overeager memset should not cause any problems.
For both, the relevant piece of code is in qcow2/qcow_ write_compresse d() which are rarely used anyway (as far as I know) and even if used, they have additional overhead due to having to compress data first, so “fixing” the memset() won't make them noticibly faster.
I don't know about the ACPI thing, but to me it seems that it's copying data to a temporary buffer and then overwriting its beginning with zeroes. From my very limited ACPI knowledge I'd guess this function is called at some point during qemu startup, so it doesn't seem worth optimizing either.