All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/2] Error reporting patches for 2020-10-09
@ 2020-10-09  6:48 Markus Armbruster
  2020-10-09  6:48 ` [PULL 1/2] error: Remove NULL checks on error_propagate() calls (again) Markus Armbruster
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Markus Armbruster @ 2020-10-09  6:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

The following changes since commit 497d415d76b9f59fcae27f22df1ca2c3fa4df64e:

  Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20201008-1' into staging (2020-10-08 21:41:20 +0100)

are available in the Git repository at:

  git://repo.or.cz/qemu/armbru.git tags/pull-error-2020-10-09

for you to fetch changes up to 805d44961b9015716cc13c1d3e49457af3970d82:

  error: Use error_fatal to simplify obvious fatal errors (again) (2020-10-09 08:36:23 +0200)

----------------------------------------------------------------
Error reporting patches for 2020-10-09

----------------------------------------------------------------
Markus Armbruster (2):
      error: Remove NULL checks on error_propagate() calls (again)
      error: Use error_fatal to simplify obvious fatal errors (again)

 exec.c                     | 11 +++--------
 hw/net/virtio-net.c        |  8 ++------
 hw/s390x/s390-virtio-ccw.c |  7 +------
 hw/virtio/vhost.c          | 10 +++-------
 migration/colo.c           |  4 +---
 migration/migration.c      |  8 ++------
 6 files changed, 12 insertions(+), 36 deletions(-)

-- 
2.26.2



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PULL 1/2] error: Remove NULL checks on error_propagate() calls (again)
  2020-10-09  6:48 [PULL 0/2] Error reporting patches for 2020-10-09 Markus Armbruster
@ 2020-10-09  6:48 ` Markus Armbruster
  2020-10-09  9:43   ` Jens Freimann
  2020-10-09  6:48 ` [PULL 2/2] error: Use error_fatal to simplify obvious fatal errors (again) Markus Armbruster
  2020-10-09 14:47 ` [PULL 0/2] Error reporting patches for 2020-10-09 Peter Maydell
  2 siblings, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2020-10-09  6:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Jens Freimann, Hailiang Zhang, Juan Quintela

Patch created mechanically by rerunning:

    $ spatch --sp-file scripts/coccinelle/error_propagate_null.cocci \
             --macro-file scripts/cocci-macro-file.h \
             --use-gitgrep .

Cc: Jens Freimann <jfreimann@redhat.com>
Cc: Hailiang Zhang <zhang.zhanghailiang@huawei.com>
Cc: Juan Quintela <quintela@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200722084048.1726105-4-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 hw/net/virtio-net.c   | 8 ++------
 migration/colo.c      | 4 +---
 migration/migration.c | 8 ++------
 3 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 7bf27b9db7..a160a9da9c 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -817,9 +817,7 @@ static void failover_add_primary(VirtIONet *n, Error **errp)
             "sure primary device has parameter"
             " failover_pair_id=<virtio-net-id>\n");
 }
-    if (err) {
-        error_propagate(errp, err);
-    }
+    error_propagate(errp, err);
 }
 
 static int is_my_primary(void *opaque, QemuOpts *opts, Error **errp)
@@ -873,9 +871,7 @@ static DeviceState *virtio_connect_failover_devices(VirtIONet *n,
         n->primary_device_id = g_strdup(prim_dev->id);
         n->primary_device_opts = prim_dev->opts;
     } else {
-        if (err) {
-            error_propagate(errp, err);
-        }
+        error_propagate(errp, err);
     }
 
     return prim_dev;
diff --git a/migration/colo.c b/migration/colo.c
index 80788d46b5..3f1d3dfd95 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -798,9 +798,7 @@ static void colo_incoming_process_checkpoint(MigrationIncomingState *mis,
 
     colo_send_message(mis->to_src_file, COLO_MESSAGE_VMSTATE_LOADED,
                  &local_err);
-    if (local_err) {
-        error_propagate(errp, local_err);
-    }
+    error_propagate(errp, local_err);
 }
 
 static void colo_wait_handle_message(MigrationIncomingState *mis,
diff --git a/migration/migration.c b/migration/migration.c
index aca7fdcd0b..0575ecb379 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -623,9 +623,7 @@ void migration_fd_process_incoming(QEMUFile *f, Error **errp)
     }
 
     if (migration_incoming_setup(f, &local_err)) {
-        if (local_err) {
-            error_propagate(errp, local_err);
-        }
+        error_propagate(errp, local_err);
         return;
     }
     migration_incoming_process();
@@ -647,9 +645,7 @@ void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)
         }
 
         if (migration_incoming_setup(f, &local_err)) {
-            if (local_err) {
-                error_propagate(errp, local_err);
-            }
+            error_propagate(errp, local_err);
             return;
         }
 
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PULL 2/2] error: Use error_fatal to simplify obvious fatal errors (again)
  2020-10-09  6:48 [PULL 0/2] Error reporting patches for 2020-10-09 Markus Armbruster
  2020-10-09  6:48 ` [PULL 1/2] error: Remove NULL checks on error_propagate() calls (again) Markus Armbruster
@ 2020-10-09  6:48 ` Markus Armbruster
  2020-10-09 14:47 ` [PULL 0/2] Error reporting patches for 2020-10-09 Peter Maydell
  2 siblings, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2020-10-09  6:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, David Hildenbrand, Eric Auger

Patch created mechanically by rerunning:

    $ spatch --in-place --sp-file scripts/coccinelle/use-error_fatal.cocci \
	     --macro-file scripts/cocci-macro-file.h --use-gitgrep .

Variables now unused dropped manually.

Cc: Eric Auger <eric.auger@redhat.com>
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200722084048.1726105-5-armbru@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
---
 exec.c                     | 11 +++--------
 hw/s390x/s390-virtio-ccw.c |  7 +------
 hw/virtio/vhost.c          | 10 +++-------
 3 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/exec.c b/exec.c
index ec68f4a9ca..bca441f7fd 100644
--- a/exec.c
+++ b/exec.c
@@ -623,8 +623,7 @@ static void tcg_register_iommu_notifier(CPUState *cpu,
      */
     MemoryRegion *mr = MEMORY_REGION(iommu_mr);
     TCGIOMMUNotifier *notifier;
-    Error *err = NULL;
-    int i, ret;
+    int i;
 
     for (i = 0; i < cpu->iommu_notifiers->len; i++) {
         notifier = g_array_index(cpu->iommu_notifiers, TCGIOMMUNotifier *, i);
@@ -653,12 +652,8 @@ static void tcg_register_iommu_notifier(CPUState *cpu,
                             0,
                             HWADDR_MAX,
                             iommu_idx);
-        ret = memory_region_register_iommu_notifier(notifier->mr, &notifier->n,
-                                                    &err);
-        if (ret) {
-            error_report_err(err);
-            exit(1);
-        }
+        memory_region_register_iommu_notifier(notifier->mr, &notifier->n,
+                                              &error_fatal);
     }
 
     if (!notifier->active) {
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 28266a3a35..e52182f946 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -161,7 +161,6 @@ static void virtio_ccw_register_hcalls(void)
 static void s390_memory_init(MemoryRegion *ram)
 {
     MemoryRegion *sysmem = get_system_memory();
-    Error *local_err = NULL;
 
     /* allocate RAM for core */
     memory_region_add_subregion(sysmem, 0, ram);
@@ -170,11 +169,7 @@ static void s390_memory_init(MemoryRegion *ram)
      * Configure the maximum page size. As no memory devices were created
      * yet, this is the page size of initial memory only.
      */
-    s390_set_max_pagesize(qemu_maxrampagesize(), &local_err);
-    if (local_err) {
-        error_report_err(local_err);
-        exit(EXIT_FAILURE);
-    }
+    s390_set_max_pagesize(qemu_maxrampagesize(), &error_fatal);
     /* Initialize storage key device */
     s390_skeys_init();
     /* Initialize storage attributes device */
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 68f0a75134..3077fa6ef5 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -712,9 +712,8 @@ static void vhost_iommu_region_add(MemoryListener *listener,
                                          iommu_listener);
     struct vhost_iommu *iommu;
     Int128 end;
-    int iommu_idx, ret;
+    int iommu_idx;
     IOMMUMemoryRegion *iommu_mr;
-    Error *err = NULL;
 
     if (!memory_region_is_iommu(section->mr)) {
         return;
@@ -737,11 +736,8 @@ static void vhost_iommu_region_add(MemoryListener *listener,
     iommu->iommu_offset = section->offset_within_address_space -
                           section->offset_within_region;
     iommu->hdev = dev;
-    ret = memory_region_register_iommu_notifier(section->mr, &iommu->n, &err);
-    if (ret) {
-        error_report_err(err);
-        exit(1);
-    }
+    memory_region_register_iommu_notifier(section->mr, &iommu->n,
+                                          &error_fatal);
     QLIST_INSERT_HEAD(&dev->iommu_list, iommu, iommu_next);
     /* TODO: can replay help performance here? */
 }
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PULL 1/2] error: Remove NULL checks on error_propagate() calls (again)
  2020-10-09  6:48 ` [PULL 1/2] error: Remove NULL checks on error_propagate() calls (again) Markus Armbruster
@ 2020-10-09  9:43   ` Jens Freimann
  0 siblings, 0 replies; 5+ messages in thread
From: Jens Freimann @ 2020-10-09  9:43 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: peter.maydell, Juan Quintela, qemu-devel, Hailiang Zhang

On Fri, Oct 09, 2020 at 08:48:57AM +0200, Markus Armbruster wrote:
>Patch created mechanically by rerunning:
>
>    $ spatch --sp-file scripts/coccinelle/error_propagate_null.cocci \
>             --macro-file scripts/cocci-macro-file.h \
>             --use-gitgrep .
>
>Cc: Jens Freimann <jfreimann@redhat.com>
>Cc: Hailiang Zhang <zhang.zhanghailiang@huawei.com>
>Cc: Juan Quintela <quintela@redhat.com>
>Signed-off-by: Markus Armbruster <armbru@redhat.com>
>Message-Id: <20200722084048.1726105-4-armbru@redhat.com>
>Reviewed-by: Eric Blake <eblake@redhat.com>
>---
> hw/net/virtio-net.c   | 8 ++------
> migration/colo.c      | 4 +---
> migration/migration.c | 8 ++------
> 3 files changed, 5 insertions(+), 15 deletions(-)
>

Reviewed-by: Jens Freimann <jfreimann@redhat.com>




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PULL 0/2] Error reporting patches for 2020-10-09
  2020-10-09  6:48 [PULL 0/2] Error reporting patches for 2020-10-09 Markus Armbruster
  2020-10-09  6:48 ` [PULL 1/2] error: Remove NULL checks on error_propagate() calls (again) Markus Armbruster
  2020-10-09  6:48 ` [PULL 2/2] error: Use error_fatal to simplify obvious fatal errors (again) Markus Armbruster
@ 2020-10-09 14:47 ` Peter Maydell
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2020-10-09 14:47 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: QEMU Developers

On Fri, 9 Oct 2020 at 07:49, Markus Armbruster <armbru@redhat.com> wrote:
>
> The following changes since commit 497d415d76b9f59fcae27f22df1ca2c3fa4df64e:
>
>   Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20201008-1' into staging (2020-10-08 21:41:20 +0100)
>
> are available in the Git repository at:
>
>   git://repo.or.cz/qemu/armbru.git tags/pull-error-2020-10-09
>
> for you to fetch changes up to 805d44961b9015716cc13c1d3e49457af3970d82:
>
>   error: Use error_fatal to simplify obvious fatal errors (again) (2020-10-09 08:36:23 +0200)
>
> ----------------------------------------------------------------
> Error reporting patches for 2020-10-09
>
> ----------------------------------------------------------------
> Markus Armbruster (2):
>       error: Remove NULL checks on error_propagate() calls (again)
>       error: Use error_fatal to simplify obvious fatal errors (again)


Applied, thanks.

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

-- PMM


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-09 14:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09  6:48 [PULL 0/2] Error reporting patches for 2020-10-09 Markus Armbruster
2020-10-09  6:48 ` [PULL 1/2] error: Remove NULL checks on error_propagate() calls (again) Markus Armbruster
2020-10-09  9:43   ` Jens Freimann
2020-10-09  6:48 ` [PULL 2/2] error: Use error_fatal to simplify obvious fatal errors (again) Markus Armbruster
2020-10-09 14:47 ` [PULL 0/2] Error reporting patches for 2020-10-09 Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.