Re: [PATCH 02/12] migration: refactor: reuse p2p url check

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

 



On Fri, Oct 02, 2015 at 10:52:42 +0300, Nikolay Shirokovskiy wrote:
> Refactor dconnuri local server URI check to common API.
> 
> Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
> ---
>  src/libvirt-domain.c |   44 ++++++++++++++++++++++++--------------------
>  1 files changed, 24 insertions(+), 20 deletions(-)
> 
> diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
> index 697d58d..2e43062 100644
> --- a/src/libvirt-domain.c
> +++ b/src/libvirt-domain.c
> @@ -3293,6 +3293,28 @@ virDomainMigrateVersion3Params(virDomainPtr domain,
>  }
>  
>  
> +static int ATTRIBUTE_NONNULL(1)
> +virDomainMigrateCheckNotLocal(const char *dconnuri)
> +{
> +    virURIPtr tempuri = NULL;
> +    int ret = -1;
> +
> +    if (!(tempuri = virURIParse(dconnuri)))
> +        goto cleanup;
> +    if (!tempuri->server || STRPREFIX(tempuri->server, "localhost")) {
> +        virReportInvalidArg(dconnuri, "%s",
> +                            _("Attempt to migrate guest to the same host %s"));
> +        goto cleanup;
> +    }
> +
> +    ret = 0;
> + cleanup:
> +

We usually put an empty line before the label, not after it.

> +    virURIFree(tempuri);
> +    return ret;
> +}

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]