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

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

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux