[PATCH] qemuMigrationSrcRun: Don't jump to 'exit_monitor' from outside of the monitor

Peter Krempa posted 1 patch 3 years, 1 month ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/823b48dfb1227335fd80e57c02b0051af4938a70.1615290664.git.pkrempa@redhat.com
src/qemu/qemu_migration.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] qemuMigrationSrcRun: Don't jump to 'exit_monitor' from outside of the monitor
Posted by Peter Krempa 3 years, 1 month ago
Failure of 'qemuMigrationSetDBusVMState' would jump to 'exit_monitor'
but the function isn't called inside of the monitor context.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index e44931dcfa..79dcb4a15d 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -4156,7 +4156,7 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
     }

     if (qemuMigrationSetDBusVMState(driver, vm) < 0)
-        goto exit_monitor;
+        goto error;

     /* Before EnterMonitor, since already qemuProcessStopCPUs does that */
     if (!(flags & VIR_MIGRATE_LIVE) &&
-- 
2.29.2

Re: [PATCH] qemuMigrationSrcRun: Don't jump to 'exit_monitor' from outside of the monitor
Posted by Jiri Denemark 3 years, 1 month ago
On Tue, Mar 09, 2021 at 12:51:04 +0100, Peter Krempa wrote:
> Failure of 'qemuMigrationSetDBusVMState' would jump to 'exit_monitor'
> but the function isn't called inside of the monitor context.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  src/qemu/qemu_migration.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index e44931dcfa..79dcb4a15d 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c
> @@ -4156,7 +4156,7 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
>      }
> 
>      if (qemuMigrationSetDBusVMState(driver, vm) < 0)
> -        goto exit_monitor;
> +        goto error;
> 
>      /* Before EnterMonitor, since already qemuProcessStopCPUs does that */
>      if (!(flags & VIR_MIGRATE_LIVE) &&

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>