Thanks Matthias,

can you please have a look at the program attached? this should work as i have used free() call. but its not working for me.


On Mon, Oct 18, 2010 at 6:20 PM, Bryan Kearney <> wrote:
On 10/15/2010 10:05 AM, Matthias Bolte wrote:
2010/10/13 Matthias Bolte<>:
2010/10/12 Matthias Bolte<>:
2010/10/12 Ravi Pawar<>:

i am trying to undefine a domain  by using dm.undefine();
and then trying to create one with same name is giving me error saying
'Domain not found: no domain with matching uuid

i have attached my test program which reproduces the issue.

please let me know where i am going wrong?

configuration: libvirt : 0.6.3
                    Java Bindings: 0.4.2

I didn't look into this problem in detail, but I think you need to
call free on the Domain object after you undefined it.

dm = null;


Okay, calling free doesn't help. I tested it with libvirt 0.6.3 and
libvirt-java 0.4.6 and can reproduce your problem.

This problem is fixed in libvirt 0.8.2. I didn't track it down to the
actual commit.

So in order to fix your problem you'll have to update libvirt to 0.8.2
or identify the commit between 0.8.1 and 0.8.2 that fixes your problem
and backport it to 0.6.3.


I found the commit (30ec755ecb3350116d2851afa0de02e77dbe2c51) that
avoids the problem in your original test code. I say 'avoid' instead
of 'fix' because the actual fix is to call free on the domain objects
after undefining them as I initially suggested. But when I tested this
I did it wrong and jumped to false conclusions.

Just to say it once again: Adding free calls solve this problem for me
with libvirt 0.6.3.

I attached a modified version of your test code that works for me.

Which the latest code has.

-- bk

Thanks & Regards

Ravi Pawar