Currently host page cache setting for a block device cannot be changed without restarting a running VM. Following patchset [V2] is for enabling dynamic change of host cache setting for devices through qemu monitor.
Changes from patchset V1: 1. Support of dynamic cache change only for hostcache. 2. Monitor command "hostcache_get" added to display current cache setting 3. Backed off the changes for display of cache setting in "info block" Two new monitor commands added. 1. hostcache_get -- Displays hostcache setting of a block device. Usage: "hostcache_get <device> <device> = block device 2. hostcache_set -- Sets hostcache for the device to specified value. Usage: "hostcache_set <device> <cache>" <device> = block device <cache> = "on"/"off" 1/2 New error classes for file reopen and device insertion 2/2 Add commands "hostcache_set" and "hostcache_get" block.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ block.h | 2 ++ blockdev.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ blockdev.h | 2 ++ hmp-commands.hx | 29 +++++++++++++++++++++++++++++ qerror.c | 8 ++++++++ qerror.h | 6 ++++++ qmp-commands.hx | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 198 insertions(+) ~ ~ ~