[vbox-dev] Byte-level read/write access to vdi files through Main API
achim.hasenmueller at oracle.com
Fri Dec 24 08:02:15 PST 2010
> I suspect that the answer to my question is 'no', but would like to
> get a confirmation. Is there functionality in the Main API (which I'm
> accessing through COM on Windows) for byte-level read/write access to
> vdi files?
Hehe, of course not. That would not be good for performance. However, the VirtualBox storage architecture supports a filter driver model. You can develop a simple filter driver and dynamically insert it into the chain of storage drivers.
Here's an example filter which we use to perform consistency tests:
In its init routine drvdiskintConstruct, it will install the required handlers so that it receives callbacks on disk read/write. If you configure your VM to "Use Host IO cache", then it will be simpler, because there will be no async IO which is much harder to handle.
If you want to insert boot sectors, you want to work on the layer above VDI as you only care about sector reads/writes and not how the actual on disk storage looks like.
More information about the vbox-dev