diff mbox

[4/4] block: Improve message for device name clashing with node name

Message ID 1410549984-16110-5-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster Sept. 12, 2014, 7:26 p.m. UTC
Suggested-by: Benoit Canet <benoit.canet@nodalink.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 block.c                    | 3 ++-
 tests/qemu-iotests/087.out | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Eric Blake Sept. 13, 2014, 3:47 p.m. UTC | #1
On 09/12/2014 01:26 PM, Markus Armbruster wrote:
> Suggested-by: Benoit Canet <benoit.canet@nodalink.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  block.c                    | 3 ++-
>  tests/qemu-iotests/087.out | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>
Benoît Canet Sept. 13, 2014, 6:52 p.m. UTC | #2
The Friday 12 Sep 2014 à 21:26:24 (+0200), Markus Armbruster wrote :
> Suggested-by: Benoit Canet <benoit.canet@nodalink.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  block.c                    | 3 ++-
>  tests/qemu-iotests/087.out | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/block.c b/block.c
> index 6faf36f..02ea90f 100644
> --- a/block.c
> +++ b/block.c
> @@ -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;
>      }
> diff --git a/tests/qemu-iotests/087.out b/tests/qemu-iotests/087.out
> index 7fbee3f..75a54e0 100644
> --- a/tests/qemu-iotests/087.out
> +++ b/tests/qemu-iotests/087.out
> @@ -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"}}
> -- 
> 1.9.3
> 

Reviewed-by: Benoît Canet <benoit.canet@nodalink.com>
diff mbox

Patch

diff --git a/block.c b/block.c
index 6faf36f..02ea90f 100644
--- a/block.c
+++ b/block.c
@@ -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;
     }
diff --git a/tests/qemu-iotests/087.out b/tests/qemu-iotests/087.out
index 7fbee3f..75a54e0 100644
--- a/tests/qemu-iotests/087.out
+++ b/tests/qemu-iotests/087.out
@@ -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"}}