* [Qemu-devel] Possible leak in block/qcow.c
@ 2011-07-18 7:25 Frediano Ziglio
2011-07-18 9:33 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Frediano Ziglio @ 2011-07-18 7:25 UTC (permalink / raw)
To: qemu-devel
Hi,
I noted that there are two cluster_data member in block/qcow.c, one
in BDRVQcowState, the other in QCowAIOCB. The last one is used in
qcow_aio_write_cb to hold buffer for encrypt the cluster before write
but I cannot find any related qemu_free while I can find many place
where BDRVQcowState::cluster_data is freed. It seems to me a leak but
I don't understand why nobody reported this problem before (it should
happen at every write so anybody using qcow encrypted should rapidly
see this problem). Perhaps there is a sort of garbage collector I'm
not aware?
Frediano Ziglio
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] Possible leak in block/qcow.c
2011-07-18 7:25 [Qemu-devel] Possible leak in block/qcow.c Frediano Ziglio
@ 2011-07-18 9:33 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2011-07-18 9:33 UTC (permalink / raw)
To: Frediano Ziglio; +Cc: qemu-devel
Am 18.07.2011 09:25, schrieb Frediano Ziglio:
> Hi,
> I noted that there are two cluster_data member in block/qcow.c, one
> in BDRVQcowState, the other in QCowAIOCB. The last one is used in
> qcow_aio_write_cb to hold buffer for encrypt the cluster before write
> but I cannot find any related qemu_free while I can find many place
> where BDRVQcowState::cluster_data is freed. It seems to me a leak but
> I don't understand why nobody reported this problem before (it should
> happen at every write so anybody using qcow encrypted should rapidly
> see this problem). Perhaps there is a sort of garbage collector I'm
> not aware?
The trick is that ACBs are reused. I think they won't be freed while
qemu is running, so the number of ACBs you have is the maximum number of
parallel requests you had while running the VM. It's typically not a
very large number.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-18 9:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-18 7:25 [Qemu-devel] Possible leak in block/qcow.c Frediano Ziglio
2011-07-18 9:33 ` Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).