that worked :-)<br><br>Thanks,<br>Ravi<br><br><div class="gmail_quote">On Thu, Oct 21, 2010 at 9:04 PM, Matthias Bolte <span dir="ltr"><<a href="mailto:matthias.bolte@googlemail.com">matthias.bolte@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">You need to free() all domain objects that represent the undefine<br>
domain before defining a domain with the same name again:<br>
<br>
System.out.println("first define tt2...");<br>
<div class="im">Domain dm1 = conn.domainDefineXML(dumpxml);<br>
</div>Domain dm2 = conn.domainLookupByName("tt2");<br>
System.out.println("Now undefine....");<br>
if (dm2 != null) {<br>
        System.out.println("undefine tt2...");<br>
        dm2.undefine();<br>
        dm2.free();<br>
        dm1.free(); // <---------- need to free dm1 here too<br>
        System.out.println("undefine tt2... done");<br>
}<br>
<br>
Matthias<br>
<br>
2010/10/21 Ravi Pawar <<a href="mailto:ravifc@gmail.com">ravifc@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Thanks Matthias,<br>
><br>
> can you please have a look at the program attached? this should work as i<br>
> have used free() call. but its not working for me.<br>
><br>
> Thanks,<br>
> Ravi<br>
><br>
> On Mon, Oct 18, 2010 at 6:20 PM, Bryan Kearney <<a href="mailto:bkearney@redhat.com">bkearney@redhat.com</a>> wrote:<br>
>><br>
>> On 10/15/2010 10:05 AM, Matthias Bolte wrote:<br>
>>><br>
>>> 2010/10/13 Matthias Bolte<<a href="mailto:matthias.bolte@googlemail.com">matthias.bolte@googlemail.com</a>>:<br>
>>>><br>
>>>> 2010/10/12 Matthias Bolte<<a href="mailto:matthias.bolte@googlemail.com">matthias.bolte@googlemail.com</a>>:<br>
>>>>><br>
>>>>> 2010/10/12 Ravi Pawar<<a href="mailto:ravifc@gmail.com">ravifc@gmail.com</a>>:<br>
>>>>>><br>
>>>>>> hi,<br>
>>>>>><br>
>>>>>> i am trying to undefine a domain  by using dm.undefine();<br>
>>>>>> and then trying to create one with same name is giving me error saying<br>
>>>>>> 'Domain not found: no domain with matching uuid<br>
>>>>>> 'aeae9d4e-17cb-b661-a612-88ac677c28c1'<br>
>>>>>><br>
>>>>>> i have attached my test program which reproduces the issue.<br>
>>>>>><br>
>>>>>> please let me know where i am going wrong?<br>
>>>>>><br>
>>>>>> configuration: libvirt : 0.6.3<br>
>>>>>>                     Java Bindings: 0.4.2<br>
>>>>><br>
>>>>> I didn't look into this problem in detail, but I think you need to<br>
>>>>> call free on the Domain object after you undefined it.<br>
>>>>><br>
>>>>> dm.undefine();<br>
>>>>> dm.free();<br>
>>>>> dm = null;<br>
>>>>><br>
>>>>> Matthias<br>
>>>>><br>
>>>><br>
>>>> Okay, calling free doesn't help. I tested it with libvirt 0.6.3 and<br>
>>>> libvirt-java 0.4.6 and can reproduce your problem.<br>
>>>><br>
>>>> This problem is fixed in libvirt 0.8.2. I didn't track it down to the<br>
>>>> actual commit.<br>
>>>><br>
>>>> So in order to fix your problem you'll have to update libvirt to 0.8.2<br>
>>>> or identify the commit between 0.8.1 and 0.8.2 that fixes your problem<br>
>>>> and backport it to 0.6.3.<br>
>>>><br>
>>>> Matthias<br>
>>>><br>
>>><br>
>>> I found the commit (30ec755ecb3350116d2851afa0de02e77dbe2c51) that<br>
>>> avoids the problem in your original test code. I say 'avoid' instead<br>
>>> of 'fix' because the actual fix is to call free on the domain objects<br>
>>> after undefining them as I initially suggested. But when I tested this<br>
>>> I did it wrong and jumped to false conclusions.<br>
>>><br>
>>> Just to say it once again: Adding free calls solve this problem for me<br>
>>> with libvirt 0.6.3.<br>
>>><br>
>>> I attached a modified version of your test code that works for me.<br>
>>><br>
>><br>
>> Which the latest code has.<br>
>><br>
>> -- bk<br>
>><br>
>><br>
><br>
><br>
><br>
> --<br>
> Thanks & Regards<br>
><br>
> Ravi Pawar<br>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Thanks & Regards<br><br>Ravi Pawar<br>