[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v3 REBASE v2 2/2] qemu: report drive mirror errors on migration



On Fri, Oct 27, 2017 at 15:37:23 +0300, Nikolay Shirokovskiy wrote:
> ---
>  src/qemu/qemu_blockjob.c  | 14 +++++++++---
>  src/qemu/qemu_blockjob.h  |  3 ++-
>  src/qemu/qemu_driver.c    |  4 ++--
>  src/qemu/qemu_migration.c | 55 +++++++++++++++++++++++++++++++++--------------
>  4 files changed, 54 insertions(+), 22 deletions(-)
...
> @@ -736,24 +752,30 @@ qemuMigrationCancelOneDriveMirror(virQEMUDriverPtr driver,
>  {
>      qemuDomainObjPrivatePtr priv = vm->privateData;
>      char *diskAlias = NULL;
> +    char *error = NULL;
>      int ret = -1;
>      int status;
>      int rv;
>  
> -    status = qemuBlockJobUpdate(driver, vm, asyncJob, disk);
> +    status = qemuBlockJobUpdate(driver, vm, asyncJob, disk, &error);
>      switch (status) {
>      case VIR_DOMAIN_BLOCK_JOB_FAILED:
>      case VIR_DOMAIN_BLOCK_JOB_CANCELED:
>          if (failNoJob) {
> -            virReportError(VIR_ERR_OPERATION_FAILED,
> -                           _("migration of disk %s failed"),
> -                           disk->dst);
> -            return -1;
> +            if (error) {
> +                virReportError(VIR_ERR_OPERATION_FAILED,
> +                               _("migration of disk %s failed: %s"),
> +                               disk->dst, error);
> +            } else {
> +                virReportError(VIR_ERR_OPERATION_FAILED,
> +                               _("migration of disk %s failed"), disk->dst);
> +            }
> +            goto cleanup;
>          }
> -        return 1;
> -
> +    /* fallthrough */

Use ATTRIBUTE_FALLTHROUGH instead of this comment.

>      case VIR_DOMAIN_BLOCK_JOB_COMPLETED:
> -        return 1;
> +        ret = 1;
> +        goto cleanup;
>      }
>  
>      if (!(diskAlias = qemuAliasFromDisk(disk)))
> @@ -771,6 +793,7 @@ qemuMigrationCancelOneDriveMirror(virQEMUDriverPtr driver,
>  
>   cleanup:
>      VIR_FREE(diskAlias);
> +    VIR_FREE(error);
>      return ret;
>  }
>  

ACK with the small change.

I'll push this series after the release.

Jirka


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]