aboutsummaryrefslogtreecommitdiff
path: root/hw/core
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-06-29 17:41:35 +0200
committerKevin Wolf <kwolf@redhat.com>2016-07-13 13:32:27 +0200
commit8c39825218227c0d63709708602d34c4355bad56 (patch)
tree34dd245add610f9df29d03a4482b0b8cd42d079e /hw/core
parent1e8fb7f1ee1ba902ab06cb8d54eca006c3b45f42 (diff)
downloadqemu-8c39825218227c0d63709708602d34c4355bad56.zip
qemu-8c39825218227c0d63709708602d34c4355bad56.tar.gz
qemu-8c39825218227c0d63709708602d34c4355bad56.tar.bz2
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 <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/qdev-properties.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 3c20c8e..14e544a 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));