Re: [PATCH v4 4/6] vz: support migration uri

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

 



On Wed, Sep 02, 2015 at 03:09:25PM +0300, Nikolay Shirokovskiy wrote:
> Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@xxxxxxxxxxxxx>
> ---
>  src/vz/vz_driver.c |   58 ++++++++++++++++++++++++++++++++++++++++++++++++---
>  1 files changed, 54 insertions(+), 4 deletions(-)

This should really be part of the 2nd patch, since you need to
deal with the migration URI right from start.

> diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
> index 2760e63..e8b198a 100644
> --- a/src/vz/vz_driver.c
> +++ b/src/vz/vz_driver.c
> @@ -1463,10 +1463,53 @@ vzMakeVzUri(const char *connuri_str)
>      return vzuri;
>  }
>  
> +virURIPtr
> +vzParseVzURI(const char *uri_str)
> +{
> +    virURIPtr uri = NULL;
> +    int ret = -1;
> +
> +    if (!(uri = virURIParse(uri_str)))
> +        goto cleanup;
> +
> +    if (uri->scheme == NULL || uri->server == NULL) {
> +        virReportError(VIR_ERR_INVALID_ARG,
> +                       _("scheme and host are mandatory vz migration URI: %s"),
> +                       uri_str);
> +        goto cleanup;
> +    }
> +
> +    if (uri->user != NULL || uri->path != NULL ||
> +        uri->query != NULL || uri->fragment != NULL) {
> +        virReportError(VIR_ERR_INVALID_ARG,
> +                       _("only scheme, host and port are supported in "
> +                         "vz migration URI: %s"), uri_str);
> +        goto cleanup;
> +    }
> +
> +    if (STRNEQ(uri->scheme, "tcp")) {
> +        virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
> +                       _("unsupported scheme %s in migration URI %s"),
> +                       uri->scheme, uri_str);
> +        goto cleanup;
> +    }

BTW, we should also fill in the 'migrateTrans' field in the virCapsHost
struct to list the 'tcp' scheme. Nothing much actually uses this in
reality, but it is technical best practice for us to list supported
URIs there


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
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]