Re: [PATCH] qemu: fix operation job association when qemuCaps is NULL.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Sep 21, 2019 at 13:55:22 -0300, jcfaracco@xxxxxxxxx wrote:
> From: Julio Faracco <jcfaracco@xxxxxxxxx>
> 
> Function qemuMigrationEatCookie() calls
> qemuMigrationCookieXMLParseStr(), when qemuCaps is not set, function
> assumes priv as a NULL pointer. At the end, function tries to set
> job info operation to the same current job. But, if priv is NULL due to
> missing qemuCaps, code returns a Null Pointer Exception. This commit
> adds an extra check to verify it.
> 
> Signed-off-by: Julio Faracco <jcfaracco@xxxxxxxxx>
> ---
>  src/qemu/qemu_migration_cookie.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
> index 25d3fecd74..945b640e2c 100644
> --- a/src/qemu/qemu_migration_cookie.c
> +++ b/src/qemu/qemu_migration_cookie.c
> @@ -1538,7 +1538,8 @@ qemuMigrationEatCookie(virQEMUDriverPtr driver,
>          }
>      }
>  
> -    if (flags & QEMU_MIGRATION_COOKIE_STATS && mig->jobInfo)
> +    if (flags & QEMU_MIGRATION_COOKIE_STATS && mig->jobInfo &&
> +        priv && priv->job.current)
>          mig->jobInfo->operation = priv->job.current->operation;

Did you actually hit this somehow? If so, please provide a full
backtrace as the problem lies somewhere else and it should be fixed in a
different way. This would just hide incorrect usage of
qemuMigrationEatCookie, in which case it's better to crash.

Jirka

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux