diff options
author | Fam Zheng <famz@redhat.com> | 2013-08-22 15:36:59 +0800 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-08-22 14:30:03 +0200 |
commit | 7780d47211bde838c7f7e9330608e5397219066e (patch) | |
tree | 5f5266eb36a3e6aa13798a1bd8e8cdd7835e4392 | |
parent | 893a8f6220368a9ebff9a74bd48359928545cf6a (diff) | |
download | qemu-7780d47211bde838c7f7e9330608e5397219066e.tar.gz qemu-7780d47211bde838c7f7e9330608e5397219066e.tar.bz2 qemu-7780d47211bde838c7f7e9330608e5397219066e.zip |
block: better error message for read only format name
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 <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r-- | blockdev.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/blockdev.c b/blockdev.c index bc7016a8d4..d3500c6133 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; } } |