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

> Split logical blocks by newlines, that simplify reading the code.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
> ---
>  migration/vmstate.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/migration/vmstate.c b/migration/vmstate.c
> index 5111e7a141..dd7cd27993 100644
> --- a/migration/vmstate.c
> +++ b/migration/vmstate.c
> @@ -139,6 +139,7 @@ int vmstate_load_state(QEMUFile *f, const 
> VMStateDescription *vmsd,
>      int ret = 0;
>  
>      trace_vmstate_load_state(vmsd->name, version_id);
> +
>      if (version_id > vmsd->version_id) {
>          error_setg(errp, "%s: incoming version_id %d is too new "
>                     "for local version_id %d",
> @@ -146,6 +147,7 @@ int vmstate_load_state(QEMUFile *f, const 
> VMStateDescription *vmsd,
>          trace_vmstate_load_state_end(vmsd->name, "too new", -EINVAL);
>          return -EINVAL;
>      }
> +
>      if  (version_id < vmsd->minimum_version_id) {
>          error_setg(errp, "%s: incoming version_id %d is too old "
>                     "for local minimum version_id %d",
> @@ -153,6 +155,7 @@ int vmstate_load_state(QEMUFile *f, const 
> VMStateDescription *vmsd,
>          trace_vmstate_load_state_end(vmsd->name, "too old", -EINVAL);
>          return -EINVAL;
>      }
> +
>      if (vmsd->pre_load_errp) {
>          if (!vmsd->pre_load_errp(opaque, errp)) {
>              error_prepend(errp, "pre load hook failed for: '%s', "
> @@ -171,9 +174,12 @@ int vmstate_load_state(QEMUFile *f, const 
> VMStateDescription *vmsd,
>              return ret;
>          }
>      }
> +
>      while (field->name) {
>          bool exists = vmstate_field_exists(vmsd, field, opaque, version_id);
> +
>          trace_vmstate_load_state_field(vmsd->name, field->name, exists);
> +
>          if (exists) {
>              void *first_elem = opaque + field->offset;
>              int i, n_elems = vmstate_n_elems(opaque, field);
> @@ -184,6 +190,7 @@ int vmstate_load_state(QEMUFile *f, const 
> VMStateDescription *vmsd,
>                  first_elem = *(void **)first_elem;
>                  assert(first_elem || !n_elems || !size);
>              }
> +
>              for (i = 0; i < n_elems; i++) {
>                  void *curr_elem = first_elem + size * i;
>                  const VMStateField *inner_field;
> @@ -235,6 +242,7 @@ int vmstate_load_state(QEMUFile *f, const 
> VMStateDescription *vmsd,
>                                     vmsd->name, ret);
>                      }
>                  }
> +
>                  if (ret < 0) {
>                      qemu_file_set_error(f, ret);
>                      trace_vmstate_load_field_error(field->name, ret);
> @@ -249,11 +257,13 @@ int vmstate_load_state(QEMUFile *f, const 
> VMStateDescription *vmsd,
>          field++;
>      }
>      assert(field->flags == VMS_END);
> +
>      ret = vmstate_subsection_load(f, vmsd, opaque, errp);
>      if (ret != 0) {
>          qemu_file_set_error(f, ret);
>          return ret;
>      }
> +
>      if (vmsd->post_load_errp) {
>          if (!vmsd->post_load_errp(opaque, version_id, errp)) {
>              error_prepend(errp, "post load hook failed for: %s, version_id: "
> @@ -271,7 +281,9 @@ int vmstate_load_state(QEMUFile *f, const 
> VMStateDescription *vmsd,
>                         ret);
>          }
>      }
> +
>      trace_vmstate_load_state_end(vmsd->name, "end", ret);
> +
>      return ret;
>  }

Reviewed-by: Fabiano Rosas <[email protected]>

Reply via email to