block: Use qemu_enum_parse() in blkdebug_debug_breakpoint()
commitf9509d151710caff22af97d904bad6aa7ff584bf
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 24 Aug 2017 08:46:02 +0000 (24 10:46 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 4 Sep 2017 11:09:13 +0000 (4 13:09 +0200)
treebedef8544541740496a0cb9e2bf89f3fcb507128
parent262517b7e062bde92beb9304fb813cac1e95643a
block: Use qemu_enum_parse() in blkdebug_debug_breakpoint()

The error message on invalid blkdebug events changes from

    qemu-system-x86_64: LOCATION: Invalid event name "VALUE"

to

    qemu-system-x86_64: LOCATION: invalid parameter value: VALUE

Slight degradation, but the message is sub-par even before the patch.
When complaining about a parameter value, both parameter name and
value should be mentioned, as the value may well not be unique.  Left
for another day.

Also left is the error message's unhelpful location: it points to the
config=FILENAME rather than into that file.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20170822132255.23945-11-marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Rebased, commit message rewritten]
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1503564371-26090-8-git-send-email-armbru@redhat.com>
block/blkdebug.c