mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
0ab1c41d1c
commit
b8efb36b9e
3 changed files with 14 additions and 1 deletions
|
@ -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(),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue