Hi,
I am using Lubuntu 11.04 with qemu. My Os loads applications from a fat32 file system. I pass the physical drive as the disk to qemu i.e -hda /dev/sda and my os does the directory parsing, reading etc.. But every change I make to the file system from the host is not shown in my Os until next reboot. I think it maybe that qemu internally caches disk accesses. So do anyone know of a solution or argument that I can pass to qemu to disable the cache. "cache=none" does not seem to work. Qemu documentation says that qemu may still internally cache even if that argument is passed. Rebooting every time I edit the applications for my Os defeats one of the main advantage of a virtual machine.
[SOLVED]Qemu disk cache problem
[SOLVED]Qemu disk cache problem
Last edited by Muneer on Tue Nov 29, 2011 4:07 am, edited 1 time in total.
Even the smallest person could change the course of the future - Lord Of The Rings.
In the end all that matters is what you have done - Alexander.
Even after a decade oh god those still gives me the shivers.
In the end all that matters is what you have done - Alexander.
Even after a decade oh god those still gives me the shivers.
Re: Qemu disk cache problem
It is possible that your changes to /dev/sda is not commited by the Linux itself.
Try sync
Try sync
Re: Qemu disk cache problem
Sorry for not mentioning it. I do unmounting and then mounting again the partition after an edit in the host. I did check it with a bunch of other utilities just to ensure whether it is the Linux itself that is caching or the qemu. And I did try sync before posting the question. It seems qemu is the culprit.
Even the smallest person could change the course of the future - Lord Of The Rings.
In the end all that matters is what you have done - Alexander.
Even after a decade oh god those still gives me the shivers.
In the end all that matters is what you have done - Alexander.
Even after a decade oh god those still gives me the shivers.
Re: Qemu disk cache problem
Found it. You have to pass the below arguement to qemu to disable guest disk caching and actually make qemu
wait on the disk IO.
qemu -drive file=/dev/sda,index=0,cache=none
instead of -hda /dev/sda
wait on the disk IO.
qemu -drive file=/dev/sda,index=0,cache=none
instead of -hda /dev/sda
Even the smallest person could change the course of the future - Lord Of The Rings.
In the end all that matters is what you have done - Alexander.
Even after a decade oh god those still gives me the shivers.
In the end all that matters is what you have done - Alexander.
Even after a decade oh god those still gives me the shivers.