[Libvir] [PATCH] virDomainMigrate version 4 (for discussion only!)

Richard W.M. Jones rjones at redhat.com
Mon Jul 23 13:49:08 UTC 2007


Richard W.M. Jones wrote:
> Attached is an updated patch which adds a "virsh migrate" subcommand.
> 
> I also rebuilt the API & Python binding using the generator.
> 
> Two known problems with the auto-generated Python binding at the moment:
> 
> (1) It's attached to the connection object (conn.migrate (...)) instead 
> of the domain object (dom.migrate (...)).  It looks like the generator 
> is confused about a function which takes both a domain ptr and a connect 
> ptr.

Actually the above isn't right.  The generator makes two copies of the 
function:

   class virDomain:
       def migrate(self, dconn, flags, dname, uri, bandwidth):

and:

   class virConnect:
       def migrate(self, domain, flags, dname, uri, bandwidth):

The first (virDomain.migrate) binding unfortunately still a contained 
problem:  The generator doesn't understand that the domain object which 
is returned exists in the scope of the destination connection (dconn, 
not conn).

This was solved in the general case when I added the 
virDomainGetConnect[1] function, so I will change the Python generator 
accordingly in a future patch.

The second (virConnect.migrate) binding is correct, although a little 
peculiar.  You would have to use it like this:
   dconn.migrate (domain, etc.).
If people are happy with this, I will leave it.

> (2) I need to get the generator to export the VIR_MIGRATE_LIVE flag.  At 
> the moment you need to pass 0|1 for the flag parameter.

Added this to the upcoming (version 5) patch.

Rich.

[1]http://www.redhat.com/archives/libvir-list/2007-June/thread.html#00365




More information about the libvir-list mailing list