[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libvirt-users
Subject:    Re: [libvirt-users] Difference between function Migrate and Migrate2
From:       Eric Blake <eblake () redhat ! com>
Date:       2011-06-13 21:09:05
Message-ID: 4DF67C71.9050702 () redhat ! com
[Download RAW message or body]


On 06/10/2011 07:09 PM, Abhishek Gupta wrote:
> I was reading the API reference for the libvirt, when I came across
> the function  virDomainMigrate and virDomainMigrate2. I am unable to
> find the difference between the two. Can someone please tell the
> difference in the application of the two?

virDomainMigrate2 is the newer API with more features.  Per the comments
in libvirt.c:

 * virDomainMigrate:
 * @domain: a domain object
 * @dconn: destination host (a connection object)
 * @flags: flags
 * @dname: (optional) rename domain to this at destination
 * @uri: (optional) dest hostname/URI as seen from the source host
 * @bandwidth: (optional) specify migration bandwidth limit in Mbps

 * virDomainMigrate2:
 * @domain: a domain object
 * @dconn: destination host (a connection object)
 * @flags: flags
 * @dxml: (optional) XML config for launching guest on target
 * @dname: (optional) rename domain to this at destination
 * @uri: (optional) dest hostname/URI as seen from the source host
 * @bandwidth: (optional) specify migration bandwidth limit in Mbps

the biggest difference is the new @dxml parameter, which allows you to
make changes in the destination by passing in compatible xml to the host
for hypervisors that know how to compare two xml images (as of 0.9.2,
this is pretty much just the qemu hypervisor for kvm guests, but more
may be added later).  For example, only virDomainMigrate2 can let you
update which host resource is used for a particular guest network
interface, so that source and destination host no longer need have
exactly the same names for host resources.  But if you plan on passing
NULL for dxml (implying no changes needed), then the simpler API is
probably sufficient.

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic