diff options
author | Anthony Liguori | 2011-08-04 23:45:17 +0200 |
---|---|---|
committer | Anthony Liguori | 2011-08-04 23:45:17 +0200 |
commit | 47bf05d7eb550905c635724ce72f855fb4e10b3d (patch) | |
tree | 31434e7500bea51fe188091ee6b5f4bbd5b8c212 /blockdev.c | |
parent | guest agent: add --enable-guest-agent config option (diff) | |
parent | block: Use bdrv_co_* instead of synchronous versions in coroutines (diff) | |
download | qemu-47bf05d7eb550905c635724ce72f855fb4e10b3d.tar.gz qemu-47bf05d7eb550905c635724ce72f855fb4e10b3d.tar.xz qemu-47bf05d7eb550905c635724ce72f855fb4e10b3d.zip |
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Diffstat (limited to 'blockdev.c')
-rw-r--r-- | blockdev.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/blockdev.c b/blockdev.c index 0b8d3a4f83..a25367a9e3 100644 --- a/blockdev.c +++ b/blockdev.c @@ -646,16 +646,13 @@ out: static int eject_device(Monitor *mon, BlockDriverState *bs, int force) { - if (!force) { - if (!bdrv_is_removable(bs)) { - qerror_report(QERR_DEVICE_NOT_REMOVABLE, - bdrv_get_device_name(bs)); - return -1; - } - if (bdrv_is_locked(bs)) { - qerror_report(QERR_DEVICE_LOCKED, bdrv_get_device_name(bs)); - return -1; - } + if (!bdrv_is_removable(bs)) { + qerror_report(QERR_DEVICE_NOT_REMOVABLE, bdrv_get_device_name(bs)); + return -1; + } + if (!force && bdrv_is_locked(bs)) { + qerror_report(QERR_DEVICE_LOCKED, bdrv_get_device_name(bs)); + return -1; } bdrv_close(bs); return 0; |