rbd.c (12c06d6f967a63515399b9e1f6a40f5ce871a8b7) | rbd.c (7dc847ebba953db90853d15f140c20eef74d4fb2) |
---|---|
1/* 2 * QEMU Block driver for RADOS (Ceph) 3 * 4 * Copyright (C) 2010-2011 Christian Brunner <chb@muc.de>, 5 * Josh Durgin <josh.durgin@dreamhost.com> 6 * 7 * This work is licensed under the terms of the GNU GPL, version 2. See 8 * the COPYING file in the top-level directory. --- 249 unchanged lines hidden (view full) --- 258 QString *value; 259 const char *key; 260 size_t remaining; 261 int ret = 0; 262 263 if (!keypairs_json) { 264 return ret; 265 } | 1/* 2 * QEMU Block driver for RADOS (Ceph) 3 * 4 * Copyright (C) 2010-2011 Christian Brunner <chb@muc.de>, 5 * Josh Durgin <josh.durgin@dreamhost.com> 6 * 7 * This work is licensed under the terms of the GNU GPL, version 2. See 8 * the COPYING file in the top-level directory. --- 249 unchanged lines hidden (view full) --- 258 QString *value; 259 const char *key; 260 size_t remaining; 261 int ret = 0; 262 263 if (!keypairs_json) { 264 return ret; 265 } |
266 keypairs = qobject_to_qlist(qobject_from_json(keypairs_json, 267 &error_abort)); | 266 keypairs = qobject_to(QList, 267 qobject_from_json(keypairs_json, &error_abort)); |
268 remaining = qlist_size(keypairs) / 2; 269 assert(remaining); 270 271 while (remaining--) { | 268 remaining = qlist_size(keypairs) / 2; 269 assert(remaining); 270 271 while (remaining--) { |
272 name = qobject_to_qstring(qlist_pop(keypairs)); 273 value = qobject_to_qstring(qlist_pop(keypairs)); | 272 name = qobject_to(QString, qlist_pop(keypairs)); 273 value = qobject_to(QString, qlist_pop(keypairs)); |
274 assert(name && value); 275 key = qstring_get_str(name); 276 277 ret = rados_conf_set(cluster, key, qstring_get_str(value)); 278 QDECREF(value); 279 if (ret < 0) { 280 error_setg_errno(errp, -ret, "invalid conf option %s", key); 281 QDECREF(name); --- 912 unchanged lines hidden --- | 274 assert(name && value); 275 key = qstring_get_str(name); 276 277 ret = rados_conf_set(cluster, key, qstring_get_str(value)); 278 QDECREF(value); 279 if (ret < 0) { 280 error_setg_errno(errp, -ret, "invalid conf option %s", key); 281 QDECREF(name); --- 912 unchanged lines hidden --- |