[libvirt] [PATCH 2/6] qemu: Fix old tcp:host URIs more cleanly

Ján Tomko jtomko at redhat.com
Mon Sep 22 16:34:47 UTC 2014


On 09/17/2014 04:53 PM, Jiri Denemark wrote:
> For compatibility with old libvirt we need to support both tcp:host and
> tcp://host migration URIs. Let's make the code that parses them a bit
> cleaner.
> 
> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> ---
> 
> Notes:
>     Version 3:
>     - new patch to make "qemu: RDMA migration support" a bit more
>       straightforward
> 
>  src/qemu/qemu_migration.c | 77 ++++++++++++++++++++---------------------------
>  1 file changed, 33 insertions(+), 44 deletions(-)
> 

> @@ -2931,27 +2935,22 @@ qemuMigrationPrepareDirect(virQEMUDriverPtr driver,
>              if (virPortAllocatorAcquire(driver->migrationPorts, &port) < 0)
>                  goto cleanup;
>  
> +            /* Send well-formed URI only if uri_in was well-formed */
>              if (well_formed_uri) {
>                  uri->port = port;
> -
> -                /* Caller frees */
>                  if (!(*uri_out = virURIFormat(uri)))
>                      goto cleanup;
>              } else {
> -                /* Caller frees */
>                  if (virAsprintf(uri_out, "%s:%d", uri_in, port) < 0)
>                      goto cleanup;
>              }
> -
>          } else {
>              port = uri->port;
>              autoPort = false;
>          }
>      }


>  
> -    if (*uri_out)
> -        VIR_DEBUG("Generated uri_out=%s", *uri_out);
> -
> +    VIR_DEBUG("Generated uri_out=%s", *uri_out);

If uri_in contains a port, uri_out will not be generated.

ACK with this hunk removed.

Jan

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


More information about the libvir-list mailing list