aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/blockdev.c b/blockdev.c
index 952eb60e3d..7810e9fb68 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1523,14 +1523,16 @@ static void eject_device(BlockDriverState *bs, int force, Error **errp)
return;
}
if (!bdrv_dev_has_removable_media(bs)) {
- error_set(errp, QERR_DEVICE_NOT_REMOVABLE, bdrv_get_device_name(bs));
+ error_setg(errp, "Device '%s' is not removable",
+ bdrv_get_device_name(bs));
return;
}
if (bdrv_dev_is_medium_locked(bs) && !bdrv_dev_is_tray_open(bs)) {
bdrv_dev_eject_request(bs, force);
if (!force) {
- error_set(errp, QERR_DEVICE_LOCKED, bdrv_get_device_name(bs));
+ error_setg(errp, "Device '%s' is locked",
+ bdrv_get_device_name(bs));
return;
}
}
@@ -2222,7 +2224,8 @@ void qmp_block_job_cancel(const char *device,
return;
}
if (job->paused && !force) {
- error_set(errp, QERR_BLOCK_JOB_PAUSED, device);
+ error_setg(errp, "The block job for device '%s' is currently paused",
+ device);
return;
}