[libvirt] [PATCH v3 14/14] migration: check dconnuri in p2p mode
Jiri Denemark
jdenemar at redhat.com
Wed Sep 30 13:47:18 UTC 2015
On Fri, Sep 18, 2015 at 18:05:52 +0300, Nikolay Shirokovskiy wrote:
> Check dconnuri is not null or we will catch nullpointer later.
> I hope this makes Coverity happy.
>
> Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy at virtuozzo.com>
> ---
> src/libvirt-domain.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
> index f012f4b..380f374 100644
> --- a/src/libvirt-domain.c
> +++ b/src/libvirt-domain.c
> @@ -4384,7 +4384,9 @@ virDomainMigrateToURI2(virDomainPtr domain,
> if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
> goto cleanup;
>
> - if (!(flags & VIR_MIGRATE_PEER2PEER))
> + if (flags & VIR_MIGRATE_PEER2PEER)
> + virCheckNonNullArgGoto(dconnuri, cleanup);
> + else
> dconnuri = NULL;
>
> ret = virDomainMigrateUnmanaged(domain, NULL, flags,
> @@ -4454,7 +4456,9 @@ virDomainMigrateToURI3(virDomainPtr domain,
> if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
> goto cleanup;
>
> - if (!(flags & VIR_MIGRATE_PEER2PEER))
> + if (flags & VIR_MIGRATE_PEER2PEER)
> + virCheckNonNullArgGoto(dconnuri, cleanup);
> + else
> dconnuri = NULL;
>
> ret = virDomainMigrateUnmanagedParams(domain, dconnuri,
ACK, although you may need to update the labels after dropping the
previous patch.
Jirka
More information about the libvir-list
mailing list