diff options
Diffstat (limited to 'block/raw-posix.c')
-rw-r--r-- | block/raw-posix.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c index aacf13203f..bef7a671a6 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -582,15 +582,9 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { BDRVRawState *s = bs->opaque; - Error *local_err = NULL; - int ret; s->type = FTYPE_FILE; - ret = raw_open_common(bs, options, flags, 0, &local_err); - if (local_err) { - error_propagate(errp, local_err); - } - return ret; + return raw_open_common(bs, options, flags, 0, errp); } static int raw_reopen_prepare(BDRVReopenState *state, @@ -2236,9 +2230,7 @@ hdev_open_Mac_error: ret = raw_open_common(bs, options, flags, 0, &local_err); if (ret < 0) { - if (local_err) { - error_propagate(errp, local_err); - } + error_propagate(errp, local_err); #if defined(__APPLE__) && defined(__MACH__) if (*bsd_path) { filename = bsd_path; @@ -2443,17 +2435,11 @@ static int cdrom_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { BDRVRawState *s = bs->opaque; - Error *local_err = NULL; - int ret; s->type = FTYPE_CD; /* open will not fail even if no CD is inserted, so add O_NONBLOCK */ - ret = raw_open_common(bs, options, flags, O_NONBLOCK, &local_err); - if (local_err) { - error_propagate(errp, local_err); - } - return ret; + return raw_open_common(bs, options, flags, O_NONBLOCK, errp); } static int cdrom_probe_device(const char *filename) @@ -2571,9 +2557,7 @@ static int cdrom_open(BlockDriverState *bs, QDict *options, int flags, ret = raw_open_common(bs, options, flags, 0, &local_err); if (ret) { - if (local_err) { - error_propagate(errp, local_err); - } + error_propagate(errp, local_err); return ret; } |