From 8c39825218227c0d63709708602d34c4355bad56 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 29 Jun 2016 17:41:35 +0200 Subject: block/qdev: Allow configuring rerror/werror with qdev properties The rerror/werror policies are implemented in the devices, so that's where they should be configured. In comparison to the old options in -drive, the qdev properties are only added to those devices that actually support them. If the option isn't given (or "auto" is specified), the setting of the BlockBackend is used for compatibility with the old options. For block jobs, "auto" is the same as "enospc". Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- hw/core/qdev-properties.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'hw/core') diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 3c20c8e4b2..14e544ab17 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -539,6 +539,19 @@ PropertyInfo qdev_prop_losttickpolicy = { .set = set_enum, }; +/* --- Block device error handling policy --- */ + +QEMU_BUILD_BUG_ON(sizeof(BlockdevOnError) != sizeof(int)); + +PropertyInfo qdev_prop_blockdev_on_error = { + .name = "BlockdevOnError", + .description = "Error handling policy, " + "report/ignore/enospc/stop/auto", + .enum_table = BlockdevOnError_lookup, + .get = get_enum, + .set = set_enum, +}; + /* --- BIOS CHS translation */ QEMU_BUILD_BUG_ON(sizeof(BiosAtaTranslation) != sizeof(int)); -- cgit v1.2.3-55-g7522