Skip to contentSkip to conversation

error: auto propagated local_err

RFC Superseded Vladimir Sementsov-Ogievskiy 14 participants 215 messages Oct 11, 2019 – Dec 6, 2019 Page 3 of 3

Subsystems (14)

v5 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#150 lore raw

RFC v5 86/126 TPM: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 hw/tpm/tpm_util.c | 7 +++----
 tpm.c             | 7 +++----
 2 files changed, 6 insertions(+), 8 deletions(-)
hw/tpm/tpm_util.c +3 -4
index 62b091f0c0..b0657bbbf2 100644
@@ -47,8 +47,8 @@ static void get_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
 static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
                     Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     DeviceState *dev = DEVICE(obj);
-    Error *local_err = NULL;
     Property *prop = opaque;
     TPMBackend *s, **be = qdev_get_prop_ptr(dev, prop);
     char *str;
@@ -58,9 +58,8 @@ static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
         return;
     }
 
-    visit_type_str(v, name, &str, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_str(v, name, &str, errp);
+    if (*errp) {
         return;
     }
 
tpm.c +3 -4
index 9c9e20bbb7..359ebb7f68 100644
@@ -81,11 +81,11 @@ TPMBackend *qemu_find_tpm_be(const char *id)
 
 static int tpm_init_tpmdev(void *dummy, QemuOpts *opts, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     const char *value;
     const char *id;
     const TPMBackendClass *be;
     TPMBackend *drv;
-    Error *local_err = NULL;
     int i;
 
     if (!QLIST_EMPTY(&tpm_backends)) {
@@ -116,9 +116,8 @@ 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) {
-        error_propagate(errp, local_err);
+    qemu_opts_validate(opts, be->opts, errp);
+    if (*errp) {
         return 1;
     }
 
Signature · 1 line
2.21.0
Reviewed-by on v5 86/126
#151 lore raw

Re: [RFC v5 086/126] TPM: introduce ERRP_AUTO_PROPAGATE

Quoted 35 lines · Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

     spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
     --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
     ...
     goto out;
     ...
     out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

Quoted 8 lines

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

Quoted 60 lines
---
  hw/tpm/tpm_util.c | 7 +++----
  tpm.c             | 7 +++----
  2 files changed, 6 insertions(+), 8 deletions(-)
hw/tpm/tpm_util.c +3 -4
index 62b091f0c0..b0657bbbf2 100644
@@ -47,8 +47,8 @@ static void get_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
  static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
                      Error **errp)
  {
+    ERRP_AUTO_PROPAGATE();
      DeviceState *dev = DEVICE(obj);
-    Error *local_err = NULL;
      Property *prop = opaque;
      TPMBackend *s, **be = qdev_get_prop_ptr(dev, prop);
      char *str;
@@ -58,9 +58,8 @@ static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque,
          return;
      }
 
-    visit_type_str(v, name, &str, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_str(v, name, &str, errp);
+    if (*errp) {
          return;
      }
 
tpm.c +3 -4
index 9c9e20bbb7..359ebb7f68 100644
@@ -81,11 +81,11 @@ TPMBackend *qemu_find_tpm_be(const char *id)
 
  static int tpm_init_tpmdev(void *dummy, QemuOpts *opts, Error **errp)
  {
+    ERRP_AUTO_PROPAGATE();
      const char *value;
      const char *id;
      const TPMBackendClass *be;
      TPMBackend *drv;
-    Error *local_err = NULL;
      int i;
 
      if (!QLIST_EMPTY(&tpm_backends)) {
@@ -116,9 +116,8 @@ 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) {
-        error_propagate(errp, local_err);
+    qemu_opts_validate(opts, be->opts, errp);
+    if (*errp) {
          return 1;
      }
 
#152 lore raw

RFC v5 87/126 Migration: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 migration/migration.c | 39 ++++++++++++++++++---------------------
 migration/ram.c       | 13 ++++++-------
 migration/rdma.c      | 13 ++++++-------
 migration/savevm.c    |  2 ++
 migration/socket.c    | 18 ++++++++----------
 5 files changed, 40 insertions(+), 45 deletions(-)
migration/migration.c +18 -21
index 5f7e4d15e9..36a0b9e783 100644
@@ -583,6 +583,7 @@ void migration_fd_process_incoming(QEMUFile *f)
 
 void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     MigrationIncomingState *mis = migration_incoming_get_current();
     bool start_migration;
 
@@ -603,12 +604,10 @@ void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)
          */
         start_migration = !migrate_use_multifd();
     } else {
-        Error *local_err = NULL;
         /* Multiple connections */
         assert(migrate_use_multifd());
-        start_migration = multifd_recv_new_channel(ioc, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        start_migration = multifd_recv_new_channel(ioc, errp);
+        if (*errp) {
             return;
         }
     }
@@ -971,6 +970,7 @@ static bool migrate_caps_check(bool *cap_list,
                                MigrationCapabilityStatusList *params,
                                Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     MigrationCapabilityStatusList *cap;
     bool old_postcopy_cap;
     MigrationIncomingState *mis = migration_incoming_get_current();
@@ -1764,7 +1764,7 @@ void migrate_del_blocker(Error *reason)
 
 void qmp_migrate_incoming(const char *uri, Error **errp)
 {
-    Error *local_err = NULL;
+    ERRP_AUTO_PROPAGATE();
     static bool once = true;
 
     if (!deferred_incoming) {
@@ -1775,10 +1775,9 @@ void qmp_migrate_incoming(const char *uri, Error **errp)
         error_setg(errp, "The incoming migration has already been started");
     }
 
-    qemu_start_incoming_migration(uri, &local_err);
+    qemu_start_incoming_migration(uri, errp);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         return;
     }
 
@@ -1856,7 +1855,7 @@ bool migration_is_blocked(Error **errp)
 static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc,
                             bool resume, Error **errp)
 {
-    Error *local_err = NULL;
+    ERRP_AUTO_PROPAGATE();
 
     if (resume) {
         if (s->state != MIGRATION_STATUS_POSTCOPY_PAUSED) {
@@ -1909,9 +1908,8 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc,
                        "current migration capabilities");
             return false;
         }
-        migrate_set_block_enabled(true, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        migrate_set_block_enabled(true, errp);
+        if (*errp) {
             return false;
         }
         s->must_remove_block_options = true;
@@ -1935,7 +1933,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
                  bool has_inc, bool inc, bool has_detach, bool detach,
                  bool has_resume, bool resume, Error **errp)
 {
-    Error *local_err = NULL;
+    ERRP_AUTO_PROPAGATE();
     MigrationState *s = migrate_get_current();
     const char *p;
 
@@ -1946,17 +1944,17 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
     }
 
     if (strstart(uri, "tcp:", &p)) {
-        tcp_start_outgoing_migration(s, p, &local_err);
+        tcp_start_outgoing_migration(s, p, errp);
 #ifdef CONFIG_RDMA
     } else if (strstart(uri, "rdma:", &p)) {
-        rdma_start_outgoing_migration(s, p, &local_err);
+        rdma_start_outgoing_migration(s, p, errp);
 #endif
     } else if (strstart(uri, "exec:", &p)) {
-        exec_start_outgoing_migration(s, p, &local_err);
+        exec_start_outgoing_migration(s, p, errp);
     } else if (strstart(uri, "unix:", &p)) {
-        unix_start_outgoing_migration(s, p, &local_err);
+        unix_start_outgoing_migration(s, p, errp);
     } else if (strstart(uri, "fd:", &p)) {
-        fd_start_outgoing_migration(s, p, &local_err);
+        fd_start_outgoing_migration(s, p, errp);
     } else {
         error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "uri",
                    "a valid migration protocol");
@@ -1966,9 +1964,8 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
         return;
     }
 
-    if (local_err) {
-        migrate_fd_error(s, local_err);
-        error_propagate(errp, local_err);
+    if (*errp) {
+        migrate_fd_error(s, *errp);
         return;
     }
 }
migration/ram.c +6 -7
index 22423f08cd..0100c11dd7 100644
@@ -1474,14 +1474,14 @@ bool multifd_recv_all_channels_created(void)
  */
 bool multifd_recv_new_channel(QIOChannel *ioc, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     MultiFDRecvParams *p;
-    Error *local_err = NULL;
     int id;
 
-    id = multifd_recv_initial_packet(ioc, &local_err);
+    id = multifd_recv_initial_packet(ioc, errp);
     if (id < 0) {
-        multifd_recv_terminate_threads(local_err);
-        error_propagate_prepend(errp, local_err,
+        multifd_recv_terminate_threads(*errp);
+        error_prepend(errp,
                                 "failed to receive packet"
                                 " via multifd channel %d: ",
                                 atomic_read(&multifd_recv_state->count));
@@ -1491,10 +1491,9 @@ bool multifd_recv_new_channel(QIOChannel *ioc, Error **errp)
 
     p = &multifd_recv_state->params[id];
     if (p->c != NULL) {
-        error_setg(&local_err, "multifd: received id '%d' already setup'",
+        error_setg(errp, "multifd: received id '%d' already setup'",
                    id);
-        multifd_recv_terminate_threads(local_err);
-        error_propagate(errp, local_err);
+        multifd_recv_terminate_threads(*errp);
         return false;
     }
     p->c = ioc;
migration/rdma.c +6 -7
index 4c74e88a37..db985fee73 100644
@@ -2396,8 +2396,9 @@ static void qemu_rdma_cleanup(RDMAContext *rdma)
 
 static int qemu_rdma_source_init(RDMAContext *rdma, bool pin_all, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int ret, idx;
-    Error *local_err = NULL, **temp = &local_err;
+    Error **temp = errp;
 
     /*
      * Will be validated against destination's actual capabilities
@@ -2450,7 +2451,6 @@ static int qemu_rdma_source_init(RDMAContext *rdma, bool pin_all, Error **errp)
     return 0;
 
 err_rdma_source_init:
-    error_propagate(errp, local_err);
     qemu_rdma_cleanup(rdma);
     return -1;
 }
@@ -4044,18 +4044,18 @@ static void rdma_accept_incoming_migration(void *opaque)
 
 void rdma_start_incoming_migration(const char *host_port, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int ret;
     RDMAContext *rdma, *rdma_return_path = NULL;
-    Error *local_err = NULL;
 
     trace_rdma_start_incoming_migration();
-    rdma = qemu_rdma_data_init(host_port, &local_err);
+    rdma = qemu_rdma_data_init(host_port, errp);
 
     if (rdma == NULL) {
         goto err;
     }
 
-    ret = qemu_rdma_dest_init(rdma, &local_err);
+    ret = qemu_rdma_dest_init(rdma, errp);
 
     if (ret) {
         goto err;
@@ -4074,7 +4074,7 @@ void rdma_start_incoming_migration(const char *host_port, Error **errp)
 
     /* initialize the RDMAContext for return path */
     if (migrate_postcopy()) {
-        rdma_return_path = qemu_rdma_data_init(host_port, &local_err);
+        rdma_return_path = qemu_rdma_data_init(host_port, errp);
 
         if (rdma_return_path == NULL) {
             goto err;
@@ -4087,7 +4087,6 @@ void rdma_start_incoming_migration(const char *host_port, Error **errp)
                         NULL, (void *)(intptr_t)rdma);
     return;
 err:
-    error_propagate(errp, local_err);
     g_free(rdma);
     g_free(rdma_return_path);
 }
migration/savevm.c +2 -0
index bb9462a54d..f9293fe192 100644
@@ -2586,6 +2586,7 @@ int qemu_load_device_state(QEMUFile *f)
 
 int save_snapshot(const char *name, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockDriverState *bs, *bs1;
     QEMUSnapshotInfo sn1, *sn = &sn1, old_sn1, *old_sn = &old_sn1;
     int ret = -1;
@@ -2790,6 +2791,7 @@ void qmp_xen_load_devices_state(const char *filename, Error **errp)
 
 int load_snapshot(const char *name, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockDriverState *bs, *bs_vm_state;
     QEMUSnapshotInfo sn;
     QEMUFile *f;
migration/socket.c +8 -10
index 97c9efde59..bc07ef92a1 100644
@@ -139,12 +139,11 @@ void tcp_start_outgoing_migration(MigrationState *s,
                                   const char *host_port,
                                   Error **errp)
 {
-    Error *err = NULL;
-    SocketAddress *saddr = tcp_build_address(host_port, &err);
-    if (!err) {
-        socket_start_outgoing_migration(s, saddr, &err);
+    ERRP_AUTO_PROPAGATE();
+    SocketAddress *saddr = tcp_build_address(host_port, errp);
+    if (!*errp) {
+        socket_start_outgoing_migration(s, saddr, errp);
     }
-    error_propagate(errp, err);
 }
 
 void unix_start_outgoing_migration(MigrationState *s,
@@ -209,13 +208,12 @@ static void socket_start_incoming_migration(SocketAddress *saddr,
 
 void tcp_start_incoming_migration(const char *host_port, Error **errp)
 {
-    Error *err = NULL;
-    SocketAddress *saddr = tcp_build_address(host_port, &err);
-    if (!err) {
-        socket_start_incoming_migration(saddr, &err);
+    ERRP_AUTO_PROPAGATE();
+    SocketAddress *saddr = tcp_build_address(host_port, errp);
+    if (!*errp) {
+        socket_start_incoming_migration(saddr, errp);
     }
     qapi_free_SocketAddress(saddr);
-    error_propagate(errp, err);
 }
 
 void unix_start_incoming_migration(const char *path, Error **errp)
Signature · 1 line
2.21.0
#153 lore raw

RFC v5 88/126 Cryptography: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 crypto/block-luks.c | 56 +++++++++++++++++++--------------------------
 crypto/secret.c     | 17 ++++++--------
 crypto/tlssession.c |  7 +++---
 3 files changed, 33 insertions(+), 47 deletions(-)
crypto/block-luks.c +23 -33
index 4861db810c..45c21c2fcc 100644
@@ -442,8 +442,8 @@ qcrypto_block_luks_store_header(QCryptoBlock *block,
                                 void *opaque,
                                 Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     const QCryptoBlockLUKS *luks = block->opaque;
-    Error *local_err = NULL;
     size_t i;
     g_autofree QCryptoBlockLUKSHeader *hdr_copy = NULL;
 
@@ -469,10 +469,9 @@ qcrypto_block_luks_store_header(QCryptoBlock *block,
 
     /* Write out the partition header and key slot headers */
     writefunc(block, 0, (const uint8_t *)hdr_copy, sizeof(*hdr_copy),
-              opaque, &local_err);
+              opaque, errp);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         return -1;
     }
     return 0;
@@ -603,9 +602,9 @@ qcrypto_block_luks_check_header(const QCryptoBlockLUKS *luks, Error **errp)
 static int
 qcrypto_block_luks_parse_header(QCryptoBlockLUKS *luks, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     g_autofree char *cipher_mode = g_strdup(luks->header.cipher_mode);
     char *ivgen_name, *ivhash_name;
-    Error *local_err = NULL;
 
     /*
      * The cipher_mode header contains a string that we have
@@ -632,17 +631,15 @@ qcrypto_block_luks_parse_header(QCryptoBlockLUKS *luks, Error **errp)
         ivhash_name++;
 
         luks->ivgen_hash_alg = qcrypto_block_luks_hash_name_lookup(ivhash_name,
-                                                                   &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+                                                                   errp);
+        if (*errp) {
             return -1;
         }
     }
 
     luks->cipher_mode = qcrypto_block_luks_cipher_mode_lookup(cipher_mode,
-                                                              &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+                                                              errp);
+    if (*errp) {
         return -1;
     }
 
@@ -650,24 +647,21 @@ qcrypto_block_luks_parse_header(QCryptoBlockLUKS *luks, Error **errp)
             qcrypto_block_luks_cipher_name_lookup(luks->header.cipher_name,
                                                   luks->cipher_mode,
                                                   luks->header.master_key_len,
-                                                  &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+                                                  errp);
+    if (*errp) {
         return -1;
     }
 
     luks->hash_alg =
             qcrypto_block_luks_hash_name_lookup(luks->header.hash_spec,
-                                                &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+                                                errp);
+    if (*errp) {
         return -1;
     }
 
     luks->ivgen_alg = qcrypto_block_luks_ivgen_name_lookup(ivgen_name,
-                                                           &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+                                                           errp);
+    if (*errp) {
         return -1;
     }
 
@@ -679,9 +673,8 @@ qcrypto_block_luks_parse_header(QCryptoBlockLUKS *luks, Error **errp)
         luks->ivgen_cipher_alg =
                 qcrypto_block_luks_essiv_cipher(luks->cipher_alg,
                                                 luks->ivgen_hash_alg,
-                                                &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+                                                errp);
+        if (*errp) {
             return -1;
         }
     } else {
@@ -1186,9 +1179,9 @@ qcrypto_block_luks_create(QCryptoBlock *block,
                           void *opaque,
                           Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     QCryptoBlockLUKS *luks;
     QCryptoBlockCreateOptionsLUKS luks_opts;
-    Error *local_err = NULL;
     g_autofree uint8_t *masterkey = NULL;
     size_t header_sectors;
     size_t split_key_sectors;
@@ -1298,9 +1291,8 @@ qcrypto_block_luks_create(QCryptoBlock *block,
         luks->ivgen_cipher_alg =
                 qcrypto_block_luks_essiv_cipher(luks_opts.cipher_alg,
                                                 luks_opts.ivgen_hash_alg,
-                                                &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+                                                errp);
+        if (*errp) {
             goto error;
         }
     } else {
@@ -1364,9 +1356,8 @@ qcrypto_block_luks_create(QCryptoBlock *block,
                                        luks->header.master_key_salt,
                                        QCRYPTO_BLOCK_LUKS_SALT_LEN,
                                        QCRYPTO_BLOCK_LUKS_DIGEST_LEN,
-                                       &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+                                       errp);
+    if (*errp) {
         goto error;
     }
 
@@ -1439,9 +1430,8 @@ qcrypto_block_luks_create(QCryptoBlock *block,
         block->sector_size;
 
     /* Reserve header space to match payload offset */
-    initfunc(block, block->payload_offset, opaque, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    initfunc(block, block->payload_offset, opaque, errp);
+    if (*errp) {
         goto error;
     }
 
crypto/secret.c +7 -10
index 1cf0ad0ce8..962d2c1d44 100644
@@ -178,27 +178,25 @@ qcrypto_secret_prop_set_loaded(Object *obj,
                                bool value,
                                Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     QCryptoSecret *secret = QCRYPTO_SECRET(obj);
 
     if (value) {
-        Error *local_err = NULL;
         uint8_t *input = NULL;
         size_t inputlen = 0;
         uint8_t *output = NULL;
         size_t outputlen = 0;
 
-        qcrypto_secret_load_data(secret, &input, &inputlen, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        qcrypto_secret_load_data(secret, &input, &inputlen, errp);
+        if (*errp) {
             return;
         }
 
         if (secret->keyid) {
             qcrypto_secret_decrypt(secret, input, inputlen,
-                                   &output, &outputlen, &local_err);
+                                   &output, &outputlen, errp);
             g_free(input);
-            if (local_err) {
-                error_propagate(errp, local_err);
+            if (*errp) {
                 return;
             }
             input = output;
@@ -206,10 +204,9 @@ qcrypto_secret_prop_set_loaded(Object *obj,
         } else {
             if (secret->format != QCRYPTO_SECRET_FORMAT_RAW) {
                 qcrypto_secret_decode(input, inputlen,
-                                      &output, &outputlen, &local_err);
+                                      &output, &outputlen, errp);
                 g_free(input);
-                if (local_err) {
-                    error_propagate(errp, local_err);
+                if (*errp) {
                     return;
                 }
                 input = output;
crypto/tlssession.c +3 -4
index 33203e8ca7..abb3912304 100644
@@ -256,13 +256,13 @@ static int
 qcrypto_tls_session_check_certificate(QCryptoTLSSession *session,
                                       Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int ret;
     unsigned int status;
     const gnutls_datum_t *certs;
     unsigned int nCerts, i;
     time_t now;
     gnutls_x509_crt_t cert = NULL;
-    Error *err = NULL;
 
     now = time(NULL);
     if (now == ((time_t)-1)) {
@@ -354,9 +354,8 @@ qcrypto_tls_session_check_certificate(QCryptoTLSSession *session,
                 bool allow;
 
                 allow = qauthz_is_allowed_by_id(session->authzid,
-                                                session->peername, &err);
-                if (err) {
-                    error_propagate(errp, err);
+                                                session->peername, errp);
+                if (*errp) {
                     goto error;
                 }
                 if (!allow) {
Signature · 1 line
2.21.0
#154 lore raw

RFC v5 89/126 I/O Channels: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 io/dns-resolver.c | 7 +++----
 io/net-listener.c | 7 +++----
 2 files changed, 6 insertions(+), 8 deletions(-)
io/dns-resolver.c +3 -4
index 6ebe2a5650..a45c5ca0c8 100644
@@ -52,13 +52,13 @@ static int qio_dns_resolver_lookup_sync_inet(QIODNSResolver *resolver,
                                              SocketAddress ***addrs,
                                              Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     struct addrinfo ai, *res, *e;
     InetSocketAddress *iaddr = &addr->u.inet;
     char port[33];
     char uaddr[INET6_ADDRSTRLEN + 1];
     char uport[33];
     int rc;
-    Error *err = NULL;
     size_t i;
 
     *naddrs = 0;
@@ -69,11 +69,10 @@ static int qio_dns_resolver_lookup_sync_inet(QIODNSResolver *resolver,
     if (iaddr->has_numeric && iaddr->numeric) {
         ai.ai_flags |= AI_NUMERICHOST | AI_NUMERICSERV;
     }
-    ai.ai_family = inet_ai_family_from_address(iaddr, &err);
+    ai.ai_family = inet_ai_family_from_address(iaddr, errp);
     ai.ai_socktype = SOCK_STREAM;
 
-    if (err) {
-        error_propagate(errp, err);
+    if (*errp) {
         return -1;
     }
 
io/net-listener.c +3 -4
index 5d8a226872..ba000e7ede 100644
@@ -65,11 +65,11 @@ int qio_net_listener_open_sync(QIONetListener *listener,
                                int num,
                                Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     QIODNSResolver *resolver = qio_dns_resolver_get_instance();
     SocketAddress **resaddrs;
     size_t nresaddrs;
     size_t i;
-    Error *err = NULL;
     bool success = false;
 
     if (qio_dns_resolver_lookup_sync(resolver,
@@ -84,7 +84,7 @@ int qio_net_listener_open_sync(QIONetListener *listener,
         QIOChannelSocket *sioc = qio_channel_socket_new();
 
         if (qio_channel_socket_listen_sync(sioc, resaddrs[i], num,
-                                           err ? NULL : &err) == 0) {
+                                           *errp ? NULL : errp) == 0) {
             success = true;
 
             qio_net_listener_add(listener, sioc);
@@ -96,10 +96,9 @@ int qio_net_listener_open_sync(QIONetListener *listener,
     g_free(resaddrs);
 
     if (success) {
-        error_free(err);
+        error_free_errp(errp);
         return 0;
     } else {
-        error_propagate(errp, err);
         return -1;
     }
 }
Signature · 1 line
2.21.0
#155 lore raw

RFC v5 90/126 Sockets: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 util/qemu-sockets.c | 31 ++++++++++++++-----------------
 1 file changed, 14 insertions(+), 17 deletions(-)
util/qemu-sockets.c +14 -17
index bcc06d0e01..12db07c092 100644
@@ -211,6 +211,7 @@ static int inet_listen_saddr(InetSocketAddress *saddr,
                              int num,
                              Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     struct addrinfo ai,*res,*e;
     char port[33];
     char uaddr[INET6_ADDRSTRLEN+1];
@@ -219,7 +220,6 @@ static int inet_listen_saddr(InetSocketAddress *saddr,
     int slisten = -1;
     int saved_errno = 0;
     bool socket_created = false;
-    Error *err = NULL;
 
     if (saddr->keep_alive) {
         error_setg(errp, "keep-alive option is not supported for passive "
@@ -232,11 +232,10 @@ static int inet_listen_saddr(InetSocketAddress *saddr,
     if (saddr->has_numeric && saddr->numeric) {
         ai.ai_flags |= AI_NUMERICHOST | AI_NUMERICSERV;
     }
-    ai.ai_family = inet_ai_family_from_address(saddr, &err);
+    ai.ai_family = inet_ai_family_from_address(saddr, errp);
     ai.ai_socktype = SOCK_STREAM;
 
-    if (err) {
-        error_propagate(errp, err);
+    if (*errp) {
         return -1;
     }
 
@@ -387,9 +386,9 @@ static int inet_connect_addr(struct addrinfo *addr, Error **errp)
 static struct addrinfo *inet_parse_connect_saddr(InetSocketAddress *saddr,
                                                  Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     struct addrinfo ai, *res;
     int rc;
-    Error *err = NULL;
     static int useV4Mapped = 1;
 
     memset(&ai, 0, sizeof(ai));
@@ -398,11 +397,10 @@ static struct addrinfo *inet_parse_connect_saddr(InetSocketAddress *saddr,
     if (atomic_read(&useV4Mapped)) {
         ai.ai_flags |= AI_V4MAPPED;
     }
-    ai.ai_family = inet_ai_family_from_address(saddr, &err);
+    ai.ai_family = inet_ai_family_from_address(saddr, errp);
     ai.ai_socktype = SOCK_STREAM;
 
-    if (err) {
-        error_propagate(errp, err);
+    if (*errp) {
         return NULL;
     }
 
@@ -443,7 +441,7 @@ static struct addrinfo *inet_parse_connect_saddr(InetSocketAddress *saddr,
  */
 int inet_connect_saddr(InetSocketAddress *saddr, Error **errp)
 {
-    Error *local_err = NULL;
+    ERRP_AUTO_PROPAGATE();
     struct addrinfo *res, *e;
     int sock = -1;
 
@@ -453,9 +451,8 @@ int inet_connect_saddr(InetSocketAddress *saddr, Error **errp)
     }
 
     for (e = res; e != NULL; e = e->ai_next) {
-        error_free(local_err);
-        local_err = NULL;
-        sock = inet_connect_addr(e, &local_err);
+        error_free_errp(errp);
+        sock = inet_connect_addr(e, errp);
         if (sock >= 0) {
             break;
         }
@@ -464,7 +461,6 @@ int inet_connect_saddr(InetSocketAddress *saddr, Error **errp)
     freeaddrinfo(res);
 
     if (sock < 0) {
-        error_propagate(errp, local_err);
         return sock;
     }
 
@@ -487,20 +483,19 @@ static int inet_dgram_saddr(InetSocketAddress *sraddr,
                             InetSocketAddress *sladdr,
                             Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     struct addrinfo ai, *peer = NULL, *local = NULL;
     const char *addr;
     const char *port;
     int sock = -1, rc;
-    Error *err = NULL;
 
     /* lookup peer addr */
     memset(&ai,0, sizeof(ai));
     ai.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ADDRCONFIG;
-    ai.ai_family = inet_ai_family_from_address(sraddr, &err);
+    ai.ai_family = inet_ai_family_from_address(sraddr, errp);
     ai.ai_socktype = SOCK_DGRAM;
 
-    if (err) {
-        error_propagate(errp, err);
+    if (*errp) {
         goto err;
     }
 
@@ -861,6 +856,7 @@ static int unix_listen_saddr(UnixSocketAddress *saddr,
                              int num,
                              Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     struct sockaddr_un un;
     int sock, fd;
     char *pathbuf = NULL;
@@ -936,6 +932,7 @@ err:
 
 static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     struct sockaddr_un un;
     int sock, rc;
     size_t pathlen;
Signature · 1 line
2.21.0
#156 lore raw

RFC v5 91/126 colo: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 migration/colo.c | 38 +++++++++++++++++---------------------
 1 file changed, 17 insertions(+), 21 deletions(-)
migration/colo.c +17 -21
index 2c88aa57a2..375aa6d8ce 100644
@@ -243,19 +243,19 @@ void qmp_xen_set_replication(bool enable, bool primary,
 
 ReplicationStatus *qmp_query_xen_replication_status(Error **errp)
 {
-    Error *err = NULL;
+    ERRP_AUTO_PROPAGATE();
     ReplicationStatus *s = g_new0(ReplicationStatus, 1);
 
-    replication_get_error_all(&err);
-    if (err) {
+    replication_get_error_all(errp);
+    if (*errp) {
         s->error = true;
         s->has_desc = true;
-        s->desc = g_strdup(error_get_pretty(err));
+        s->desc = g_strdup(error_get_pretty(*errp));
     } else {
         s->error = false;
     }
 
-    error_free(err);
+    error_free_errp(errp);
     return s;
 }
 
@@ -314,12 +314,11 @@ static void colo_send_message(QEMUFile *f, COLOMessage msg,
 static void colo_send_message_value(QEMUFile *f, COLOMessage msg,
                                     uint64_t value, Error **errp)
 {
-    Error *local_err = NULL;
+    ERRP_AUTO_PROPAGATE();
     int ret;
 
-    colo_send_message(f, msg, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    colo_send_message(f, msg, errp);
+    if (*errp) {
         return;
     }
     qemu_put_be64(f, value);
@@ -354,12 +353,11 @@ static COLOMessage colo_receive_message(QEMUFile *f, Error **errp)
 static void colo_receive_check_message(QEMUFile *f, COLOMessage expect_msg,
                                        Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     COLOMessage msg;
-    Error *local_err = NULL;
 
-    msg = colo_receive_message(f, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    msg = colo_receive_message(f, errp);
+    if (*errp) {
         return;
     }
     if (msg != expect_msg) {
@@ -371,13 +369,12 @@ static void colo_receive_check_message(QEMUFile *f, COLOMessage expect_msg,
 static uint64_t colo_receive_message_value(QEMUFile *f, uint32_t expect_msg,
                                            Error **errp)
 {
-    Error *local_err = NULL;
+    ERRP_AUTO_PROPAGATE();
     uint64_t value;
     int ret;
 
-    colo_receive_check_message(f, expect_msg, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    colo_receive_check_message(f, expect_msg, errp);
+    if (*errp) {
         return 0;
     }
 
@@ -667,12 +664,11 @@ void migrate_start_colo_process(MigrationState *s)
 static void colo_wait_handle_message(QEMUFile *f, int *checkpoint_request,
                                      Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     COLOMessage msg;
-    Error *local_err = NULL;
 
-    msg = colo_receive_message(f, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    msg = colo_receive_message(f, errp);
+    if (*errp) {
         return;
     }
 
Signature · 1 line
2.21.0
#157 lore raw

RFC v5 92/126 Record/replay: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/blkreplay.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
block/blkreplay.c +3 -4
index 2b7931b940..4b548e382f 100644
@@ -23,15 +23,14 @@ typedef struct Request {
 static int blkreplay_open(BlockDriverState *bs, QDict *options, int flags,
                           Error **errp)
 {
-    Error *local_err = NULL;
+    ERRP_AUTO_PROPAGATE();
     int ret;
 
     /* Open the image file */
     bs->file = bdrv_open_child(NULL, options, "image",
-                               bs, &child_file, false, &local_err);
-    if (local_err) {
+                               bs, &child_file, false, errp);
+    if (*errp) {
         ret = -EINVAL;
-        error_propagate(errp, local_err);
         goto fail;
     }
 
Signature · 1 line
2.21.0
#158 lore raw

RFC v5 93/126 VMDK: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/vmdk.c | 41 +++++++++++++++++------------------------
 1 file changed, 17 insertions(+), 24 deletions(-)
block/vmdk.c +17 -24
index fed3b50c8a..bf1f2c4cac 100644
@@ -1078,6 +1078,7 @@ static const char *next_line(const char *s)
 static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
                               QDict *options, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int ret;
     int matches;
     char access[11];
@@ -1092,7 +1093,6 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
     BDRVVmdkState *s = bs->opaque;
     VmdkExtent *extent;
     char extent_opt_prefix[32];
-    Error *local_err = NULL;
 
     for (p = desc; *p; p = next_line(p)) {
         /* parse extent line in one of below formats:
@@ -1152,10 +1152,9 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
         assert(ret < 32);
 
         extent_file = bdrv_open_child(extent_path, options, extent_opt_prefix,
-                                      bs, &child_file, false, &local_err);
+                                      bs, &child_file, false, errp);
         g_free(extent_path);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        if (*errp) {
             ret = -EINVAL;
             goto out;
         }
@@ -1251,11 +1250,11 @@ exit:
 static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
                      Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     char *buf;
     int ret;
     BDRVVmdkState *s = bs->opaque;
     uint32_t magic;
-    Error *local_err = NULL;
 
     bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
                                false, errp);
@@ -1303,9 +1302,8 @@ static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The vmdk format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (*errp) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -2223,21 +2221,19 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
                               BlockBackend **pbb,
                               QemuOpts *opts, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int ret;
     BlockBackend *blk = NULL;
-    Error *local_err = NULL;
 
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto exit;
     }
 
     blk = blk_new_open(filename, NULL, NULL,
                        BDRV_O_RDWR | BDRV_O_RESIZE | BDRV_O_PROTOCOL,
-                       &local_err);
+                       errp);
     if (blk == NULL) {
-        error_propagate(errp, local_err);
         ret = -EIO;
         goto exit;
     }
@@ -2333,10 +2329,10 @@ static int coroutine_fn vmdk_co_do_create(int64_t size,
                                           void *opaque,
                                           Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int extent_idx;
     BlockBackend *blk = NULL;
     BlockBackend *extent_blk;
-    Error *local_err = NULL;
     char *desc = NULL;
     int ret = 0;
     bool flat, split, compress;
@@ -2440,9 +2436,8 @@ static int coroutine_fn vmdk_co_do_create(int64_t size,
         char *full_backing =
             bdrv_get_full_backing_filename_from_filename(blk_bs(blk)->filename,
                                                          backing_file,
-                                                         &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+                                                         errp);
+        if (*errp) {
             ret = -ENOENT;
             goto exit;
         }
@@ -2591,7 +2586,7 @@ exit:
 static int coroutine_fn vmdk_co_create_opts(const char *filename, QemuOpts *opts,
                                             Error **errp)
 {
-    Error *local_err = NULL;
+    ERRP_AUTO_PROPAGATE();
     char *desc = NULL;
     int64_t total_size = 0;
     char *adapter_type = NULL;
@@ -2634,9 +2629,8 @@ static int coroutine_fn vmdk_co_create_opts(const char *filename, QemuOpts *opts
         adapter_type_enum = qapi_enum_parse(&BlockdevVmdkAdapterType_lookup,
                                             adapter_type,
                                             BLOCKDEV_VMDK_ADAPTER_TYPE_IDE,
-                                            &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+                                            errp);
+        if (*errp) {
             ret = -EINVAL;
             goto exit;
         }
@@ -2651,9 +2645,8 @@ static int coroutine_fn vmdk_co_create_opts(const char *filename, QemuOpts *opts
         subformat = qapi_enum_parse(&BlockdevVmdkSubformat_lookup,
                                     fmt,
                                     BLOCKDEV_VMDK_SUBFORMAT_MONOLITHICSPARSE,
-                                    &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+                                    errp);
+        if (*errp) {
             ret = -EINVAL;
             goto exit;
         }
Signature · 1 line
2.21.0
#159 lore raw

RFC v5 94/126 RBD: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/rbd.c | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)
block/rbd.c +12 -17
index 057af43d48..fc821da17e 100644
@@ -428,10 +428,10 @@ static int coroutine_fn qemu_rbd_co_create_opts(const char *filename,
                                                 QemuOpts *opts,
                                                 Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockdevCreateOptions *create_options;
     BlockdevCreateOptionsRbd *rbd_opts;
     BlockdevOptionsRbd *loc;
-    Error *local_err = NULL;
     const char *keypairs, *password_secret;
     QDict *options = NULL;
     int ret = 0;
@@ -452,10 +452,9 @@ static int coroutine_fn qemu_rbd_co_create_opts(const char *filename,
     rbd_opts->has_cluster_size = (rbd_opts->cluster_size != 0);
 
     options = qdict_new();
-    qemu_rbd_parse_filename(filename, options, &local_err);
-    if (local_err) {
+    qemu_rbd_parse_filename(filename, options, errp);
+    if (*errp) {
         ret = -EINVAL;
-        error_propagate(errp, local_err);
         goto exit;
     }
 
@@ -572,8 +571,8 @@ static int qemu_rbd_connect(rados_t *cluster, rados_ioctx_t *io_ctx,
                             const char *keypairs, const char *secretid,
                             Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     char *mon_host = NULL;
-    Error *local_err = NULL;
     int r;
 
     if (secretid) {
@@ -586,9 +585,8 @@ static int qemu_rbd_connect(rados_t *cluster, rados_ioctx_t *io_ctx,
         opts->has_key_secret = true;
     }
 
-    mon_host = qemu_rbd_mon_host(opts, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    mon_host = qemu_rbd_mon_host(opts, errp);
+    if (*errp) {
         r = -EINVAL;
         goto failed_opts;
     }
@@ -660,8 +658,8 @@ failed_opts:
 static int qemu_rbd_convert_options(QDict *options, BlockdevOptionsRbd **opts,
                                     Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     Visitor *v;
-    Error *local_err = NULL;
 
     /* Convert the remaining options into a QAPI object */
     v = qobject_input_visitor_new_flat_confused(options, errp);
@@ -669,11 +667,10 @@ static int qemu_rbd_convert_options(QDict *options, BlockdevOptionsRbd **opts,
         return -EINVAL;
     }
 
-    visit_type_BlockdevOptionsRbd(v, NULL, opts, &local_err);
+    visit_type_BlockdevOptionsRbd(v, NULL, opts, errp);
     visit_free(v);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         return -EINVAL;
     }
 
@@ -710,10 +707,10 @@ static int qemu_rbd_attempt_legacy_options(QDict *options,
 static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
                          Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVRBDState *s = bs->opaque;
     BlockdevOptionsRbd *opts = NULL;
     const QDictEntry *e;
-    Error *local_err = NULL;
     char *keypairs, *secretid;
     int r;
 
@@ -727,13 +724,12 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
         qdict_del(options, "password-secret");
     }
 
-    r = qemu_rbd_convert_options(options, &opts, &local_err);
-    if (local_err) {
+    r = qemu_rbd_convert_options(options, &opts, errp);
+    if (*errp) {
         /* If keypairs are present, that means some options are present in
          * the modern option format.  Don't attempt to parse legacy option
          * formats, as we won't support mixed usage. */
         if (keypairs) {
-            error_propagate(errp, local_err);
             goto out;
         }
 
@@ -746,7 +742,6 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
         if (r < 0) {
             /* Propagate the original error, not the legacy parsing fallback
              * error, as the latter was just a best-effort attempt. */
-            error_propagate(errp, local_err);
             goto out;
         }
         /* Take care whenever deciding to actually deprecate; once this ability
Signature · 1 line
2.21.0
#160 lore raw

RFC v5 95/126 Sheepdog: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/sheepdog.c | 73 ++++++++++++++++++++++--------------------------
 1 file changed, 33 insertions(+), 40 deletions(-)
block/sheepdog.c +33 -40
index 773dfc6ab1..396ec1be28 100644
@@ -529,10 +529,10 @@ static void sd_aio_setup(SheepdogAIOCB *acb, BDRVSheepdogState *s,
 
 static SocketAddress *sd_server_config(QDict *options, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     QDict *server = NULL;
     Visitor *iv = NULL;
     SocketAddress *saddr = NULL;
-    Error *local_err = NULL;
 
     qdict_extract_subqdict(options, &server, "server.");
 
@@ -541,9 +541,8 @@ static SocketAddress *sd_server_config(QDict *options, Error **errp)
         goto done;
     }
 
-    visit_type_SocketAddress(iv, NULL, &saddr, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_SocketAddress(iv, NULL, &saddr, errp);
+    if (*errp) {
         goto done;
     }
 
@@ -1008,7 +1007,7 @@ static void sd_config_done(SheepdogConfig *cfg)
 static void sd_parse_uri(SheepdogConfig *cfg, const char *filename,
                          Error **errp)
 {
-    Error *err = NULL;
+    ERRP_AUTO_PROPAGATE();
     QueryParams *qp = NULL;
     bool is_unix;
     URI *uri;
@@ -1017,7 +1016,7 @@ static void sd_parse_uri(SheepdogConfig *cfg, const char *filename,
 
     cfg->uri = uri = uri_parse(filename);
     if (!uri) {
-        error_setg(&err, "invalid URI '%s'", filename);
+        error_setg(errp, "invalid URI '%s'", filename);
         goto out;
     }
 
@@ -1029,18 +1028,18 @@ static void sd_parse_uri(SheepdogConfig *cfg, const char *filename,
     } else if (!g_strcmp0(uri->scheme, "sheepdog+unix")) {
         is_unix = true;
     } else {
-        error_setg(&err, "URI scheme must be 'sheepdog', 'sheepdog+tcp',"
+        error_setg(errp, "URI scheme must be 'sheepdog', 'sheepdog+tcp',"
                    " or 'sheepdog+unix'");
         goto out;
     }
 
     if (uri->path == NULL || !strcmp(uri->path, "/")) {
-        error_setg(&err, "missing file path in URI");
+        error_setg(errp, "missing file path in URI");
         goto out;
     }
     if (g_strlcpy(cfg->vdi, uri->path + 1, SD_MAX_VDI_LEN)
         >= SD_MAX_VDI_LEN) {
-        error_setg(&err, "VDI name is too long");
+        error_setg(errp, "VDI name is too long");
         goto out;
     }
 
@@ -1049,25 +1048,25 @@ static void sd_parse_uri(SheepdogConfig *cfg, const char *filename,
     if (is_unix) {
         /* sheepdog+unix:///vdiname?socket=path */
         if (uri->server || uri->port) {
-            error_setg(&err, "URI scheme %s doesn't accept a server address",
+            error_setg(errp, "URI scheme %s doesn't accept a server address",
                        uri->scheme);
             goto out;
         }
         if (!qp->n) {
-            error_setg(&err,
+            error_setg(errp,
                        "URI scheme %s requires query parameter 'socket'",
                        uri->scheme);
             goto out;
         }
         if (qp->n != 1 || strcmp(qp->p[0].name, "socket")) {
-            error_setg(&err, "unexpected query parameters");
+            error_setg(errp, "unexpected query parameters");
             goto out;
         }
         cfg->path = qp->p[0].value;
     } else {
         /* sheepdog[+tcp]://[host:port]/vdiname */
         if (qp->n) {
-            error_setg(&err, "unexpected query parameters");
+            error_setg(errp, "unexpected query parameters");
             goto out;
         }
         cfg->host = uri->server;
@@ -1078,7 +1077,7 @@ static void sd_parse_uri(SheepdogConfig *cfg, const char *filename,
     if (uri->fragment) {
         if (!sd_parse_snapid_or_tag(uri->fragment,
                                     &cfg->snap_id, cfg->tag)) {
-            error_setg(&err, "'%s' is not a valid snapshot ID",
+            error_setg(errp, "'%s' is not a valid snapshot ID",
                        uri->fragment);
             goto out;
         }
@@ -1087,8 +1086,7 @@ static void sd_parse_uri(SheepdogConfig *cfg, const char *filename,
     }
 
 out:
-    if (err) {
-        error_propagate(errp, err);
+    if (*errp) {
         sd_config_done(cfg);
     }
 }
@@ -1113,7 +1111,7 @@ out:
 static void parse_vdiname(SheepdogConfig *cfg, const char *filename,
                           Error **errp)
 {
-    Error *err = NULL;
+    ERRP_AUTO_PROPAGATE();
     char *p, *q, *uri;
     const char *host_spec, *vdi_spec;
     int nr_sep;
@@ -1155,14 +1153,14 @@ static void parse_vdiname(SheepdogConfig *cfg, const char *filename,
      * FIXME We to escape URI meta-characters, e.g. "x?y=z"
      * produces "sheepdog://x?y=z".  Because of that ...
      */
-    sd_parse_uri(cfg, uri, &err);
-    if (err) {
+    sd_parse_uri(cfg, uri, errp);
+    if (*errp) {
         /*
          * ... this can fail, but the error message is misleading.
          * Replace it by the traditional useless one until the
          * escaping is fixed.
          */
-        error_free(err);
+        error_free_errp(errp);
         error_setg(errp, "Can't parse filename");
     }
 
@@ -1173,17 +1171,16 @@ static void parse_vdiname(SheepdogConfig *cfg, const char *filename,
 static void sd_parse_filename(const char *filename, QDict *options,
                               Error **errp)
 {
-    Error *err = NULL;
+    ERRP_AUTO_PROPAGATE();
     SheepdogConfig cfg;
     char buf[32];
 
     if (strstr(filename, "://")) {
-        sd_parse_uri(&cfg, filename, &err);
+        sd_parse_uri(&cfg, filename, errp);
     } else {
-        parse_vdiname(&cfg, filename, &err);
+        parse_vdiname(&cfg, filename, errp);
     }
-    if (err) {
-        error_propagate(errp, err);
+    if (*errp) {
         return;
     }
 
@@ -1543,6 +1540,7 @@ static QemuOptsList runtime_opts = {
 static int sd_open(BlockDriverState *bs, QDict *options, int flags,
                    Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int ret, fd;
     uint32_t vid = 0;
     BDRVSheepdogState *s = bs->opaque;
@@ -1550,15 +1548,13 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags,
     uint64_t snap_id;
     char *buf = NULL;
     QemuOpts *opts;
-    Error *local_err = NULL;
 
     s->bs = bs;
     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) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto err_no_fd;
     }
@@ -1850,19 +1846,18 @@ out_with_err_set:
 static int sd_create_prealloc(BlockdevOptionsSheepdog *location, int64_t size,
                               Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockDriverState *bs;
     Visitor *v;
     QObject *obj = NULL;
     QDict *qdict;
-    Error *local_err = NULL;
     int ret;
 
     v = qobject_output_visitor_new(&obj);
-    visit_type_BlockdevOptionsSheepdog(v, NULL, &location, &local_err);
+    visit_type_BlockdevOptionsSheepdog(v, NULL, &location, errp);
     visit_free(v);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         qobject_unref(obj);
         return -EINVAL;
     }
@@ -2160,11 +2155,11 @@ out:
 static int coroutine_fn sd_co_create_opts(const char *filename, QemuOpts *opts,
                                           Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockdevCreateOptions *create_options = NULL;
     QDict *qdict, *location_qdict;
     Visitor *v;
     char *redundancy;
-    Error *local_err = NULL;
     int ret;
 
     redundancy = qemu_opt_get_del(opts, BLOCK_OPT_REDUNDANCY);
@@ -2175,9 +2170,8 @@ static int coroutine_fn sd_co_create_opts(const char *filename, QemuOpts *opts,
     location_qdict = qdict_new();
     qdict_put(qdict, "location", location_qdict);
 
-    sd_parse_filename(filename, location_qdict, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    sd_parse_filename(filename, location_qdict, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
@@ -2203,11 +2197,10 @@ static int coroutine_fn sd_co_create_opts(const char *filename, QemuOpts *opts,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
Signature · 1 line
2.21.0
#161 lore raw

RFC v5 96/126 VHDX: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/vhdx-log.c |  1 +
 block/vhdx.c     | 22 +++++++++-------------
 2 files changed, 10 insertions(+), 13 deletions(-)
block/vhdx-log.c +1 -0
index fdd3a7adc3..176e03327b 100644
@@ -748,6 +748,7 @@ exit:
 int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s, bool *flushed,
                    Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int ret = 0;
     VHDXHeader *hdr;
     VHDXLogSequence logs = { 0 };
block/vhdx.c +9 -13
index 6a09d0a55c..e3ca23214c 100644
@@ -898,11 +898,11 @@ static void vhdx_close(BlockDriverState *bs)
 static int vhdx_open(BlockDriverState *bs, QDict *options, int flags,
                      Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVVHDXState *s = bs->opaque;
     int ret = 0;
     uint32_t i;
     uint64_t signature;
-    Error *local_err = NULL;
 
     bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
                                false, errp);
@@ -931,9 +931,8 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags,
      * header update */
     vhdx_guid_generate(&s->session_guid);
 
-    vhdx_parse_header(bs, s, &local_err);
-    if (local_err != NULL) {
-        error_propagate(errp, local_err);
+    vhdx_parse_header(bs, s, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
@@ -1007,9 +1006,8 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The vhdx format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (*errp) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -1966,11 +1964,11 @@ static int coroutine_fn vhdx_co_create_opts(const char *filename,
                                             QemuOpts *opts,
                                             Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockdevCreateOptions *create_options = NULL;
     QDict *qdict;
     Visitor *v;
     BlockDriverState *bs = NULL;
-    Error *local_err = NULL;
     int ret;
 
     static const QDictRenames opt_renames[] = {
@@ -1989,9 +1987,8 @@ static int coroutine_fn vhdx_co_create_opts(const char *filename,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto fail;
     }
 
@@ -2012,11 +2009,10 @@ static int coroutine_fn vhdx_co_create_opts(const char *filename,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
Signature · 1 line
2.21.0
#162 lore raw

RFC v5 97/126 VDI: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/vdi.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
block/vdi.c +7 -8
index 806ba7f53c..0f2e0723f9 100644
@@ -371,11 +371,11 @@ static int vdi_probe(const uint8_t *buf, int buf_size, const char *filename)
 static int vdi_open(BlockDriverState *bs, QDict *options, int flags,
                     Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVVdiState *s = bs->opaque;
     VdiHeader header;
     size_t bmap_size;
     int ret;
-    Error *local_err = NULL;
     QemuUUID uuid_link, uuid_parent;
 
     bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
@@ -496,9 +496,8 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The vdi format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (*errp) {
         error_free(s->migration_blocker);
         goto fail_free_bmap;
     }
@@ -735,6 +734,7 @@ nonallocating_write:
 static int coroutine_fn vdi_co_do_create(BlockdevCreateOptions *create_options,
                                          size_t block_size, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockdevCreateOptionsVdi *vdi_opts;
     int ret = 0;
     uint64_t bytes = 0;
@@ -899,13 +899,13 @@ static int coroutine_fn vdi_co_create(BlockdevCreateOptions *create_options,
 static int coroutine_fn vdi_co_create_opts(const char *filename, QemuOpts *opts,
                                            Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     QDict *qdict = NULL;
     BlockdevCreateOptions *create_options = NULL;
     BlockDriverState *bs_file = NULL;
     uint64_t block_size = DEFAULT_CLUSTER_SIZE;
     bool is_static = false;
     Visitor *v;
-    Error *local_err = NULL;
     int ret;
 
     /* Parse options and convert legacy syntax.
@@ -956,11 +956,10 @@ static int coroutine_fn vdi_co_create_opts(const char *filename, QemuOpts *opts,
         ret = -EINVAL;
         goto done;
     }
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         ret = -EINVAL;
         goto done;
     }
Signature · 1 line
2.21.0
#163 lore raw

RFC v5 98/126 iSCSI: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/iscsi.c | 36 +++++++++++++++---------------------
 1 file changed, 15 insertions(+), 21 deletions(-)
block/iscsi.c +15 -21
index 506bf5f875..bd825fe40e 100644
@@ -1779,6 +1779,7 @@ static void iscsi_save_designator(IscsiLun *lun,
 static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
                       Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     IscsiLun *iscsilun = bs->opaque;
     struct iscsi_context *iscsi = NULL;
     struct scsi_task *task = NULL;
@@ -1786,7 +1787,6 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
     struct scsi_inquiry_supported_pages *inq_vpd;
     char *initiator_name = NULL;
     QemuOpts *opts;
-    Error *local_err = NULL;
     const char *transport_name, *portal, *target;
 #if LIBISCSI_API_VERSION >= (20160603)
     enum iscsi_transport_type transport;
@@ -1794,9 +1794,8 @@ 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) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto out;
     }
@@ -1850,9 +1849,8 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
     }
 
     /* check if we got CHAP username/password via the options */
-    apply_chap(iscsi, opts, &local_err);
-    if (local_err != NULL) {
-        error_propagate(errp, local_err);
+    apply_chap(iscsi, opts, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto out;
     }
@@ -1864,9 +1862,8 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
     }
 
     /* check if we got HEADER_DIGEST via the options */
-    apply_header_digest(iscsi, opts, &local_err);
-    if (local_err != NULL) {
-        error_propagate(errp, local_err);
+    apply_header_digest(iscsi, opts, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto out;
     }
@@ -1918,9 +1915,8 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
         flags &= ~BDRV_O_RDWR;
     }
 
-    iscsi_readcapacity_sync(iscsilun, &local_err);
-    if (local_err != NULL) {
-        error_propagate(errp, local_err);
+    iscsi_readcapacity_sync(iscsilun, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto out;
     }
@@ -2124,8 +2120,8 @@ static void iscsi_reopen_commit(BDRVReopenState *reopen_state)
 static int coroutine_fn iscsi_co_truncate(BlockDriverState *bs, int64_t offset,
                                           PreallocMode prealloc, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     IscsiLun *iscsilun = bs->opaque;
-    Error *local_err = NULL;
 
     if (prealloc != PREALLOC_MODE_OFF) {
         error_setg(errp, "Unsupported preallocation mode '%s'",
@@ -2138,9 +2134,8 @@ static int coroutine_fn iscsi_co_truncate(BlockDriverState *bs, int64_t offset,
         return -ENOTSUP;
     }
 
-    iscsi_readcapacity_sync(iscsilun, &local_err);
-    if (local_err != NULL) {
-        error_propagate(errp, local_err);
+    iscsi_readcapacity_sync(iscsilun, errp);
+    if (*errp) {
         return -EIO;
     }
 
@@ -2159,12 +2154,12 @@ static int coroutine_fn iscsi_co_truncate(BlockDriverState *bs, int64_t offset,
 static int coroutine_fn iscsi_co_create_opts(const char *filename, QemuOpts *opts,
                                              Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int ret = 0;
     int64_t total_size = 0;
     BlockDriverState *bs;
     IscsiLun *iscsilun = NULL;
     QDict *bs_options;
-    Error *local_err = NULL;
 
     bs = bdrv_new();
 
@@ -2175,9 +2170,8 @@ static int coroutine_fn iscsi_co_create_opts(const char *filename, QemuOpts *opt
     iscsilun = bs->opaque;
 
     bs_options = qdict_new();
-    iscsi_parse_filename(filename, bs_options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    iscsi_parse_filename(filename, bs_options, errp);
+    if (*errp) {
         ret = -EINVAL;
     } else {
         ret = iscsi_open(bs, bs_options, 0, NULL);
Signature · 1 line
2.21.0
#164 lore raw

RFC v5 99/126 nbd: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 include/block/nbd.h |  1 +
 block/nbd.c         | 49 +++++++++++++++++++++------------------------
 nbd/client.c        |  5 +++++
 nbd/server.c        |  5 +++++
 4 files changed, 34 insertions(+), 26 deletions(-)
include/block/nbd.h +1 -0
index 316fd705a9..330f40142a 100644
@@ -360,6 +360,7 @@ void nbd_server_start(SocketAddress *addr, const char *tls_creds,
 static inline int nbd_read(QIOChannel *ioc, void *buffer, size_t size,
                            const char *desc, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int ret = qio_channel_read_all(ioc, buffer, size, errp) < 0 ? -EIO : 0;
 
     if (ret < 0) {
block/nbd.c +23 -26

148 lines not on this page · raw message

nbd/client.c +5 -0
index f6733962b4..6e510f4a14 100644
@@ -68,6 +68,7 @@ static int nbd_send_option_request(QIOChannel *ioc, uint32_t opt,
                                    uint32_t len, const char *data,
                                    Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     NBDOption req;
     QEMU_BUILD_BUG_ON(sizeof(req) != 16);
 
@@ -153,6 +154,7 @@ static int nbd_receive_option_reply(QIOChannel *ioc, uint32_t opt,
 static int nbd_handle_reply_err(QIOChannel *ioc, NBDOptionReply *reply,
                                 bool strict, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     g_autofree char *msg = NULL;
 
     if (!(reply->type & (1 << 31))) {
@@ -331,6 +333,7 @@ static int nbd_receive_list(QIOChannel *ioc, char **name, char **description,
 static int nbd_opt_info_or_go(QIOChannel *ioc, uint32_t opt,
                               NBDExportInfo *info, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     NBDOptionReply reply;
     uint32_t len = strlen(info->name);
     uint16_t type;
@@ -870,6 +873,7 @@ static int nbd_start_negotiate(AioContext *aio_context, QIOChannel *ioc,
                                bool structured_reply, bool *zeroes,
                                Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     uint64_t magic;
 
     trace_nbd_start_negotiate(tlscreds, hostname ? hostname : "<null>");
@@ -1005,6 +1009,7 @@ int nbd_receive_negotiate(AioContext *aio_context, QIOChannel *ioc,
                           const char *hostname, QIOChannel **outioc,
                           NBDExportInfo *info, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int result;
     bool zeroes;
     bool base_allocation = info->base_allocation;
nbd/server.c +5 -0
index d8d1e62455..fdb93aab3f 100644
@@ -211,6 +211,7 @@ static int GCC_FMT_ATTR(4, 0)
 nbd_negotiate_send_rep_verr(NBDClient *client, uint32_t type,
                             Error **errp, const char *fmt, va_list va)
 {
+    ERRP_AUTO_PROPAGATE();
     g_autofree char *msg = NULL;
     int ret;
     size_t len;
@@ -365,6 +366,7 @@ static int nbd_opt_read_name(NBDClient *client, char *name, uint32_t *length,
 static int nbd_negotiate_send_rep_list(NBDClient *client, NBDExport *exp,
                                        Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     size_t name_len, desc_len;
     uint32_t len;
     const char *name = exp->name ? exp->name : "";
@@ -427,6 +429,7 @@ static void nbd_check_meta_export(NBDClient *client)
 static int nbd_negotiate_handle_export_name(NBDClient *client, bool no_zeroes,
                                             Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     char name[NBD_MAX_NAME_SIZE + 1];
     char buf[NBD_REPLY_EXPORT_NAME_SIZE] = "";
     size_t len;
@@ -1260,6 +1263,7 @@ static int nbd_negotiate_options(NBDClient *client, Error **errp)
  */
 static coroutine_fn int nbd_negotiate(NBDClient *client, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     char buf[NBD_OLDSTYLE_NEGOTIATE_SIZE] = "";
     int ret;
 
@@ -1631,6 +1635,7 @@ void nbd_export_close(NBDExport *exp)
 
 void nbd_export_remove(NBDExport *exp, NbdServerRemoveMode mode, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     if (mode == NBD_SERVER_REMOVE_MODE_HARD || QTAILQ_EMPTY(&exp->clients)) {
         nbd_export_close(exp);
         return;
Signature · 1 line
2.21.0
Reviewed-by on v5 99/126
#165 lore raw

Re: [RFC v5 099/126] nbd: introduce ERRP_AUTO_PROPAGATE

Quoted 19 lines · Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

Quoted 6 lines
---
 include/block/nbd.h |  1 +
 block/nbd.c         | 49 +++++++++++++++++++++------------------------
 nbd/client.c        |  5 +++++
 nbd/server.c        |  5 +++++
 4 files changed, 34 insertions(+), 26 deletions(-)

One of the few patches with a net gain rather than loss of lines, but that's because of lots of error_prepend use (where you add the macro without removing error_propagate).

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
#166 lore raw

RFC v5 100/126 NFS: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/nfs.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
block/nfs.c +3 -4
index f39acfdb28..ec0dbe3385 100644
@@ -561,21 +561,20 @@ out:
 static BlockdevOptionsNfs *nfs_options_qdict_to_qapi(QDict *options,
                                                      Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockdevOptionsNfs *opts = NULL;
     Visitor *v;
     const QDictEntry *e;
-    Error *local_err = NULL;
 
     v = qobject_input_visitor_new_flat_confused(options, errp);
     if (!v) {
         return NULL;
     }
 
-    visit_type_BlockdevOptionsNfs(v, NULL, &opts, &local_err);
+    visit_type_BlockdevOptionsNfs(v, NULL, &opts, errp);
     visit_free(v);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         return NULL;
     }
 
Signature · 1 line
2.21.0
#167 lore raw

RFC v5 101/126 SSH: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/ssh.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
block/ssh.c +5 -7
index 84d01e892b..98df18ecb7 100644
@@ -614,17 +614,16 @@ static bool ssh_process_legacy_options(QDict *output_opts,
 
 static BlockdevOptionsSsh *ssh_parse_options(QDict *options, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockdevOptionsSsh *result = NULL;
     QemuOpts *opts = NULL;
-    Error *local_err = NULL;
     const QDictEntry *e;
     Visitor *v;
 
     /* 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) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         goto fail;
     }
 
@@ -638,11 +637,10 @@ static BlockdevOptionsSsh *ssh_parse_options(QDict *options, Error **errp)
         goto fail;
     }
 
-    visit_type_BlockdevOptionsSsh(v, NULL, &result, &local_err);
+    visit_type_BlockdevOptionsSsh(v, NULL, &result, errp);
     visit_free(v);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         goto fail;
     }
 
Signature · 1 line
2.21.0
#168 lore raw

RFC v5 102/126 CURL: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/curl.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
block/curl.c +3 -4
index f86299378e..bd687ec9f0 100644
@@ -642,10 +642,10 @@ static QemuOptsList runtime_opts = {
 static int curl_open(BlockDriverState *bs, QDict *options, int flags,
                      Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVCURLState *s = bs->opaque;
     CURLState *state = NULL;
     QemuOpts *opts;
-    Error *local_err = NULL;
     const char *file;
     const char *cookie;
     const char *cookie_secret;
@@ -671,9 +671,8 @@ 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) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         goto out_noclean;
     }
 
Signature · 1 line
2.21.0
#169 lore raw

RFC v5 103/126 GLUSTER: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/gluster.c | 69 ++++++++++++++++++++++++-------------------------
 1 file changed, 34 insertions(+), 35 deletions(-)
block/gluster.c +34 -35
index 64028b2cba..683101612e 100644
@@ -419,6 +419,7 @@ out:
 static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf,
                                            Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     struct glfs *glfs;
     int ret;
     int old_errno;
@@ -512,38 +513,38 @@ out:
 static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
                                   QDict *options, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     QemuOpts *opts;
     SocketAddress *gsconf = NULL;
     SocketAddressList *curr = NULL;
     QDict *backing_options = NULL;
-    Error *local_err = NULL;
     char *str = NULL;
     const char *ptr;
     int i, type, num_servers;
 
     /* 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) {
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         goto out;
     }
 
     num_servers = qdict_array_entries(options, GLUSTER_OPT_SERVER_PATTERN);
     if (num_servers < 1) {
-        error_setg(&local_err, QERR_MISSING_PARAMETER, "server");
+        error_setg(errp, QERR_MISSING_PARAMETER, "server");
         goto out;
     }
 
     ptr = qemu_opt_get(opts, GLUSTER_OPT_VOLUME);
     if (!ptr) {
-        error_setg(&local_err, QERR_MISSING_PARAMETER, GLUSTER_OPT_VOLUME);
+        error_setg(errp, QERR_MISSING_PARAMETER, GLUSTER_OPT_VOLUME);
         goto out;
     }
     gconf->volume = g_strdup(ptr);
 
     ptr = qemu_opt_get(opts, GLUSTER_OPT_PATH);
     if (!ptr) {
-        error_setg(&local_err, QERR_MISSING_PARAMETER, GLUSTER_OPT_PATH);
+        error_setg(errp, QERR_MISSING_PARAMETER, GLUSTER_OPT_PATH);
         goto out;
     }
     gconf->path = g_strdup(ptr);
@@ -555,15 +556,15 @@ 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) {
+        qemu_opts_absorb_qdict(opts, backing_options, errp);
+        if (*errp) {
             goto out;
         }
 
         ptr = qemu_opt_get(opts, GLUSTER_OPT_TYPE);
         if (!ptr) {
-            error_setg(&local_err, QERR_MISSING_PARAMETER, GLUSTER_OPT_TYPE);
-            error_append_hint(&local_err, GERR_INDEX_HINT, i);
+            error_setg(errp, QERR_MISSING_PARAMETER, GLUSTER_OPT_TYPE);
+            error_append_hint(errp, GERR_INDEX_HINT, i);
             goto out;
 
         }
@@ -574,10 +575,10 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
         type = qapi_enum_parse(&SocketAddressType_lookup, ptr, -1, NULL);
         if (type != SOCKET_ADDRESS_TYPE_INET
             && type != SOCKET_ADDRESS_TYPE_UNIX) {
-            error_setg(&local_err,
+            error_setg(errp,
                        "Parameter '%s' may be 'inet' or 'unix'",
                        GLUSTER_OPT_TYPE);
-            error_append_hint(&local_err, GERR_INDEX_HINT, i);
+            error_append_hint(errp, GERR_INDEX_HINT, i);
             goto out;
         }
         gsconf->type = type;
@@ -586,24 +587,24 @@ 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) {
+            qemu_opts_absorb_qdict(opts, backing_options, errp);
+            if (*errp) {
                 goto out;
             }
 
             ptr = qemu_opt_get(opts, GLUSTER_OPT_HOST);
             if (!ptr) {
-                error_setg(&local_err, QERR_MISSING_PARAMETER,
+                error_setg(errp, QERR_MISSING_PARAMETER,
                            GLUSTER_OPT_HOST);
-                error_append_hint(&local_err, GERR_INDEX_HINT, i);
+                error_append_hint(errp, GERR_INDEX_HINT, i);
                 goto out;
             }
             gsconf->u.inet.host = g_strdup(ptr);
             ptr = qemu_opt_get(opts, GLUSTER_OPT_PORT);
             if (!ptr) {
-                error_setg(&local_err, QERR_MISSING_PARAMETER,
+                error_setg(errp, QERR_MISSING_PARAMETER,
                            GLUSTER_OPT_PORT);
-                error_append_hint(&local_err, GERR_INDEX_HINT, i);
+                error_append_hint(errp, GERR_INDEX_HINT, i);
                 goto out;
             }
             gsconf->u.inet.port = g_strdup(ptr);
@@ -624,19 +625,19 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
                 gsconf->u.inet.has_ipv6 = true;
             }
             if (gsconf->u.inet.has_to) {
-                error_setg(&local_err, "Parameter 'to' not supported");
+                error_setg(errp, "Parameter 'to' not supported");
                 goto out;
             }
             if (gsconf->u.inet.has_ipv4 || gsconf->u.inet.has_ipv6) {
-                error_setg(&local_err, "Parameters 'ipv4/ipv6' not supported");
+                error_setg(errp, "Parameters 'ipv4/ipv6' not supported");
                 goto out;
             }
             qemu_opts_del(opts);
         } 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) {
+            qemu_opts_absorb_qdict(opts, backing_options, errp);
+            if (*errp) {
                 goto out;
             }
 
@@ -644,15 +645,15 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
             if (!ptr) {
                 ptr = qemu_opt_get(opts, GLUSTER_OPT_SOCKET);
             } else if (qemu_opt_get(opts, GLUSTER_OPT_SOCKET)) {
-                error_setg(&local_err,
+                error_setg(errp,
                            "Conflicting parameters 'path' and 'socket'");
-                error_append_hint(&local_err, GERR_INDEX_HINT, i);
+                error_append_hint(errp, GERR_INDEX_HINT, i);
                 goto out;
             }
             if (!ptr) {
-                error_setg(&local_err, QERR_MISSING_PARAMETER,
+                error_setg(errp, QERR_MISSING_PARAMETER,
                            GLUSTER_OPT_PATH);
-                error_append_hint(&local_err, GERR_INDEX_HINT, i);
+                error_append_hint(errp, GERR_INDEX_HINT, i);
                 goto out;
             }
             gsconf->u.q_unix.path = g_strdup(ptr);
@@ -679,7 +680,6 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf,
     return 0;
 
 out:
-    error_propagate(errp, local_err);
     qapi_free_SocketAddress(gsconf);
     qemu_opts_del(opts);
     g_free(str);
@@ -694,6 +694,7 @@ static int qemu_gluster_parse(BlockdevOptionsGluster *gconf,
                               const char *filename,
                               QDict *options, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int ret;
     if (filename) {
         ret = qemu_gluster_parse_uri(gconf, filename);
@@ -810,18 +811,17 @@ static bool qemu_gluster_test_seek(struct glfs_fd *fd)
 static int qemu_gluster_open(BlockDriverState *bs,  QDict *options,
                              int bdrv_flags, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVGlusterState *s = bs->opaque;
     int open_flags = 0;
     int ret = 0;
     BlockdevOptionsGluster *gconf = NULL;
     QemuOpts *opts;
-    Error *local_err = NULL;
     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) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto out;
     }
@@ -1134,11 +1134,11 @@ static int coroutine_fn qemu_gluster_co_create_opts(const char *filename,
                                                     QemuOpts *opts,
                                                     Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockdevCreateOptions *options;
     BlockdevCreateOptionsGluster *gopts;
     BlockdevOptionsGluster *gconf;
     char *tmp = NULL;
-    Error *local_err = NULL;
     int ret;
 
     options = g_new0(BlockdevCreateOptions, 1);
@@ -1153,10 +1153,9 @@ static int coroutine_fn qemu_gluster_co_create_opts(const char *filename,
 
     tmp = qemu_opt_get_del(opts, BLOCK_OPT_PREALLOC);
     gopts->preallocation = qapi_enum_parse(&PreallocMode_lookup, tmp,
-                                           PREALLOC_MODE_OFF, &local_err);
+                                           PREALLOC_MODE_OFF, errp);
     g_free(tmp);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
Signature · 1 line
2.21.0
#170 lore raw

RFC v5 104/126 NVMe Block Driver: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/nvme.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
block/nvme.c +8 -11
index 5be3a39b63..8447d1caea 100644
@@ -187,9 +187,9 @@ static NVMeQueuePair *nvme_create_queue_pair(BlockDriverState *bs,
                                              int idx, int size,
                                              Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int i, r;
     BDRVNVMeState *s = bs->opaque;
-    Error *local_err = NULL;
     NVMeQueuePair *q = g_new0(NVMeQueuePair, 1);
     uint64_t prp_list_iova;
 
@@ -209,16 +209,14 @@ static NVMeQueuePair *nvme_create_queue_pair(BlockDriverState *bs,
         req->prp_list_page = q->prp_list_pages + i * s->page_size;
         req->prp_list_iova = prp_list_iova + i * s->page_size;
     }
-    nvme_init_queue(bs, &q->sq, size, NVME_SQ_ENTRY_BYTES, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    nvme_init_queue(bs, &q->sq, size, NVME_SQ_ENTRY_BYTES, errp);
+    if (*errp) {
         goto fail;
     }
     q->sq.doorbell = &s->regs->doorbells[idx * 2 * s->doorbell_scale];
 
-    nvme_init_queue(bs, &q->cq, size, NVME_CQ_ENTRY_BYTES, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    nvme_init_queue(bs, &q->cq, size, NVME_CQ_ENTRY_BYTES, errp);
+    if (*errp) {
         goto fail;
     }
     q->cq.doorbell = &s->regs->doorbells[(idx * 2 + 1) * s->doorbell_scale];
@@ -569,12 +567,12 @@ static bool nvme_poll_cb(void *opaque)
 static int nvme_init(BlockDriverState *bs, const char *device, int namespace,
                      Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVNVMeState *s = bs->opaque;
     int ret;
     uint64_t cap;
     uint64_t timeout_ms;
     uint64_t deadline, now;
-    Error *local_err = NULL;
 
     qemu_co_mutex_init(&s->dma_map_lock);
     qemu_co_queue_init(&s->dma_flush_queue);
@@ -666,9 +664,8 @@ static int nvme_init(BlockDriverState *bs, const char *device, int namespace,
     aio_set_event_notifier(bdrv_get_aio_context(bs), &s->irq_notifier,
                            false, nvme_handle_event, nvme_poll_cb);
 
-    nvme_identify(bs, namespace, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    nvme_identify(bs, namespace, errp);
+    if (*errp) {
         ret = -EIO;
         goto out;
     }
Signature · 1 line
2.21.0
#171 lore raw

RFC v5 105/126 Bootdevice: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 bootdevice.c | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)
bootdevice.c +13 -18
index 1d225202f9..ca69cbeb05 100644
@@ -53,7 +53,7 @@ void qemu_register_boot_set(QEMUBootSetHandler *func, void *opaque)
 
 void qemu_boot_set(const char *boot_order, Error **errp)
 {
-    Error *local_err = NULL;
+    ERRP_AUTO_PROPAGATE();
 
     if (!boot_set_handler) {
         error_setg(errp, "no function defined to set boot device list for"
@@ -61,9 +61,8 @@ void qemu_boot_set(const char *boot_order, Error **errp)
         return;
     }
 
-    validate_bootdevices(boot_order, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    validate_bootdevices(boot_order, errp);
+    if (*errp) {
         return;
     }
 
@@ -286,26 +285,23 @@ static void device_get_bootindex(Object *obj, Visitor *v, const char *name,
 static void device_set_bootindex(Object *obj, Visitor *v, const char *name,
                                  void *opaque, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BootIndexProperty *prop = opaque;
     int32_t boot_index;
-    Error *local_err = NULL;
 
-    visit_type_int32(v, name, &boot_index, &local_err);
-    if (local_err) {
-        goto out;
+    visit_type_int32(v, name, &boot_index, errp);
+    if (*errp) {
+        return;
     }
     /* check whether bootindex is present in fw_boot_order list  */
-    check_boot_index(boot_index, &local_err);
-    if (local_err) {
-        goto out;
+    check_boot_index(boot_index, errp);
+    if (*errp) {
+        return;
     }
     /* change bootindex to a new one */
     *prop->bootindex = boot_index;
 
     add_boot_device_path(*prop->bootindex, prop->dev, prop->suffix);
-
-out:
-    error_propagate(errp, local_err);
 }
 
 static void property_release_bootindex(Object *obj, const char *name,
@@ -322,7 +318,7 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex,
                                    const char *name, const char *suffix,
                                    DeviceState *dev, Error **errp)
 {
-    Error *local_err = NULL;
+    ERRP_AUTO_PROPAGATE();
     BootIndexProperty *prop = g_malloc0(sizeof(*prop));
 
     prop->bootindex = bootindex;
@@ -333,10 +329,9 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex,
                         device_get_bootindex,
                         device_set_bootindex,
                         property_release_bootindex,
-                        prop, &local_err);
+                        prop, errp);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         g_free(prop);
         return;
     }
Signature · 1 line
2.21.0
#172 lore raw

RFC v5 106/126 Quorum: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/quorum.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)
block/quorum.c +11 -12
index df68adcfaa..5c531e1ec5 100644
@@ -861,8 +861,8 @@ static QemuOptsList quorum_runtime_opts = {
 static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
                        Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVQuorumState *s = bs->opaque;
-    Error *local_err = NULL;
     QemuOpts *opts = NULL;
     const char *pattern_str;
     bool *opened;
@@ -874,27 +874,27 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
     /* count how many different children are present */
     s->num_children = qdict_array_entries(options, "children.");
     if (s->num_children < 0) {
-        error_setg(&local_err, "Option children is not a valid array");
+        error_setg(errp, "Option children is not a valid array");
         ret = -EINVAL;
         goto exit;
     }
     if (s->num_children < 1) {
-        error_setg(&local_err,
+        error_setg(errp,
                    "Number of provided children must be 1 or more");
         ret = -EINVAL;
         goto exit;
     }
 
     opts = qemu_opts_create(&quorum_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto exit;
     }
 
     s->threshold = qemu_opt_get_number(opts, QUORUM_OPT_VOTE_THRESHOLD, 0);
     /* and validate it against s->num_children */
-    ret = quorum_valid_threshold(s->threshold, s->num_children, &local_err);
+    ret = quorum_valid_threshold(s->threshold, s->num_children, errp);
     if (ret < 0) {
         goto exit;
     }
@@ -907,7 +907,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
                               -EINVAL, NULL);
     }
     if (ret < 0) {
-        error_setg(&local_err, "Please set read-pattern as fifo or quorum");
+        error_setg(errp, "Please set read-pattern as fifo or quorum");
         goto exit;
     }
     s->read_pattern = ret;
@@ -915,7 +915,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
     if (s->read_pattern == QUORUM_READ_PATTERN_QUORUM) {
         s->is_blkverify = qemu_opt_get_bool(opts, QUORUM_OPT_BLKVERIFY, false);
         if (s->is_blkverify && (s->num_children != 2 || s->threshold != 2)) {
-            error_setg(&local_err, "blkverify=on can only be set if there are "
+            error_setg(errp, "blkverify=on can only be set if there are "
                        "exactly two files and vote-threshold is 2");
             ret = -EINVAL;
             goto exit;
@@ -924,7 +924,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
         s->rewrite_corrupted = qemu_opt_get_bool(opts, QUORUM_OPT_REWRITE,
                                                  false);
         if (s->rewrite_corrupted && s->is_blkverify) {
-            error_setg(&local_err,
+            error_setg(errp,
                        "rewrite-corrupted=on cannot be used with blkverify=on");
             ret = -EINVAL;
             goto exit;
@@ -941,8 +941,8 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
         assert(ret < 32);
 
         s->children[i] = bdrv_open_child(NULL, options, indexstr, bs,
-                                         &child_format, false, &local_err);
-        if (local_err) {
+                                         &child_format, false, errp);
+        if (*errp) {
             ret = -EINVAL;
             goto close_exit;
         }
@@ -969,7 +969,6 @@ close_exit:
 exit:
     qemu_opts_del(opts);
     /* propagate error */
-    error_propagate(errp, local_err);
     return ret;
 }
 
Signature · 1 line
2.21.0
#173 lore raw

RFC v5 107/126 blklogwrites: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/blklogwrites.c | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)
block/blklogwrites.c +9 -13
index 04d8b33607..841cfeef95 100644
@@ -141,36 +141,33 @@ static uint64_t blk_log_writes_find_cur_log_sector(BdrvChild *log,
 static int blk_log_writes_open(BlockDriverState *bs, QDict *options, int flags,
                                Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVBlkLogWritesState *s = bs->opaque;
     QemuOpts *opts;
-    Error *local_err = NULL;
     int ret;
     uint64_t log_sector_size;
     bool log_append;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         ret = -EINVAL;
-        error_propagate(errp, local_err);
         goto fail;
     }
 
     /* Open the file */
     bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, false,
-                               &local_err);
-    if (local_err) {
+                               errp);
+    if (*errp) {
         ret = -EINVAL;
-        error_propagate(errp, local_err);
         goto fail;
     }
 
     /* Open the log file */
     s->log_file = bdrv_open_child(NULL, options, "log", bs, &child_file, false,
-                                  &local_err);
-    if (local_err) {
+                                  errp);
+    if (*errp) {
         ret = -EINVAL;
-        error_propagate(errp, local_err);
         goto fail;
     }
 
@@ -220,10 +217,9 @@ static int blk_log_writes_open(BlockDriverState *bs, QDict *options, int flags,
         if (blk_log_writes_sector_size_valid(log_sector_size)) {
             s->cur_log_sector =
                 blk_log_writes_find_cur_log_sector(s->log_file, log_sector_size,
-                                    le64_to_cpu(log_sb.nr_entries), &local_err);
-            if (local_err) {
+                                    le64_to_cpu(log_sb.nr_entries), errp);
+            if (*errp) {
                 ret = -EINVAL;
-                error_propagate(errp, local_err);
                 goto fail_log;
             }
 
Signature · 1 line
2.21.0
#174 lore raw

RFC v5 108/126 blkverify: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/blkverify.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
block/blkverify.c +7 -10
index 304b0a1368..96e54f8439 100644
@@ -110,35 +110,32 @@ static QemuOptsList runtime_opts = {
 static int blkverify_open(BlockDriverState *bs, QDict *options, int flags,
                           Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVBlkverifyState *s = bs->opaque;
     QemuOpts *opts;
-    Error *local_err = NULL;
     int ret;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
 
     /* Open the raw file */
     bs->file = bdrv_open_child(qemu_opt_get(opts, "x-raw"), options, "raw",
-                               bs, &child_file, false, &local_err);
-    if (local_err) {
+                               bs, &child_file, false, errp);
+    if (*errp) {
         ret = -EINVAL;
-        error_propagate(errp, local_err);
         goto fail;
     }
 
     /* Open the test file */
     s->test_file = bdrv_open_child(qemu_opt_get(opts, "x-image"), options,
                                    "test", bs, &child_format, false,
-                                   &local_err);
-    if (local_err) {
+                                   errp);
+    if (*errp) {
         ret = -EINVAL;
-        error_propagate(errp, local_err);
         goto fail;
     }
 
Signature · 1 line
2.21.0
#175 lore raw

RFC v5 109/126 parallels: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/parallels.c | 30 +++++++++++++-----------------
 1 file changed, 13 insertions(+), 17 deletions(-)
block/parallels.c +13 -17
index 7cd2714b69..c8ba23bbd5 100644
@@ -613,8 +613,8 @@ static int coroutine_fn parallels_co_create_opts(const char *filename,
                                                  QemuOpts *opts,
                                                  Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockdevCreateOptions *create_options = NULL;
-    Error *local_err = NULL;
     BlockDriverState *bs = NULL;
     QDict *qdict;
     Visitor *v;
@@ -635,9 +635,8 @@ static int coroutine_fn parallels_co_create_opts(const char *filename,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto done;
     }
 
@@ -658,11 +657,10 @@ static int coroutine_fn parallels_co_create_opts(const char *filename,
         goto done;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         ret = -EINVAL;
         goto done;
     }
@@ -721,11 +719,11 @@ static int parallels_update_header(BlockDriverState *bs)
 static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
                           Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVParallelsState *s = bs->opaque;
     ParallelsHeader ph;
     int ret, size, i;
     QemuOpts *opts = NULL;
-    Error *local_err = NULL;
     char *buf;
 
     bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
@@ -813,13 +811,13 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
         }
     }
 
-    opts = qemu_opts_create(&parallels_runtime_opts, NULL, 0, &local_err);
-    if (local_err != NULL) {
+    opts = qemu_opts_create(&parallels_runtime_opts, NULL, 0, errp);
+    if (*errp) {
         goto fail_options;
     }
 
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err != NULL) {
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         goto fail_options;
     }
 
@@ -829,9 +827,9 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
     buf = qemu_opt_get_del(opts, PARALLELS_OPT_PREALLOC_MODE);
     s->prealloc_mode = qapi_enum_parse(&prealloc_mode_lookup, buf,
                                        PRL_PREALLOC_MODE_FALLOCATE,
-                                       &local_err);
+                                       errp);
     g_free(buf);
-    if (local_err != NULL) {
+    if (*errp) {
         goto fail_options;
     }
 
@@ -855,9 +853,8 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The Parallels format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (*errp) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -872,7 +869,6 @@ fail:
     return ret;
 
 fail_options:
-    error_propagate(errp, local_err);
     ret = -EINVAL;
     goto fail;
 }
Signature · 1 line
2.21.0
#176 lore raw

RFC v5 110/126 qed: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/qed.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
block/qed.c +8 -10
index 0d8fd507aa..689522519d 100644
@@ -721,11 +721,11 @@ static int coroutine_fn bdrv_qed_co_create_opts(const char *filename,
                                                 QemuOpts *opts,
                                                 Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockdevCreateOptions *create_options = NULL;
     QDict *qdict;
     Visitor *v;
     BlockDriverState *bs = NULL;
-    Error *local_err = NULL;
     int ret;
 
     static const QDictRenames opt_renames[] = {
@@ -745,9 +745,8 @@ static int coroutine_fn bdrv_qed_co_create_opts(const char *filename,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto fail;
     }
 
@@ -768,11 +767,10 @@ static int coroutine_fn bdrv_qed_co_create_opts(const char *filename,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
@@ -1587,18 +1585,18 @@ static int bdrv_qed_change_backing_file(BlockDriverState *bs,
 static void coroutine_fn bdrv_qed_co_invalidate_cache(BlockDriverState *bs,
                                                       Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVQEDState *s = bs->opaque;
-    Error *local_err = NULL;
     int ret;
 
     bdrv_qed_close(bs);
 
     bdrv_qed_init_state(bs);
     qemu_co_mutex_lock(&s->table_lock);
-    ret = bdrv_qed_do_open(bs, NULL, bs->open_flags, &local_err);
+    ret = bdrv_qed_do_open(bs, NULL, bs->open_flags, errp);
     qemu_co_mutex_unlock(&s->table_lock);
-    if (local_err) {
-        error_propagate_prepend(errp, local_err,
+    if (*errp) {
+        error_prepend(errp,
                                 "Could not reopen qed layer: ");
         return;
     } else if (ret < 0) {
Signature · 1 line
2.21.0
#177 lore raw

RFC v5 111/126 raw: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/file-posix.c | 79 ++++++++++++++++++++--------------------------
 block/file-win32.c | 29 +++++++----------
 block/raw-format.c |  7 ++--
 3 files changed, 50 insertions(+), 65 deletions(-)
block/file-posix.c +35 -44
index f12c06de2d..fa75232713 100644
@@ -320,6 +320,7 @@ static bool raw_is_io_aligned(int fd, void *buf, size_t len)
 
 static void raw_probe_alignment(BlockDriverState *bs, int fd, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVRawState *s = bs->opaque;
     char *buf;
     size_t max_align = MAX(MAX_BLOCKSIZE, getpagesize());
@@ -473,9 +474,9 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
                            int bdrv_flags, int open_flags,
                            bool device, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVRawState *s = bs->opaque;
     QemuOpts *opts;
-    Error *local_err = NULL;
     const char *filename = NULL;
     const char *str;
     BlockdevAioOptions aio, aio_default;
@@ -484,9 +485,8 @@ 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) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
@@ -503,9 +503,8 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
                   : BLOCKDEV_AIO_OPTIONS_THREADS;
     aio = qapi_enum_parse(&BlockdevAioOptions_lookup,
                           qemu_opt_get(opts, "aio"),
-                          aio_default, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+                          aio_default, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
@@ -513,9 +512,8 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
 
     locking = qapi_enum_parse(&OnOffAuto_lookup,
                               qemu_opt_get(opts, "locking"),
-                              ON_OFF_AUTO_AUTO, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+                              ON_OFF_AUTO_AUTO, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
@@ -541,9 +539,8 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
 
     str = qemu_opt_get(opts, "pr-manager");
     if (str) {
-        s->pr_mgr = pr_manager_lookup(str, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        s->pr_mgr = pr_manager_lookup(str, errp);
+        if (*errp) {
             ret = -EINVAL;
             goto fail;
         }
@@ -817,9 +814,9 @@ static int raw_handle_perm_lock(BlockDriverState *bs,
                                 uint64_t new_perm, uint64_t new_shared,
                                 Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVRawState *s = bs->opaque;
     int ret = 0;
-    Error *local_err = NULL;
 
     if (!s->use_lock) {
         return 0;
@@ -859,22 +856,22 @@ static int raw_handle_perm_lock(BlockDriverState *bs,
         /* fall through to unlock bytes. */
     case RAW_PL_ABORT:
         raw_apply_lock_bytes(s, s->fd, s->perm, ~s->shared_perm,
-                             true, &local_err);
-        if (local_err) {
+                             true, errp);
+        if (*errp) {
             /* Theoretically the above call only unlocks bytes and it cannot
              * fail. Something weird happened, report it.
              */
-            warn_report_err(local_err);
+            warn_report_errp(errp);
         }
         break;
     case RAW_PL_COMMIT:
         raw_apply_lock_bytes(s, s->fd, new_perm, ~new_shared,
-                             true, &local_err);
-        if (local_err) {
+                             true, errp);
+        if (*errp) {
             /* Theoretically the above call only unlocks bytes and it cannot
              * fail. Something weird happened, report it.
              */
-            warn_report_err(local_err);
+            warn_report_errp(errp);
         }
         break;
     }
@@ -948,11 +945,11 @@ static int raw_reconfigure_getfd(BlockDriverState *bs, int flags,
 static int raw_reopen_prepare(BDRVReopenState *state,
                               BlockReopenQueue *queue, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVRawState *s;
     BDRVRawReopenState *rs;
     QemuOpts *opts;
     int ret;
-    Error *local_err = NULL;
 
     assert(state != NULL);
     assert(state->bs != NULL);
@@ -964,9 +961,8 @@ 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) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, state->options, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto out;
     }
@@ -981,9 +977,8 @@ static int raw_reopen_prepare(BDRVReopenState *state,
     qemu_opts_to_qdict(opts, state->options);
 
     rs->fd = raw_reconfigure_getfd(state->bs, state->flags, &rs->open_flags,
-                                   state->perm, true, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+                                   state->perm, true, errp);
+    if (*errp) {
         ret = -1;
         goto out;
     }
@@ -991,9 +986,8 @@ static int raw_reopen_prepare(BDRVReopenState *state,
     /* Fail already reopen_prepare() if we can't get a working O_DIRECT
      * alignment with the new fd. */
     if (rs->fd != -1) {
-        raw_probe_alignment(state->bs, rs->fd, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        raw_probe_alignment(state->bs, rs->fd, errp);
+        if (*errp) {
             ret = -EINVAL;
             goto out_fd;
         }
@@ -2232,8 +2226,8 @@ static int64_t raw_get_allocated_file_size(BlockDriverState *bs)
 static int coroutine_fn
 raw_co_create(BlockdevCreateOptions *options, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockdevCreateOptionsFile *file_opts;
-    Error *local_err = NULL;
     int fd;
     uint64_t perm, shared;
     int result = 0;
@@ -2315,13 +2309,13 @@ raw_co_create(BlockdevCreateOptions *options, Error **errp)
     }
 
 out_unlock:
-    raw_apply_lock_bytes(NULL, fd, 0, 0, true, &local_err);
-    if (local_err) {
+    raw_apply_lock_bytes(NULL, fd, 0, 0, true, errp);
+    if (*errp) {
         /* The above call should not fail, and if it does, that does
          * not mean the whole creation operation has failed.  So
          * report it the user for their convenience, but do not report
          * it to the caller. */
-        warn_report_err(local_err);
+        warn_report_errp(errp);
     }
 
 out_close:
@@ -2336,12 +2330,12 @@ out:
 static int coroutine_fn raw_co_create_opts(const char *filename, QemuOpts *opts,
                                            Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockdevCreateOptions options;
     int64_t total_size = 0;
     bool nocow = false;
     PreallocMode prealloc;
     char *buf = NULL;
-    Error *local_err = NULL;
 
     /* Skip file: protocol prefix */
     strstart(filename, "file:", &filename);
@@ -2352,10 +2346,9 @@ static int coroutine_fn raw_co_create_opts(const char *filename, QemuOpts *opts,
     nocow = qemu_opt_get_bool(opts, BLOCK_OPT_NOCOW, false);
     buf = qemu_opt_get_del(opts, BLOCK_OPT_PREALLOC);
     prealloc = qapi_enum_parse(&PreallocMode_lookup, buf,
-                               PREALLOC_MODE_OFF, &local_err);
+                               PREALLOC_MODE_OFF, errp);
     g_free(buf);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         return -EINVAL;
     }
 
@@ -3155,8 +3148,8 @@ static bool hdev_is_sg(BlockDriverState *bs)
 static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
                      Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVRawState *s = bs->opaque;
-    Error *local_err = NULL;
     int ret;
 
 #if defined(__APPLE__) && defined(__MACH__)
@@ -3221,9 +3214,8 @@ hdev_open_Mac_error:
 
     s->type = FTYPE_FILE;
 
-    ret = raw_open_common(bs, options, flags, 0, true, &local_err);
+    ret = raw_open_common(bs, options, flags, 0, true, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
 #if defined(__APPLE__) && defined(__MACH__)
         if (*bsd_path) {
             filename = bsd_path;
@@ -3557,15 +3549,14 @@ static BlockDriver bdrv_host_cdrom = {
 static int cdrom_open(BlockDriverState *bs, QDict *options, int flags,
                       Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVRawState *s = bs->opaque;
-    Error *local_err = NULL;
     int ret;
 
     s->type = FTYPE_CD;
 
-    ret = raw_open_common(bs, options, flags, 0, true, &local_err);
+    ret = raw_open_common(bs, options, flags, 0, true, errp);
     if (ret) {
-        error_propagate(errp, local_err);
         return ret;
     }
 
block/file-win32.c +12 -17
index 41f55dfece..6ef3117cda 100644
@@ -326,11 +326,11 @@ static bool get_aio_option(QemuOpts *opts, int flags, Error **errp)
 static int raw_open(BlockDriverState *bs, QDict *options, int flags,
                     Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVRawState *s = bs->opaque;
     int access_flags;
     DWORD overlapped;
     QemuOpts *opts;
-    Error *local_err = NULL;
     const char *filename;
     bool use_aio;
     int ret;
@@ -338,9 +338,8 @@ 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) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
@@ -353,9 +352,8 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,
 
     filename = qemu_opt_get(opts, "filename");
 
-    use_aio = get_aio_option(opts, flags, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    use_aio = get_aio_option(opts, flags, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
@@ -722,33 +720,30 @@ static void hdev_refresh_limits(BlockDriverState *bs, Error **errp)
 static int hdev_open(BlockDriverState *bs, QDict *options, int flags,
                      Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVRawState *s = bs->opaque;
     int access_flags, create_flags;
     int ret = 0;
     DWORD overlapped;
     char device_name[64];
-
-    Error *local_err = NULL;
     const char *filename;
     bool use_aio;
 
     QemuOpts *opts = qemu_opts_create(&raw_runtime_opts, NULL, 0,
                                       &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto done;
     }
 
     filename = qemu_opt_get(opts, "filename");
 
-    use_aio = get_aio_option(opts, flags, &local_err);
-    if (!local_err && use_aio) {
-        error_setg(&local_err, "AIO is not supported on Windows host devices");
+    use_aio = get_aio_option(opts, flags, errp);
+    if (!*errp && use_aio) {
+        error_setg(errp, "AIO is not supported on Windows host devices");
     }
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         ret = -EINVAL;
         goto done;
     }
block/raw-format.c +3 -4
index 42c28cc29a..8903b54499 100644
@@ -74,7 +74,7 @@ static QemuOptsList raw_create_opts = {
 static int raw_read_options(QDict *options, BlockDriverState *bs,
     BDRVRawState *s, Error **errp)
 {
-    Error *local_err = NULL;
+    ERRP_AUTO_PROPAGATE();
     QemuOpts *opts = NULL;
     int64_t real_size = 0;
     int ret;
@@ -86,9 +86,8 @@ static int raw_read_options(QDict *options, BlockDriverState *bs,
     }
 
     opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto end;
     }
Signature · 1 line
2.21.0
#178 lore raw

RFC v5 112/126 qcow2: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/qcow2-bitmap.c |  9 ++--
 block/qcow2.c        | 98 +++++++++++++++++++-------------------------
 2 files changed, 48 insertions(+), 59 deletions(-)
block/qcow2-bitmap.c +5 -4
index b2487101ed..b060911faa 100644
@@ -1447,6 +1447,7 @@ fail:
 
 void qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BdrvDirtyBitmap *bitmap;
     BDRVQcow2State *s = bs->opaque;
     uint32_t new_nb_bitmaps = s->nb_bitmaps;
@@ -1593,12 +1594,11 @@ fail:
 
 int qcow2_reopen_bitmaps_ro(BlockDriverState *bs, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BdrvDirtyBitmap *bitmap;
-    Error *local_err = NULL;
 
-    qcow2_store_persistent_dirty_bitmaps(bs, &local_err);
-    if (local_err != NULL) {
-        error_propagate(errp, local_err);
+    qcow2_store_persistent_dirty_bitmaps(bs, errp);
+    if (*errp) {
         return -EINVAL;
     }
 
@@ -1618,6 +1618,7 @@ bool qcow2_can_store_new_dirty_bitmap(BlockDriverState *bs,
                                       uint32_t granularity,
                                       Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVQcow2State *s = bs->opaque;
     bool found;
     Qcow2BitmapList *bm_list;
block/qcow2.c +43 -55

300 lines not on this page · raw message

Signature · 1 line
2.21.0
#179 lore raw

RFC v5 113/126 qcow: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/qcow.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
block/qcow.c +7 -10
index 5bdf72ba33..c58d3e36be 100644
@@ -117,11 +117,11 @@ static QemuOptsList qcow_runtime_opts = {
 static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
                      Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVQcowState *s = bs->opaque;
     unsigned int len, i, shift;
     int ret;
     QCowHeader header;
-    Error *local_err = NULL;
     QCryptoBlockOpenOptions *crypto_opts = NULL;
     unsigned int cflags = 0;
     QDict *encryptopts = NULL;
@@ -314,9 +314,8 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The qcow format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (*errp) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -942,12 +941,12 @@ exit:
 static int coroutine_fn qcow_co_create_opts(const char *filename,
                                             QemuOpts *opts, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockdevCreateOptions *create_options = NULL;
     BlockDriverState *bs = NULL;
     QDict *qdict;
     Visitor *v;
     const char *val;
-    Error *local_err = NULL;
     int ret;
 
     static const QDictRenames opt_renames[] = {
@@ -977,9 +976,8 @@ static int coroutine_fn qcow_co_create_opts(const char *filename,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto fail;
     }
 
@@ -1000,11 +998,10 @@ static int coroutine_fn qcow_co_create_opts(const char *filename,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
Signature · 1 line
2.21.0
#180 lore raw

RFC v5 114/126 blkdebug: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/blkdebug.c | 36 +++++++++++++++---------------------
 1 file changed, 15 insertions(+), 21 deletions(-)
block/blkdebug.c +15 -21
index 5ae96c52b0..7c3fc222f3 100644
@@ -164,6 +164,7 @@ struct add_rule_data {
 
 static int add_rule(void *opaque, QemuOpts *opts, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     struct add_rule_data *d = opaque;
     BDRVBlkdebugState *s = d->s;
     const char* event_name;
@@ -171,7 +172,6 @@ static int add_rule(void *opaque, QemuOpts *opts, Error **errp)
     struct BlkdebugRule *rule;
     int64_t sector;
     BlkdebugIOType iotype;
-    Error *local_error = NULL;
 
     /* Find the right event for the rule */
     event_name = qemu_opt_get(opts, "event");
@@ -205,9 +205,8 @@ static int add_rule(void *opaque, QemuOpts *opts, Error **errp)
 
         iotype = qapi_enum_parse(&BlkdebugIOType_lookup,
                                  qemu_opt_get(opts, "iotype"),
-                                 BLKDEBUG_IO_TYPE__MAX, &local_error);
-        if (local_error) {
-            error_propagate(errp, local_error);
+                                 BLKDEBUG_IO_TYPE__MAX, errp);
+        if (*errp) {
             return -1;
         }
         if (iotype != BLKDEBUG_IO_TYPE__MAX) {
@@ -259,10 +258,10 @@ static void remove_rule(BlkdebugRule *rule)
 static int read_config(BDRVBlkdebugState *s, const char *filename,
                        QDict *options, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     FILE *f = NULL;
     int ret;
     struct add_rule_data d;
-    Error *local_err = NULL;
 
     if (filename) {
         f = fopen(filename, "r");
@@ -278,26 +277,23 @@ static int read_config(BDRVBlkdebugState *s, const char *filename,
         }
     }
 
-    qemu_config_parse_qdict(options, config_groups, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_config_parse_qdict(options, config_groups, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
 
     d.s = s;
     d.action = ACTION_INJECT_ERROR;
-    qemu_opts_foreach(&inject_error_opts, add_rule, &d, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_foreach(&inject_error_opts, add_rule, &d, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
 
     d.action = ACTION_SET_STATE;
-    qemu_opts_foreach(&set_state_opts, add_rule, &d, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_foreach(&set_state_opts, add_rule, &d, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
@@ -395,16 +391,15 @@ static QemuOptsList runtime_opts = {
 static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags,
                          Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVBlkdebugState *s = bs->opaque;
     QemuOpts *opts;
-    Error *local_err = NULL;
     int ret;
     uint64_t align;
 
     opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort);
-    qemu_opts_absorb_qdict(opts, options, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto out;
     }
@@ -421,10 +416,9 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags,
 
     /* Open the image file */
     bs->file = bdrv_open_child(qemu_opt_get(opts, "x-image"), options, "image",
-                               bs, &child_file, false, &local_err);
-    if (local_err) {
+                               bs, &child_file, false, errp);
+    if (*errp) {
         ret = -EINVAL;
-        error_propagate(errp, local_err);
         goto out;
     }
 
Signature · 1 line
2.21.0
#181 lore raw

RFC v5 115/126 vpc: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/vpc.c | 28 ++++++++++++----------------
 1 file changed, 12 insertions(+), 16 deletions(-)
block/vpc.c +12 -16
index 5cd3890780..c685a9ae41 100644
@@ -213,12 +213,12 @@ static void vpc_parse_options(BlockDriverState *bs, QemuOpts *opts,
 static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
                     Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVVPCState *s = bs->opaque;
     int i;
     VHDFooter *footer;
     VHDDynDiskHeader *dyndisk_header;
     QemuOpts *opts = NULL;
-    Error *local_err = NULL;
     bool use_chs;
     uint8_t buf[HEADER_SIZE];
     uint32_t checksum;
@@ -235,16 +235,14 @@ 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) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
 
-    vpc_parse_options(bs, opts, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    vpc_parse_options(bs, opts, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
@@ -448,9 +446,8 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
     error_setg(&s->migration_blocker, "The vpc format used by node '%s' "
                "does not support live migration",
                bdrv_get_device_or_node_name(bs));
-    ret = migrate_add_blocker(s->migration_blocker, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    ret = migrate_add_blocker(s->migration_blocker, errp);
+    if (*errp) {
         error_free(s->migration_blocker);
         goto fail;
     }
@@ -971,6 +968,7 @@ static int calculate_rounded_image_size(BlockdevCreateOptionsVpc *vpc_opts,
 static int coroutine_fn vpc_co_create(BlockdevCreateOptions *opts,
                                       Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockdevCreateOptionsVpc *vpc_opts;
     BlockBackend *blk = NULL;
     BlockDriverState *bs = NULL;
@@ -1092,11 +1090,11 @@ out:
 static int coroutine_fn vpc_co_create_opts(const char *filename,
                                            QemuOpts *opts, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockdevCreateOptions *create_options = NULL;
     QDict *qdict;
     Visitor *v;
     BlockDriverState *bs = NULL;
-    Error *local_err = NULL;
     int ret;
 
     static const QDictRenames opt_renames[] = {
@@ -1113,9 +1111,8 @@ static int coroutine_fn vpc_co_create_opts(const char *filename,
     }
 
     /* Create and open the file (protocol layer) */
-    ret = bdrv_create_file(filename, opts, &local_err);
+    ret = bdrv_create_file(filename, opts, errp);
     if (ret < 0) {
-        error_propagate(errp, local_err);
         goto fail;
     }
 
@@ -1136,11 +1133,10 @@ static int coroutine_fn vpc_co_create_opts(const char *filename,
         goto fail;
     }
 
-    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
+    visit_type_BlockdevCreateOptions(v, NULL, &create_options, errp);
     visit_free(v);
 
-    if (local_err) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
Signature · 1 line
2.21.0
#182 lore raw

RFC v5 116/126 vvfat: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/vvfat.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
block/vvfat.c +5 -7
index 019b8f1341..34cbed71b7 100644
@@ -1149,12 +1149,12 @@ static void vvfat_parse_filename(const char *filename, QDict *options,
 static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
                       Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVVVFATState *s = bs->opaque;
     int cyls, heads, secs;
     bool floppy;
     const char *dirname, *label;
     QemuOpts *opts;
-    Error *local_err = NULL;
     int ret;
 
 #ifdef DEBUG
@@ -1162,9 +1162,8 @@ 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) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         ret = -EINVAL;
         goto fail;
     }
@@ -1282,9 +1281,8 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
                    "The vvfat (rw) format used by node '%s' "
                    "does not support live migration",
                    bdrv_get_device_or_node_name(bs));
-        ret = migrate_add_blocker(s->migration_blocker, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        ret = migrate_add_blocker(s->migration_blocker, errp);
+        if (*errp) {
             error_free(s->migration_blocker);
             goto fail;
         }
Signature · 1 line
2.21.0
#183 lore raw

RFC v5 117/126 Replication: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 block/replication.c | 40 ++++++++++++++++++----------------------
 replication.c       | 28 ++++++++++++----------------
 2 files changed, 30 insertions(+), 38 deletions(-)
block/replication.c +18 -22
index 936b2f8b5a..f5e7c5a8ec 100644
@@ -83,9 +83,9 @@ static ReplicationOps replication_ops = {
 static int replication_open(BlockDriverState *bs, QDict *options,
                             int flags, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int ret;
     BDRVReplicationState *s = bs->opaque;
-    Error *local_err = NULL;
     QemuOpts *opts = NULL;
     const char *mode;
     const char *top_id;
@@ -98,14 +98,14 @@ 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) {
+    qemu_opts_absorb_qdict(opts, options, errp);
+    if (*errp) {
         goto fail;
     }
 
     mode = qemu_opt_get(opts, REPLICATION_MODE);
     if (!mode) {
-        error_setg(&local_err, "Missing the option mode");
+        error_setg(errp, "Missing the option mode");
         goto fail;
     }
 
@@ -113,7 +113,8 @@ static int replication_open(BlockDriverState *bs, QDict *options,
         s->mode = REPLICATION_MODE_PRIMARY;
         top_id = qemu_opt_get(opts, REPLICATION_TOP_ID);
         if (top_id) {
-            error_setg(&local_err, "The primary side does not support option top-id");
+            error_setg(errp,
+                       "The primary side does not support option top-id");
             goto fail;
         }
     } else if (!strcmp(mode, "secondary")) {
@@ -121,11 +122,11 @@ static int replication_open(BlockDriverState *bs, QDict *options,
         top_id = qemu_opt_get(opts, REPLICATION_TOP_ID);
         s->top_id = g_strdup(top_id);
         if (!s->top_id) {
-            error_setg(&local_err, "Missing the option top-id");
+            error_setg(errp, "Missing the option top-id");
             goto fail;
         }
     } else {
-        error_setg(&local_err,
+        error_setg(errp,
                    "The option mode's value should be primary or secondary");
         goto fail;
     }
@@ -136,7 +137,6 @@ static int replication_open(BlockDriverState *bs, QDict *options,
 
 fail:
     qemu_opts_del(opts);
-    error_propagate(errp, local_err);
 
     return ret;
 }
@@ -314,7 +314,7 @@ static bool replication_recurse_is_first_non_filter(BlockDriverState *bs,
 
 static void secondary_do_checkpoint(BDRVReplicationState *s, Error **errp)
 {
-    Error *local_err = NULL;
+    ERRP_AUTO_PROPAGATE();
     int ret;
 
     if (!s->backup_job) {
@@ -322,9 +322,8 @@ static void secondary_do_checkpoint(BDRVReplicationState *s, Error **errp)
         return;
     }
 
-    backup_do_checkpoint(s->backup_job, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    backup_do_checkpoint(s->backup_job, errp);
+    if (*errp) {
         return;
     }
 
@@ -361,9 +360,9 @@ static void secondary_do_checkpoint(BDRVReplicationState *s, Error **errp)
 static void reopen_backing_file(BlockDriverState *bs, bool writable,
                                 Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BDRVReplicationState *s = bs->opaque;
     BlockReopenQueue *reopen_queue = NULL;
-    Error *local_err = NULL;
 
     if (writable) {
         s->orig_hidden_read_only = bdrv_is_read_only(s->hidden_disk->bs);
@@ -388,8 +387,7 @@ static void reopen_backing_file(BlockDriverState *bs, bool writable,
     }
 
     if (reopen_queue) {
-        bdrv_reopen_multiple(reopen_queue, &local_err);
-        error_propagate(errp, local_err);
+        bdrv_reopen_multiple(reopen_queue, errp);
     }
 
     bdrv_subtree_drained_end(s->hidden_disk->bs);
@@ -445,12 +443,12 @@ static bool check_top_bs(BlockDriverState *top_bs, BlockDriverState *bs)
 static void replication_start(ReplicationState *rs, ReplicationMode mode,
                               Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BlockDriverState *bs = rs->opaque;
     BDRVReplicationState *s;
     BlockDriverState *top_bs;
     int64_t active_length, hidden_length, disk_length;
     AioContext *aio_context;
-    Error *local_err = NULL;
 
     aio_context = bdrv_get_aio_context(bs);
     aio_context_acquire(aio_context);
@@ -519,9 +517,8 @@ static void replication_start(ReplicationState *rs, ReplicationMode mode,
         }
 
         /* reopen the backing file in r/w mode */
-        reopen_backing_file(bs, true, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        reopen_backing_file(bs, true, errp);
+        if (*errp) {
             aio_context_release(aio_context);
             return;
         }
@@ -546,9 +543,8 @@ static void replication_start(ReplicationState *rs, ReplicationMode mode,
                                 0, MIRROR_SYNC_MODE_NONE, NULL, 0, false,
                                 BLOCKDEV_ON_ERROR_REPORT,
                                 BLOCKDEV_ON_ERROR_REPORT, JOB_INTERNAL,
-                                backup_job_completed, bs, NULL, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+                                backup_job_completed, bs, NULL, errp);
+        if (*errp) {
             backup_job_cleanup(bs);
             aio_context_release(aio_context);
             return;
replication.c +12 -16
index be3a42f9c9..2e5ea7f537 100644
@@ -44,15 +44,14 @@ void replication_remove(ReplicationState *rs)
  */
 void replication_start_all(ReplicationMode mode, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     ReplicationState *rs, *next;
-    Error *local_err = NULL;
 
     QLIST_FOREACH_SAFE(rs, &replication_states, node, next) {
         if (rs->ops && rs->ops->start) {
-            rs->ops->start(rs, mode, &local_err);
+            rs->ops->start(rs, mode, errp);
         }
-        if (local_err) {
-            error_propagate(errp, local_err);
+        if (*errp) {
             return;
         }
     }
@@ -60,15 +59,14 @@ void replication_start_all(ReplicationMode mode, Error **errp)
 
 void replication_do_checkpoint_all(Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     ReplicationState *rs, *next;
-    Error *local_err = NULL;
 
     QLIST_FOREACH_SAFE(rs, &replication_states, node, next) {
         if (rs->ops && rs->ops->checkpoint) {
-            rs->ops->checkpoint(rs, &local_err);
+            rs->ops->checkpoint(rs, errp);
         }
-        if (local_err) {
-            error_propagate(errp, local_err);
+        if (*errp) {
             return;
         }
     }
@@ -76,15 +74,14 @@ void replication_do_checkpoint_all(Error **errp)
 
 void replication_get_error_all(Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     ReplicationState *rs, *next;
-    Error *local_err = NULL;
 
     QLIST_FOREACH_SAFE(rs, &replication_states, node, next) {
         if (rs->ops && rs->ops->get_error) {
-            rs->ops->get_error(rs, &local_err);
+            rs->ops->get_error(rs, errp);
         }
-        if (local_err) {
-            error_propagate(errp, local_err);
+        if (*errp) {
             return;
         }
     }
@@ -92,15 +89,14 @@ void replication_get_error_all(Error **errp)
 
 void replication_stop_all(bool failover, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     ReplicationState *rs, *next;
-    Error *local_err = NULL;
 
     QLIST_FOREACH_SAFE(rs, &replication_states, node, next) {
         if (rs->ops && rs->ops->stop) {
-            rs->ops->stop(rs, failover, &local_err);
+            rs->ops->stop(rs, failover, errp);
         }
-        if (local_err) {
-            error_propagate(errp, local_err);
+        if (*errp) {
             return;
         }
     }
Signature · 1 line
2.21.0
#184 lore raw

RFC v5 118/126 PVRDMA: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 hw/rdma/vmw/pvrdma_main.c | 1 +
 1 file changed, 1 insertion(+)
hw/rdma/vmw/pvrdma_main.c +1 -0
index 3e36e13013..fd1a6ef099 100644
@@ -592,6 +592,7 @@ static void pvrdma_shutdown_notifier(Notifier *n, void *opaque)
 
 static void pvrdma_realize(PCIDevice *pdev, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int rc = 0;
     PVRDMADev *dev = PVRDMA_DEV(pdev);
     Object *memdev_root;
Signature · 1 line
2.21.0
#185 lore raw

RFC v5 119/126 hw/core/bus.c: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 hw/core/bus.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
hw/core/bus.c +7 -8
index 7f3d2a3dbd..0a1e508963 100644
@@ -146,14 +146,14 @@ static bool bus_get_realized(Object *obj, Error **errp)
 
 static void bus_set_realized(Object *obj, bool value, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     BusState *bus = BUS(obj);
     BusClass *bc = BUS_GET_CLASS(bus);
     BusChild *kid;
-    Error *local_err = NULL;
 
     if (value && !bus->realized) {
         if (bc->realize) {
-            bc->realize(bus, &local_err);
+            bc->realize(bus, errp);
         }
 
         /* TODO: recursive realization */
@@ -161,18 +161,17 @@ static void bus_set_realized(Object *obj, bool value, Error **errp)
         QTAILQ_FOREACH(kid, &bus->children, sibling) {
             DeviceState *dev = kid->child;
             object_property_set_bool(OBJECT(dev), false, "realized",
-                                     &local_err);
-            if (local_err != NULL) {
+                                     errp);
+            if (*errp) {
                 break;
             }
         }
-        if (bc->unrealize && local_err == NULL) {
-            bc->unrealize(bus, &local_err);
+        if (bc->unrealize && *errp == NULL) {
+            bc->unrealize(bus, errp);
         }
     }
 
-    if (local_err != NULL) {
-        error_propagate(errp, local_err);
+    if (*errp) {
         return;
     }
 
Signature · 1 line
2.21.0
Reviewed-by on v5 119/126
#186 lore raw

Re: [RFC v5 119/126] hw/core/bus.c: introduce ERRP_AUTO_PROPAGATE

Quoted 69 lines · Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

     spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
     --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
     ...
     goto out;
     ...
     out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
  hw/core/bus.c | 15 +++++++--------
  1 file changed, 7 insertions(+), 8 deletions(-)
hw/core/bus.c +2 -2
index 7f3d2a3dbd..0a1e508963 100644
@@ -146,14 +146,14 @@ static bool bus_get_realized(Object *obj, Error **errp)
 
  static void bus_set_realized(Object *obj, bool value, Error **errp)
  {
+    ERRP_AUTO_PROPAGATE();
      BusState *bus = BUS(obj);
      BusClass *bc = BUS_GET_CLASS(bus);
      BusChild *kid;
-    Error *local_err = NULL;
 
      if (value && !bus->realized) {
          if (bc->realize) {
-            bc->realize(bus, &local_err);
+            bc->realize(bus, errp);
          }
 
          /* TODO: recursive realization */

hw/core/bus.c static void bus_set_realized(Object *obj, bool value, Error **errp) · line 164

Quoted 6 lines
hw/core/bus.c +1 -2
@@ -161,18 +161,17 @@ static void bus_set_realized(Object *obj, bool value, Error **errp)
          QTAILQ_FOREACH(kid, &bus->children, sibling) {
              DeviceState *dev = kid->child;
              object_property_set_bool(OBJECT(dev), false, "realized",
-                                     &local_err);
-            if (local_err != NULL) {
+                                     errp);

You can add it at the end of the previous line.

Regardless:

Quoted 18 lines
hw/core/bus.c +4 -4
+            if (*errp) {
                  break;
              }
          }
-        if (bc->unrealize && local_err == NULL) {
-            bc->unrealize(bus, &local_err);
+        if (bc->unrealize && *errp == NULL) {
+            bc->unrealize(bus, errp);
          }
      }
 
-    if (local_err != NULL) {
-        error_propagate(errp, local_err);
+    if (*errp) {
          return;
      }
 
#187 lore raw

RFC v5 120/126 hw/cpu/core.c: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 hw/cpu/core.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
hw/cpu/core.c +6 -8
index 9874c5c870..9620bd7939 100644
@@ -27,13 +27,12 @@ static void core_prop_get_core_id(Object *obj, Visitor *v, const char *name,
 static void core_prop_set_core_id(Object *obj, Visitor *v, const char *name,
                                   void *opaque, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     CPUCore *core = CPU_CORE(obj);
-    Error *local_err = NULL;
     int64_t value;
 
-    visit_type_int(v, name, &value, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_int(v, name, &value, errp);
+    if (*errp) {
         return;
     }
 
@@ -57,13 +56,12 @@ static void core_prop_get_nr_threads(Object *obj, Visitor *v, const char *name,
 static void core_prop_set_nr_threads(Object *obj, Visitor *v, const char *name,
                                      void *opaque, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     CPUCore *core = CPU_CORE(obj);
-    Error *local_err = NULL;
     int64_t value;
 
-    visit_type_int(v, name, &value, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    visit_type_int(v, name, &value, errp);
+    if (*errp) {
         return;
     }
 
Signature · 1 line
2.21.0
#188 lore raw

RFC v5 121/126 hw/sd/ssi-sd.c: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 hw/sd/ssi-sd.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
hw/sd/ssi-sd.c +8 -6
index 91db069212..f42204d649 100644
@@ -241,10 +241,10 @@ static const VMStateDescription vmstate_ssi_sd = {
 
 static void ssi_sd_realize(SSISlave *d, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     ssi_sd_state *s = FROM_SSI_SLAVE(ssi_sd_state, d);
     DeviceState *carddev;
     DriveInfo *dinfo;
-    Error *err = NULL;
 
     qbus_create_inplace(&s->sdbus, sizeof(s->sdbus), TYPE_SD_BUS,
                         DEVICE(d), "sd-bus");
@@ -254,12 +254,14 @@ static void ssi_sd_realize(SSISlave *d, Error **errp)
     dinfo = drive_get_next(IF_SD);
     carddev = qdev_create(BUS(&s->sdbus), TYPE_SD_CARD);
     if (dinfo) {
-        qdev_prop_set_drive(carddev, "drive", blk_by_legacy_dinfo(dinfo), &err);
+        qdev_prop_set_drive(carddev, "drive", blk_by_legacy_dinfo(dinfo),
+                            errp);
     }
-    object_property_set_bool(OBJECT(carddev), true, "spi", &err);
-    object_property_set_bool(OBJECT(carddev), true, "realized", &err);
-    if (err) {
-        error_setg(errp, "failed to init SD card: %s", error_get_pretty(err));
+    object_property_set_bool(OBJECT(carddev), true, "spi", errp);
+    object_property_set_bool(OBJECT(carddev), true, "realized", errp);
+    if (*errp) {
+        error_setg(errp, "failed to init SD card: %s",
+                   error_get_pretty(*errp));
         return;
     }
 }
Signature · 1 line
2.21.0
Reviewed-by on v5 121/126
#189 lore raw

Re: [RFC v5 121/126] hw/sd/ssi-sd.c: introduce ERRP_AUTO_PROPAGATE

Quoted 64 lines · Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

     spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
     --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
     ...
     goto out;
     ...
     out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
  hw/sd/ssi-sd.c | 14 ++++++++------
  1 file changed, 8 insertions(+), 6 deletions(-)
hw/sd/ssi-sd.c +1 -1
index 91db069212..f42204d649 100644
@@ -241,10 +241,10 @@ static const VMStateDescription vmstate_ssi_sd = {
 
  static void ssi_sd_realize(SSISlave *d, Error **errp)
  {
+    ERRP_AUTO_PROPAGATE();
      ssi_sd_state *s = FROM_SSI_SLAVE(ssi_sd_state, d);
      DeviceState *carddev;
      DriveInfo *dinfo;
-    Error *err = NULL;
 
      qbus_create_inplace(&s->sdbus, sizeof(s->sdbus), TYPE_SD_BUS,
                          DEVICE(d), "sd-bus");

hw/sd/ssi-sd.c static void ssi_sd_realize(SSISlave *d, Error **errp) · line 258

Quoted 6 lines
hw/sd/ssi-sd.c +2 -1
@@ -254,12 +254,14 @@ static void ssi_sd_realize(SSISlave *d, Error **errp)
      dinfo = drive_get_next(IF_SD);
      carddev = qdev_create(BUS(&s->sdbus), TYPE_SD_CARD);
      if (dinfo) {
-        qdev_prop_set_drive(carddev, "drive", blk_by_legacy_dinfo(dinfo), &err);
+        qdev_prop_set_drive(carddev, "drive", blk_by_legacy_dinfo(dinfo),
+                            errp);

This fits 72 chars, can you keep it in the same line?

hw/sd/ssi-sd.c static void ssi_sd_realize(SSISlave *d, Error **errp) · line 264

Quoted 10 lines
hw/sd/ssi-sd.c +5 -4
      }
-    object_property_set_bool(OBJECT(carddev), true, "spi", &err);
-    object_property_set_bool(OBJECT(carddev), true, "realized", &err);
-    if (err) {
-        error_setg(errp, "failed to init SD card: %s", error_get_pretty(err));
+    object_property_set_bool(OBJECT(carddev), true, "spi", errp);
+    object_property_set_bool(OBJECT(carddev), true, "realized", errp);
+    if (*errp) {
+        error_setg(errp, "failed to init SD card: %s",
+                   error_get_pretty(*errp));

Ditto...

hw/sd/ssi-sd.c static void ssi_sd_realize(SSISlave *d, Error **errp) · line 267

Quoted 4 lines
hw/sd/ssi-sd.c +0 -0
          return;
      }
  }

If possible please squash with "47/126 SD (Secure Card)"

#190 lore raw

Re: [RFC v5 121/126] hw/sd/ssi-sd.c: introduce ERRP_AUTO_PROPAGATE

Quoted 63 lines · Philippe Mathieu-Daudé
Quoted 62 lines · Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call).  Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \
     spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
     --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \
done;

then fix a bit of compilation problems: coccinelle for some reason leaves several
f() {
     ...
     goto out;
     ...
     out:
}
patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
  hw/sd/ssi-sd.c | 14 ++++++++------

  1 file changed, 8 insertions(+), 6 deletions(-)
hw/sd/ssi-sd.c +1 -1
index 91db069212..f42204d649 100644
@@ -241,10 +241,10 @@ static const VMStateDescription vmstate_ssi_sd = {
   static void ssi_sd_realize(SSISlave *d, Error **errp)
   {
+    ERRP_AUTO_PROPAGATE();
       ssi_sd_state *s = FROM_SSI_SLAVE(ssi_sd_state, d);
       DeviceState *carddev;
       DriveInfo *dinfo;
-    Error *err = NULL;
       qbus_create_inplace(&s->sdbus, sizeof(s->sdbus), TYPE_SD_BUS,
                           DEVICE(d), "sd-bus");
@@ -254,12 +254,14 @@ static void ssi_sd_realize(SSISlave *d, Error **errp)
Quoted 8 lines

hw/sd/ssi-sd.c static void ssi_sd_realize(SSISlave *d, Error **errp) · line 258

Quoted 6 lines
hw/sd/ssi-sd.c +2 -1
       dinfo = drive_get_next(IF_SD);
       carddev = qdev_create(BUS(&s->sdbus), TYPE_SD_CARD);
       if (dinfo) {
-        qdev_prop_set_drive(carddev, "drive", blk_by_legacy_dinfo(dinfo), &err);
+        qdev_prop_set_drive(carddev, "drive", blk_by_legacy_dinfo(dinfo),
+                            errp);

This fits 72 chars, can you keep it in the same line?

Honestly, I'd prefer not fixing code style in these 100 auto-generated commits... But if only you request this, it's not a problem.

Quoted 12 lines

hw/sd/ssi-sd.c static void ssi_sd_realize(SSISlave *d, Error **errp) · line 264

Quoted 11 lines
hw/sd/ssi-sd.c +5 -4
       }
-    object_property_set_bool(OBJECT(carddev), true, "spi", &err);
-    object_property_set_bool(OBJECT(carddev), true, "realized", &err);
-    if (err) {
-        error_setg(errp, "failed to init SD card: %s", error_get_pretty(err));
+    object_property_set_bool(OBJECT(carddev), true, "spi", errp);
+    object_property_set_bool(OBJECT(carddev), true, "realized", errp);
+    if (*errp) {
+        error_setg(errp, "failed to init SD card: %s",
+                   error_get_pretty(*errp));
Quoted 8 lines

Ditto...

hw/sd/ssi-sd.c static void ssi_sd_realize(SSISlave *d, Error **errp) · line 267

Quoted 4 lines
hw/sd/ssi-sd.c +0 -0
           return;
       }
   }

If possible please squash with "47/126 SD (Secure Card)"

Hmm this is in separate, as it's unmaintained accordingly to MAINTAINERS. I'll rebase the next version on your MAINTAINERS-fixes and it should work.

Quoted 2 lines

Thanks!

Signature · 2 lines
Best regards,
Vladimir
#191 lore raw

Re: [RFC v5 121/126] hw/sd/ssi-sd.c: introduce ERRP_AUTO_PROPAGATE

Quoted 73 lines · Vladimir Sementsov-Ogievskiy
Quoted 63 lines · Philippe Mathieu-Daudé
Quoted 62 lines · Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call).  Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \
     spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
     --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \
done;

then fix a bit of compilation problems: coccinelle for some reason leaves several
f() {
     ...
     goto out;
     ...
     out:
}
patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
   hw/sd/ssi-sd.c | 14 ++++++++------
   1 file changed, 8 insertions(+), 6 deletions(-)
hw/sd/ssi-sd.c +1 -1
index 91db069212..f42204d649 100644
@@ -241,10 +241,10 @@ static const VMStateDescription vmstate_ssi_sd = {
   static void ssi_sd_realize(SSISlave *d, Error **errp)
   {
+    ERRP_AUTO_PROPAGATE();
       ssi_sd_state *s = FROM_SSI_SLAVE(ssi_sd_state, d);
       DeviceState *carddev;
       DriveInfo *dinfo;
-    Error *err = NULL;
       qbus_create_inplace(&s->sdbus, sizeof(s->sdbus), TYPE_SD_BUS,
                           DEVICE(d), "sd-bus");
@@ -254,12 +254,14 @@ static void ssi_sd_realize(SSISlave *d, Error **errp)
Quoted 8 lines

hw/sd/ssi-sd.c static void ssi_sd_realize(SSISlave *d, Error **errp) · line 258

Quoted 6 lines
hw/sd/ssi-sd.c +2 -1
       dinfo = drive_get_next(IF_SD);
       carddev = qdev_create(BUS(&s->sdbus), TYPE_SD_CARD);
       if (dinfo) {
-        qdev_prop_set_drive(carddev, "drive", blk_by_legacy_dinfo(dinfo), &err);
+        qdev_prop_set_drive(carddev, "drive", blk_by_legacy_dinfo(dinfo),
+                            errp);

This fits 72 chars, can you keep it in the same line?

Quoted 2 lines

Honestly, I'd prefer not fixing code style in these 100 auto-generated commits... But if only you request this, it's not a problem.

Ah, Coccinelle added the newline. Hmm maybe there is a spatch argument to set the maximum line length?

$ spatch --longhelp
[...]
  --linux-spacing               spacing of + code follows the 
conventions of Linux
  --smpl-spacing                spacing of + code follows the semantic 
patch
  --indent                      default indent, in spaces (no tabs)
  --max-width                   column limit for generated code

Have you tried --max-width? Maybe we need a combination with --smpl-spacing.

Quoted 29 lines
Quoted 12 lines

hw/sd/ssi-sd.c static void ssi_sd_realize(SSISlave *d, Error **errp) · line 264

Quoted 11 lines
hw/sd/ssi-sd.c +5 -4
       }
-    object_property_set_bool(OBJECT(carddev), true, "spi", &err);
-    object_property_set_bool(OBJECT(carddev), true, "realized", &err);
-    if (err) {
-        error_setg(errp, "failed to init SD card: %s", error_get_pretty(err));
+    object_property_set_bool(OBJECT(carddev), true, "spi", errp);
+    object_property_set_bool(OBJECT(carddev), true, "realized", errp);
+    if (*errp) {
+        error_setg(errp, "failed to init SD card: %s",
+                   error_get_pretty(*errp));
Quoted 8 lines

Ditto...

hw/sd/ssi-sd.c static void ssi_sd_realize(SSISlave *d, Error **errp) · line 267

Quoted 4 lines
hw/sd/ssi-sd.c +0 -0
           return;
       }
   }

If possible please squash with "47/126 SD (Secure Card)"

Hmm this is in separate, as it's unmaintained accordingly to MAINTAINERS. I'll rebase the next version on your MAINTAINERS-fixes and it should work.

Quoted 2 lines

Thanks!

#192 lore raw

Re: [RFC v5 121/126] hw/sd/ssi-sd.c: introduce ERRP_AUTO_PROPAGATE

Quoted 79 lines · Philippe Mathieu-Daudé
Quoted 73 lines · Vladimir Sementsov-Ogievskiy
Quoted 63 lines · Philippe Mathieu-Daudé
Quoted 62 lines · Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call).  Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \
      spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
      --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \
done;

then fix a bit of compilation problems: coccinelle for some reason leaves several
f() {
      ...
      goto out;
      ...
      out:
}
patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
   hw/sd/ssi-sd.c | 14 ++++++++------

   1 file changed, 8 insertions(+), 6 deletions(-)
hw/sd/ssi-sd.c +1 -1
index 91db069212..f42204d649 100644
@@ -241,10 +241,10 @@ static const VMStateDescription vmstate_ssi_sd = {
    static void ssi_sd_realize(SSISlave *d, Error **errp)
    {
+    ERRP_AUTO_PROPAGATE();
        ssi_sd_state *s = FROM_SSI_SLAVE(ssi_sd_state, d);
        DeviceState *carddev;
        DriveInfo *dinfo;
-    Error *err = NULL;
        qbus_create_inplace(&s->sdbus, sizeof(s->sdbus), TYPE_SD_BUS,
                            DEVICE(d), "sd-bus");
@@ -254,12 +254,14 @@ static void ssi_sd_realize(SSISlave *d, Error **errp)
Quoted 8 lines

hw/sd/ssi-sd.c static void ssi_sd_realize(SSISlave *d, Error **errp) · line 258

Quoted 6 lines
hw/sd/ssi-sd.c +2 -1
        dinfo = drive_get_next(IF_SD);
        carddev = qdev_create(BUS(&s->sdbus), TYPE_SD_CARD);
        if (dinfo) {
-        qdev_prop_set_drive(carddev, "drive", blk_by_legacy_dinfo(dinfo), &err);
+        qdev_prop_set_drive(carddev, "drive", blk_by_legacy_dinfo(dinfo),
+                            errp);

This fits 72 chars, can you keep it in the same line?

Quoted 2 lines

Honestly, I'd prefer not fixing code style in these 100 auto-generated commits... But if only you request this, it's not a problem.

Ah, Coccinelle added the newline. Hmm maybe there is a spatch argument to set the maximum line length?

Quoted 8 lines
$ spatch --longhelp
[...]
   --linux-spacing               spacing of + code follows the conventions of Linux
   --smpl-spacing                spacing of + code follows the semantic patch
   --indent                      default indent, in spaces (no tabs)
   --max-width                   column limit for generated code

Have you tried --max-width? Maybe we need a combination with --smpl-spacing.

Hmm, thanks, I'll try.

Quoted 30 lines
Quoted 30 lines
Quoted 13 lines

hw/sd/ssi-sd.c static void ssi_sd_realize(SSISlave *d, Error **errp) · line 264

Quoted 12 lines
hw/sd/ssi-sd.c +5 -4
        }
-    object_property_set_bool(OBJECT(carddev), true, "spi", &err);
-    object_property_set_bool(OBJECT(carddev), true, "realized", &err);
-    if (err) {
-        error_setg(errp, "failed to init SD card: %s", error_get_pretty(err));
+    object_property_set_bool(OBJECT(carddev), true, "spi", errp);
+    object_property_set_bool(OBJECT(carddev), true, "realized", errp);
+    if (*errp) {
+        error_setg(errp, "failed to init SD card: %s",
+                   error_get_pretty(*errp));
Quoted 8 lines

Ditto...

hw/sd/ssi-sd.c static void ssi_sd_realize(SSISlave *d, Error **errp) · line 267

Quoted 4 lines
hw/sd/ssi-sd.c +0 -0
            return;
        }
    }

If possible please squash with "47/126 SD (Secure Card)"

Hmm this is in separate, as it's unmaintained accordingly to MAINTAINERS. I'll rebase the next version on your MAINTAINERS-fixes and it should work.

Quoted 2 lines

Thanks!

Signature · 2 lines
Best regards,
Vladimir
#193 lore raw

RFC v5 122/126 iothread.c: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 iothread.c | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)
iothread.c +11 -16
index 7130be58e3..726b60df53 100644
@@ -163,15 +163,14 @@ static void iothread_init_gcontext(IOThread *iothread)
 
 static void iothread_complete(UserCreatable *obj, Error **errp)
 {
-    Error *local_error = NULL;
+    ERRP_AUTO_PROPAGATE();
     IOThread *iothread = IOTHREAD(obj);
     char *name, *thread_name;
 
     iothread->stopping = false;
     iothread->running = true;
-    iothread->ctx = aio_context_new(&local_error);
+    iothread->ctx = aio_context_new(errp);
     if (!iothread->ctx) {
-        error_propagate(errp, local_error);
         return;
     }
 
@@ -185,9 +184,8 @@ static void iothread_complete(UserCreatable *obj, Error **errp)
                                 iothread->poll_max_ns,
                                 iothread->poll_grow,
                                 iothread->poll_shrink,
-                                &local_error);
-    if (local_error) {
-        error_propagate(errp, local_error);
+                                errp);
+    if (*errp) {
         aio_context_unref(iothread->ctx);
         iothread->ctx = NULL;
         return;
@@ -237,21 +235,21 @@ static void iothread_get_poll_param(Object *obj, Visitor *v,
 static void iothread_set_poll_param(Object *obj, Visitor *v,
         const char *name, void *opaque, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     IOThread *iothread = IOTHREAD(obj);
     PollParamInfo *info = opaque;
     int64_t *field = (void *)iothread + info->offset;
-    Error *local_err = NULL;
     int64_t value;
 
-    visit_type_int64(v, name, &value, &local_err);
-    if (local_err) {
-        goto out;
+    visit_type_int64(v, name, &value, errp);
+    if (*errp) {
+        return;
     }
 
     if (value < 0) {
-        error_setg(&local_err, "%s value must be in range [0, %"PRId64"]",
+        error_setg(errp, "%s value must be in range [0, %"PRId64"]",
                    info->name, INT64_MAX);
-        goto out;
+        return;
     }
 
     *field = value;
@@ -261,11 +259,8 @@ static void iothread_set_poll_param(Object *obj, Visitor *v,
                                     iothread->poll_max_ns,
                                     iothread->poll_grow,
                                     iothread->poll_shrink,
-                                    &local_err);
+                                    errp);
     }
-
-out:
-    error_propagate(errp, local_err);
 }
 
 static void iothread_class_init(ObjectClass *klass, void *class_data)
Signature · 1 line
2.21.0
#194 lore raw

RFC v5 123/126 memory_mapping.c: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 memory_mapping.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
memory_mapping.c +3 -4
index 18d0b8067c..d95df2484b 100644
@@ -288,6 +288,7 @@ void qemu_get_guest_memory_mapping(MemoryMappingList *list,
                                    const GuestPhysBlockList *guest_phys_blocks,
                                    Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     CPUState *cpu, *first_paging_enabled_cpu;
     GuestPhysBlock *block;
     ram_addr_t offset, length;
@@ -296,10 +297,8 @@ void qemu_get_guest_memory_mapping(MemoryMappingList *list,
     if (first_paging_enabled_cpu) {
         for (cpu = first_paging_enabled_cpu; cpu != NULL;
              cpu = CPU_NEXT(cpu)) {
-            Error *err = NULL;
-            cpu_get_memory_mapping(cpu, list, &err);
-            if (err) {
-                error_propagate(errp, err);
+            cpu_get_memory_mapping(cpu, list, errp);
+            if (*errp) {
                 return;
             }
         }
Signature · 1 line
2.21.0
#195 lore raw

RFC v5 124/126 target/tilegx/cpu.c: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 target/tilegx/cpu.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
target/tilegx/cpu.c +3 -4
index 2b2a7ccc31..79bfe27856 100644
@@ -81,13 +81,12 @@ static void tilegx_cpu_reset(CPUState *s)
 
 static void tilegx_cpu_realizefn(DeviceState *dev, Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     CPUState *cs = CPU(dev);
     TileGXCPUClass *tcc = TILEGX_CPU_GET_CLASS(dev);
-    Error *local_err = NULL;
 
-    cpu_exec_realizefn(cs, &local_err);
-    if (local_err != NULL) {
-        error_propagate(errp, local_err);
+    cpu_exec_realizefn(cs, errp);
+    if (*errp) {
         return;
     }
 
Signature · 1 line
2.21.0
Reviewed-by on v5 124/126
#196 lore raw

Re: [RFC v5 124/126] target/tilegx/cpu.c: introduce ERRP_AUTO_PROPAGATE

Quoted 59 lines · Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

     spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
     --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
     ...
     goto out;
     ...
     out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
  target/tilegx/cpu.c | 7 +++----
  1 file changed, 3 insertions(+), 4 deletions(-)
target/tilegx/cpu.c +1 -0
index 2b2a7ccc31..79bfe27856 100644
@@ -81,13 +81,12 @@ static void tilegx_cpu_reset(CPUState *s)
 
  static void tilegx_cpu_realizefn(DeviceState *dev, Error **errp)
  {
+    ERRP_AUTO_PROPAGATE();
      CPUState *cs = CPU(dev);
      TileGXCPUClass *tcc = TILEGX_CPU_GET_CLASS(dev);

target/tilegx/cpu.c static void tilegx_cpu_reset(CPUState *s) · line 92

Quoted 10 lines
target/tilegx/cpu.c +2 -4
-    Error *local_err = NULL;
 
-    cpu_exec_realizefn(cs, &local_err);
-    if (local_err != NULL) {
-        error_propagate(errp, local_err);
+    cpu_exec_realizefn(cs, errp);
+    if (*errp) {
          return;
      }
 
#197 lore raw

RFC v5 125/126 tests/test-image-locking.c: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 tests/test-image-locking.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
tests/test-image-locking.c +3 -4
index ba057bd66c..4c996bdf55 100644
@@ -35,20 +35,19 @@ static BlockBackend *open_image(const char *path,
                                 uint64_t perm, uint64_t shared_perm,
                                 Error **errp)
 {
-    Error *local_err = NULL;
+    ERRP_AUTO_PROPAGATE();
     BlockBackend *blk;
     QDict *options = qdict_new();
 
     qdict_put_str(options, "driver", "raw");
-    blk = blk_new_open(path, NULL, options, BDRV_O_RDWR, &local_err);
+    blk = blk_new_open(path, NULL, options, BDRV_O_RDWR, errp);
     if (blk) {
-        g_assert_null(local_err);
+        g_assert_null(*errp);
         if (blk_set_perm(blk, perm, shared_perm, errp)) {
             blk_unref(blk);
             blk = NULL;
         }
     } else {
-        error_propagate(errp, local_err);
     }
     return blk;
 }
Signature · 1 line
2.21.0
#198 lore raw

RFC v5 126/126 util/qemu-config.c: introduce ERRP_AUTO_PROPAGATE

In reply to Vladimir Sementsov-Ogievskiy

If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == &fatal_err (the program will exit prior to the error_append_hint() or error_prepend() call). Fix such cases.

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

This commit (together with its neighbors) was generated by

for f in $(git grep -l errp \*.[ch]); do \

    spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \
    --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff $f; \

done;

then fix a bit of compilation problems: coccinelle for some reason leaves several

f() {
    ...
    goto out;
    ...
    out:
}

patterns, with "out:" at function end.

then
./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"

(auto-msg was a file with this commit message)

Still, for backporting it may be more comfortable to use only the first command and then do one huge commit.

---
 util/qemu-config.c | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)
util/qemu-config.c +12 -17
index 772f5a219e..13e2f797ba 100644
@@ -478,10 +478,10 @@ int qemu_read_config_file(const char *filename)
 static void config_parse_qdict_section(QDict *options, QemuOptsList *opts,
                                        Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     QemuOpts *subopts;
     QDict *subqdict;
     QList *list = NULL;
-    Error *local_err = NULL;
     size_t orig_size, enum_size;
     char *prefix;
 
@@ -493,15 +493,13 @@ static void config_parse_qdict_section(QDict *options, QemuOptsList *opts,
         goto out;
     }
 
-    subopts = qemu_opts_create(opts, NULL, 0, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    subopts = qemu_opts_create(opts, NULL, 0, errp);
+    if (*errp) {
         goto out;
     }
 
-    qemu_opts_absorb_qdict(subopts, subqdict, &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
+    qemu_opts_absorb_qdict(subopts, subqdict, errp);
+    if (*errp) {
         goto out;
     }
 
@@ -538,16 +536,14 @@ static void config_parse_qdict_section(QDict *options, QemuOptsList *opts,
             }
 
             opt_name = g_strdup_printf("%s.%u", opts->name, i++);
-            subopts = qemu_opts_create(opts, opt_name, 1, &local_err);
+            subopts = qemu_opts_create(opts, opt_name, 1, errp);
             g_free(opt_name);
-            if (local_err) {
-                error_propagate(errp, local_err);
+            if (*errp) {
                 goto out;
             }
 
-            qemu_opts_absorb_qdict(subopts, section, &local_err);
-            if (local_err) {
-                error_propagate(errp, local_err);
+            qemu_opts_absorb_qdict(subopts, section, errp);
+            if (*errp) {
                 qemu_opts_del(subopts);
                 goto out;
             }
@@ -569,13 +565,12 @@ out:
 void qemu_config_parse_qdict(QDict *options, QemuOptsList **lists,
                              Error **errp)
 {
+    ERRP_AUTO_PROPAGATE();
     int i;
-    Error *local_err = NULL;
 
     for (i = 0; lists[i]; i++) {
-        config_parse_qdict_section(options, lists[i], &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
+        config_parse_qdict_section(options, lists[i], errp);
+        if (*errp) {
             return;
         }
     }
Signature · 1 line
2.21.0
#199 lore raw
In reply to Vladimir Sementsov-Ogievskiy
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===

  TEST    iotest-qcow2: 013
  TEST    check-unit: tests/test-block-iothread
  TEST    check-unit: tests/test-image-locking

warning: Failed to get shared "consistent read" lock
Is another process using the image [/tmp/qtest.O66l3t]?
warning: Failed to get shared "consistent read" lock
Is another process using the image [/tmp/qtest.G0M9V8]?
TEST check-unit: tests/test-x86-cpuid
TEST check-unit: tests/test-xbzrle
---
TEST iotest-qcow2: 267
Failures: 054
Failed 1 of 108 iotests
make: *** [check-tests/check-block.sh] Error 1
make: *** Waiting for unfinished jobs....
TEST check-qtest-aarch64: tests/qos-test
Traceback (most recent call last):
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=2c55fb61a63a409382f2b3a99fca93d9', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-usvi8fob/src/docker-src.2019-10-11-22.00.10.1933:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=2c55fb61a63a409382f2b3a99fca93d9
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-usvi8fob/src'
make: *** [docker-run-test-quick@centos7] Error 2

real 10m33.714s
user 0m8.360s

The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

#200 lore raw
Quoted 32 lines · 12.10.2019 5:10, [email protected] wrote:

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1 === TEST SCRIPT END ===

   TEST    iotest-qcow2: 013
   TEST    check-unit: tests/test-block-iothread
   TEST    check-unit: tests/test-image-locking

warning: Failed to get shared "consistent read" lock Is another process using the image [/tmp/qtest.O66l3t]?
warning: Failed to get shared "consistent read" lock Is another process using the image [/tmp/qtest.G0M9V8]?
TEST check-unit: tests/test-x86-cpuid
TEST check-unit: tests/test-xbzrle
---
TEST iotest-qcow2: 267
Failures: 054
Failed 1 of 108 iotests
make: *** [check-tests/check-block.sh] Error 1
make: *** Waiting for unfinished jobs....
TEST check-qtest-aarch64: tests/qos-test

Quoted 8 lines

Traceback (most recent call last):
---
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=2c55fb61a63a409382f2b3a99fca93d9', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-usvi8fob/src/docker-src.2019-10-11-22.00.10.1933:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2. filter=--filter=label=com.qemu.instance.uuid=2c55fb61a63a409382f2b3a99fca93d9
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-usvi8fob/src'
make: *** [docker-run-test-quick@centos7] Error 2

Something strange. Who knows, what is it?

Quoted 7 lines

real 10m33.714s
user 0m8.360s

The full log is available at
http://patchew.org/logs/[email protected]/testing.docker-quick@centos7/?type=message.

""
Not Found

The requested resource was not found on this server. ""

Quoted 4 lines

---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

Signature · 2 lines
Best regards,
Vladimir
#201 lore raw
In reply to Vladimir Sementsov-Ogievskiy
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Subject: [RFC v5 000/126] error: auto propagated local_err
Type: series
Message-id: [email protected]

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Switched to a new branch 'test'
319b206 util/qemu-config.c: introduce ERRP_AUTO_PROPAGATE
3ee6567 tests/test-image-locking.c: introduce ERRP_AUTO_PROPAGATE 2e4f371 target/tilegx/cpu.c: introduce ERRP_AUTO_PROPAGATE
5f766d7 memory_mapping.c: introduce ERRP_AUTO_PROPAGATE
8969c6f iothread.c: introduce ERRP_AUTO_PROPAGATE
1534a92 hw/sd/ssi-sd.c: introduce ERRP_AUTO_PROPAGATE
b5b1e0a hw/cpu/core.c: introduce ERRP_AUTO_PROPAGATE
dd3f310 hw/core/bus.c: introduce ERRP_AUTO_PROPAGATE
21ee5f8 PVRDMA: introduce ERRP_AUTO_PROPAGATE
84365ab Replication: introduce ERRP_AUTO_PROPAGATE
225bbc5 vvfat: introduce ERRP_AUTO_PROPAGATE
2da58d6 vpc: introduce ERRP_AUTO_PROPAGATE
e7fb0b9 blkdebug: introduce ERRP_AUTO_PROPAGATE
39d367e qcow: introduce ERRP_AUTO_PROPAGATE
1b7546c qcow2: introduce ERRP_AUTO_PROPAGATE
c0352a1 raw: introduce ERRP_AUTO_PROPAGATE
612aebf qed: introduce ERRP_AUTO_PROPAGATE
155f6ea parallels: introduce ERRP_AUTO_PROPAGATE
5d3c3fd blkverify: introduce ERRP_AUTO_PROPAGATE
36132e6 blklogwrites: introduce ERRP_AUTO_PROPAGATE
785cfb4 Quorum: introduce ERRP_AUTO_PROPAGATE
5acba63 Bootdevice: introduce ERRP_AUTO_PROPAGATE
0e0d3fb NVMe Block Driver: introduce ERRP_AUTO_PROPAGATE
1cf6911 GLUSTER: introduce ERRP_AUTO_PROPAGATE
cb4c8f7 CURL: introduce ERRP_AUTO_PROPAGATE
4e32493 SSH: introduce ERRP_AUTO_PROPAGATE
abbecd4 NFS: introduce ERRP_AUTO_PROPAGATE
f4f937d nbd: introduce ERRP_AUTO_PROPAGATE
7b638b3 iSCSI: introduce ERRP_AUTO_PROPAGATE
4727ffc VDI: introduce ERRP_AUTO_PROPAGATE
2c03145 VHDX: introduce ERRP_AUTO_PROPAGATE
7916a87 Sheepdog: introduce ERRP_AUTO_PROPAGATE
db15fdd RBD: introduce ERRP_AUTO_PROPAGATE
05ea2cf VMDK: introduce ERRP_AUTO_PROPAGATE
ff11144 Record/replay: introduce ERRP_AUTO_PROPAGATE
a95fab2 colo: introduce ERRP_AUTO_PROPAGATE
be71202 Sockets: introduce ERRP_AUTO_PROPAGATE
69a59b0 I/O Channels: introduce ERRP_AUTO_PROPAGATE
e4f56f3 Cryptography: introduce ERRP_AUTO_PROPAGATE
4f5f412 Migration: introduce ERRP_AUTO_PROPAGATE
985da1a TPM: introduce ERRP_AUTO_PROPAGATE
b19cdab Tracing: introduce ERRP_AUTO_PROPAGATE
3113fc7 SLIRP: introduce ERRP_AUTO_PROPAGATE
51e2f48 QMP: introduce ERRP_AUTO_PROPAGATE
1c0c827 QOM: introduce ERRP_AUTO_PROPAGATE
fc0eec4 qga: introduce ERRP_AUTO_PROPAGATE
af16041 QAPI: introduce ERRP_AUTO_PROPAGATE
21ed21e cryptodev: introduce ERRP_AUTO_PROPAGATE
7ab6e12 hostmem: introduce ERRP_AUTO_PROPAGATE
994c02c net: introduce ERRP_AUTO_PROPAGATE
26fe9a4 Human Monitor (HMP): introduce ERRP_AUTO_PROPAGATE
82b7f8b Main loop: introduce ERRP_AUTO_PROPAGATE
863100d Graphics: introduce ERRP_AUTO_PROPAGATE
45a8d41 SPICE: introduce ERRP_AUTO_PROPAGATE
6d967ec Memory API: introduce ERRP_AUTO_PROPAGATE
5645325 Dump: introduce ERRP_AUTO_PROPAGATE
6d795b4 cmdline: introduce ERRP_AUTO_PROPAGATE
5fceaa3 chardev: introduce ERRP_AUTO_PROPAGATE
d551bda scsi: introduce ERRP_AUTO_PROPAGATE
cc3d83e block: introduce ERRP_AUTO_PROPAGATE
75b948b Audio: introduce ERRP_AUTO_PROPAGATE
c3fee2f XIVE: introduce ERRP_AUTO_PROPAGATE
42ba3e1 fw_cfg: introduce ERRP_AUTO_PROPAGATE
90c4efa virtio-gpu: introduce ERRP_AUTO_PROPAGATE
4db3f47 eepro100: introduce ERRP_AUTO_PROPAGATE
d7634f4 NVDIMM: introduce ERRP_AUTO_PROPAGATE
706ee21 megasas: introduce ERRP_AUTO_PROPAGATE
a037a5c virtio-rng: introduce ERRP_AUTO_PROPAGATE
dcf1769 virtio-serial: introduce ERRP_AUTO_PROPAGATE
77d26d1 virtio-input: introduce ERRP_AUTO_PROPAGATE
7f62cb1 virtio-ccw: introduce ERRP_AUTO_PROPAGATE
2bdd860 virtio-blk: introduce ERRP_AUTO_PROPAGATE
026260e virtio-9p: introduce ERRP_AUTO_PROPAGATE
191c845 virtio: introduce ERRP_AUTO_PROPAGATE
24510de vhost: introduce ERRP_AUTO_PROPAGATE
e8a1779 vfio-ccw: introduce ERRP_AUTO_PROPAGATE
00baaa3 VFIO: introduce ERRP_AUTO_PROPAGATE
361c201 USB (serial adapter): introduce ERRP_AUTO_PROPAGATE 0f70e97 USB: introduce ERRP_AUTO_PROPAGATE
9548378 SD (Secure Card): introduce ERRP_AUTO_PROPAGATE
90b472d SCSI: introduce ERRP_AUTO_PROPAGATE
312220a pflash: introduce ERRP_AUTO_PROPAGATE
47a7bb5 Network devices: introduce ERRP_AUTO_PROPAGATE
bf2e1ef ACPI/SMBIOS: introduce ERRP_AUTO_PROPAGATE
98f6d04 PCI: introduce ERRP_AUTO_PROPAGATE
e3e14fe IPack: introduce ERRP_AUTO_PROPAGATE
9ef097c Floppy: introduce ERRP_AUTO_PROPAGATE
4ffbc39 IDE: introduce ERRP_AUTO_PROPAGATE
a91553f X86 Machines: introduce ERRP_AUTO_PROPAGATE
a83188d S390 Machines: introduce ERRP_AUTO_PROPAGATE
8cbe8c9 SPARC Machines: introduce ERRP_AUTO_PROPAGATE
a36009a PowerPC Machines: introduce ERRP_AUTO_PROPAGATE
f82c520 MIPS Machines: introduce ERRP_AUTO_PROPAGATE
7033c7f ARM Machines: introduce ERRP_AUTO_PROPAGATE
13406bd Hosts: introduce ERRP_AUTO_PROPAGATE
6923a91 xen: introduce ERRP_AUTO_PROPAGATE
0170e9e kvm: introduce ERRP_AUTO_PROPAGATE
7c4b0d9 tcg: introduce ERRP_AUTO_PROPAGATE
5cb4ba6 s390x: introduce ERRP_AUTO_PROPAGATE
53edd88 misc: introduce ERRP_AUTO_PROPAGATE
a296770 python: add commit-per-subsystem.py
feedc38 scripts: add coccinelle script to use auto propagated errp e712d0e error: auto propagated local_err
64b786f hw/vfio/ap: drop local_err from vfio_ap_realize
54ef2b0 backends/cryptodev: drop local_err from cryptodev_backend_complete() c605b8b qapi/error: add (Error **errp) cleaning APIs
be9f380 include/qom/object.h: rename Error ** parameter to more common errp 948a5a3 include/block/snapshot.h: rename Error ** parameter to more common errp cda337b hw/usb: rename Error ** parameter to more common errp 1d22fd7 hw/tpm: rename Error ** parameter to more common errp 4023b59 hw/sd: rename Error ** parameter to more common errp c258678 hw/s390x: rename Error ** parameter to more common errp 07539ce monitor/qmp-cmds: rename Error ** parameter to more common errp a26c917 qga: rename Error ** parameter to more common errp
05cef6b hw/i386/amd_iommu: rename Error ** parameter to more common errp 398c2e9 block/snapshot: rename Error ** parameter to more common errp 4df0735 hw/core/qdev: cleanup Error ** variables
a97739a 9pfs: well form error hint helpers
f621e2a ppc: well form kvmppc_hint_smt_possible error hint helper cc9b38a nbd: well form nbd_iter_channel_error errp handler
9f18f68 qdev-monitor: well form error hint helpers
6c96ebe vnc: drop Error pointer indirection in vnc_client_io_error 8dac505 hmp: drop Error pointer indirection in hmp_handle_error ea1f06c error: rename errp to errp_in where it is IN-argument eb0e528 net/net: Clean up variable shadowing in net_client_init() 16c9d22 hw/core/loader-fit: fix freeing errp in fit_load_fdt

=== OUTPUT BEGIN ===
1/126 Checking commit 16c9d22dbdf8 (hw/core/loader-fit: fix freeing errp in fit_load_fdt) 2/126 Checking commit eb0e5289fbd9 (net/net: Clean up variable shadowing in net_client_init()) 3/126 Checking commit ea1f06c5177f (error: rename errp to errp_in where it is IN-argument) 4/126 Checking commit 8dac50575fb7 (hmp: drop Error pointer indirection in hmp_handle_error) 5/126 Checking commit 6c96ebe7980d (vnc: drop Error pointer indirection in vnc_client_io_error) 6/126 Checking commit 9f18f68053d6 (qdev-monitor: well form error hint helpers)
7/126 Checking commit cc9b38ae2be7 (nbd: well form nbd_iter_channel_error errp handler) 8/126 Checking commit f621e2a212e4 (ppc: well form kvmppc_hint_smt_possible error hint helper) 9/126 Checking commit a97739a33dbf (9pfs: well form error hint helpers)
10/126 Checking commit 4df0735d30e8 (hw/core/qdev: cleanup Error ** variables)
11/126 Checking commit 398c2e9b6b6d (block/snapshot: rename Error ** parameter to more common errp) 12/126 Checking commit 05cef6ba60f4 (hw/i386/amd_iommu: rename Error ** parameter to more common errp) 13/126 Checking commit a26c9171c17b (qga: rename Error ** parameter to more common errp) 14/126 Checking commit 07539ce2d362 (monitor/qmp-cmds: rename Error ** parameter to more common errp) 15/126 Checking commit c258678c3b76 (hw/s390x: rename Error ** parameter to more common errp) 16/126 Checking commit 4023b59092f7 (hw/sd: rename Error ** parameter to more common errp) 17/126 Checking commit 1d22fd7fc323 (hw/tpm: rename Error ** parameter to more common errp) 18/126 Checking commit cda337b28d54 (hw/usb: rename Error ** parameter to more common errp) 19/126 Checking commit 948a5a31d4b1 (include/block/snapshot.h: rename Error ** parameter to more common errp) 20/126 Checking commit be9f38026447 (include/qom/object.h: rename Error ** parameter to more common errp) 21/126 Checking commit c605b8ba94ea (qapi/error: add (Error **errp) cleaning APIs)
22/126 Checking commit 54ef2b0ab6ea (backends/cryptodev: drop local_err from cryptodev_backend_complete()) 23/126 Checking commit 64b786fd77cb (hw/vfio/ap: drop local_err from vfio_ap_realize) 24/126 Checking commit e712d0e3ad3b (error: auto propagated local_err)
ERROR: Macros with multiple statements should be enclosed in a do - while loop
#79: FILE: include/qapi/error.h:381:

+#define ERRP_AUTO_PROPAGATE()                                  \
+    g_auto(ErrorPropagator) _auto_errp_prop = {.errp = errp};  \
+    errp = ((errp == NULL || *errp == error_fatal)             \

+ ? &_auto_errp_prop.local_err : errp)

total: 1 errors, 0 warnings, 44 lines checked

Patch 24/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

25/126 Checking commit feedc38f888e (scripts: add coccinelle script to use auto propagated errp)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#11:
new file mode 100644

total: 0 errors, 1 warnings, 118 lines checked

Patch 25/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
26/126 Checking commit a296770e4ed0 (python: add commit-per-subsystem.py)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #13:
new file mode 100755

ERROR: line over 90 characters
#51: FILE: python/commit-per-subsystem.py:34:
+ ret = subprocess.check_output(['git', 'diff', '--name-only'], encoding='utf-8').split('\n')

WARNING: line over 80 characters
#102: FILE: python/commit-per-subsystem.py:85:
+ path, mapper[path][0], subsystem, mapper_name, glob_count,

ERROR: line over 90 characters
#142: FILE: python/commit-per-subsystem.py:125:
+ print('Warning: nothing corresponds to "{}"'.format(fname))

ERROR: line over 90 characters
#148: FILE: python/commit-per-subsystem.py:131:
+ self.add(subsystem, f, self.map_glob_file, 'glob-file', n)

ERROR: line over 90 characters
#151: FILE: python/commit-per-subsystem.py:134:
+ self.add(subsystem, f, self.map_glob_dir, 'glob-dir', n)

total: 4 errors, 2 warnings, 204 lines checked

Patch 26/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

27/126 Checking commit 53edd882e0a2 (misc: introduce ERRP_AUTO_PROPAGATE) 28/126 Checking commit 5cb4ba6dc988 (s390x: introduce ERRP_AUTO_PROPAGATE) 29/126 Checking commit 7c4b0d9d6196 (tcg: introduce ERRP_AUTO_PROPAGATE)
ERROR: suspect code indent for conditional statements (4, 4) #1360: FILE: target/i386/cpu.c:5405:

+    if (*errp) {
     }

total: 1 errors, 0 warnings, 1656 lines checked

Patch 29/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

30/126 Checking commit 0170e9e55113 (kvm: introduce ERRP_AUTO_PROPAGATE) 31/126 Checking commit 6923a91b51e4 (xen: introduce ERRP_AUTO_PROPAGATE) 32/126 Checking commit 13406bd38518 (Hosts: introduce ERRP_AUTO_PROPAGATE) 33/126 Checking commit 7033c7f6dbb2 (ARM Machines: introduce ERRP_AUTO_PROPAGATE) 34/126 Checking commit f82c520e220f (MIPS Machines: introduce ERRP_AUTO_PROPAGATE) 35/126 Checking commit a36009a9841f (PowerPC Machines: introduce ERRP_AUTO_PROPAGATE)
ERROR: suspect code indent for conditional statements (8, 8)
#2325: FILE: hw/ppc/spapr_pci.c:1615:

+        if (*errp) {
         }

total: 1 errors, 0 warnings, 2188 lines checked

Patch 35/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

36/126 Checking commit 8cbe8c93d975 (SPARC Machines: introduce ERRP_AUTO_PROPAGATE) 37/126 Checking commit a83188dacb99 (S390 Machines: introduce ERRP_AUTO_PROPAGATE) 38/126 Checking commit a91553fe4d04 (X86 Machines: introduce ERRP_AUTO_PROPAGATE) 39/126 Checking commit 4ffbc39501c4 (IDE: introduce ERRP_AUTO_PROPAGATE) 40/126 Checking commit 9ef097c08fd8 (Floppy: introduce ERRP_AUTO_PROPAGATE) 41/126 Checking commit e3e14fe9d883 (IPack: introduce ERRP_AUTO_PROPAGATE) 42/126 Checking commit 98f6d04bd17f (PCI: introduce ERRP_AUTO_PROPAGATE) 43/126 Checking commit bf2e1efbbb02 (ACPI/SMBIOS: introduce ERRP_AUTO_PROPAGATE) 44/126 Checking commit 47a7bb584c29 (Network devices: introduce ERRP_AUTO_PROPAGATE) 45/126 Checking commit 312220a1ddc8 (pflash: introduce ERRP_AUTO_PROPAGATE) 46/126 Checking commit 90b472de5a1d (SCSI: introduce ERRP_AUTO_PROPAGATE) 47/126 Checking commit 954837843356 (SD (Secure Card): introduce ERRP_AUTO_PROPAGATE) 48/126 Checking commit 0f70e97614d7 (USB: introduce ERRP_AUTO_PROPAGATE) 49/126 Checking commit 361c2015322c (USB (serial adapter): introduce ERRP_AUTO_PROPAGATE) 50/126 Checking commit 00baaa39204f (VFIO: introduce ERRP_AUTO_PROPAGATE) 51/126 Checking commit e8a177945afc (vfio-ccw: introduce ERRP_AUTO_PROPAGATE) 52/126 Checking commit 24510de2e8fc (vhost: introduce ERRP_AUTO_PROPAGATE) 53/126 Checking commit 191c845b48f3 (virtio: introduce ERRP_AUTO_PROPAGATE) 54/126 Checking commit 026260ea0442 (virtio-9p: introduce ERRP_AUTO_PROPAGATE) 55/126 Checking commit 2bdd8607add4 (virtio-blk: introduce ERRP_AUTO_PROPAGATE) 56/126 Checking commit 7f62cb15ac25 (virtio-ccw: introduce ERRP_AUTO_PROPAGATE) 57/126 Checking commit 77d26d1cfd2e (virtio-input: introduce ERRP_AUTO_PROPAGATE) 58/126 Checking commit dcf176995f8c (virtio-serial: introduce ERRP_AUTO_PROPAGATE) 59/126 Checking commit a037a5c408d5 (virtio-rng: introduce ERRP_AUTO_PROPAGATE) 60/126 Checking commit 706ee2136358 (megasas: introduce ERRP_AUTO_PROPAGATE) 61/126 Checking commit d7634f485cf3 (NVDIMM: introduce ERRP_AUTO_PROPAGATE) 62/126 Checking commit 4db3f478d427 (eepro100: introduce ERRP_AUTO_PROPAGATE) 63/126 Checking commit 90c4efaa36e0 (virtio-gpu: introduce ERRP_AUTO_PROPAGATE) 64/126 Checking commit 42ba3e1dd85c (fw_cfg: introduce ERRP_AUTO_PROPAGATE) 65/126 Checking commit c3fee2fc02f1 (XIVE: introduce ERRP_AUTO_PROPAGATE) 66/126 Checking commit 75b948b28b28 (Audio: introduce ERRP_AUTO_PROPAGATE) 67/126 Checking commit cc3d83e31b4e (block: introduce ERRP_AUTO_PROPAGATE)
ERROR: suspect code indent for conditional statements (8, 8)
#126: FILE: block.c:1298:

+        if (*errp) {
         } else if (bs->filename[0]) {

ERROR: suspect code indent for conditional statements (12, 12) #556: FILE: block.c:3784:

+            if (*errp) {
             } else {

ERROR: Error messages should not contain newlines
#735: FILE: block.c:5791:
+ "This may become an error in future versions.\n");

total: 3 errors, 0 warnings, 2006 lines checked

Patch 67/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

68/126 Checking commit d551bdac29ec (scsi: introduce ERRP_AUTO_PROPAGATE) 69/126 Checking commit 5fceaa34a239 (chardev: introduce ERRP_AUTO_PROPAGATE) 70/126 Checking commit 6d795b43413c (cmdline: introduce ERRP_AUTO_PROPAGATE) 71/126 Checking commit 56453257b1ac (Dump: introduce ERRP_AUTO_PROPAGATE) 72/126 Checking commit 6d967ec1fdf9 (Memory API: introduce ERRP_AUTO_PROPAGATE) 73/126 Checking commit 45a8d41d3e5f (SPICE: introduce ERRP_AUTO_PROPAGATE) 74/126 Checking commit 863100d31565 (Graphics: introduce ERRP_AUTO_PROPAGATE) 75/126 Checking commit 82b7f8bf101d (Main loop: introduce ERRP_AUTO_PROPAGATE) 76/126 Checking commit 26fe9a48828c (Human Monitor (HMP): introduce ERRP_AUTO_PROPAGATE) 77/126 Checking commit 994c02c4e44c (net: introduce ERRP_AUTO_PROPAGATE) 78/126 Checking commit 7ab6e12b144c (hostmem: introduce ERRP_AUTO_PROPAGATE) 79/126 Checking commit 21ed21e21d02 (cryptodev: introduce ERRP_AUTO_PROPAGATE) 80/126 Checking commit af1604131cde (QAPI: introduce ERRP_AUTO_PROPAGATE)
ERROR: suspect code indent for conditional statements (4, 4)
#131: FILE: qapi/qapi-visit-core.c:156:

+    if (*errp) {
     } else if (value > max) {

ERROR: suspect code indent for conditional statements (4, 4) #147: FILE: qapi/qapi-visit-core.c:214:

+    if (*errp) {
     } else if (value < min || value > max) {

ERROR: suspect code indent for conditional statements (4, 4) #232: FILE: qapi/qmp-dispatch.c:133:

+    if (*errp) {
     } else if (cmd->options & QCO_NO_SUCCESS_RESP) {

total: 3 errors, 0 warnings, 182 lines checked

Patch 80/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

81/126 Checking commit fc0eec4158dc (qga: introduce ERRP_AUTO_PROPAGATE)
ERROR: suspect code indent for conditional statements (4, 4) #378: FILE: qga/commands-posix.c:1587:

+    if (*errp) {
     } else {

ERROR: suspect code indent for conditional statements (4, 4) #407: FILE: qga/commands-posix.c:1613:

+    if (*errp) {
     } else {

ERROR: suspect code indent for conditional statements (4, 4) #438: FILE: qga/commands-posix.c:1643:

+    if (*errp) {
     } else {

total: 3 errors, 0 warnings, 669 lines checked

Patch 81/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

82/126 Checking commit 1c0c827d5ca3 (QOM: introduce ERRP_AUTO_PROPAGATE)
ERROR: suspect code indent for conditional statements (8, 8) #277: FILE: hw/core/qdev-properties.c:671:

+        if (*errp) {
         } else if (value < -1 || value > 255) {

total: 1 errors, 0 warnings, 1298 lines checked

Patch 82/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

83/126 Checking commit 51e2f4872c1a (QMP: introduce ERRP_AUTO_PROPAGATE)
84/126 Checking commit 3113fc7bf720 (SLIRP: introduce ERRP_AUTO_PROPAGATE) 85/126 Checking commit b19cdab11e6c (Tracing: introduce ERRP_AUTO_PROPAGATE) 86/126 Checking commit 985da1a54aa6 (TPM: introduce ERRP_AUTO_PROPAGATE)
87/126 Checking commit 4f5f412b75c4 (Migration: introduce ERRP_AUTO_PROPAGATE) 88/126 Checking commit e4f56f3b8dae (Cryptography: introduce ERRP_AUTO_PROPAGATE) 89/126 Checking commit 69a59b07492d (I/O Channels: introduce ERRP_AUTO_PROPAGATE) 90/126 Checking commit be712020a7c1 (Sockets: introduce ERRP_AUTO_PROPAGATE) 91/126 Checking commit a95fab2ba9c0 (colo: introduce ERRP_AUTO_PROPAGATE)
92/126 Checking commit ff11144b4d5e (Record/replay: introduce ERRP_AUTO_PROPAGATE) 93/126 Checking commit 05ea2cfe6a49 (VMDK: introduce ERRP_AUTO_PROPAGATE)
94/126 Checking commit db15fdd137ca (RBD: introduce ERRP_AUTO_PROPAGATE)
95/126 Checking commit 7916a87501ff (Sheepdog: introduce ERRP_AUTO_PROPAGATE) 96/126 Checking commit 2c03145f174d (VHDX: introduce ERRP_AUTO_PROPAGATE)
97/126 Checking commit 4727ffc9e2b1 (VDI: introduce ERRP_AUTO_PROPAGATE)
98/126 Checking commit 7b638b375230 (iSCSI: introduce ERRP_AUTO_PROPAGATE) 99/126 Checking commit f4f937dedc90 (nbd: introduce ERRP_AUTO_PROPAGATE)
100/126 Checking commit abbecd4c8ca1 (NFS: introduce ERRP_AUTO_PROPAGATE) 101/126 Checking commit 4e324932309d (SSH: introduce ERRP_AUTO_PROPAGATE) 102/126 Checking commit cb4c8f74b637 (CURL: introduce ERRP_AUTO_PROPAGATE) 103/126 Checking commit 1cf6911a3113 (GLUSTER: introduce ERRP_AUTO_PROPAGATE) 104/126 Checking commit 0e0d3fbc80a8 (NVMe Block Driver: introduce ERRP_AUTO_PROPAGATE) 105/126 Checking commit 5acba634d3f2 (Bootdevice: introduce ERRP_AUTO_PROPAGATE) 106/126 Checking commit 785cfb4bfd6e (Quorum: introduce ERRP_AUTO_PROPAGATE) 107/126 Checking commit 36132e6d953e (blklogwrites: introduce ERRP_AUTO_PROPAGATE) 108/126 Checking commit 5d3c3fde30a1 (blkverify: introduce ERRP_AUTO_PROPAGATE) 109/126 Checking commit 155f6ea5fe1b (parallels: introduce ERRP_AUTO_PROPAGATE) 110/126 Checking commit 612aebf400b0 (qed: introduce ERRP_AUTO_PROPAGATE) 111/126 Checking commit c0352a192b8f (raw: introduce ERRP_AUTO_PROPAGATE) 112/126 Checking commit 1b7546c66586 (qcow2: introduce ERRP_AUTO_PROPAGATE) 113/126 Checking commit 39d367e15ae7 (qcow: introduce ERRP_AUTO_PROPAGATE) 114/126 Checking commit e7fb0b9d3ec5 (blkdebug: introduce ERRP_AUTO_PROPAGATE) 115/126 Checking commit 2da58d6731e0 (vpc: introduce ERRP_AUTO_PROPAGATE) 116/126 Checking commit 225bbc51c347 (vvfat: introduce ERRP_AUTO_PROPAGATE) 117/126 Checking commit 84365ab2dc2d (Replication: introduce ERRP_AUTO_PROPAGATE) 118/126 Checking commit 21ee5f83d833 (PVRDMA: introduce ERRP_AUTO_PROPAGATE) 119/126 Checking commit dd3f3104f838 (hw/core/bus.c: introduce ERRP_AUTO_PROPAGATE) 120/126 Checking commit b5b1e0a54e36 (hw/cpu/core.c: introduce ERRP_AUTO_PROPAGATE) 121/126 Checking commit 1534a928d277 (hw/sd/ssi-sd.c: introduce ERRP_AUTO_PROPAGATE) 122/126 Checking commit 8969c6fe5523 (iothread.c: introduce ERRP_AUTO_PROPAGATE) 123/126 Checking commit 5f766d764fb0 (memory_mapping.c: introduce ERRP_AUTO_PROPAGATE) 124/126 Checking commit 2e4f3717dda3 (target/tilegx/cpu.c: introduce ERRP_AUTO_PROPAGATE) 125/126 Checking commit 3ee65677767a (tests/test-image-locking.c: introduce ERRP_AUTO_PROPAGATE) 126/126 Checking commit 319b2061bfba (util/qemu-config.c: introduce ERRP_AUTO_PROPAGATE) === OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

#202 lore raw
Quoted 168 lines · 12.10.2019 5:52, [email protected] wrote:

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Subject: [RFC v5 000/126] error: auto propagated local_err
Type: series
Message-id: [email protected]

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Switched to a new branch 'test'
319b206 util/qemu-config.c: introduce ERRP_AUTO_PROPAGATE
3ee6567 tests/test-image-locking.c: introduce ERRP_AUTO_PROPAGATE 2e4f371 target/tilegx/cpu.c: introduce ERRP_AUTO_PROPAGATE
5f766d7 memory_mapping.c: introduce ERRP_AUTO_PROPAGATE
8969c6f iothread.c: introduce ERRP_AUTO_PROPAGATE
1534a92 hw/sd/ssi-sd.c: introduce ERRP_AUTO_PROPAGATE
b5b1e0a hw/cpu/core.c: introduce ERRP_AUTO_PROPAGATE
dd3f310 hw/core/bus.c: introduce ERRP_AUTO_PROPAGATE
21ee5f8 PVRDMA: introduce ERRP_AUTO_PROPAGATE
84365ab Replication: introduce ERRP_AUTO_PROPAGATE
225bbc5 vvfat: introduce ERRP_AUTO_PROPAGATE
2da58d6 vpc: introduce ERRP_AUTO_PROPAGATE
e7fb0b9 blkdebug: introduce ERRP_AUTO_PROPAGATE
39d367e qcow: introduce ERRP_AUTO_PROPAGATE
1b7546c qcow2: introduce ERRP_AUTO_PROPAGATE
c0352a1 raw: introduce ERRP_AUTO_PROPAGATE
612aebf qed: introduce ERRP_AUTO_PROPAGATE
155f6ea parallels: introduce ERRP_AUTO_PROPAGATE
5d3c3fd blkverify: introduce ERRP_AUTO_PROPAGATE
36132e6 blklogwrites: introduce ERRP_AUTO_PROPAGATE
785cfb4 Quorum: introduce ERRP_AUTO_PROPAGATE
5acba63 Bootdevice: introduce ERRP_AUTO_PROPAGATE
0e0d3fb NVMe Block Driver: introduce ERRP_AUTO_PROPAGATE
1cf6911 GLUSTER: introduce ERRP_AUTO_PROPAGATE
cb4c8f7 CURL: introduce ERRP_AUTO_PROPAGATE
4e32493 SSH: introduce ERRP_AUTO_PROPAGATE
abbecd4 NFS: introduce ERRP_AUTO_PROPAGATE
f4f937d nbd: introduce ERRP_AUTO_PROPAGATE
7b638b3 iSCSI: introduce ERRP_AUTO_PROPAGATE
4727ffc VDI: introduce ERRP_AUTO_PROPAGATE
2c03145 VHDX: introduce ERRP_AUTO_PROPAGATE
7916a87 Sheepdog: introduce ERRP_AUTO_PROPAGATE
db15fdd RBD: introduce ERRP_AUTO_PROPAGATE
05ea2cf VMDK: introduce ERRP_AUTO_PROPAGATE
ff11144 Record/replay: introduce ERRP_AUTO_PROPAGATE
a95fab2 colo: introduce ERRP_AUTO_PROPAGATE
be71202 Sockets: introduce ERRP_AUTO_PROPAGATE
69a59b0 I/O Channels: introduce ERRP_AUTO_PROPAGATE
e4f56f3 Cryptography: introduce ERRP_AUTO_PROPAGATE
4f5f412 Migration: introduce ERRP_AUTO_PROPAGATE
985da1a TPM: introduce ERRP_AUTO_PROPAGATE
b19cdab Tracing: introduce ERRP_AUTO_PROPAGATE
3113fc7 SLIRP: introduce ERRP_AUTO_PROPAGATE
51e2f48 QMP: introduce ERRP_AUTO_PROPAGATE
1c0c827 QOM: introduce ERRP_AUTO_PROPAGATE
fc0eec4 qga: introduce ERRP_AUTO_PROPAGATE
af16041 QAPI: introduce ERRP_AUTO_PROPAGATE
21ed21e cryptodev: introduce ERRP_AUTO_PROPAGATE
7ab6e12 hostmem: introduce ERRP_AUTO_PROPAGATE
994c02c net: introduce ERRP_AUTO_PROPAGATE
26fe9a4 Human Monitor (HMP): introduce ERRP_AUTO_PROPAGATE
82b7f8b Main loop: introduce ERRP_AUTO_PROPAGATE
863100d Graphics: introduce ERRP_AUTO_PROPAGATE
45a8d41 SPICE: introduce ERRP_AUTO_PROPAGATE
6d967ec Memory API: introduce ERRP_AUTO_PROPAGATE
5645325 Dump: introduce ERRP_AUTO_PROPAGATE
6d795b4 cmdline: introduce ERRP_AUTO_PROPAGATE
5fceaa3 chardev: introduce ERRP_AUTO_PROPAGATE
d551bda scsi: introduce ERRP_AUTO_PROPAGATE
cc3d83e block: introduce ERRP_AUTO_PROPAGATE
75b948b Audio: introduce ERRP_AUTO_PROPAGATE
c3fee2f XIVE: introduce ERRP_AUTO_PROPAGATE
42ba3e1 fw_cfg: introduce ERRP_AUTO_PROPAGATE
90c4efa virtio-gpu: introduce ERRP_AUTO_PROPAGATE
4db3f47 eepro100: introduce ERRP_AUTO_PROPAGATE
d7634f4 NVDIMM: introduce ERRP_AUTO_PROPAGATE
706ee21 megasas: introduce ERRP_AUTO_PROPAGATE
a037a5c virtio-rng: introduce ERRP_AUTO_PROPAGATE
dcf1769 virtio-serial: introduce ERRP_AUTO_PROPAGATE
77d26d1 virtio-input: introduce ERRP_AUTO_PROPAGATE
7f62cb1 virtio-ccw: introduce ERRP_AUTO_PROPAGATE
2bdd860 virtio-blk: introduce ERRP_AUTO_PROPAGATE
026260e virtio-9p: introduce ERRP_AUTO_PROPAGATE
191c845 virtio: introduce ERRP_AUTO_PROPAGATE
24510de vhost: introduce ERRP_AUTO_PROPAGATE
e8a1779 vfio-ccw: introduce ERRP_AUTO_PROPAGATE
00baaa3 VFIO: introduce ERRP_AUTO_PROPAGATE
361c201 USB (serial adapter): introduce ERRP_AUTO_PROPAGATE 0f70e97 USB: introduce ERRP_AUTO_PROPAGATE
9548378 SD (Secure Card): introduce ERRP_AUTO_PROPAGATE
90b472d SCSI: introduce ERRP_AUTO_PROPAGATE
312220a pflash: introduce ERRP_AUTO_PROPAGATE
47a7bb5 Network devices: introduce ERRP_AUTO_PROPAGATE
bf2e1ef ACPI/SMBIOS: introduce ERRP_AUTO_PROPAGATE
98f6d04 PCI: introduce ERRP_AUTO_PROPAGATE
e3e14fe IPack: introduce ERRP_AUTO_PROPAGATE
9ef097c Floppy: introduce ERRP_AUTO_PROPAGATE
4ffbc39 IDE: introduce ERRP_AUTO_PROPAGATE
a91553f X86 Machines: introduce ERRP_AUTO_PROPAGATE
a83188d S390 Machines: introduce ERRP_AUTO_PROPAGATE
8cbe8c9 SPARC Machines: introduce ERRP_AUTO_PROPAGATE
a36009a PowerPC Machines: introduce ERRP_AUTO_PROPAGATE
f82c520 MIPS Machines: introduce ERRP_AUTO_PROPAGATE
7033c7f ARM Machines: introduce ERRP_AUTO_PROPAGATE
13406bd Hosts: introduce ERRP_AUTO_PROPAGATE
6923a91 xen: introduce ERRP_AUTO_PROPAGATE
0170e9e kvm: introduce ERRP_AUTO_PROPAGATE
7c4b0d9 tcg: introduce ERRP_AUTO_PROPAGATE
5cb4ba6 s390x: introduce ERRP_AUTO_PROPAGATE
53edd88 misc: introduce ERRP_AUTO_PROPAGATE
a296770 python: add commit-per-subsystem.py
feedc38 scripts: add coccinelle script to use auto propagated errp e712d0e error: auto propagated local_err
64b786f hw/vfio/ap: drop local_err from vfio_ap_realize
54ef2b0 backends/cryptodev: drop local_err from cryptodev_backend_complete() c605b8b qapi/error: add (Error **errp) cleaning APIs
be9f380 include/qom/object.h: rename Error ** parameter to more common errp 948a5a3 include/block/snapshot.h: rename Error ** parameter to more common errp cda337b hw/usb: rename Error ** parameter to more common errp 1d22fd7 hw/tpm: rename Error ** parameter to more common errp 4023b59 hw/sd: rename Error ** parameter to more common errp c258678 hw/s390x: rename Error ** parameter to more common errp 07539ce monitor/qmp-cmds: rename Error ** parameter to more common errp a26c917 qga: rename Error ** parameter to more common errp
05cef6b hw/i386/amd_iommu: rename Error ** parameter to more common errp 398c2e9 block/snapshot: rename Error ** parameter to more common errp 4df0735 hw/core/qdev: cleanup Error ** variables
a97739a 9pfs: well form error hint helpers
f621e2a ppc: well form kvmppc_hint_smt_possible error hint helper cc9b38a nbd: well form nbd_iter_channel_error errp handler
9f18f68 qdev-monitor: well form error hint helpers
6c96ebe vnc: drop Error pointer indirection in vnc_client_io_error 8dac505 hmp: drop Error pointer indirection in hmp_handle_error ea1f06c error: rename errp to errp_in where it is IN-argument eb0e528 net/net: Clean up variable shadowing in net_client_init() 16c9d22 hw/core/loader-fit: fix freeing errp in fit_load_fdt

=== OUTPUT BEGIN ===
1/126 Checking commit 16c9d22dbdf8 (hw/core/loader-fit: fix freeing errp in fit_load_fdt) 2/126 Checking commit eb0e5289fbd9 (net/net: Clean up variable shadowing in net_client_init()) 3/126 Checking commit ea1f06c5177f (error: rename errp to errp_in where it is IN-argument) 4/126 Checking commit 8dac50575fb7 (hmp: drop Error pointer indirection in hmp_handle_error) 5/126 Checking commit 6c96ebe7980d (vnc: drop Error pointer indirection in vnc_client_io_error) 6/126 Checking commit 9f18f68053d6 (qdev-monitor: well form error hint helpers)
7/126 Checking commit cc9b38ae2be7 (nbd: well form nbd_iter_channel_error errp handler) 8/126 Checking commit f621e2a212e4 (ppc: well form kvmppc_hint_smt_possible error hint helper) 9/126 Checking commit a97739a33dbf (9pfs: well form error hint helpers)
10/126 Checking commit 4df0735d30e8 (hw/core/qdev: cleanup Error ** variables)
11/126 Checking commit 398c2e9b6b6d (block/snapshot: rename Error ** parameter to more common errp) 12/126 Checking commit 05cef6ba60f4 (hw/i386/amd_iommu: rename Error ** parameter to more common errp) 13/126 Checking commit a26c9171c17b (qga: rename Error ** parameter to more common errp) 14/126 Checking commit 07539ce2d362 (monitor/qmp-cmds: rename Error ** parameter to more common errp) 15/126 Checking commit c258678c3b76 (hw/s390x: rename Error ** parameter to more common errp) 16/126 Checking commit 4023b59092f7 (hw/sd: rename Error ** parameter to more common errp) 17/126 Checking commit 1d22fd7fc323 (hw/tpm: rename Error ** parameter to more common errp)

Quoted 8 lines

18/126 Checking commit cda337b28d54 (hw/usb: rename Error ** parameter to more common errp) 19/126 Checking commit 948a5a31d4b1 (include/block/snapshot.h: rename Error ** parameter to more common errp) 20/126 Checking commit be9f38026447 (include/qom/object.h: rename Error ** parameter to more common errp) 21/126 Checking commit c605b8ba94ea (qapi/error: add (Error **errp) cleaning APIs)
22/126 Checking commit 54ef2b0ab6ea (backends/cryptodev: drop local_err from cryptodev_backend_complete()) 23/126 Checking commit 64b786fd77cb (hw/vfio/ap: drop local_err from vfio_ap_realize) 24/126 Checking commit e712d0e3ad3b (error: auto propagated local_err)
ERROR: Macros with multiple statements should be enclosed in a do - while loop

Sorry, but it worth it:)

Quoted 39 lines

#79: FILE: include/qapi/error.h:381:

(quoted diff) +4 -0
+#define ERRP_AUTO_PROPAGATE()                                  \
+    g_auto(ErrorPropagator) _auto_errp_prop = {.errp = errp};  \
+    errp = ((errp == NULL || *errp == error_fatal)             \
+            ? &_auto_errp_prop.local_err : errp)

total: 1 errors, 0 warnings, 44 lines checked

Patch 24/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

25/126 Checking commit feedc38f888e (scripts: add coccinelle script to use auto propagated errp)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#11:
new file mode 100644

total: 0 errors, 1 warnings, 118 lines checked

Patch 25/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.
26/126 Checking commit a296770e4ed0 (python: add commit-per-subsystem.py)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? #13:
new file mode 100755

ERROR: line over 90 characters
#51: FILE: python/commit-per-subsystem.py:34:
+ ret = subprocess.check_output(['git', 'diff', '--name-only'], encoding='utf-8').split('\n')

WARNING: line over 80 characters
#102: FILE: python/commit-per-subsystem.py:85:
+ path, mapper[path][0], subsystem, mapper_name, glob_count,

ERROR: line over 90 characters
#142: FILE: python/commit-per-subsystem.py:125:
+ print('Warning: nothing corresponds to "{}"'.format(fname))

Quoted 7 lines

ERROR: line over 90 characters
#148: FILE: python/commit-per-subsystem.py:131:
+ self.add(subsystem, f, self.map_glob_file, 'glob-file', n)

ERROR: line over 90 characters
#151: FILE: python/commit-per-subsystem.py:134:
+ self.add(subsystem, f, self.map_glob_dir, 'glob-dir', n)

I'll of course clean this all up.

Quoted 7 lines

total: 4 errors, 2 warnings, 204 lines checked

Patch 26/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Quoted 7 lines

27/126 Checking commit 53edd882e0a2 (misc: introduce ERRP_AUTO_PROPAGATE) 28/126 Checking commit 5cb4ba6dc988 (s390x: introduce ERRP_AUTO_PROPAGATE) 29/126 Checking commit 7c4b0d9d6196 (tcg: introduce ERRP_AUTO_PROPAGATE)
ERROR: suspect code indent for conditional statements (4, 4) #1360: FILE: target/i386/cpu.c:5405:

+    if (*errp) {
      }

Hmm. I'll try to drop such things with help of coccinelle.

Quoted 58 lines

total: 1 errors, 0 warnings, 1656 lines checked

Patch 29/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

30/126 Checking commit 0170e9e55113 (kvm: introduce ERRP_AUTO_PROPAGATE) 31/126 Checking commit 6923a91b51e4 (xen: introduce ERRP_AUTO_PROPAGATE) 32/126 Checking commit 13406bd38518 (Hosts: introduce ERRP_AUTO_PROPAGATE) 33/126 Checking commit 7033c7f6dbb2 (ARM Machines: introduce ERRP_AUTO_PROPAGATE) 34/126 Checking commit f82c520e220f (MIPS Machines: introduce ERRP_AUTO_PROPAGATE) 35/126 Checking commit a36009a9841f (PowerPC Machines: introduce ERRP_AUTO_PROPAGATE)
ERROR: suspect code indent for conditional statements (8, 8)
#2325: FILE: hw/ppc/spapr_pci.c:1615:

+        if (*errp) {
          }

total: 1 errors, 0 warnings, 2188 lines checked

Patch 35/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

36/126 Checking commit 8cbe8c93d975 (SPARC Machines: introduce ERRP_AUTO_PROPAGATE) 37/126 Checking commit a83188dacb99 (S390 Machines: introduce ERRP_AUTO_PROPAGATE) 38/126 Checking commit a91553fe4d04 (X86 Machines: introduce ERRP_AUTO_PROPAGATE) 39/126 Checking commit 4ffbc39501c4 (IDE: introduce ERRP_AUTO_PROPAGATE) 40/126 Checking commit 9ef097c08fd8 (Floppy: introduce ERRP_AUTO_PROPAGATE) 41/126 Checking commit e3e14fe9d883 (IPack: introduce ERRP_AUTO_PROPAGATE) 42/126 Checking commit 98f6d04bd17f (PCI: introduce ERRP_AUTO_PROPAGATE) 43/126 Checking commit bf2e1efbbb02 (ACPI/SMBIOS: introduce ERRP_AUTO_PROPAGATE) 44/126 Checking commit 47a7bb584c29 (Network devices: introduce ERRP_AUTO_PROPAGATE) 45/126 Checking commit 312220a1ddc8 (pflash: introduce ERRP_AUTO_PROPAGATE) 46/126 Checking commit 90b472de5a1d (SCSI: introduce ERRP_AUTO_PROPAGATE) 47/126 Checking commit 954837843356 (SD (Secure Card): introduce ERRP_AUTO_PROPAGATE) 48/126 Checking commit 0f70e97614d7 (USB: introduce ERRP_AUTO_PROPAGATE) 49/126 Checking commit 361c2015322c (USB (serial adapter): introduce ERRP_AUTO_PROPAGATE) 50/126 Checking commit 00baaa39204f (VFIO: introduce ERRP_AUTO_PROPAGATE) 51/126 Checking commit e8a177945afc (vfio-ccw: introduce ERRP_AUTO_PROPAGATE) 52/126 Checking commit 24510de2e8fc (vhost: introduce ERRP_AUTO_PROPAGATE) 53/126 Checking commit 191c845b48f3 (virtio: introduce ERRP_AUTO_PROPAGATE) 54/126 Checking commit 026260ea0442 (virtio-9p: introduce ERRP_AUTO_PROPAGATE) 55/126 Checking commit 2bdd8607add4 (virtio-blk: introduce ERRP_AUTO_PROPAGATE) 56/126 Checking commit 7f62cb15ac25 (virtio-ccw: introduce ERRP_AUTO_PROPAGATE) 57/126 Checking commit 77d26d1cfd2e (virtio-input: introduce ERRP_AUTO_PROPAGATE) 58/126 Checking commit dcf176995f8c (virtio-serial: introduce ERRP_AUTO_PROPAGATE) 59/126 Checking commit a037a5c408d5 (virtio-rng: introduce ERRP_AUTO_PROPAGATE) 60/126 Checking commit 706ee2136358 (megasas: introduce ERRP_AUTO_PROPAGATE) 61/126 Checking commit d7634f485cf3 (NVDIMM: introduce ERRP_AUTO_PROPAGATE) 62/126 Checking commit 4db3f478d427 (eepro100: introduce ERRP_AUTO_PROPAGATE) 63/126 Checking commit 90c4efaa36e0 (virtio-gpu: introduce ERRP_AUTO_PROPAGATE) 64/126 Checking commit 42ba3e1dd85c (fw_cfg: introduce ERRP_AUTO_PROPAGATE) 65/126 Checking commit c3fee2fc02f1 (XIVE: introduce ERRP_AUTO_PROPAGATE) 66/126 Checking commit 75b948b28b28 (Audio: introduce ERRP_AUTO_PROPAGATE) 67/126 Checking commit cc3d83e31b4e (block: introduce ERRP_AUTO_PROPAGATE)
ERROR: suspect code indent for conditional statements (8, 8)
#126: FILE: block.c:1298:

Quoted 7 lines
+        if (*errp) {
          } else if (bs->filename[0]) {

ERROR: suspect code indent for conditional statements (12, 12) #556: FILE: block.c:3784:

+            if (*errp) {
              } else {

Will try to update coccinelle for this.

Quoted 4 lines

ERROR: Error messages should not contain newlines
#735: FILE: block.c:5791:
+ "This may become an error in future versions.\n");

preexisting

Quoted 130 lines

total: 3 errors, 0 warnings, 2006 lines checked

Patch 67/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

68/126 Checking commit d551bdac29ec (scsi: introduce ERRP_AUTO_PROPAGATE) 69/126 Checking commit 5fceaa34a239 (chardev: introduce ERRP_AUTO_PROPAGATE) 70/126 Checking commit 6d795b43413c (cmdline: introduce ERRP_AUTO_PROPAGATE) 71/126 Checking commit 56453257b1ac (Dump: introduce ERRP_AUTO_PROPAGATE) 72/126 Checking commit 6d967ec1fdf9 (Memory API: introduce ERRP_AUTO_PROPAGATE) 73/126 Checking commit 45a8d41d3e5f (SPICE: introduce ERRP_AUTO_PROPAGATE) 74/126 Checking commit 863100d31565 (Graphics: introduce ERRP_AUTO_PROPAGATE) 75/126 Checking commit 82b7f8bf101d (Main loop: introduce ERRP_AUTO_PROPAGATE) 76/126 Checking commit 26fe9a48828c (Human Monitor (HMP): introduce ERRP_AUTO_PROPAGATE) 77/126 Checking commit 994c02c4e44c (net: introduce ERRP_AUTO_PROPAGATE) 78/126 Checking commit 7ab6e12b144c (hostmem: introduce ERRP_AUTO_PROPAGATE) 79/126 Checking commit 21ed21e21d02 (cryptodev: introduce ERRP_AUTO_PROPAGATE) 80/126 Checking commit af1604131cde (QAPI: introduce ERRP_AUTO_PROPAGATE)
ERROR: suspect code indent for conditional statements (4, 4)
#131: FILE: qapi/qapi-visit-core.c:156:

+    if (*errp) {
      } else if (value > max) {

ERROR: suspect code indent for conditional statements (4, 4) #147: FILE: qapi/qapi-visit-core.c:214:

+    if (*errp) {
      } else if (value < min || value > max) {

ERROR: suspect code indent for conditional statements (4, 4) #232: FILE: qapi/qmp-dispatch.c:133:

+    if (*errp) {
      } else if (cmd->options & QCO_NO_SUCCESS_RESP) {

total: 3 errors, 0 warnings, 182 lines checked

Patch 80/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

81/126 Checking commit fc0eec4158dc (qga: introduce ERRP_AUTO_PROPAGATE)
ERROR: suspect code indent for conditional statements (4, 4) #378: FILE: qga/commands-posix.c:1587:

+    if (*errp) {
      } else {

ERROR: suspect code indent for conditional statements (4, 4) #407: FILE: qga/commands-posix.c:1613:

+    if (*errp) {
      } else {

ERROR: suspect code indent for conditional statements (4, 4) #438: FILE: qga/commands-posix.c:1643:

+    if (*errp) {
      } else {

total: 3 errors, 0 warnings, 669 lines checked

Patch 81/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

82/126 Checking commit 1c0c827d5ca3 (QOM: introduce ERRP_AUTO_PROPAGATE)
ERROR: suspect code indent for conditional statements (8, 8) #277: FILE: hw/core/qdev-properties.c:671:

+        if (*errp) {
          } else if (value < -1 || value > 255) {

total: 1 errors, 0 warnings, 1298 lines checked

Patch 82/126 has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

83/126 Checking commit 51e2f4872c1a (QMP: introduce ERRP_AUTO_PROPAGATE)
84/126 Checking commit 3113fc7bf720 (SLIRP: introduce ERRP_AUTO_PROPAGATE) 85/126 Checking commit b19cdab11e6c (Tracing: introduce ERRP_AUTO_PROPAGATE) 86/126 Checking commit 985da1a54aa6 (TPM: introduce ERRP_AUTO_PROPAGATE)
87/126 Checking commit 4f5f412b75c4 (Migration: introduce ERRP_AUTO_PROPAGATE) 88/126 Checking commit e4f56f3b8dae (Cryptography: introduce ERRP_AUTO_PROPAGATE) 89/126 Checking commit 69a59b07492d (I/O Channels: introduce ERRP_AUTO_PROPAGATE) 90/126 Checking commit be712020a7c1 (Sockets: introduce ERRP_AUTO_PROPAGATE) 91/126 Checking commit a95fab2ba9c0 (colo: introduce ERRP_AUTO_PROPAGATE)
92/126 Checking commit ff11144b4d5e (Record/replay: introduce ERRP_AUTO_PROPAGATE) 93/126 Checking commit 05ea2cfe6a49 (VMDK: introduce ERRP_AUTO_PROPAGATE)
94/126 Checking commit db15fdd137ca (RBD: introduce ERRP_AUTO_PROPAGATE)
95/126 Checking commit 7916a87501ff (Sheepdog: introduce ERRP_AUTO_PROPAGATE) 96/126 Checking commit 2c03145f174d (VHDX: introduce ERRP_AUTO_PROPAGATE)
97/126 Checking commit 4727ffc9e2b1 (VDI: introduce ERRP_AUTO_PROPAGATE)
98/126 Checking commit 7b638b375230 (iSCSI: introduce ERRP_AUTO_PROPAGATE) 99/126 Checking commit f4f937dedc90 (nbd: introduce ERRP_AUTO_PROPAGATE)
100/126 Checking commit abbecd4c8ca1 (NFS: introduce ERRP_AUTO_PROPAGATE) 101/126 Checking commit 4e324932309d (SSH: introduce ERRP_AUTO_PROPAGATE) 102/126 Checking commit cb4c8f74b637 (CURL: introduce ERRP_AUTO_PROPAGATE) 103/126 Checking commit 1cf6911a3113 (GLUSTER: introduce ERRP_AUTO_PROPAGATE) 104/126 Checking commit 0e0d3fbc80a8 (NVMe Block Driver: introduce ERRP_AUTO_PROPAGATE) 105/126 Checking commit 5acba634d3f2 (Bootdevice: introduce ERRP_AUTO_PROPAGATE) 106/126 Checking commit 785cfb4bfd6e (Quorum: introduce ERRP_AUTO_PROPAGATE) 107/126 Checking commit 36132e6d953e (blklogwrites: introduce ERRP_AUTO_PROPAGATE) 108/126 Checking commit 5d3c3fde30a1 (blkverify: introduce ERRP_AUTO_PROPAGATE) 109/126 Checking commit 155f6ea5fe1b (parallels: introduce ERRP_AUTO_PROPAGATE) 110/126 Checking commit 612aebf400b0 (qed: introduce ERRP_AUTO_PROPAGATE) 111/126 Checking commit c0352a192b8f (raw: introduce ERRP_AUTO_PROPAGATE) 112/126 Checking commit 1b7546c66586 (qcow2: introduce ERRP_AUTO_PROPAGATE) 113/126 Checking commit 39d367e15ae7 (qcow: introduce ERRP_AUTO_PROPAGATE) 114/126 Checking commit e7fb0b9d3ec5 (blkdebug: introduce ERRP_AUTO_PROPAGATE) 115/126 Checking commit 2da58d6731e0 (vpc: introduce ERRP_AUTO_PROPAGATE) 116/126 Checking commit 225bbc51c347 (vvfat: introduce ERRP_AUTO_PROPAGATE) 117/126 Checking commit 84365ab2dc2d (Replication: introduce ERRP_AUTO_PROPAGATE) 118/126 Checking commit 21ee5f83d833 (PVRDMA: introduce ERRP_AUTO_PROPAGATE) 119/126 Checking commit dd3f3104f838 (hw/core/bus.c: introduce ERRP_AUTO_PROPAGATE) 120/126 Checking commit b5b1e0a54e36 (hw/cpu/core.c: introduce ERRP_AUTO_PROPAGATE) 121/126 Checking commit 1534a928d277 (hw/sd/ssi-sd.c: introduce ERRP_AUTO_PROPAGATE) 122/126 Checking commit 8969c6fe5523 (iothread.c: introduce ERRP_AUTO_PROPAGATE) 123/126 Checking commit 5f766d764fb0 (memory_mapping.c: introduce ERRP_AUTO_PROPAGATE) 124/126 Checking commit 2e4f3717dda3 (target/tilegx/cpu.c: introduce ERRP_AUTO_PROPAGATE) 125/126 Checking commit 3ee65677767a (tests/test-image-locking.c: introduce ERRP_AUTO_PROPAGATE) 126/126 Checking commit 319b2061bfba (util/qemu-config.c: introduce ERRP_AUTO_PROPAGATE) === OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]

Signature · 2 lines
Best regards,
Vladimir
#203 lore raw
In reply to Vladimir Sementsov-Ogievskiy

Finally, what is the plan?

Markus what do you think?

Now a lot of patches are reviewed, but a lot of are not.

Is there any hope that all patches will be reviewed? Should I resend the whole series, or may be reduce it to reviewed subsystems only?

Quoted 1,044 lines · Vladimir Sementsov-Ogievskiy

Hi all!

At the request of Markus: full version of errp propagation. Let's look at it. Cover as much as possible, except inserting macro invocation where it's not necessary.

It's huge, and so it's an RFC.

In v5 I've added a lot more preparation cleanups:
01-23 are preparation cleanups
01: not changed, keep Eric's r-b
02: improve commit msg [Markus], keep Eric's r-b
03: changed, only error API here, drop r-b
24 is core macro
- improve cover letter, wording and macro code style
- keep Eric's r-b
25-26: automation scripts
- commit-per-subsystem changed a lot. it's a draft, don't bother too much with it
- coccinelle: add support of error_propagate_prepend

27-126: generated patches

====

Here is a proposal of auto propagation for local_err, to not call error_propagate on every exit point, when we deal with local_err.

There are also two issues with errp:

1. error_fatal & error_append_hint/error_prepend: user can't see this additional info, because exit() happens in error_setg earlier than info is added. [Reported by Greg Kurz]

2. error_abort & error_propagate: when we wrap
error_abort by local_err+error_propagate, resulting coredump will refer to error_propagate and not to the place where error happened. (the macro itself don't fix the issue, but it allows to [3.] drop all local_err+error_propagate pattern, which will definitely fix the issue) [Reported by Kevin Wolf]

====

Generated patches split:

misc

    hw/misc/ivshmem.c
    hw/misc/tmp105.c
    hw/misc/tmp421.c
s390x
    hw/intc/s390_flic_kvm.c
    hw/s390x/3270-ccw.c
    hw/s390x/css-bridge.c
    hw/s390x/css.c
    hw/s390x/s390-skeys.c
    hw/s390x/s390-virtio-ccw.c
    hw/s390x/sclp.c
    hw/s390x/tod-kvm.c
    hw/vfio/ccw.c
    target/s390x/cpu.c
tcg
    exec.c
    hw/arm/armv7m.c
    hw/arm/smmu-common.c
    hw/arm/smmuv3.c
    hw/cpu/a15mpcore.c
    hw/cpu/a9mpcore.c
    hw/cpu/arm11mpcore.c
    hw/i386/pc.c
    hw/intc/nios2_iic.c
    hw/mips/cps.c
    hw/riscv/riscv_hart.c
    hw/riscv/sifive_e.c
    hw/riscv/sifive_u.c
    hw/sd/milkymist-memcard.c
    target/alpha/cpu.c
    target/arm/cpu.c
    target/arm/cpu64.c
    target/cris/cpu.c
    target/hppa/cpu.c
    target/i386/cpu.c
    target/lm32/cpu.c
    target/m68k/cpu.c
    target/microblaze/cpu.c
    target/mips/cpu.c
    target/moxie/cpu.c
    target/nios2/cpu.c
    target/openrisc/cpu.c
    target/ppc/compat.c
    target/ppc/translate_init.inc.c
    target/riscv/cpu.c
    target/sh4/cpu.c
    target/sparc/cpu.c
    target/tricore/cpu.c
    target/unicore32/cpu.c
    target/xtensa/cpu.c
kvm
    target/ppc/kvm.c
    target/s390x/cpu_models.c
xen
    hw/block/dataplane/xen-block.c
    hw/block/xen-block.c
    hw/xen/xen-backend.c
    hw/xen/xen-bus.c
    hw/xen/xen-host-pci-device.c
    hw/xen/xen_pt.c
    hw/xen/xen_pt_config_init.c

Hosts
qga/commands-win32.c
util/oslib-posix.c
ARM Machines

    hw/arm/allwinner-a10.c
    hw/arm/aspeed_soc.c
    hw/arm/bcm2835_peripherals.c
    hw/arm/bcm2836.c
    hw/arm/digic.c
    hw/arm/fsl-imx25.c
    hw/arm/fsl-imx31.c
    hw/arm/fsl-imx6.c
    hw/arm/integratorcp.c
    hw/arm/msf2-soc.c
    hw/arm/nrf51_soc.c
    hw/arm/stm32f205_soc.c
    hw/arm/virt.c
    hw/arm/xlnx-versal-virt.c
    hw/arm/xlnx-zynqmp.c
    hw/cpu/realview_mpcore.c
    hw/display/bcm2835_fb.c
    hw/dma/bcm2835_dma.c
    hw/dma/xilinx_axidma.c
    hw/gpio/aspeed_gpio.c
    hw/gpio/bcm2835_gpio.c
    hw/intc/arm_gic.c
    hw/intc/arm_gic_kvm.c
    hw/intc/arm_gicv3.c
    hw/intc/arm_gicv3_its_kvm.c
    hw/intc/arm_gicv3_kvm.c
    hw/intc/armv7m_nvic.c
    hw/intc/realview_gic.c
    hw/microblaze/xlnx-zynqmp-pmu.c
    hw/misc/bcm2835_mbox.c
    hw/misc/bcm2835_property.c
    hw/misc/msf2-sysreg.c
    hw/net/xilinx_axienet.c
    hw/nvram/nrf51_nvm.c
    hw/timer/aspeed_timer.c
    hw/watchdog/wdt_aspeed.c
MIPS Machines
    hw/core/loader-fit.c
PowerPC Machines
    hw/intc/pnv_xive.c
    hw/intc/xics.c
    hw/intc/xics_kvm.c
    hw/intc/xics_pnv.c
    hw/intc/xics_spapr.c
    hw/isa/pc87312.c
    hw/misc/macio/macio.c
    hw/ppc/e500.c
    hw/ppc/mac_newworld.c
    hw/ppc/pnv.c
    hw/ppc/pnv_core.c
    hw/ppc/pnv_homer.c
    hw/ppc/pnv_lpc.c
    hw/ppc/pnv_occ.c
    hw/ppc/pnv_psi.c
    hw/ppc/spapr.c
    hw/ppc/spapr_caps.c
    hw/ppc/spapr_cpu_core.c
    hw/ppc/spapr_drc.c
    hw/ppc/spapr_irq.c
    hw/ppc/spapr_pci.c
    hw/ppc/spapr_vio.c
SPARC Machines
    hw/sparc/sun4m.c
    hw/sparc64/sun4u.c
S390 Machines
    hw/s390x/ipl.c
    hw/s390x/s390-pci-bus.c
X86 Machines
    hw/acpi/ich9.c
    hw/char/debugcon.c
    hw/char/serial-pci-multi.c
    hw/char/serial-pci.c
    hw/core/machine.c
    hw/core/numa.c
    hw/intc/apic_common.c
    hw/pci-host/piix.c

IDE
hw/ide/qdev.c
Floppy
hw/block/fdc.c
IPack
hw/ipack/ipack.c
PCI
hw/pci-bridge/gen_pcie_root_port.c
hw/pci-bridge/pci_bridge_dev.c
hw/pci-bridge/pci_expander_bridge.c
hw/pci-bridge/pcie_pci_bridge.c
hw/pci-bridge/pcie_root_port.c
hw/pci/pci.c
hw/pci/pcie.c
hw/pci/shpc.c
ACPI/SMBIOS
hw/acpi/core.c
hw/acpi/cpu_hotplug.c
hw/acpi/memory_hotplug.c
hw/mem/memory-device.c
hw/mem/pc-dimm.c
hw/smbios/smbios.c
Network devices

    hw/net/dp8393x.c
    hw/net/ne2000-isa.c
pflash
    hw/block/pflash_cfi01.c
    hw/block/pflash_cfi02.c

SCSI
hw/scsi/esp-pci.c
hw/scsi/mptsas.c
hw/scsi/scsi-bus.c
hw/scsi/scsi-disk.c
hw/scsi/scsi-generic.c
hw/scsi/virtio-scsi.c
SD (Secure Card)
hw/sd/sdhci-pci.c
hw/sd/sdhci.c
USB
hw/usb/bus.c
hw/usb/ccid-card-emulated.c
hw/usb/dev-smartcard-reader.c
hw/usb/dev-storage.c
hw/usb/hcd-ohci-pci.c
hw/usb/hcd-ohci.c
hw/usb/hcd-uhci.c
hw/usb/hcd-xhci.c
USB (serial adapter)
hw/usb/dev-serial.c
VFIO
hw/vfio/common.c
hw/vfio/pci-quirks.c
hw/vfio/pci.c
hw/vfio/platform.c
vfio-ccw

    hw/s390x/s390-ccw.c

vhost
hw/block/vhost-user-blk.c
hw/scsi/vhost-scsi.c
hw/scsi/vhost-user-scsi.c
hw/virtio/vhost-vsock.c
virtio
hw/virtio/virtio-balloon.c
hw/virtio/virtio-bus.c
hw/virtio/virtio-pci.c
hw/virtio/virtio-rng-pci.c
hw/virtio/virtio.c
virtio-9p

    hw/9pfs/9p-local.c
    hw/9pfs/9p.c

virtio-blk
hw/block/dataplane/virtio-blk.c
hw/block/virtio-blk.c
virtio-ccw

    hw/s390x/virtio-ccw-crypto.c
    hw/s390x/virtio-ccw-rng.c
    hw/s390x/virtio-ccw.c

virtio-input
hw/input/virtio-input.c
virtio-serial
hw/char/virtio-serial-bus.c
virtio-rng
backends/rng.c
hw/virtio/virtio-rng.c
megasas
hw/scsi/megasas.c
NVDIMM
hw/mem/nvdimm.c
eepro100

    hw/net/eepro100.c

virtio-gpu
hw/display/virtio-gpu-base.c
hw/display/virtio-gpu-pci.c
hw/display/virtio-vga.c
fw_cfg
hw/nvram/fw_cfg.c
XIVE
hw/intc/spapr_xive.c
hw/intc/spapr_xive_kvm.c
hw/intc/xive.c
Audio
audio/audio.c
hw/audio/intel-hda.c
block
block.c
block/backup.c
block/block-backend.c
block/commit.c
block/crypto.c
block/dirty-bitmap.c
block/io.c
block/mirror.c
block/qapi.c
block/snapshot.c
block/throttle-groups.c
block/throttle.c
block/vxhs.c
blockdev.c
blockjob.c
hw/block/onenand.c
job.c
scsi
scsi/pr-manager-helper.c
chardev
chardev/char-socket.c
chardev/char.c
chardev/spice.c
cmdline
util/qemu-option.c
Dump
dump/dump.c
dump/win_dump.c
Memory API
memory.c
SPICE
hw/display/qxl.c
Graphics
ui/input-barrier.c
ui/input.c
ui/vnc.c
Main loop
util/main-loop.c
vl.c
Human Monitor (HMP)
monitor/misc.c
net
net/can/can_host.c
net/dump.c
net/filter-buffer.c
net/filter.c
net/net.c
net/netmap.c
net/tap.c
hostmem
backends/hostmem-file.c
backends/hostmem-memfd.c
backends/hostmem.c
cryptodev
backends/cryptodev-vhost-user.c
backends/cryptodev.c
QAPI
qapi/qapi-visit-core.c
qapi/qmp-dispatch.c
qapi/string-input-visitor.c
qga
qga/commands-posix.c
QOM
hw/core/qdev-properties-system.c
hw/core/qdev-properties.c
hw/core/qdev.c
qdev-monitor.c
qom/object.c
qom/object_interfaces.c
qom/qom-qobject.c
QMP
monitor/qmp-cmds.c
SLIRP
net/slirp.c
Tracing
trace/qmp.c
TPM
hw/tpm/tpm_util.c
tpm.c
Migration
migration/migration.c
migration/ram.c
migration/rdma.c
migration/savevm.c
migration/socket.c
Cryptography
crypto/block-luks.c
crypto/secret.c
crypto/tlssession.c
I/O Channels
io/dns-resolver.c
io/net-listener.c
Sockets
util/qemu-sockets.c
colo
migration/colo.c
Record/replay
block/blkreplay.c
VMDK
block/vmdk.c
RBD
block/rbd.c
Sheepdog
block/sheepdog.c
VHDX
block/vhdx-log.c
block/vhdx.c
VDI
block/vdi.c
iSCSI
block/iscsi.c
nbd
include/block/nbd.h
block/nbd.c
nbd/client.c
nbd/server.c
NFS
block/nfs.c
SSH
block/ssh.c
CURL
block/curl.c
GLUSTER
block/gluster.c
NVMe Block Driver
block/nvme.c
Bootdevice
bootdevice.c
Quorum
block/quorum.c
blklogwrites
block/blklogwrites.c
blkverify
block/blkverify.c
parallels
block/parallels.c
qed
block/qed.c
raw

    block/file-posix.c
    block/file-win32.c
    block/raw-format.c

qcow2
block/qcow2-bitmap.c
block/qcow2.c
qcow
block/qcow.c
blkdebug
block/blkdebug.c
vpc
block/vpc.c
vvfat
block/vvfat.c
Replication
block/replication.c
replication.c
PVRDMA
hw/rdma/vmw/pvrdma_main.c
hw/core/bus.c
hw/core/bus.c
hw/cpu/core.c
hw/cpu/core.c
hw/sd/ssi-sd.c

    hw/sd/ssi-sd.c

iothread.c
iothread.c
memory_mapping.c
memory_mapping.c
target/tilegx/cpu.c
target/tilegx/cpu.c
tests/test-image-locking.c
tests/test-image-locking.c
util/qemu-config.c
util/qemu-config.c

Vladimir Sementsov-Ogievskiy (126):
hw/core/loader-fit: fix freeing errp in fit_load_fdt net/net: Clean up variable shadowing in net_client_init()
error: rename errp to errp_in where it is IN-argument
hmp: drop Error pointer indirection in hmp_handle_error
vnc: drop Error pointer indirection in vnc_client_io_error
qdev-monitor: well form error hint helpers
nbd: well form nbd_iter_channel_error errp handler
ppc: well form kvmppc_hint_smt_possible error hint helper 9pfs: well form error hint helpers
hw/core/qdev: cleanup Error ** variables
block/snapshot: rename Error ** parameter to more common errp hw/i386/amd_iommu: rename Error ** parameter to more common errp
qga: rename Error ** parameter to more common errp monitor/qmp-cmds: rename Error ** parameter to more common errp hw/s390x: rename Error ** parameter to more common errp hw/sd: rename Error ** parameter to more common errp hw/tpm: rename Error ** parameter to more common errp hw/usb: rename Error ** parameter to more common errp include/block/snapshot.h: rename Error ** parameter to more common
errp
include/qom/object.h: rename Error ** parameter to more common errp qapi/error: add (Error **errp) cleaning APIs backends/cryptodev: drop local_err from cryptodev_backend_complete() hw/vfio/ap: drop local_err from vfio_ap_realize
error: auto propagated local_err
scripts: add coccinelle script to use auto propagated errp
python: add commit-per-subsystem.py
misc: introduce ERRP_AUTO_PROPAGATE
s390x: introduce ERRP_AUTO_PROPAGATE
tcg: introduce ERRP_AUTO_PROPAGATE
kvm: introduce ERRP_AUTO_PROPAGATE
xen: introduce ERRP_AUTO_PROPAGATE
Hosts: introduce ERRP_AUTO_PROPAGATE
ARM Machines: introduce ERRP_AUTO_PROPAGATE
MIPS Machines: introduce ERRP_AUTO_PROPAGATE
PowerPC Machines: introduce ERRP_AUTO_PROPAGATE
SPARC Machines: introduce ERRP_AUTO_PROPAGATE
S390 Machines: introduce ERRP_AUTO_PROPAGATE
X86 Machines: introduce ERRP_AUTO_PROPAGATE
IDE: introduce ERRP_AUTO_PROPAGATE
Floppy: introduce ERRP_AUTO_PROPAGATE
IPack: introduce ERRP_AUTO_PROPAGATE
PCI: introduce ERRP_AUTO_PROPAGATE
ACPI/SMBIOS: introduce ERRP_AUTO_PROPAGATE
Network devices: introduce ERRP_AUTO_PROPAGATE
pflash: introduce ERRP_AUTO_PROPAGATE
SCSI: introduce ERRP_AUTO_PROPAGATE
SD (Secure Card): introduce ERRP_AUTO_PROPAGATE
USB: introduce ERRP_AUTO_PROPAGATE
USB (serial adapter): introduce ERRP_AUTO_PROPAGATE
VFIO: introduce ERRP_AUTO_PROPAGATE
vfio-ccw: introduce ERRP_AUTO_PROPAGATE
vhost: introduce ERRP_AUTO_PROPAGATE
virtio: introduce ERRP_AUTO_PROPAGATE
virtio-9p: introduce ERRP_AUTO_PROPAGATE
virtio-blk: introduce ERRP_AUTO_PROPAGATE
virtio-ccw: introduce ERRP_AUTO_PROPAGATE
virtio-input: introduce ERRP_AUTO_PROPAGATE
virtio-serial: introduce ERRP_AUTO_PROPAGATE
virtio-rng: introduce ERRP_AUTO_PROPAGATE
megasas: introduce ERRP_AUTO_PROPAGATE
NVDIMM: introduce ERRP_AUTO_PROPAGATE
eepro100: introduce ERRP_AUTO_PROPAGATE
virtio-gpu: introduce ERRP_AUTO_PROPAGATE
fw_cfg: introduce ERRP_AUTO_PROPAGATE
XIVE: introduce ERRP_AUTO_PROPAGATE
Audio: introduce ERRP_AUTO_PROPAGATE
block: introduce ERRP_AUTO_PROPAGATE
scsi: introduce ERRP_AUTO_PROPAGATE
chardev: introduce ERRP_AUTO_PROPAGATE
cmdline: introduce ERRP_AUTO_PROPAGATE
Dump: introduce ERRP_AUTO_PROPAGATE
Memory API: introduce ERRP_AUTO_PROPAGATE
SPICE: introduce ERRP_AUTO_PROPAGATE
Graphics: introduce ERRP_AUTO_PROPAGATE
Main loop: introduce ERRP_AUTO_PROPAGATE
Human Monitor (HMP): introduce ERRP_AUTO_PROPAGATE
net: introduce ERRP_AUTO_PROPAGATE
hostmem: introduce ERRP_AUTO_PROPAGATE
cryptodev: introduce ERRP_AUTO_PROPAGATE
QAPI: introduce ERRP_AUTO_PROPAGATE
qga: introduce ERRP_AUTO_PROPAGATE
QOM: introduce ERRP_AUTO_PROPAGATE
QMP: introduce ERRP_AUTO_PROPAGATE
SLIRP: introduce ERRP_AUTO_PROPAGATE
Tracing: introduce ERRP_AUTO_PROPAGATE
TPM: introduce ERRP_AUTO_PROPAGATE
Migration: introduce ERRP_AUTO_PROPAGATE
Cryptography: introduce ERRP_AUTO_PROPAGATE
I/O Channels: introduce ERRP_AUTO_PROPAGATE
Sockets: introduce ERRP_AUTO_PROPAGATE
colo: introduce ERRP_AUTO_PROPAGATE
Record/replay: introduce ERRP_AUTO_PROPAGATE
VMDK: introduce ERRP_AUTO_PROPAGATE
RBD: introduce ERRP_AUTO_PROPAGATE
Sheepdog: introduce ERRP_AUTO_PROPAGATE
VHDX: introduce ERRP_AUTO_PROPAGATE
VDI: introduce ERRP_AUTO_PROPAGATE
iSCSI: introduce ERRP_AUTO_PROPAGATE
nbd: introduce ERRP_AUTO_PROPAGATE
NFS: introduce ERRP_AUTO_PROPAGATE
SSH: introduce ERRP_AUTO_PROPAGATE
CURL: introduce ERRP_AUTO_PROPAGATE
GLUSTER: introduce ERRP_AUTO_PROPAGATE
NVMe Block Driver: introduce ERRP_AUTO_PROPAGATE
Bootdevice: introduce ERRP_AUTO_PROPAGATE
Quorum: introduce ERRP_AUTO_PROPAGATE
blklogwrites: introduce ERRP_AUTO_PROPAGATE
blkverify: introduce ERRP_AUTO_PROPAGATE
parallels: introduce ERRP_AUTO_PROPAGATE
qed: introduce ERRP_AUTO_PROPAGATE

   raw: introduce ERRP_AUTO_PROPAGATE
   qcow2: introduce ERRP_AUTO_PROPAGATE
   qcow: introduce ERRP_AUTO_PROPAGATE
   blkdebug: introduce ERRP_AUTO_PROPAGATE
   vpc: introduce ERRP_AUTO_PROPAGATE
   vvfat: introduce ERRP_AUTO_PROPAGATE
   Replication: introduce ERRP_AUTO_PROPAGATE
   PVRDMA: introduce ERRP_AUTO_PROPAGATE
   hw/core/bus.c: introduce ERRP_AUTO_PROPAGATE
   hw/cpu/core.c: introduce ERRP_AUTO_PROPAGATE
   hw/sd/ssi-sd.c: introduce ERRP_AUTO_PROPAGATE
   iothread.c: introduce ERRP_AUTO_PROPAGATE
   memory_mapping.c: introduce ERRP_AUTO_PROPAGATE
   target/tilegx/cpu.c: introduce ERRP_AUTO_PROPAGATE
   tests/test-image-locking.c: introduce ERRP_AUTO_PROPAGATE
   util/qemu-config.c: introduce ERRP_AUTO_PROPAGATE
CC Gerd Hoffmann <[email protected]>
CC "Gonglei (Arei)" <[email protected]>
CC Eduardo Habkost <[email protected]>
CC Igor Mammedov <[email protected]>
CC Laurent Vivier <[email protected]>
CC Amit Shah <[email protected]>
CC Kevin Wolf <[email protected]>
CC Max Reitz <[email protected]>
CC John Snow <[email protected]>
CC Ari Sundholm <[email protected]>
CC Pavel Dovgalyuk <[email protected]>
CC Paolo Bonzini <[email protected]>
CC Stefan Hajnoczi <[email protected]>
CC Fam Zheng <[email protected]>
CC Stefan Weil <[email protected]>
CC Ronnie Sahlberg <[email protected]>
CC Peter Lieven <[email protected]>
CC Eric Blake <[email protected]>
CC "Denis V. Lunev" <[email protected]>
CC Markus Armbruster <[email protected]>
CC Alberto Garcia <[email protected]>
CC Jason Dillaman <[email protected]>
CC Wen Congyang <[email protected]>
CC Xie Changlong <[email protected]>
CC Liu Yuan <[email protected]>
CC "Richard W.M. Jones" <[email protected]>
CC Jeff Cody <[email protected]>
CC "Marc-André Lureau" <[email protected]>
CC "Daniel P. Berrangé" <[email protected]>
CC Richard Henderson <[email protected]>
CC Greg Kurz <[email protected]>
CC "Michael S. Tsirkin" <[email protected]>
CC Marcel Apfelbaum <[email protected]>
CC Beniamino Galvani <[email protected]>
CC Peter Maydell <[email protected]>
CC "Cédric Le Goater" <[email protected]>
CC Andrew Jeffery <[email protected]>
CC Joel Stanley <[email protected]>
CC Andrew Baumann <[email protected]>
CC "Philippe Mathieu-Daudé" <[email protected]>
CC Antony Pavlov <[email protected]>
CC Jean-Christophe Dubois <[email protected]>
CC Peter Chubb <[email protected]>
CC Subbaraya Sundeep <[email protected]>
CC Eric Auger <[email protected]>
CC Alistair Francis <[email protected]>
CC "Edgar E. Iglesias" <[email protected]>
CC Stefano Stabellini <[email protected]>
CC Anthony Perard <[email protected]>
CC Paul Durrant <[email protected]>
CC Paul Burton <[email protected]>
CC Aleksandar Rikalo <[email protected]>
CC Chris Wulff <[email protected]>
CC Marek Vasut <[email protected]>
CC David Gibson <[email protected]>
CC Cornelia Huck <[email protected]>
CC Halil Pasic <[email protected]>
CC Christian Borntraeger <[email protected]>
CC "Hervé Poussineau" <[email protected]>
CC Xiao Guangrong <[email protected]>
CC Aurelien Jarno <[email protected]>
CC Aleksandar Markovic <[email protected]>
CC Mark Cave-Ayland <[email protected]>
CC Jason Wang <[email protected]>
CC Laszlo Ersek <[email protected]>
CC Yuval Shaia <[email protected]>
CC Palmer Dabbelt <[email protected]>
CC Sagar Karandikar <[email protected]>
CC Bastian Koppelmann <[email protected]>
CC David Hildenbrand <[email protected]>
CC Thomas Huth <[email protected]>
CC Eric Farman <[email protected]>
CC Matthew Rosato <[email protected]>
CC Hannes Reinecke <[email protected]>
CC Michael Walle <[email protected]>
CC Artyom Tarasenko <[email protected]>
CC Stefan Berger <[email protected]>
CC Samuel Thibault <[email protected]>
CC Alex Williamson <[email protected]>
CC Tony Krowiak <[email protected]>
CC Pierre Morel <[email protected]>
CC Michael Roth <[email protected]>
CC Hailiang Zhang <[email protected]>
CC Juan Quintela <[email protected]>
CC "Dr. David Alan Gilbert" <[email protected]>
CC Luigi Rizzo <[email protected]>
CC Giuseppe Lettieri <[email protected]>
CC Vincenzo Maffione <[email protected]>
CC Jan Kiszka <[email protected]>
CC Anthony Green <[email protected]>
CC Stafford Horne <[email protected]>
CC Guan Xuetao <[email protected]>
CC Max Filippov <[email protected]>
  include/block/nbd.h                           |   1 +
  include/block/snapshot.h                      |   2 +-
  include/monitor/hmp.h                         |   2 +-
  include/qapi/error.h                          |  69 ++++-
  include/qom/object.h                          |   4 +-
  target/ppc/kvm_ppc.h                          |   4 +-
  ui/vnc.h                                      |   2 +-
  audio/audio.c                                 |  12 +-
  backends/cryptodev-vhost-user.c               |  10 +-
  backends/cryptodev.c                          |  25 +-
  backends/hostmem-file.c                       |  21 +-
  backends/hostmem-memfd.c                      |  18 +-
  backends/hostmem.c                            |  41 ++-
  backends/rng.c                                |   7 +-
  block.c                                       | 225 +++++++---------
  block/backup.c                                |   1 +
  block/blkdebug.c                              |  36 ++-
  block/blklogwrites.c                          |  22 +-
  block/blkreplay.c                             |   7 +-
  block/blkverify.c                             |  17 +-
  block/block-backend.c                         |  19 +-
  block/commit.c                                |   7 +-
  block/crypto.c                                |  14 +-
  block/curl.c                                  |   7 +-
  block/dirty-bitmap.c                          |   1 +
  block/file-posix.c                            |  79 +++---
  block/file-win32.c                            |  29 +-
  block/gluster.c                               |  69 +++--
  block/io.c                                    |  12 +-
  block/iscsi.c                                 |  36 ++-
  block/mirror.c                                |  19 +-
  block/nbd.c                                   |  59 ++--
  block/nfs.c                                   |   7 +-
  block/nvme.c                                  |  19 +-
  block/parallels.c                             |  30 +--
  block/qapi.c                                  |  26 +-
  block/qcow.c                                  |  17 +-
  block/qcow2-bitmap.c                          |   9 +-
  block/qcow2.c                                 |  98 +++----
  block/qed.c                                   |  18 +-
  block/quorum.c                                |  23 +-
  block/raw-format.c                            |   7 +-
  block/rbd.c                                   |  29 +-
  block/replication.c                           |  40 ++-
  block/sheepdog.c                              |  73 +++--
  block/snapshot.c                              |  20 +-
  block/ssh.c                                   |  12 +-
  block/throttle-groups.c                       |  24 +-
  block/throttle.c                              |   7 +-
  block/vdi.c                                   |  15 +-
  block/vhdx-log.c                              |   1 +
  block/vhdx.c                                  |  22 +-
  block/vmdk.c                                  |  41 ++-
  block/vpc.c                                   |  28 +-
  block/vvfat.c                                 |  12 +-
  block/vxhs.c                                  |  23 +-
  blockdev.c                                    | 252 ++++++++----------
  blockjob.c                                    |   8 +-
  bootdevice.c                                  |  31 +--
  chardev/char-socket.c                         |   7 +-
  chardev/char.c                                |  20 +-
  chardev/spice.c                               |   1 +
  crypto/block-luks.c                           |  56 ++--
  crypto/secret.c                               |  17 +-
  crypto/tlssession.c                           |   7 +-
  dump/dump-hmp-cmds.c                          |   4 +-
  dump/dump.c                                   | 151 +++++------
  dump/win_dump.c                               |  29 +-
  exec.c                                        |  21 +-
  hw/9pfs/9p-local.c                            |  12 +-
  hw/9pfs/9p-proxy.c                            |   5 +-
  hw/9pfs/9p.c                                  |   1 +
  hw/acpi/core.c                                |  18 +-
  hw/acpi/cpu_hotplug.c                         |   2 +-
  hw/acpi/ich9.c                                |  30 +--
  hw/acpi/memory_hotplug.c                      |   7 +-
  hw/arm/allwinner-a10.c                        |  27 +-
  hw/arm/armv7m.c                               |  52 ++--
  hw/arm/aspeed_soc.c                           |   1 +
  hw/arm/bcm2835_peripherals.c                  |  85 +++---
  hw/arm/bcm2836.c                              |  41 ++-
  hw/arm/digic.c                                |  22 +-
  hw/arm/fsl-imx25.c                            |  62 ++---
  hw/arm/fsl-imx31.c                            |  57 ++--
  hw/arm/fsl-imx6.c                             |  81 +++---
  hw/arm/integratorcp.c                         |   7 +-
  hw/arm/msf2-soc.c                             |  22 +-
  hw/arm/nrf51_soc.c                            |  47 ++--
  hw/arm/smmu-common.c                          |   7 +-
  hw/arm/smmuv3.c                               |   7 +-
  hw/arm/stm32f205_soc.c                        |  39 ++-
  hw/arm/virt.c                                 |   2 +
  hw/arm/xlnx-versal-virt.c                     |   7 +-
  hw/arm/xlnx-zynqmp.c                          |  86 +++---
  hw/audio/intel-hda.c                          |  13 +-
  hw/block/dataplane/virtio-blk.c               |   1 +
  hw/block/dataplane/xen-block.c                |  17 +-
  hw/block/fdc.c                                |  19 +-
  hw/block/onenand.c                            |   7 +-
  hw/block/pflash_cfi01.c                       |   7 +-
  hw/block/pflash_cfi02.c                       |   7 +-
  hw/block/vhost-user-blk.c                     |   6 +-
  hw/block/virtio-blk.c                         |   7 +-
  hw/block/xen-block.c                          | 119 ++++-----
  hw/char/debugcon.c                            |   7 +-
  hw/char/serial-pci-multi.c                    |   7 +-
  hw/char/serial-pci.c                          |   7 +-
  hw/char/virtio-serial-bus.c                   |   7 +-
  hw/core/bus.c                                 |  15 +-
  hw/core/loader-fit.c                          |   7 +-
  hw/core/machine-hmp-cmds.c                    |   6 +-
  hw/core/machine.c                             |  21 +-
  hw/core/numa.c                                |  51 ++--
  hw/core/qdev-properties-system.c              |  28 +-
  hw/core/qdev-properties.c                     |  89 +++----
  hw/core/qdev.c                                |  58 ++--
  hw/cpu/a15mpcore.c                            |   7 +-
  hw/cpu/a9mpcore.c                             |  27 +-
  hw/cpu/arm11mpcore.c                          |  22 +-
  hw/cpu/core.c                                 |  14 +-
  hw/cpu/realview_mpcore.c                      |  12 +-
  hw/display/bcm2835_fb.c                       |   6 +-
  hw/display/qxl.c                              |   7 +-
  hw/display/virtio-gpu-base.c                  |   7 +-
  hw/display/virtio-gpu-pci.c                   |   7 +-
  hw/display/virtio-vga.c                       |   7 +-
  hw/dma/bcm2835_dma.c                          |   6 +-
  hw/dma/xilinx_axidma.c                        |  22 +-
  hw/gpio/aspeed_gpio.c                         |   7 +-
  hw/gpio/bcm2835_gpio.c                        |  10 +-
  hw/i386/amd_iommu.c                           |  14 +-
  hw/i386/pc.c                                  | 120 ++++-----
  hw/ide/qdev.c                                 |  16 +-
  hw/input/virtio-input.c                       |  14 +-
  hw/intc/apic_common.c                         |   7 +-
  hw/intc/arm_gic.c                             |   7 +-
  hw/intc/arm_gic_kvm.c                         |  12 +-
  hw/intc/arm_gicv3.c                           |  12 +-
  hw/intc/arm_gicv3_its_kvm.c                   |   7 +-
  hw/intc/arm_gicv3_kvm.c                       |  17 +-
  hw/intc/armv7m_nvic.c                         |  12 +-
  hw/intc/nios2_iic.c                           |   6 +-
  hw/intc/pnv_xive.c                            |  15 +-
  hw/intc/realview_gic.c                        |   7 +-
  hw/intc/s390_flic_kvm.c                       |   9 +-
  hw/intc/spapr_xive.c                          |  12 +-
  hw/intc/spapr_xive_kvm.c                      |  55 ++--
  hw/intc/xics.c                                |  28 +-
  hw/intc/xics_kvm.c                            |  30 +--
  hw/intc/xics_pnv.c                            |   7 +-
  hw/intc/xics_spapr.c                          |   7 +-
  hw/intc/xive.c                                |  27 +-
  hw/ipack/ipack.c                              |   5 +-
  hw/isa/pc87312.c                              |   7 +-
  hw/mem/memory-device.c                        |  20 +-
  hw/mem/nvdimm.c                               |  25 +-
  hw/mem/pc-dimm.c                              |  23 +-
  hw/microblaze/xlnx-zynqmp-pmu.c               |  12 +-
  hw/mips/cps.c                                 |  46 ++--
  hw/misc/bcm2835_mbox.c                        |   6 +-
  hw/misc/bcm2835_property.c                    |  10 +-
  hw/misc/ivshmem.c                             |  37 ++-
  hw/misc/macio/macio.c                         |  68 ++---
  hw/misc/msf2-sysreg.c                         |   1 +
  hw/misc/tmp105.c                              |   7 +-
  hw/misc/tmp421.c                              |   7 +-
  hw/net/dp8393x.c                              |   7 +-
  hw/net/eepro100.c                             |   7 +-
  hw/net/ne2000-isa.c                           |  17 +-
  hw/net/xilinx_axienet.c                       |  22 +-
  hw/nvram/fw_cfg.c                             |  14 +-
  hw/nvram/nrf51_nvm.c                          |   7 +-
  hw/pci-bridge/gen_pcie_root_port.c            |   7 +-
  hw/pci-bridge/pci_bridge_dev.c                |  13 +-
  hw/pci-bridge/pci_expander_bridge.c           |   7 +-
  hw/pci-bridge/pcie_pci_bridge.c               |   8 +-
  hw/pci-bridge/pcie_root_port.c                |   1 +
  hw/pci-host/piix.c                            |   7 +-
  hw/pci/pci.c                                  |  19 +-
  hw/pci/pcie.c                                 |   7 +-
  hw/pci/shpc.c                                 |  14 +-
  hw/ppc/e500.c                                 |   7 +-
  hw/ppc/mac_newworld.c                         |   1 +
  hw/ppc/pnv.c                                  | 109 ++++----
  hw/ppc/pnv_core.c                             |  23 +-
  hw/ppc/pnv_homer.c                            |   5 +-
  hw/ppc/pnv_lpc.c                              |  26 +-
  hw/ppc/pnv_occ.c                              |   5 +-
  hw/ppc/pnv_psi.c                              |  23 +-
  hw/ppc/spapr.c                                | 133 ++++-----
  hw/ppc/spapr_caps.c                           |  57 ++--
  hw/ppc/spapr_cpu_core.c                       |  36 ++-
  hw/ppc/spapr_drc.c                            |  48 ++--
  hw/ppc/spapr_irq.c                            |  98 +++----
  hw/ppc/spapr_pci.c                            |  97 +++----
  hw/ppc/spapr_vio.c                            |  12 +-
  hw/rdma/vmw/pvrdma_main.c                     |   1 +
  hw/riscv/riscv_hart.c                         |   7 +-
  hw/riscv/sifive_e.c                           |   7 +-
  hw/riscv/sifive_u.c                           |  11 +-
  hw/s390x/3270-ccw.c                           |  13 +-
  hw/s390x/css-bridge.c                         |   7 +-
  hw/s390x/css.c                                |   7 +-
  hw/s390x/event-facility.c                     |   2 +-
  hw/s390x/ipl.c                                |  24 +-
  hw/s390x/s390-ccw.c                           |  19 +-
  hw/s390x/s390-pci-bus.c                       |  37 ++-
  hw/s390x/s390-skeys.c                         |   7 +-
  hw/s390x/s390-stattrib.c                      |   3 +-
  hw/s390x/s390-virtio-ccw.c                    |  11 +-
  hw/s390x/sclp.c                               |  15 +-
  hw/s390x/tod-kvm.c                            |  14 +-
  hw/s390x/virtio-ccw-crypto.c                  |   7 +-
  hw/s390x/virtio-ccw-rng.c                     |   7 +-
  hw/s390x/virtio-ccw.c                         |  13 +-
  hw/scsi/esp-pci.c                             |   7 +-
  hw/scsi/megasas.c                             |  11 +-
  hw/scsi/mptsas.c                              |  13 +-
  hw/scsi/scsi-bus.c                            |  24 +-
  hw/scsi/scsi-disk.c                           |   8 +-
  hw/scsi/scsi-generic.c                        |   1 +
  hw/scsi/vhost-scsi.c                          |  12 +-
  hw/scsi/vhost-user-scsi.c                     |   7 +-
  hw/scsi/virtio-scsi.c                         |   7 +-
  hw/sd/milkymist-memcard.c                     |  11 +-
  hw/sd/sdhci-pci.c                             |   7 +-
  hw/sd/sdhci.c                                 |  23 +-
  hw/sd/ssi-sd.c                                |  14 +-
  hw/smbios/smbios.c                            |  42 ++-
  hw/sparc/sun4m.c                              |  21 +-
  hw/sparc64/sun4u.c                            |   7 +-
  hw/timer/aspeed_timer.c                       |   6 +-
  hw/tpm/tpm_emulator.c                         |   8 +-
  hw/tpm/tpm_util.c                             |   7 +-
  hw/usb/bus.c                                  |  37 ++-
  hw/usb/ccid-card-emulated.c                   |   1 +
  hw/usb/dev-network.c                          |   2 +-
  hw/usb/dev-serial.c                           |   7 +-
  hw/usb/dev-smartcard-reader.c                 |  14 +-
  hw/usb/dev-storage.c                          |  17 +-
  hw/usb/hcd-ohci-pci.c                         |   7 +-
  hw/usb/hcd-ohci.c                             |  14 +-
  hw/usb/hcd-uhci.c                             |   7 +-
  hw/usb/hcd-xhci.c                             |  13 +-
  hw/vfio/ap.c                                  |  16 +-
  hw/vfio/ccw.c                                 |  24 +-
  hw/vfio/common.c                              |   3 +
  hw/vfio/pci-quirks.c                          |   8 +-
  hw/vfio/pci.c                                 |  42 ++-
  hw/vfio/platform.c                            |   1 +
  hw/virtio/vhost-vsock.c                       |   1 +
  hw/virtio/virtio-balloon.c                    |  35 ++-
  hw/virtio/virtio-bus.c                        |  17 +-
  hw/virtio/virtio-pci.c                        |   2 +
  hw/virtio/virtio-rng-pci.c                    |   7 +-
  hw/virtio/virtio-rng.c                        |   7 +-
  hw/virtio/virtio.c                            |  19 +-
  hw/watchdog/wdt_aspeed.c                      |   5 +-
  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 +-
  io/dns-resolver.c                             |   7 +-
  io/net-listener.c                             |   7 +-
  iothread.c                                    |  27 +-
  job.c                                         |   7 +-
  memory.c                                      |  63 ++---
  memory_mapping.c                              |   7 +-
  migration/colo.c                              |  38 ++-
  migration/migration.c                         |  39 ++-
  migration/ram.c                               |  13 +-
  migration/rdma.c                              |  13 +-
  migration/savevm.c                            |   2 +
  migration/socket.c                            |  18 +-
  monitor/hmp-cmds.c                            | 155 ++++++-----
  monitor/misc.c                                |   9 +-
  monitor/qmp-cmds.c                            |   9 +-
  nbd/client.c                                  |   5 +
  nbd/server.c                                  |   5 +
  net/can/can_host.c                            |   7 +-
  net/dump.c                                    |  15 +-
  net/filter-buffer.c                           |  15 +-
  net/filter.c                                  |   7 +-
  net/net.c                                     |  58 ++--
  net/netmap.c                                  |   7 +-
  net/slirp.c                                   |   7 +-
  net/tap.c                                     |  47 ++--
  qapi/qapi-visit-core.c                        |  56 ++--
  qapi/qmp-dispatch.c                           |   7 +-
  qapi/string-input-visitor.c                   |   7 +-
  qdev-monitor.c                                |  69 +++--
  qga/commands-posix.c                          | 222 +++++++--------
  qga/commands-win32.c                          | 141 +++++-----
  qga/commands.c                                |  12 +-
  qom/object.c                                  | 246 ++++++++---------
  qom/object_interfaces.c                       |  27 +-
  qom/qom-hmp-cmds.c                            |   4 +-
  qom/qom-qobject.c                             |   7 +-
  replication.c                                 |  28 +-
  scsi/pr-manager-helper.c                      |   7 +-
  target/alpha/cpu.c                            |   7 +-
  target/arm/cpu.c                              |   7 +-
  target/arm/cpu64.c                            |  11 +-
  target/cris/cpu.c                             |   7 +-
  target/hppa/cpu.c                             |   7 +-
  target/i386/cpu.c                             | 117 ++++----
  target/lm32/cpu.c                             |   7 +-
  target/m68k/cpu.c                             |   7 +-
  target/microblaze/cpu.c                       |   7 +-
  target/mips/cpu.c                             |   7 +-
  target/moxie/cpu.c                            |   7 +-
  target/nios2/cpu.c                            |   7 +-
  target/openrisc/cpu.c                         |   7 +-
  target/ppc/compat.c                           |  20 +-
  target/ppc/kvm.c                              |  14 +-
  target/ppc/translate_init.inc.c               |  26 +-
  target/riscv/cpu.c                            |   7 +-
  target/s390x/cpu.c                            |  26 +-
  target/s390x/cpu_models.c                     |   2 +
  target/sh4/cpu.c                              |   7 +-
  target/sparc/cpu.c                            |  14 +-
  target/tilegx/cpu.c                           |   7 +-
  target/tricore/cpu.c                          |   7 +-
  target/unicore32/cpu.c                        |   7 +-
  target/xtensa/cpu.c                           |   7 +-
  tests/test-image-locking.c                    |   7 +-
  tpm.c                                         |   7 +-
  trace/qmp.c                                   |  14 +-
  ui/input-barrier.c                            |   7 +-
  ui/input.c                                    |  14 +-
  ui/vnc.c                                      |  39 ++-
  util/error.c                                  |  30 +--
  util/main-loop.c                              |   5 +-
  util/oslib-posix.c                            |   6 +-
  util/qemu-config.c                            |  29 +-
  util/qemu-option.c                            |  59 ++--
  util/qemu-sockets.c                           |  31 +--
  vl.c                                          |  14 +-
  python/commit-per-subsystem.py                | 204 ++++++++++++++
  scripts/coccinelle/auto-propagated-errp.cocci | 118 ++++++++
  341 files changed, 3851 insertions(+), 4455 deletions(-)

create mode 100755 python/commit-per-subsystem.py create mode 100644 scripts/coccinelle/auto-propagated-errp.cocci

Signature · 2 lines
Best regards,
Vladimir
#204 lore raw

Hi

Quoted 9 lines · Vladimir Sementsov-Ogievskiy

Finally, what is the plan?

Markus what do you think?

Now a lot of patches are reviewed, but a lot of are not.

Is there any hope that all patches will be reviewed? Should I resend the whole series, or may be reduce it to reviewed subsystems only?

I don't think we have well established rules for whole-tree cleanups like this. In the past, several cleanup series got lost.

It will take ages to get every subsystem maintainer to review the patches. Most likely, since they are quite systematic, there isn't much to say and it is easy to miss something that has some hidden ramifications. Perhaps whole-tree cleanups should require at least 2 reviewers to bypass the subsytem maintainer review? But my past experience with this kind of exercice doesn't encourage me, and probably I am not the only one.

Quoted 1,051 lines
Quoted 1,041 lines · Vladimir Sementsov-Ogievskiy

Hi all!

At the request of Markus: full version of errp propagation. Let's look at it. Cover as much as possible, except inserting macro invocation where it's not necessary.

It's huge, and so it's an RFC.

In v5 I've added a lot more preparation cleanups:
01-23 are preparation cleanups
01: not changed, keep Eric's r-b
02: improve commit msg [Markus], keep Eric's r-b
03: changed, only error API here, drop r-b
24 is core macro
- improve cover letter, wording and macro code style
- keep Eric's r-b
25-26: automation scripts
- commit-per-subsystem changed a lot. it's a draft, don't bother too much with it
- coccinelle: add support of error_propagate_prepend

27-126: generated patches

====

Here is a proposal of auto propagation for local_err, to not call error_propagate on every exit point, when we deal with local_err.

There are also two issues with errp:

1. error_fatal & error_append_hint/error_prepend: user can't see this additional info, because exit() happens in error_setg earlier than info is added. [Reported by Greg Kurz]

2. error_abort & error_propagate: when we wrap
error_abort by local_err+error_propagate, resulting coredump will refer to error_propagate and not to the place where error happened. (the macro itself don't fix the issue, but it allows to [3.] drop all local_err+error_propagate pattern, which will definitely fix the issue) [Reported by Kevin Wolf]

====

Generated patches split:

misc

    hw/misc/ivshmem.c
    hw/misc/tmp105.c
    hw/misc/tmp421.c
s390x
    hw/intc/s390_flic_kvm.c
    hw/s390x/3270-ccw.c
    hw/s390x/css-bridge.c
    hw/s390x/css.c
    hw/s390x/s390-skeys.c
    hw/s390x/s390-virtio-ccw.c
    hw/s390x/sclp.c
    hw/s390x/tod-kvm.c
    hw/vfio/ccw.c
    target/s390x/cpu.c
tcg
    exec.c
    hw/arm/armv7m.c
    hw/arm/smmu-common.c
    hw/arm/smmuv3.c
    hw/cpu/a15mpcore.c
    hw/cpu/a9mpcore.c
    hw/cpu/arm11mpcore.c
    hw/i386/pc.c
    hw/intc/nios2_iic.c
    hw/mips/cps.c
    hw/riscv/riscv_hart.c
    hw/riscv/sifive_e.c
    hw/riscv/sifive_u.c
    hw/sd/milkymist-memcard.c
    target/alpha/cpu.c
    target/arm/cpu.c
    target/arm/cpu64.c
    target/cris/cpu.c
    target/hppa/cpu.c
    target/i386/cpu.c
    target/lm32/cpu.c
    target/m68k/cpu.c
    target/microblaze/cpu.c
    target/mips/cpu.c
    target/moxie/cpu.c
    target/nios2/cpu.c
    target/openrisc/cpu.c
    target/ppc/compat.c
    target/ppc/translate_init.inc.c
    target/riscv/cpu.c
    target/sh4/cpu.c
    target/sparc/cpu.c
    target/tricore/cpu.c
    target/unicore32/cpu.c
    target/xtensa/cpu.c
kvm
    target/ppc/kvm.c
    target/s390x/cpu_models.c
xen
    hw/block/dataplane/xen-block.c
    hw/block/xen-block.c
    hw/xen/xen-backend.c
    hw/xen/xen-bus.c
    hw/xen/xen-host-pci-device.c
    hw/xen/xen_pt.c
    hw/xen/xen_pt_config_init.c

Hosts
qga/commands-win32.c
util/oslib-posix.c
ARM Machines

    hw/arm/allwinner-a10.c
    hw/arm/aspeed_soc.c
    hw/arm/bcm2835_peripherals.c
    hw/arm/bcm2836.c
    hw/arm/digic.c
    hw/arm/fsl-imx25.c
    hw/arm/fsl-imx31.c
    hw/arm/fsl-imx6.c
    hw/arm/integratorcp.c
    hw/arm/msf2-soc.c
    hw/arm/nrf51_soc.c
    hw/arm/stm32f205_soc.c
    hw/arm/virt.c
    hw/arm/xlnx-versal-virt.c
    hw/arm/xlnx-zynqmp.c
    hw/cpu/realview_mpcore.c
    hw/display/bcm2835_fb.c
    hw/dma/bcm2835_dma.c
    hw/dma/xilinx_axidma.c
    hw/gpio/aspeed_gpio.c
    hw/gpio/bcm2835_gpio.c
    hw/intc/arm_gic.c
    hw/intc/arm_gic_kvm.c
    hw/intc/arm_gicv3.c
    hw/intc/arm_gicv3_its_kvm.c
    hw/intc/arm_gicv3_kvm.c
    hw/intc/armv7m_nvic.c
    hw/intc/realview_gic.c
    hw/microblaze/xlnx-zynqmp-pmu.c
    hw/misc/bcm2835_mbox.c
    hw/misc/bcm2835_property.c
    hw/misc/msf2-sysreg.c
    hw/net/xilinx_axienet.c
    hw/nvram/nrf51_nvm.c
    hw/timer/aspeed_timer.c
    hw/watchdog/wdt_aspeed.c
MIPS Machines
    hw/core/loader-fit.c
PowerPC Machines
    hw/intc/pnv_xive.c
    hw/intc/xics.c
    hw/intc/xics_kvm.c
    hw/intc/xics_pnv.c
    hw/intc/xics_spapr.c
    hw/isa/pc87312.c
    hw/misc/macio/macio.c
    hw/ppc/e500.c
    hw/ppc/mac_newworld.c
    hw/ppc/pnv.c
    hw/ppc/pnv_core.c
    hw/ppc/pnv_homer.c
    hw/ppc/pnv_lpc.c
    hw/ppc/pnv_occ.c
    hw/ppc/pnv_psi.c
    hw/ppc/spapr.c
    hw/ppc/spapr_caps.c
    hw/ppc/spapr_cpu_core.c
    hw/ppc/spapr_drc.c
    hw/ppc/spapr_irq.c
    hw/ppc/spapr_pci.c
    hw/ppc/spapr_vio.c
SPARC Machines
    hw/sparc/sun4m.c
    hw/sparc64/sun4u.c
S390 Machines
    hw/s390x/ipl.c
    hw/s390x/s390-pci-bus.c
X86 Machines
    hw/acpi/ich9.c
    hw/char/debugcon.c
    hw/char/serial-pci-multi.c
    hw/char/serial-pci.c
    hw/core/machine.c
    hw/core/numa.c
    hw/intc/apic_common.c
    hw/pci-host/piix.c

IDE
hw/ide/qdev.c
Floppy
hw/block/fdc.c
IPack
hw/ipack/ipack.c
PCI
hw/pci-bridge/gen_pcie_root_port.c
hw/pci-bridge/pci_bridge_dev.c
hw/pci-bridge/pci_expander_bridge.c
hw/pci-bridge/pcie_pci_bridge.c
hw/pci-bridge/pcie_root_port.c
hw/pci/pci.c
hw/pci/pcie.c
hw/pci/shpc.c
ACPI/SMBIOS
hw/acpi/core.c
hw/acpi/cpu_hotplug.c
hw/acpi/memory_hotplug.c
hw/mem/memory-device.c
hw/mem/pc-dimm.c
hw/smbios/smbios.c
Network devices

    hw/net/dp8393x.c
    hw/net/ne2000-isa.c
pflash
    hw/block/pflash_cfi01.c
    hw/block/pflash_cfi02.c

SCSI
hw/scsi/esp-pci.c
hw/scsi/mptsas.c
hw/scsi/scsi-bus.c
hw/scsi/scsi-disk.c
hw/scsi/scsi-generic.c
hw/scsi/virtio-scsi.c
SD (Secure Card)
hw/sd/sdhci-pci.c
hw/sd/sdhci.c
USB
hw/usb/bus.c
hw/usb/ccid-card-emulated.c
hw/usb/dev-smartcard-reader.c
hw/usb/dev-storage.c
hw/usb/hcd-ohci-pci.c
hw/usb/hcd-ohci.c
hw/usb/hcd-uhci.c
hw/usb/hcd-xhci.c
USB (serial adapter)
hw/usb/dev-serial.c
VFIO
hw/vfio/common.c
hw/vfio/pci-quirks.c
hw/vfio/pci.c
hw/vfio/platform.c
vfio-ccw

    hw/s390x/s390-ccw.c

vhost
hw/block/vhost-user-blk.c
hw/scsi/vhost-scsi.c
hw/scsi/vhost-user-scsi.c
hw/virtio/vhost-vsock.c
virtio
hw/virtio/virtio-balloon.c
hw/virtio/virtio-bus.c
hw/virtio/virtio-pci.c
hw/virtio/virtio-rng-pci.c
hw/virtio/virtio.c
virtio-9p

    hw/9pfs/9p-local.c
    hw/9pfs/9p.c

virtio-blk
hw/block/dataplane/virtio-blk.c
hw/block/virtio-blk.c
virtio-ccw

    hw/s390x/virtio-ccw-crypto.c
    hw/s390x/virtio-ccw-rng.c
    hw/s390x/virtio-ccw.c

virtio-input
hw/input/virtio-input.c
virtio-serial
hw/char/virtio-serial-bus.c
virtio-rng
backends/rng.c
hw/virtio/virtio-rng.c
megasas
hw/scsi/megasas.c
NVDIMM
hw/mem/nvdimm.c
eepro100

    hw/net/eepro100.c

virtio-gpu
hw/display/virtio-gpu-base.c
hw/display/virtio-gpu-pci.c
hw/display/virtio-vga.c
fw_cfg
hw/nvram/fw_cfg.c
XIVE
hw/intc/spapr_xive.c
hw/intc/spapr_xive_kvm.c
hw/intc/xive.c
Audio
audio/audio.c
hw/audio/intel-hda.c
block
block.c
block/backup.c
block/block-backend.c
block/commit.c
block/crypto.c
block/dirty-bitmap.c
block/io.c
block/mirror.c
block/qapi.c
block/snapshot.c
block/throttle-groups.c
block/throttle.c
block/vxhs.c
blockdev.c
blockjob.c
hw/block/onenand.c
job.c
scsi
scsi/pr-manager-helper.c
chardev
chardev/char-socket.c
chardev/char.c
chardev/spice.c
cmdline
util/qemu-option.c
Dump
dump/dump.c
dump/win_dump.c
Memory API
memory.c
SPICE
hw/display/qxl.c
Graphics
ui/input-barrier.c
ui/input.c
ui/vnc.c
Main loop
util/main-loop.c
vl.c
Human Monitor (HMP)
monitor/misc.c
net
net/can/can_host.c
net/dump.c
net/filter-buffer.c
net/filter.c
net/net.c
net/netmap.c
net/tap.c
hostmem
backends/hostmem-file.c
backends/hostmem-memfd.c
backends/hostmem.c
cryptodev
backends/cryptodev-vhost-user.c
backends/cryptodev.c
QAPI
qapi/qapi-visit-core.c
qapi/qmp-dispatch.c
qapi/string-input-visitor.c
qga
qga/commands-posix.c
QOM
hw/core/qdev-properties-system.c
hw/core/qdev-properties.c
hw/core/qdev.c
qdev-monitor.c
qom/object.c
qom/object_interfaces.c
qom/qom-qobject.c
QMP
monitor/qmp-cmds.c
SLIRP
net/slirp.c
Tracing
trace/qmp.c
TPM
hw/tpm/tpm_util.c
tpm.c
Migration
migration/migration.c
migration/ram.c
migration/rdma.c
migration/savevm.c
migration/socket.c
Cryptography
crypto/block-luks.c
crypto/secret.c
crypto/tlssession.c
I/O Channels
io/dns-resolver.c
io/net-listener.c
Sockets
util/qemu-sockets.c
colo
migration/colo.c
Record/replay
block/blkreplay.c
VMDK
block/vmdk.c
RBD
block/rbd.c
Sheepdog
block/sheepdog.c
VHDX
block/vhdx-log.c
block/vhdx.c
VDI
block/vdi.c
iSCSI
block/iscsi.c
nbd
include/block/nbd.h
block/nbd.c
nbd/client.c
nbd/server.c
NFS
block/nfs.c
SSH
block/ssh.c
CURL
block/curl.c
GLUSTER
block/gluster.c
NVMe Block Driver
block/nvme.c
Bootdevice
bootdevice.c
Quorum
block/quorum.c
blklogwrites
block/blklogwrites.c
blkverify
block/blkverify.c
parallels
block/parallels.c
qed
block/qed.c
raw

    block/file-posix.c
    block/file-win32.c
    block/raw-format.c

qcow2
block/qcow2-bitmap.c
block/qcow2.c
qcow
block/qcow.c
blkdebug
block/blkdebug.c
vpc
block/vpc.c
vvfat
block/vvfat.c
Replication
block/replication.c
replication.c
PVRDMA
hw/rdma/vmw/pvrdma_main.c
hw/core/bus.c
hw/core/bus.c
hw/cpu/core.c
hw/cpu/core.c
hw/sd/ssi-sd.c

    hw/sd/ssi-sd.c

iothread.c
iothread.c
memory_mapping.c
memory_mapping.c
target/tilegx/cpu.c
target/tilegx/cpu.c
tests/test-image-locking.c
tests/test-image-locking.c
util/qemu-config.c
util/qemu-config.c

Vladimir Sementsov-Ogievskiy (126):
hw/core/loader-fit: fix freeing errp in fit_load_fdt net/net: Clean up variable shadowing in net_client_init()
error: rename errp to errp_in where it is IN-argument
hmp: drop Error pointer indirection in hmp_handle_error
vnc: drop Error pointer indirection in vnc_client_io_error
qdev-monitor: well form error hint helpers
nbd: well form nbd_iter_channel_error errp handler
ppc: well form kvmppc_hint_smt_possible error hint helper 9pfs: well form error hint helpers
hw/core/qdev: cleanup Error ** variables
block/snapshot: rename Error ** parameter to more common errp hw/i386/amd_iommu: rename Error ** parameter to more common errp
qga: rename Error ** parameter to more common errp monitor/qmp-cmds: rename Error ** parameter to more common errp hw/s390x: rename Error ** parameter to more common errp hw/sd: rename Error ** parameter to more common errp hw/tpm: rename Error ** parameter to more common errp hw/usb: rename Error ** parameter to more common errp include/block/snapshot.h: rename Error ** parameter to more common
errp
include/qom/object.h: rename Error ** parameter to more common errp qapi/error: add (Error **errp) cleaning APIs backends/cryptodev: drop local_err from cryptodev_backend_complete() hw/vfio/ap: drop local_err from vfio_ap_realize
error: auto propagated local_err
scripts: add coccinelle script to use auto propagated errp
python: add commit-per-subsystem.py
misc: introduce ERRP_AUTO_PROPAGATE
s390x: introduce ERRP_AUTO_PROPAGATE
tcg: introduce ERRP_AUTO_PROPAGATE
kvm: introduce ERRP_AUTO_PROPAGATE
xen: introduce ERRP_AUTO_PROPAGATE
Hosts: introduce ERRP_AUTO_PROPAGATE
ARM Machines: introduce ERRP_AUTO_PROPAGATE
MIPS Machines: introduce ERRP_AUTO_PROPAGATE
PowerPC Machines: introduce ERRP_AUTO_PROPAGATE
SPARC Machines: introduce ERRP_AUTO_PROPAGATE
S390 Machines: introduce ERRP_AUTO_PROPAGATE
X86 Machines: introduce ERRP_AUTO_PROPAGATE
IDE: introduce ERRP_AUTO_PROPAGATE
Floppy: introduce ERRP_AUTO_PROPAGATE
IPack: introduce ERRP_AUTO_PROPAGATE
PCI: introduce ERRP_AUTO_PROPAGATE
ACPI/SMBIOS: introduce ERRP_AUTO_PROPAGATE
Network devices: introduce ERRP_AUTO_PROPAGATE
pflash: introduce ERRP_AUTO_PROPAGATE
SCSI: introduce ERRP_AUTO_PROPAGATE
SD (Secure Card): introduce ERRP_AUTO_PROPAGATE
USB: introduce ERRP_AUTO_PROPAGATE
USB (serial adapter): introduce ERRP_AUTO_PROPAGATE
VFIO: introduce ERRP_AUTO_PROPAGATE
vfio-ccw: introduce ERRP_AUTO_PROPAGATE
vhost: introduce ERRP_AUTO_PROPAGATE
virtio: introduce ERRP_AUTO_PROPAGATE
virtio-9p: introduce ERRP_AUTO_PROPAGATE
virtio-blk: introduce ERRP_AUTO_PROPAGATE
virtio-ccw: introduce ERRP_AUTO_PROPAGATE
virtio-input: introduce ERRP_AUTO_PROPAGATE
virtio-serial: introduce ERRP_AUTO_PROPAGATE
virtio-rng: introduce ERRP_AUTO_PROPAGATE
megasas: introduce ERRP_AUTO_PROPAGATE
NVDIMM: introduce ERRP_AUTO_PROPAGATE
eepro100: introduce ERRP_AUTO_PROPAGATE
virtio-gpu: introduce ERRP_AUTO_PROPAGATE
fw_cfg: introduce ERRP_AUTO_PROPAGATE
XIVE: introduce ERRP_AUTO_PROPAGATE
Audio: introduce ERRP_AUTO_PROPAGATE
block: introduce ERRP_AUTO_PROPAGATE
scsi: introduce ERRP_AUTO_PROPAGATE
chardev: introduce ERRP_AUTO_PROPAGATE
cmdline: introduce ERRP_AUTO_PROPAGATE
Dump: introduce ERRP_AUTO_PROPAGATE
Memory API: introduce ERRP_AUTO_PROPAGATE
SPICE: introduce ERRP_AUTO_PROPAGATE
Graphics: introduce ERRP_AUTO_PROPAGATE
Main loop: introduce ERRP_AUTO_PROPAGATE
Human Monitor (HMP): introduce ERRP_AUTO_PROPAGATE
net: introduce ERRP_AUTO_PROPAGATE
hostmem: introduce ERRP_AUTO_PROPAGATE
cryptodev: introduce ERRP_AUTO_PROPAGATE
QAPI: introduce ERRP_AUTO_PROPAGATE
qga: introduce ERRP_AUTO_PROPAGATE
QOM: introduce ERRP_AUTO_PROPAGATE
QMP: introduce ERRP_AUTO_PROPAGATE
SLIRP: introduce ERRP_AUTO_PROPAGATE
Tracing: introduce ERRP_AUTO_PROPAGATE
TPM: introduce ERRP_AUTO_PROPAGATE
Migration: introduce ERRP_AUTO_PROPAGATE
Cryptography: introduce ERRP_AUTO_PROPAGATE
I/O Channels: introduce ERRP_AUTO_PROPAGATE
Sockets: introduce ERRP_AUTO_PROPAGATE
colo: introduce ERRP_AUTO_PROPAGATE
Record/replay: introduce ERRP_AUTO_PROPAGATE
VMDK: introduce ERRP_AUTO_PROPAGATE
RBD: introduce ERRP_AUTO_PROPAGATE
Sheepdog: introduce ERRP_AUTO_PROPAGATE
VHDX: introduce ERRP_AUTO_PROPAGATE
VDI: introduce ERRP_AUTO_PROPAGATE
iSCSI: introduce ERRP_AUTO_PROPAGATE
nbd: introduce ERRP_AUTO_PROPAGATE
NFS: introduce ERRP_AUTO_PROPAGATE
SSH: introduce ERRP_AUTO_PROPAGATE
CURL: introduce ERRP_AUTO_PROPAGATE
GLUSTER: introduce ERRP_AUTO_PROPAGATE
NVMe Block Driver: introduce ERRP_AUTO_PROPAGATE
Bootdevice: introduce ERRP_AUTO_PROPAGATE
Quorum: introduce ERRP_AUTO_PROPAGATE
blklogwrites: introduce ERRP_AUTO_PROPAGATE
blkverify: introduce ERRP_AUTO_PROPAGATE
parallels: introduce ERRP_AUTO_PROPAGATE
qed: introduce ERRP_AUTO_PROPAGATE

   raw: introduce ERRP_AUTO_PROPAGATE
   qcow2: introduce ERRP_AUTO_PROPAGATE
   qcow: introduce ERRP_AUTO_PROPAGATE
   blkdebug: introduce ERRP_AUTO_PROPAGATE
   vpc: introduce ERRP_AUTO_PROPAGATE
   vvfat: introduce ERRP_AUTO_PROPAGATE
   Replication: introduce ERRP_AUTO_PROPAGATE
   PVRDMA: introduce ERRP_AUTO_PROPAGATE
   hw/core/bus.c: introduce ERRP_AUTO_PROPAGATE
   hw/cpu/core.c: introduce ERRP_AUTO_PROPAGATE
   hw/sd/ssi-sd.c: introduce ERRP_AUTO_PROPAGATE
   iothread.c: introduce ERRP_AUTO_PROPAGATE
   memory_mapping.c: introduce ERRP_AUTO_PROPAGATE
   target/tilegx/cpu.c: introduce ERRP_AUTO_PROPAGATE
   tests/test-image-locking.c: introduce ERRP_AUTO_PROPAGATE
   util/qemu-config.c: introduce ERRP_AUTO_PROPAGATE
CC Gerd Hoffmann <[email protected]>
CC "Gonglei (Arei)" <[email protected]>
CC Eduardo Habkost <[email protected]>
CC Igor Mammedov <[email protected]>
CC Laurent Vivier <[email protected]>
CC Amit Shah <[email protected]>
CC Kevin Wolf <[email protected]>
CC Max Reitz <[email protected]>
CC John Snow <[email protected]>
CC Ari Sundholm <[email protected]>
CC Pavel Dovgalyuk <[email protected]>
CC Paolo Bonzini <[email protected]>
CC Stefan Hajnoczi <[email protected]>
CC Fam Zheng <[email protected]>
CC Stefan Weil <[email protected]>
CC Ronnie Sahlberg <[email protected]>
CC Peter Lieven <[email protected]>
CC Eric Blake <[email protected]>
CC "Denis V. Lunev" <[email protected]>
CC Markus Armbruster <[email protected]>
CC Alberto Garcia <[email protected]>
CC Jason Dillaman <[email protected]>
CC Wen Congyang <[email protected]>
CC Xie Changlong <[email protected]>
CC Liu Yuan <[email protected]>
CC "Richard W.M. Jones" <[email protected]>
CC Jeff Cody <[email protected]>
CC "Marc-André Lureau" <[email protected]>
CC "Daniel P. Berrangé" <[email protected]>
CC Richard Henderson <[email protected]>
CC Greg Kurz <[email protected]>
CC "Michael S. Tsirkin" <[email protected]>
CC Marcel Apfelbaum <[email protected]>
CC Beniamino Galvani <[email protected]>
CC Peter Maydell <[email protected]>
CC "Cédric Le Goater" <[email protected]>
CC Andrew Jeffery <[email protected]>
CC Joel Stanley <[email protected]>
CC Andrew Baumann <[email protected]>
CC "Philippe Mathieu-Daudé" <[email protected]>
CC Antony Pavlov <[email protected]>
CC Jean-Christophe Dubois <[email protected]>
CC Peter Chubb <[email protected]>
CC Subbaraya Sundeep <[email protected]>
CC Eric Auger <[email protected]>
CC Alistair Francis <[email protected]>
CC "Edgar E. Iglesias" <[email protected]>
CC Stefano Stabellini <[email protected]>
CC Anthony Perard <[email protected]>
CC Paul Durrant <[email protected]>
CC Paul Burton <[email protected]>
CC Aleksandar Rikalo <[email protected]>
CC Chris Wulff <[email protected]>
CC Marek Vasut <[email protected]>
CC David Gibson <[email protected]>
CC Cornelia Huck <[email protected]>
CC Halil Pasic <[email protected]>
CC Christian Borntraeger <[email protected]>
CC "Hervé Poussineau" <[email protected]>
CC Xiao Guangrong <[email protected]>
CC Aurelien Jarno <[email protected]>
CC Aleksandar Markovic <[email protected]>
CC Mark Cave-Ayland <[email protected]>
CC Jason Wang <[email protected]>
CC Laszlo Ersek <[email protected]>
CC Yuval Shaia <[email protected]>
CC Palmer Dabbelt <[email protected]>
CC Sagar Karandikar <[email protected]>
CC Bastian Koppelmann <[email protected]>
CC David Hildenbrand <[email protected]>
CC Thomas Huth <[email protected]>
CC Eric Farman <[email protected]>
CC Matthew Rosato <[email protected]>
CC Hannes Reinecke <[email protected]>
CC Michael Walle <[email protected]>
CC Artyom Tarasenko <[email protected]>
CC Stefan Berger <[email protected]>
CC Samuel Thibault <[email protected]>
CC Alex Williamson <[email protected]>
CC Tony Krowiak <[email protected]>
CC Pierre Morel <[email protected]>
CC Michael Roth <[email protected]>
CC Hailiang Zhang <[email protected]>
CC Juan Quintela <[email protected]>
CC "Dr. David Alan Gilbert" <[email protected]>
CC Luigi Rizzo <[email protected]>
CC Giuseppe Lettieri <[email protected]>
CC Vincenzo Maffione <[email protected]>
CC Jan Kiszka <[email protected]>
CC Anthony Green <[email protected]>
CC Stafford Horne <[email protected]>
CC Guan Xuetao <[email protected]>
CC Max Filippov <[email protected]>
  include/block/nbd.h                           |   1 +
  include/block/snapshot.h                      |   2 +-
  include/monitor/hmp.h                         |   2 +-
  include/qapi/error.h                          |  69 ++++-
  include/qom/object.h                          |   4 +-
  target/ppc/kvm_ppc.h                          |   4 +-
  ui/vnc.h                                      |   2 +-
  audio/audio.c                                 |  12 +-
  backends/cryptodev-vhost-user.c               |  10 +-
  backends/cryptodev.c                          |  25 +-
  backends/hostmem-file.c                       |  21 +-
  backends/hostmem-memfd.c                      |  18 +-
  backends/hostmem.c                            |  41 ++-
  backends/rng.c                                |   7 +-
  block.c                                       | 225 +++++++---------
  block/backup.c                                |   1 +
  block/blkdebug.c                              |  36 ++-
  block/blklogwrites.c                          |  22 +-
  block/blkreplay.c                             |   7 +-
  block/blkverify.c                             |  17 +-
  block/block-backend.c                         |  19 +-
  block/commit.c                                |   7 +-
  block/crypto.c                                |  14 +-
  block/curl.c                                  |   7 +-
  block/dirty-bitmap.c                          |   1 +
  block/file-posix.c                            |  79 +++---
  block/file-win32.c                            |  29 +-
  block/gluster.c                               |  69 +++--
  block/io.c                                    |  12 +-
  block/iscsi.c                                 |  36 ++-
  block/mirror.c                                |  19 +-
  block/nbd.c                                   |  59 ++--
  block/nfs.c                                   |   7 +-
  block/nvme.c                                  |  19 +-
  block/parallels.c                             |  30 +--
  block/qapi.c                                  |  26 +-
  block/qcow.c                                  |  17 +-
  block/qcow2-bitmap.c                          |   9 +-
  block/qcow2.c                                 |  98 +++----
  block/qed.c                                   |  18 +-
  block/quorum.c                                |  23 +-
  block/raw-format.c                            |   7 +-
  block/rbd.c                                   |  29 +-
  block/replication.c                           |  40 ++-
  block/sheepdog.c                              |  73 +++--
  block/snapshot.c                              |  20 +-
  block/ssh.c                                   |  12 +-
  block/throttle-groups.c                       |  24 +-
  block/throttle.c                              |   7 +-
  block/vdi.c                                   |  15 +-
  block/vhdx-log.c                              |   1 +
  block/vhdx.c                                  |  22 +-
  block/vmdk.c                                  |  41 ++-
  block/vpc.c                                   |  28 +-
  block/vvfat.c                                 |  12 +-
  block/vxhs.c                                  |  23 +-
  blockdev.c                                    | 252 ++++++++----------
  blockjob.c                                    |   8 +-
  bootdevice.c                                  |  31 +--
  chardev/char-socket.c                         |   7 +-
  chardev/char.c                                |  20 +-
  chardev/spice.c                               |   1 +
  crypto/block-luks.c                           |  56 ++--
  crypto/secret.c                               |  17 +-
  crypto/tlssession.c                           |   7 +-
  dump/dump-hmp-cmds.c                          |   4 +-
  dump/dump.c                                   | 151 +++++------
  dump/win_dump.c                               |  29 +-
  exec.c                                        |  21 +-
  hw/9pfs/9p-local.c                            |  12 +-
  hw/9pfs/9p-proxy.c                            |   5 +-
  hw/9pfs/9p.c                                  |   1 +
  hw/acpi/core.c                                |  18 +-
  hw/acpi/cpu_hotplug.c                         |   2 +-
  hw/acpi/ich9.c                                |  30 +--
  hw/acpi/memory_hotplug.c                      |   7 +-
  hw/arm/allwinner-a10.c                        |  27 +-
  hw/arm/armv7m.c                               |  52 ++--
  hw/arm/aspeed_soc.c                           |   1 +
  hw/arm/bcm2835_peripherals.c                  |  85 +++---
  hw/arm/bcm2836.c                              |  41 ++-
  hw/arm/digic.c                                |  22 +-
  hw/arm/fsl-imx25.c                            |  62 ++---
  hw/arm/fsl-imx31.c                            |  57 ++--
  hw/arm/fsl-imx6.c                             |  81 +++---
  hw/arm/integratorcp.c                         |   7 +-
  hw/arm/msf2-soc.c                             |  22 +-
  hw/arm/nrf51_soc.c                            |  47 ++--
  hw/arm/smmu-common.c                          |   7 +-
  hw/arm/smmuv3.c                               |   7 +-
  hw/arm/stm32f205_soc.c                        |  39 ++-
  hw/arm/virt.c                                 |   2 +
  hw/arm/xlnx-versal-virt.c                     |   7 +-
  hw/arm/xlnx-zynqmp.c                          |  86 +++---
  hw/audio/intel-hda.c                          |  13 +-
  hw/block/dataplane/virtio-blk.c               |   1 +
  hw/block/dataplane/xen-block.c                |  17 +-
  hw/block/fdc.c                                |  19 +-
  hw/block/onenand.c                            |   7 +-
  hw/block/pflash_cfi01.c                       |   7 +-
  hw/block/pflash_cfi02.c                       |   7 +-
  hw/block/vhost-user-blk.c                     |   6 +-
  hw/block/virtio-blk.c                         |   7 +-
  hw/block/xen-block.c                          | 119 ++++-----
  hw/char/debugcon.c                            |   7 +-
  hw/char/serial-pci-multi.c                    |   7 +-
  hw/char/serial-pci.c                          |   7 +-
  hw/char/virtio-serial-bus.c                   |   7 +-
  hw/core/bus.c                                 |  15 +-
  hw/core/loader-fit.c                          |   7 +-
  hw/core/machine-hmp-cmds.c                    |   6 +-
  hw/core/machine.c                             |  21 +-
  hw/core/numa.c                                |  51 ++--
  hw/core/qdev-properties-system.c              |  28 +-
  hw/core/qdev-properties.c                     |  89 +++----
  hw/core/qdev.c                                |  58 ++--
  hw/cpu/a15mpcore.c                            |   7 +-
  hw/cpu/a9mpcore.c                             |  27 +-
  hw/cpu/arm11mpcore.c                          |  22 +-
  hw/cpu/core.c                                 |  14 +-
  hw/cpu/realview_mpcore.c                      |  12 +-
  hw/display/bcm2835_fb.c                       |   6 +-
  hw/display/qxl.c                              |   7 +-
  hw/display/virtio-gpu-base.c                  |   7 +-
  hw/display/virtio-gpu-pci.c                   |   7 +-
  hw/display/virtio-vga.c                       |   7 +-
  hw/dma/bcm2835_dma.c                          |   6 +-
  hw/dma/xilinx_axidma.c                        |  22 +-
  hw/gpio/aspeed_gpio.c                         |   7 +-
  hw/gpio/bcm2835_gpio.c                        |  10 +-
  hw/i386/amd_iommu.c                           |  14 +-
  hw/i386/pc.c                                  | 120 ++++-----
  hw/ide/qdev.c                                 |  16 +-
  hw/input/virtio-input.c                       |  14 +-
  hw/intc/apic_common.c                         |   7 +-
  hw/intc/arm_gic.c                             |   7 +-
  hw/intc/arm_gic_kvm.c                         |  12 +-
  hw/intc/arm_gicv3.c                           |  12 +-
  hw/intc/arm_gicv3_its_kvm.c                   |   7 +-
  hw/intc/arm_gicv3_kvm.c                       |  17 +-
  hw/intc/armv7m_nvic.c                         |  12 +-
  hw/intc/nios2_iic.c                           |   6 +-
  hw/intc/pnv_xive.c                            |  15 +-
  hw/intc/realview_gic.c                        |   7 +-
  hw/intc/s390_flic_kvm.c                       |   9 +-
  hw/intc/spapr_xive.c                          |  12 +-
  hw/intc/spapr_xive_kvm.c                      |  55 ++--
  hw/intc/xics.c                                |  28 +-
  hw/intc/xics_kvm.c                            |  30 +--
  hw/intc/xics_pnv.c                            |   7 +-
  hw/intc/xics_spapr.c                          |   7 +-
  hw/intc/xive.c                                |  27 +-
  hw/ipack/ipack.c                              |   5 +-
  hw/isa/pc87312.c                              |   7 +-
  hw/mem/memory-device.c                        |  20 +-
  hw/mem/nvdimm.c                               |  25 +-
  hw/mem/pc-dimm.c                              |  23 +-
  hw/microblaze/xlnx-zynqmp-pmu.c               |  12 +-
  hw/mips/cps.c                                 |  46 ++--
  hw/misc/bcm2835_mbox.c                        |   6 +-
  hw/misc/bcm2835_property.c                    |  10 +-
  hw/misc/ivshmem.c                             |  37 ++-
  hw/misc/macio/macio.c                         |  68 ++---
  hw/misc/msf2-sysreg.c                         |   1 +
  hw/misc/tmp105.c                              |   7 +-
  hw/misc/tmp421.c                              |   7 +-
  hw/net/dp8393x.c                              |   7 +-
  hw/net/eepro100.c                             |   7 +-
  hw/net/ne2000-isa.c                           |  17 +-
  hw/net/xilinx_axienet.c                       |  22 +-
  hw/nvram/fw_cfg.c                             |  14 +-
  hw/nvram/nrf51_nvm.c                          |   7 +-
  hw/pci-bridge/gen_pcie_root_port.c            |   7 +-
  hw/pci-bridge/pci_bridge_dev.c                |  13 +-
  hw/pci-bridge/pci_expander_bridge.c           |   7 +-
  hw/pci-bridge/pcie_pci_bridge.c               |   8 +-
  hw/pci-bridge/pcie_root_port.c                |   1 +
  hw/pci-host/piix.c                            |   7 +-
  hw/pci/pci.c                                  |  19 +-
  hw/pci/pcie.c                                 |   7 +-
  hw/pci/shpc.c                                 |  14 +-
  hw/ppc/e500.c                                 |   7 +-
  hw/ppc/mac_newworld.c                         |   1 +
  hw/ppc/pnv.c                                  | 109 ++++----
  hw/ppc/pnv_core.c                             |  23 +-
  hw/ppc/pnv_homer.c                            |   5 +-
  hw/ppc/pnv_lpc.c                              |  26 +-
  hw/ppc/pnv_occ.c                              |   5 +-
  hw/ppc/pnv_psi.c                              |  23 +-
  hw/ppc/spapr.c                                | 133 ++++-----
  hw/ppc/spapr_caps.c                           |  57 ++--
  hw/ppc/spapr_cpu_core.c                       |  36 ++-
  hw/ppc/spapr_drc.c                            |  48 ++--
  hw/ppc/spapr_irq.c                            |  98 +++----
  hw/ppc/spapr_pci.c                            |  97 +++----
  hw/ppc/spapr_vio.c                            |  12 +-
  hw/rdma/vmw/pvrdma_main.c                     |   1 +
  hw/riscv/riscv_hart.c                         |   7 +-
  hw/riscv/sifive_e.c                           |   7 +-
  hw/riscv/sifive_u.c                           |  11 +-
  hw/s390x/3270-ccw.c                           |  13 +-
  hw/s390x/css-bridge.c                         |   7 +-
  hw/s390x/css.c                                |   7 +-
  hw/s390x/event-facility.c                     |   2 +-
  hw/s390x/ipl.c                                |  24 +-
  hw/s390x/s390-ccw.c                           |  19 +-
  hw/s390x/s390-pci-bus.c                       |  37 ++-
  hw/s390x/s390-skeys.c                         |   7 +-
  hw/s390x/s390-stattrib.c                      |   3 +-
  hw/s390x/s390-virtio-ccw.c                    |  11 +-
  hw/s390x/sclp.c                               |  15 +-
  hw/s390x/tod-kvm.c                            |  14 +-
  hw/s390x/virtio-ccw-crypto.c                  |   7 +-
  hw/s390x/virtio-ccw-rng.c                     |   7 +-
  hw/s390x/virtio-ccw.c                         |  13 +-
  hw/scsi/esp-pci.c                             |   7 +-
  hw/scsi/megasas.c                             |  11 +-
  hw/scsi/mptsas.c                              |  13 +-
  hw/scsi/scsi-bus.c                            |  24 +-
  hw/scsi/scsi-disk.c                           |   8 +-
  hw/scsi/scsi-generic.c                        |   1 +
  hw/scsi/vhost-scsi.c                          |  12 +-
  hw/scsi/vhost-user-scsi.c                     |   7 +-
  hw/scsi/virtio-scsi.c                         |   7 +-
  hw/sd/milkymist-memcard.c                     |  11 +-
  hw/sd/sdhci-pci.c                             |   7 +-
  hw/sd/sdhci.c                                 |  23 +-
  hw/sd/ssi-sd.c                                |  14 +-
  hw/smbios/smbios.c                            |  42 ++-
  hw/sparc/sun4m.c                              |  21 +-
  hw/sparc64/sun4u.c                            |   7 +-
  hw/timer/aspeed_timer.c                       |   6 +-
  hw/tpm/tpm_emulator.c                         |   8 +-
  hw/tpm/tpm_util.c                             |   7 +-
  hw/usb/bus.c                                  |  37 ++-
  hw/usb/ccid-card-emulated.c                   |   1 +
  hw/usb/dev-network.c                          |   2 +-
  hw/usb/dev-serial.c                           |   7 +-
  hw/usb/dev-smartcard-reader.c                 |  14 +-
  hw/usb/dev-storage.c                          |  17 +-
  hw/usb/hcd-ohci-pci.c                         |   7 +-
  hw/usb/hcd-ohci.c                             |  14 +-
  hw/usb/hcd-uhci.c                             |   7 +-
  hw/usb/hcd-xhci.c                             |  13 +-
  hw/vfio/ap.c                                  |  16 +-
  hw/vfio/ccw.c                                 |  24 +-
  hw/vfio/common.c                              |   3 +
  hw/vfio/pci-quirks.c                          |   8 +-
  hw/vfio/pci.c                                 |  42 ++-
  hw/vfio/platform.c                            |   1 +
  hw/virtio/vhost-vsock.c                       |   1 +
  hw/virtio/virtio-balloon.c                    |  35 ++-
  hw/virtio/virtio-bus.c                        |  17 +-
  hw/virtio/virtio-pci.c                        |   2 +
  hw/virtio/virtio-rng-pci.c                    |   7 +-
  hw/virtio/virtio-rng.c                        |   7 +-
  hw/virtio/virtio.c                            |  19 +-
  hw/watchdog/wdt_aspeed.c                      |   5 +-
  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 +-
  io/dns-resolver.c                             |   7 +-
  io/net-listener.c                             |   7 +-
  iothread.c                                    |  27 +-
  job.c                                         |   7 +-
  memory.c                                      |  63 ++---
  memory_mapping.c                              |   7 +-
  migration/colo.c                              |  38 ++-
  migration/migration.c                         |  39 ++-
  migration/ram.c                               |  13 +-
  migration/rdma.c                              |  13 +-
  migration/savevm.c                            |   2 +
  migration/socket.c                            |  18 +-
  monitor/hmp-cmds.c                            | 155 ++++++-----
  monitor/misc.c                                |   9 +-
  monitor/qmp-cmds.c                            |   9 +-
  nbd/client.c                                  |   5 +
  nbd/server.c                                  |   5 +
  net/can/can_host.c                            |   7 +-
  net/dump.c                                    |  15 +-
  net/filter-buffer.c                           |  15 +-
  net/filter.c                                  |   7 +-
  net/net.c                                     |  58 ++--
  net/netmap.c                                  |   7 +-
  net/slirp.c                                   |   7 +-
  net/tap.c                                     |  47 ++--
  qapi/qapi-visit-core.c                        |  56 ++--
  qapi/qmp-dispatch.c                           |   7 +-
  qapi/string-input-visitor.c                   |   7 +-
  qdev-monitor.c                                |  69 +++--
  qga/commands-posix.c                          | 222 +++++++--------
  qga/commands-win32.c                          | 141 +++++-----
  qga/commands.c                                |  12 +-
  qom/object.c                                  | 246 ++++++++---------
  qom/object_interfaces.c                       |  27 +-
  qom/qom-hmp-cmds.c                            |   4 +-
  qom/qom-qobject.c                             |   7 +-
  replication.c                                 |  28 +-
  scsi/pr-manager-helper.c                      |   7 +-
  target/alpha/cpu.c                            |   7 +-
  target/arm/cpu.c                              |   7 +-
  target/arm/cpu64.c                            |  11 +-
  target/cris/cpu.c                             |   7 +-
  target/hppa/cpu.c                             |   7 +-
  target/i386/cpu.c                             | 117 ++++----
  target/lm32/cpu.c                             |   7 +-
  target/m68k/cpu.c                             |   7 +-
  target/microblaze/cpu.c                       |   7 +-
  target/mips/cpu.c                             |   7 +-
  target/moxie/cpu.c                            |   7 +-
  target/nios2/cpu.c                            |   7 +-
  target/openrisc/cpu.c                         |   7 +-
  target/ppc/compat.c                           |  20 +-
  target/ppc/kvm.c                              |  14 +-
  target/ppc/translate_init.inc.c               |  26 +-
  target/riscv/cpu.c                            |   7 +-
  target/s390x/cpu.c                            |  26 +-
  target/s390x/cpu_models.c                     |   2 +
  target/sh4/cpu.c                              |   7 +-
  target/sparc/cpu.c                            |  14 +-
  target/tilegx/cpu.c                           |   7 +-
  target/tricore/cpu.c                          |   7 +-
  target/unicore32/cpu.c                        |   7 +-
  target/xtensa/cpu.c                           |   7 +-
  tests/test-image-locking.c                    |   7 +-
  tpm.c                                         |   7 +-
  trace/qmp.c                                   |  14 +-
  ui/input-barrier.c                            |   7 +-
  ui/input.c                                    |  14 +-
  ui/vnc.c                                      |  39 ++-
  util/error.c                                  |  30 +--
  util/main-loop.c                              |   5 +-
  util/oslib-posix.c                            |   6 +-
  util/qemu-config.c                            |  29 +-
  util/qemu-option.c                            |  59 ++--
  util/qemu-sockets.c                           |  31 +--
  vl.c                                          |  14 +-
  python/commit-per-subsystem.py                | 204 ++++++++++++++
  scripts/coccinelle/auto-propagated-errp.cocci | 118 ++++++++
  341 files changed, 3851 insertions(+), 4455 deletions(-)
Quoted 3 lines

create mode 100755 python/commit-per-subsystem.py create mode 100644 scripts/coccinelle/auto-propagated-errp.cocci

--
Best regards,
Vladimir

#205 lore raw
Quoted 9 lines · On Fri, 8 Nov 2019 22:57:25 +0400 Marc-André Lureau…

Hi

Quoted 5 lines · Vladimir Sementsov-Ogievskiy

Finally, what is the plan?

Markus what do you think?

Quoted 7 lines
Quoted 4 lines

Now a lot of patches are reviewed, but a lot of are not.

Is there any hope that all patches will be reviewed? Should I resend the whole series, or may be reduce it to reviewed subsystems only?

I don't think we have well established rules for whole-tree cleanups like this. In the past, several cleanup series got lost.

Yes, it is always problematic if a series touches a lot of different subsystems.

Quoted 8 lines

It will take ages to get every subsystem maintainer to review the patches. Most likely, since they are quite systematic, there isn't much to say and it is easy to miss something that has some hidden ramifications. Perhaps whole-tree cleanups should require at least 2 reviewers to bypass the subsytem maintainer review? But my past experience with this kind of exercice doesn't encourage me, and probably I am not the only one.

It's not just the reviews; it's easy to miss compile problems on less mainstream architectures (and even easier to miss functional problems there, although they are probably less likely with automated rework.) CI can probably help, but that's something for the future.

Anyway, I've now gotten around to that series; spotted one problem in s390x code, I think.

One thing that's helpful for such a large series is a git branch that makes it easy to give the series a quick go. (You can use patchew, but it takes time before it gets all mails, so just pushing it somewhere and letting people know is a good idea anyway.)

#206 lore raw
Quoted 37 lines · Cornelia Huck
Quoted 9 lines · On Fri, 8 Nov 2019 22:57:25 +0400 Marc-André Lureau…

Hi

Quoted 5 lines · Vladimir Sementsov-Ogievskiy

Finally, what is the plan?

Markus what do you think?

Quoted 7 lines
Quoted 4 lines

Now a lot of patches are reviewed, but a lot of are not.

Is there any hope that all patches will be reviewed? Should I resend the whole series, or may be reduce it to reviewed subsystems only?

I don't think we have well established rules for whole-tree cleanups like this. In the past, several cleanup series got lost.

Yes, it is always problematic if a series touches a lot of different subsystems.

Quoted 8 lines

It will take ages to get every subsystem maintainer to review the patches. Most likely, since they are quite systematic, there isn't much to say and it is easy to miss something that has some hidden ramifications. Perhaps whole-tree cleanups should require at least 2 reviewers to bypass the subsytem maintainer review? But my past experience with this kind of exercice doesn't encourage me, and probably I am not the only one.

It's not just the reviews; it's easy to miss compile problems on less mainstream architectures (and even easier to miss functional problems there, although they are probably less likely with automated rework.) CI can probably help, but that's something for the future.

Quoted 8 lines

Anyway, I've now gotten around to that series; spotted one problem in s390x code, I think.

One thing that's helpful for such a large series is a git branch that makes it easy to give the series a quick go. (You can use patchew, but it takes time before it gets all mails, so just pushing it somewhere and letting people know is a good idea anyway.)

Thanks for review!

The series are posted here:

https://src.openvz.org/users/vsementsov/repos/qemu/browse

https://src.openvz.org/scm/~vsementsov/qemu.git #tag up-auto-local-err-v5

Signature · 2 lines
Best regards,
Vladimir
#207 lore raw
In reply to Vladimir Sementsov-Ogievskiy

Okay...

I think that:

1. A lot of efforts (not only my, I think reviewing is already exceeded generation efforts) are made, it would be sad to lose them.

2. It's safe enough to apply only part of generated patches: we just fix error_abort/error_fatal in more popular subsystems, what's wrong with that? Why not to cover 80% cases by 20% efforts?

3. It's obviously impossible to merge the whole series. A lot of time passed, series diverges.

So I propose the following plan:

1. I resend small separate series of preparation patches per maintainer. They are good anyway.

2. We commit patch with macro (changing MUST to SHOULD in documentation) and coccinelle script. (or that may be combined with the first series from [3.])

3. When one of preparations taken to maintainer's tree, I send generated patches for its maintainer.

If no objections during a week, I'll start that plan, hope someone will support it.

Quoted 1,056 lines · Vladimir Sementsov-Ogievskiy

Finally, what is the plan?

Markus what do you think?

Now a lot of patches are reviewed, but a lot of are not.

Is there any hope that all patches will be reviewed? Should I resend the whole series, or may be reduce it to reviewed subsystems only?

Quoted 1,044 lines · Vladimir Sementsov-Ogievskiy

Hi all!

At the request of Markus: full version of errp propagation. Let's look at it. Cover as much as possible, except inserting macro invocation where it's not necessary.

It's huge, and so it's an RFC.

In v5 I've added a lot more preparation cleanups:
01-23 are preparation cleanups
   01: not changed, keep Eric's r-b
   02: improve commit msg [Markus], keep Eric's r-b
   03: changed, only error API here, drop r-b
24 is core macro
   - improve cover letter, wording and macro code style
   - keep Eric's r-b
25-26: automation scripts
    - commit-per-subsystem changed a lot. it's a draft, don't bother too much with it
    - coccinelle: add support of error_propagate_prepend

27-126: generated patches

====

Here is a proposal of auto propagation for local_err, to not call error_propagate on every exit point, when we deal with local_err.

There are also two issues with errp:

1. error_fatal & error_append_hint/error_prepend: user can't see this additional info, because exit() happens in error_setg earlier than info is added. [Reported by Greg Kurz]

2. error_abort & error_propagate: when we wrap
error_abort by local_err+error_propagate, resulting coredump will refer to error_propagate and not to the place where error happened. (the macro itself don't fix the issue, but it allows to [3.] drop all local_err+error_propagate pattern, which will definitely fix the issue) [Reported by Kevin Wolf]

====

Generated patches split:

misc
    hw/misc/ivshmem.c
    hw/misc/tmp105.c
    hw/misc/tmp421.c
s390x
    hw/intc/s390_flic_kvm.c
    hw/s390x/3270-ccw.c
    hw/s390x/css-bridge.c
    hw/s390x/css.c
    hw/s390x/s390-skeys.c
    hw/s390x/s390-virtio-ccw.c
    hw/s390x/sclp.c
    hw/s390x/tod-kvm.c
    hw/vfio/ccw.c
    target/s390x/cpu.c
tcg
    exec.c
    hw/arm/armv7m.c
    hw/arm/smmu-common.c
    hw/arm/smmuv3.c
    hw/cpu/a15mpcore.c
    hw/cpu/a9mpcore.c
    hw/cpu/arm11mpcore.c
    hw/i386/pc.c
    hw/intc/nios2_iic.c
    hw/mips/cps.c
    hw/riscv/riscv_hart.c
    hw/riscv/sifive_e.c
    hw/riscv/sifive_u.c
    hw/sd/milkymist-memcard.c
    target/alpha/cpu.c
    target/arm/cpu.c
    target/arm/cpu64.c
    target/cris/cpu.c
    target/hppa/cpu.c
    target/i386/cpu.c
    target/lm32/cpu.c
    target/m68k/cpu.c
    target/microblaze/cpu.c
    target/mips/cpu.c
    target/moxie/cpu.c
    target/nios2/cpu.c
    target/openrisc/cpu.c
    target/ppc/compat.c
    target/ppc/translate_init.inc.c
    target/riscv/cpu.c
    target/sh4/cpu.c
    target/sparc/cpu.c
    target/tricore/cpu.c
    target/unicore32/cpu.c
    target/xtensa/cpu.c
kvm
    target/ppc/kvm.c
    target/s390x/cpu_models.c
xen
    hw/block/dataplane/xen-block.c
    hw/block/xen-block.c
    hw/xen/xen-backend.c
    hw/xen/xen-bus.c
    hw/xen/xen-host-pci-device.c
    hw/xen/xen_pt.c
    hw/xen/xen_pt_config_init.c
Hosts
    qga/commands-win32.c
    util/oslib-posix.c
ARM Machines
    hw/arm/allwinner-a10.c
    hw/arm/aspeed_soc.c
    hw/arm/bcm2835_peripherals.c
    hw/arm/bcm2836.c
    hw/arm/digic.c
    hw/arm/fsl-imx25.c
    hw/arm/fsl-imx31.c
    hw/arm/fsl-imx6.c
    hw/arm/integratorcp.c
    hw/arm/msf2-soc.c
    hw/arm/nrf51_soc.c
    hw/arm/stm32f205_soc.c
    hw/arm/virt.c
    hw/arm/xlnx-versal-virt.c
    hw/arm/xlnx-zynqmp.c
    hw/cpu/realview_mpcore.c
    hw/display/bcm2835_fb.c
    hw/dma/bcm2835_dma.c
    hw/dma/xilinx_axidma.c
    hw/gpio/aspeed_gpio.c
    hw/gpio/bcm2835_gpio.c
    hw/intc/arm_gic.c
    hw/intc/arm_gic_kvm.c
    hw/intc/arm_gicv3.c
    hw/intc/arm_gicv3_its_kvm.c
    hw/intc/arm_gicv3_kvm.c
    hw/intc/armv7m_nvic.c
    hw/intc/realview_gic.c
    hw/microblaze/xlnx-zynqmp-pmu.c
    hw/misc/bcm2835_mbox.c
    hw/misc/bcm2835_property.c
    hw/misc/msf2-sysreg.c
    hw/net/xilinx_axienet.c
    hw/nvram/nrf51_nvm.c
    hw/timer/aspeed_timer.c
    hw/watchdog/wdt_aspeed.c
MIPS Machines
    hw/core/loader-fit.c
PowerPC Machines
    hw/intc/pnv_xive.c
    hw/intc/xics.c
    hw/intc/xics_kvm.c
    hw/intc/xics_pnv.c
    hw/intc/xics_spapr.c
    hw/isa/pc87312.c
    hw/misc/macio/macio.c
    hw/ppc/e500.c
    hw/ppc/mac_newworld.c
    hw/ppc/pnv.c
    hw/ppc/pnv_core.c
    hw/ppc/pnv_homer.c
    hw/ppc/pnv_lpc.c
    hw/ppc/pnv_occ.c
    hw/ppc/pnv_psi.c
    hw/ppc/spapr.c
    hw/ppc/spapr_caps.c
    hw/ppc/spapr_cpu_core.c
    hw/ppc/spapr_drc.c
    hw/ppc/spapr_irq.c
    hw/ppc/spapr_pci.c
    hw/ppc/spapr_vio.c
SPARC Machines
    hw/sparc/sun4m.c
    hw/sparc64/sun4u.c
S390 Machines
    hw/s390x/ipl.c
    hw/s390x/s390-pci-bus.c
X86 Machines
    hw/acpi/ich9.c
    hw/char/debugcon.c
    hw/char/serial-pci-multi.c
    hw/char/serial-pci.c
    hw/core/machine.c
    hw/core/numa.c
    hw/intc/apic_common.c
    hw/pci-host/piix.c
IDE
    hw/ide/qdev.c
Floppy
    hw/block/fdc.c
IPack
    hw/ipack/ipack.c
PCI
    hw/pci-bridge/gen_pcie_root_port.c
    hw/pci-bridge/pci_bridge_dev.c
    hw/pci-bridge/pci_expander_bridge.c
    hw/pci-bridge/pcie_pci_bridge.c
    hw/pci-bridge/pcie_root_port.c
    hw/pci/pci.c
    hw/pci/pcie.c
    hw/pci/shpc.c
ACPI/SMBIOS
    hw/acpi/core.c
    hw/acpi/cpu_hotplug.c
    hw/acpi/memory_hotplug.c
    hw/mem/memory-device.c
    hw/mem/pc-dimm.c
    hw/smbios/smbios.c
Network devices
    hw/net/dp8393x.c
    hw/net/ne2000-isa.c
pflash
    hw/block/pflash_cfi01.c
    hw/block/pflash_cfi02.c
SCSI
    hw/scsi/esp-pci.c
    hw/scsi/mptsas.c
    hw/scsi/scsi-bus.c
    hw/scsi/scsi-disk.c
    hw/scsi/scsi-generic.c
    hw/scsi/virtio-scsi.c
SD (Secure Card)
    hw/sd/sdhci-pci.c
    hw/sd/sdhci.c
USB
    hw/usb/bus.c
    hw/usb/ccid-card-emulated.c
    hw/usb/dev-smartcard-reader.c
    hw/usb/dev-storage.c
    hw/usb/hcd-ohci-pci.c
    hw/usb/hcd-ohci.c
    hw/usb/hcd-uhci.c
    hw/usb/hcd-xhci.c
USB (serial adapter)
    hw/usb/dev-serial.c
VFIO
    hw/vfio/common.c
    hw/vfio/pci-quirks.c
    hw/vfio/pci.c
    hw/vfio/platform.c
vfio-ccw
    hw/s390x/s390-ccw.c
vhost
    hw/block/vhost-user-blk.c
    hw/scsi/vhost-scsi.c
    hw/scsi/vhost-user-scsi.c
    hw/virtio/vhost-vsock.c
virtio
    hw/virtio/virtio-balloon.c
    hw/virtio/virtio-bus.c
    hw/virtio/virtio-pci.c
    hw/virtio/virtio-rng-pci.c
    hw/virtio/virtio.c
virtio-9p
    hw/9pfs/9p-local.c
    hw/9pfs/9p.c
virtio-blk
    hw/block/dataplane/virtio-blk.c
    hw/block/virtio-blk.c
virtio-ccw
    hw/s390x/virtio-ccw-crypto.c
    hw/s390x/virtio-ccw-rng.c
    hw/s390x/virtio-ccw.c
virtio-input
    hw/input/virtio-input.c
virtio-serial
    hw/char/virtio-serial-bus.c
virtio-rng
    backends/rng.c
    hw/virtio/virtio-rng.c
megasas
    hw/scsi/megasas.c
NVDIMM
    hw/mem/nvdimm.c
eepro100
    hw/net/eepro100.c
virtio-gpu
    hw/display/virtio-gpu-base.c
    hw/display/virtio-gpu-pci.c
    hw/display/virtio-vga.c
fw_cfg
    hw/nvram/fw_cfg.c
XIVE
    hw/intc/spapr_xive.c
    hw/intc/spapr_xive_kvm.c
    hw/intc/xive.c
Audio
    audio/audio.c
    hw/audio/intel-hda.c
block
    block.c
    block/backup.c
    block/block-backend.c
    block/commit.c
    block/crypto.c
    block/dirty-bitmap.c
    block/io.c
    block/mirror.c
    block/qapi.c
    block/snapshot.c
    block/throttle-groups.c
    block/throttle.c
    block/vxhs.c
    blockdev.c
    blockjob.c
    hw/block/onenand.c
    job.c
scsi
    scsi/pr-manager-helper.c
chardev
    chardev/char-socket.c
    chardev/char.c
    chardev/spice.c
cmdline
    util/qemu-option.c
Dump
    dump/dump.c
    dump/win_dump.c
Memory API
    memory.c
SPICE
    hw/display/qxl.c
Graphics
    ui/input-barrier.c
    ui/input.c
    ui/vnc.c
Main loop
    util/main-loop.c
    vl.c
Human Monitor (HMP)
    monitor/misc.c
net
    net/can/can_host.c
    net/dump.c
    net/filter-buffer.c
    net/filter.c
    net/net.c
    net/netmap.c
    net/tap.c
hostmem
    backends/hostmem-file.c
    backends/hostmem-memfd.c
    backends/hostmem.c
cryptodev
    backends/cryptodev-vhost-user.c
    backends/cryptodev.c
QAPI
    qapi/qapi-visit-core.c
    qapi/qmp-dispatch.c
    qapi/string-input-visitor.c
qga
    qga/commands-posix.c
QOM
    hw/core/qdev-properties-system.c
    hw/core/qdev-properties.c
    hw/core/qdev.c
    qdev-monitor.c
    qom/object.c
    qom/object_interfaces.c
    qom/qom-qobject.c
QMP
    monitor/qmp-cmds.c
SLIRP
    net/slirp.c
Tracing
    trace/qmp.c
TPM
    hw/tpm/tpm_util.c
    tpm.c
Migration
    migration/migration.c
    migration/ram.c
    migration/rdma.c
    migration/savevm.c
    migration/socket.c
Cryptography
    crypto/block-luks.c
    crypto/secret.c
    crypto/tlssession.c
I/O Channels
    io/dns-resolver.c
    io/net-listener.c
Sockets
    util/qemu-sockets.c
colo
    migration/colo.c
Record/replay
    block/blkreplay.c
VMDK
    block/vmdk.c
RBD
    block/rbd.c
Sheepdog
    block/sheepdog.c
VHDX
    block/vhdx-log.c
    block/vhdx.c
VDI
    block/vdi.c
iSCSI
    block/iscsi.c
nbd
    include/block/nbd.h
    block/nbd.c
    nbd/client.c
    nbd/server.c
NFS
    block/nfs.c
SSH
    block/ssh.c
CURL
    block/curl.c
GLUSTER
    block/gluster.c
NVMe Block Driver
    block/nvme.c
Bootdevice
    bootdevice.c
Quorum
    block/quorum.c
blklogwrites
    block/blklogwrites.c
blkverify
    block/blkverify.c
parallels
    block/parallels.c
qed
    block/qed.c
raw
    block/file-posix.c
    block/file-win32.c
    block/raw-format.c
qcow2
    block/qcow2-bitmap.c
    block/qcow2.c
qcow
    block/qcow.c
blkdebug
    block/blkdebug.c
vpc
    block/vpc.c
vvfat
    block/vvfat.c
Replication
    block/replication.c
    replication.c
PVRDMA
    hw/rdma/vmw/pvrdma_main.c
hw/core/bus.c
    hw/core/bus.c
hw/cpu/core.c
    hw/cpu/core.c
hw/sd/ssi-sd.c
    hw/sd/ssi-sd.c
iothread.c
    iothread.c
memory_mapping.c
    memory_mapping.c
target/tilegx/cpu.c
    target/tilegx/cpu.c
tests/test-image-locking.c
    tests/test-image-locking.c
util/qemu-config.c
    util/qemu-config.c

Vladimir Sementsov-Ogievskiy (126):
   hw/core/loader-fit: fix freeing errp in fit_load_fdt net/net: Clean up variable shadowing in net_client_init()
   error: rename errp to errp_in where it is IN-argument
   hmp: drop Error pointer indirection in hmp_handle_error
   vnc: drop Error pointer indirection in vnc_client_io_error
   qdev-monitor: well form error hint helpers
   nbd: well form nbd_iter_channel_error errp handler
   ppc: well form kvmppc_hint_smt_possible error hint helper 9pfs: well form error hint helpers
   hw/core/qdev: cleanup Error ** variables
   block/snapshot: rename Error ** parameter to more common errp hw/i386/amd_iommu: rename Error ** parameter to more common errp
   qga: rename Error ** parameter to more common errp monitor/qmp-cmds: rename Error ** parameter to more common errp hw/s390x: rename Error ** parameter to more common errp hw/sd: rename Error ** parameter to more common errp hw/tpm: rename Error ** parameter to more common errp hw/usb: rename Error ** parameter to more common errp include/block/snapshot.h: rename Error ** parameter to more common errp
   include/qom/object.h: rename Error ** parameter to more common errp qapi/error: add (Error **errp) cleaning APIs backends/cryptodev: drop local_err from cryptodev_backend_complete() hw/vfio/ap: drop local_err from vfio_ap_realize
   error: auto propagated local_err
   scripts: add coccinelle script to use auto propagated errp
   python: add commit-per-subsystem.py
   misc: introduce ERRP_AUTO_PROPAGATE
   s390x: introduce ERRP_AUTO_PROPAGATE
   tcg: introduce ERRP_AUTO_PROPAGATE
   kvm: introduce ERRP_AUTO_PROPAGATE
   xen: introduce ERRP_AUTO_PROPAGATE
   Hosts: introduce ERRP_AUTO_PROPAGATE
   ARM Machines: introduce ERRP_AUTO_PROPAGATE
   MIPS Machines: introduce ERRP_AUTO_PROPAGATE
   PowerPC Machines: introduce ERRP_AUTO_PROPAGATE
   SPARC Machines: introduce ERRP_AUTO_PROPAGATE
   S390 Machines: introduce ERRP_AUTO_PROPAGATE
   X86 Machines: introduce ERRP_AUTO_PROPAGATE
   IDE: introduce ERRP_AUTO_PROPAGATE
   Floppy: introduce ERRP_AUTO_PROPAGATE
   IPack: introduce ERRP_AUTO_PROPAGATE
   PCI: introduce ERRP_AUTO_PROPAGATE
   ACPI/SMBIOS: introduce ERRP_AUTO_PROPAGATE
   Network devices: introduce ERRP_AUTO_PROPAGATE
   pflash: introduce ERRP_AUTO_PROPAGATE
   SCSI: introduce ERRP_AUTO_PROPAGATE
   SD (Secure Card): introduce ERRP_AUTO_PROPAGATE
   USB: introduce ERRP_AUTO_PROPAGATE
   USB (serial adapter): introduce ERRP_AUTO_PROPAGATE
   VFIO: introduce ERRP_AUTO_PROPAGATE
   vfio-ccw: introduce ERRP_AUTO_PROPAGATE
   vhost: introduce ERRP_AUTO_PROPAGATE
   virtio: introduce ERRP_AUTO_PROPAGATE
   virtio-9p: introduce ERRP_AUTO_PROPAGATE
   virtio-blk: introduce ERRP_AUTO_PROPAGATE
   virtio-ccw: introduce ERRP_AUTO_PROPAGATE
   virtio-input: introduce ERRP_AUTO_PROPAGATE
   virtio-serial: introduce ERRP_AUTO_PROPAGATE
   virtio-rng: introduce ERRP_AUTO_PROPAGATE
   megasas: introduce ERRP_AUTO_PROPAGATE
   NVDIMM: introduce ERRP_AUTO_PROPAGATE
   eepro100: introduce ERRP_AUTO_PROPAGATE
   virtio-gpu: introduce ERRP_AUTO_PROPAGATE
   fw_cfg: introduce ERRP_AUTO_PROPAGATE
   XIVE: introduce ERRP_AUTO_PROPAGATE
   Audio: introduce ERRP_AUTO_PROPAGATE
   block: introduce ERRP_AUTO_PROPAGATE
   scsi: introduce ERRP_AUTO_PROPAGATE
   chardev: introduce ERRP_AUTO_PROPAGATE
   cmdline: introduce ERRP_AUTO_PROPAGATE
   Dump: introduce ERRP_AUTO_PROPAGATE
   Memory API: introduce ERRP_AUTO_PROPAGATE
   SPICE: introduce ERRP_AUTO_PROPAGATE
   Graphics: introduce ERRP_AUTO_PROPAGATE
   Main loop: introduce ERRP_AUTO_PROPAGATE
   Human Monitor (HMP): introduce ERRP_AUTO_PROPAGATE
   net: introduce ERRP_AUTO_PROPAGATE
   hostmem: introduce ERRP_AUTO_PROPAGATE
   cryptodev: introduce ERRP_AUTO_PROPAGATE
   QAPI: introduce ERRP_AUTO_PROPAGATE
   qga: introduce ERRP_AUTO_PROPAGATE
   QOM: introduce ERRP_AUTO_PROPAGATE
   QMP: introduce ERRP_AUTO_PROPAGATE
   SLIRP: introduce ERRP_AUTO_PROPAGATE
   Tracing: introduce ERRP_AUTO_PROPAGATE
   TPM: introduce ERRP_AUTO_PROPAGATE
   Migration: introduce ERRP_AUTO_PROPAGATE
   Cryptography: introduce ERRP_AUTO_PROPAGATE
   I/O Channels: introduce ERRP_AUTO_PROPAGATE
   Sockets: introduce ERRP_AUTO_PROPAGATE
   colo: introduce ERRP_AUTO_PROPAGATE
   Record/replay: introduce ERRP_AUTO_PROPAGATE
   VMDK: introduce ERRP_AUTO_PROPAGATE
   RBD: introduce ERRP_AUTO_PROPAGATE
   Sheepdog: introduce ERRP_AUTO_PROPAGATE
   VHDX: introduce ERRP_AUTO_PROPAGATE
   VDI: introduce ERRP_AUTO_PROPAGATE
   iSCSI: introduce ERRP_AUTO_PROPAGATE
   nbd: introduce ERRP_AUTO_PROPAGATE
   NFS: introduce ERRP_AUTO_PROPAGATE
   SSH: introduce ERRP_AUTO_PROPAGATE
   CURL: introduce ERRP_AUTO_PROPAGATE
   GLUSTER: introduce ERRP_AUTO_PROPAGATE
   NVMe Block Driver: introduce ERRP_AUTO_PROPAGATE
   Bootdevice: introduce ERRP_AUTO_PROPAGATE
   Quorum: introduce ERRP_AUTO_PROPAGATE
   blklogwrites: introduce ERRP_AUTO_PROPAGATE
   blkverify: introduce ERRP_AUTO_PROPAGATE
   parallels: introduce ERRP_AUTO_PROPAGATE
   qed: introduce ERRP_AUTO_PROPAGATE

   raw: introduce ERRP_AUTO_PROPAGATE

   qcow2: introduce ERRP_AUTO_PROPAGATE
   qcow: introduce ERRP_AUTO_PROPAGATE
   blkdebug: introduce ERRP_AUTO_PROPAGATE
   vpc: introduce ERRP_AUTO_PROPAGATE
   vvfat: introduce ERRP_AUTO_PROPAGATE
   Replication: introduce ERRP_AUTO_PROPAGATE
   PVRDMA: introduce ERRP_AUTO_PROPAGATE hw/core/bus.c: introduce ERRP_AUTO_PROPAGATE hw/cpu/core.c: introduce ERRP_AUTO_PROPAGATE hw/sd/ssi-sd.c: introduce ERRP_AUTO_PROPAGATE iothread.c: introduce ERRP_AUTO_PROPAGATE memory_mapping.c: introduce ERRP_AUTO_PROPAGATE target/tilegx/cpu.c: introduce ERRP_AUTO_PROPAGATE tests/test-image-locking.c: introduce ERRP_AUTO_PROPAGATE util/qemu-config.c: introduce ERRP_AUTO_PROPAGATE

CC Gerd Hoffmann <[email protected]>
CC "Gonglei (Arei)" <[email protected]>
CC Eduardo Habkost <[email protected]>
CC Igor Mammedov <[email protected]>
CC Laurent Vivier <[email protected]>
CC Amit Shah <[email protected]>
CC Kevin Wolf <[email protected]>
CC Max Reitz <[email protected]>
CC John Snow <[email protected]>
CC Ari Sundholm <[email protected]>
CC Pavel Dovgalyuk <[email protected]>
CC Paolo Bonzini <[email protected]>
CC Stefan Hajnoczi <[email protected]>
CC Fam Zheng <[email protected]>
CC Stefan Weil <[email protected]>
CC Ronnie Sahlberg <[email protected]>
CC Peter Lieven <[email protected]>
CC Eric Blake <[email protected]>
CC "Denis V. Lunev" <[email protected]>
CC Markus Armbruster <[email protected]>
CC Alberto Garcia <[email protected]>
CC Jason Dillaman <[email protected]>
CC Wen Congyang <[email protected]>
CC Xie Changlong <[email protected]>
CC Liu Yuan <[email protected]>
CC "Richard W.M. Jones" <[email protected]>
CC Jeff Cody <[email protected]>
CC "Marc-André Lureau" <[email protected]>
CC "Daniel P. Berrangé" <[email protected]>
CC Richard Henderson <[email protected]>
CC Greg Kurz <[email protected]>
CC "Michael S. Tsirkin" <[email protected]>
CC Marcel Apfelbaum <[email protected]>
CC Beniamino Galvani <[email protected]>
CC Peter Maydell <[email protected]>
CC "Cédric Le Goater" <[email protected]>
CC Andrew Jeffery <[email protected]>
CC Joel Stanley <[email protected]>
CC Andrew Baumann <[email protected]>
CC "Philippe Mathieu-Daudé" <[email protected]>
CC Antony Pavlov <[email protected]>
CC Jean-Christophe Dubois <[email protected]>
CC Peter Chubb <[email protected]>
CC Subbaraya Sundeep <[email protected]>
CC Eric Auger <[email protected]>
CC Alistair Francis <[email protected]>
CC "Edgar E. Iglesias" <[email protected]>
CC Stefano Stabellini <[email protected]>
CC Anthony Perard <[email protected]>
CC Paul Durrant <[email protected]>
CC Paul Burton <[email protected]>
CC Aleksandar Rikalo <[email protected]>
CC Chris Wulff <[email protected]>
CC Marek Vasut <[email protected]>
CC David Gibson <[email protected]>
CC Cornelia Huck <[email protected]>
CC Halil Pasic <[email protected]>
CC Christian Borntraeger <[email protected]>
CC "Hervé Poussineau" <[email protected]>
CC Xiao Guangrong <[email protected]>
CC Aurelien Jarno <[email protected]>
CC Aleksandar Markovic <[email protected]>
CC Mark Cave-Ayland <[email protected]>
CC Jason Wang <[email protected]>
CC Laszlo Ersek <[email protected]>
CC Yuval Shaia <[email protected]>
CC Palmer Dabbelt <[email protected]>
CC Sagar Karandikar <[email protected]>
CC Bastian Koppelmann <[email protected]>
CC David Hildenbrand <[email protected]>
CC Thomas Huth <[email protected]>
CC Eric Farman <[email protected]>
CC Matthew Rosato <[email protected]>
CC Hannes Reinecke <[email protected]>
CC Michael Walle <[email protected]>
CC Artyom Tarasenko <[email protected]>
CC Stefan Berger <[email protected]>
CC Samuel Thibault <[email protected]>
CC Alex Williamson <[email protected]>
CC Tony Krowiak <[email protected]>
CC Pierre Morel <[email protected]>
CC Michael Roth <[email protected]>
CC Hailiang Zhang <[email protected]>
CC Juan Quintela <[email protected]>
CC "Dr. David Alan Gilbert" <[email protected]>
CC Luigi Rizzo <[email protected]>
CC Giuseppe Lettieri <[email protected]>
CC Vincenzo Maffione <[email protected]>
CC Jan Kiszka <[email protected]>
CC Anthony Green <[email protected]>
CC Stafford Horne <[email protected]>
CC Guan Xuetao <[email protected]>
CC Max Filippov <[email protected]>

  include/block/nbd.h                           |   1 + include/block/snapshot.h                      |   2 +- include/monitor/hmp.h                         |   2 +-

  include/qapi/error.h                          |  69 ++++-
  include/qom/object.h                          |   4 +-
  target/ppc/kvm_ppc.h                          |   4 +-

  ui/vnc.h                                      |   2 +- audio/audio.c                                 |  12 +- backends/cryptodev-vhost-user.c               |  10 +- backends/cryptodev.c                          |  25 +- backends/hostmem-file.c                       |  21 +- backends/hostmem-memfd.c                      |  18 +- backends/hostmem.c                            |  41 ++- backends/rng.c                                |   7 +- block.c                                       | 225 +++++++--------- block/backup.c                                |   1 + block/blkdebug.c                              |  36 ++- block/blklogwrites.c                          |  22 +- block/blkreplay.c                             |   7 +- block/blkverify.c                             |  17 +- block/block-backend.c                         |  19 +- block/commit.c                                |   7 +- block/crypto.c                                |  14 +- block/curl.c                                  |   7 +- block/dirty-bitmap.c                          |   1 + block/file-posix.c                            |  79 +++--- block/file-win32.c                            |  29 +- block/gluster.c                               |  69 +++-- block/io.c                                    |  12 +- block/iscsi.c                                 |  36 ++- block/mirror.c                                |  19 +- block/nbd.c                                   |  59 ++-- block/nfs.c                                   |   7 +- block/nvme.c                                  |  19 +- block/parallels.c                             |  30 +-- block/qapi.c                                  |  26 +- block/qcow.c                                  |  17 +- block/qcow2-bitmap.c                          |   9 +- block/qcow2.c                                 |  98 +++---- block/qed.c                                   |  18 +- block/quorum.c                                |  23 +- block/raw-format.c                            |   7 +- block/rbd.c                                   |  29 +- block/replication.c                           |  40 ++- block/sheepdog.c                              |  73 +++-- block/snapshot.c                              |  20 +- block/ssh.c                                   |  12 +- block/throttle-groups.c                       |  24 +- block/throttle.c                              |   7 +- block/vdi.c                                   |  15 +- block/vhdx-log.c                              |   1 + block/vhdx.c                                  |  22 +- block/vmdk.c                                  |  41 ++- block/vpc.c                                   |  28 +- block/vvfat.c                                 |  12 +- block/vxhs.c                                  |  23 +- blockdev.c                                    | 252 ++++++++---------- blockjob.c                                    |   8 +- bootdevice.c                                  |  31 +-- chardev/char-socket.c                         |   7 +- chardev/char.c                                |  20 +- chardev/spice.c                               |   1 + crypto/block-luks.c                           |  56 ++-- crypto/secret.c                               |  17 +- crypto/tlssession.c                           |   7 +- dump/dump-hmp-cmds.c                          |   4 +- dump/dump.c                                   | 151 +++++------ dump/win_dump.c                               |  29 +- exec.c                                        |  21 +- hw/9pfs/9p-local.c                            |  12 +- hw/9pfs/9p-proxy.c                            |   5 +- hw/9pfs/9p.c                                  |   1 + hw/acpi/core.c                                |  18 +- hw/acpi/cpu_hotplug.c                         |   2 +- hw/acpi/ich9.c                                |  30 +-- hw/acpi/memory_hotplug.c                      |   7 +- hw/arm/allwinner-a10.c                        |  27 +- hw/arm/armv7m.c                               |  52 ++-- hw/arm/aspeed_soc.c                           |   1 + hw/arm/bcm2835_peripherals.c                  |  85 +++--- hw/arm/bcm2836.c                              |  41 ++- hw/arm/digic.c                                |  22 +- hw/arm/fsl-imx25.c                            |  62 ++--- hw/arm/fsl-imx31.c                            |  57 ++-- hw/arm/fsl-imx6.c                             |  81 +++--- hw/arm/integratorcp.c                         |   7 +- hw/arm/msf2-soc.c                             |  22 +- hw/arm/nrf51_soc.c                            |  47 ++-- hw/arm/smmu-common.c                          |   7 +- hw/arm/smmuv3.c                               |   7 +- hw/arm/stm32f205_soc.c                        |  39 ++- hw/arm/virt.c                                 |   2 + hw/arm/xlnx-versal-virt.c                     |   7 +- hw/arm/xlnx-zynqmp.c                          |  86 +++--- hw/audio/intel-hda.c                          |  13 +- hw/block/dataplane/virtio-blk.c               |   1 + hw/block/dataplane/xen-block.c                |  17 +- hw/block/fdc.c                                |  19 +- hw/block/onenand.c                            |   7 +- hw/block/pflash_cfi01.c                       |   7 +- hw/block/pflash_cfi02.c                       |   7 +- hw/block/vhost-user-blk.c                     |   6 +- hw/block/virtio-blk.c                         |   7 +- hw/block/xen-block.c                          | 119 ++++----- hw/char/debugcon.c                            |   7 +- hw/char/serial-pci-multi.c                    |   7 +- hw/char/serial-pci.c                          |   7 +- hw/char/virtio-serial-bus.c                   |   7 +- hw/core/bus.c                                 |  15 +- hw/core/loader-fit.c                          |   7 +- hw/core/machine-hmp-cmds.c                    |   6 +- hw/core/machine.c                             |  21 +- hw/core/numa.c                                |  51 ++-- hw/core/qdev-properties-system.c              |  28 +- hw/core/qdev-properties.c                     |  89 +++---- hw/core/qdev.c                                |  58 ++-- hw/cpu/a15mpcore.c                            |   7 +- hw/cpu/a9mpcore.c                             |  27 +- hw/cpu/arm11mpcore.c                          |  22 +- hw/cpu/core.c                                 |  14 +- hw/cpu/realview_mpcore.c                      |  12 +- hw/display/bcm2835_fb.c                       |   6 +- hw/display/qxl.c                              |   7 +- hw/display/virtio-gpu-base.c                  |   7 +- hw/display/virtio-gpu-pci.c                   |   7 +- hw/display/virtio-vga.c                       |   7 +- hw/dma/bcm2835_dma.c                          |   6 +- hw/dma/xilinx_axidma.c                        |  22 +- hw/gpio/aspeed_gpio.c                         |   7 +- hw/gpio/bcm2835_gpio.c                        |  10 +- hw/i386/amd_iommu.c                           |  14 +- hw/i386/pc.c                                  | 120 ++++----- hw/ide/qdev.c                                 |  16 +- hw/input/virtio-input.c                       |  14 +- hw/intc/apic_common.c                         |   7 +- hw/intc/arm_gic.c                             |   7 +- hw/intc/arm_gic_kvm.c                         |  12 +- hw/intc/arm_gicv3.c                           |  12 +- hw/intc/arm_gicv3_its_kvm.c                   |   7 +- hw/intc/arm_gicv3_kvm.c                       |  17 +- hw/intc/armv7m_nvic.c                         |  12 +- hw/intc/nios2_iic.c                           |   6 +- hw/intc/pnv_xive.c                            |  15 +- hw/intc/realview_gic.c                        |   7 +- hw/intc/s390_flic_kvm.c                       |   9 +- hw/intc/spapr_xive.c                          |  12 +- hw/intc/spapr_xive_kvm.c                      |  55 ++-- hw/intc/xics.c                                |  28 +- hw/intc/xics_kvm.c                            |  30 +-- hw/intc/xics_pnv.c                            |   7 +- hw/intc/xics_spapr.c                          |   7 +- hw/intc/xive.c                                |  27 +- hw/ipack/ipack.c                              |   5 +- hw/isa/pc87312.c                              |   7 +- hw/mem/memory-device.c                        |  20 +- hw/mem/nvdimm.c                               |  25 +- hw/mem/pc-dimm.c                              |  23 +- hw/microblaze/xlnx-zynqmp-pmu.c               |  12 +- hw/mips/cps.c                                 |  46 ++-- hw/misc/bcm2835_mbox.c                        |   6 +- hw/misc/bcm2835_property.c                    |  10 +- hw/misc/ivshmem.c                             |  37 ++- hw/misc/macio/macio.c                         |  68 ++--- hw/misc/msf2-sysreg.c                         |   1 +

  hw/misc/tmp105.c                              |   7 +-
  hw/misc/tmp421.c                              |   7 +-
  hw/net/dp8393x.c                              |   7 +-

  hw/net/eepro100.c                             |   7 +- hw/net/ne2000-isa.c                           |  17 +- hw/net/xilinx_axienet.c                       |  22 +- hw/nvram/fw_cfg.c                             |  14 +- hw/nvram/nrf51_nvm.c                          |   7 +- hw/pci-bridge/gen_pcie_root_port.c            |   7 +- hw/pci-bridge/pci_bridge_dev.c                |  13 +- hw/pci-bridge/pci_expander_bridge.c           |   7 +- hw/pci-bridge/pcie_pci_bridge.c               |   8 +- hw/pci-bridge/pcie_root_port.c                |   1 + hw/pci-host/piix.c                            |   7 +- hw/pci/pci.c                                  |  19 +-

  hw/pci/pcie.c                                 |   7 +-
  hw/pci/shpc.c                                 |  14 +-
  hw/ppc/e500.c                                 |   7 +-

  hw/ppc/mac_newworld.c                         |   1 + hw/ppc/pnv.c                                  | 109 ++++---- hw/ppc/pnv_core.c                             |  23 +- hw/ppc/pnv_homer.c                            |   5 +-

  hw/ppc/pnv_lpc.c                              |  26 +-
  hw/ppc/pnv_occ.c                              |   5 +-
  hw/ppc/pnv_psi.c                              |  23 +-
  hw/ppc/spapr.c                                | 133 ++++-----
  hw/ppc/spapr_caps.c                           |  57 ++--
  hw/ppc/spapr_cpu_core.c                       |  36 ++-
  hw/ppc/spapr_drc.c                            |  48 ++--
  hw/ppc/spapr_irq.c                            |  98 +++----
  hw/ppc/spapr_pci.c                            |  97 +++----
  hw/ppc/spapr_vio.c                            |  12 +-
  hw/rdma/vmw/pvrdma_main.c                     |   1 +
  hw/riscv/riscv_hart.c                         |   7 +-
  hw/riscv/sifive_e.c                           |   7 +-
  hw/riscv/sifive_u.c                           |  11 +-
  hw/s390x/3270-ccw.c                           |  13 +-

  hw/s390x/css-bridge.c                         |   7 +- hw/s390x/css.c                                |   7 +- hw/s390x/event-facility.c                     |   2 +- hw/s390x/ipl.c                                |  24 +- hw/s390x/s390-ccw.c                           |  19 +- hw/s390x/s390-pci-bus.c                       |  37 ++- hw/s390x/s390-skeys.c                         |   7 +- hw/s390x/s390-stattrib.c                      |   3 +- hw/s390x/s390-virtio-ccw.c                    |  11 +- hw/s390x/sclp.c                               |  15 +- hw/s390x/tod-kvm.c                            |  14 +- hw/s390x/virtio-ccw-crypto.c                  |   7 +- hw/s390x/virtio-ccw-rng.c                     |   7 +- hw/s390x/virtio-ccw.c                         |  13 +- hw/scsi/esp-pci.c                             |   7 +- hw/scsi/megasas.c                             |  11 +- hw/scsi/mptsas.c                              |  13 +- hw/scsi/scsi-bus.c                            |  24 +- hw/scsi/scsi-disk.c                           |   8 +- hw/scsi/scsi-generic.c                        |   1 + hw/scsi/vhost-scsi.c                          |  12 +- hw/scsi/vhost-user-scsi.c                     |   7 +- hw/scsi/virtio-scsi.c                         |   7 +- hw/sd/milkymist-memcard.c                     |  11 +- hw/sd/sdhci-pci.c                             |   7 +- hw/sd/sdhci.c                                 |  23 +- hw/sd/ssi-sd.c                                |  14 +- hw/smbios/smbios.c                            |  42 ++- hw/sparc/sun4m.c                              |  21 +- hw/sparc64/sun4u.c                            |   7 +- hw/timer/aspeed_timer.c                       |   6 +- hw/tpm/tpm_emulator.c                         |   8 +- hw/tpm/tpm_util.c                             |   7 +- hw/usb/bus.c                                  |  37 ++- hw/usb/ccid-card-emulated.c                   |   1 + hw/usb/dev-network.c                          |   2 +- hw/usb/dev-serial.c                           |   7 +- hw/usb/dev-smartcard-reader.c                 |  14 +- hw/usb/dev-storage.c                          |  17 +- hw/usb/hcd-ohci-pci.c                         |   7 +-

  hw/usb/hcd-ohci.c                             |  14 +-
  hw/usb/hcd-uhci.c                             |   7 +-
  hw/usb/hcd-xhci.c                             |  13 +-

  hw/vfio/ap.c                                  |  16 +- hw/vfio/ccw.c                                 |  24 +- hw/vfio/common.c                              |   3 + hw/vfio/pci-quirks.c                          |   8 +- hw/vfio/pci.c                                 |  42 ++- hw/vfio/platform.c                            |   1 + hw/virtio/vhost-vsock.c                       |   1 + hw/virtio/virtio-balloon.c                    |  35 ++- hw/virtio/virtio-bus.c                        |  17 +- hw/virtio/virtio-pci.c                        |   2 + hw/virtio/virtio-rng-pci.c                    |   7 +- hw/virtio/virtio-rng.c                        |   7 +- hw/virtio/virtio.c                            |  19 +- hw/watchdog/wdt_aspeed.c                      |   5 +- 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 +- io/dns-resolver.c                             |   7 +- io/net-listener.c                             |   7 +- iothread.c                                    |  27 +- job.c                                         |   7 +- memory.c                                      |  63 ++--- memory_mapping.c                              |   7 +- migration/colo.c                              |  38 ++- migration/migration.c                         |  39 ++- migration/ram.c                               |  13 +- migration/rdma.c                              |  13 +-

  migration/savevm.c                            |   2 +
  migration/socket.c                            |  18 +-
  monitor/hmp-cmds.c                            | 155 ++++++-----

  monitor/misc.c                                |   9 +- monitor/qmp-cmds.c                            |   9 +- nbd/client.c                                  |   5 + nbd/server.c                                  |   5 + net/can/can_host.c                            |   7 +- net/dump.c                                    |  15 +- net/filter-buffer.c                           |  15 +- net/filter.c                                  |   7 +- net/net.c                                     |  58 ++-- net/netmap.c                                  |   7 +- net/slirp.c                                   |   7 +- net/tap.c                                     |  47 ++-- qapi/qapi-visit-core.c                        |  56 ++-- qapi/qmp-dispatch.c                           |   7 +- qapi/string-input-visitor.c                   |   7 +- qdev-monitor.c                                |  69 +++-- qga/commands-posix.c                          | 222 +++++++-------- qga/commands-win32.c                          | 141 +++++----- qga/commands.c                                |  12 +- qom/object.c                                  | 246 ++++++++--------- qom/object_interfaces.c                       |  27 +- qom/qom-hmp-cmds.c                            |   4 +- qom/qom-qobject.c                             |   7 +- replication.c                                 |  28 +- scsi/pr-manager-helper.c                      |   7 +- target/alpha/cpu.c                            |   7 +- target/arm/cpu.c                              |   7 +- target/arm/cpu64.c                            |  11 +-

  target/cris/cpu.c                             |   7 +-
  target/hppa/cpu.c                             |   7 +-
  target/i386/cpu.c                             | 117 ++++----
  target/lm32/cpu.c                             |   7 +-
  target/m68k/cpu.c                             |   7 +-

  target/microblaze/cpu.c                       |   7 +- target/mips/cpu.c                             |   7 +- target/moxie/cpu.c                            |   7 +- target/nios2/cpu.c                            |   7 +- target/openrisc/cpu.c                         |   7 +- target/ppc/compat.c                           |  20 +- target/ppc/kvm.c                              |  14 +- target/ppc/translate_init.inc.c               |  26 +- target/riscv/cpu.c                            |   7 +- target/s390x/cpu.c                            |  26 +- target/s390x/cpu_models.c                     |   2 + target/sh4/cpu.c                              |   7 +- target/sparc/cpu.c                            |  14 +- target/tilegx/cpu.c                           |   7 +- target/tricore/cpu.c                          |   7 +- target/unicore32/cpu.c                        |   7 +- target/xtensa/cpu.c                           |   7 +- tests/test-image-locking.c                    |   7 +- tpm.c                                         |   7 +- trace/qmp.c                                   |  14 +- ui/input-barrier.c                            |   7 +- ui/input.c                                    |  14 +- ui/vnc.c                                      |  39 ++- util/error.c                                  |  30 +-- util/main-loop.c                              |   5 +-

  util/oslib-posix.c                            |   6 +-
  util/qemu-config.c                            |  29 +-
  util/qemu-option.c                            |  59 ++--

  util/qemu-sockets.c                           |  31 +-- vl.c                                          |  14 +- python/commit-per-subsystem.py                | 204 ++++++++++++++ scripts/coccinelle/auto-propagated-errp.cocci | 118 ++++++++

  341 files changed, 3851 insertions(+), 4455 deletions(-)

  create mode 100755 python/commit-per-subsystem.py create mode 100644 scripts/coccinelle/auto-propagated-errp.cocci

Signature · 2 lines
Best regards,
Vladimir
#208 lore raw
Quoted 17 lines · On Wed, 20 Nov 2019 09:50:54 +0000 Vladimir Sementsov-Ogievskiy…

Okay...

I think that:

1. A lot of efforts (not only my, I think reviewing is already exceeded generation efforts) are made, it would be sad to lose them.

2. It's safe enough to apply only part of generated patches: we just fix error_abort/error_fatal in more popular subsystems, what's wrong with that? Why not to cover 80% cases by 20% efforts?

3. It's obviously impossible to merge the whole series. A lot of time passed, series diverges.

So I propose the following plan:

1. I resend small separate series of preparation patches per maintainer. They are good anyway.

Quoted 9 lines

2. We commit patch with macro (changing MUST to SHOULD in documentation) and coccinelle script. (or that may be combined with the first series from [3.])

3. When one of preparations taken to maintainer's tree, I send generated patches for its maintainer.

If no objections during a week, I'll start that plan, hope someone will support it.

Hi Vladimir,

I support your plan and I will help this to go forward for 9pfs, PowerPC and XIVE. I'll start with pushing the preparatory patch for 9pfs to my 9p-next branch right away.

[RFC v5 009/126] 9pfs: well form error hint helpers

Cheers,

--
Greg

PS: my ISP's mail relay was unhappy with the huge recipient list, so I've
dropped all Cc: except qemu-devel. Sorry if some of the original recipients receive multiple copies of my previous mail...

Quoted 1,060 lines
Quoted 1,056 lines · Vladimir Sementsov-Ogievskiy

Finally, what is the plan?

Markus what do you think?

Now a lot of patches are reviewed, but a lot of are not.

Is there any hope that all patches will be reviewed? Should I resend the whole series, or may be reduce it to reviewed subsystems only?

Quoted 1,044 lines · Vladimir Sementsov-Ogievskiy

Hi all!

At the request of Markus: full version of errp propagation. Let's look at it. Cover as much as possible, except inserting macro invocation where it's not necessary.

It's huge, and so it's an RFC.

In v5 I've added a lot more preparation cleanups:
01-23 are preparation cleanups
   01: not changed, keep Eric's r-b
   02: improve commit msg [Markus], keep Eric's r-b
   03: changed, only error API here, drop r-b
24 is core macro
   - improve cover letter, wording and macro code style
   - keep Eric's r-b
25-26: automation scripts
    - commit-per-subsystem changed a lot. it's a draft, don't bother too much with it
    - coccinelle: add support of error_propagate_prepend

27-126: generated patches

====

Here is a proposal of auto propagation for local_err, to not call error_propagate on every exit point, when we deal with local_err.

There are also two issues with errp:

1. error_fatal & error_append_hint/error_prepend: user can't see this additional info, because exit() happens in error_setg earlier than info is added. [Reported by Greg Kurz]

2. error_abort & error_propagate: when we wrap
error_abort by local_err+error_propagate, resulting coredump will refer to error_propagate and not to the place where error happened. (the macro itself don't fix the issue, but it allows to [3.] drop all local_err+error_propagate pattern, which will definitely fix the issue) [Reported by Kevin Wolf]

====

Generated patches split:

misc
    hw/misc/ivshmem.c
    hw/misc/tmp105.c
    hw/misc/tmp421.c
s390x
    hw/intc/s390_flic_kvm.c
    hw/s390x/3270-ccw.c
    hw/s390x/css-bridge.c
    hw/s390x/css.c
    hw/s390x/s390-skeys.c
    hw/s390x/s390-virtio-ccw.c
    hw/s390x/sclp.c
    hw/s390x/tod-kvm.c
    hw/vfio/ccw.c
    target/s390x/cpu.c
tcg
    exec.c
    hw/arm/armv7m.c
    hw/arm/smmu-common.c
    hw/arm/smmuv3.c
    hw/cpu/a15mpcore.c
    hw/cpu/a9mpcore.c
    hw/cpu/arm11mpcore.c
    hw/i386/pc.c
    hw/intc/nios2_iic.c
    hw/mips/cps.c
    hw/riscv/riscv_hart.c
    hw/riscv/sifive_e.c
    hw/riscv/sifive_u.c
    hw/sd/milkymist-memcard.c
    target/alpha/cpu.c
    target/arm/cpu.c
    target/arm/cpu64.c
    target/cris/cpu.c
    target/hppa/cpu.c
    target/i386/cpu.c
    target/lm32/cpu.c
    target/m68k/cpu.c
    target/microblaze/cpu.c
    target/mips/cpu.c
    target/moxie/cpu.c
    target/nios2/cpu.c
    target/openrisc/cpu.c
    target/ppc/compat.c
    target/ppc/translate_init.inc.c
    target/riscv/cpu.c
    target/sh4/cpu.c
    target/sparc/cpu.c
    target/tricore/cpu.c
    target/unicore32/cpu.c
    target/xtensa/cpu.c
kvm
    target/ppc/kvm.c
    target/s390x/cpu_models.c
xen
    hw/block/dataplane/xen-block.c
    hw/block/xen-block.c
    hw/xen/xen-backend.c
    hw/xen/xen-bus.c
    hw/xen/xen-host-pci-device.c
    hw/xen/xen_pt.c
    hw/xen/xen_pt_config_init.c
Hosts
    qga/commands-win32.c
    util/oslib-posix.c
ARM Machines
    hw/arm/allwinner-a10.c
    hw/arm/aspeed_soc.c
    hw/arm/bcm2835_peripherals.c
    hw/arm/bcm2836.c
    hw/arm/digic.c
    hw/arm/fsl-imx25.c
    hw/arm/fsl-imx31.c
    hw/arm/fsl-imx6.c
    hw/arm/integratorcp.c
    hw/arm/msf2-soc.c
    hw/arm/nrf51_soc.c
    hw/arm/stm32f205_soc.c
    hw/arm/virt.c
    hw/arm/xlnx-versal-virt.c
    hw/arm/xlnx-zynqmp.c
    hw/cpu/realview_mpcore.c
    hw/display/bcm2835_fb.c
    hw/dma/bcm2835_dma.c
    hw/dma/xilinx_axidma.c
    hw/gpio/aspeed_gpio.c
    hw/gpio/bcm2835_gpio.c
    hw/intc/arm_gic.c
    hw/intc/arm_gic_kvm.c
    hw/intc/arm_gicv3.c
    hw/intc/arm_gicv3_its_kvm.c
    hw/intc/arm_gicv3_kvm.c
    hw/intc/armv7m_nvic.c
    hw/intc/realview_gic.c
    hw/microblaze/xlnx-zynqmp-pmu.c
    hw/misc/bcm2835_mbox.c
    hw/misc/bcm2835_property.c
    hw/misc/msf2-sysreg.c
    hw/net/xilinx_axienet.c
    hw/nvram/nrf51_nvm.c
    hw/timer/aspeed_timer.c
    hw/watchdog/wdt_aspeed.c
MIPS Machines
    hw/core/loader-fit.c
PowerPC Machines
    hw/intc/pnv_xive.c
    hw/intc/xics.c
    hw/intc/xics_kvm.c
    hw/intc/xics_pnv.c
    hw/intc/xics_spapr.c
    hw/isa/pc87312.c
    hw/misc/macio/macio.c
    hw/ppc/e500.c
    hw/ppc/mac_newworld.c
    hw/ppc/pnv.c
    hw/ppc/pnv_core.c
    hw/ppc/pnv_homer.c
    hw/ppc/pnv_lpc.c
    hw/ppc/pnv_occ.c
    hw/ppc/pnv_psi.c
    hw/ppc/spapr.c
    hw/ppc/spapr_caps.c
    hw/ppc/spapr_cpu_core.c
    hw/ppc/spapr_drc.c
    hw/ppc/spapr_irq.c
    hw/ppc/spapr_pci.c
    hw/ppc/spapr_vio.c
SPARC Machines
    hw/sparc/sun4m.c
    hw/sparc64/sun4u.c
S390 Machines
    hw/s390x/ipl.c
    hw/s390x/s390-pci-bus.c
X86 Machines
    hw/acpi/ich9.c
    hw/char/debugcon.c
    hw/char/serial-pci-multi.c
    hw/char/serial-pci.c
    hw/core/machine.c
    hw/core/numa.c
    hw/intc/apic_common.c
    hw/pci-host/piix.c
IDE
    hw/ide/qdev.c
Floppy
    hw/block/fdc.c
IPack
    hw/ipack/ipack.c
PCI
    hw/pci-bridge/gen_pcie_root_port.c
    hw/pci-bridge/pci_bridge_dev.c
    hw/pci-bridge/pci_expander_bridge.c
    hw/pci-bridge/pcie_pci_bridge.c
    hw/pci-bridge/pcie_root_port.c
    hw/pci/pci.c
    hw/pci/pcie.c
    hw/pci/shpc.c
ACPI/SMBIOS
    hw/acpi/core.c
    hw/acpi/cpu_hotplug.c
    hw/acpi/memory_hotplug.c
    hw/mem/memory-device.c
    hw/mem/pc-dimm.c
    hw/smbios/smbios.c
Network devices
    hw/net/dp8393x.c
    hw/net/ne2000-isa.c
pflash
    hw/block/pflash_cfi01.c
    hw/block/pflash_cfi02.c
SCSI
    hw/scsi/esp-pci.c
    hw/scsi/mptsas.c
    hw/scsi/scsi-bus.c
    hw/scsi/scsi-disk.c
    hw/scsi/scsi-generic.c
    hw/scsi/virtio-scsi.c
SD (Secure Card)
    hw/sd/sdhci-pci.c
    hw/sd/sdhci.c
USB
    hw/usb/bus.c
    hw/usb/ccid-card-emulated.c
    hw/usb/dev-smartcard-reader.c
    hw/usb/dev-storage.c
    hw/usb/hcd-ohci-pci.c
    hw/usb/hcd-ohci.c
    hw/usb/hcd-uhci.c
    hw/usb/hcd-xhci.c
USB (serial adapter)
    hw/usb/dev-serial.c
VFIO
    hw/vfio/common.c
    hw/vfio/pci-quirks.c
    hw/vfio/pci.c
    hw/vfio/platform.c
vfio-ccw
    hw/s390x/s390-ccw.c
vhost
    hw/block/vhost-user-blk.c
    hw/scsi/vhost-scsi.c
    hw/scsi/vhost-user-scsi.c
    hw/virtio/vhost-vsock.c
virtio
    hw/virtio/virtio-balloon.c
    hw/virtio/virtio-bus.c
    hw/virtio/virtio-pci.c
    hw/virtio/virtio-rng-pci.c
    hw/virtio/virtio.c
virtio-9p
    hw/9pfs/9p-local.c
    hw/9pfs/9p.c
virtio-blk
    hw/block/dataplane/virtio-blk.c
    hw/block/virtio-blk.c
virtio-ccw
    hw/s390x/virtio-ccw-crypto.c
    hw/s390x/virtio-ccw-rng.c
    hw/s390x/virtio-ccw.c
virtio-input
    hw/input/virtio-input.c
virtio-serial
    hw/char/virtio-serial-bus.c
virtio-rng
    backends/rng.c
    hw/virtio/virtio-rng.c
megasas
    hw/scsi/megasas.c
NVDIMM
    hw/mem/nvdimm.c
eepro100
    hw/net/eepro100.c
virtio-gpu
    hw/display/virtio-gpu-base.c
    hw/display/virtio-gpu-pci.c
    hw/display/virtio-vga.c
fw_cfg
    hw/nvram/fw_cfg.c
XIVE
    hw/intc/spapr_xive.c
    hw/intc/spapr_xive_kvm.c
    hw/intc/xive.c
Audio
    audio/audio.c
    hw/audio/intel-hda.c
block
    block.c
    block/backup.c
    block/block-backend.c
    block/commit.c
    block/crypto.c
    block/dirty-bitmap.c
    block/io.c
    block/mirror.c
    block/qapi.c
    block/snapshot.c
    block/throttle-groups.c
    block/throttle.c
    block/vxhs.c
    blockdev.c
    blockjob.c
    hw/block/onenand.c
    job.c
scsi
    scsi/pr-manager-helper.c
chardev
    chardev/char-socket.c
    chardev/char.c
    chardev/spice.c
cmdline
    util/qemu-option.c
Dump
    dump/dump.c
    dump/win_dump.c
Memory API
    memory.c
SPICE
    hw/display/qxl.c
Graphics
    ui/input-barrier.c
    ui/input.c
    ui/vnc.c
Main loop
    util/main-loop.c
    vl.c
Human Monitor (HMP)
    monitor/misc.c
net
    net/can/can_host.c
    net/dump.c
    net/filter-buffer.c
    net/filter.c
    net/net.c
    net/netmap.c
    net/tap.c
hostmem
    backends/hostmem-file.c
    backends/hostmem-memfd.c
    backends/hostmem.c
cryptodev
    backends/cryptodev-vhost-user.c
    backends/cryptodev.c
QAPI
    qapi/qapi-visit-core.c
    qapi/qmp-dispatch.c
    qapi/string-input-visitor.c
qga
    qga/commands-posix.c
QOM
    hw/core/qdev-properties-system.c
    hw/core/qdev-properties.c
    hw/core/qdev.c
    qdev-monitor.c
    qom/object.c
    qom/object_interfaces.c
    qom/qom-qobject.c
QMP
    monitor/qmp-cmds.c
SLIRP
    net/slirp.c
Tracing
    trace/qmp.c
TPM
    hw/tpm/tpm_util.c
    tpm.c
Migration
    migration/migration.c
    migration/ram.c
    migration/rdma.c
    migration/savevm.c
    migration/socket.c
Cryptography
    crypto/block-luks.c
    crypto/secret.c
    crypto/tlssession.c
I/O Channels
    io/dns-resolver.c
    io/net-listener.c
Sockets
    util/qemu-sockets.c
colo
    migration/colo.c
Record/replay
    block/blkreplay.c
VMDK
    block/vmdk.c
RBD
    block/rbd.c
Sheepdog
    block/sheepdog.c
VHDX
    block/vhdx-log.c
    block/vhdx.c
VDI
    block/vdi.c
iSCSI
    block/iscsi.c
nbd
    include/block/nbd.h
    block/nbd.c
    nbd/client.c
    nbd/server.c
NFS
    block/nfs.c
SSH
    block/ssh.c
CURL
    block/curl.c
GLUSTER
    block/gluster.c
NVMe Block Driver
    block/nvme.c
Bootdevice
    bootdevice.c
Quorum
    block/quorum.c
blklogwrites
    block/blklogwrites.c
blkverify
    block/blkverify.c
parallels
    block/parallels.c
qed
    block/qed.c
raw
    block/file-posix.c
    block/file-win32.c
    block/raw-format.c
qcow2
    block/qcow2-bitmap.c
    block/qcow2.c
qcow
    block/qcow.c
blkdebug
    block/blkdebug.c
vpc
    block/vpc.c
vvfat
    block/vvfat.c
Replication
    block/replication.c
    replication.c
PVRDMA
    hw/rdma/vmw/pvrdma_main.c
hw/core/bus.c
    hw/core/bus.c
hw/cpu/core.c
    hw/cpu/core.c
hw/sd/ssi-sd.c
    hw/sd/ssi-sd.c
iothread.c
    iothread.c
memory_mapping.c
    memory_mapping.c
target/tilegx/cpu.c
    target/tilegx/cpu.c
tests/test-image-locking.c
    tests/test-image-locking.c
util/qemu-config.c
    util/qemu-config.c

Vladimir Sementsov-Ogievskiy (126):
   hw/core/loader-fit: fix freeing errp in fit_load_fdt net/net: Clean up variable shadowing in net_client_init()
   error: rename errp to errp_in where it is IN-argument
   hmp: drop Error pointer indirection in hmp_handle_error
   vnc: drop Error pointer indirection in vnc_client_io_error
   qdev-monitor: well form error hint helpers
   nbd: well form nbd_iter_channel_error errp handler
   ppc: well form kvmppc_hint_smt_possible error hint helper 9pfs: well form error hint helpers
   hw/core/qdev: cleanup Error ** variables
   block/snapshot: rename Error ** parameter to more common errp hw/i386/amd_iommu: rename Error ** parameter to more common errp
   qga: rename Error ** parameter to more common errp monitor/qmp-cmds: rename Error ** parameter to more common errp hw/s390x: rename Error ** parameter to more common errp hw/sd: rename Error ** parameter to more common errp hw/tpm: rename Error ** parameter to more common errp hw/usb: rename Error ** parameter to more common errp include/block/snapshot.h: rename Error ** parameter to more common errp
   include/qom/object.h: rename Error ** parameter to more common errp qapi/error: add (Error **errp) cleaning APIs backends/cryptodev: drop local_err from cryptodev_backend_complete() hw/vfio/ap: drop local_err from vfio_ap_realize
   error: auto propagated local_err
   scripts: add coccinelle script to use auto propagated errp
   python: add commit-per-subsystem.py
   misc: introduce ERRP_AUTO_PROPAGATE
   s390x: introduce ERRP_AUTO_PROPAGATE
   tcg: introduce ERRP_AUTO_PROPAGATE
   kvm: introduce ERRP_AUTO_PROPAGATE
   xen: introduce ERRP_AUTO_PROPAGATE
   Hosts: introduce ERRP_AUTO_PROPAGATE
   ARM Machines: introduce ERRP_AUTO_PROPAGATE
   MIPS Machines: introduce ERRP_AUTO_PROPAGATE
   PowerPC Machines: introduce ERRP_AUTO_PROPAGATE
   SPARC Machines: introduce ERRP_AUTO_PROPAGATE
   S390 Machines: introduce ERRP_AUTO_PROPAGATE
   X86 Machines: introduce ERRP_AUTO_PROPAGATE
   IDE: introduce ERRP_AUTO_PROPAGATE
   Floppy: introduce ERRP_AUTO_PROPAGATE
   IPack: introduce ERRP_AUTO_PROPAGATE
   PCI: introduce ERRP_AUTO_PROPAGATE
   ACPI/SMBIOS: introduce ERRP_AUTO_PROPAGATE
   Network devices: introduce ERRP_AUTO_PROPAGATE
   pflash: introduce ERRP_AUTO_PROPAGATE
   SCSI: introduce ERRP_AUTO_PROPAGATE
   SD (Secure Card): introduce ERRP_AUTO_PROPAGATE
   USB: introduce ERRP_AUTO_PROPAGATE
   USB (serial adapter): introduce ERRP_AUTO_PROPAGATE
   VFIO: introduce ERRP_AUTO_PROPAGATE
   vfio-ccw: introduce ERRP_AUTO_PROPAGATE
   vhost: introduce ERRP_AUTO_PROPAGATE
   virtio: introduce ERRP_AUTO_PROPAGATE
   virtio-9p: introduce ERRP_AUTO_PROPAGATE
   virtio-blk: introduce ERRP_AUTO_PROPAGATE
   virtio-ccw: introduce ERRP_AUTO_PROPAGATE
   virtio-input: introduce ERRP_AUTO_PROPAGATE
   virtio-serial: introduce ERRP_AUTO_PROPAGATE
   virtio-rng: introduce ERRP_AUTO_PROPAGATE
   megasas: introduce ERRP_AUTO_PROPAGATE
   NVDIMM: introduce ERRP_AUTO_PROPAGATE
   eepro100: introduce ERRP_AUTO_PROPAGATE
   virtio-gpu: introduce ERRP_AUTO_PROPAGATE
   fw_cfg: introduce ERRP_AUTO_PROPAGATE
   XIVE: introduce ERRP_AUTO_PROPAGATE
   Audio: introduce ERRP_AUTO_PROPAGATE
   block: introduce ERRP_AUTO_PROPAGATE
   scsi: introduce ERRP_AUTO_PROPAGATE
   chardev: introduce ERRP_AUTO_PROPAGATE
   cmdline: introduce ERRP_AUTO_PROPAGATE
   Dump: introduce ERRP_AUTO_PROPAGATE
   Memory API: introduce ERRP_AUTO_PROPAGATE
   SPICE: introduce ERRP_AUTO_PROPAGATE
   Graphics: introduce ERRP_AUTO_PROPAGATE
   Main loop: introduce ERRP_AUTO_PROPAGATE
   Human Monitor (HMP): introduce ERRP_AUTO_PROPAGATE
   net: introduce ERRP_AUTO_PROPAGATE
   hostmem: introduce ERRP_AUTO_PROPAGATE
   cryptodev: introduce ERRP_AUTO_PROPAGATE
   QAPI: introduce ERRP_AUTO_PROPAGATE
   qga: introduce ERRP_AUTO_PROPAGATE
   QOM: introduce ERRP_AUTO_PROPAGATE
   QMP: introduce ERRP_AUTO_PROPAGATE
   SLIRP: introduce ERRP_AUTO_PROPAGATE
   Tracing: introduce ERRP_AUTO_PROPAGATE
   TPM: introduce ERRP_AUTO_PROPAGATE
   Migration: introduce ERRP_AUTO_PROPAGATE
   Cryptography: introduce ERRP_AUTO_PROPAGATE
   I/O Channels: introduce ERRP_AUTO_PROPAGATE
   Sockets: introduce ERRP_AUTO_PROPAGATE
   colo: introduce ERRP_AUTO_PROPAGATE
   Record/replay: introduce ERRP_AUTO_PROPAGATE
   VMDK: introduce ERRP_AUTO_PROPAGATE
   RBD: introduce ERRP_AUTO_PROPAGATE
   Sheepdog: introduce ERRP_AUTO_PROPAGATE
   VHDX: introduce ERRP_AUTO_PROPAGATE
   VDI: introduce ERRP_AUTO_PROPAGATE
   iSCSI: introduce ERRP_AUTO_PROPAGATE
   nbd: introduce ERRP_AUTO_PROPAGATE
   NFS: introduce ERRP_AUTO_PROPAGATE
   SSH: introduce ERRP_AUTO_PROPAGATE
   CURL: introduce ERRP_AUTO_PROPAGATE
   GLUSTER: introduce ERRP_AUTO_PROPAGATE
   NVMe Block Driver: introduce ERRP_AUTO_PROPAGATE
   Bootdevice: introduce ERRP_AUTO_PROPAGATE
   Quorum: introduce ERRP_AUTO_PROPAGATE
   blklogwrites: introduce ERRP_AUTO_PROPAGATE
   blkverify: introduce ERRP_AUTO_PROPAGATE
   parallels: introduce ERRP_AUTO_PROPAGATE
   qed: introduce ERRP_AUTO_PROPAGATE

   raw: introduce ERRP_AUTO_PROPAGATE

   qcow2: introduce ERRP_AUTO_PROPAGATE
   qcow: introduce ERRP_AUTO_PROPAGATE
   blkdebug: introduce ERRP_AUTO_PROPAGATE
   vpc: introduce ERRP_AUTO_PROPAGATE
   vvfat: introduce ERRP_AUTO_PROPAGATE
   Replication: introduce ERRP_AUTO_PROPAGATE
   PVRDMA: introduce ERRP_AUTO_PROPAGATE hw/core/bus.c: introduce ERRP_AUTO_PROPAGATE hw/cpu/core.c: introduce ERRP_AUTO_PROPAGATE hw/sd/ssi-sd.c: introduce ERRP_AUTO_PROPAGATE iothread.c: introduce ERRP_AUTO_PROPAGATE memory_mapping.c: introduce ERRP_AUTO_PROPAGATE target/tilegx/cpu.c: introduce ERRP_AUTO_PROPAGATE tests/test-image-locking.c: introduce ERRP_AUTO_PROPAGATE util/qemu-config.c: introduce ERRP_AUTO_PROPAGATE

CC Gerd Hoffmann <[email protected]>
CC "Gonglei (Arei)" <[email protected]>
CC Eduardo Habkost <[email protected]>
CC Igor Mammedov <[email protected]>
CC Laurent Vivier <[email protected]>
CC Amit Shah <[email protected]>
CC Kevin Wolf <[email protected]>
CC Max Reitz <[email protected]>
CC John Snow <[email protected]>
CC Ari Sundholm <[email protected]>
CC Pavel Dovgalyuk <[email protected]>
CC Paolo Bonzini <[email protected]>
CC Stefan Hajnoczi <[email protected]>
CC Fam Zheng <[email protected]>
CC Stefan Weil <[email protected]>
CC Ronnie Sahlberg <[email protected]>
CC Peter Lieven <[email protected]>
CC Eric Blake <[email protected]>
CC "Denis V. Lunev" <[email protected]>
CC Markus Armbruster <[email protected]>
CC Alberto Garcia <[email protected]>
CC Jason Dillaman <[email protected]>
CC Wen Congyang <[email protected]>
CC Xie Changlong <[email protected]>
CC Liu Yuan <[email protected]>
CC "Richard W.M. Jones" <[email protected]>
CC Jeff Cody <[email protected]>
CC "Marc-André Lureau" <[email protected]>
CC "Daniel P. Berrangé" <[email protected]>
CC Richard Henderson <[email protected]>
CC Greg Kurz <[email protected]>
CC "Michael S. Tsirkin" <[email protected]>
CC Marcel Apfelbaum <[email protected]>
CC Beniamino Galvani <[email protected]>
CC Peter Maydell <[email protected]>
CC "Cédric Le Goater" <[email protected]>
CC Andrew Jeffery <[email protected]>
CC Joel Stanley <[email protected]>
CC Andrew Baumann <[email protected]>
CC "Philippe Mathieu-Daudé" <[email protected]>
CC Antony Pavlov <[email protected]>
CC Jean-Christophe Dubois <[email protected]>
CC Peter Chubb <[email protected]>
CC Subbaraya Sundeep <[email protected]>
CC Eric Auger <[email protected]>
CC Alistair Francis <[email protected]>
CC "Edgar E. Iglesias" <[email protected]>
CC Stefano Stabellini <[email protected]>
CC Anthony Perard <[email protected]>
CC Paul Durrant <[email protected]>
CC Paul Burton <[email protected]>
CC Aleksandar Rikalo <[email protected]>
CC Chris Wulff <[email protected]>
CC Marek Vasut <[email protected]>
CC David Gibson <[email protected]>
CC Cornelia Huck <[email protected]>
CC Halil Pasic <[email protected]>
CC Christian Borntraeger <[email protected]>
CC "Hervé Poussineau" <[email protected]>
CC Xiao Guangrong <[email protected]>
CC Aurelien Jarno <[email protected]>
CC Aleksandar Markovic <[email protected]>
CC Mark Cave-Ayland <[email protected]>
CC Jason Wang <[email protected]>
CC Laszlo Ersek <[email protected]>
CC Yuval Shaia <[email protected]>
CC Palmer Dabbelt <[email protected]>
CC Sagar Karandikar <[email protected]>
CC Bastian Koppelmann <[email protected]>
CC David Hildenbrand <[email protected]>
CC Thomas Huth <[email protected]>
CC Eric Farman <[email protected]>
CC Matthew Rosato <[email protected]>
CC Hannes Reinecke <[email protected]>
CC Michael Walle <[email protected]>
CC Artyom Tarasenko <[email protected]>
CC Stefan Berger <[email protected]>
CC Samuel Thibault <[email protected]>
CC Alex Williamson <[email protected]>
CC Tony Krowiak <[email protected]>
CC Pierre Morel <[email protected]>
CC Michael Roth <[email protected]>
CC Hailiang Zhang <[email protected]>
CC Juan Quintela <[email protected]>
CC "Dr. David Alan Gilbert" <[email protected]>
CC Luigi Rizzo <[email protected]>
CC Giuseppe Lettieri <[email protected]>
CC Vincenzo Maffione <[email protected]>
CC Jan Kiszka <[email protected]>
CC Anthony Green <[email protected]>
CC Stafford Horne <[email protected]>
CC Guan Xuetao <[email protected]>
CC Max Filippov <[email protected]>

  include/block/nbd.h                           |   1 + include/block/snapshot.h                      |   2 +- include/monitor/hmp.h                         |   2 +-

  include/qapi/error.h                          |  69 ++++-
  include/qom/object.h                          |   4 +-
  target/ppc/kvm_ppc.h                          |   4 +-

  ui/vnc.h                                      |   2 +- audio/audio.c                                 |  12 +- backends/cryptodev-vhost-user.c               |  10 +- backends/cryptodev.c                          |  25 +- backends/hostmem-file.c                       |  21 +- backends/hostmem-memfd.c                      |  18 +- backends/hostmem.c                            |  41 ++- backends/rng.c                                |   7 +- block.c                                       | 225 +++++++--------- block/backup.c                                |   1 + block/blkdebug.c                              |  36 ++- block/blklogwrites.c                          |  22 +- block/blkreplay.c                             |   7 +- block/blkverify.c                             |  17 +- block/block-backend.c                         |  19 +- block/commit.c                                |   7 +- block/crypto.c                                |  14 +- block/curl.c                                  |   7 +- block/dirty-bitmap.c                          |   1 + block/file-posix.c                            |  79 +++--- block/file-win32.c                            |  29 +- block/gluster.c                               |  69 +++-- block/io.c                                    |  12 +- block/iscsi.c                                 |  36 ++- block/mirror.c                                |  19 +- block/nbd.c                                   |  59 ++-- block/nfs.c                                   |   7 +- block/nvme.c                                  |  19 +- block/parallels.c                             |  30 +-- block/qapi.c                                  |  26 +- block/qcow.c                                  |  17 +- block/qcow2-bitmap.c                          |   9 +- block/qcow2.c                                 |  98 +++---- block/qed.c                                   |  18 +- block/quorum.c                                |  23 +- block/raw-format.c                            |   7 +- block/rbd.c                                   |  29 +- block/replication.c                           |  40 ++- block/sheepdog.c                              |  73 +++-- block/snapshot.c                              |  20 +- block/ssh.c                                   |  12 +- block/throttle-groups.c                       |  24 +- block/throttle.c                              |   7 +- block/vdi.c                                   |  15 +- block/vhdx-log.c                              |   1 + block/vhdx.c                                  |  22 +- block/vmdk.c                                  |  41 ++- block/vpc.c                                   |  28 +- block/vvfat.c                                 |  12 +- block/vxhs.c                                  |  23 +- blockdev.c                                    | 252 ++++++++---------- blockjob.c                                    |   8 +- bootdevice.c                                  |  31 +-- chardev/char-socket.c                         |   7 +- chardev/char.c                                |  20 +- chardev/spice.c                               |   1 + crypto/block-luks.c                           |  56 ++-- crypto/secret.c                               |  17 +- crypto/tlssession.c                           |   7 +- dump/dump-hmp-cmds.c                          |   4 +- dump/dump.c                                   | 151 +++++------ dump/win_dump.c                               |  29 +- exec.c                                        |  21 +- hw/9pfs/9p-local.c                            |  12 +- hw/9pfs/9p-proxy.c                            |   5 +- hw/9pfs/9p.c                                  |   1 + hw/acpi/core.c                                |  18 +- hw/acpi/cpu_hotplug.c                         |   2 +- hw/acpi/ich9.c                                |  30 +-- hw/acpi/memory_hotplug.c                      |   7 +- hw/arm/allwinner-a10.c                        |  27 +- hw/arm/armv7m.c                               |  52 ++-- hw/arm/aspeed_soc.c                           |   1 + hw/arm/bcm2835_peripherals.c                  |  85 +++--- hw/arm/bcm2836.c                              |  41 ++- hw/arm/digic.c                                |  22 +- hw/arm/fsl-imx25.c                            |  62 ++--- hw/arm/fsl-imx31.c                            |  57 ++-- hw/arm/fsl-imx6.c                             |  81 +++--- hw/arm/integratorcp.c                         |   7 +- hw/arm/msf2-soc.c                             |  22 +- hw/arm/nrf51_soc.c                            |  47 ++-- hw/arm/smmu-common.c                          |   7 +- hw/arm/smmuv3.c                               |   7 +- hw/arm/stm32f205_soc.c                        |  39 ++- hw/arm/virt.c                                 |   2 + hw/arm/xlnx-versal-virt.c                     |   7 +- hw/arm/xlnx-zynqmp.c                          |  86 +++--- hw/audio/intel-hda.c                          |  13 +- hw/block/dataplane/virtio-blk.c               |   1 + hw/block/dataplane/xen-block.c                |  17 +- hw/block/fdc.c                                |  19 +- hw/block/onenand.c                            |   7 +- hw/block/pflash_cfi01.c                       |   7 +- hw/block/pflash_cfi02.c                       |   7 +- hw/block/vhost-user-blk.c                     |   6 +- hw/block/virtio-blk.c                         |   7 +- hw/block/xen-block.c                          | 119 ++++----- hw/char/debugcon.c                            |   7 +- hw/char/serial-pci-multi.c                    |   7 +- hw/char/serial-pci.c                          |   7 +- hw/char/virtio-serial-bus.c                   |   7 +- hw/core/bus.c                                 |  15 +- hw/core/loader-fit.c                          |   7 +- hw/core/machine-hmp-cmds.c                    |   6 +- hw/core/machine.c                             |  21 +- hw/core/numa.c                                |  51 ++-- hw/core/qdev-properties-system.c              |  28 +- hw/core/qdev-properties.c                     |  89 +++---- hw/core/qdev.c                                |  58 ++-- hw/cpu/a15mpcore.c                            |   7 +- hw/cpu/a9mpcore.c                             |  27 +- hw/cpu/arm11mpcore.c                          |  22 +- hw/cpu/core.c                                 |  14 +- hw/cpu/realview_mpcore.c                      |  12 +- hw/display/bcm2835_fb.c                       |   6 +- hw/display/qxl.c                              |   7 +- hw/display/virtio-gpu-base.c                  |   7 +- hw/display/virtio-gpu-pci.c                   |   7 +- hw/display/virtio-vga.c                       |   7 +- hw/dma/bcm2835_dma.c                          |   6 +- hw/dma/xilinx_axidma.c                        |  22 +- hw/gpio/aspeed_gpio.c                         |   7 +- hw/gpio/bcm2835_gpio.c                        |  10 +- hw/i386/amd_iommu.c                           |  14 +- hw/i386/pc.c                                  | 120 ++++----- hw/ide/qdev.c                                 |  16 +- hw/input/virtio-input.c                       |  14 +- hw/intc/apic_common.c                         |   7 +- hw/intc/arm_gic.c                             |   7 +- hw/intc/arm_gic_kvm.c                         |  12 +- hw/intc/arm_gicv3.c                           |  12 +- hw/intc/arm_gicv3_its_kvm.c                   |   7 +- hw/intc/arm_gicv3_kvm.c                       |  17 +- hw/intc/armv7m_nvic.c                         |  12 +- hw/intc/nios2_iic.c                           |   6 +- hw/intc/pnv_xive.c                            |  15 +- hw/intc/realview_gic.c                        |   7 +- hw/intc/s390_flic_kvm.c                       |   9 +- hw/intc/spapr_xive.c                          |  12 +- hw/intc/spapr_xive_kvm.c                      |  55 ++-- hw/intc/xics.c                                |  28 +- hw/intc/xics_kvm.c                            |  30 +-- hw/intc/xics_pnv.c                            |   7 +- hw/intc/xics_spapr.c                          |   7 +- hw/intc/xive.c                                |  27 +- hw/ipack/ipack.c                              |   5 +- hw/isa/pc87312.c                              |   7 +- hw/mem/memory-device.c                        |  20 +- hw/mem/nvdimm.c                               |  25 +- hw/mem/pc-dimm.c                              |  23 +- hw/microblaze/xlnx-zynqmp-pmu.c               |  12 +- hw/mips/cps.c                                 |  46 ++-- hw/misc/bcm2835_mbox.c                        |   6 +- hw/misc/bcm2835_property.c                    |  10 +- hw/misc/ivshmem.c                             |  37 ++- hw/misc/macio/macio.c                         |  68 ++--- hw/misc/msf2-sysreg.c                         |   1 +

  hw/misc/tmp105.c                              |   7 +-
  hw/misc/tmp421.c                              |   7 +-
  hw/net/dp8393x.c                              |   7 +-

  hw/net/eepro100.c                             |   7 +- hw/net/ne2000-isa.c                           |  17 +- hw/net/xilinx_axienet.c                       |  22 +- hw/nvram/fw_cfg.c                             |  14 +- hw/nvram/nrf51_nvm.c                          |   7 +- hw/pci-bridge/gen_pcie_root_port.c            |   7 +- hw/pci-bridge/pci_bridge_dev.c                |  13 +- hw/pci-bridge/pci_expander_bridge.c           |   7 +- hw/pci-bridge/pcie_pci_bridge.c               |   8 +- hw/pci-bridge/pcie_root_port.c                |   1 + hw/pci-host/piix.c                            |   7 +- hw/pci/pci.c                                  |  19 +-

  hw/pci/pcie.c                                 |   7 +-
  hw/pci/shpc.c                                 |  14 +-
  hw/ppc/e500.c                                 |   7 +-

  hw/ppc/mac_newworld.c                         |   1 + hw/ppc/pnv.c                                  | 109 ++++---- hw/ppc/pnv_core.c                             |  23 +- hw/ppc/pnv_homer.c                            |   5 +-

  hw/ppc/pnv_lpc.c                              |  26 +-
  hw/ppc/pnv_occ.c                              |   5 +-
  hw/ppc/pnv_psi.c                              |  23 +-
  hw/ppc/spapr.c                                | 133 ++++-----
  hw/ppc/spapr_caps.c                           |  57 ++--
  hw/ppc/spapr_cpu_core.c                       |  36 ++-
  hw/ppc/spapr_drc.c                            |  48 ++--
  hw/ppc/spapr_irq.c                            |  98 +++----
  hw/ppc/spapr_pci.c                            |  97 +++----
  hw/ppc/spapr_vio.c                            |  12 +-
  hw/rdma/vmw/pvrdma_main.c                     |   1 +
  hw/riscv/riscv_hart.c                         |   7 +-
  hw/riscv/sifive_e.c                           |   7 +-
  hw/riscv/sifive_u.c                           |  11 +-
  hw/s390x/3270-ccw.c                           |  13 +-

  hw/s390x/css-bridge.c                         |   7 +- hw/s390x/css.c                                |   7 +- hw/s390x/event-facility.c                     |   2 +- hw/s390x/ipl.c                                |  24 +- hw/s390x/s390-ccw.c                           |  19 +- hw/s390x/s390-pci-bus.c                       |  37 ++- hw/s390x/s390-skeys.c                         |   7 +- hw/s390x/s390-stattrib.c                      |   3 +- hw/s390x/s390-virtio-ccw.c                    |  11 +- hw/s390x/sclp.c                               |  15 +- hw/s390x/tod-kvm.c                            |  14 +- hw/s390x/virtio-ccw-crypto.c                  |   7 +- hw/s390x/virtio-ccw-rng.c                     |   7 +- hw/s390x/virtio-ccw.c                         |  13 +- hw/scsi/esp-pci.c                             |   7 +- hw/scsi/megasas.c                             |  11 +- hw/scsi/mptsas.c                              |  13 +- hw/scsi/scsi-bus.c                            |  24 +- hw/scsi/scsi-disk.c                           |   8 +- hw/scsi/scsi-generic.c                        |   1 + hw/scsi/vhost-scsi.c                          |  12 +- hw/scsi/vhost-user-scsi.c                     |   7 +- hw/scsi/virtio-scsi.c                         |   7 +- hw/sd/milkymist-memcard.c                     |  11 +- hw/sd/sdhci-pci.c                             |   7 +- hw/sd/sdhci.c                                 |  23 +- hw/sd/ssi-sd.c                                |  14 +- hw/smbios/smbios.c                            |  42 ++- hw/sparc/sun4m.c                              |  21 +- hw/sparc64/sun4u.c                            |   7 +- hw/timer/aspeed_timer.c                       |   6 +- hw/tpm/tpm_emulator.c                         |   8 +- hw/tpm/tpm_util.c                             |   7 +- hw/usb/bus.c                                  |  37 ++- hw/usb/ccid-card-emulated.c                   |   1 + hw/usb/dev-network.c                          |   2 +- hw/usb/dev-serial.c                           |   7 +- hw/usb/dev-smartcard-reader.c                 |  14 +- hw/usb/dev-storage.c                          |  17 +- hw/usb/hcd-ohci-pci.c                         |   7 +-

  hw/usb/hcd-ohci.c                             |  14 +-
  hw/usb/hcd-uhci.c                             |   7 +-
  hw/usb/hcd-xhci.c                             |  13 +-

  hw/vfio/ap.c                                  |  16 +- hw/vfio/ccw.c                                 |  24 +- hw/vfio/common.c                              |   3 + hw/vfio/pci-quirks.c                          |   8 +- hw/vfio/pci.c                                 |  42 ++- hw/vfio/platform.c                            |   1 + hw/virtio/vhost-vsock.c                       |   1 + hw/virtio/virtio-balloon.c                    |  35 ++- hw/virtio/virtio-bus.c                        |  17 +- hw/virtio/virtio-pci.c                        |   2 + hw/virtio/virtio-rng-pci.c                    |   7 +- hw/virtio/virtio-rng.c                        |   7 +- hw/virtio/virtio.c                            |  19 +- hw/watchdog/wdt_aspeed.c                      |   5 +- 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 +- io/dns-resolver.c                             |   7 +- io/net-listener.c                             |   7 +- iothread.c                                    |  27 +- job.c                                         |   7 +- memory.c                                      |  63 ++--- memory_mapping.c                              |   7 +- migration/colo.c                              |  38 ++- migration/migration.c                         |  39 ++- migration/ram.c                               |  13 +- migration/rdma.c                              |  13 +-

  migration/savevm.c                            |   2 +
  migration/socket.c                            |  18 +-
  monitor/hmp-cmds.c                            | 155 ++++++-----

  monitor/misc.c                                |   9 +- monitor/qmp-cmds.c                            |   9 +- nbd/client.c                                  |   5 + nbd/server.c                                  |   5 + net/can/can_host.c                            |   7 +- net/dump.c                                    |  15 +- net/filter-buffer.c                           |  15 +- net/filter.c                                  |   7 +- net/net.c                                     |  58 ++-- net/netmap.c                                  |   7 +- net/slirp.c                                   |   7 +- net/tap.c                                     |  47 ++-- qapi/qapi-visit-core.c                        |  56 ++-- qapi/qmp-dispatch.c                           |   7 +- qapi/string-input-visitor.c                   |   7 +- qdev-monitor.c                                |  69 +++-- qga/commands-posix.c                          | 222 +++++++-------- qga/commands-win32.c                          | 141 +++++----- qga/commands.c                                |  12 +- qom/object.c                                  | 246 ++++++++--------- qom/object_interfaces.c                       |  27 +- qom/qom-hmp-cmds.c                            |   4 +- qom/qom-qobject.c                             |   7 +- replication.c                                 |  28 +- scsi/pr-manager-helper.c                      |   7 +- target/alpha/cpu.c                            |   7 +- target/arm/cpu.c                              |   7 +- target/arm/cpu64.c                            |  11 +-

  target/cris/cpu.c                             |   7 +-
  target/hppa/cpu.c                             |   7 +-
  target/i386/cpu.c                             | 117 ++++----
  target/lm32/cpu.c                             |   7 +-
  target/m68k/cpu.c                             |   7 +-

  target/microblaze/cpu.c                       |   7 +- target/mips/cpu.c                             |   7 +- target/moxie/cpu.c                            |   7 +- target/nios2/cpu.c                            |   7 +- target/openrisc/cpu.c                         |   7 +- target/ppc/compat.c                           |  20 +- target/ppc/kvm.c                              |  14 +- target/ppc/translate_init.inc.c               |  26 +- target/riscv/cpu.c                            |   7 +- target/s390x/cpu.c                            |  26 +- target/s390x/cpu_models.c                     |   2 + target/sh4/cpu.c                              |   7 +- target/sparc/cpu.c                            |  14 +- target/tilegx/cpu.c                           |   7 +- target/tricore/cpu.c                          |   7 +- target/unicore32/cpu.c                        |   7 +- target/xtensa/cpu.c                           |   7 +- tests/test-image-locking.c                    |   7 +- tpm.c                                         |   7 +- trace/qmp.c                                   |  14 +- ui/input-barrier.c                            |   7 +- ui/input.c                                    |  14 +- ui/vnc.c                                      |  39 ++- util/error.c                                  |  30 +-- util/main-loop.c                              |   5 +-

  util/oslib-posix.c                            |   6 +-
  util/qemu-config.c                            |  29 +-
  util/qemu-option.c                            |  59 ++--

  util/qemu-sockets.c                           |  31 +-- vl.c                                          |  14 +- python/commit-per-subsystem.py                | 204 ++++++++++++++ scripts/coccinelle/auto-propagated-errp.cocci | 118 ++++++++

  341 files changed, 3851 insertions(+), 4455 deletions(-)

  create mode 100755 python/commit-per-subsystem.py create mode 100644 scripts/coccinelle/auto-propagated-errp.cocci

#209 lore raw
Quoted 31 lines · Greg Kurz
Quoted 17 lines · On Wed, 20 Nov 2019 09:50:54 +0000 Vladimir…

Okay...

I think that:

1. A lot of efforts (not only my, I think reviewing is already exceeded generation efforts) are made, it would be sad to lose them.

2. It's safe enough to apply only part of generated patches: we just fix error_abort/error_fatal in more popular subsystems, what's wrong with that? Why not to cover 80% cases by 20% efforts?

3. It's obviously impossible to merge the whole series. A lot of time passed, series diverges.

So I propose the following plan:

1. I resend small separate series of preparation patches per maintainer. They are good anyway.

Quoted 9 lines

2. We commit patch with macro (changing MUST to SHOULD in documentation) and coccinelle script. (or that may be combined with the first series from [3.])

3. When one of preparations taken to maintainer's tree, I send generated patches for its maintainer.

If no objections during a week, I'll start that plan, hope someone will support it.

Hi Vladimir,

Quoted 7 lines

I support your plan and I will help this to go forward for 9pfs, PowerPC and XIVE. I'll start with pushing the preparatory patch for 9pfs to my 9p-next branch right away.

[RFC v5 009/126] 9pfs: well form error hint helpers

Cheers,

Thank you Greg!

Signature · 2 lines
Best regards,
Vladimir
#210 lore raw
In reply to Vladimir Sementsov-Ogievskiy
Quoted 15 lines · Vladimir Sementsov-Ogievskiy

Okay...

I think that:

1. A lot of efforts (not only my, I think reviewing is already exceeded generation efforts) are made, it would be sad to lose them.

2. It's safe enough to apply only part of generated patches: we just fix error_abort/error_fatal in more popular subsystems, what's wrong with that? Why not to cover 80% cases by 20% efforts?

3. It's obviously impossible to merge the whole series. A lot of time passed, series diverges.

So I propose the following plan:

Quoted 7 lines

1. I resend small separate series of preparation patches per maintainer. They are good anyway.

2. We commit patch with macro (changing MUST to SHOULD in documentation) and coccinelle script. (or that may be combined with the first series from [3.])

3. When one of preparations taken to maintainer's tree, I send generated patches for its maintainer.

I'd still prefer waiting for direction from Markus. We've been tied up by other things (KVM Forum, 4.2 release), but now that we are in freeze, this is actually a GOOD time for Markus to finally get back to this series, and there is going to be less rebasing needed if we can apply the entire cleanup right as 5.0 development opens in a couple of weeks.

Quoted 5 lines

If no objections during a week, I'll start that plan, hope someone will support it.

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
#211 lore raw

Am 20.11.2019 um 13:59 hat Eric Blake geschrieben:

Quoted 21 lines · Vladimir Sementsov-Ogievskiy
Quoted 20 lines

Okay...

I think that:

1. A lot of efforts (not only my, I think reviewing is already exceeded generation efforts) are made, it would be sad to lose them.

2. It's safe enough to apply only part of generated patches: we just fix error_abort/error_fatal in more popular subsystems, what's wrong with that? Why not to cover 80% cases by 20% efforts?

3. It's obviously impossible to merge the whole series. A lot of time passed, series diverges.

So I propose the following plan:

1. I resend small separate series of preparation patches per maintainer. They are good anyway.

2. We commit patch with macro (changing MUST to SHOULD in documentation) and coccinelle script. (or that may be combined with the first series from [3.])

Quoted 8 lines
Quoted 2 lines

3. When one of preparations taken to maintainer's tree, I send generated patches for its maintainer.

I'd still prefer waiting for direction from Markus. We've been tied up by other things (KVM Forum, 4.2 release), but now that we are in freeze, this is actually a GOOD time for Markus to finally get back to this series, and there is going to be less rebasing needed if we can apply the entire cleanup right as 5.0 development opens in a couple of weeks.

Actually, that's possibly the worst possible time for avoiding conflicts because during freeze, maintainers are collecting stuff in private branches for weeks without getting it into master.

If you are the one who gets merged first (what are the odds?), that solves the problem for you, but then everyone else will get conflicts.

I like Vladimir's new plan.

Kevin

#212 lore raw
In reply to Vladimir Sementsov-Ogievskiy

Please accept my sincere apologies for taking so long to reply. A few thoughts before I dig deeper.

Quoted 7 lines · Vladimir Sementsov-Ogievskiy

Hi all!

At the request of Markus: full version of errp propagation. Let's look at it. Cover as much as possible, except inserting macro invocation where it's not necessary.

It's huge, and so it's an RFC.

It's a monster. Best to get it into full view before we commit to fighting it.

Quoted 13 lines

In v5 I've added a lot more preparation cleanups:
01-23 are preparation cleanups
01: not changed, keep Eric's r-b
02: improve commit msg [Markus], keep Eric's r-b
03: changed, only error API here, drop r-b
24 is core macro
- improve cover letter, wording and macro code style
- keep Eric's r-b
25-26: automation scripts
- commit-per-subsystem changed a lot. it's a draft, don't bother too much with it
- coccinelle: add support of error_propagate_prepend

Quoted 1 line

27-126: generated patches

Splitting up the monster can make fighting it easier.

Your description suggests three high-level parts:

Part 1: Preparation (makes sense by itself)
Part 2: Error interface update (with rules what code should do now) Part 3: Make the code obey the new rules everywhere

I hope we can get part 1 out of the way quickly. Diffstat:

 backends/cryptodev.c       |  11 +---
 block/nbd.c                |  10 +--
 block/snapshot.c           |   4 +-
 dump/dump-hmp-cmds.c       |   4 +-
 hw/9pfs/9p-local.c         |   4 +-
 hw/9pfs/9p-proxy.c         |   5 +-
 hw/core/loader-fit.c       |   5 +-
 hw/core/machine-hmp-cmds.c |   6 +-
 hw/core/qdev.c             |  28 ++++----
 hw/i386/amd_iommu.c        |  14 ++--
 hw/ppc/spapr.c             |   2 +-
 hw/s390x/event-facility.c  |   2 +-
 hw/s390x/s390-stattrib.c   |   3 +-
 hw/sd/sdhci.c              |   2 +-
 hw/tpm/tpm_emulator.c      |   8 +--
 hw/usb/dev-network.c       |   2 +-
 hw/vfio/ap.c               |  16 +----
 include/block/snapshot.h   |   2 +-
 include/monitor/hmp.h      |   2 +-
 include/qapi/error.h       |  69 ++++++++++++++++++--
 include/qom/object.h       |   4 +-
 monitor/hmp-cmds.c         | 155 ++++++++++++++++++++++-----------------------
 monitor/qmp-cmds.c         |   2 +-
 net/net.c                  |  17 ++---
 qdev-monitor.c             |  28 ++++----
 qga/commands-posix.c       |   2 +-
 qga/commands-win32.c       |   2 +-
 qga/commands.c             |  12 ++--
 qom/qom-hmp-cmds.c         |   4 +-
 target/ppc/kvm.c           |   6 +-
 target/ppc/kvm_ppc.h       |   4 +-
 ui/vnc.c                   |  20 ++----
 ui/vnc.h                   |   2 +-
 util/error.c               |  30 ++++-----
 34 files changed, 261 insertions(+), 226 deletions(-)

At first glance, I can see bug fixes, non-mechanical cleanups, and mechanical cleanups.

Within each of these three groups, we have related sub-groups. For instance, several patches clean up funny names for the common Error ** parameters. Several more rename "uncommon" Error ** parameters, to signal their uncommon role. I doubt splitting up these subgroups of related mechanical changes along subsystem lines is worthwhile.

Part 2 needs careful interface review. Having part 3 ready helps there, because we can see rather than guess how the interface changes play out. We really want to get this part right from the start, because if we don't, we get to do part 3 again.

Part 3 is what makes this a monster. I understand it's mechanical. We can merge it incrementally, but we do want to merge it all, and sooner rather than later, to avoid a mix of old and new error handling code. Such mixes inevitably confuse developers, and lead to new instances of the old patterns creeping in.

I do have doubts about your automated split.

I acknowledge maintainers of active subsystems may want to merge this on their own terms, to minimize disruption. Splitting off sub-monsters for them makes sense. Splitting off the long tail of less busy subsystems not so much; it'll only drag out the merging. Your list below shows 100 parts, and chasing their maintainers is not going to be a fun experience.

Moreover, using MAINTAINERS to guide an automatic split is a cute idea, but it falls apart when MAINTAINERS attributes the same file to several subsystems, which is fairly common. A sane split requires human touch.

Instead, I'd start with big subsystems with maintainers known to be sympathetic to this effort. Split off their sub-monsters, get them merged. Iterate until the remainder can be merged in one final push.

Quoted 4 lines

====

Here is a proposal of auto propagation for local_err, to not call error_propagate on every exit point, when we deal with local_err.

More cleverness, less code, avoids one kind of error (forgetting manual propagate when we should), risks another kind of error (automatic propagate when we shouldn't). Tradeoffs, but the general feeling among reviewers appears to be positive.

Quoted 5 lines

There are also two issues with errp:

1. error_fatal & error_append_hint/error_prepend: user can't see this additional info, because exit() happens in error_setg earlier than info is added. [Reported by Greg Kurz]

Yes, broken by design, hurts users.

Quoted 6 lines

2. error_abort & error_propagate: when we wrap
error_abort by local_err+error_propagate, resulting coredump will refer to error_propagate and not to the place where error happened. (the macro itself don't fix the issue, but it allows to [3.] drop all local_err+error_propagate pattern, which will definitely fix the issue) [Reported by Kevin Wolf]

Yes, broken by design, inconveniences developers.

Quoted 8 lines

====

Generated patches split:

misc
hw/misc/ivshmem.c
hw/misc/tmp105.c
hw/misc/tmp421.c

[99 more...]

#213 lore raw
Quoted 29 lines · Markus Armbruster

Please accept my sincere apologies for taking so long to reply. A few thoughts before I dig deeper.

Quoted 7 lines · Vladimir Sementsov-Ogievskiy

Hi all!

At the request of Markus: full version of errp propagation. Let's look at it. Cover as much as possible, except inserting macro invocation where it's not necessary.

It's huge, and so it's an RFC.

It's a monster. Best to get it into full view before we commit to fighting it.

Quoted 13 lines

In v5 I've added a lot more preparation cleanups:
01-23 are preparation cleanups
01: not changed, keep Eric's r-b
02: improve commit msg [Markus], keep Eric's r-b
03: changed, only error API here, drop r-b
24 is core macro
- improve cover letter, wording and macro code style
- keep Eric's r-b
25-26: automation scripts
- commit-per-subsystem changed a lot. it's a draft, don't bother too much with it
- coccinelle: add support of error_propagate_prepend

Quoted 7 lines
Quoted 1 line

27-126: generated patches

Splitting up the monster can make fighting it easier.

Your description suggests three high-level parts:

Part 1: Preparation (makes sense by itself)

I already resent part 1 all patches (handling review comments) in separate as v6. If it is convenient, I can resend them in one series as v7.

Quoted 1 line

Part 2: Error interface update (with rules what code should do now)

Note, that patch 21 is actually from part2, not part1.
So Part 2 is 21, 24, 25.
So I wait for your comments and resend (if needed) as separate small series.

And 26 is auto-patch-splitter, but we don't need it now, if we are going to start from several big subsystems.

Quoted 69 lines

Part 3: Make the code obey the new rules everywhere

I hope we can get part 1 out of the way quickly. Diffstat:

  backends/cryptodev.c       |  11 +---
  block/nbd.c                |  10 +--
  block/snapshot.c           |   4 +-
  dump/dump-hmp-cmds.c       |   4 +-
  hw/9pfs/9p-local.c         |   4 +-
  hw/9pfs/9p-proxy.c         |   5 +-
  hw/core/loader-fit.c       |   5 +-
  hw/core/machine-hmp-cmds.c |   6 +-
  hw/core/qdev.c             |  28 ++++----
  hw/i386/amd_iommu.c        |  14 ++--
  hw/ppc/spapr.c             |   2 +-
  hw/s390x/event-facility.c  |   2 +-
  hw/s390x/s390-stattrib.c   |   3 +-
  hw/sd/sdhci.c              |   2 +-
  hw/tpm/tpm_emulator.c      |   8 +--
  hw/usb/dev-network.c       |   2 +-
  hw/vfio/ap.c               |  16 +----
  include/block/snapshot.h   |   2 +-
  include/monitor/hmp.h      |   2 +-
  include/qapi/error.h       |  69 ++++++++++++++++++--
  include/qom/object.h       |   4 +-
  monitor/hmp-cmds.c         | 155 ++++++++++++++++++++++-----------------------
  monitor/qmp-cmds.c         |   2 +-
  net/net.c                  |  17 ++---
  qdev-monitor.c             |  28 ++++----
  qga/commands-posix.c       |   2 +-
  qga/commands-win32.c       |   2 +-
  qga/commands.c             |  12 ++--
  qom/qom-hmp-cmds.c         |   4 +-
  target/ppc/kvm.c           |   6 +-
  target/ppc/kvm_ppc.h       |   4 +-
  ui/vnc.c                   |  20 ++----
  ui/vnc.h                   |   2 +-
  util/error.c               |  30 ++++-----
  34 files changed, 261 insertions(+), 226 deletions(-)

At first glance, I can see bug fixes, non-mechanical cleanups, and mechanical cleanups.

Within each of these three groups, we have related sub-groups. For instance, several patches clean up funny names for the common Error ** parameters. Several more rename "uncommon" Error ** parameters, to signal their uncommon role. I doubt splitting up these subgroups of related mechanical changes along subsystem lines is worthwhile.

Part 2 needs careful interface review. Having part 3 ready helps there, because we can see rather than guess how the interface changes play out. We really want to get this part right from the start, because if we don't, we get to do part 3 again.

Part 3 is what makes this a monster. I understand it's mechanical. We can merge it incrementally, but we do want to merge it all, and sooner rather than later, to avoid a mix of old and new error handling code. Such mixes inevitably confuse developers, and lead to new instances of the old patterns creeping in.

I do have doubts about your automated split.

I acknowledge maintainers of active subsystems may want to merge this on their own terms, to minimize disruption. Splitting off sub-monsters for them makes sense. Splitting off the long tail of less busy subsystems not so much; it'll only drag out the merging. Your list below shows 100 parts, and chasing their maintainers is not going to be a fun experience.

Quoted 7 lines

Moreover, using MAINTAINERS to guide an automatic split is a cute idea, but it falls apart when MAINTAINERS attributes the same file to several subsystems, which is fairly common. A sane split requires human touch.

Instead, I'd start with big subsystems with maintainers known to be sympathetic to this effort. Split off their sub-monsters, get them merged. Iterate until the remainder can be merged in one final push.

Do you mean to send them as separate per-subsystem series, or all in one, but limited to some subsystems?

Quoted 30 lines
Quoted 5 lines

====

Here is a proposal of auto propagation for local_err, to not call error_propagate on every exit point, when we deal with local_err.

More cleverness, less code, avoids one kind of error (forgetting manual propagate when we should), risks another kind of error (automatic propagate when we shouldn't). Tradeoffs, but the general feeling among reviewers appears to be positive.

Quoted 5 lines

There are also two issues with errp:

1. error_fatal & error_append_hint/error_prepend: user can't see this additional info, because exit() happens in error_setg earlier than info is added. [Reported by Greg Kurz]

Yes, broken by design, hurts users.

Quoted 6 lines

2. error_abort & error_propagate: when we wrap
error_abort by local_err+error_propagate, resulting coredump will refer to error_propagate and not to the place where error happened. (the macro itself don't fix the issue, but it allows to [3.] drop all local_err+error_propagate pattern, which will definitely fix the issue) [Reported by Kevin Wolf]

Yes, broken by design, inconveniences developers.

Quoted 2 lines

====

Quoted 8 lines
Quoted 6 lines

Generated patches split:

misc

    hw/misc/ivshmem.c
    hw/misc/tmp105.c
    hw/misc/tmp421.c

[99 more...]

Thanks!

Signature · 2 lines
Best regards,
Vladimir
#214 lore raw
Quoted 32 lines · Vladimir Sementsov-Ogievskiy
Quoted 31 lines · Markus Armbruster

Please accept my sincere apologies for taking so long to reply. A few thoughts before I dig deeper.

Quoted 7 lines · Vladimir Sementsov-Ogievskiy

Hi all!

At the request of Markus: full version of errp propagation. Let's look at it. Cover as much as possible, except inserting macro invocation where it's not necessary.

It's huge, and so it's an RFC.

It's a monster. Best to get it into full view before we commit to fighting it.

Quoted 14 lines

In v5 I've added a lot more preparation cleanups:
01-23 are preparation cleanups
01: not changed, keep Eric's r-b
02: improve commit msg [Markus], keep Eric's r-b
03: changed, only error API here, drop r-b
24 is core macro
- improve cover letter, wording and macro code style
- keep Eric's r-b
25-26: automation scripts
- commit-per-subsystem changed a lot. it's a draft, don't bother too much with it
- coccinelle: add support of error_propagate_prepend

27-126: generated patches

Quoted 8 lines
Quoted 5 lines

Splitting up the monster can make fighting it easier.

Your description suggests three high-level parts:

Part 1: Preparation (makes sense by itself)

I already resent part 1 all patches (handling review comments) in separate as v6. If it is convenient, I can resend them in one series as v7.

Recommend to await review. The more we can merge without another respin, the better.

Quoted 4 lines
Quoted 1 line

Part 2: Error interface update (with rules what code should do now)

Note, that patch 21 is actually from part2, not part1. So Part 2 is 21, 24, 25.

Thanks for the heads-up.

Quoted 78 lines

So I wait for your comments and resend (if needed) as separate small series.

And 26 is auto-patch-splitter, but we don't need it now, if we are going to start from several big subsystems.

Quoted 73 lines

Part 3: Make the code obey the new rules everywhere

I hope we can get part 1 out of the way quickly. Diffstat:

  backends/cryptodev.c       |  11 +---
  block/nbd.c                |  10 +--
  block/snapshot.c           |   4 +-
  dump/dump-hmp-cmds.c       |   4 +-
  hw/9pfs/9p-local.c         |   4 +-
  hw/9pfs/9p-proxy.c         |   5 +-
  hw/core/loader-fit.c       |   5 +-
  hw/core/machine-hmp-cmds.c |   6 +-
  hw/core/qdev.c             |  28 ++++----
  hw/i386/amd_iommu.c        |  14 ++--
  hw/ppc/spapr.c             |   2 +-
  hw/s390x/event-facility.c  |   2 +-
  hw/s390x/s390-stattrib.c   |   3 +-
  hw/sd/sdhci.c              |   2 +-
  hw/tpm/tpm_emulator.c      |   8 +--
  hw/usb/dev-network.c       |   2 +-
  hw/vfio/ap.c               |  16 +----
  include/block/snapshot.h   |   2 +-
  include/monitor/hmp.h      |   2 +-
  include/qapi/error.h       |  69 ++++++++++++++++++--
  include/qom/object.h       |   4 +-
  monitor/hmp-cmds.c         | 155 ++++++++++++++++++++++-----------------------
  monitor/qmp-cmds.c         |   2 +-
  net/net.c                  |  17 ++---
  qdev-monitor.c             |  28 ++++----
  qga/commands-posix.c       |   2 +-
  qga/commands-win32.c       |   2 +-
  qga/commands.c             |  12 ++--
  qom/qom-hmp-cmds.c         |   4 +-
  target/ppc/kvm.c           |   6 +-
  target/ppc/kvm_ppc.h       |   4 +-
  ui/vnc.c                   |  20 ++----
  ui/vnc.h                   |   2 +-
  util/error.c               |  30 ++++-----
  34 files changed, 261 insertions(+), 226 deletions(-)

At first glance, I can see bug fixes, non-mechanical cleanups, and mechanical cleanups.

Within each of these three groups, we have related sub-groups. For instance, several patches clean up funny names for the common Error ** parameters. Several more rename "uncommon" Error ** parameters, to signal their uncommon role. I doubt splitting up these subgroups of related mechanical changes along subsystem lines is worthwhile.

Part 2 needs careful interface review. Having part 3 ready helps there, because we can see rather than guess how the interface changes play out. We really want to get this part right from the start, because if we don't, we get to do part 3 again.

Part 3 is what makes this a monster. I understand it's mechanical. We can merge it incrementally, but we do want to merge it all, and sooner rather than later, to avoid a mix of old and new error handling code. Such mixes inevitably confuse developers, and lead to new instances of the old patterns creeping in.

I do have doubts about your automated split.

I acknowledge maintainers of active subsystems may want to merge this on their own terms, to minimize disruption. Splitting off sub-monsters for them makes sense. Splitting off the long tail of less busy subsystems not so much; it'll only drag out the merging. Your list below shows 100 parts, and chasing their maintainers is not going to be a fun experience.

Moreover, using MAINTAINERS to guide an automatic split is a cute idea, but it falls apart when MAINTAINERS attributes the same file to several subsystems, which is fairly common. A sane split requires human touch.

Quoted 6 lines
Quoted 3 lines

Instead, I'd start with big subsystems with maintainers known to be sympathetic to this effort. Split off their sub-monsters, get them merged. Iterate until the remainder can be merged in one final push.

Do you mean to send them as separate per-subsystem series, or all in one, but limited to some subsystems?

Let's make it as easy as we can both for the subsystem maintainers and for the people trying to track all of it.

When a subsystem takes multiple patches, I'd consider an independent series to save the maintainer the trouble of extracting multiple patches from a larger series.

For the ones that take just one patch, I'd consider an omnibus series. Extracting a single patch is no harder than applying a series, but tracking one omnibus is easier than a dozen lone patches.

There's no clear line between "busy" and "less busy" subsystem. Just start with some obviously busy ones, then iterate. Each iteration should be large enough to be worth the overhead, yet small enough not to scare off reviewers :)

Trust your judgement!

[...]