aboutsummaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-06-25 18:39:00 +0200
committerKevin Wolf <kwolf@redhat.com>2018-06-29 14:20:56 +0200
commitb8efb36b9e99dbea7370139c0866b97a933f78d4 (patch)
treeed585786627527ccc7bb9ebb597ace766d66d3c8 /hw/usb
parent0ab1c41d1cdf50c90ff976d29ac943e727334668 (diff)
downloadqemu-b8efb36b9e99dbea7370139c0866b97a933f78d4.zip
qemu-b8efb36b9e99dbea7370139c0866b97a933f78d4.tar.gz
qemu-b8efb36b9e99dbea7370139c0866b97a933f78d4.tar.bz2
usb-storage: Add rerror/werror properties
The error handling policy was traditionally set with -drive, but with -blockdev it is no longer possible to set frontend options. scsi-disk (and other block devices) have long supported qdev properties to configure the error handling policy, so let's add these options to usb-storage as well and just forward them to the internal scsi-disk instance. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/dev-storage.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index c99398b..cd5551d 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -625,6 +625,7 @@ static void usb_msd_storage_realize(USBDevice *dev, Error **errp)
&usb_msd_scsi_info_storage, NULL);
scsi_dev = scsi_bus_legacy_add_drive(&s->bus, blk, 0, !!s->removable,
s->conf.bootindex, s->conf.share_rw,
+ s->conf.rerror, s->conf.werror,
dev->serial,
errp);
blk_unref(blk);
@@ -671,6 +672,7 @@ static const VMStateDescription vmstate_usb_msd = {
static Property msd_properties[] = {
DEFINE_BLOCK_PROPERTIES(MSDState, conf),
+ DEFINE_BLOCK_ERROR_PROPERTIES(MSDState, conf),
DEFINE_PROP_BIT("removable", MSDState, removable, 0, false),
DEFINE_PROP_END_OF_LIST(),
};