Skip to contentSkip to conversation

Error reporting patches patches for 2020-07-07

GIT PULL Applied Markus Armbruster 2 participants 7 messages Jul 10, 2020 – Jul 13, 2020

Subsystems (14)
lore
Share & tools
lore
#1 lore raw

[PULL v2 43/53] qemu-img: Ignore Error objects where the return value suffices

In reply to Markus Armbruster

Message-Id: <[email protected]> [One more in img_amend() due to commit 0bc2a50e17 "qemu-option: Use returned bool to check for failure"]

---
 qemu-img.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)
qemu-img.c +3 -12
index 41d2b91091..498fbf42fe 100644
@@ -465,22 +465,18 @@ static int add_old_style_options(const char *fmt, QemuOpts *opts,
                                  const char *base_filename,
                                  const char *base_fmt)
 {
-    Error *err = NULL;
-
     if (base_filename) {
         if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename,
-                          &err)) {
+                          NULL)) {
             error_report("Backing file not supported for file format '%s'",
                          fmt);
-            error_free(err);
             return -1;
         }
     }
     if (base_fmt) {
-        if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, &err)) {
+        if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, NULL)) {
             error_report("Backing file format not supported for file "
                          "format '%s'", fmt);
-            error_free(err);
             return -1;
         }
     }
@@ -4214,17 +4210,12 @@ static int img_amend(int argc, char **argv)
     opts = qemu_opts_create(amend_opts, NULL, 0, &error_abort);
     if (!qemu_opts_do_parse(opts, options, NULL, &err)) {
         /* Try to parse options using the create options */
-        Error *err1 = NULL;
         amend_opts = qemu_opts_append(amend_opts, bs->drv->create_opts);
         qemu_opts_del(opts);
         opts = qemu_opts_create(amend_opts, NULL, 0, &error_abort);
-        qemu_opts_do_parse(opts, options, NULL, &err1);
-
-        if (!err1) {
+        if (qemu_opts_do_parse(opts, options, NULL, NULL)) {
             error_append_hint(&err,
                               "This option is only supported for image creation\n");
-        } else {
-            error_free(err1);
         }
 
         error_report_err(err);
Signature · 1 line
2.26.2
#2 lore raw

[PULL v2 50/53] fw_cfg: Use ERRP_GUARD()

In reply to Markus Armbruster

From: Vladimir Sementsov-Ogievskiy <[email protected]>

If we want to check error after errp-function call, we need to introduce local_err and then propagate it to errp. Instead, use the ERRP_GUARD() macro, benefits are:
1. No need of explicit error_propagate call
2. No need of explicit local_err variable: use errp directly
3. ERRP_GUARD() leaves errp as is if it's not NULL or &error_fatal, this means that we don't break error_abort (we'll abort on error_set, not on error_propagate)

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_GUARD() macro. Otherwise, this info will not be added when errp == &error_fatal (the program will exit prior to the error_append_hint() or error_prepend() call). No such cases are being fixed here.

This commit is generated by command

    sed -n '/^Firmware configuration (fw_cfg)$/,/^$/{s/^F: //p}' \
        MAINTAINERS | \
    xargs git ls-files | grep '\.[hc]$' | \
    xargs spatch \
        --sp-file scripts/coccinelle/errp-guard.cocci \
        --macro-file scripts/cocci-macro-file.h \
        --in-place --no-show-diff --max-width 80

Message-Id: <[email protected]> [ERRP_AUTO_PROPAGATE() renamed to ERRP_GUARD(), and auto-propagated-errp.cocci to errp-guard.cocci. Commit message tweaked again. Coccinelle script rerun for commit 3203148917 "hw/nvram/fw_cfg: Add the FW_CFG_DATA_GENERATOR interface"]

---
 hw/nvram/fw_cfg.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)
hw/nvram/fw_cfg.c +9 -12
index 694722b212..3b1811d3bf 100644
@@ -1035,8 +1035,8 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,
 void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
                                const char *gen_id, Error **errp)
 {
+    ERRP_GUARD();
     FWCfgDataGeneratorClass *klass;
-    Error *local_err = NULL;
     GByteArray *array;
     Object *obj;
     gsize size;
@@ -1052,9 +1052,8 @@ void fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
         return;
     }
     klass = FW_CFG_DATA_GENERATOR_GET_CLASS(obj);
-    array = klass->get_data(obj, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    array = klass->get_data(obj, errp);
+    if (*errp) {
         return;
     }
     size = array->len;
@@ -1260,12 +1259,11 @@ static Property fw_cfg_io_properties[] = {
 
 static void fw_cfg_io_realize(DeviceState *dev, Error **errp)
 {
+    ERRP_GUARD();
     FWCfgIoState *s = FW_CFG_IO(dev);
-    Error *local_err = NULL;
 
-    fw_cfg_file_slots_allocate(FW_CFG(s), &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    fw_cfg_file_slots_allocate(FW_CFG(s), errp);
+    if (*errp) {
         return;
     }
 
@@ -1311,14 +1309,13 @@ static Property fw_cfg_mem_properties[] = {
 
 static void fw_cfg_mem_realize(DeviceState *dev, Error **errp)
 {
+    ERRP_GUARD();
     FWCfgMemState *s = FW_CFG_MEM(dev);
     SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
     const MemoryRegionOps *data_ops = &fw_cfg_data_mem_ops;
-    Error *local_err = NULL;
 
-    fw_cfg_file_slots_allocate(FW_CFG(s), &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    fw_cfg_file_slots_allocate(FW_CFG(s), errp);
+    if (*errp) {
         return;
     }
 
Signature · 1 line
2.26.2
#3 lore raw

[PULL v2 14/53] qemu-option: Use returned bool to check for failure

In reply to Markus Armbruster

The previous commit enables conversion of

    foo(..., &err);
    if (err) {
        ...
    }

to

    if (!foo(..., &err)) {
        ...
    }

for QemuOpts functions that now return true / false on success / error. Coccinelle script:

    @@
    identifier fun = {
        opts_do_parse, parse_option_bool, parse_option_number,
        parse_option_size, qemu_opt_parse, qemu_opt_rename, qemu_opt_set,
        qemu_opt_set_bool, qemu_opt_set_number, qemu_opts_absorb_qdict,
        qemu_opts_do_parse, qemu_opts_from_qdict_entry, qemu_opts_set,
        qemu_opts_validate
    };
    expression list args, args2;
    typedef Error;
    Error *err;
    @@
    -    fun(args, &err, args2);
    -    if (err)
    +    if (!fun(args, &err, args2))
         {
             ...
         }

A few line breaks tidied up manually.

Message-Id: <[email protected]> [Conflict with commit 0b6786a9c1 "block/amend: refactor qcow2 amend options" resolved by rerunning Coccinelle on master's version]

---
 block.c                       | 16 ++++++----------
 block/blkdebug.c              |  3 +--
 block/blklogwrites.c          |  3 +--
 block/blkverify.c             |  3 +--
 block/crypto.c                |  3 +--
 block/curl.c                  |  3 +--
 block/file-posix.c            |  6 ++----
 block/file-win32.c            |  6 ++----
 block/gluster.c               | 15 +++++----------
 block/iscsi.c                 |  3 +--
 block/nbd.c                   |  3 +--
 block/parallels.c             |  3 +--
 block/qcow2.c                 |  3 +--
 block/quorum.c                |  3 +--
 block/raw-format.c            |  3 +--
 block/replication.c           |  3 +--
 block/sheepdog.c              |  3 +--
 block/ssh.c                   |  3 +--
 block/throttle.c              |  3 +--
 block/vpc.c                   |  3 +--
 block/vvfat.c                 |  3 +--
 block/vxhs.c                  |  6 ++----
 blockdev.c                    | 11 ++++-------
 chardev/char.c                |  6 ++----
 contrib/ivshmem-server/main.c |  4 ++--
 hw/net/virtio-net.c           |  5 ++---
 hw/smbios/smbios.c            | 24 ++++++++----------------
 qapi/string-input-visitor.c   |  3 +--
 qemu-img.c                    | 20 +++++++-------------
 tpm.c                         |  3 +--
 util/qemu-config.c            | 12 ++++--------
 util/qemu-option.c            | 16 ++++++----------
 32 files changed, 71 insertions(+), 133 deletions(-)
block.c +6 -10
index 62e40db2f1..850755e04e 100644
@@ -1629,8 +1629,7 @@ static int bdrv_open_common(BlockDriverState *bs, BlockBackend *file,
     assert(options != NULL && bs->options != options);
 
     opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto fail_opts;
@@ -4091,8 +4090,7 @@ int bdrv_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue,
 
     /* Process generic block layer options */
     opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, reopen_state->options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, reopen_state->options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto error;
@@ -6063,8 +6061,7 @@ void bdrv_img_create(const char *filename, const char *fmt,
 
     /* Parse -o options */
     if (options) {
-        qemu_opts_do_parse(opts, options, NULL, &local_err);
-        if (local_err) {
+        if (!qemu_opts_do_parse(opts, options, NULL, &local_err)) {
             goto out;
         }
     }
@@ -6077,8 +6074,8 @@ void bdrv_img_create(const char *filename, const char *fmt,
     }
 
     if (base_filename) {
-        qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename, &local_err);
-        if (local_err) {
+        if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename,
+                          &local_err)) {
             error_setg(errp, "Backing file not supported for file format '%s'",
                        fmt);
             goto out;
@@ -6086,8 +6083,7 @@ void bdrv_img_create(const char *filename, const char *fmt,
     }
 
     if (base_fmt) {
-        qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, &local_err);
-        if (local_err) {
+        if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, &local_err)) {
             error_setg(errp, "Backing file format not supported for file "
                              "format '%s'", fmt);
             goto out;
block/blkdebug.c +1 -2
index 7194bc7f06..d473dcf8c7 100644
@@ -472,8 +472,7 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags,
     uint64_t align;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto out;
block/blklogwrites.c +1 -2
index 6753bd9a3e..0c93e926b1 100644
@@ -149,8 +149,7 @@ static int blk_log_writes_open(BlockDriverState *bs, QDict *options, int flags,
     bool log_append;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         ret = -EINVAL;
         error_propagate(errp, local_err);
         goto fail;
block/blkverify.c +1 -2
index 2f261de24b..666d626c57 100644
@@ -116,8 +116,7 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags,
     int ret;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto fail;
block/crypto.c +1 -2
index 2636e959ae..35aa5947d4 100644
@@ -276,8 +276,7 @@ static int block_crypto_open_generic(QCryptoBlockFormat format,
         bs->file->bs->supported_write_flags;
 
     opts = qemu_opts_create(opts_spec, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         goto cleanup;
     }
block/curl.c +1 -2
index 6e325901dc..d9552efe52 100644
@@ -695,8 +695,7 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,
 
     qemu_mutex_init(&s->mutex);
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         goto out_noclean;
     }
block/file-posix.c +2 -4
index d86ea57769..36acf7b911 100644
@@ -490,8 +490,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
     OnOffAuto locking;
 
     opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto fail;
@@ -1000,8 +999,7 @@ static int raw_reopen_prepare(BDRVReopenState *state,
 
     /* Handle options changes */
     opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, state->options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, state->options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto out;
block/file-win32.c +2 -4
index 221aaf713e..5f8015319a 100644
@@ -338,8 +338,7 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,
     s->type = FTYPE_FILE;
 
     opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto fail;
@@ -739,8 +738,7 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
 
     QemuOpts *opts = qemu_opts_create(&raw_runtime_opts, NULL, 0,
                                       &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto done;
block/gluster.c +5 -10
index 31233cac69..b68bd32d47 100644
@@ -523,8 +523,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
 
     /* create opts info from runtime_json_opts list */
     opts = qemu_opts_create(&runtime_json_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         goto out;
     }
 
@@ -555,8 +554,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
 
         /* create opts info from runtime_type_opts list */
         opts = qemu_opts_create(&runtime_type_opts, NULL, 0, &error_abort);
-        qemu_opts_absorb_qdict(opts, backing_options, &local_err);
-        if (local_err) {
+        if (!qemu_opts_absorb_qdict(opts, backing_options, &local_err)) {
             goto out;
         }
 
@@ -586,8 +584,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
         if (gsconf->type == SOCKET_ADDRESS_TYPE_INET) {
             /* create opts info from runtime_inet_opts list */
             opts = qemu_opts_create(&runtime_inet_opts, NULL, 0, &error_abort);
-            qemu_opts_absorb_qdict(opts, backing_options, &local_err);
-            if (local_err) {
+            if (!qemu_opts_absorb_qdict(opts, backing_options, &local_err)) {
                 goto out;
             }
 
@@ -635,8 +632,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
         } else {
             /* create opts info from runtime_unix_opts list */
             opts = qemu_opts_create(&runtime_unix_opts, NULL, 0, &error_abort);
-            qemu_opts_absorb_qdict(opts, backing_options, &local_err);
-            if (local_err) {
+            if (!qemu_opts_absorb_qdict(opts, backing_options, &local_err)) {
                 goto out;
             }
 
@@ -819,8 +815,7 @@ static int qemu_gluster_open(BlockDriverState *bs,  QDict *options,
     const char *filename, *logfile;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto out;
block/iscsi.c +1 -2
index 767e3e75fd..d4dfa9914b 100644
@@ -1792,8 +1792,7 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
     int i, ret = 0, timeout = 0, lun;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto out;
block/nbd.c +1 -2
index eed160c5cd..1b30d96a4f 100644
@@ -1840,8 +1840,7 @@ static int nbd_process_options(BlockDriverState *bs, QDict *options,
     int ret = -EINVAL;
 
     opts = qemu_opts_create(&nbd_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         goto error;
     }
block/parallels.c +1 -2
index f26f03c926..32d0ecd398 100644
@@ -829,8 +829,7 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
         goto fail_options;
     }
 
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err != NULL) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         goto fail_options;
     }
 
block/qcow2.c +1 -2
index 38198b4e75..ce6333fd1e 100644
@@ -990,8 +990,7 @@ static int qcow2_update_options_prepare(BlockDriverState *bs,
     encryptfmt = qdict_get_try_str(encryptopts, "format");
 
     opts = qemu_opts_create(&qcow2_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto fail;
block/quorum.c +1 -2
index 7cf7ab1546..beb3b6dbcc 100644
@@ -922,8 +922,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
     }
 
     opts = qemu_opts_create(&quorum_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         ret = -EINVAL;
         goto exit;
     }
block/raw-format.c +1 -2
index 233d019ca3..a66fbe77c7 100644
@@ -79,8 +79,7 @@ static int raw_read_options(QDict *options, uint64_t *offset, bool *has_size,
     int ret;
 
     opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto end;
block/replication.c +1 -2
index ccf7b78160..5701eeb9e8 100644
@@ -99,8 +99,7 @@ static int replication_open(BlockDriverState *bs, QDict *options,
 
     ret = -EINVAL;
     opts = qemu_opts_create(&replication_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         goto fail;
     }
 
block/sheepdog.c +1 -2
index 27a30d17f4..a8d396dcdf 100644
@@ -1556,8 +1556,7 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags,
     s->aio_context = bdrv_get_aio_context(bs);
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto err_no_fd;
block/ssh.c +1 -2
index 098dbe03c1..13a2964621 100644
@@ -622,8 +622,7 @@ static BlockdevOptionsSsh *ssh_parse_options(QDict *options, Error **errp)
 
     /* Translate legacy options */
     opts = qemu_opts_create(&ssh_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         goto fail;
     }
block/throttle.c +1 -2
index 0ebbad0743..c0802addbb 100644
@@ -49,8 +49,7 @@ static int throttle_parse_options(QDict *options, char **group, Error **errp)
     Error *local_err = NULL;
     QemuOpts *opts = qemu_opts_create(&throttle_opts, NULL, 0, &error_abort);
 
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto fin;
block/vpc.c +1 -2
index 01fcd37e3c..119350d495 100644
@@ -235,8 +235,7 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
     }
 
     opts = qemu_opts_create(&vpc_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto fail;
block/vvfat.c +1 -2
index 2eb8cbb19f..e3e27e0d6c 100644
@@ -1149,8 +1149,7 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
 #endif
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto fail;
block/vxhs.c +2 -4
index d79fc97df6..237df4f185 100644
@@ -318,8 +318,7 @@ static int vxhs_open(BlockDriverState *bs, QDict *options,
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
     tcp_opts = qemu_opts_create(&runtime_tcp_opts, NULL, 0, &error_abort);
 
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         ret = -EINVAL;
         goto out;
     }
@@ -346,8 +345,7 @@ static int vxhs_open(BlockDriverState *bs, QDict *options,
     /* get the 'server.' arguments */
     qdict_extract_subqdict(options, &backing_options, VXHS_OPT_SERVER".");
 
-    qemu_opts_absorb_qdict(tcp_opts, backing_options, &local_err);
-    if (local_err != NULL) {
+    if (!qemu_opts_absorb_qdict(tcp_opts, backing_options, &local_err)) {
         ret = -EINVAL;
         goto out;
     }
blockdev.c +4 -7
index 39e12a62b3..625c8ff3f2 100644
@@ -509,8 +509,7 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
         goto err_no_opts;
     }
 
-    qemu_opts_absorb_qdict(opts, bs_opts, &error);
-    if (error) {
+    if (!qemu_opts_absorb_qdict(opts, bs_opts, &error)) {
         error_propagate(errp, error);
         goto early_err;
     }
@@ -827,9 +826,8 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
     };
 
     for (i = 0; i < ARRAY_SIZE(opt_renames); i++) {
-        qemu_opt_rename(all_opts, opt_renames[i].from, opt_renames[i].to,
-                        &local_err);
-        if (local_err) {
+        if (!qemu_opt_rename(all_opts, opt_renames[i].from,
+                             opt_renames[i].to, &local_err)) {
             error_propagate(errp, local_err);
             return NULL;
         }
@@ -867,8 +865,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type,
 
     legacy_opts = qemu_opts_create(&qemu_legacy_drive_opts, NULL, 0,
                                    &error_abort);
-    qemu_opts_absorb_qdict(legacy_opts, bs_opts, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(legacy_opts, bs_opts, &local_err)) {
         error_propagate(errp, local_err);
         goto fail;
     }
chardev/char.c +2 -4
index df697f3ce9..e5b43cb4b8 100644
@@ -444,8 +444,7 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename,
         qemu_opt_set(opts, "host", host, &error_abort);
         qemu_opt_set(opts, "port", port, &error_abort);
         if (p[pos] == ',') {
-            qemu_opts_do_parse(opts, p+pos+1, NULL, &local_err);
-            if (local_err) {
+            if (!qemu_opts_do_parse(opts, p + pos + 1, NULL, &local_err)) {
                 error_report_err(local_err);
                 goto fail;
             }
@@ -484,8 +483,7 @@ QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename,
     }
     if (strstart(filename, "unix:", &p)) {
         qemu_opt_set(opts, "backend", "socket", &error_abort);
-        qemu_opts_do_parse(opts, p, "path", &local_err);
-        if (local_err) {
+        if (!qemu_opts_do_parse(opts, p, "path", &local_err)) {
             error_report_err(local_err);
             goto fail;
         }
contrib/ivshmem-server/main.c +2 -2
index e4cd35f74c..ee08c4ced0 100644
@@ -103,8 +103,8 @@ ivshmem_server_parse_args(IvshmemServerArgs *args, int argc, char *argv[])
             break;
 
         case 'l': /* shm size */
-            parse_option_size("shm_size", optarg, &args->shm_size, &err);
-            if (err) {
+            if (!parse_option_size("shm_size", optarg, &args->shm_size,
+                                   &err)) {
                 error_report_err(err);
                 ivshmem_server_help(argv[0]);
                 exit(1);
hw/net/virtio-net.c +2 -3
index 1596cb1397..48b07eb921 100644
@@ -3137,9 +3137,8 @@ static bool failover_replug_primary(VirtIONet *n, Error **errp)
     }
     qdev_set_parent_bus(n->primary_dev, n->primary_bus);
     n->primary_should_be_hidden = false;
-    qemu_opt_set_bool(n->primary_device_opts,
-                      "partially_hotplugged", true, &err);
-    if (err) {
+    if (!qemu_opt_set_bool(n->primary_device_opts,
+                           "partially_hotplugged", true, &err)) {
         goto out;
     }
     hotplug_ctrl = qdev_get_hotplug_handler(n->primary_dev);
hw/smbios/smbios.c +8 -16
index ffd98727ee..87afcf9142 100644
@@ -964,8 +964,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
         int size;
         struct smbios_table *table; /* legacy mode only */
 
-        qemu_opts_validate(opts, qemu_smbios_file_opts, &err);
-        if (err) {
+        if (!qemu_opts_validate(opts, qemu_smbios_file_opts, &err)) {
             error_propagate(errp, err);
             return;
         }
@@ -1051,8 +1050,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
 
         switch (type) {
         case 0:
-            qemu_opts_validate(opts, qemu_smbios_type0_opts, &err);
-            if (err) {
+            if (!qemu_opts_validate(opts, qemu_smbios_type0_opts, &err)) {
                 error_propagate(errp, err);
                 return;
             }
@@ -1071,8 +1069,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
             }
             return;
         case 1:
-            qemu_opts_validate(opts, qemu_smbios_type1_opts, &err);
-            if (err) {
+            if (!qemu_opts_validate(opts, qemu_smbios_type1_opts, &err)) {
                 error_propagate(errp, err);
                 return;
             }
@@ -1093,8 +1090,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
             }
             return;
         case 2:
-            qemu_opts_validate(opts, qemu_smbios_type2_opts, &err);
-            if (err) {
+            if (!qemu_opts_validate(opts, qemu_smbios_type2_opts, &err)) {
                 error_propagate(errp, err);
                 return;
             }
@@ -1106,8 +1102,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
             save_opt(&type2.location, opts, "location");
             return;
         case 3:
-            qemu_opts_validate(opts, qemu_smbios_type3_opts, &err);
-            if (err) {
+            if (!qemu_opts_validate(opts, qemu_smbios_type3_opts, &err)) {
                 error_propagate(errp, err);
                 return;
             }
@@ -1118,8 +1113,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
             save_opt(&type3.sku, opts, "sku");
             return;
         case 4:
-            qemu_opts_validate(opts, qemu_smbios_type4_opts, &err);
-            if (err) {
+            if (!qemu_opts_validate(opts, qemu_smbios_type4_opts, &err)) {
                 error_propagate(errp, err);
                 return;
             }
@@ -1131,16 +1125,14 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
             save_opt(&type4.part, opts, "part");
             return;
         case 11:
-            qemu_opts_validate(opts, qemu_smbios_type11_opts, &err);
-            if (err) {
+            if (!qemu_opts_validate(opts, qemu_smbios_type11_opts, &err)) {
                 error_propagate(errp, err);
                 return;
             }
             save_opt_list(&type11.nvalues, &type11.values, opts, "value");
             return;
         case 17:
-            qemu_opts_validate(opts, qemu_smbios_type17_opts, &err);
-            if (err) {
+            if (!qemu_opts_validate(opts, qemu_smbios_type17_opts, &err)) {
                 error_propagate(errp, err);
                 return;
             }
qapi/string-input-visitor.c +1 -2
index 9be418b6d6..730fa4630d 100644
@@ -318,8 +318,7 @@ static void parse_type_size(Visitor *v, const char *name, uint64_t *obj,
     uint64_t val;
 
     assert(siv->lm == LM_NONE);
-    parse_option_size(name, siv->string, &val, &err);
-    if (err) {
+    if (!parse_option_size(name, siv->string, &val, &err)) {
         error_propagate(errp, err);
         return;
     }
qemu-img.c +7 -13
index 53bd32bf8f..41d2b91091 100644
@@ -468,8 +468,8 @@ static int add_old_style_options(const char *fmt, QemuOpts *opts,
     Error *err = NULL;
 
     if (base_filename) {
-        qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename, &err);
-        if (err) {
+        if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, base_filename,
+                          &err)) {
             error_report("Backing file not supported for file format '%s'",
                          fmt);
             error_free(err);
@@ -477,8 +477,7 @@ static int add_old_style_options(const char *fmt, QemuOpts *opts,
         }
     }
     if (base_fmt) {
-        qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, &err);
-        if (err) {
+        if (!qemu_opt_set(opts, BLOCK_OPT_BACKING_FMT, base_fmt, &err)) {
             error_report("Backing file format not supported for file "
                          "format '%s'", fmt);
             error_free(err);
@@ -2487,8 +2486,7 @@ static int img_convert(int argc, char **argv)
 
         opts = qemu_opts_create(create_opts, NULL, 0, &error_abort);
         if (options) {
-            qemu_opts_do_parse(opts, options, NULL, &local_err);
-            if (local_err) {
+            if (!qemu_opts_do_parse(opts, options, NULL, &local_err)) {
                 error_report_err(local_err);
                 ret = -1;
                 goto out;
@@ -3963,8 +3961,7 @@ static int img_resize(int argc, char **argv)
 
     /* Parse size */
     param = qemu_opts_create(&resize_options, NULL, 0, &error_abort);
-    qemu_opt_set(param, BLOCK_OPT_SIZE, size, &err);
-    if (err) {
+    if (!qemu_opt_set(param, BLOCK_OPT_SIZE, size, &err)) {
         error_report_err(err);
         ret = -1;
         qemu_opts_del(param);
@@ -4215,9 +4212,7 @@ static int img_amend(int argc, char **argv)
 
     amend_opts = qemu_opts_append(amend_opts, bs->drv->amend_opts);
     opts = qemu_opts_create(amend_opts, NULL, 0, &error_abort);
-    qemu_opts_do_parse(opts, options, NULL, &err);
-
-    if (err) {
+    if (!qemu_opts_do_parse(opts, options, NULL, &err)) {
         /* Try to parse options using the create options */
         Error *err1 = NULL;
         amend_opts = qemu_opts_append(amend_opts, bs->drv->create_opts);
@@ -5363,8 +5358,7 @@ static int img_measure(int argc, char **argv)
     create_opts = qemu_opts_append(create_opts, bdrv_file.create_opts);
     opts = qemu_opts_create(create_opts, NULL, 0, &error_abort);
     if (options) {
-        qemu_opts_do_parse(opts, options, NULL, &local_err);
-        if (local_err) {
+        if (!qemu_opts_do_parse(opts, options, NULL, &local_err)) {
             error_report_err(local_err);
             error_report("Invalid options for file format '%s'", out_fmt);
             goto out;
tpm.c +1 -2
index 9c9e20bbb7..75bc937812 100644
@@ -116,8 +116,7 @@ static int tpm_init_tpmdev(void *dummy, QemuOpts *opts, Error **errp)
     }
 
     /* validate backend specific opts */
-    qemu_opts_validate(opts, be->opts, &local_err);
-    if (local_err) {
+    if (!qemu_opts_validate(opts, be->opts, &local_err)) {
         error_propagate(errp, local_err);
         return 1;
     }
util/qemu-config.c +4 -8
index c0d0e9b8ef..7229c79cc7 100644
@@ -339,8 +339,7 @@ int qemu_set_option(const char *str)
         return -1;
     }
 
-    qemu_opt_set(opts, arg, str + offset + 1, &local_err);
-    if (local_err) {
+    if (!qemu_opt_set(opts, arg, str + offset + 1, &local_err)) {
         error_report_err(local_err);
         return -1;
     }
@@ -441,8 +440,7 @@ int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname)
                 error_report("no group defined");
                 goto out;
             }
-            qemu_opt_set(opts, arg, value, &local_err);
-            if (local_err) {
+            if (!qemu_opt_set(opts, arg, value, &local_err)) {
                 error_report_err(local_err);
                 goto out;
             }
@@ -498,8 +496,7 @@ static void config_parse_qdict_section(QDict *options, QemuOptsList *opts,
         goto out;
     }
 
-    qemu_opts_absorb_qdict(subopts, subqdict, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(subopts, subqdict, &local_err)) {
         error_propagate(errp, local_err);
         goto out;
     }
@@ -543,8 +540,7 @@ static void config_parse_qdict_section(QDict *options, QemuOptsList *opts,
                 goto out;
             }
 
-            qemu_opts_absorb_qdict(subopts, section, &local_err);
-            if (local_err) {
+            if (!qemu_opts_absorb_qdict(subopts, section, &local_err)) {
                 error_propagate(errp, local_err);
                 qemu_opts_del(subopts);
                 goto out;
util/qemu-option.c +6 -10
index 2f4fb62120..1dd14a0634 100644
@@ -536,8 +536,7 @@ static bool opt_validate(QemuOpt *opt, bool *help_wanted,
     }
 
     opt->desc = desc;
-    qemu_opt_parse(opt, &local_err);
-    if (local_err) {
+    if (!qemu_opt_parse(opt, &local_err)) {
         error_propagate(errp, local_err);
         return false;
     }
@@ -929,8 +928,8 @@ static QemuOpts *opts_parse(QemuOptsList *list, const char *params,
         return NULL;
     }
 
-    opts_do_parse(opts, params, firstname, defaults, help_wanted, &local_err);
-    if (local_err) {
+    if (!opts_do_parse(opts, params, firstname, defaults, help_wanted,
+                       &local_err)) {
         error_propagate(errp, local_err);
         qemu_opts_del(opts);
         return NULL;
@@ -1045,8 +1044,7 @@ QemuOpts *qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict,
     for (entry = qdict_first(qdict);
          entry;
          entry = qdict_next(qdict, entry)) {
-        qemu_opts_from_qdict_entry(opts, entry, &local_err);
-        if (local_err) {
+        if (!qemu_opts_from_qdict_entry(opts, entry, &local_err)) {
             error_propagate(errp, local_err);
             qemu_opts_del(opts);
             return NULL;
@@ -1073,8 +1071,7 @@ bool qemu_opts_absorb_qdict(QemuOpts *opts, QDict *qdict, Error **errp)
         next = qdict_next(qdict, entry);
 
         if (find_desc_by_name(opts->list->desc, entry->key)) {
-            qemu_opts_from_qdict_entry(opts, entry, &local_err);
-            if (local_err) {
+            if (!qemu_opts_from_qdict_entry(opts, entry, &local_err)) {
                 error_propagate(errp, local_err);
                 return false;
             }
@@ -1158,8 +1155,7 @@ bool qemu_opts_validate(QemuOpts *opts, const QemuOptDesc *desc, Error **errp)
             return false;
         }
 
-        qemu_opt_parse(opt, &local_err);
-        if (local_err) {
+        if (!qemu_opt_parse(opt, &local_err)) {
             error_propagate(errp, local_err);
             return false;
         }
Signature · 1 line
2.26.2
#5 lore raw

[PULL v2 26/53] qom: Put name parameter before value / visitor parameter

In reply to Markus Armbruster

The object_property_set_FOO() setters take property name and value in an unusual order:

void object_property_set_FOO(Object *obj, FOO_TYPE value,
const char *name, Error **errp)

Having to pass value before name feels grating. Swap them.

Same for object_property_set(), object_property_get(), and object_property_parse().

Convert callers with this Coccinelle script:

    @@
    identifier fun = {
        object_property_get, object_property_parse, object_property_set_str,
        object_property_set_link, object_property_set_bool,
        object_property_set_int, object_property_set_uint, object_property_set,
        object_property_set_qobject
    };
    expression obj, v, name, errp;
    @@
    -    fun(obj, v, name, errp)
    +    fun(obj, name, v, errp)

Chokes on hw/arm/musicpal.c's lcd_refresh() with the unhelpful error message "no position information". Convert that one manually.

Fails to convert hw/arm/armsse.c, because Coccinelle gets confused by ARMSSE being used both as typedef and function-like macro there. Convert manually.

Fails to convert hw/rx/rx-gdbsim.c, because Coccinelle gets confused by RXCPU being used both as typedef and function-like macro there. Convert manually. The other files using RXCPU that way don't need conversion.

Message-Id: <[email protected]> [Straightforwad conflict with commit 2336172d9b "audio: set default value for pcspk.iobase property" resolved]

---
 include/hw/audio/pcspk.h                 |   2 +-
 include/qom/object.h                     |  44 ++++-----
 include/qom/qom-qobject.h                |   7 +-
 backends/cryptodev.c                     |   2 +-
 backends/rng.c                           |   2 +-
 bootdevice.c                             |   2 +-
 crypto/secret.c                          |   2 +-
 crypto/secret_keyring.c                  |   2 +-
 crypto/tlscredsanon.c                    |   2 +-
 crypto/tlscredspsk.c                     |   2 +-
 crypto/tlscredsx509.c                    |   2 +-
 hw/acpi/cpu_hotplug.c                    |   4 +-
 hw/acpi/ich9.c                           |   2 +-
 hw/acpi/piix4.c                          |   2 +-
 hw/arm/allwinner-a10.c                   |   6 +-
 hw/arm/armsse.c                          |  76 +++++++--------
 hw/arm/armv7m.c                          |  24 +++--
 hw/arm/aspeed.c                          |  24 ++---
 hw/arm/aspeed_ast2600.c                  |  54 +++++------
 hw/arm/aspeed_soc.c                      |  23 +++--
 hw/arm/bcm2835_peripherals.c             |  12 +--
 hw/arm/bcm2836.c                         |   9 +-
 hw/arm/cubieboard.c                      |   6 +-
 hw/arm/digic.c                           |   2 +-
 hw/arm/exynos4210.c                      |  13 +--
 hw/arm/fsl-imx25.c                       |  14 ++-
 hw/arm/fsl-imx31.c                       |   2 +-
 hw/arm/fsl-imx6.c                        |  37 ++++---
 hw/arm/fsl-imx6ul.c                      |  29 +++---
 hw/arm/fsl-imx7.c                        |  31 +++---
 hw/arm/highbank.c                        |  12 +--
 hw/arm/integratorcp.c                    |   2 +-
 hw/arm/mcimx6ul-evk.c                    |   4 +-
 hw/arm/microbit.c                        |   4 +-
 hw/arm/mps2-tz.c                         |  31 +++---
 hw/arm/mps2.c                            |  12 +--
 hw/arm/msf2-soc.c                        |   8 +-
 hw/arm/musca.c                           |  18 ++--
 hw/arm/musicpal.c                        |   4 +-
 hw/arm/nrf51_soc.c                       |   6 +-
 hw/arm/orangepi.c                        |  13 ++-
 hw/arm/raspi.c                           |   2 +-
 hw/arm/realview.c                        |   6 +-
 hw/arm/sbsa-ref.c                        |  16 +--
 hw/arm/stellaris.c                       |   4 +-
 hw/arm/stm32f205_soc.c                   |   8 +-
 hw/arm/stm32f405_soc.c                   |   8 +-
 hw/arm/versatilepb.c                     |   4 +-
 hw/arm/vexpress.c                        |   8 +-
 hw/arm/virt.c                            |  44 +++++----
 hw/arm/xilinx_zynq.c                     |   6 +-
 hw/arm/xlnx-versal-virt.c                |   8 +-
 hw/arm/xlnx-versal.c                     |  30 +++---
 hw/arm/xlnx-zcu102.c                     |   8 +-
 hw/arm/xlnx-zynqmp.c                     |  46 ++++-----
 hw/block/xen-block.c                     |   9 +-
 hw/core/bus.c                            |   8 +-
 hw/core/numa.c                           |   4 +-
 hw/core/qdev-properties-system.c         |  10 +-
 hw/core/qdev-properties.c                |  20 ++--
 hw/core/qdev.c                           |   8 +-
 hw/display/virtio-gpu-pci.c              |   5 +-
 hw/display/virtio-vga.c                  |   5 +-
 hw/dma/sparc32_dma.c                     |   6 +-
 hw/dma/xilinx_axidma.c                   |   4 +-
 hw/i386/pc.c                             |   8 +-
 hw/i386/pc_piix.c                        |   4 +-
 hw/i386/pc_q35.c                         |  28 +++---
 hw/i386/x86.c                            |   2 +-
 hw/ide/qdev.c                            |   2 +-
 hw/intc/pnv_xive.c                       |   9 +-
 hw/intc/spapr_xive.c                     |   9 +-
 hw/intc/xics.c                           |   4 +-
 hw/intc/xive.c                           |   4 +-
 hw/m68k/q800.c                           |   4 +-
 hw/mem/pc-dimm.c                         |   4 +-
 hw/microblaze/petalogix_ml605_mmu.c      |  24 ++---
 hw/microblaze/petalogix_s3adsp1800_mmu.c |   2 +-
 hw/microblaze/xlnx-zynqmp-pmu.c          |  30 +++---
 hw/mips/boston.c                         |   4 +-
 hw/mips/cps.c                            |  24 ++---
 hw/mips/jazz.c                           |   4 +-
 hw/mips/malta.c                          |   4 +-
 hw/misc/iotkit-sysctl.c                  |   2 +-
 hw/misc/macio/macio.c                    |   6 +-
 hw/net/ne2000-isa.c                      |   2 +-
 hw/net/xilinx_axienet.c                  |   4 +-
 hw/pci-host/pnv_phb3.c                   |  20 ++--
 hw/pci-host/pnv_phb4.c                   |   4 +-
 hw/pci-host/pnv_phb4_pec.c               |   4 +-
 hw/pci-host/prep.c                       |   4 +-
 hw/ppc/mac_newworld.c                    |  10 +-
 hw/ppc/mac_oldworld.c                    |   4 +-
 hw/ppc/pnv.c                             | 118 +++++++++++------------
 hw/ppc/pnv_psi.c                         |   9 +-
 hw/ppc/spapr.c                           |   4 +-
 hw/ppc/spapr_irq.c                       |   6 +-
 hw/ppc/spapr_pci.c                       |   2 +-
 hw/riscv/opentitan.c                     |   4 +-
 hw/riscv/sifive_e.c                      |   4 +-
 hw/riscv/sifive_u.c                      |   6 +-
 hw/riscv/spike.c                         |   4 +-
 hw/riscv/virt.c                          |   4 +-
 hw/rx/rx-gdbsim.c                        |  12 +--
 hw/s390x/ipl.c                           |   4 +-
 hw/s390x/s390-pci-bus.c                  |   2 +-
 hw/s390x/s390-skeys.c                    |   2 +-
 hw/s390x/s390-stattrib.c                 |   2 +-
 hw/s390x/s390-virtio-ccw.c               |   6 +-
 hw/s390x/virtio-ccw-crypto.c             |   5 +-
 hw/s390x/virtio-ccw-rng.c                |   3 +-
 hw/scsi/scsi-bus.c                       |   4 +-
 hw/sd/aspeed_sdhci.c                     |   6 +-
 hw/sd/ssi-sd.c                           |   2 +-
 hw/sparc/sun4m.c                         |   2 +-
 hw/sparc64/sun4u.c                       |   2 +-
 hw/usb/dev-storage.c                     |   4 +-
 hw/virtio/virtio-crypto-pci.c            |   5 +-
 hw/virtio/virtio-iommu-pci.c             |   4 +-
 hw/virtio/virtio-mem-pci.c               |   4 +-
 hw/virtio/virtio-pmem-pci.c              |   2 +-
 hw/virtio/virtio-rng-pci.c               |   3 +-
 hw/virtio/virtio-rng.c                   |   4 +-
 linux-user/syscall.c                     |   2 +-
 net/filter.c                             |   2 +-
 net/net.c                                |   2 +-
 qdev-monitor.c                           |   2 +-
 qom/object.c                             |  52 +++++-----
 qom/object_interfaces.c                  |   2 +-
 qom/qom-hmp-cmds.c                       |   2 +-
 qom/qom-qmp-cmds.c                       |   2 +-
 qom/qom-qobject.c                        |   9 +-
 softmmu/vl.c                             |  12 +--
 target/arm/monitor.c                     |   2 +-
 target/i386/cpu.c                        |  57 ++++++-----
 target/ppc/translate_init.inc.c          |   2 +-
 target/s390x/cpu_models.c                |   2 +-
 ui/console.c                             |   4 +-
 138 files changed, 712 insertions(+), 741 deletions(-)
include/hw/audio/pcspk.h +1 -1
index 06cba00b83..9506179587 100644
@@ -33,7 +33,7 @@
 
 static inline void pcspk_init(ISADevice *isadev, ISABus *bus, ISADevice *pit)
 {
-    object_property_set_link(OBJECT(isadev), OBJECT(pit), "pit", NULL);
+    object_property_set_link(OBJECT(isadev), "pit", OBJECT(pit), NULL);
     isa_realize_and_unref(isadev, bus, &error_fatal);
 }
 
include/qom/object.h +22 -22

134 lines not on this page · raw message

include/qom/qom-qobject.h +4 -3
index 82136e6e80..ad9a98dd62 100644
@@ -28,13 +28,14 @@ struct QObject *object_property_get_qobject(Object *obj, const char *name,
 /**
  * object_property_set_qobject:
  * @obj: the object
- * @ret: The value that will be written to the property.
  * @name: the name of the property
+ * @value: The value that will be written to the property.
  * @errp: returns an error if this function fails
  *
  * Writes a property to a object.
  */
-void object_property_set_qobject(Object *obj, struct QObject *qobj,
-                                 const char *name, struct Error **errp);
+void object_property_set_qobject(Object *obj,
+                                 const char *name, struct QObject *value,
+                                 struct Error **errp);
 
 #endif
backends/cryptodev.c +1 -1
index 7e7265102e..72b7077475 100644
@@ -214,7 +214,7 @@ static void cryptodev_backend_instance_init(Object *obj)
                           cryptodev_backend_set_queues,
                           NULL, NULL);
     /* Initialize devices' queues property to 1 */
-    object_property_set_int(obj, 1, "queues", NULL);
+    object_property_set_int(obj, "queues", 1, NULL);
 }
 
 static void cryptodev_backend_finalize(Object *obj)
backends/rng.c +1 -1
index 597f0ec268..484f04e891 100644
@@ -48,7 +48,7 @@ static bool rng_backend_prop_get_opened(Object *obj, Error **errp)
 
 static void rng_backend_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "opened", errp);
+    object_property_set_bool(OBJECT(uc), "opened", true, errp);
 }
 
 static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp)
bootdevice.c +1 -1
index 769f40c77d..8185402a5a 100644
@@ -341,7 +341,7 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex,
                         prop);
 
     /* initialize devices' bootindex property to -1 */
-    object_property_set_int(obj, -1, name, NULL);
+    object_property_set_int(obj, name, -1, NULL);
 }
 
 typedef struct FWLCHSEntry FWLCHSEntry;
crypto/secret.c +1 -1
index 3447e2f64b..281cb81f0f 100644
@@ -110,7 +110,7 @@ qcrypto_secret_prop_get_file(Object *obj,
 static void
 qcrypto_secret_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
crypto/secret_keyring.c +1 -1
index 4f132d6370..8bfc58ebf4 100644
@@ -105,7 +105,7 @@ qcrypto_secret_prop_get_key(Object *obj, Visitor *v,
 static void
 qcrypto_secret_keyring_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
crypto/tlscredsanon.c +1 -1
index fc078d5b97..30275b6847 100644
@@ -165,7 +165,7 @@ qcrypto_tls_creds_anon_prop_get_loaded(Object *obj G_GNUC_UNUSED,
 static void
 qcrypto_tls_creds_anon_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
crypto/tlscredspsk.c +1 -1
index f01b64d8bc..e26807b899 100644
@@ -234,7 +234,7 @@ qcrypto_tls_creds_psk_prop_get_loaded(Object *obj G_GNUC_UNUSED,
 static void
 qcrypto_tls_creds_psk_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
crypto/tlscredsx509.c +1 -1
index e337d68c4f..dd7267ccdb 100644
@@ -774,7 +774,7 @@ qcrypto_tls_creds_x509_prop_get_sanity(Object *obj,
 static void
 qcrypto_tls_creds_x509_complete(UserCreatable *uc, Error **errp)
 {
-    object_property_set_bool(OBJECT(uc), true, "loaded", errp);
+    object_property_set_bool(OBJECT(uc), "loaded", true, errp);
 }
 
 
hw/acpi/cpu_hotplug.c +2 -2
index 3e687d227a..53654f8638 100644
@@ -41,7 +41,7 @@ static void cpu_status_write(void *opaque, hwaddr addr, uint64_t data,
      */
     if (addr == 0 && data == 0) {
         AcpiCpuHotplug *cpus = opaque;
-        object_property_set_bool(cpus->device, false, "cpu-hotplug-legacy",
+        object_property_set_bool(cpus->device, "cpu-hotplug-legacy", false,
                                  &error_abort);
     }
 }
@@ -63,7 +63,7 @@ static void acpi_set_cpu_present_bit(AcpiCpuHotplug *g, CPUState *cpu)
 
     cpu_id = k->get_arch_id(cpu);
     if ((cpu_id / 8) >= ACPI_GPE_PROC_LEN) {
-        object_property_set_bool(g->device, false, "cpu-hotplug-legacy",
+        object_property_set_bool(g->device, "cpu-hotplug-legacy", false,
                                  &error_abort);
         return;
     }
hw/acpi/ich9.c +1 -1
index 2d204babc6..6a19070cec 100644
@@ -201,7 +201,7 @@ static int vmstate_cpuhp_pre_load(void *opaque)
 {
     ICH9LPCPMRegs *s = opaque;
     Object *obj = OBJECT(s->gpe_cpu.device);
-    object_property_set_bool(obj, false, "cpu-hotplug-legacy", &error_abort);
+    object_property_set_bool(obj, "cpu-hotplug-legacy", false, &error_abort);
     return 0;
 }
 
hw/acpi/piix4.c +1 -1
index 283422e0d3..26bac4f16c 100644
@@ -244,7 +244,7 @@ static bool vmstate_test_use_cpuhp(void *opaque)
 static int vmstate_cpuhp_pre_load(void *opaque)
 {
     Object *obj = OBJECT(opaque);
-    object_property_set_bool(obj, false, "cpu-hotplug-legacy", &error_abort);
+    object_property_set_bool(obj, "cpu-hotplug-legacy", false, &error_abort);
     return 0;
 }
 
hw/arm/allwinner-a10.c +3 -3
index e1acffe5f6..c5d604af68 100644
@@ -142,15 +142,15 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
 
             sprintf(bus, "usb-bus.%d", i);
 
-            object_property_set_bool(OBJECT(&s->ehci[i]), true,
-                                     "companion-enable", &error_fatal);
+            object_property_set_bool(OBJECT(&s->ehci[i]), "companion-enable",
+                                     true, &error_fatal);
             sysbus_realize(SYS_BUS_DEVICE(&s->ehci[i]), &error_fatal);
             sysbus_mmio_map(SYS_BUS_DEVICE(&s->ehci[i]), 0,
                             AW_A10_EHCI_BASE + i * 0x8000);
             sysbus_connect_irq(SYS_BUS_DEVICE(&s->ehci[i]), 0,
                                qdev_get_gpio_in(dev, 39 + i));
 
-            object_property_set_str(OBJECT(&s->ohci[i]), bus, "masterbus",
+            object_property_set_str(OBJECT(&s->ohci[i]), "masterbus", bus,
                                     &error_fatal);
             sysbus_realize(SYS_BUS_DEVICE(&s->ohci[i]), &error_fatal);
             sysbus_mmio_map(SYS_BUS_DEVICE(&s->ohci[i]), 0,
hw/arm/armsse.c +37 -39

194 lines not on this page · raw message

hw/arm/armv7m.c +11 -13
index 28baf330e5..923f7fad40 100644
@@ -167,39 +167,37 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    object_property_set_link(OBJECT(s->cpu), OBJECT(&s->container), "memory",
+    object_property_set_link(OBJECT(s->cpu), "memory", OBJECT(&s->container),
                              &error_abort);
     if (object_property_find(OBJECT(s->cpu), "idau", NULL)) {
-        object_property_set_link(OBJECT(s->cpu), s->idau, "idau",
+        object_property_set_link(OBJECT(s->cpu), "idau", s->idau,
                                  &error_abort);
     }
     if (object_property_find(OBJECT(s->cpu), "init-svtor", NULL)) {
-        object_property_set_uint(OBJECT(s->cpu), s->init_svtor,
-                                 "init-svtor", &err);
+        object_property_set_uint(OBJECT(s->cpu), "init-svtor", s->init_svtor,
+                                 &err);
         if (err != NULL) {
             error_propagate(errp, err);
             return;
         }
     }
     if (object_property_find(OBJECT(s->cpu), "start-powered-off", NULL)) {
-        object_property_set_bool(OBJECT(s->cpu), s->start_powered_off,
-                                 "start-powered-off", &err);
+        object_property_set_bool(OBJECT(s->cpu), "start-powered-off",
+                                 s->start_powered_off, &err);
         if (err != NULL) {
             error_propagate(errp, err);
             return;
         }
     }
     if (object_property_find(OBJECT(s->cpu), "vfp", NULL)) {
-        object_property_set_bool(OBJECT(s->cpu), s->vfp,
-                                 "vfp", &err);
+        object_property_set_bool(OBJECT(s->cpu), "vfp", s->vfp, &err);
         if (err != NULL) {
             error_propagate(errp, err);
             return;
         }
     }
     if (object_property_find(OBJECT(s->cpu), "dsp", NULL)) {
-        object_property_set_bool(OBJECT(s->cpu), s->dsp,
-                                 "dsp", &err);
+        object_property_set_bool(OBJECT(s->cpu), "dsp", s->dsp, &err);
         if (err != NULL) {
             error_propagate(errp, err);
             return;
@@ -245,13 +243,13 @@ static void armv7m_realize(DeviceState *dev, Error **errp)
             Object *obj = OBJECT(&s->bitband[i]);
             SysBusDevice *sbd = SYS_BUS_DEVICE(&s->bitband[i]);
 
-            object_property_set_int(obj, bitband_input_addr[i], "base", &err);
+            object_property_set_int(obj, "base", bitband_input_addr[i], &err);
             if (err != NULL) {
                 error_propagate(errp, err);
                 return;
             }
-            object_property_set_link(obj, OBJECT(s->board_memory),
-                                     "source-memory", &error_abort);
+            object_property_set_link(obj, "source-memory",
+                                     OBJECT(s->board_memory), &error_abort);
             if (!sysbus_realize(SYS_BUS_DEVICE(obj), &err)) {
                 error_propagate(errp, err);
                 return;
hw/arm/aspeed.c +12 -12
index 379f9672a5..660dcb5414 100644
@@ -277,7 +277,7 @@ static void aspeed_machine_init(MachineState *machine)
     /*
      * This will error out if isize is not supported by memory controller.
      */
-    object_property_set_uint(OBJECT(&bmc->soc), ram_size, "ram-size",
+    object_property_set_uint(OBJECT(&bmc->soc), "ram-size", ram_size,
                              &error_fatal);
 
     for (i = 0; i < sc->macs_num; i++) {
@@ -288,22 +288,22 @@ static void aspeed_machine_init(MachineState *machine)
         }
     }
 
-    object_property_set_int(OBJECT(&bmc->soc), amc->hw_strap1, "hw-strap1",
+    object_property_set_int(OBJECT(&bmc->soc), "hw-strap1", amc->hw_strap1,
                             &error_abort);
-    object_property_set_int(OBJECT(&bmc->soc), amc->hw_strap2, "hw-strap2",
+    object_property_set_int(OBJECT(&bmc->soc), "hw-strap2", amc->hw_strap2,
                             &error_abort);
-    object_property_set_int(OBJECT(&bmc->soc), amc->num_cs, "num-cs",
+    object_property_set_int(OBJECT(&bmc->soc), "num-cs", amc->num_cs,
                             &error_abort);
-    object_property_set_link(OBJECT(&bmc->soc), OBJECT(&bmc->ram_container),
-                             "dram", &error_abort);
+    object_property_set_link(OBJECT(&bmc->soc), "dram",
+                             OBJECT(&bmc->ram_container), &error_abort);
     if (machine->kernel_filename) {
         /*
          * When booting with a -kernel command line there is no u-boot
          * that runs to unlock the SCU. In this case set the default to
          * be unlocked as the kernel expects
          */
-        object_property_set_int(OBJECT(&bmc->soc), ASPEED_SCU_PROT_KEY,
-                                "hw-prot-key", &error_abort);
+        object_property_set_int(OBJECT(&bmc->soc), "hw-prot-key",
+                                ASPEED_SCU_PROT_KEY, &error_abort);
     }
     qdev_realize(DEVICE(&bmc->soc), NULL, &error_abort);
 
@@ -393,10 +393,10 @@ static void palmetto_bmc_i2c_init(AspeedMachineState *bmc)
     /* add a TMP423 temperature sensor */
     dev = i2c_create_slave(aspeed_i2c_get_bus(DEVICE(&soc->i2c), 2),
                            "tmp423", 0x4c);
-    object_property_set_int(OBJECT(dev), 31000, "temperature0", &error_abort);
-    object_property_set_int(OBJECT(dev), 28000, "temperature1", &error_abort);
-    object_property_set_int(OBJECT(dev), 20000, "temperature2", &error_abort);
-    object_property_set_int(OBJECT(dev), 110000, "temperature3", &error_abort);
+    object_property_set_int(OBJECT(dev), "temperature0", 31000, &error_abort);
+    object_property_set_int(OBJECT(dev), "temperature1", 28000, &error_abort);
+    object_property_set_int(OBJECT(dev), "temperature2", 20000, &error_abort);
+    object_property_set_int(OBJECT(dev), "temperature3", 110000, &error_abort);
 }
 
 static void ast2500_evb_i2c_init(AspeedMachineState *bmc)
hw/arm/aspeed_ast2600.c +26 -28

126 lines not on this page · raw message

hw/arm/aspeed_soc.c +11 -12
index fa56f96f92..27704d87ea 100644
@@ -204,7 +204,7 @@ static void aspeed_soc_init(Object *obj)
 
     object_initialize_child(obj, "sdc", &s->sdhci, TYPE_ASPEED_SDHCI);
 
-    object_property_set_int(OBJECT(&s->sdhci), 2, "num-slots", &error_abort);
+    object_property_set_int(OBJECT(&s->sdhci), "num-slots", 2, &error_abort);
 
     /* Init sd card slot class here so that they're under the correct parent */
     for (i = 0; i < ASPEED_SDHCI_NUM_SLOTS; ++i) {
@@ -274,8 +274,8 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
                        aspeed_soc_get_irq(s, ASPEED_RTC));
 
     /* Timer */
-    object_property_set_link(OBJECT(&s->timerctrl),
-                             OBJECT(&s->scu), "scu", &error_abort);
+    object_property_set_link(OBJECT(&s->timerctrl), "scu", OBJECT(&s->scu),
+                             &error_abort);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->timerctrl), &err)) {
         error_propagate(errp, err);
         return;
@@ -295,7 +295,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
     }
 
     /* I2C */
-    object_property_set_link(OBJECT(&s->i2c), OBJECT(s->dram_mr), "dram",
+    object_property_set_link(OBJECT(&s->i2c), "dram", OBJECT(s->dram_mr),
                              &error_abort);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->i2c), &err)) {
         error_propagate(errp, err);
@@ -306,10 +306,10 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
                        aspeed_soc_get_irq(s, ASPEED_I2C));
 
     /* FMC, The number of CS is set at the board level */
-    object_property_set_link(OBJECT(&s->fmc), OBJECT(s->dram_mr), "dram",
+    object_property_set_link(OBJECT(&s->fmc), "dram", OBJECT(s->dram_mr),
                              &error_abort);
-    object_property_set_int(OBJECT(&s->fmc), sc->memmap[ASPEED_SDRAM],
-                            "sdram-base", &err);
+    object_property_set_int(OBJECT(&s->fmc), "sdram-base",
+                            sc->memmap[ASPEED_SDRAM], &err);
     if (err) {
         error_propagate(errp, err);
         return;
@@ -326,8 +326,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
 
     /* SPI */
     for (i = 0; i < sc->spis_num; i++) {
-        object_property_set_int(OBJECT(&s->spi[i]), 1, "num-cs",
-                                &error_abort);
+        object_property_set_int(OBJECT(&s->spi[i]), "num-cs", 1, &error_abort);
         if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err)) {
             error_propagate(errp, err);
             return;
@@ -361,8 +360,8 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
     for (i = 0; i < sc->wdts_num; i++) {
         AspeedWDTClass *awc = ASPEED_WDT_GET_CLASS(&s->wdt[i]);
 
-        object_property_set_link(OBJECT(&s->wdt[i]),
-                                 OBJECT(&s->scu), "scu", &error_abort);
+        object_property_set_link(OBJECT(&s->wdt[i]), "scu", OBJECT(&s->scu),
+                                 &error_abort);
         if (!sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), &err)) {
             error_propagate(errp, err);
             return;
@@ -373,7 +372,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp)
 
     /* Net */
     for (i = 0; i < sc->macs_num; i++) {
-        object_property_set_bool(OBJECT(&s->ftgmac100[i]), true, "aspeed",
+        object_property_set_bool(OBJECT(&s->ftgmac100[i]), "aspeed", true,
                                  &error_abort);
         if (!sysbus_realize(SYS_BUS_DEVICE(&s->ftgmac100[i]), &err)) {
             error_propagate(errp, err);
hw/arm/bcm2835_peripherals.c +6 -6
index beade39e41..a6ccf3b368 100644
@@ -222,8 +222,8 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    object_property_set_uint(OBJECT(&s->fb), ram_size - vcram_size,
-                             "vcram-base", &err);
+    object_property_set_uint(OBJECT(&s->fb), "vcram-base",
+                             ram_size - vcram_size, &err);
     if (err) {
         error_propagate(errp, err);
         return;
@@ -270,11 +270,11 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
      * For the exact details please refer to the Arasan documentation:
      *   SD3.0_Host_AHB_eMMC4.4_Usersguide_ver5.9_jan11_10.pdf
      */
-    object_property_set_uint(OBJECT(&s->sdhci), 3, "sd-spec-version",
+    object_property_set_uint(OBJECT(&s->sdhci), "sd-spec-version", 3,
                              &error_abort);
-    object_property_set_uint(OBJECT(&s->sdhci), BCM2835_SDHC_CAPAREG, "capareg",
-                             &error_abort);
-    object_property_set_bool(OBJECT(&s->sdhci), true, "pending-insert-quirk",
+    object_property_set_uint(OBJECT(&s->sdhci), "capareg",
+                             BCM2835_SDHC_CAPAREG, &error_abort);
+    object_property_set_bool(OBJECT(&s->sdhci), "pending-insert-quirk", true,
                              &error_abort);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->sdhci), &err)) {
         error_propagate(errp, err);
hw/arm/bcm2836.c +4 -5
index 70ca2f0d9a..91d31a5cb7 100644
@@ -110,17 +110,16 @@ static void bcm2836_realize(DeviceState *dev, Error **errp)
         s->cpu[n].core.mp_affinity = (info->clusterid << 8) | n;
 
         /* set periphbase/CBAR value for CPU-local registers */
-        object_property_set_int(OBJECT(&s->cpu[n].core),
-                                info->peri_base,
-                                "reset-cbar", &err);
+        object_property_set_int(OBJECT(&s->cpu[n].core), "reset-cbar",
+                                info->peri_base, &err);
         if (err) {
             error_propagate(errp, err);
             return;
         }
 
         /* start powered off if not enabled */
-        object_property_set_bool(OBJECT(&s->cpu[n].core), n >= s->enabled_cpus,
-                                 "start-powered-off", &err);
+        object_property_set_bool(OBJECT(&s->cpu[n].core), "start-powered-off",
+                                 n >= s->enabled_cpus, &err);
         if (err) {
             error_propagate(errp, err);
             return;
hw/arm/cubieboard.c +3 -3
index c720e24ced..302919246b 100644
@@ -62,19 +62,19 @@ static void cubieboard_init(MachineState *machine)
     object_property_add_child(OBJECT(machine), "soc", OBJECT(a10));
     object_unref(OBJECT(a10));
 
-    object_property_set_int(OBJECT(&a10->emac), 1, "phy-addr", &err);
+    object_property_set_int(OBJECT(&a10->emac), "phy-addr", 1, &err);
     if (err != NULL) {
         error_reportf_err(err, "Couldn't set phy address: ");
         exit(1);
     }
 
-    object_property_set_int(OBJECT(&a10->timer), 32768, "clk0-freq", &err);
+    object_property_set_int(OBJECT(&a10->timer), "clk0-freq", 32768, &err);
     if (err != NULL) {
         error_reportf_err(err, "Couldn't set clk0 frequency: ");
         exit(1);
     }
 
-    object_property_set_int(OBJECT(&a10->timer), 24000000, "clk1-freq", &err);
+    object_property_set_int(OBJECT(&a10->timer), "clk1-freq", 24000000, &err);
     if (err != NULL) {
         error_reportf_err(err, "Couldn't set clk1 frequency: ");
         exit(1);
hw/arm/digic.c +1 -1
index 1494c2900a..ffc89d86b8 100644
@@ -56,7 +56,7 @@ static void digic_realize(DeviceState *dev, Error **errp)
     SysBusDevice *sbd;
     int i;
 
-    object_property_set_bool(OBJECT(&s->cpu), true, "reset-hivecs", &err);
+    object_property_set_bool(OBJECT(&s->cpu), "reset-hivecs", true, &err);
     if (err != NULL) {
         error_propagate(errp, err);
         return;
hw/arm/exynos4210.c +7 -6
index fa639806ec..081bbff317 100644
@@ -188,7 +188,7 @@ static DeviceState *pl330_create(uint32_t base, qemu_or_irq *orgate,
     sysbus_realize_and_unref(busdev, &error_fatal);
     sysbus_mmio_map(busdev, 0, base);
 
-    object_property_set_int(OBJECT(orgate), nevents + 1, "num-lines",
+    object_property_set_int(OBJECT(orgate), "num-lines", nevents + 1,
                             &error_abort);
     qdev_realize(DEVICE(orgate), NULL, &error_abort);
 
@@ -215,14 +215,15 @@ static void exynos4210_realize(DeviceState *socdev, Error **errp)
          * support EL3 so the CPU EL3 property is disabled before realization.
          */
         if (object_property_find(cpuobj, "has_el3", NULL)) {
-            object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
+            object_property_set_bool(cpuobj, "has_el3", false, &error_fatal);
         }
 
         s->cpu[n] = ARM_CPU(cpuobj);
-        object_property_set_int(cpuobj, exynos4210_calc_affinity(n),
-                                "mp-affinity", &error_abort);
-        object_property_set_int(cpuobj, EXYNOS4210_SMP_PRIVATE_BASE_ADDR,
-                                "reset-cbar", &error_abort);
+        object_property_set_int(cpuobj, "mp-affinity",
+                                exynos4210_calc_affinity(n), &error_abort);
+        object_property_set_int(cpuobj, "reset-cbar",
+                                EXYNOS4210_SMP_PRIVATE_BASE_ADDR,
+                                &error_abort);
         qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
     }
 
hw/arm/fsl-imx25.c +6 -8
index 250681f045..ea72a02d06 100644
@@ -249,14 +249,12 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
             { FSL_IMX25_ESDHC2_ADDR, FSL_IMX25_ESDHC2_IRQ },
         };
 
-        object_property_set_uint(OBJECT(&s->esdhc[i]), 2, "sd-spec-version",
-                                 &error_abort);
-        object_property_set_uint(OBJECT(&s->esdhc[i]), IMX25_ESDHC_CAPABILITIES,
-                                 "capareg",
-                                 &error_abort);
-        object_property_set_uint(OBJECT(&s->esdhc[i]), SDHCI_VENDOR_IMX,
-                                 "vendor",
+        object_property_set_uint(OBJECT(&s->esdhc[i]), "sd-spec-version", 2,
                                  &error_abort);
+        object_property_set_uint(OBJECT(&s->esdhc[i]), "capareg",
+                                 IMX25_ESDHC_CAPABILITIES, &error_abort);
+        object_property_set_uint(OBJECT(&s->esdhc[i]), "vendor",
+                                 SDHCI_VENDOR_IMX, &error_abort);
         if (!sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), &err)) {
             error_propagate(errp, err);
             return;
@@ -285,7 +283,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
     }
 
     /* Watchdog */
-    object_property_set_bool(OBJECT(&s->wdt), true, "pretimeout-support",
+    object_property_set_bool(OBJECT(&s->wdt), "pretimeout-support", true,
                              &error_abort);
     sysbus_realize(SYS_BUS_DEVICE(&s->wdt), &error_abort);
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt), 0, FSL_IMX25_WDT_ADDR);
hw/arm/fsl-imx31.c +1 -1
index 4f007ea5e8..23a5f50175 100644
@@ -179,7 +179,7 @@ static void fsl_imx31_realize(DeviceState *dev, Error **errp)
             { FSL_IMX31_GPIO3_ADDR, FSL_IMX31_GPIO3_IRQ }
         };
 
-        object_property_set_bool(OBJECT(&s->gpio[i]), false, "has-edge-sel",
+        object_property_set_bool(OBJECT(&s->gpio[i]), "has-edge-sel", false,
                                  &error_abort);
         if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), &err)) {
             error_propagate(errp, err);
hw/arm/fsl-imx6.c +17 -20
index 417ca6889c..e359ee579d 100644
@@ -120,14 +120,14 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
 
         /* On uniprocessor, the CBAR is set to 0 */
         if (smp_cpus > 1) {
-            object_property_set_int(OBJECT(&s->cpu[i]), FSL_IMX6_A9MPCORE_ADDR,
-                                    "reset-cbar", &error_abort);
+            object_property_set_int(OBJECT(&s->cpu[i]), "reset-cbar",
+                                    FSL_IMX6_A9MPCORE_ADDR, &error_abort);
         }
 
         /* All CPU but CPU 0 start in power off mode */
         if (i) {
-            object_property_set_bool(OBJECT(&s->cpu[i]), true,
-                                     "start-powered-off", &error_abort);
+            object_property_set_bool(OBJECT(&s->cpu[i]), "start-powered-off",
+                                     true, &error_abort);
         }
 
         if (!qdev_realize(DEVICE(&s->cpu[i]), NULL, &err)) {
@@ -136,12 +136,11 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
         }
     }
 
-    object_property_set_int(OBJECT(&s->a9mpcore), smp_cpus, "num-cpu",
+    object_property_set_int(OBJECT(&s->a9mpcore), "num-cpu", smp_cpus,
                             &error_abort);
 
-    object_property_set_int(OBJECT(&s->a9mpcore),
-                            FSL_IMX6_MAX_IRQ + GIC_INTERNAL, "num-irq",
-                            &error_abort);
+    object_property_set_int(OBJECT(&s->a9mpcore), "num-irq",
+                            FSL_IMX6_MAX_IRQ + GIC_INTERNAL, &error_abort);
 
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->a9mpcore), &err)) {
         error_propagate(errp, err);
@@ -295,10 +294,10 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
             },
         };
 
-        object_property_set_bool(OBJECT(&s->gpio[i]), true, "has-edge-sel",
-                                 &error_abort);
-        object_property_set_bool(OBJECT(&s->gpio[i]), true, "has-upper-pin-irq",
+        object_property_set_bool(OBJECT(&s->gpio[i]), "has-edge-sel", true,
                                  &error_abort);
+        object_property_set_bool(OBJECT(&s->gpio[i]), "has-upper-pin-irq",
+                                 true, &error_abort);
         if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio[i]), &err)) {
             error_propagate(errp, err);
             return;
@@ -326,14 +325,12 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
         };
 
         /* UHS-I SDIO3.0 SDR104 1.8V ADMA */
-        object_property_set_uint(OBJECT(&s->esdhc[i]), 3, "sd-spec-version",
-                                 &error_abort);
-        object_property_set_uint(OBJECT(&s->esdhc[i]), IMX6_ESDHC_CAPABILITIES,
-                                 "capareg",
-                                 &error_abort);
-        object_property_set_uint(OBJECT(&s->esdhc[i]), SDHCI_VENDOR_IMX,
-                                 "vendor",
+        object_property_set_uint(OBJECT(&s->esdhc[i]), "sd-spec-version", 3,
                                  &error_abort);
+        object_property_set_uint(OBJECT(&s->esdhc[i]), "capareg",
+                                 IMX6_ESDHC_CAPABILITIES, &error_abort);
+        object_property_set_uint(OBJECT(&s->esdhc[i]), "vendor",
+                                 SDHCI_VENDOR_IMX, &error_abort);
         if (!sysbus_realize(SYS_BUS_DEVICE(&s->esdhc[i]), &err)) {
             error_propagate(errp, err);
             return;
@@ -417,8 +414,8 @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
             FSL_IMX6_WDOG2_IRQ,
         };
 
-        object_property_set_bool(OBJECT(&s->wdt[i]), true, "pretimeout-support",
-                                 &error_abort);
+        object_property_set_bool(OBJECT(&s->wdt[i]), "pretimeout-support",
+                                 true, &error_abort);
         sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), &error_abort);
 
         sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0, FSL_IMX6_WDOGn_ADDR[i]);
hw/arm/fsl-imx6ul.c +13 -16
index 51b2f256ec..e0128d7316 100644
@@ -166,17 +166,16 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
         return;
     }
 
-    object_property_set_int(OBJECT(&s->cpu), QEMU_PSCI_CONDUIT_SMC,
-                            "psci-conduit", &error_abort);
+    object_property_set_int(OBJECT(&s->cpu), "psci-conduit",
+                            QEMU_PSCI_CONDUIT_SMC, &error_abort);
     qdev_realize(DEVICE(&s->cpu), NULL, &error_abort);
 
     /*
      * A7MPCORE
      */
-    object_property_set_int(OBJECT(&s->a7mpcore), 1, "num-cpu", &error_abort);
-    object_property_set_int(OBJECT(&s->a7mpcore),
-                            FSL_IMX6UL_MAX_IRQ + GIC_INTERNAL,
-                            "num-irq", &error_abort);
+    object_property_set_int(OBJECT(&s->a7mpcore), "num-cpu", 1, &error_abort);
+    object_property_set_int(OBJECT(&s->a7mpcore), "num-irq",
+                            FSL_IMX6UL_MAX_IRQ + GIC_INTERNAL, &error_abort);
     sysbus_realize(SYS_BUS_DEVICE(&s->a7mpcore), &error_abort);
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->a7mpcore), 0, FSL_IMX6UL_A7MPCORE_ADDR);
 
@@ -427,12 +426,10 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
             FSL_IMX6UL_ENET2_TIMER_IRQ,
         };
 
-        object_property_set_uint(OBJECT(&s->eth[i]),
-                                 s->phy_num[i],
-                                 "phy-num", &error_abort);
-        object_property_set_uint(OBJECT(&s->eth[i]),
-                                 FSL_IMX6UL_ETH_NUM_TX_RINGS,
-                                 "tx-ring-num", &error_abort);
+        object_property_set_uint(OBJECT(&s->eth[i]), "phy-num",
+                                 s->phy_num[i], &error_abort);
+        object_property_set_uint(OBJECT(&s->eth[i]), "tx-ring-num",
+                                 FSL_IMX6UL_ETH_NUM_TX_RINGS, &error_abort);
         qdev_set_nic_properties(DEVICE(&s->eth[i]), &nd_table[i]);
         sysbus_realize(SYS_BUS_DEVICE(&s->eth[i]), &error_abort);
 
@@ -482,8 +479,8 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
             FSL_IMX6UL_USDHC2_IRQ,
         };
 
-        object_property_set_uint(OBJECT(&s->usdhc[i]), SDHCI_VENDOR_IMX,
-                                        "vendor", &error_abort);
+        object_property_set_uint(OBJECT(&s->usdhc[i]), "vendor",
+                                 SDHCI_VENDOR_IMX, &error_abort);
         sysbus_realize(SYS_BUS_DEVICE(&s->usdhc[i]), &error_abort);
 
         sysbus_mmio_map(SYS_BUS_DEVICE(&s->usdhc[i]), 0,
@@ -515,8 +512,8 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
             FSL_IMX6UL_WDOG3_IRQ,
         };
 
-        object_property_set_bool(OBJECT(&s->wdt[i]), true, "pretimeout-support",
-                                 &error_abort);
+        object_property_set_bool(OBJECT(&s->wdt[i]), "pretimeout-support",
+                                 true, &error_abort);
         sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), &error_abort);
 
         sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0,
hw/arm/fsl-imx7.c +15 -16
index b49d895a41..fad637d328 100644
@@ -159,19 +159,19 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
     for (i = 0; i < smp_cpus; i++) {
         o = OBJECT(&s->cpu[i]);
 
-        object_property_set_int(o, QEMU_PSCI_CONDUIT_SMC,
-                                "psci-conduit", &error_abort);
+        object_property_set_int(o, "psci-conduit", QEMU_PSCI_CONDUIT_SMC,
+                                &error_abort);
 
         /* On uniprocessor, the CBAR is set to 0 */
         if (smp_cpus > 1) {
-            object_property_set_int(o, FSL_IMX7_A7MPCORE_ADDR,
-                                    "reset-cbar", &error_abort);
+            object_property_set_int(o, "reset-cbar", FSL_IMX7_A7MPCORE_ADDR,
+                                    &error_abort);
         }
 
         if (i) {
             /* Secondary CPUs start in PSCI powered-down state */
-            object_property_set_bool(o, true,
-                                     "start-powered-off", &error_abort);
+            object_property_set_bool(o, "start-powered-off", true,
+                                     &error_abort);
         }
 
         qdev_realize(DEVICE(o), NULL, &error_abort);
@@ -180,11 +180,10 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
     /*
      * A7MPCORE
      */
-    object_property_set_int(OBJECT(&s->a7mpcore), smp_cpus, "num-cpu",
+    object_property_set_int(OBJECT(&s->a7mpcore), "num-cpu", smp_cpus,
                             &error_abort);
-    object_property_set_int(OBJECT(&s->a7mpcore),
-                            FSL_IMX7_MAX_IRQ + GIC_INTERNAL,
-                            "num-irq", &error_abort);
+    object_property_set_int(OBJECT(&s->a7mpcore), "num-irq",
+                            FSL_IMX7_MAX_IRQ + GIC_INTERNAL, &error_abort);
 
     sysbus_realize(SYS_BUS_DEVICE(&s->a7mpcore), &error_abort);
     sysbus_mmio_map(SYS_BUS_DEVICE(&s->a7mpcore), 0, FSL_IMX7_A7MPCORE_ADDR);
@@ -364,8 +363,8 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
             FSL_IMX7_ENET2_ADDR,
         };
 
-        object_property_set_uint(OBJECT(&s->eth[i]), FSL_IMX7_ETH_NUM_TX_RINGS,
-                                 "tx-ring-num", &error_abort);
+        object_property_set_uint(OBJECT(&s->eth[i]), "tx-ring-num",
+                                 FSL_IMX7_ETH_NUM_TX_RINGS, &error_abort);
         qdev_set_nic_properties(DEVICE(&s->eth[i]), &nd_table[i]);
         sysbus_realize(SYS_BUS_DEVICE(&s->eth[i]), &error_abort);
 
@@ -393,8 +392,8 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
             FSL_IMX7_USDHC3_IRQ,
         };
 
-        object_property_set_uint(OBJECT(&s->usdhc[i]), SDHCI_VENDOR_IMX,
-                                 "vendor", &error_abort);
+        object_property_set_uint(OBJECT(&s->usdhc[i]), "vendor",
+                                 SDHCI_VENDOR_IMX, &error_abort);
         sysbus_realize(SYS_BUS_DEVICE(&s->usdhc[i]), &error_abort);
 
         sysbus_mmio_map(SYS_BUS_DEVICE(&s->usdhc[i]), 0,
@@ -432,8 +431,8 @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
             FSL_IMX7_WDOG4_IRQ,
         };
 
-        object_property_set_bool(OBJECT(&s->wdt[i]), true, "pretimeout-support",
-                                 &error_abort);
+        object_property_set_bool(OBJECT(&s->wdt[i]), "pretimeout-support",
+                                 true, &error_abort);
         sysbus_realize(SYS_BUS_DEVICE(&s->wdt[i]), &error_abort);
 
         sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0, FSL_IMX7_WDOGn_ADDR[i]);
hw/arm/highbank.c +6 -6
index c7ef48ecde..c96f2ab9cf 100644
@@ -267,18 +267,18 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
         cpuobj = object_new(machine->cpu_type);
         cpu = ARM_CPU(cpuobj);
 
-        object_property_set_int(cpuobj, QEMU_PSCI_CONDUIT_SMC,
-                                "psci-conduit", &error_abort);
+        object_property_set_int(cpuobj, "psci-conduit", QEMU_PSCI_CONDUIT_SMC,
+                                &error_abort);
 
         if (n) {
             /* Secondary CPUs start in PSCI powered-down state */
-            object_property_set_bool(cpuobj, true,
-                                     "start-powered-off", &error_abort);
+            object_property_set_bool(cpuobj, "start-powered-off", true,
+                                     &error_abort);
         }
 
         if (object_property_find(cpuobj, "reset-cbar", NULL)) {
-            object_property_set_int(cpuobj, MPCORE_PERIPHBASE,
-                                    "reset-cbar", &error_abort);
+            object_property_set_int(cpuobj, "reset-cbar", MPCORE_PERIPHBASE,
+                                    &error_abort);
         }
         qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
         cpu_irq[n] = qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_IRQ);
hw/arm/integratorcp.c +1 -1
index b11a846355..f304c2b4f0 100644
@@ -604,7 +604,7 @@ static void integratorcp_init(MachineState *machine)
      * realization.
      */
     if (object_property_find(cpuobj, "has_el3", NULL)) {
-        object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
+        object_property_set_bool(cpuobj, "has_el3", false, &error_fatal);
     }
 
     qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
hw/arm/mcimx6ul-evk.c +2 -2
index 9033d3f8f3..ed69a7b037 100644
@@ -40,8 +40,8 @@ static void mcimx6ul_evk_init(MachineState *machine)
 
     s = FSL_IMX6UL(object_new(TYPE_FSL_IMX6UL));
     object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
-    object_property_set_uint(OBJECT(s), 2, "fec1-phy-num", &error_fatal);
-    object_property_set_uint(OBJECT(s), 1, "fec2-phy-num", &error_fatal);
+    object_property_set_uint(OBJECT(s), "fec1-phy-num", 2, &error_fatal);
+    object_property_set_uint(OBJECT(s), "fec2-phy-num", 1, &error_fatal);
     qdev_realize(DEVICE(s), NULL, &error_fatal);
 
     memory_region_add_subregion(get_system_memory(), FSL_IMX6UL_MMDC_ADDR,
hw/arm/microbit.c +2 -2
index 8fe42c9d6a..a91acab1cb 100644
@@ -40,8 +40,8 @@ static void microbit_init(MachineState *machine)
     object_initialize_child(OBJECT(machine), "nrf51", &s->nrf51,
                             TYPE_NRF51_SOC);
     qdev_prop_set_chr(DEVICE(&s->nrf51), "serial0", serial_hd(0));
-    object_property_set_link(OBJECT(&s->nrf51), OBJECT(system_memory),
-                             "memory", &error_fatal);
+    object_property_set_link(OBJECT(&s->nrf51), "memory",
+                             OBJECT(system_memory), &error_fatal);
     sysbus_realize(SYS_BUS_DEVICE(&s->nrf51), &error_fatal);
 
     /*
hw/arm/mps2-tz.c +15 -16
index a4fd5ddede..28d9e8bfac 100644
@@ -265,8 +265,8 @@ static MemoryRegion *make_mpc(MPS2TZMachineState *mms, void *opaque,
     memory_region_init_ram(ssram, NULL, name, ramsize[i], &error_fatal);
 
     object_initialize_child(OBJECT(mms), mpcname, mpc, TYPE_TZ_MPC);
-    object_property_set_link(OBJECT(mpc), OBJECT(ssram),
-                             "downstream", &error_fatal);
+    object_property_set_link(OBJECT(mpc), "downstream", OBJECT(ssram),
+                             &error_fatal);
     sysbus_realize(SYS_BUS_DEVICE(mpc), &error_fatal);
     /* Map the upstream end of the MPC into system memory */
     upstream = sysbus_mmio_get_region(SYS_BUS_DEVICE(mpc), 1);
@@ -308,10 +308,9 @@ static MemoryRegion *make_dma(MPS2TZMachineState *mms, void *opaque,
      */
     object_initialize_child(OBJECT(mms), mscname, msc, TYPE_TZ_MSC);
     msc_downstream = sysbus_mmio_get_region(SYS_BUS_DEVICE(&mms->iotkit), 0);
-    object_property_set_link(OBJECT(msc), OBJECT(msc_downstream),
-                             "downstream", &error_fatal);
-    object_property_set_link(OBJECT(msc), OBJECT(mms),
-                             "idau", &error_fatal);
+    object_property_set_link(OBJECT(msc), "downstream",
+                             OBJECT(msc_downstream), &error_fatal);
+    object_property_set_link(OBJECT(msc), "idau", OBJECT(mms), &error_fatal);
     sysbus_realize(SYS_BUS_DEVICE(msc), &error_fatal);
 
     qdev_connect_gpio_out_named(DEVICE(msc), "irq", 0,
@@ -330,8 +329,8 @@ static MemoryRegion *make_dma(MPS2TZMachineState *mms, void *opaque,
     msc_upstream = sysbus_mmio_get_region(SYS_BUS_DEVICE(msc), 0);
 
     object_initialize_child(OBJECT(mms), name, dma, TYPE_PL081);
-    object_property_set_link(OBJECT(dma), OBJECT(msc_upstream),
-                             "downstream", &error_fatal);
+    object_property_set_link(OBJECT(dma), "downstream", OBJECT(msc_upstream),
+                             &error_fatal);
     sysbus_realize(SYS_BUS_DEVICE(dma), &error_fatal);
 
     s = SYS_BUS_DEVICE(dma);
@@ -404,8 +403,8 @@ static void mps2tz_common_init(MachineState *machine)
     object_initialize_child(OBJECT(machine), TYPE_IOTKIT, &mms->iotkit,
                             mmc->armsse_type);
     iotkitdev = DEVICE(&mms->iotkit);
-    object_property_set_link(OBJECT(&mms->iotkit), OBJECT(system_memory),
-                             "memory", &error_abort);
+    object_property_set_link(OBJECT(&mms->iotkit), "memory",
+                             OBJECT(system_memory), &error_abort);
     qdev_prop_set_uint32(iotkitdev, "EXP_NUMIRQ", MPS2TZ_NUMIRQ);
     qdev_prop_set_uint32(iotkitdev, "MAINCLK", SYSCLK_FRQ);
     sysbus_realize(SYS_BUS_DEVICE(&mms->iotkit), &error_fatal);
@@ -425,7 +424,7 @@ static void mps2tz_common_init(MachineState *machine)
                                                NULL);
             g_free(name);
 
-            object_property_set_int(OBJECT(splitter), 2, "num-lines",
+            object_property_set_int(OBJECT(splitter), "num-lines", 2,
                                     &error_fatal);
             qdev_realize(DEVICE(splitter), NULL, &error_fatal);
             qdev_connect_gpio_out(DEVICE(splitter), 0,
@@ -442,9 +441,9 @@ static void mps2tz_common_init(MachineState *machine)
      */
     object_initialize_child(OBJECT(machine), "sec-resp-splitter",
                             &mms->sec_resp_splitter, TYPE_SPLIT_IRQ);
-    object_property_set_int(OBJECT(&mms->sec_resp_splitter),
+    object_property_set_int(OBJECT(&mms->sec_resp_splitter), "num-lines",
                             ARRAY_SIZE(mms->ppc) + ARRAY_SIZE(mms->msc),
-                            "num-lines", &error_fatal);
+                            &error_fatal);
     qdev_realize(DEVICE(&mms->sec_resp_splitter), NULL, &error_fatal);
     dev_splitter = DEVICE(&mms->sec_resp_splitter);
     qdev_connect_gpio_out_named(iotkitdev, "sec_resp_cfg", 0,
@@ -475,7 +474,7 @@ static void mps2tz_common_init(MachineState *machine)
      */
     object_initialize_child(OBJECT(mms), "uart-irq-orgate",
                             &mms->uart_irq_orgate, TYPE_OR_IRQ);
-    object_property_set_int(OBJECT(&mms->uart_irq_orgate), 10, "num-lines",
+    object_property_set_int(OBJECT(&mms->uart_irq_orgate), "num-lines", 10,
                             &error_fatal);
     qdev_realize(DEVICE(&mms->uart_irq_orgate), NULL, &error_fatal);
     qdev_connect_gpio_out(DEVICE(&mms->uart_irq_orgate), 0,
@@ -568,8 +567,8 @@ static void mps2tz_common_init(MachineState *machine)
 
             mr = pinfo->devfn(mms, pinfo->opaque, pinfo->name, pinfo->size);
             portname = g_strdup_printf("port[%d]", port);
-            object_property_set_link(OBJECT(ppc), OBJECT(mr),
-                                     portname, &error_fatal);
+            object_property_set_link(OBJECT(ppc), portname, OBJECT(mr),
+                                     &error_fatal);
             g_free(portname);
         }
 
hw/arm/mps2.c +6 -6
index d1653a7e6e..9f12934ca8 100644
@@ -203,8 +203,8 @@ static void mps2_common_init(MachineState *machine)
     }
     qdev_prop_set_string(armv7m, "cpu-type", machine->cpu_type);
     qdev_prop_set_bit(armv7m, "enable-bitband", true);
-    object_property_set_link(OBJECT(&mms->armv7m), OBJECT(system_memory),
-                             "memory", &error_abort);
+    object_property_set_link(OBJECT(&mms->armv7m), "memory",
+                             OBJECT(system_memory), &error_abort);
     sysbus_realize(SYS_BUS_DEVICE(&mms->armv7m), &error_fatal);
 
     create_unimplemented_device("zbtsmram mirror", 0x00400000, 0x00400000);
@@ -237,7 +237,7 @@ static void mps2_common_init(MachineState *machine)
         DeviceState *orgate_dev;
 
         orgate = object_new(TYPE_OR_IRQ);
-        object_property_set_int(orgate, 6, "num-lines", &error_fatal);
+        object_property_set_int(orgate, "num-lines", 6, &error_fatal);
         qdev_realize(DEVICE(orgate), NULL, &error_fatal);
         orgate_dev = DEVICE(orgate);
         qdev_connect_gpio_out(orgate_dev, 0, qdev_get_gpio_in(armv7m, 12));
@@ -273,7 +273,7 @@ static void mps2_common_init(MachineState *machine)
         DeviceState *orgate_dev;
 
         orgate = object_new(TYPE_OR_IRQ);
-        object_property_set_int(orgate, 10, "num-lines", &error_fatal);
+        object_property_set_int(orgate, "num-lines", 10, &error_fatal);
         qdev_realize(DEVICE(orgate), NULL, &error_fatal);
         orgate_dev = DEVICE(orgate);
         qdev_connect_gpio_out(orgate_dev, 0, qdev_get_gpio_in(armv7m, 12));
@@ -288,7 +288,7 @@ static void mps2_common_init(MachineState *machine)
             DeviceState *txrx_orgate_dev;
 
             txrx_orgate = object_new(TYPE_OR_IRQ);
-            object_property_set_int(txrx_orgate, 2, "num-lines", &error_fatal);
+            object_property_set_int(txrx_orgate, "num-lines", 2, &error_fatal);
             qdev_realize(DEVICE(txrx_orgate), NULL, &error_fatal);
             txrx_orgate_dev = DEVICE(txrx_orgate);
             qdev_connect_gpio_out(txrx_orgate_dev, 0,
@@ -356,7 +356,7 @@ static void mps2_common_init(MachineState *machine)
         int j;
 
         orgate = object_new(TYPE_OR_IRQ);
-        object_property_set_int(orgate, 2, "num-lines", &error_fatal);
+        object_property_set_int(orgate, "num-lines", 2, &error_fatal);
         orgate_dev = DEVICE(orgate);
         qdev_realize(orgate_dev, NULL, &error_fatal);
         qdev_connect_gpio_out(orgate_dev, 0,
hw/arm/msf2-soc.c +4 -4
index 476112b2d9..e6e4bb3153 100644
@@ -123,8 +123,8 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
     qdev_prop_set_uint32(armv7m, "num-irq", 81);
     qdev_prop_set_string(armv7m, "cpu-type", s->cpu_type);
     qdev_prop_set_bit(armv7m, "enable-bitband", true);
-    object_property_set_link(OBJECT(&s->armv7m), OBJECT(get_system_memory()),
-                                     "memory", &error_abort);
+    object_property_set_link(OBJECT(&s->armv7m), "memory",
+                             OBJECT(get_system_memory()), &error_abort);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), &err)) {
         error_propagate(errp, err);
         return;
@@ -193,8 +193,8 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
     }
 
     dev = DEVICE(&s->emac);
-    object_property_set_link(OBJECT(&s->emac), OBJECT(get_system_memory()),
-                             "ahb-bus", &error_abort);
+    object_property_set_link(OBJECT(&s->emac), "ahb-bus",
+                             OBJECT(get_system_memory()), &error_abort);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->emac), &err)) {
         error_propagate(errp, err);
         return;
hw/arm/musca.c +9 -9
index 34376328fc..4bc737f93b 100644
@@ -256,8 +256,8 @@ static MemoryRegion *make_mpc(MuscaMachineState *mms, void *opaque,
     }
 
     object_initialize_child(OBJECT(mms), mpcname, mpc, TYPE_TZ_MPC);
-    object_property_set_link(OBJECT(mpc), OBJECT(downstream),
-                             "downstream", &error_fatal);
+    object_property_set_link(OBJECT(mpc), "downstream", OBJECT(downstream),
+                             &error_fatal);
     sysbus_realize(SYS_BUS_DEVICE(mpc), &error_fatal);
     /* Map the upstream end of the MPC into system memory */
     upstream = sysbus_mmio_get_region(SYS_BUS_DEVICE(mpc), 1);
@@ -374,8 +374,8 @@ static void musca_init(MachineState *machine)
     object_initialize_child(OBJECT(machine), "sse-200", &mms->sse,
                             TYPE_SSE200);
     ssedev = DEVICE(&mms->sse);
-    object_property_set_link(OBJECT(&mms->sse), OBJECT(system_memory),
-                             "memory", &error_fatal);
+    object_property_set_link(OBJECT(&mms->sse), "memory",
+                             OBJECT(system_memory), &error_fatal);
     qdev_prop_set_uint32(ssedev, "EXP_NUMIRQ", mmc->num_irqs);
     qdev_prop_set_uint32(ssedev, "init-svtor", mmc->init_svtor);
     qdev_prop_set_uint32(ssedev, "SRAM_ADDR_WIDTH", mmc->sram_addr_width);
@@ -403,7 +403,7 @@ static void musca_init(MachineState *machine)
                                            &error_fatal, NULL);
         g_free(name);
 
-        object_property_set_int(OBJECT(splitter), 2, "num-lines",
+        object_property_set_int(OBJECT(splitter), "num-lines", 2,
                                 &error_fatal);
         qdev_realize(DEVICE(splitter), NULL, &error_fatal);
         qdev_connect_gpio_out(DEVICE(splitter), 0,
@@ -422,8 +422,8 @@ static void musca_init(MachineState *machine)
                                        sizeof(mms->sec_resp_splitter),
                                        TYPE_SPLIT_IRQ, &error_fatal, NULL);
 
-    object_property_set_int(OBJECT(&mms->sec_resp_splitter),
-                            ARRAY_SIZE(mms->ppc), "num-lines", &error_fatal);
+    object_property_set_int(OBJECT(&mms->sec_resp_splitter), "num-lines",
+                            ARRAY_SIZE(mms->ppc), &error_fatal);
     qdev_realize(DEVICE(&mms->sec_resp_splitter), NULL, &error_fatal);
     dev_splitter = DEVICE(&mms->sec_resp_splitter);
     qdev_connect_gpio_out_named(ssedev, "sec_resp_cfg", 0,
@@ -541,8 +541,8 @@ static void musca_init(MachineState *machine)
 
             mr = pinfo->devfn(mms, pinfo->opaque, pinfo->name, pinfo->size);
             portname = g_strdup_printf("port[%d]", port);
-            object_property_set_link(OBJECT(ppc), OBJECT(mr),
-                                     portname, &error_fatal);
+            object_property_set_link(OBJECT(ppc), portname, OBJECT(mr),
+                                     &error_fatal);
             g_free(portname);
         }
 
hw/arm/musicpal.c +2 -2
index 394a3345bd..ff9a7c8cc6 100644
@@ -1690,8 +1690,8 @@ static void musicpal_init(MachineState *machine)
     wm8750_dev = i2c_create_slave(i2c, TYPE_WM8750, MP_WM_ADDR);
     dev = qdev_new(TYPE_MV88W8618_AUDIO);
     s = SYS_BUS_DEVICE(dev);
-    object_property_set_link(OBJECT(dev), OBJECT(wm8750_dev),
-                             "wm8750", NULL);
+    object_property_set_link(OBJECT(dev), "wm8750", OBJECT(wm8750_dev),
+                             NULL);
     sysbus_realize_and_unref(s, &error_fatal);
     sysbus_mmio_map(s, 0, MP_AUDIO_BASE);
     sysbus_connect_irq(s, 0, pic[MP_AUDIO_IRQ]);
hw/arm/nrf51_soc.c +3 -3
index e9c77e4c21..c440cd11e9 100644
@@ -65,7 +65,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
         return;
     }
 
-    object_property_set_link(OBJECT(&s->cpu), OBJECT(&s->container), "memory",
+    object_property_set_link(OBJECT(&s->cpu), "memory", OBJECT(&s->container),
                              &error_abort);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpu), &err)) {
         error_propagate(errp, err);
@@ -106,7 +106,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
                        BASE_TO_IRQ(NRF51_RNG_BASE)));
 
     /* UICR, FICR, NVMC, FLASH */
-    object_property_set_uint(OBJECT(&s->nvm), s->flash_size, "flash-size",
+    object_property_set_uint(OBJECT(&s->nvm), "flash-size", s->flash_size,
                              &err);
     if (err) {
         error_propagate(errp, err);
@@ -141,7 +141,7 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Error **errp)
 
     /* TIMER */
     for (i = 0; i < NRF51_NUM_TIMERS; i++) {
-        object_property_set_uint(OBJECT(&s->timer[i]), i, "id", &err);
+        object_property_set_uint(OBJECT(&s->timer[i]), "id", i, &err);
         if (err) {
             error_propagate(errp, err);
             return;
hw/arm/orangepi.c +6 -7
index 843dcbbd62..1679468232 100644
@@ -63,9 +63,8 @@ static void orangepi_init(MachineState *machine)
     object_unref(OBJECT(h3));
 
     /* Setup timer properties */
-    object_property_set_int(OBJECT(h3), 32768, "clk0-freq",
-                            &error_abort);
-    object_property_set_int(OBJECT(h3), 24 * 1000 * 1000, "clk1-freq",
+    object_property_set_int(OBJECT(h3), "clk0-freq", 32768, &error_abort);
+    object_property_set_int(OBJECT(h3), "clk1-freq", 24 * 1000 * 1000,
                             &error_abort);
 
     /* Setup SID properties. Currently using a default fixed SID identifier. */
@@ -77,12 +76,12 @@ static void orangepi_init(MachineState *machine)
     }
 
     /* Setup EMAC properties */
-    object_property_set_int(OBJECT(&h3->emac), 1, "phy-addr", &error_abort);
+    object_property_set_int(OBJECT(&h3->emac), "phy-addr", 1, &error_abort);
 
     /* DRAMC */
-    object_property_set_uint(OBJECT(h3), h3->memmap[AW_H3_SDRAM],
-                             "ram-addr", &error_abort);
-    object_property_set_int(OBJECT(h3), machine->ram_size / MiB, "ram-size",
+    object_property_set_uint(OBJECT(h3), "ram-addr", h3->memmap[AW_H3_SDRAM],
+                             &error_abort);
+    object_property_set_int(OBJECT(h3), "ram-size", machine->ram_size / MiB,
                             &error_abort);
 
     /* Mark H3 object realized */
hw/arm/raspi.c +1 -1
index 09bf02ec9c..b2d6c9688f 100644
@@ -285,7 +285,7 @@ static void raspi_machine_init(MachineState *machine)
     object_initialize_child(OBJECT(machine), "soc", &s->soc,
                             board_soc_type(board_rev));
     object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(machine->ram));
-    object_property_set_int(OBJECT(&s->soc), board_rev, "board-rev",
+    object_property_set_int(OBJECT(&s->soc), "board-rev", board_rev,
                             &error_abort);
     qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
 
hw/arm/realview.c +3 -3
index b6c0a1adb9..22e132058e 100644
@@ -107,11 +107,11 @@ static void realview_init(MachineState *machine,
          * before realization.
          */
         if (object_property_find(cpuobj, "has_el3", NULL)) {
-            object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
+            object_property_set_bool(cpuobj, "has_el3", false, &error_fatal);
         }
 
         if (is_pb && is_mpcore) {
-            object_property_set_int(cpuobj, periphbase, "reset-cbar",
+            object_property_set_int(cpuobj, "reset-cbar", periphbase,
                                     &error_fatal);
         }
 
@@ -205,7 +205,7 @@ static void realview_init(MachineState *machine,
 
     /* DMA controller is optional, apparently.  */
     dev = qdev_new("pl081");
-    object_property_set_link(OBJECT(dev), OBJECT(sysmem), "downstream",
+    object_property_set_link(OBJECT(dev), "downstream", OBJECT(sysmem),
                              &error_fatal);
     busdev = SYS_BUS_DEVICE(dev);
     sysbus_realize_and_unref(busdev, &error_fatal);
hw/arm/sbsa-ref.c +8 -8
index e40c868a82..f030a416fd 100644
@@ -499,7 +499,7 @@ static void create_smmu(const SBSAMachineState *sms, PCIBus *bus)
 
     dev = qdev_new("arm-smmuv3");
 
-    object_property_set_link(OBJECT(dev), OBJECT(bus), "primary-bus",
+    object_property_set_link(OBJECT(dev), "primary-bus", OBJECT(bus),
                              &error_abort);
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
     sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
@@ -659,8 +659,8 @@ static void sbsa_ref_init(MachineState *machine)
         }
 
         cpuobj = object_new(possible_cpus->cpus[n].type);
-        object_property_set_int(cpuobj, possible_cpus->cpus[n].arch_id,
-                                "mp-affinity", NULL);
+        object_property_set_int(cpuobj, "mp-affinity",
+                                possible_cpus->cpus[n].arch_id, NULL);
 
         cs = CPU(cpuobj);
         cs->cpu_index = n;
@@ -669,16 +669,16 @@ static void sbsa_ref_init(MachineState *machine)
                           &error_fatal);
 
         if (object_property_find(cpuobj, "reset-cbar", NULL)) {
-            object_property_set_int(cpuobj,
+            object_property_set_int(cpuobj, "reset-cbar",
                                     sbsa_ref_memmap[SBSA_CPUPERIPHS].base,
-                                    "reset-cbar", &error_abort);
+                                    &error_abort);
         }
 
-        object_property_set_link(cpuobj, OBJECT(sysmem), "memory",
+        object_property_set_link(cpuobj, "memory", OBJECT(sysmem),
                                  &error_abort);
 
-        object_property_set_link(cpuobj, OBJECT(secure_sysmem),
-                                 "secure-memory", &error_abort);
+        object_property_set_link(cpuobj, "secure-memory",
+                                 OBJECT(secure_sysmem), &error_abort);
 
         qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
         object_unref(cpuobj);
hw/arm/stellaris.c +2 -2
index 97ef566c12..7156fb3ece 100644
@@ -1312,8 +1312,8 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board)
     qdev_prop_set_uint32(nvic, "num-irq", NUM_IRQ_LINES);
     qdev_prop_set_string(nvic, "cpu-type", ms->cpu_type);
     qdev_prop_set_bit(nvic, "enable-bitband", true);
-    object_property_set_link(OBJECT(nvic), OBJECT(get_system_memory()),
-                                     "memory", &error_abort);
+    object_property_set_link(OBJECT(nvic), "memory",
+                             OBJECT(get_system_memory()), &error_abort);
     /* This will exit with an error if the user passed us a bad cpu_type */
     sysbus_realize_and_unref(SYS_BUS_DEVICE(nvic), &error_fatal);
 
hw/arm/stm32f205_soc.c +4 -4
index 46b5332470..9acf401fbf 100644
@@ -105,8 +105,8 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
     qdev_prop_set_uint32(armv7m, "num-irq", 96);
     qdev_prop_set_string(armv7m, "cpu-type", s->cpu_type);
     qdev_prop_set_bit(armv7m, "enable-bitband", true);
-    object_property_set_link(OBJECT(&s->armv7m), OBJECT(get_system_memory()),
-                                     "memory", &error_abort);
+    object_property_set_link(OBJECT(&s->armv7m), "memory",
+                             OBJECT(get_system_memory()), &error_abort);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), &err)) {
         error_propagate(errp, err);
         return;
@@ -149,8 +149,8 @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
     }
 
     /* ADC 1 to 3 */
-    object_property_set_int(OBJECT(s->adc_irqs), STM_NUM_ADCS,
-                            "num-lines", &error_abort);
+    object_property_set_int(OBJECT(s->adc_irqs), "num-lines", STM_NUM_ADCS,
+                            &error_abort);
     if (!qdev_realize(DEVICE(s->adc_irqs), NULL, &err)) {
         error_propagate(errp, err);
         return;
hw/arm/stm32f405_soc.c +4 -4
index f1f0dc40b1..07ce323a64 100644
@@ -116,8 +116,8 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp)
     qdev_prop_set_uint32(armv7m, "num-irq", 96);
     qdev_prop_set_string(armv7m, "cpu-type", s->cpu_type);
     qdev_prop_set_bit(armv7m, "enable-bitband", true);
-    object_property_set_link(OBJECT(&s->armv7m), OBJECT(system_memory),
-                                     "memory", &error_abort);
+    object_property_set_link(OBJECT(&s->armv7m), "memory",
+                             OBJECT(system_memory), &error_abort);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->armv7m), &err)) {
         error_propagate(errp, err);
         return;
@@ -167,8 +167,8 @@ static void stm32f405_soc_realize(DeviceState *dev_soc, Error **errp)
         error_propagate(errp, err);
         return;
     }
-    object_property_set_int(OBJECT(&s->adc_irqs), STM_NUM_ADCS,
-                            "num-lines", &error_abort);
+    object_property_set_int(OBJECT(&s->adc_irqs), "num-lines", STM_NUM_ADCS,
+                            &error_abort);
     if (!qdev_realize(DEVICE(&s->adc_irqs), NULL, &err)) {
         error_propagate(errp, err);
         return;
hw/arm/versatilepb.c +2 -2
index e596b8170f..d09ea24ae2 100644
@@ -213,7 +213,7 @@ static void versatile_init(MachineState *machine, int board_id)
      * realization.
      */
     if (object_property_find(cpuobj, "has_el3", NULL)) {
-        object_property_set_bool(cpuobj, false, "has_el3", &error_fatal);
+        object_property_set_bool(cpuobj, "has_el3", false, &error_fatal);
     }
 
     qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
@@ -288,7 +288,7 @@ static void versatile_init(MachineState *machine, int board_id)
     pl011_create(0x10009000, sic[6], serial_hd(3));
 
     dev = qdev_new("pl080");
-    object_property_set_link(OBJECT(dev), OBJECT(sysmem), "downstream",
+    object_property_set_link(OBJECT(dev), "downstream", OBJECT(sysmem),
                              &error_fatal);
     busdev = SYS_BUS_DEVICE(dev);
     sysbus_realize_and_unref(busdev, &error_fatal);
hw/arm/vexpress.c +4 -4
index 5bf9cff8a8..762b068e90 100644
@@ -218,17 +218,17 @@ static void init_cpus(MachineState *ms, const char *cpu_type,
         Object *cpuobj = object_new(cpu_type);
 
         if (!secure) {
-            object_property_set_bool(cpuobj, false, "has_el3", NULL);
+            object_property_set_bool(cpuobj, "has_el3", false, NULL);
         }
         if (!virt) {
             if (object_property_find(cpuobj, "has_el2", NULL)) {
-                object_property_set_bool(cpuobj, false, "has_el2", NULL);
+                object_property_set_bool(cpuobj, "has_el2", false, NULL);
             }
         }
 
         if (object_property_find(cpuobj, "reset-cbar", NULL)) {
-            object_property_set_int(cpuobj, periphbase,
-                                    "reset-cbar", &error_abort);
+            object_property_set_int(cpuobj, "reset-cbar", periphbase,
+                                    &error_abort);
         }
         qdev_realize(DEVICE(cpuobj), NULL, &error_fatal);
     }
hw/arm/virt.c +23 -21

99 lines not on this page · raw message

hw/arm/xilinx_zynq.c +3 -3
index ed970273f3..32aa7323d9 100644
@@ -196,12 +196,12 @@ static void zynq_init(MachineState *machine)
      * realization.
      */
     if (object_property_find(OBJECT(cpu), "has_el3", NULL)) {
-        object_property_set_bool(OBJECT(cpu), false, "has_el3", &error_fatal);
+        object_property_set_bool(OBJECT(cpu), "has_el3", false, &error_fatal);
     }
 
-    object_property_set_int(OBJECT(cpu), ZYNQ_BOARD_MIDR, "midr",
+    object_property_set_int(OBJECT(cpu), "midr", ZYNQ_BOARD_MIDR,
                             &error_fatal);
-    object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar",
+    object_property_set_int(OBJECT(cpu), "reset-cbar", MPCORE_PERIPHBASE,
                             &error_fatal);
     qdev_realize(DEVICE(cpu), NULL, &error_fatal);
 
hw/arm/xlnx-versal-virt.c +4 -4
index a3b1ce9c7c..4b3152ee77 100644
@@ -502,10 +502,10 @@ static void versal_virt_init(MachineState *machine)
 
     object_initialize_child(OBJECT(machine), "xlnx-versal", &s->soc,
                             TYPE_XLNX_VERSAL);
-    object_property_set_link(OBJECT(&s->soc), OBJECT(machine->ram),
-                             "ddr", &error_abort);
-    object_property_set_int(OBJECT(&s->soc), psci_conduit,
-                            "psci-conduit", &error_abort);
+    object_property_set_link(OBJECT(&s->soc), "ddr", OBJECT(machine->ram),
+                             &error_abort);
+    object_property_set_int(OBJECT(&s->soc), "psci-conduit", psci_conduit,
+                            &error_abort);
     sysbus_realize(SYS_BUS_DEVICE(&s->soc), &error_fatal);
 
     fdt_create(s);
hw/arm/xlnx-versal.c +14 -16
index fed9d07ca2..ead038b971 100644
@@ -35,17 +35,17 @@ static void versal_create_apu_cpus(Versal *s)
         object_initialize_child(OBJECT(s), "apu-cpu[*]", &s->fpd.apu.cpu[i],
                                 XLNX_VERSAL_ACPU_TYPE);
         obj = OBJECT(&s->fpd.apu.cpu[i]);
-        object_property_set_int(obj, s->cfg.psci_conduit,
-                                "psci-conduit", &error_abort);
+        object_property_set_int(obj, "psci-conduit", s->cfg.psci_conduit,
+                                &error_abort);
         if (i) {
             /* Secondary CPUs start in PSCI powered-down state */
-            object_property_set_bool(obj, true,
-                                     "start-powered-off", &error_abort);
+            object_property_set_bool(obj, "start-powered-off", true,
+                                     &error_abort);
         }
 
-        object_property_set_int(obj, ARRAY_SIZE(s->fpd.apu.cpu),
-                                "core-count", &error_abort);
-        object_property_set_link(obj, OBJECT(&s->fpd.apu.mr), "memory",
+        object_property_set_int(obj, "core-count", ARRAY_SIZE(s->fpd.apu.cpu),
+                                &error_abort);
+        object_property_set_link(obj, "memory", OBJECT(&s->fpd.apu.mr),
                                  &error_abort);
         qdev_realize(DEVICE(obj), NULL, &error_fatal);
     }
@@ -164,11 +164,9 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
             qemu_check_nic_model(nd, "cadence_gem");
             qdev_set_nic_properties(dev, nd);
         }
-        object_property_set_int(OBJECT(dev),
-                                2, "num-priority-queues",
+        object_property_set_int(OBJECT(dev), "num-priority-queues", 2,
                                 &error_abort);
-        object_property_set_link(OBJECT(dev),
-                                 OBJECT(&s->mr_ps), "dma",
+        object_property_set_link(OBJECT(dev), "dma", OBJECT(&s->mr_ps),
                                  &error_abort);
         sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
 
@@ -192,7 +190,7 @@ static void versal_create_admas(Versal *s, qemu_irq *pic)
         object_initialize_child(OBJECT(s), name, &s->lpd.iou.adma[i],
                                 TYPE_XLNX_ZDMA);
         dev = DEVICE(&s->lpd.iou.adma[i]);
-        object_property_set_int(OBJECT(dev), 128, "bus-width", &error_abort);
+        object_property_set_int(OBJECT(dev), "bus-width", 128, &error_abort);
         sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
 
         mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
@@ -217,11 +215,11 @@ static void versal_create_sds(Versal *s, qemu_irq *pic)
                                 TYPE_SYSBUS_SDHCI);
         dev = DEVICE(&s->pmc.iou.sd[i]);
 
-        object_property_set_uint(OBJECT(dev),
-                                 3, "sd-spec-version", &error_fatal);
-        object_property_set_uint(OBJECT(dev), SDHCI_CAPABILITIES, "capareg",
+        object_property_set_uint(OBJECT(dev), "sd-spec-version", 3,
                                  &error_fatal);
-        object_property_set_uint(OBJECT(dev), UHS_I, "uhs", &error_fatal);
+        object_property_set_uint(OBJECT(dev), "capareg", SDHCI_CAPABILITIES,
+                                 &error_fatal);
+        object_property_set_uint(OBJECT(dev), "uhs", UHS_I, &error_fatal);
         sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
 
         mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
hw/arm/xlnx-zcu102.c +4 -4
index 77449759c6..5997262459 100644
@@ -118,11 +118,11 @@ static void xlnx_zcu102_init(MachineState *machine)
 
     object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_XLNX_ZYNQMP);
 
-    object_property_set_link(OBJECT(&s->soc), OBJECT(machine->ram),
-                         "ddr-ram", &error_abort);
-    object_property_set_bool(OBJECT(&s->soc), s->secure, "secure",
+    object_property_set_link(OBJECT(&s->soc), "ddr-ram", OBJECT(machine->ram),
+                             &error_abort);
+    object_property_set_bool(OBJECT(&s->soc), "secure", s->secure,
                              &error_fatal);
-    object_property_set_bool(OBJECT(&s->soc), s->virt, "virtualization",
+    object_property_set_bool(OBJECT(&s->soc), "virtualization", s->virt,
                              &error_fatal);
 
     qdev_realize(DEVICE(&s->soc), NULL, &error_fatal);
hw/arm/xlnx-zynqmp.c +23 -23

111 lines not on this page · raw message

hw/block/xen-block.c +4 -5
index 48890536a4..0e6e6df5fa 100644
@@ -935,21 +935,20 @@ static void xen_block_device_create(XenBackendInstance *backend,
     xendev = XEN_DEVICE(qdev_new(type));
     blockdev = XEN_BLOCK_DEVICE(xendev);
 
-    object_property_set_str(OBJECT(xendev), vdev, "vdev", &local_err);
+    object_property_set_str(OBJECT(xendev), "vdev", vdev, &local_err);
     if (local_err) {
         error_propagate_prepend(errp, local_err, "failed to set 'vdev': ");
         goto fail;
     }
 
-    object_property_set_str(OBJECT(xendev),
-                            xen_block_drive_get_node_name(drive), "drive",
-                            &local_err);
+    object_property_set_str(OBJECT(xendev), "drive",
+                            xen_block_drive_get_node_name(drive), &local_err);
     if (local_err) {
         error_propagate_prepend(errp, local_err, "failed to set 'drive': ");
         goto fail;
     }
 
-    object_property_set_str(OBJECT(xendev), iothread->id, "iothread",
+    object_property_set_str(OBJECT(xendev), "iothread", iothread->id,
                             &local_err);
     if (local_err) {
         error_propagate_prepend(errp, local_err,
hw/core/bus.c +4 -4
index 544dd8a6fa..00d1d31762 100644
@@ -25,8 +25,8 @@
 
 void qbus_set_hotplug_handler(BusState *bus, Object *handler)
 {
-    object_property_set_link(OBJECT(bus), handler,
-                             QDEV_HOTPLUG_HANDLER_PROPERTY, &error_abort);
+    object_property_set_link(OBJECT(bus), QDEV_HOTPLUG_HANDLER_PROPERTY,
+                             handler, &error_abort);
 }
 
 void qbus_set_bus_hotplug_handler(BusState *bus)
@@ -168,14 +168,14 @@ bool qbus_realize(BusState *bus, Error **errp)
 {
     Error *err = NULL;
 
-    object_property_set_bool(OBJECT(bus), true, "realized", &err);
+    object_property_set_bool(OBJECT(bus), "realized", true, &err);
     error_propagate(errp, err);
     return !err;
 }
 
 void qbus_unrealize(BusState *bus)
 {
-    object_property_set_bool(OBJECT(bus), false, "realized", &error_abort);
+    object_property_set_bool(OBJECT(bus), "realized", false, &error_abort);
 }
 
 static bool bus_get_realized(Object *obj, Error **errp)
hw/core/numa.c +2 -2
index 6a20ce7cf1..de9a2f7e32 100644
@@ -810,8 +810,8 @@ void numa_cpu_pre_plug(const CPUArchId *slot, DeviceState *dev, Error **errp)
         /* due to bug in libvirt, it doesn't pass node-id from props on
          * device_add as expected, so we have to fix it up here */
         if (slot->props.has_node_id) {
-            object_property_set_int(OBJECT(dev), slot->props.node_id,
-                                    "node-id", errp);
+            object_property_set_int(OBJECT(dev), "node-id",
+                                    slot->props.node_id, errp);
         }
     } else if (node_id != slot->props.node_id) {
         error_setg(errp, "invalid node-id, must be %"PRId64,
hw/core/qdev-properties-system.c +5 -5
index 383a54578f..810831b1df 100644
@@ -436,7 +436,7 @@ void qdev_prop_set_drive_err(DeviceState *dev, const char *name,
         }
     }
 
-    object_property_set_str(OBJECT(dev), ref, name, errp);
+    object_property_set_str(OBJECT(dev), name, ref, errp);
 }
 
 void qdev_prop_set_drive(DeviceState *dev, const char *name,
@@ -449,16 +449,16 @@ void qdev_prop_set_chr(DeviceState *dev, const char *name,
                        Chardev *value)
 {
     assert(!value || value->label);
-    object_property_set_str(OBJECT(dev),
-                            value ? value->label : "", name, &error_abort);
+    object_property_set_str(OBJECT(dev), name, value ? value->label : "",
+                            &error_abort);
 }
 
 void qdev_prop_set_netdev(DeviceState *dev, const char *name,
                           NetClientState *value)
 {
     assert(!value || value->name);
-    object_property_set_str(OBJECT(dev),
-                            value ? value->name : "", name, &error_abort);
+    object_property_set_str(OBJECT(dev), name, value ? value->name : "",
+                            &error_abort);
 }
 
 void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd)
hw/core/qdev-properties.c +10 -10
index 4c7a8a05a5..be8d4eb9f6 100644
@@ -1256,37 +1256,37 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev,
 
 void qdev_prop_set_bit(DeviceState *dev, const char *name, bool value)
 {
-    object_property_set_bool(OBJECT(dev), value, name, &error_abort);
+    object_property_set_bool(OBJECT(dev), name, value, &error_abort);
 }
 
 void qdev_prop_set_uint8(DeviceState *dev, const char *name, uint8_t value)
 {
-    object_property_set_int(OBJECT(dev), value, name, &error_abort);
+    object_property_set_int(OBJECT(dev), name, value, &error_abort);
 }
 
 void qdev_prop_set_uint16(DeviceState *dev, const char *name, uint16_t value)
 {
-    object_property_set_int(OBJECT(dev), value, name, &error_abort);
+    object_property_set_int(OBJECT(dev), name, value, &error_abort);
 }
 
 void qdev_prop_set_uint32(DeviceState *dev, const char *name, uint32_t value)
 {
-    object_property_set_int(OBJECT(dev), value, name, &error_abort);
+    object_property_set_int(OBJECT(dev), name, value, &error_abort);
 }
 
 void qdev_prop_set_int32(DeviceState *dev, const char *name, int32_t value)
 {
-    object_property_set_int(OBJECT(dev), value, name, &error_abort);
+    object_property_set_int(OBJECT(dev), name, value, &error_abort);
 }
 
 void qdev_prop_set_uint64(DeviceState *dev, const char *name, uint64_t value)
 {
-    object_property_set_int(OBJECT(dev), value, name, &error_abort);
+    object_property_set_int(OBJECT(dev), name, value, &error_abort);
 }
 
 void qdev_prop_set_string(DeviceState *dev, const char *name, const char *value)
 {
-    object_property_set_str(OBJECT(dev), value, name, &error_abort);
+    object_property_set_str(OBJECT(dev), name, value, &error_abort);
 }
 
 void qdev_prop_set_macaddr(DeviceState *dev, const char *name,
@@ -1296,7 +1296,7 @@ void qdev_prop_set_macaddr(DeviceState *dev, const char *name,
     snprintf(str, sizeof(str), "%02x:%02x:%02x:%02x:%02x:%02x",
              value[0], value[1], value[2], value[3], value[4], value[5]);
 
-    object_property_set_str(OBJECT(dev), str, name, &error_abort);
+    object_property_set_str(OBJECT(dev), name, str, &error_abort);
 }
 
 void qdev_prop_set_enum(DeviceState *dev, const char *name, int value)
@@ -1304,9 +1304,9 @@ void qdev_prop_set_enum(DeviceState *dev, const char *name, int value)
     Property *prop;
 
     prop = qdev_prop_find(dev, name);
-    object_property_set_str(OBJECT(dev),
+    object_property_set_str(OBJECT(dev), name,
                             qapi_enum_lookup(prop->info->enum_table, value),
-                            name, &error_abort);
+                            &error_abort);
 }
 
 static GPtrArray *global_props(void)
hw/core/qdev.c +4 -4
index 9de16eae05..56daa7b456 100644
@@ -398,7 +398,7 @@ bool qdev_realize(DeviceState *dev, BusState *bus, Error **errp)
         assert(!DEVICE_GET_CLASS(dev)->bus_type);
     }
 
-    object_property_set_bool(OBJECT(dev), true, "realized", &err);
+    object_property_set_bool(OBJECT(dev), "realized", true, &err);
     if (err) {
         error_propagate(errp, err);
     }
@@ -426,7 +426,7 @@ bool qdev_realize_and_unref(DeviceState *dev, BusState *bus, Error **errp)
 
 void qdev_unrealize(DeviceState *dev)
 {
-    object_property_set_bool(OBJECT(dev), false, "realized", &error_abort);
+    object_property_set_bool(OBJECT(dev), "realized", false, &error_abort);
 }
 
 static int qdev_assert_realized_properly(Object *obj, void *opaque)
@@ -567,7 +567,7 @@ void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n,
                                                 "/unattached"),
                                   "non-qdev-gpio[*]", OBJECT(pin));
     }
-    object_property_set_link(OBJECT(dev), OBJECT(pin), propname, &error_abort);
+    object_property_set_link(OBJECT(dev), propname, OBJECT(pin), &error_abort);
     g_free(propname);
 }
 
@@ -593,7 +593,7 @@ static qemu_irq qdev_disconnect_gpio_out_named(DeviceState *dev,
     qemu_irq ret = (qemu_irq)object_property_get_link(OBJECT(dev), propname,
                                                       NULL);
     if (ret) {
-        object_property_set_link(OBJECT(dev), NULL, propname, NULL);
+        object_property_set_link(OBJECT(dev), propname, NULL, NULL);
     }
     g_free(propname);
     return ret;
hw/display/virtio-gpu-pci.c +2 -3
index 357fefa3c0..d5b7d39bc4 100644
@@ -40,9 +40,8 @@ static void virtio_gpu_pci_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     }
 
     for (i = 0; i < g->conf.max_outputs; i++) {
-        object_property_set_link(OBJECT(g->scanout[i].con),
-                                 OBJECT(vpci_dev),
-                                 "device", &error_abort);
+        object_property_set_link(OBJECT(g->scanout[i].con), "device",
+                                 OBJECT(vpci_dev), &error_abort);
     }
 }
 
hw/display/virtio-vga.c +2 -3
index 0fc00fee1f..d5cebf686f 100644
@@ -151,9 +151,8 @@ static void virtio_vga_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     graphic_console_set_hwops(vga->con, &virtio_vga_base_ops, vvga);
 
     for (i = 0; i < g->conf.max_outputs; i++) {
-        object_property_set_link(OBJECT(g->scanout[i].con),
-                                 OBJECT(vpci_dev),
-                                 "device", &error_abort);
+        object_property_set_link(OBJECT(g->scanout[i].con), "device",
+                                 OBJECT(vpci_dev), &error_abort);
     }
 }
 
hw/dma/sparc32_dma.c +3 -3
index 2d7dbbb92d..9459178866 100644
@@ -346,7 +346,7 @@ static void sparc32_ledma_device_realize(DeviceState *dev, Error **errp)
     d = qdev_new(TYPE_LANCE);
     object_property_add_child(OBJECT(dev), "lance", OBJECT(d));
     qdev_set_nic_properties(d, nd);
-    object_property_set_link(OBJECT(d), OBJECT(dev), "dma", &error_abort);
+    object_property_set_link(OBJECT(d), "dma", OBJECT(dev), &error_abort);
     sysbus_realize_and_unref(SYS_BUS_DEVICE(d), &error_fatal);
 }
 
@@ -379,7 +379,7 @@ static void sparc32_dma_realize(DeviceState *dev, Error **errp)
     }
 
     espdma = qdev_new(TYPE_SPARC32_ESPDMA_DEVICE);
-    object_property_set_link(OBJECT(espdma), iommu, "iommu", &error_abort);
+    object_property_set_link(OBJECT(espdma), "iommu", iommu, &error_abort);
     object_property_add_child(OBJECT(s), "espdma", OBJECT(espdma));
     sysbus_realize_and_unref(SYS_BUS_DEVICE(espdma), &error_fatal);
 
@@ -394,7 +394,7 @@ static void sparc32_dma_realize(DeviceState *dev, Error **errp)
                                 sysbus_mmio_get_region(sbd, 0));
 
     ledma = qdev_new(TYPE_SPARC32_LEDMA_DEVICE);
-    object_property_set_link(OBJECT(ledma), iommu, "iommu", &error_abort);
+    object_property_set_link(OBJECT(ledma), "iommu", iommu, &error_abort);
     object_property_add_child(OBJECT(s), "ledma", OBJECT(ledma));
     sysbus_realize_and_unref(SYS_BUS_DEVICE(ledma), &error_fatal);
 
hw/dma/xilinx_axidma.c +2 -2
index a069637bf2..a4812e480a 100644
@@ -547,8 +547,8 @@ static void xilinx_axidma_realize(DeviceState *dev, Error **errp)
                              (Object **)&cs->dma,
                              object_property_allow_set_link,
                              OBJ_PROP_LINK_STRONG);
-    object_property_set_link(OBJECT(ds), OBJECT(s), "dma", &error_abort);
-    object_property_set_link(OBJECT(cs), OBJECT(s), "dma", &error_abort);
+    object_property_set_link(OBJECT(ds), "dma", OBJECT(s), &error_abort);
+    object_property_set_link(OBJECT(cs), "dma", OBJECT(s), &error_abort);
 
     for (i = 0; i < 2; i++) {
         struct Stream *st = &s->streams[i];
hw/i386/pc.c +4 -4
index cb15261420..3e933b65b9 100644
@@ -640,8 +640,8 @@ void pc_cmos_init(PCMachineState *pcms,
                              (Object **)&x86ms->rtc,
                              object_property_allow_set_link,
                              OBJ_PROP_LINK_STRONG);
-    object_property_set_link(OBJECT(pcms), OBJECT(s),
-                             "rtc_state", &error_abort);
+    object_property_set_link(OBJECT(pcms), "rtc_state", OBJECT(s),
+                             &error_abort);
 
     set_boot_dev(s, MACHINE(pcms)->boot_order, &error_fatal);
 
@@ -1143,8 +1143,8 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, bool no_vmport)
         vmmouse = NULL;
     }
     if (vmmouse) {
-        object_property_set_link(OBJECT(vmmouse), OBJECT(i8042),
-                                 "i8042", &error_abort);
+        object_property_set_link(OBJECT(vmmouse), "i8042", OBJECT(i8042),
+                                 &error_abort);
         isa_realize_and_unref(vmmouse, isa_bus, &error_fatal);
     }
     port92 = isa_create_simple(isa_bus, TYPE_PORT92);
hw/i386/pc_piix.c +2 -2
index 2bb42a8141..ae0dc9247b 100644
@@ -293,8 +293,8 @@ static void pc_init1(MachineState *machine,
                                  (Object **)&pcms->acpi_dev,
                                  object_property_allow_set_link,
                                  OBJ_PROP_LINK_STRONG);
-        object_property_set_link(OBJECT(machine), OBJECT(piix4_pm),
-                                 PC_MACHINE_ACPI_DEVICE_PROP, &error_abort);
+        object_property_set_link(OBJECT(machine), PC_MACHINE_ACPI_DEVICE_PROP,
+                                 OBJECT(piix4_pm), &error_abort);
     }
 
     if (machine->nvdimms_state->is_enabled) {
hw/i386/pc_q35.c +14 -14
index 33163ed18d..a3e607a544 100644
@@ -217,18 +217,18 @@ static void pc_q35_init(MachineState *machine)
     q35_host = Q35_HOST_DEVICE(qdev_new(TYPE_Q35_HOST_DEVICE));
 
     object_property_add_child(qdev_get_machine(), "q35", OBJECT(q35_host));
-    object_property_set_link(OBJECT(q35_host), OBJECT(ram_memory),
-                             MCH_HOST_PROP_RAM_MEM, NULL);
-    object_property_set_link(OBJECT(q35_host), OBJECT(pci_memory),
-                             MCH_HOST_PROP_PCI_MEM, NULL);
-    object_property_set_link(OBJECT(q35_host), OBJECT(get_system_memory()),
-                             MCH_HOST_PROP_SYSTEM_MEM, NULL);
-    object_property_set_link(OBJECT(q35_host), OBJECT(system_io),
-                             MCH_HOST_PROP_IO_MEM, NULL);
-    object_property_set_int(OBJECT(q35_host), x86ms->below_4g_mem_size,
-                            PCI_HOST_BELOW_4G_MEM_SIZE, NULL);
-    object_property_set_int(OBJECT(q35_host), x86ms->above_4g_mem_size,
-                            PCI_HOST_ABOVE_4G_MEM_SIZE, NULL);
+    object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_RAM_MEM,
+                             OBJECT(ram_memory), NULL);
+    object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_PCI_MEM,
+                             OBJECT(pci_memory), NULL);
+    object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_SYSTEM_MEM,
+                             OBJECT(get_system_memory()), NULL);
+    object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_IO_MEM,
+                             OBJECT(system_io), NULL);
+    object_property_set_int(OBJECT(q35_host), PCI_HOST_BELOW_4G_MEM_SIZE,
+                            x86ms->below_4g_mem_size, NULL);
+    object_property_set_int(OBJECT(q35_host), PCI_HOST_ABOVE_4G_MEM_SIZE,
+                            x86ms->above_4g_mem_size, NULL);
     /* pci */
     sysbus_realize_and_unref(SYS_BUS_DEVICE(q35_host), &error_fatal);
     phb = PCI_HOST_BRIDGE(q35_host);
@@ -243,8 +243,8 @@ static void pc_q35_init(MachineState *machine)
                              (Object **)&pcms->acpi_dev,
                              object_property_allow_set_link,
                              OBJ_PROP_LINK_STRONG);
-    object_property_set_link(OBJECT(machine), OBJECT(lpc),
-                             PC_MACHINE_ACPI_DEVICE_PROP, &error_abort);
+    object_property_set_link(OBJECT(machine), PC_MACHINE_ACPI_DEVICE_PROP,
+                             OBJECT(lpc), &error_abort);
 
     /* irq lines */
     gsi_state = pc_gsi_create(&x86ms->gsi, pcmc->pci_enabled);
hw/i386/x86.c +1 -1
index 93f7371a56..54760197cf 100644
@@ -121,7 +121,7 @@ void x86_cpu_new(X86MachineState *x86ms, int64_t apic_id, Error **errp)
     Error *local_err = NULL;
     Object *cpu = object_new(MACHINE(x86ms)->cpu_type);
 
-    object_property_set_uint(cpu, apic_id, "apic-id", &local_err);
+    object_property_set_uint(cpu, "apic-id", apic_id, &local_err);
     if (local_err) {
         goto out;
     }
hw/ide/qdev.c +1 -1
index ba8b0d7f02..27ff1f7f66 100644
@@ -269,7 +269,7 @@ static void ide_dev_instance_init(Object *obj)
     object_property_add(obj, "bootindex", "int32",
                         ide_dev_get_bootindex,
                         ide_dev_set_bootindex, NULL, NULL);
-    object_property_set_int(obj, -1, "bootindex", NULL);
+    object_property_set_int(obj, "bootindex", -1, NULL);
 }
 
 static void ide_hd_realize(IDEDevice *dev, Error **errp)
hw/intc/pnv_xive.c +4 -5
index 3b2e87334d..d6780061f4 100644
@@ -1829,18 +1829,17 @@ static void pnv_xive_realize(DeviceState *dev, Error **errp)
      * resized dynamically when the controller is configured by the FW
      * to limit accesses to resources not provisioned.
      */
-    object_property_set_int(OBJECT(xsrc), PNV_XIVE_NR_IRQS, "nr-irqs",
+    object_property_set_int(OBJECT(xsrc), "nr-irqs", PNV_XIVE_NR_IRQS,
                             &error_fatal);
-    object_property_set_link(OBJECT(xsrc), OBJECT(xive), "xive",
-                             &error_abort);
+    object_property_set_link(OBJECT(xsrc), "xive", OBJECT(xive), &error_abort);
     if (!qdev_realize(DEVICE(xsrc), NULL, &local_err)) {
         error_propagate(errp, local_err);
         return;
     }
 
-    object_property_set_int(OBJECT(end_xsrc), PNV_XIVE_NR_ENDS, "nr-ends",
+    object_property_set_int(OBJECT(end_xsrc), "nr-ends", PNV_XIVE_NR_ENDS,
                             &error_fatal);
-    object_property_set_link(OBJECT(end_xsrc), OBJECT(xive), "xive",
+    object_property_set_link(OBJECT(end_xsrc), "xive", OBJECT(xive),
                              &error_abort);
     if (!qdev_realize(DEVICE(end_xsrc), NULL, &local_err)) {
         error_propagate(errp, local_err);
hw/intc/spapr_xive.c +4 -5
index 615abf5462..1f42bf4f43 100644
@@ -308,10 +308,9 @@ static void spapr_xive_realize(DeviceState *dev, Error **errp)
     /*
      * Initialize the internal sources, for IPIs and virtual devices.
      */
-    object_property_set_int(OBJECT(xsrc), xive->nr_irqs, "nr-irqs",
+    object_property_set_int(OBJECT(xsrc), "nr-irqs", xive->nr_irqs,
                             &error_fatal);
-    object_property_set_link(OBJECT(xsrc), OBJECT(xive), "xive",
-                             &error_abort);
+    object_property_set_link(OBJECT(xsrc), "xive", OBJECT(xive), &error_abort);
     if (!qdev_realize(DEVICE(xsrc), NULL, &local_err)) {
         error_propagate(errp, local_err);
         return;
@@ -321,9 +320,9 @@ static void spapr_xive_realize(DeviceState *dev, Error **errp)
     /*
      * Initialize the END ESB source
      */
-    object_property_set_int(OBJECT(end_xsrc), xive->nr_irqs, "nr-ends",
+    object_property_set_int(OBJECT(end_xsrc), "nr-ends", xive->nr_irqs,
                             &error_fatal);
-    object_property_set_link(OBJECT(end_xsrc), OBJECT(xive), "xive",
+    object_property_set_link(OBJECT(end_xsrc), "xive", OBJECT(xive),
                              &error_abort);
     if (!qdev_realize(DEVICE(end_xsrc), NULL, &local_err)) {
         error_propagate(errp, local_err);
hw/intc/xics.c +2 -2
index 811b0346e1..c1feb649fb 100644
@@ -382,8 +382,8 @@ Object *icp_create(Object *cpu, const char *type, XICSFabric *xi, Error **errp)
     obj = object_new(type);
     object_property_add_child(cpu, type, obj);
     object_unref(obj);
-    object_property_set_link(obj, OBJECT(xi), ICP_PROP_XICS, &error_abort);
-    object_property_set_link(obj, cpu, ICP_PROP_CPU, &error_abort);
+    object_property_set_link(obj, ICP_PROP_XICS, OBJECT(xi), &error_abort);
+    object_property_set_link(obj, ICP_PROP_CPU, cpu, &error_abort);
     if (!qdev_realize(DEVICE(obj), NULL, &local_err)) {
         object_unparent(obj);
         error_propagate(errp, local_err);
hw/intc/xive.c +2 -2
index 8e167306e7..34591659d3 100644
@@ -763,8 +763,8 @@ Object *xive_tctx_create(Object *cpu, XivePresenter *xptr, Error **errp)
     obj = object_new(TYPE_XIVE_TCTX);
     object_property_add_child(cpu, TYPE_XIVE_TCTX, obj);
     object_unref(obj);
-    object_property_set_link(obj, cpu, "cpu", &error_abort);
-    object_property_set_link(obj, OBJECT(xptr), "presenter", &error_abort);
+    object_property_set_link(obj, "cpu", cpu, &error_abort);
+    object_property_set_link(obj, "presenter", OBJECT(xptr), &error_abort);
     if (!qdev_realize(DEVICE(obj), NULL, &local_err)) {
         goto error;
     }
hw/m68k/q800.c +2 -2
index 459d326af0..1ca482ad81 100644
@@ -262,8 +262,8 @@ static void q800_init(MachineState *machine)
     qdev_set_nic_properties(dev, &nd_table[0]);
     qdev_prop_set_uint8(dev, "it_shift", 2);
     qdev_prop_set_bit(dev, "big_endian", true);
-    object_property_set_link(OBJECT(dev), OBJECT(get_system_memory()),
-                             "dma_mr", &error_abort);
+    object_property_set_link(OBJECT(dev), "dma_mr",
+                             OBJECT(get_system_memory()), &error_abort);
     sysbus = SYS_BUS_DEVICE(dev);
     sysbus_realize_and_unref(sysbus, &error_fatal);
     sysbus_mmio_map(sysbus, 0, SONIC_BASE);
hw/mem/pc-dimm.c +2 -2
index f2a86ec4ee..8a075fbf72 100644
@@ -54,7 +54,7 @@ void pc_dimm_pre_plug(PCDIMMDevice *dimm, MachineState *machine,
     if (local_err) {
         goto out;
     }
-    object_property_set_int(OBJECT(dimm), slot, PC_DIMM_SLOT_PROP,
+    object_property_set_int(OBJECT(dimm), PC_DIMM_SLOT_PROP, slot,
                             &error_abort);
     trace_mhp_pc_dimm_assigned_slot(slot);
 
@@ -225,7 +225,7 @@ static uint64_t pc_dimm_md_get_addr(const MemoryDeviceState *md)
 static void pc_dimm_md_set_addr(MemoryDeviceState *md, uint64_t addr,
                                 Error **errp)
 {
-    object_property_set_uint(OBJECT(md), addr, PC_DIMM_ADDR_PROP, errp);
+    object_property_set_uint(OBJECT(md), PC_DIMM_ADDR_PROP, addr, errp);
 }
 
 static MemoryRegion *pc_dimm_md_get_memory_region(MemoryDeviceState *md,
hw/microblaze/petalogix_ml605_mmu.c +12 -12
index fff2c578ef..e49fc86eb8 100644
@@ -83,14 +83,14 @@ petalogix_ml605_init(MachineState *machine)
 
     /* init CPUs */
     cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU));
-    object_property_set_str(OBJECT(cpu), "8.10.a", "version", &error_abort);
+    object_property_set_str(OBJECT(cpu), "version", "8.10.a", &error_abort);
     /* Use FPU but don't use floating point conversion and square
      * root instructions
      */
-    object_property_set_int(OBJECT(cpu), 1, "use-fpu", &error_abort);
-    object_property_set_bool(OBJECT(cpu), true, "dcache-writeback",
+    object_property_set_int(OBJECT(cpu), "use-fpu", 1, &error_abort);
+    object_property_set_bool(OBJECT(cpu), "dcache-writeback", true,
                              &error_abort);
-    object_property_set_bool(OBJECT(cpu), true, "endianness", &error_abort);
+    object_property_set_bool(OBJECT(cpu), "endianness", true, &error_abort);
     qdev_realize(DEVICE(cpu), NULL, &error_abort);
 
     /* Attach emulated BRAM through the LMB.  */
@@ -148,10 +148,10 @@ petalogix_ml605_init(MachineState *machine)
     qdev_set_nic_properties(eth0, &nd_table[0]);
     qdev_prop_set_uint32(eth0, "rxmem", 0x1000);
     qdev_prop_set_uint32(eth0, "txmem", 0x1000);
-    object_property_set_link(OBJECT(eth0), ds,
-                             "axistream-connected", &error_abort);
-    object_property_set_link(OBJECT(eth0), cs,
-                             "axistream-control-connected", &error_abort);
+    object_property_set_link(OBJECT(eth0), "axistream-connected", ds,
+                             &error_abort);
+    object_property_set_link(OBJECT(eth0), "axistream-control-connected", cs,
+                             &error_abort);
     sysbus_realize_and_unref(SYS_BUS_DEVICE(eth0), &error_fatal);
     sysbus_mmio_map(SYS_BUS_DEVICE(eth0), 0, AXIENET_BASEADDR);
     sysbus_connect_irq(SYS_BUS_DEVICE(eth0), 0, irq[AXIENET_IRQ]);
@@ -161,10 +161,10 @@ petalogix_ml605_init(MachineState *machine)
     cs = object_property_get_link(OBJECT(eth0),
                                   "axistream-control-connected-target", NULL);
     qdev_prop_set_uint32(dma, "freqhz", 100 * 1000000);
-    object_property_set_link(OBJECT(dma), ds,
-                             "axistream-connected", &error_abort);
-    object_property_set_link(OBJECT(dma), cs,
-                             "axistream-control-connected", &error_abort);
+    object_property_set_link(OBJECT(dma), "axistream-connected", ds,
+                             &error_abort);
+    object_property_set_link(OBJECT(dma), "axistream-control-connected", cs,
+                             &error_abort);
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dma), &error_fatal);
     sysbus_mmio_map(SYS_BUS_DEVICE(dma), 0, AXIDMA_BASEADDR);
     sysbus_connect_irq(SYS_BUS_DEVICE(dma), 0, irq[AXIDMA_IRQ0]);
hw/microblaze/petalogix_s3adsp1800_mmu.c +1 -1
index a43c980fc9..9d959d1ad8 100644
@@ -70,7 +70,7 @@ petalogix_s3adsp1800_init(MachineState *machine)
     MemoryRegion *sysmem = get_system_memory();
 
     cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU));
-    object_property_set_str(OBJECT(cpu), "7.10.d", "version", &error_abort);
+    object_property_set_str(OBJECT(cpu), "version", "7.10.d", &error_abort);
     qdev_realize(DEVICE(cpu), NULL, &error_abort);
 
     /* Attach emulated BRAM through the LMB.  */
hw/microblaze/xlnx-zynqmp-pmu.c +15 -15
index 5e861f5ae2..d22d3e22d1 100644
@@ -78,34 +78,34 @@ static void xlnx_zynqmp_pmu_soc_realize(DeviceState *dev, Error **errp)
     XlnxZynqMPPMUSoCState *s = XLNX_ZYNQMP_PMU_SOC(dev);
     Error *err = NULL;
 
-    object_property_set_uint(OBJECT(&s->cpu), XLNX_ZYNQMP_PMU_ROM_ADDR,
-                             "base-vectors", &error_abort);
-    object_property_set_bool(OBJECT(&s->cpu), true, "use-stack-protection",
+    object_property_set_uint(OBJECT(&s->cpu), "base-vectors",
+                             XLNX_ZYNQMP_PMU_ROM_ADDR, &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), "use-stack-protection", true,
                              &error_abort);
-    object_property_set_uint(OBJECT(&s->cpu), 0, "use-fpu", &error_abort);
-    object_property_set_uint(OBJECT(&s->cpu), 0, "use-hw-mul", &error_abort);
-    object_property_set_bool(OBJECT(&s->cpu), true, "use-barrel",
+    object_property_set_uint(OBJECT(&s->cpu), "use-fpu", 0, &error_abort);
+    object_property_set_uint(OBJECT(&s->cpu), "use-hw-mul", 0, &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), "use-barrel", true,
                              &error_abort);
-    object_property_set_bool(OBJECT(&s->cpu), true, "use-msr-instr",
+    object_property_set_bool(OBJECT(&s->cpu), "use-msr-instr", true,
                              &error_abort);
-    object_property_set_bool(OBJECT(&s->cpu), true, "use-pcmp-instr",
+    object_property_set_bool(OBJECT(&s->cpu), "use-pcmp-instr", true,
                              &error_abort);
-    object_property_set_bool(OBJECT(&s->cpu), false, "use-mmu", &error_abort);
-    object_property_set_bool(OBJECT(&s->cpu), true, "endianness",
+    object_property_set_bool(OBJECT(&s->cpu), "use-mmu", false, &error_abort);
+    object_property_set_bool(OBJECT(&s->cpu), "endianness", true,
                              &error_abort);
-    object_property_set_str(OBJECT(&s->cpu), "8.40.b", "version",
+    object_property_set_str(OBJECT(&s->cpu), "version", "8.40.b",
                             &error_abort);
-    object_property_set_uint(OBJECT(&s->cpu), 0, "pvr", &error_abort);
+    object_property_set_uint(OBJECT(&s->cpu), "pvr", 0, &error_abort);
     if (!qdev_realize(DEVICE(&s->cpu), NULL, &err)) {
         error_propagate(errp, err);
         return;
     }
 
-    object_property_set_uint(OBJECT(&s->intc), 0x10, "intc-intr-size",
+    object_property_set_uint(OBJECT(&s->intc), "intc-intr-size", 0x10,
                              &error_abort);
-    object_property_set_uint(OBJECT(&s->intc), 0x0, "intc-level-edge",
+    object_property_set_uint(OBJECT(&s->intc), "intc-level-edge", 0x0,
                              &error_abort);
-    object_property_set_uint(OBJECT(&s->intc), 0xffff, "intc-positive",
+    object_property_set_uint(OBJECT(&s->intc), "intc-positive", 0xffff,
                              &error_abort);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->intc), &err)) {
         error_propagate(errp, err);
hw/mips/boston.c +2 -2
index f5d4ac8cd4..766458c015 100644
@@ -455,9 +455,9 @@ static void boston_mach_init(MachineState *machine)
     is_64b = cpu_supports_isa(machine->cpu_type, ISA_MIPS64);
 
     object_initialize_child(OBJECT(machine), "cps", &s->cps, TYPE_MIPS_CPS);
-    object_property_set_str(OBJECT(&s->cps), machine->cpu_type, "cpu-type",
+    object_property_set_str(OBJECT(&s->cps), "cpu-type", machine->cpu_type,
                             &error_fatal);
-    object_property_set_int(OBJECT(&s->cps), machine->smp.cpus, "num-vp",
+    object_property_set_int(OBJECT(&s->cps), "num-vp", machine->smp.cpus,
                             &error_fatal);
     sysbus_realize(SYS_BUS_DEVICE(&s->cps), &error_fatal);
 
hw/mips/cps.c +12 -12
index 22b932890d..83a073fba5 100644
@@ -100,11 +100,11 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)
     /* Inter-Thread Communication Unit */
     if (itu_present) {
         object_initialize_child(OBJECT(dev), "itu", &s->itu, TYPE_MIPS_ITU);
-        object_property_set_int(OBJECT(&s->itu), 16, "num-fifo",
+        object_property_set_int(OBJECT(&s->itu), "num-fifo", 16,
                                 &error_abort);
-        object_property_set_int(OBJECT(&s->itu), 16, "num-semaphores",
+        object_property_set_int(OBJECT(&s->itu), "num-semaphores", 16,
                                 &error_abort);
-        object_property_set_bool(OBJECT(&s->itu), saar_present, "saar-present",
+        object_property_set_bool(OBJECT(&s->itu), "saar-present", saar_present,
                                  &error_abort);
         if (saar_present) {
             s->itu.saar = &env->CP0_SAAR;
@@ -120,9 +120,9 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)
 
     /* Cluster Power Controller */
     object_initialize_child(OBJECT(dev), "cpc", &s->cpc, TYPE_MIPS_CPC);
-    object_property_set_int(OBJECT(&s->cpc), s->num_vp, "num-vp",
+    object_property_set_int(OBJECT(&s->cpc), "num-vp", s->num_vp,
                             &error_abort);
-    object_property_set_int(OBJECT(&s->cpc), 1, "vp-start-running",
+    object_property_set_int(OBJECT(&s->cpc), "vp-start-running", 1,
                             &error_abort);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpc), &err)) {
         error_propagate(errp, err);
@@ -134,9 +134,9 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)
 
     /* Global Interrupt Controller */
     object_initialize_child(OBJECT(dev), "gic", &s->gic, TYPE_MIPS_GIC);
-    object_property_set_int(OBJECT(&s->gic), s->num_vp, "num-vp",
+    object_property_set_int(OBJECT(&s->gic), "num-vp", s->num_vp,
                             &error_abort);
-    object_property_set_int(OBJECT(&s->gic), 128, "num-irq",
+    object_property_set_int(OBJECT(&s->gic), "num-irq", 128,
                             &error_abort);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->gic), &err)) {
         error_propagate(errp, err);
@@ -150,15 +150,15 @@ static void mips_cps_realize(DeviceState *dev, Error **errp)
     gcr_base = env->CP0_CMGCRBase << 4;
 
     object_initialize_child(OBJECT(dev), "gcr", &s->gcr, TYPE_MIPS_GCR);
-    object_property_set_int(OBJECT(&s->gcr), s->num_vp, "num-vp",
+    object_property_set_int(OBJECT(&s->gcr), "num-vp", s->num_vp,
                             &error_abort);
-    object_property_set_int(OBJECT(&s->gcr), 0x800, "gcr-rev",
+    object_property_set_int(OBJECT(&s->gcr), "gcr-rev", 0x800,
                             &error_abort);
-    object_property_set_int(OBJECT(&s->gcr), gcr_base, "gcr-base",
+    object_property_set_int(OBJECT(&s->gcr), "gcr-base", gcr_base,
                             &error_abort);
-    object_property_set_link(OBJECT(&s->gcr), OBJECT(&s->gic.mr), "gic",
+    object_property_set_link(OBJECT(&s->gcr), "gic", OBJECT(&s->gic.mr),
                              &error_abort);
-    object_property_set_link(OBJECT(&s->gcr), OBJECT(&s->cpc.mr), "cpc",
+    object_property_set_link(OBJECT(&s->gcr), "cpc", OBJECT(&s->cpc.mr),
                              &error_abort);
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->gcr), &err)) {
         error_propagate(errp, err);
hw/mips/jazz.c +2 -2
index 0002bff695..82a6e3220e 100644
@@ -290,8 +290,8 @@ static void mips_jazz_init(MachineState *machine,
             dev = qdev_new("dp8393x");
             qdev_set_nic_properties(dev, nd);
             qdev_prop_set_uint8(dev, "it_shift", 2);
-            object_property_set_link(OBJECT(dev), OBJECT(rc4030_dma_mr),
-                                     "dma_mr", &error_abort);
+            object_property_set_link(OBJECT(dev), "dma_mr",
+                                     OBJECT(rc4030_dma_mr), &error_abort);
             sysbus = SYS_BUS_DEVICE(dev);
             sysbus_realize_and_unref(sysbus, &error_fatal);
             sysbus_mmio_map(sysbus, 0, 0x80001000);
hw/mips/malta.c +2 -2
index d95926a89c..a59e20c81c 100644
@@ -1184,9 +1184,9 @@ static void create_cps(MachineState *ms, MaltaState *s,
                        qemu_irq *cbus_irq, qemu_irq *i8259_irq)
 {
     object_initialize_child(OBJECT(s), "cps", &s->cps, TYPE_MIPS_CPS);
-    object_property_set_str(OBJECT(&s->cps), ms->cpu_type, "cpu-type",
+    object_property_set_str(OBJECT(&s->cps), "cpu-type", ms->cpu_type,
                             &error_fatal);
-    object_property_set_int(OBJECT(&s->cps), ms->smp.cpus, "num-vp",
+    object_property_set_int(OBJECT(&s->cps), "num-vp", ms->smp.cpus,
                             &error_fatal);
     sysbus_realize(SYS_BUS_DEVICE(&s->cps), &error_fatal);
 
hw/misc/iotkit-sysctl.c +1 -1
index ec1cc1931a..269783366d 100644
@@ -84,7 +84,7 @@ static void set_init_vtor(uint64_t cpuid, uint32_t vtor)
 
     if (cpuobj) {
         if (object_property_find(cpuobj, "init-svtor", NULL)) {
-            object_property_set_uint(cpuobj, vtor, "init-svtor", &error_abort);
+            object_property_set_uint(cpuobj, "init-svtor", vtor, &error_abort);
         }
     }
 }
hw/misc/macio/macio.c +3 -3
index be66bb7758..9b6e3f120e 100644
@@ -134,7 +134,7 @@ static void macio_realize_ide(MacIOState *s, MACIOIDEState *ide,
     sysbus_connect_irq(sysbus_dev, 0, irq0);
     sysbus_connect_irq(sysbus_dev, 1, irq1);
     qdev_prop_set_uint32(DEVICE(ide), "channel", dmaid);
-    object_property_set_link(OBJECT(ide), OBJECT(&s->dbdma), "dbdma",
+    object_property_set_link(OBJECT(ide), "dbdma", OBJECT(&s->dbdma),
                              &error_abort);
     macio_ide_register_dma(ide);
 
@@ -330,7 +330,7 @@ static void macio_newworld_realize(PCIDevice *d, Error **errp)
     if (ns->has_pmu) {
         /* GPIOs */
         sysbus_dev = SYS_BUS_DEVICE(&ns->gpio);
-        object_property_set_link(OBJECT(&ns->gpio), OBJECT(pic_dev), "pic",
+        object_property_set_link(OBJECT(&ns->gpio), "pic", OBJECT(pic_dev),
                                  &error_abort);
         memory_region_add_subregion(&s->bar, 0x50,
                                     sysbus_mmio_get_region(sysbus_dev, 0));
@@ -340,7 +340,7 @@ static void macio_newworld_realize(PCIDevice *d, Error **errp)
 
         /* PMU */
         object_initialize_child(OBJECT(s), "pmu", &s->pmu, TYPE_VIA_PMU);
-        object_property_set_link(OBJECT(&s->pmu), OBJECT(sysbus_dev), "gpio",
+        object_property_set_link(OBJECT(&s->pmu), "gpio", OBJECT(sysbus_dev),
                                  &error_abort);
         qdev_prop_set_bit(DEVICE(&s->pmu), "has-adb", ns->has_adb);
         if (!qdev_realize(DEVICE(&s->pmu), BUS(&s->macio_bus), &err)) {
hw/net/ne2000-isa.c +1 -1
index 0594abd93a..a878056426 100644
@@ -133,7 +133,7 @@ static void isa_ne2000_instance_init(Object *obj)
     object_property_add(obj, "bootindex", "int32",
                         isa_ne2000_get_bootindex,
                         isa_ne2000_set_bootindex, NULL, NULL);
-    object_property_set_int(obj, -1, "bootindex", NULL);
+    object_property_set_int(obj, "bootindex", -1, NULL);
 }
 static const TypeInfo ne2000_isa_info = {
     .name          = TYPE_ISA_NE2000,
hw/net/xilinx_axienet.c +2 -2
index 679a359f9a..1e48eb70c9 100644
@@ -989,8 +989,8 @@ static void xilinx_enet_realize(DeviceState *dev, Error **errp)
                              (Object **) &cs->enet,
                              object_property_allow_set_link,
                              OBJ_PROP_LINK_STRONG);
-    object_property_set_link(OBJECT(ds), OBJECT(s), "enet", &error_abort);
-    object_property_set_link(OBJECT(cs), OBJECT(s), "enet", &error_abort);
+    object_property_set_link(OBJECT(ds), "enet", OBJECT(s), &error_abort);
+    object_property_set_link(OBJECT(cs), "enet", OBJECT(s), &error_abort);
 
     qemu_macaddr_default_if_unset(&s->conf.macaddr);
     s->nic = qemu_new_nic(&net_xilinx_enet_info, &s->conf,
hw/pci-host/pnv_phb3.c +10 -10
index 7b547b1d78..94cb989136 100644
@@ -999,9 +999,9 @@ static void pnv_phb3_realize(DeviceState *dev, Error **errp)
     }
 
     /* LSI sources */
-    object_property_set_link(OBJECT(&phb->lsis), OBJECT(pnv), "xics",
-                                   &error_abort);
-    object_property_set_int(OBJECT(&phb->lsis), PNV_PHB3_NUM_LSI, "nr-irqs",
+    object_property_set_link(OBJECT(&phb->lsis), "xics", OBJECT(pnv),
+                             &error_abort);
+    object_property_set_int(OBJECT(&phb->lsis), "nr-irqs", PNV_PHB3_NUM_LSI,
                             &error_abort);
     if (!qdev_realize(DEVICE(&phb->lsis), NULL, &local_err)) {
         error_propagate(errp, local_err);
@@ -1015,11 +1015,11 @@ static void pnv_phb3_realize(DeviceState *dev, Error **errp)
     phb->qirqs = qemu_allocate_irqs(ics_set_irq, &phb->lsis, phb->lsis.nr_irqs);
 
     /* MSI sources */
-    object_property_set_link(OBJECT(&phb->msis), OBJECT(phb), "phb",
-                                   &error_abort);
-    object_property_set_link(OBJECT(&phb->msis), OBJECT(pnv), "xics",
-                                   &error_abort);
-    object_property_set_int(OBJECT(&phb->msis), PHB3_MAX_MSI, "nr-irqs",
+    object_property_set_link(OBJECT(&phb->msis), "phb", OBJECT(phb),
+                             &error_abort);
+    object_property_set_link(OBJECT(&phb->msis), "xics", OBJECT(pnv),
+                             &error_abort);
+    object_property_set_int(OBJECT(&phb->msis), "nr-irqs", PHB3_MAX_MSI,
                             &error_abort);
     if (!qdev_realize(DEVICE(&phb->msis), NULL, &local_err)) {
         error_propagate(errp, local_err);
@@ -1027,8 +1027,8 @@ static void pnv_phb3_realize(DeviceState *dev, Error **errp)
     }
 
     /* Power Bus Common Queue */
-    object_property_set_link(OBJECT(&phb->pbcq), OBJECT(phb), "phb",
-                                   &error_abort);
+    object_property_set_link(OBJECT(&phb->pbcq), "phb", OBJECT(phb),
+                             &error_abort);
     if (!qdev_realize(DEVICE(&phb->pbcq), NULL, &local_err)) {
         error_propagate(errp, local_err);
         return;
hw/pci-host/pnv_phb4.c +2 -2
index 53c2b1785b..a598c89eb0 100644
@@ -1216,8 +1216,8 @@ static void pnv_phb4_realize(DeviceState *dev, Error **errp)
     } else {
         nr_irqs = PNV_PHB4_MAX_INTs >> 1;
     }
-    object_property_set_int(OBJECT(xsrc), nr_irqs, "nr-irqs", &error_fatal);
-    object_property_set_link(OBJECT(xsrc), OBJECT(phb), "xive", &error_fatal);
+    object_property_set_int(OBJECT(xsrc), "nr-irqs", nr_irqs, &error_fatal);
+    object_property_set_link(OBJECT(xsrc), "xive", OBJECT(phb), &error_fatal);
     if (!qdev_realize(DEVICE(xsrc), NULL, &local_err)) {
         error_propagate(errp, local_err);
         return;
hw/pci-host/pnv_phb4_pec.c +2 -2
index 45a1b3719d..088ab753aa 100644
@@ -388,8 +388,8 @@ static void pnv_pec_realize(DeviceState *dev, Error **errp)
         PnvPhb4PecStack *stack = &pec->stacks[i];
         Object *stk_obj = OBJECT(stack);
 
-        object_property_set_int(stk_obj, i, "stack-no", &error_abort);
-        object_property_set_link(stk_obj, OBJECT(pec), "pec", &error_abort);
+        object_property_set_int(stk_obj, "stack-no", i, &error_abort);
+        object_property_set_link(stk_obj, "pec", OBJECT(pec), &error_abort);
         if (!qdev_realize(DEVICE(stk_obj), NULL, &local_err)) {
             error_propagate(errp, local_err);
             return;
hw/pci-host/prep.c +2 -2
index 367e408b91..4b93fd2b01 100644
@@ -236,7 +236,7 @@ static void raven_pcihost_realizefn(DeviceState *d, Error **errp)
         /* According to PReP specification section 6.1.6 "System Interrupt
          * Assignments", all PCI interrupts are routed via IRQ 15 */
         s->or_irq = OR_IRQ(object_new(TYPE_OR_IRQ));
-        object_property_set_int(OBJECT(s->or_irq), PCI_NUM_PINS, "num-lines",
+        object_property_set_int(OBJECT(s->or_irq), "num-lines", PCI_NUM_PINS,
                                 &error_fatal);
         qdev_realize(DEVICE(s->or_irq), NULL, &error_fatal);
         sysbus_init_irq(dev, &s->or_irq->out_irq);
@@ -307,7 +307,7 @@ static void raven_pcihost_initfn(Object *obj)
 
     object_initialize(&s->pci_dev, sizeof(s->pci_dev), TYPE_RAVEN_PCI_DEVICE);
     pci_dev = DEVICE(&s->pci_dev);
-    object_property_set_int(OBJECT(&s->pci_dev), PCI_DEVFN(0, 0), "addr",
+    object_property_set_int(OBJECT(&s->pci_dev), "addr", PCI_DEVFN(0, 0),
                             NULL);
     qdev_prop_set_bit(pci_dev, "multifunction", false);
 }
hw/ppc/mac_newworld.c +5 -5
index 828c5992ae..e42bd7a626 100644
@@ -304,7 +304,7 @@ static void ppc_core99_init(MachineState *machine)
         /* 970 gets a U3 bus */
         /* Uninorth AGP bus */
         dev = qdev_new(TYPE_U3_AGP_HOST_BRIDGE);
-        object_property_set_link(OBJECT(dev), OBJECT(pic_dev), "pic",
+        object_property_set_link(OBJECT(dev), "pic", OBJECT(pic_dev),
                                  &error_abort);
         sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
         uninorth_pci = U3_AGP_HOST_BRIDGE(dev);
@@ -323,7 +323,7 @@ static void ppc_core99_init(MachineState *machine)
         /* Use values found on a real PowerMac */
         /* Uninorth AGP bus */
         dev = qdev_new(TYPE_UNI_NORTH_AGP_HOST_BRIDGE);
-        object_property_set_link(OBJECT(dev), OBJECT(pic_dev), "pic",
+        object_property_set_link(OBJECT(dev), "pic", OBJECT(pic_dev),
                                  &error_abort);
         s = SYS_BUS_DEVICE(dev);
         sysbus_realize_and_unref(s, &error_fatal);
@@ -332,7 +332,7 @@ static void ppc_core99_init(MachineState *machine)
 
         /* Uninorth internal bus */
         dev = qdev_new(TYPE_UNI_NORTH_INTERNAL_PCI_HOST_BRIDGE);
-        object_property_set_link(OBJECT(dev), OBJECT(pic_dev), "pic",
+        object_property_set_link(OBJECT(dev), "pic", OBJECT(pic_dev),
                                  &error_abort);
         s = SYS_BUS_DEVICE(dev);
         sysbus_realize_and_unref(s, &error_fatal);
@@ -342,7 +342,7 @@ static void ppc_core99_init(MachineState *machine)
         /* Uninorth main bus */
         dev = qdev_new(TYPE_UNI_NORTH_PCI_HOST_BRIDGE);
         qdev_prop_set_uint32(dev, "ofw-addr", 0xf2000000);
-        object_property_set_link(OBJECT(dev), OBJECT(pic_dev), "pic",
+        object_property_set_link(OBJECT(dev), "pic", OBJECT(pic_dev),
                                  &error_abort);
         sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
         uninorth_pci = UNI_NORTH_PCI_HOST_BRIDGE(dev);
@@ -380,7 +380,7 @@ static void ppc_core99_init(MachineState *machine)
     qdev_prop_set_uint64(dev, "frequency", tbfreq);
     qdev_prop_set_bit(dev, "has-pmu", has_pmu);
     qdev_prop_set_bit(dev, "has-adb", has_adb);
-    object_property_set_link(OBJECT(macio), OBJECT(pic_dev), "pic",
+    object_property_set_link(OBJECT(macio), "pic", OBJECT(pic_dev),
                              &error_abort);
     pci_realize_and_unref(macio, pci_bus, &error_fatal);
 
hw/ppc/mac_oldworld.c +2 -2
index f8c204ead7..7aba040f1b 100644
@@ -254,7 +254,7 @@ static void ppc_heathrow_init(MachineState *machine)
     /* Grackle PCI host bridge */
     dev = qdev_new(TYPE_GRACKLE_PCI_HOST_BRIDGE);
     qdev_prop_set_uint32(dev, "ofw-addr", 0x80000000);
-    object_property_set_link(OBJECT(dev), OBJECT(pic_dev), "pic",
+    object_property_set_link(OBJECT(dev), "pic", OBJECT(pic_dev),
                              &error_abort);
     s = SYS_BUS_DEVICE(dev);
     sysbus_realize_and_unref(s, &error_fatal);
@@ -281,7 +281,7 @@ static void ppc_heathrow_init(MachineState *machine)
     macio = pci_new(-1, TYPE_OLDWORLD_MACIO);
     dev = DEVICE(macio);
     qdev_prop_set_uint64(dev, "frequency", tbfreq);
-    object_property_set_link(OBJECT(macio), OBJECT(pic_dev), "pic",
+    object_property_set_link(OBJECT(macio), "pic", OBJECT(pic_dev),
                              &error_abort);
     pci_realize_and_unref(macio, pci_bus, &error_fatal);
 
hw/ppc/pnv.c +59 -59

248 lines not on this page · raw message

hw/ppc/pnv_psi.c +4 -5
index 7efe6e138f..e23276983f 100644
@@ -505,7 +505,7 @@ static void pnv_psi_power8_realize(DeviceState *dev, Error **errp)
     unsigned int i;
 
     /* Create PSI interrupt control source */
-    object_property_set_int(OBJECT(ics), PSI_NUM_INTERRUPTS, "nr-irqs", &err);
+    object_property_set_int(OBJECT(ics), "nr-irqs", PSI_NUM_INTERRUPTS, &err);
     if (err) {
         error_propagate(errp, err);
         return;
@@ -845,11 +845,10 @@ static void pnv_psi_power9_realize(DeviceState *dev, Error **errp)
     int i;
 
     /* This is the only device with 4k ESB pages */
-    object_property_set_int(OBJECT(xsrc), XIVE_ESB_4K, "shift",
+    object_property_set_int(OBJECT(xsrc), "shift", XIVE_ESB_4K, &error_fatal);
+    object_property_set_int(OBJECT(xsrc), "nr-irqs", PSIHB9_NUM_IRQS,
                             &error_fatal);
-    object_property_set_int(OBJECT(xsrc), PSIHB9_NUM_IRQS, "nr-irqs",
-                            &error_fatal);
-    object_property_set_link(OBJECT(xsrc), OBJECT(psi), "xive", &error_abort);
+    object_property_set_link(OBJECT(xsrc), "xive", OBJECT(psi), &error_abort);
     if (!qdev_realize(DEVICE(xsrc), NULL, &local_err)) {
         error_propagate(errp, local_err);
         return;
hw/ppc/spapr.c +2 -2
index f6f034d039..68e8b504b5 100644
@@ -2624,9 +2624,9 @@ static void spapr_init_cpus(SpaprMachineState *spapr)
                 nr_threads = smp_cpus - i * smp_threads;
             }
 
-            object_property_set_int(core, nr_threads, "nr-threads",
+            object_property_set_int(core, "nr-threads", nr_threads,
                                     &error_fatal);
-            object_property_set_int(core, core_id, CPU_CORE_PROP_CORE_ID,
+            object_property_set_int(core, CPU_CORE_PROP_CORE_ID, core_id,
                                     &error_fatal);
             qdev_realize(DEVICE(core), NULL, &error_fatal);
 
hw/ppc/spapr_irq.c +3 -3
index 1d0db57fc5..eb55171d70 100644
@@ -308,9 +308,9 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
         obj = object_new(TYPE_ICS_SPAPR);
 
         object_property_add_child(OBJECT(spapr), "ics", obj);
-        object_property_set_link(obj, OBJECT(spapr), ICS_PROP_XICS,
+        object_property_set_link(obj, ICS_PROP_XICS, OBJECT(spapr),
                                  &error_abort);
-        object_property_set_int(obj, smc->nr_xirqs, "nr-irqs", &error_abort);
+        object_property_set_int(obj, "nr-irqs", smc->nr_xirqs, &error_abort);
         if (!qdev_realize(DEVICE(obj), NULL, &local_err)) {
             error_propagate(errp, local_err);
             return;
@@ -331,7 +331,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
          * priority
          */
         qdev_prop_set_uint32(dev, "nr-ends", nr_servers << 3);
-        object_property_set_link(OBJECT(dev), OBJECT(spapr), "xive-fabric",
+        object_property_set_link(OBJECT(dev), "xive-fabric", OBJECT(spapr),
                                  &error_abort);
         sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
 
hw/ppc/spapr_pci.c +1 -1
index 0f00e2421f..223bb8f464 100644
@@ -2418,7 +2418,7 @@ static int spapr_switch_one_vga(DeviceState *dev, void *opaque)
 
     if (object_dynamic_cast(OBJECT(dev), "VGA")
         || object_dynamic_cast(OBJECT(dev), "secondary-vga")) {
-        object_property_set_bool(OBJECT(dev), be, "big-endian-framebuffer",
+        object_property_set_bool(OBJECT(dev), "big-endian-framebuffer", be,
                                  &error_abort);
     }
     return 0;
hw/riscv/opentitan.c +2 -2
index 5fce455d30..7003b1f62d 100644
@@ -108,9 +108,9 @@ static void lowrisc_ibex_soc_realize(DeviceState *dev_soc, Error **errp)
     MemoryRegion *sys_mem = get_system_memory();
     Error *err = NULL;
 
-    object_property_set_str(OBJECT(&s->cpus), ms->cpu_type, "cpu-type",
+    object_property_set_str(OBJECT(&s->cpus), "cpu-type", ms->cpu_type,
                             &error_abort);
-    object_property_set_int(OBJECT(&s->cpus), ms->smp.cpus, "num-harts",
+    object_property_set_int(OBJECT(&s->cpus), "num-harts", ms->smp.cpus,
                             &error_abort);
     sysbus_realize(SYS_BUS_DEVICE(&s->cpus), &error_abort);
 
hw/riscv/sifive_e.c +2 -2
index 1b2e95a977..f2df06cc43 100644
@@ -175,7 +175,7 @@ static void sifive_e_soc_init(Object *obj)
     SiFiveESoCState *s = RISCV_E_SOC(obj);
 
     object_initialize_child(obj, "cpus", &s->cpus, TYPE_RISCV_HART_ARRAY);
-    object_property_set_int(OBJECT(&s->cpus), ms->smp.cpus, "num-harts",
+    object_property_set_int(OBJECT(&s->cpus), "num-harts", ms->smp.cpus,
                             &error_abort);
     object_initialize_child(obj, "riscv.sifive.e.gpio0", &s->gpio,
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

hw/riscv/sifive_u.c +3 -3
index 7b9e7fdc7f..e70253d58f 100644

Lines of this file are not shown. View the raw message.

hw/riscv/spike.c +2 -2
index 3c87e04fdc..c107bf3ba1 100644

Lines of this file are not shown. View the raw message.

hw/riscv/virt.c +2 -2
index 616db6f5ac..f7630c8a89 100644

Lines of this file are not shown. View the raw message.

hw/rx/rx-gdbsim.c +6 -6
index b8a56fa7af..54992ebe57 100644

Lines of this file are not shown. View the raw message.

hw/s390x/ipl.c +2 -2
index ce21494c08..7c893e5683 100644

Lines of this file are not shown. View the raw message.

hw/s390x/s390-pci-bus.c +1 -1
index 1e4537f0e3..a7b2a15a96 100644

Lines of this file are not shown. View the raw message.

hw/s390x/s390-skeys.c +1 -1
index 1e036cc602..db2f49cb27 100644

Lines of this file are not shown. View the raw message.

hw/s390x/s390-stattrib.c +1 -1
index 0144b9021c..4441e1d331 100644

Lines of this file are not shown. View the raw message.

hw/s390x/s390-virtio-ccw.c +3 -3
index 023fd25f2b..07609a9a58 100644

Lines of this file are not shown. View the raw message.

hw/s390x/virtio-ccw-crypto.c +2 -3
index 36cfdf865c..5720e84fc9 100644

Lines of this file are not shown. View the raw message.

hw/s390x/virtio-ccw-rng.c +1 -2
index 513f85ac63..8cf01ce76c 100644

Lines of this file are not shown. View the raw message.

hw/scsi/scsi-bus.c +2 -2
index 365d09fb48..4860863f1d 100644

Lines of this file are not shown. View the raw message.

hw/sd/aspeed_sdhci.c +3 -3
index 2d0d5651e3..29aa11df66 100644

Lines of this file are not shown. View the raw message.

hw/sd/ssi-sd.c +1 -1
index c57d76b1c8..d4b57cda80 100644

Lines of this file are not shown. View the raw message.

hw/sparc/sun4m.c +1 -1
index ee52b5cbbc..9be930415f 100644

Lines of this file are not shown. View the raw message.

hw/sparc64/sun4u.c +1 -1
index 9c8655cffc..9e30203dcc 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-storage.c +2 -2
index 721665191e..2ed6a8df24 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-crypto-pci.c +2 -3
index 0755722288..f1cc979d33 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-iommu-pci.c +2 -2
index 592abc9279..ba62d60a0a 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-mem-pci.c +2 -2
index 1a8e854123..d375280ee1 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-pmem-pci.c +1 -1
index 11d0c8ebc6..21a457d151 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-rng-pci.c +1 -2
index 20ce1b113b..8b11c4b425 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-rng.c +2 -2
index a8df41b11b..85f7163e2d 100644

Lines of this file are not shown. View the raw message.

linux-user/syscall.c +1 -1
index 82afadcea0..98ea86ca81 100644

Lines of this file are not shown. View the raw message.

net/filter.c +1 -1
index caf6443655..eac8ba1e9c 100644

Lines of this file are not shown. View the raw message.

net/net.c +1 -1
index 6fe74c80bb..7fddcebaa2 100644

Lines of this file are not shown. View the raw message.

qdev-monitor.c +1 -1
index cbcbbb5d50..f4c6e6073a 100644

Lines of this file are not shown. View the raw message.

qom/object.c +26 -26

52 lines not on this page · raw message

qom/object_interfaces.c +1 -1
index 3085ae0b31..4c59ee56d5 100644

Lines of this file are not shown. View the raw message.

qom/qom-hmp-cmds.c +1 -1
index b0abe84cb1..9ed8bb1c9f 100644

Lines of this file are not shown. View the raw message.

qom/qom-qmp-cmds.c +1 -1
index 5e2c8cbf33..310ab2d048 100644

Lines of this file are not shown. View the raw message.

qom/qom-qobject.c +5 -4
index c3b95aa354..f949572d8a 100644

Lines of this file are not shown. View the raw message.

softmmu/vl.c +6 -6
index f3ff5d06ca..f6bcad1c07 100644

Lines of this file are not shown. View the raw message.

target/arm/monitor.c +1 -1
index 98fe11ae69..087726a394 100644

Lines of this file are not shown. View the raw message.

target/i386/cpu.c +27 -30

57 lines not on this page · raw message

target/ppc/translate_init.inc.c +1 -1
index 49212bfd90..7e66822b5d 100644

Lines of this file are not shown. View the raw message.

target/s390x/cpu_models.c +1 -1
index 65c26c4c86..8ab206186b 100644

Lines of this file are not shown. View the raw message.

ui/console.c +2 -2
index 865fa32635..08f75c9bf6 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.26.2

Part of the diff is not shown here. View the raw message.

#0 lore raw

The following changes since commit b6d7e9b66f59ca6ebc6e9b830cd5e7bf849d31cf:

Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging (2020-07-10 09:01:28 +0100)

are available in the Git repository at:

git://repo.or.cz/qemu/armbru.git tags/pull-error-2020-07-07-v2

for you to fetch changes up to 1de7096d8378a57e2d75d9cacc9a119e7e41640d:

xen: Use ERRP_GUARD() (2020-07-10 15:18:09 +0200)

----------------------------------------------------------------
Error reporting patches patches for 2020-07-07

* Improve documentation
* Codify rules for less clumsy error handling
* Convert a substantial amount of code to adhere to them
* ERRP_GUARD() infrastructure to avoid more clumsiness
* First batch of conversions to it
----------------------------------------------------------------
Markus Armbruster (45):
error: Fix examples in error.h's big comment
error: Improve error.h's big comment
error: Document Error API usage rules
qdev: Use returned bool to check for qdev_realize() etc. failure
macio: Tidy up error handling in macio_newworld_realize()
virtio-crypto-pci: Tidy up virtio_crypto_pci_realize()
qemu-option: Check return value instead of @err where convenient
qemu-option: Make uses of find_desc_by_name() more similar
qemu-option: Factor out helper find_default_by_name()
qemu-option: Simplify around find_default_by_name()
qemu-option: Factor out helper opt_create()
qemu-option: Replace opt_set() by cleaner opt_validate()
qemu-option: Make functions taking Error ** return bool, not void
qemu-option: Use returned bool to check for failure
block: Avoid error accumulation in bdrv_img_create()
hmp: Eliminate a variable in hmp_migrate_set_parameter()
qapi: Make visitor functions taking Error ** return bool, not void
qapi: Use returned bool to check for failure, Coccinelle part
qapi: Use returned bool to check for failure, manual part s390x/pci: Fix harmless mistake in zpci's property fid's setter
qom: Use error_reportf_err() instead of g_printerr() in examples
qom: Rename qdev_get_type() to object_get_type()
qom: Crash more nicely on object_property_get_link() failure
qom: Don't handle impossible object_property_get_link() failure
qom: Use return values to check for error where that's simpler
qom: Put name parameter before value / visitor parameter
qom: Make functions taking Error ** return bool, not void
qom: Use returned bool to check for failure, Coccinelle part
qom: Use returned bool to check for failure, manual part
qom: Make functions taking Error ** return bool, not 0/-1
qdev: Make functions taking Error ** return bool, not void
qdev: Use returned bool to check for failure, Coccinelle part
error: Avoid unnecessary error_propagate() after error_setg()
error: Eliminate error_propagate() with Coccinelle, part 1
error: Eliminate error_propagate() with Coccinelle, part 2
error: Eliminate error_propagate() manually
error: Reduce unnecessary error propagation block/parallels: Simplify parallels_open() after previous commit
qapi: Smooth another visitor error checking pattern
qapi: Smooth visitor error checking in generated code
qapi: Purge error_propagate() from QAPI core
error: Avoid error_propagate() after migrate_add_blocker()
qemu-img: Ignore Error objects where the return value suffices
qdev: Ignore Error objects where the return value suffices
hmp: Ignore Error objects where the return value suffices

Vladimir Sementsov-Ogievskiy (8):
error: New macro ERRP_GUARD()
scripts: Coccinelle script to use ERRP_GUARD()
sd: Use ERRP_GUARD()
pflash: Use ERRP_GUARD()
fw_cfg: Use ERRP_GUARD()
virtio-9p: Use ERRP_GUARD()
nbd: Use ERRP_GUARD()
xen: Use ERRP_GUARD()

 docs/devel/qapi-code-gen.txt             | 103 ++++------
 scripts/coccinelle/errp-guard.cocci      | 336 +++++++++++++++++++++++++++++++
 include/block/nbd.h                      |   1 +
 include/hw/audio/pcspk.h                 |   2 +-
 include/hw/qdev-properties.h             |   4 +-
 include/qapi/clone-visitor.h             |   8 +-
 include/qapi/error.h                     | 267 ++++++++++++++++++++----
 include/qapi/visitor-impl.h              |  26 +--
 include/qapi/visitor.h                   | 102 ++++++----
 include/qemu/option.h                    |  16 +-
 include/qom/object.h                     | 104 +++++-----
 include/qom/object_interfaces.h          |  12 +-
 include/qom/qom-qobject.h                |   9 +-
 accel/kvm/kvm-all.c                      |  55 +++--
 accel/tcg/tcg-all.c                      |   5 +-
 audio/audio_legacy.c                     |  15 +-
 backends/cryptodev-vhost-user.c          |   3 +-
 backends/cryptodev.c                     |  16 +-
 backends/hostmem-file.c                  |  22 +-
 backends/hostmem-memfd.c                 |  18 +-
 backends/hostmem.c                       |  33 ++-
 backends/rng.c                           |   2 +-
 backends/tpm/tpm_util.c                  |   5 +-
 block.c                                  |  21 +-
 block/blkdebug.c                         |   9 +-
 block/blklogwrites.c                     |   4 +-
 block/blkverify.c                        |   4 +-
 block/crypto.c                           |   5 +-
 block/curl.c                             |   5 +-
 block/file-posix.c                       |  16 +-
 block/file-win32.c                       |   8 +-
 block/gluster.c                          |  17 +-
 block/iscsi.c                            |   4 +-
 block/nbd.c                              |  17 +-
 block/nfs.c                              |   7 +-
 block/parallels.c                        |  29 +--
 block/qcow.c                             |  16 +-
 block/qcow2.c                            |  21 +-
 block/qed.c                              |  10 +-
 block/quorum.c                           |  19 +-
 block/raw-format.c                       |   5 +-
 block/rbd.c                              |   7 +-
 block/replication.c                      |  19 +-
 block/sheepdog.c                         |  16 +-
 block/ssh.c                              |  11 +-
 block/throttle-groups.c                  |  31 +--
 block/throttle.c                         |   5 +-
 block/vdi.c                              |  13 +-
 block/vhdx.c                             |  15 +-
 block/vmdk.c                             |  13 +-
 block/vpc.c                              |  19 +-
 block/vvfat.c                            |  10 +-
 block/vxhs.c                             |  15 +-
 blockdev.c                               |  40 ++--
 bootdevice.c                             |  13 +-
 chardev/char.c                           |   6 +-
 contrib/ivshmem-server/main.c            |   4 +-
 crypto/secret.c                          |   2 +-
 crypto/secret_keyring.c                  |   2 +-
 crypto/tlscredsanon.c                    |   2 +-
 crypto/tlscredspsk.c                     |   2 +-
 crypto/tlscredsx509.c                    |   2 +-
 dump/dump.c                              |   7 +-
 hw/9pfs/9p-local.c                       |  12 +-
 hw/9pfs/9p.c                             |   1 +
 hw/acpi/core.c                           |  19 +-
 hw/acpi/cpu_hotplug.c                    |   4 +-
 hw/acpi/ich9.c                           |   2 +-
 hw/acpi/piix4.c                          |   2 +-
 hw/arm/allwinner-a10.c                   |  27 +--
 hw/arm/armsse.c                          | 208 ++++++-------------
 hw/arm/armv7m.c                          |  47 ++---
 hw/arm/aspeed.c                          |  24 +--
 hw/arm/aspeed_ast2600.c                  | 124 ++++--------
 hw/arm/aspeed_soc.c                      |  85 +++-----
 hw/arm/bcm2835_peripherals.c             |  81 ++------
 hw/arm/bcm2836.c                         |  35 +---
 hw/arm/cubieboard.c                      |  14 +-
 hw/arm/digic.c                           |  18 +-
 hw/arm/digic_boards.c                    |   3 +-
 hw/arm/exynos4210.c                      |  13 +-
 hw/arm/fsl-imx25.c                       |  58 ++----
 hw/arm/fsl-imx31.c                       |  34 +---
 hw/arm/fsl-imx6.c                        |  85 +++-----
 hw/arm/fsl-imx6ul.c                      |  29 ++-
 hw/arm/fsl-imx7.c                        |  31 ++-
 hw/arm/highbank.c                        |  12 +-
 hw/arm/integratorcp.c                    |   2 +-
 hw/arm/mcimx6ul-evk.c                    |   4 +-
 hw/arm/microbit.c                        |   4 +-
 hw/arm/mps2-tz.c                         |  31 ++-
 hw/arm/mps2.c                            |  12 +-
 hw/arm/msf2-soc.c                        |  29 +--
 hw/arm/musca.c                           |  18 +-
 hw/arm/musicpal.c                        |   4 +-
 hw/arm/nrf51_soc.c                       |  36 +---
 hw/arm/orangepi.c                        |  13 +-
 hw/arm/raspi.c                           |   2 +-
 hw/arm/realview.c                        |   6 +-
 hw/arm/sbsa-ref.c                        |  16 +-
 hw/arm/stellaris.c                       |   4 +-
 hw/arm/stm32f205_soc.c                   |  37 +---
 hw/arm/stm32f405_soc.c                   |  48 ++---
 hw/arm/versatilepb.c                     |   4 +-
 hw/arm/vexpress.c                        |   8 +-
 hw/arm/virt.c                            |  44 ++--
 hw/arm/xilinx_zynq.c                     |   6 +-
 hw/arm/xlnx-versal-virt.c                |   8 +-
 hw/arm/xlnx-versal.c                     |  30 ++-
 hw/arm/xlnx-zcu102.c                     |   8 +-
 hw/arm/xlnx-zynqmp.c                     | 117 ++++-------
 hw/block/dataplane/xen-block.c           |  17 +-
 hw/block/fdc.c                           |  12 +-
 hw/block/pflash_cfi01.c                  |   7 +-
 hw/block/pflash_cfi02.c                  |   7 +-
 hw/block/xen-block.c                     | 124 +++++-------
 hw/char/serial-pci-multi.c               |   5 +-
 hw/char/serial-pci.c                     |   5 +-
 hw/char/serial.c                         |  10 +-
 hw/core/bus.c                            |  12 +-
 hw/core/cpu.c                            |   3 +-
 hw/core/machine.c                        |   5 +-
 hw/core/numa.c                           |  55 ++---
 hw/core/platform-bus.c                   |   6 +-
 hw/core/qdev-properties-system.c         |  32 +--
 hw/core/qdev-properties.c                |  95 +++------
 hw/core/qdev.c                           |  16 +-
 hw/cpu/a15mpcore.c                       |   5 +-
 hw/cpu/a9mpcore.c                        |  21 +-
 hw/cpu/arm11mpcore.c                     |  17 +-
 hw/cpu/core.c                            |  10 +-
 hw/cpu/realview_mpcore.c                 |   9 +-
 hw/display/bcm2835_fb.c                  |   8 +-
 hw/display/virtio-gpu-base.c             |   5 +-
 hw/display/virtio-gpu-pci.c              |  11 +-
 hw/display/virtio-vga.c                  |  10 +-
 hw/dma/bcm2835_dma.c                     |   9 +-
 hw/dma/sparc32_dma.c                     |   6 +-
 hw/dma/xilinx_axidma.c                   |   4 +-
 hw/gpio/aspeed_gpio.c                    |   5 +-
 hw/gpio/bcm2835_gpio.c                   |  15 +-
 hw/hyperv/vmbus.c                        |   5 +-
 hw/i386/pc.c                             |  48 ++---
 hw/i386/pc_piix.c                        |   4 +-
 hw/i386/pc_q35.c                         |  28 +--
 hw/i386/x86.c                            |   7 +-
 hw/ide/qdev.c                            |   7 +-
 hw/intc/apic_common.c                    |   5 +-
 hw/intc/arm_gic_kvm.c                    |   4 +-
 hw/intc/arm_gicv3_its_kvm.c              |   5 +-
 hw/intc/arm_gicv3_kvm.c                  |   4 +-
 hw/intc/armv7m_nvic.c                    |   9 +-
 hw/intc/nios2_iic.c                      |   8 +-
 hw/intc/pnv_xive.c                       |  17 +-
 hw/intc/realview_gic.c                   |   5 +-
 hw/intc/spapr_xive.c                     |  17 +-
 hw/intc/xics.c                           |   9 +-
 hw/intc/xics_kvm.c                       |   4 +-
 hw/intc/xive.c                           |  17 +-
 hw/isa/piix4.c                           |   5 +-
 hw/m68k/q800.c                           |   4 +-
 hw/mem/nvdimm.c                          |  30 +--
 hw/mem/pc-dimm.c                         |  18 +-
 hw/microblaze/petalogix_ml605_mmu.c      |  24 +--
 hw/microblaze/petalogix_s3adsp1800_mmu.c |   2 +-
 hw/microblaze/xlnx-zynqmp-pmu.c          |  39 ++--
 hw/mips/boston.c                         |   4 +-
 hw/mips/cps.c                            |  41 ++--
 hw/mips/jazz.c                           |   4 +-
 hw/mips/malta.c                          |   4 +-
 hw/misc/aspeed_sdmc.c                    |   8 +-
 hw/misc/bcm2835_mbox.c                   |   9 +-
 hw/misc/bcm2835_property.c               |  17 +-
 hw/misc/iotkit-sysctl.c                  |   2 +-
 hw/misc/ivshmem.c                        |   4 +-
 hw/misc/macio/cuda.c                     |   5 +-
 hw/misc/macio/macio.c                    |  35 ++--
 hw/misc/macio/pmu.c                      |   5 +-
 hw/misc/pca9552.c                        |   5 +-
 hw/misc/tmp105.c                         |   5 +-
 hw/misc/tmp421.c                         |   5 +-
 hw/net/ne2000-isa.c                      |   7 +-
 hw/net/virtio-net.c                      |   7 +-
 hw/net/xilinx_axienet.c                  |   4 +-
 hw/nvram/fw_cfg.c                        |  21 +-
 hw/pci-host/pnv_phb3.c                   |  33 ++-
 hw/pci-host/pnv_phb4.c                   |   9 +-
 hw/pci-host/pnv_phb4_pec.c               |   9 +-
 hw/pci-host/prep.c                       |   4 +-
 hw/pci-host/xen_igd_pt.c                 |   7 +-
 hw/ppc/e500.c                            |   5 +-
 hw/ppc/mac_newworld.c                    |  10 +-
 hw/ppc/mac_oldworld.c                    |   4 +-
 hw/ppc/pnv.c                             | 171 +++++++---------
 hw/ppc/pnv_core.c                        |   4 +-
 hw/ppc/pnv_psi.c                         |  22 +-
 hw/ppc/rs6000_mc.c                       |   9 +-
 hw/ppc/spapr.c                           |  77 +++----
 hw/ppc/spapr_caps.c                      |  15 +-
 hw/ppc/spapr_cpu_core.c                  |  15 +-
 hw/ppc/spapr_drc.c                       |  16 +-
 hw/ppc/spapr_hcall.c                     |   3 +-
 hw/ppc/spapr_irq.c                       |  11 +-
 hw/ppc/spapr_pci.c                       |  16 +-
 hw/ppc/spapr_pci_nvlink2.c               |   3 +-
 hw/riscv/opentitan.c                     |  13 +-
 hw/riscv/sifive_e.c                      |  10 +-
 hw/riscv/sifive_u.c                      |  11 +-
 hw/riscv/spike.c                         |   4 +-
 hw/riscv/virt.c                          |   4 +-
 hw/rx/rx-gdbsim.c                        |  12 +-
 hw/s390x/css.c                           |   5 +-
 hw/s390x/event-facility.c                |  13 +-
 hw/s390x/ipl.c                           |  27 ++-
 hw/s390x/s390-pci-bus.c                  |  14 +-
 hw/s390x/s390-skeys.c                    |   2 +-
 hw/s390x/s390-stattrib.c                 |   2 +-
 hw/s390x/s390-virtio-ccw.c               |  20 +-
 hw/s390x/sclp.c                          |  13 +-
 hw/s390x/virtio-ccw-crypto.c             |  10 +-
 hw/s390x/virtio-ccw-rng.c                |   8 +-
 hw/scsi/scsi-bus.c                       |  15 +-
 hw/scsi/vhost-scsi.c                     |   4 +-
 hw/sd/aspeed_sdhci.c                     |  15 +-
 hw/sd/sd.c                               |   3 +-
 hw/sd/sdhci-pci.c                        |   7 +-
 hw/sd/sdhci.c                            |  21 +-
 hw/sd/ssi-sd.c                           |  15 +-
 hw/smbios/smbios.c                       |  33 +--
 hw/sparc/sun4m.c                         |   2 +-
 hw/sparc64/sun4u.c                       |   2 +-
 hw/usb/bus.c                             |   7 +-
 hw/usb/dev-storage.c                     |   9 +-
 hw/usb/hcd-dwc2.c                        |   9 +-
 hw/vfio/pci-quirks.c                     |   5 +-
 hw/vfio/pci.c                            |  10 +-
 hw/virtio/virtio-balloon.c               |  17 +-
 hw/virtio/virtio-crypto-pci.c            |   9 +-
 hw/virtio/virtio-iommu-pci.c             |   4 +-
 hw/virtio/virtio-mem-pci.c               |   4 +-
 hw/virtio/virtio-pmem-pci.c              |   2 +-
 hw/virtio/virtio-rng-pci.c               |   8 +-
 hw/virtio/virtio-rng.c                   |  11 +-
 hw/xen/xen-backend.c                     |   7 +-
 hw/xen/xen-bus.c                         |  92 ++++-----
 hw/xen/xen-host-pci-device.c             |  27 ++-
 hw/xen/xen_pt.c                          |  25 +--
 hw/xen/xen_pt_config_init.c              |  20 +-
 iothread.c                               |  18 +-
 linux-user/syscall.c                     |   2 +-
 monitor/hmp-cmds.c                       |  11 +-
 monitor/monitor.c                        |  21 +-
 nbd/client.c                             |   5 +
 nbd/server.c                             |   5 +
 net/colo-compare.c                       |  26 +--
 net/dump.c                               |  13 +-
 net/filter-buffer.c                      |  13 +-
 net/filter.c                             |   2 +-
 net/net.c                                |  10 +-
 net/tap.c                                |   6 +-
 qapi/opts-visitor.c                      |  66 +++---
 qapi/qapi-clone-visitor.c                |  69 ++++---
 qapi/qapi-dealloc-visitor.c              |  27 ++-
 qapi/qapi-visit-core.c                   | 197 +++++++++---------
 qapi/qobject-input-visitor.c             | 109 ++++++----
 qapi/qobject-output-visitor.c            |  27 ++-
 qapi/string-input-visitor.c              |  67 +++---
 qapi/string-output-visitor.c             |  32 +--
 qdev-monitor.c                           |  39 ++--
 qemu-img.c                               |  31 +--
 qga/commands-posix.c                     |   4 +-
 qga/commands-win32.c                     |  22 +-
 qom/object.c                             | 244 +++++++++++-----------
 qom/object_interfaces.c                  |  30 +--
 qom/qom-hmp-cmds.c                       |   2 +-
 qom/qom-qmp-cmds.c                       |   2 +-
 qom/qom-qobject.c                        |  14 +-
 softmmu/vl.c                             |  17 +-
 target/arm/cpu64.c                       |  15 +-
 target/arm/monitor.c                     |   7 +-
 target/i386/cpu.c                        |  98 ++++-----
 target/ppc/compat.c                      |   5 +-
 target/ppc/translate_init.inc.c          |   2 +-
 target/s390x/cpu_models.c                |  17 +-
 target/sparc/cpu.c                       |   5 +-
 tpm.c                                    |   5 +-
 ui/console.c                             |   4 +-
 ui/vnc.c                                 |   2 +-
 util/main-loop.c                         |   4 +-
 util/qemu-config.c                       |  25 +--
 util/qemu-option.c                       | 259 ++++++++++++------------
 MAINTAINERS                              |   1 +
 scripts/qapi/commands.py                 |  22 +-
 scripts/qapi/visit.py                    | 107 ++++------
 294 files changed, 3069 insertions(+), 3791 deletions(-)
 create mode 100644 scripts/coccinelle/errp-guard.cocci
Signature · 1 line
2.26.2
#6 lore raw
Quoted 13 lines · Markus Armbruster

The following changes since commit b6d7e9b66f59ca6ebc6e9b830cd5e7bf849d31cf:

Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging (2020-07-10 09:01:28 +0100)

are available in the Git repository at:

git://repo.or.cz/qemu/armbru.git tags/pull-error-2020-07-07-v2

for you to fetch changes up to 1de7096d8378a57e2d75d9cacc9a119e7e41640d:

xen: Use ERRP_GUARD() (2020-07-10 15:18:09 +0200)

Quoted 8 lines

----------------------------------------------------------------
Error reporting patches patches for 2020-07-07

* Improve documentation
* Codify rules for less clumsy error handling
* Convert a substantial amount of code to adhere to them
* ERRP_GUARD() infrastructure to avoid more clumsiness
* First batch of conversions to it

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.1
for any user-visible changes.

-- PMM

#4 lore raw

Re: [PULL v2 14/53] qemu-option: Use returned bool to check for failure

In reply to Markus Armbruster
Quoted 8 lines · Markus Armbruster

The previous commit enables conversion of

    foo(..., &err);
    if (err) {
        ...
    }
Quoted 8 lines

to

    if (!foo(..., &err)) {
        ...
    }

for QemuOpts functions that now return true / false on success / error.

Hi; this patch changes a lot of callsites of qemu_opts_absorb_qdict() which previously didn't check their return value to now check it, like this:

Quoted 5 lines
block.c +0 -0
index 62e40db2f1..850755e04e 100644

block.c static int bdrv_open_common(BlockDriverState *bs, BlockBackend *file, · line 1635

Quoted 9 lines
block.c +1 -2
@@ -1629,8 +1629,7 @@ static int bdrv_open_common(BlockDriverState *bs, BlockBackend *file,
     assert(options != NULL && bs->options != options);
 
     opts = qemu_opts_create(&bdrv_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
         error_propagate(errp, local_err);
         ret = -EINVAL;
         goto fail_opts;

This has triggered Coverity's "X out of Y callsites preferred to check the return value" heuristic. Specifically, null_file_open() (CID 1430366) and nvme_file_open() (CID 1430347) don't check the return value. In both cases that's in some sense OK, because they pass error_abort; but it seems a bit inconsistent that other foo_file_open() functions check and pass up the error and these do not.

thanks
-- PMM