summaryrefslogtreecommitdiffstats
path: root/hw/usb/dev-storage.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/usb/dev-storage.c')
-rw-r--r--hw/usb/dev-storage.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index f5977eb72e..2ed6a8df24 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -736,9 +736,8 @@ static void usb_msd_set_bootindex(Object *obj, Visitor *v, const char *name,
int32_t boot_index;
Error *local_err = NULL;
- visit_type_int32(v, name, &boot_index, &local_err);
- if (local_err) {
- goto out;
+ if (!visit_type_int32(v, name, &boot_index, errp)) {
+ return;
}
/* check whether bootindex is present in fw_boot_order list */
check_boot_index(boot_index, &local_err);
@@ -749,7 +748,7 @@ static void usb_msd_set_bootindex(Object *obj, Visitor *v, const char *name,
s->conf.bootindex = boot_index;
if (s->scsi_dev) {
- object_property_set_int(OBJECT(s->scsi_dev), boot_index, "bootindex",
+ object_property_set_int(OBJECT(s->scsi_dev), "bootindex", boot_index,
&error_abort);
}
@@ -770,7 +769,7 @@ static void usb_msd_instance_init(Object *obj)
object_property_add(obj, "bootindex", "int32",
usb_msd_get_bootindex,
usb_msd_set_bootindex, NULL, NULL);
- object_property_set_int(obj, -1, "bootindex", NULL);
+ object_property_set_int(obj, "bootindex", -1, NULL);
}
static void usb_msd_class_bot_initfn(ObjectClass *klass, void *data)