aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/blockdev.c b/blockdev.c
index a6758c1220..6067792e41 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -334,7 +334,8 @@ static bool parse_stats_intervals(BlockAcctStats *stats, QList *intervals,
case QTYPE_QSTRING: {
unsigned long long length;
- const char *str = qstring_get_str(qobject_to_qstring(entry->value));
+ const char *str = qstring_get_str(qobject_to(QString,
+ entry->value));
if (parse_uint_full(str, &length, 10) == 0 &&
length > 0 && length <= UINT_MAX) {
block_acct_add_interval(stats, (unsigned) length);
@@ -346,7 +347,7 @@ static bool parse_stats_intervals(BlockAcctStats *stats, QList *intervals,
}
case QTYPE_QNUM: {
- int64_t length = qnum_get_int(qobject_to_qnum(entry->value));
+ int64_t length = qnum_get_int(qobject_to(QNum, entry->value));
if (length > 0 && length <= UINT_MAX) {
block_acct_add_interval(stats, (unsigned) length);
@@ -4054,7 +4055,7 @@ void qmp_blockdev_add(BlockdevOptions *options, Error **errp)
}
visit_complete(v, &obj);
- qdict = qobject_to_qdict(obj);
+ qdict = qobject_to(QDict, obj);
qdict_flatten(qdict);