On Tue, Dec 01, 2015 at 03:14:14PM +0800, 浩樊啊 wrote: > I read the source code of qcow2. > I can see > bdrv_co_do_readv---bdrv_co_do_preadv---bdrv_aligned_preadv---drv->bdrv_co_readv > (here drv.bdrv_co_readv=qcow2_co_readv) > but when I read > qcow2_co_readv->bdrv_co_readv->bdrv_co_do_readv->bdrv_co_do_preadv > I am confused about this. qcow2_co_readv use bdrv_co_do_preadv again?
The qcow2 BlockDriverState uses a file BlockDriverState to do the actual I/O. This way the qcow2 image format can be used on POSIX files, iSCSI LUNs, Gluster files, etc. It means that qcow2 code does not call preadv(2)/pwritev(2) directly but instead uses another BlockDriverState to perform the actual I/O. In QEMU we keep "image format" block drivers (e.g. qcow2, vmdk, vhdx) separate from "protocol" block drivers (e.g. POSIX, Win32, Gluster, Sheepdog, iSCSI). Stefan
signature.asc
Description: PGP signature