[libvirt] [PATCH] qemu: Break endless loop if qemuMigrationResetTLS fails

Jiri Denemark posted 1 patch 7 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/42797b378895f2e76993887e023b3874ea865562.1491302911.git.jdenemar@redhat.com
src/qemu/qemu_migration.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
[libvirt] [PATCH] qemu: Break endless loop if qemuMigrationResetTLS fails
Posted by Jiri Denemark 7 years ago
Jumping to "endjob" label from a code after this label is not a very
good idea.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_migration.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 87d7dcd0c..7f00a3d93 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -5351,9 +5351,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
                                  QEMU_ASYNC_JOB_MIGRATION_IN);
     }
 
-    if (qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
-                              NULL, NULL) < 0)
-        goto endjob;
+    qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN, NULL, NULL);
 
     qemuMigrationJobFinish(driver, vm);
     if (!virDomainObjIsActive(vm))
-- 
2.12.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Break endless loop if qemuMigrationResetTLS fails
Posted by Pavel Hrdina 7 years ago
On Tue, Apr 04, 2017 at 12:48:31PM +0200, Jiri Denemark wrote:
> Jumping to "endjob" label from a code after this label is not a very
> good idea.
> 
> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
> ---
>  src/qemu/qemu_migration.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

ACK

Pavel
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Break endless loop if qemuMigrationResetTLS fails
Posted by John Ferlan 7 years ago

On 04/04/2017 06:48 AM, Jiri Denemark wrote:
> Jumping to "endjob" label from a code after this label is not a very
> good idea.
> 
> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
> ---
>  src/qemu/qemu_migration.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 

D'oh... Not sure if it's too late, but wrap in ignore_value(); similar
to qemuMigrationPrepareAny failure

John

> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 87d7dcd0c..7f00a3d93 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -5351,9 +5351,7 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
>                                   QEMU_ASYNC_JOB_MIGRATION_IN);
>      }
>  
> -    if (qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
> -                              NULL, NULL) < 0)
> -        goto endjob;
> +    qemuMigrationResetTLS(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN, NULL, NULL);
>  
>      qemuMigrationJobFinish(driver, vm);
>      if (!virDomainObjIsActive(vm))
> 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Break endless loop if qemuMigrationResetTLS fails
Posted by Jiri Denemark 7 years ago
On Tue, Apr 04, 2017 at 07:53:55 -0400, John Ferlan wrote:
> 
> 
> On 04/04/2017 06:48 AM, Jiri Denemark wrote:
> > Jumping to "endjob" label from a code after this label is not a very
> > good idea.
> > 
> > Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
> > ---
> >  src/qemu/qemu_migration.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> 
> D'oh... Not sure if it's too late, but wrap in ignore_value(); similar
> to qemuMigrationPrepareAny failure

Why? The ignore_value macro is only needed when the function is declared
with ATTRIBUTE_RETURN_CHECK.

Jirka

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Break endless loop if qemuMigrationResetTLS fails
Posted by John Ferlan 7 years ago

On 04/04/2017 08:29 AM, Jiri Denemark wrote:
> On Tue, Apr 04, 2017 at 07:53:55 -0400, John Ferlan wrote:
>>
>>
>> On 04/04/2017 06:48 AM, Jiri Denemark wrote:
>>> Jumping to "endjob" label from a code after this label is not a very
>>> good idea.
>>>
>>> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
>>> ---
>>>  src/qemu/qemu_migration.c | 4 +---
>>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>>
>>
>> D'oh... Not sure if it's too late, but wrap in ignore_value(); similar
>> to qemuMigrationPrepareAny failure
> 
> Why? The ignore_value macro is only needed when the function is declared
> with ATTRIBUTE_RETURN_CHECK.
> 

Figured that since I had used it that way with PrepareAny - it'd be a
consistency thing since in this path we don't care about the status.
It's a best attempt.  It doesn't really matter that much though.

John

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