Skip to content

Commit

Permalink
block: Avoid qobject_get_try_str()
Browse files Browse the repository at this point in the history
I'm about to remove qobject_get_try_str().  Use qstring_get_str()
instead.  Safe because the argument is known to be a QString here.

Cc: Kevin Wolf <[email protected]>
Cc: Max Reitz <[email protected]>
Cc: [email protected]
Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
  • Loading branch information
Markus Armbruster committed Dec 19, 2020
1 parent d403d92 commit 410f44f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions block.c
Original file line number Diff line number Diff line change
Expand Up @@ -4021,7 +4021,7 @@ static int bdrv_reopen_parse_backing(BDRVReopenState *reopen_state,
new_backing_bs = NULL;
break;
case QTYPE_QSTRING:
str = qobject_get_try_str(value);
str = qstring_get_str(qobject_to(QString, value));
new_backing_bs = bdrv_lookup_bs(NULL, str, errp);
if (new_backing_bs == NULL) {
return -EINVAL;
Expand Down Expand Up @@ -4284,8 +4284,8 @@ int bdrv_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue,
}

if (child) {
const char *str = qobject_get_try_str(new);
if (!strcmp(child->bs->node_name, str)) {
if (!strcmp(child->bs->node_name,
qstring_get_str(qobject_to(QString, new)))) {
continue; /* Found child with this name, skip option */
}
}
Expand Down

0 comments on commit 410f44f

Please sign in to comment.