block: Improve message for device name clashing with node name

Suggested-by: Benoit Canet <benoit.canet@nodalink.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Benoît Canet <benoit.canet@nodalink.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Markus Armbruster 2014-09-12 21:26:24 +02:00 committed by Kevin Wolf
parent e5d7bbeb10
commit d224469d87
2 changed files with 3 additions and 2 deletions

View File

@ -347,7 +347,8 @@ BlockDriverState *bdrv_new(const char *device_name, Error **errp)
return NULL;
}
if (bdrv_find_node(device_name)) {
error_setg(errp, "Device with node-name '%s' already exists",
error_setg(errp,
"Device name '%s' conflicts with an existing node name",
device_name);
return NULL;
}

View File

@ -20,7 +20,7 @@ QMP_VERSION
{"return": {}}
{"return": {}}
{"error": {"class": "GenericError", "desc": "Device with id 'disk' already exists"}}
{"error": {"class": "GenericError", "desc": "Device with node-name 'test-node' already exists"}}
{"error": {"class": "GenericError", "desc": "Device name 'test-node' conflicts with an existing node name"}}
main-loop: WARNING: I/O thread spun for 1000 iterations
{"error": {"class": "GenericError", "desc": "could not open disk image disk2: node-name=disk is conflicting with a device id"}}
{"error": {"class": "GenericError", "desc": "could not open disk image disk2: Duplicate node name"}}