[libvirt] [PATCH 1/3] Fix error message when TUNNELLED flag is used in non-p2p migration

Peter Krempa pkrempa at redhat.com
Thu May 22 13:56:57 UTC 2014


On 05/22/14 13:55, Jiri Denemark wrote:
> The current error message is
> 
>     error: use virDomainMigrateToURI3 for peer-to-peer migration
> 
> which is correct but a bit misleading because the client did not specify
> VIR_MIGRATE_PEER2PEER flag. This patch changes the error message to
> 
>     error: cannot perform tunnelled migration without using peer2peer
>     flag
> 
> which is consistent with the error reported by older migration APIs.
> 
> Reported by Rich Jones in
> https://bugzilla.redhat.com/show_bug.cgi?id=1095924
> 
> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> ---
>  src/libvirt.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libvirt.c b/src/libvirt.c
> index 19fa18b..72a9f6d 100644
> --- a/src/libvirt.c
> +++ b/src/libvirt.c
> @@ -5723,12 +5723,18 @@ virDomainMigrate3(virDomainPtr domain,
>                              __FUNCTION__);
>          goto error;
>      }
> -    if (flags & (VIR_MIGRATE_PEER2PEER | VIR_MIGRATE_TUNNELLED)) {
> +    if (flags & VIR_MIGRATE_PEER2PEER) {
>          virReportInvalidArg(flags, "%s",
>                              _("use virDomainMigrateToURI3 for peer-to-peer "
>                                "migration"));
>          goto error;
>      }
> +    if (flags & VIR_MIGRATE_TUNNELLED) {
> +        virReportInvalidArg(flags, "%s",
> +                            _("cannot perform tunnelled migration "
> +                              "without using peer2peer flag"));

<bikeshed> This error message will incline the user to specifying the
VIR_MIGRATE_PEER2PEER flag for this api, so that he receives the error
above.

how about "use virDomainMigrateToURI3 and specify the
VIR_MIGRATE_PEER2PEER flag for tunelled migration"

Not sure whether that will be more clear though.

</bikeshed>

> +        goto error;
> +    }
>  
>      if (flags & VIR_MIGRATE_OFFLINE) {
>          if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
> 

ACK,

Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140522/4fe325ad/attachment-0001.sig>


More information about the libvir-list mailing list