From f6166a06ffdb1cd5dd80adf2d82c35c3bda88239 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 23 Jun 2016 15:12:35 +0200 Subject: block/qdev: Allow configuring WCE with qdev properties As cache.writeback is a BlockBackend property and as such more related to the guest device than the BlockDriverState, we already removed it from the blockdev-add interface. This patch adds the new way to set it, as a qdev property of the corresponding guest device. For example: -drive if=none,file=test.img,node-name=img -device ide-hd,drive=img,write-cache=off Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- hw/block/virtio-blk.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/block/virtio-blk.c') diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index ae86e94..ecd8ea3 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -897,6 +897,7 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp) } blkconf_serial(&conf->conf, &conf->serial); + blkconf_apply_backend_options(&conf->conf); s->original_wce = blk_enable_write_cache(conf->conf.blk); blkconf_geometry(&conf->conf, NULL, 65535, 255, 255, &err); if (err) { -- cgit v1.1