[PATCH] migration: postcopy take proper error return

Dr. David Alan Gilbert (git) posted 1 patch 3 years, 10 months ago
Test FreeBSD passed
Test docker-quick@centos7 passed
Test checkpatch passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200701093557.130096-1-dgilbert@redhat.com
Maintainers: "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Juan Quintela <quintela@redhat.com>
migration/postcopy-ram.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] migration: postcopy take proper error return
Posted by Dr. David Alan Gilbert (git) 3 years, 10 months ago
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

This function returns a boolean success and we're returning -1;
lets just use the 'out' error path.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Fixes: 58b7c17e226 ("Disable mlock around incoming postcopy")
Buglink: https://bugs.launchpad.net/qemu/+bug/1885720
---
 migration/postcopy-ram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index a36402722b..bef2a3afed 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -389,7 +389,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis)
      */
     if (munlockall()) {
         error_report("%s: munlockall: %s", __func__,  strerror(errno));
-        return -1;
+        goto out;
     }
 
     /*
-- 
2.26.2


Re: [PATCH] migration: postcopy take proper error return
Posted by Dr. David Alan Gilbert 3 years, 9 months ago
* Dr. David Alan Gilbert (git) (dgilbert@redhat.com) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> This function returns a boolean success and we're returning -1;
> lets just use the 'out' error path.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Fixes: 58b7c17e226 ("Disable mlock around incoming postcopy")
> Buglink: https://bugs.launchpad.net/qemu/+bug/1885720

queued

> ---
>  migration/postcopy-ram.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
> index a36402722b..bef2a3afed 100644
> --- a/migration/postcopy-ram.c
> +++ b/migration/postcopy-ram.c
> @@ -389,7 +389,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis)
>       */
>      if (munlockall()) {
>          error_report("%s: munlockall: %s", __func__,  strerror(errno));
> -        return -1;
> +        goto out;
>      }
>  
>      /*
> -- 
> 2.26.2
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


Re: [PATCH] migration: postcopy take proper error return
Posted by Thomas Huth 3 years, 10 months ago
On 01/07/2020 11.35, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> This function returns a boolean success and we're returning -1;
> lets just use the 'out' error path.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Fixes: 58b7c17e226 ("Disable mlock around incoming postcopy")
> Buglink: https://bugs.launchpad.net/qemu/+bug/1885720
> ---
>   migration/postcopy-ram.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
> index a36402722b..bef2a3afed 100644
> --- a/migration/postcopy-ram.c
> +++ b/migration/postcopy-ram.c
> @@ -389,7 +389,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis)
>        */
>       if (munlockall()) {
>           error_report("%s: munlockall: %s", __func__,  strerror(errno));
> -        return -1;
> +        goto out;
>       }

Sounds like the right thing to do here.

Reviewed-by: Thomas Huth <thuth@redhat.com>