Support for cache=unsafe in QemuServer.pm

bert64

Renowned Member
Aug 14, 2008
74
4
73
I have made a simple change to QemuServer.pm to allow the "cache=unsafe" option to be used on virtio disks...

Now while i realise the risks of using this option and would not advocate it as a default or even to be encouraged, it can provide improved performance in some cases. In particular, i configure all of my images with separate disk images for swap and use the cache=unsafe option there on the basis that the swap will be toast if the power goes out anyway.

Would it be possible to roll this into the main distribution, rather than having to patch it myself every time?
 
According to the sourcecode:


} else if (!strcmp(buf, "writeback")) { bdrv_flags |= BDRV_O_CACHE_WB; } else if (!strcmp(buf, "unsafe")) { bdrv_flags |= BDRV_O_CACHE_WB; bdrv_flags |= BDRV_O_NO_FLUSH;BDRV_O_NO_FLUSH looks like it doesnt explicitly flush the data to disk, but will flush as required...
 
we will include this option for 2.0.