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

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

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

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))

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

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
participants (3)
-
Jiri Denemark
-
John Ferlan
-
Pavel Hrdina