aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-12-11 18:11:42 +0100
committerMarkus Armbruster <armbru@redhat.com>2020-12-19 10:38:43 +0100
commit410f44f59685b05fc76e813fb2716bdb17c8da8d (patch)
tree25d6ef3db7ab9275a682add4cca5976be4319e94
parentd403d92dfc243f0fb7dec432f971961c522ba077 (diff)
block: Avoid qobject_get_try_str()
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 <kwolf@redhat.com> Cc: Max Reitz <mreitz@redhat.com> Cc: qemu-block@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20201211171152.146877-11-armbru@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
-rw-r--r--block.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block.c b/block.c
index 09d4c6bd25..934d1bcc8f 100644
--- a/block.c
+++ b/block.c
@@ -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;
@@ -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 */
}
}