[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 23/33] block: Avoid qobject_get_try_str()
From: |
Markus Armbruster |
Subject: |
[PULL 23/33] block: Avoid qobject_get_try_str() |
Date: |
Sat, 19 Dec 2020 11:55:22 +0100 |
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>
---
block.c | 6 +++---
1 file 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 */
}
}
--
2.26.2
- [PULL 12/33] test-visitor-serialization: Drop insufficient precision workaround, (continued)
- [PULL 12/33] test-visitor-serialization: Drop insufficient precision workaround, Markus Armbruster, 2020/12/19
- [PULL 07/33] tests/check-qjson: Replace redundant large_number(), Markus Armbruster, 2020/12/19
- [PULL 02/33] migration: Refactor migrate_cap_add, Markus Armbruster, 2020/12/19
- [PULL 26/33] qobject: Drop qstring_get_try_str(), Markus Armbruster, 2020/12/19
- [PULL 13/33] test-visitor-serialization: Clean up test_primitives(), Markus Armbruster, 2020/12/19
- [PULL 19/33] Revert "qstring: add qstring_free()", Markus Armbruster, 2020/12/19
- [PULL 16/33] qobject: Make qobject_to_json_pretty() take a pretty argument, Markus Armbruster, 2020/12/19
- [PULL 15/33] monitor: Use GString instead of QString for output buffer, Markus Armbruster, 2020/12/19
- [PULL 22/33] qmp: Fix tracing of non-string command IDs, Markus Armbruster, 2020/12/19
- [PULL 20/33] hw/rdma: Replace QList by GQueue, Markus Armbruster, 2020/12/19
- [PULL 23/33] block: Avoid qobject_get_try_str(),
Markus Armbruster <=
- [PULL 28/33] qobject: Factor JSON writer out of qobject_to_json(), Markus Armbruster, 2020/12/19
- [PULL 25/33] qobject: Drop qobject_get_try_str(), Markus Armbruster, 2020/12/19
- [PULL 30/33] json: Use GString instead of QString to accumulate strings, Markus Armbruster, 2020/12/19
- [PULL 31/33] keyval: Use GString to accumulate value strings, Markus Armbruster, 2020/12/19
- [PULL 18/33] qobject: Change qobject_to_json()'s value to GString, Markus Armbruster, 2020/12/19
- [PULL 33/33] qobject: Make QString immutable, Markus Armbruster, 2020/12/19
- [PULL 27/33] qobject: Factor quoted_str() out of to_json(), Markus Armbruster, 2020/12/19
- [PULL 29/33] migration: Replace migration's JSON writer by the general one, Markus Armbruster, 2020/12/19
- [PULL 32/33] block: Use GString instead of QString to build filenames, Markus Armbruster, 2020/12/19
- [PULL 21/33] qobject: Move internals to qobject-internal.h, Markus Armbruster, 2020/12/19