diff options
author | Kevin Wolf <kwolf@redhat.com> | 2018-07-04 13:28:29 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-07-05 10:29:19 +0200 |
commit | 824808dd77821ceba05357cb1ee4069a6a95bebd (patch) | |
tree | 9c5718d645066bd179c898133c6eac1e68122314 /tests/qemu-iotests/051 | |
parent | bfcc224e3cf04ee3fef0eb69984607b5764d9892 (diff) |
block: Don't silently truncate node names
If the user passes a too long node name string, we silently truncate it
to fit into BlockDriverState.node_name, i.e. to 31 characters. Apart
from surprising the user when the node has a different name than
requested, this also bypasses the check for duplicate names, so that the
same name can be assigned to multiple nodes.
Fix this by just making too long node names an error.
Reported-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/051')
-rwxr-xr-x | tests/qemu-iotests/051 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index f617e25e24..ee9c820d0f 100755 --- a/tests/qemu-iotests/051 +++ b/tests/qemu-iotests/051 @@ -100,6 +100,21 @@ run_qemu -drive file="$TEST_IMG",driver=raw,format=qcow2 run_qemu -drive file="$TEST_IMG",driver=qcow2,format=qcow2 echo +echo === Node names === +echo + +# Maximum length: 31 characters +run_qemu -drive file="$TEST_IMG",node-name=x123456789012345678901234567890 +run_qemu -drive file="$TEST_IMG",node-name=x1234567890123456789012345678901 + +# First character must be alphabetic +# Following characters alphanumeric or -._ +run_qemu -drive file="$TEST_IMG",node-name=All-Types.of_all0wed_chars +run_qemu -drive file="$TEST_IMG",node-name=123foo +run_qemu -drive file="$TEST_IMG",node-name=_foo +run_qemu -drive file="$TEST_IMG",node-name=foo#12 + +echo echo === Device without drive === echo |