diff options
author | Mao Zhongyi <maozy.fnst@cn.fujitsu.com> | 2017-11-22 11:08:45 +0800 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-12-19 10:25:03 +0000 |
commit | ceff3e1f01ee8c0d77de7e3750e7297c3af7e2ec (patch) | |
tree | bf47061c5908b37237498dfb95df27d9ae6407fa /hw/usb/dev-storage.c | |
parent | 9d3b155186c2788570f4802700d030c84e0f0746 (diff) | |
download | qemu-ceff3e1f01ee8c0d77de7e3750e7297c3af7e2ec.zip qemu-ceff3e1f01ee8c0d77de7e3750e7297c3af7e2ec.tar.gz qemu-ceff3e1f01ee8c0d77de7e3750e7297c3af7e2ec.tar.bz2 |
hw/block: Use errp directly rather than local_err
[Drop virtio_blk_data_plane_create() change that misinterprets return
value when the virtio transport does not support dataplane.
--Stefan]
Cc: John Snow <jsnow@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: e77848d3735ba590f23ffbf8094379c646c33d79.1511317952.git.maozy.fnst@cn.fujitsu.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/usb/dev-storage.c')
-rw-r--r-- | hw/usb/dev-storage.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 8a61ec9..a9bcc67 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -601,7 +601,6 @@ static void usb_msd_realize_storage(USBDevice *dev, Error **errp) MSDState *s = USB_STORAGE_DEV(dev); BlockBackend *blk = s->conf.blk; SCSIDevice *scsi_dev; - Error *err = NULL; if (!blk) { error_setg(errp, "drive property not set"); @@ -610,9 +609,8 @@ static void usb_msd_realize_storage(USBDevice *dev, Error **errp) blkconf_serial(&s->conf, &dev->serial); blkconf_blocksizes(&s->conf); - blkconf_apply_backend_options(&s->conf, blk_is_read_only(blk), true, &err); - if (err) { - error_propagate(errp, err); + if (!blkconf_apply_backend_options(&s->conf, blk_is_read_only(blk), true, + errp)) { return; } @@ -636,10 +634,9 @@ static void usb_msd_realize_storage(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, dev->serial, - &err); + errp); blk_unref(blk); if (!scsi_dev) { - error_propagate(errp, err); return; } usb_msd_handle_reset(dev); |