[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/42] block: better error message for read only form
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 04/42] block: better error message for read only format name |
Date: |
Thu, 22 Aug 2013 22:11:00 +0200 |
From: Fam Zheng <address@hidden>
When user tries to use read-only whitelist format in the command line
option, failure message was "'foo' invalid format". It might be invalid
only for writable, but valid for read-only, so it is confusing. Give the
user easier to understand information.
Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
blockdev.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/blockdev.c b/blockdev.c
index bc7016a..d3500c6 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -487,7 +487,11 @@ static DriveInfo *blockdev_init(QemuOpts *all_opts,
drv = bdrv_find_whitelisted_format(buf, ro);
if (!drv) {
- error_report("'%s' invalid format", buf);
+ if (!ro && bdrv_find_whitelisted_format(buf, !ro)) {
+ error_report("'%s' can be only used as read-only device.",
buf);
+ } else {
+ error_report("'%s' invalid format", buf);
+ }
return NULL;
}
}
--
1.8.3.1
- [Qemu-devel] [PULL 00/42] Block patches, Stefan Hajnoczi, 2013/08/22
- [Qemu-devel] [PULL 01/42] qcow2: Change default for new images to compat=1.1, Stefan Hajnoczi, 2013/08/22
- [Qemu-devel] [PULL 02/42] block: Introduce bs->zero_beyond_eof, Stefan Hajnoczi, 2013/08/22
- [Qemu-devel] [PULL 03/42] block: Produce zeros when protocols reading beyond end of file, Stefan Hajnoczi, 2013/08/22
- [Qemu-devel] [PULL 04/42] block: better error message for read only format name,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 06/42] vmdk: fix L1 and L2 table size in vmdk3 open, Stefan Hajnoczi, 2013/08/22
- [Qemu-devel] [PULL 05/42] vmdk: Move l1_size check into vmdk_add_extent(), Stefan Hajnoczi, 2013/08/22
- [Qemu-devel] [PULL 08/42] vmdk: support vmfs files, Stefan Hajnoczi, 2013/08/22
- [Qemu-devel] [PULL 07/42] vmdk: support vmfsSparse files, Stefan Hajnoczi, 2013/08/22
- [Qemu-devel] [PULL 10/42] aio / timers: Rename qemu_new_clock and expose clock types, Stefan Hajnoczi, 2013/08/22
- [Qemu-devel] [PULL 09/42] aio / timers: Rename qemu_timer_* functions, Stefan Hajnoczi, 2013/08/22
- [Qemu-devel] [PULL 11/42] aio / timers: add qemu-timer.c utility functions, Stefan Hajnoczi, 2013/08/22
- [Qemu-devel] [PULL 13/42] aio / timers: add ppoll support with qemu_poll_ns, Stefan Hajnoczi, 2013/08/22
- [Qemu-devel] [PULL 12/42] aio / timers: Consistent treatment of disabled clocks for deadlines, Stefan Hajnoczi, 2013/08/22
- [Qemu-devel] [PULL 14/42] aio / timers: Add prctl(PR_SET_TIMERSLACK, 1, ...) to reduce timer slack, Stefan Hajnoczi, 2013/08/22