[PATCH v2 1/6] qemu_process.c: check migrateURI when setting VIR_QEMU_PROCESS_START_NEW

Michal Privoznik mprivozn at redhat.com
Wed Dec 2 07:17:37 UTC 2020


On 11/18/20 8:58 PM, Daniel Henrique Barboza wrote:
> qemuProcessCreatePretendCmdPrepare() is setting the
> VIR_QEMU_PROCESS_START_NEW regardless of whether this is
> a migration case or not. This behavior differs from what we're
> doing in qemuProcessStart(), where the flag is set only
> if !migrate && !snapshot.
> 
> Fix it by making the flag setting consistent with what we're
> doing in qemuProcessStart().
> 
> Signed-off-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
> ---
>   src/qemu/qemu_process.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index 579b3c3713..3677da635c 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -7436,7 +7436,10 @@ qemuProcessCreatePretendCmdPrepare(virQEMUDriverPtr driver,
>                     VIR_QEMU_PROCESS_START_AUTODESTROY, -1);
>   
>       flags |= VIR_QEMU_PROCESS_START_PRETEND;
> -    flags |= VIR_QEMU_PROCESS_START_NEW;
> +
> +    if (!migrateURI)
> +        flags |= VIR_QEMU_PROCESS_START_NEW;
> +
>       if (standalone)
>           flags |= VIR_QEMU_PROCESS_START_STANDALONE;
>   
> 

Le sigh, this lead me down the rabbit hole of VIR_QEMU_PROCESS_START_NEW 
flag and where it's used and what consequences this can have. Then I 
read the commit message properly and realized this is only for "pretend" 
case. And of course it's what we do for qemuProcessStart(). Lesson 
learned :-)

Michal




More information about the libvir-list mailing list