[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 4/8] block: Drop BB name from bad option error
From: |
Max Reitz |
Subject: |
[Qemu-block] [PATCH 4/8] block: Drop BB name from bad option error |
Date: |
Tue, 10 Nov 2015 04:44:19 +0100 |
The information which BB is concerned does not seem useful enough to
justify its existence in most other place (which may be related to qemu
printing the -drive parameter in question anyway, and for blockdev-add
the attribution is naturally unambiguous). Furthermore, as of a future
patch, bdrv_get_device_name(bs) will always return the empty string
before bdrv_open_inherit() returns.
Therefore, just dropping that information seems to be the best course of
action.
Signed-off-by: Max Reitz <address@hidden>
---
block.c | 6 +++---
tests/qemu-iotests/051.out | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/block.c b/block.c
index c5ea5e7..395b7b0 100644
--- a/block.c
+++ b/block.c
@@ -1539,9 +1539,9 @@ static int bdrv_open_inherit(BlockDriverState **pbs,
const char *filename,
error_setg(errp, "Block protocol '%s' doesn't support the option "
"'%s'", drv->format_name, entry->key);
} else {
- error_setg(errp, "Block format '%s' used by device '%s' doesn't "
- "support the option '%s'", drv->format_name,
- bdrv_get_device_name(bs), entry->key);
+ error_setg(errp,
+ "Block format '%s' doesn't support the option '%s'",
+ drv->format_name, entry->key);
}
ret = -EINVAL;
diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out
index 7765aa0..c6df65f 100644
--- a/tests/qemu-iotests/051.out
+++ b/tests/qemu-iotests/051.out
@@ -5,16 +5,16 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
backing_file=TEST_DIR/
=== Unknown option ===
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=: Block
format 'qcow2' used by device 'ide0-hd0' doesn't support the option
'unknown_opt'
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=: Block
format 'qcow2' doesn't support the option 'unknown_opt'
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on: Block
format 'qcow2' used by device 'ide0-hd0' doesn't support the option
'unknown_opt'
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=on: Block
format 'qcow2' doesn't support the option 'unknown_opt'
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234: Block
format 'qcow2' used by device 'ide0-hd0' doesn't support the option
'unknown_opt'
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=1234: Block
format 'qcow2' doesn't support the option 'unknown_opt'
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo
-QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo: Block
format 'qcow2' used by device 'ide0-hd0' doesn't support the option
'unknown_opt'
+QEMU_PROG: -drive file=TEST_DIR/t.qcow2,format=qcow2,unknown_opt=foo: Block
format 'qcow2' doesn't support the option 'unknown_opt'
=== Unknown protocol option ===
--
2.6.2
- [Qemu-block] [PATCH 0/8] blockdev: (Nearly) free clean-up work, Max Reitz, 2015/11/09
- [Qemu-block] [PATCH 1/8] qapi: Drop QERR_UNKNOWN_BLOCK_FORMAT_FEATURE, Max Reitz, 2015/11/09
- [Qemu-block] [PATCH 2/8] block: Drop useless bdrv_new() calls, Max Reitz, 2015/11/09
- [Qemu-block] [PATCH 3/8] block: Let bdrv_open_inherit() return the snapshot, Max Reitz, 2015/11/09
- [Qemu-block] [PATCH 4/8] block: Drop BB name from bad option error,
Max Reitz <=
- [Qemu-block] [PATCH 5/8] block: Drop blk_new_with_bs(), Max Reitz, 2015/11/09
- [Qemu-block] [PATCH 6/8] block: Drop bdrv_new_root(), Max Reitz, 2015/11/09
- [Qemu-block] [PATCH 8/8] block: Assert !bs->refcnt in bdrv_close(), Max Reitz, 2015/11/09
- [Qemu-block] [PATCH 7/8] block: Make bdrv_open() return a BDS, Max Reitz, 2015/11/09