[libvirt] [PATCH 3/3] virsh: migrate: Don't disallow --p2p and --migrateuri

Eric Blake eblake at redhat.com
Tue May 28 21:51:25 UTC 2013


On 05/28/2013 02:44 PM, Cole Robinson wrote:
> Because it's a valid combination. p2p still uses a separate channel
> for qemu migration, so there's value in letting the user specify a manual
> migrate URI for overriding auto-port, or libvirt's FQDN lookup.
> 
> What _isn't_ allowed is --migrateuri and TUNNELLED, since there is
> no separate migration channel. Disallow that instead
> ---
>  tools/virsh-domain.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

ACK.  This exposes more power of the underlying API (the fact that it
only touches tools/virsh-domain.c is good).

> 
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index 4fdf4ba..eb8688d 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -8306,15 +8306,15 @@ doMigrate(void *opaque)
>  
>      if ((flags & VIR_MIGRATE_PEER2PEER) ||
>          vshCommandOptBool(cmd, "direct")) {
> -        /* For peer2peer migration or direct migration we only expect one URI
> -         * a libvirt URI, or a hypervisor specific URI. */
>  
> -        if (migrateuri != NULL) {
> +        /* migrateuri doesn't make sense for tunnelled migration */
> +        if (flags & VIR_MIGRATE_TUNNELLED && migrateuri != NULL) {
>              vshError(ctl, "%s", _("migrate: Unexpected migrateuri for peer2peer/direct migration"));
>              goto out;
>          }
>  
> -        if (virDomainMigrateToURI2(dom, desturi, NULL, xml, flags, dname, 0) == 0)
> +        if (virDomainMigrateToURI2(dom, desturi, migrateuri,
> +                                   xml, flags, dname, 0) == 0)
>              ret = '0';
>      } else {
>          /* For traditional live migration, connect to the destination host directly. */
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list