[libvirt] first argument in virDomainMigrate, is it free'ed?

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hi, I saw that freeing the dom after a migration takes place results in: libvir: Domain error : invalid domain pointer in virDomainFree Now I wonder, if this is the case, could a normale migrate function 'just' be: domain = virDomainMigrate(domain, ....) Or is this unsafe; for example as a domain migration fails? Stefan -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREKAAYFAkjqOYwACgkQYH1+F2Rqwn0NZACffFESznbeElKNVgt65YXPGzXX ausAmwZ7HScE0/RTtDWm2uug/dC1S21K =xpn6 -----END PGP SIGNATURE-----

On Mon, Oct 06, 2008 at 06:15:08PM +0200, Stefan de Konink wrote:
I saw that freeing the dom after a migration takes place results in:
libvir: Domain error : invalid domain pointer in virDomainFree
That would be a bug ...
Now I wonder, if this is the case, could a normale migrate function 'just' be:
domain = virDomainMigrate(domain, ....)
Or is this unsafe; for example as a domain migration fails?
virDomainMigrate shouldn't free the source domain ever. It should be up to the caller to free it later once they've ascertained that the migration was successful. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v

On Wed, Oct 08, 2008 at 05:08:59PM +0100, Richard W.M. Jones wrote:
On Mon, Oct 06, 2008 at 06:15:08PM +0200, Stefan de Konink wrote:
I saw that freeing the dom after a migration takes place results in:
libvir: Domain error : invalid domain pointer in virDomainFree
That would be a bug ...
Now I wonder, if this is the case, could a normale migrate function 'just' be:
domain = virDomainMigrate(domain, ....)
Or is this unsafe; for example as a domain migration fails?
virDomainMigrate shouldn't free the source domain ever. It should be up to the caller to free it later once they've ascertained that the migration was successful.
I don't see any code which free's the source domain, so I'm not sure that's the problem. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Thanks you are too quick :D Richard W.M. Jones schreef:
On Mon, Oct 06, 2008 at 06:15:08PM +0200, Stefan de Konink wrote:
I saw that freeing the dom after a migration takes place results in:
libvir: Domain error : invalid domain pointer in virDomainFree
That would be a bug ...
I'll try to figure out if it is in my code, or that I can reproduce it with some sample code. Stefan -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREKAAYFAkjs3OcACgkQYH1+F2Rqwn023ACghl4+nroZXFgGUexPCH08DJpw uZ4AoItG2BxFogYnBh3kt2amVjis1LFM =OOIv -----END PGP SIGNATURE-----
participants (3)
-
Daniel P. Berrange
-
Richard W.M. Jones
-
Stefan de Konink