<br>
here is the stacktrace:<br><br><br>org.libvirt.LibvirtException: invalid argument in cannot pin vcpus on an inactive domain<br>        at org.libvirt.ErrorHandler.processError(Unknown Source)<br>        at org.libvirt.Connect.processError(Unknown Source)<br>
        at org.libvirt.Connect.storagePoolLookupByName(Unknown Source)<br>        at TestMultiThreadingLibvirt.run(TestMultiThreadingLibvirt.java:25)<br>        at java.lang.Thread.run(Thread.java:619)<br>libvir: QEMU error : invalid argument in cannot pin vcpus on an inactive domain<br>
<br>from your stacktrace i could find out that you have printed the stacktrace in TestMultiThreadingLibvirtWithError  class. please do check the code i have pasted below for the second thread.<br><br><br>public class TestMultiThreadingLibvirtWithError implements Runnable<br>
{<br>        Connect m_conn = null;<br>        public TestMultiThreadingLibvirtWithError(Connect conn)<br>        {<br>                m_conn = conn;<br><br>        }<br>        @Override<br>        public void run() {<br>
               <br><br>                        try {<br>                                Domain d = m_conn.domainLookupByName("afzaltestmachine");<br>                                VcpuInfo[] vcpuInfo = d.getVcpusInfo();<br>
<br><br>                        }<br>                      <b>  catch (Exception e)<br>                        {<br>                           //we are explicitly eating up the exception here and we know Exception is going to occur here. <br>
<br>                        }</b><br><br>        }<br><br>}<br><br><br>please let me know if my you have more queries to my problem.<br><br><div class="gmail_quote">On Fri, Sep 3, 2010 at 2:37 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;">Well, if the domain is not running then I get this exception with<br>
libvirt 0.6.3 and libvirt-java 0.4.2:<br>
<br>
org.libvirt.LibvirtException: invalid argument in cannot pin vcpus on<br>
an inactive domain<br>
        at org.libvirt.ErrorHandler.processError(Unknown Source)<br>
        at org.libvirt.Connect.processError(Unknown Source)<br>
        at org.libvirt.Domain.processError(Unknown Source)<br>
        at org.libvirt.Domain.getVcpusInfo(Unknown Source)<br>
        <b>at TestMultiThreadingLibvirtWithE</b><b>rror.run(</b><b>TestMultiThreadingLibvirtWithE</b><b>rror.java:20)</b><br>
        at java.lang.Thread.run(Thread.java:636)<br>
<br>
The error message is misleading and current git version gives this<br>
exception when the domain is not running:<br>
<br>
org.libvirt.LibvirtException: Requested operation is not valid: cannot<br>
list vcpu pinning for an inactive domain<br>
        at org.libvirt.ErrorHandler.processError(Unknown Source)<br>
        at org.libvirt.Connect.processError(Unknown Source)<br>
        at org.libvirt.Domain.processError(Unknown Source)<br>
        at org.libvirt.Domain.getVcpusInfo(Unknown Source)<br>
        <b>at TestMultiThreadingLibvirtWithE</b><b>rror.run(</b><b>TestMultiThreadingLibvirtWithE</b><b>rror.java:20)</b><br>
        at java.lang.Thread.run(Thread.java:636)<br>
<br>
And that's perfectly valid, as the complete vCPU information is only<br>
available when the domain is running, therefore the exception is<br>
expected when you call getVcpusInfo on a non-running domain. Also this<br>
has nothing to do with thread-safety.<br>
<br>
If this isn't the exception you're referring to, then please show a<br>
stacktrace of the exception you're seeing.<br>
<br>
Matthias<br>
<br>
2010/9/3 Ravi Pawar <<a href="mailto:ravifc@gmail.com">ravifc@gmail.com</a>>:<br>
<div><div></div><div class="h5">> thank you for the reply and time you spend.<br>
> your guest domain should not be running and then run my program without any<br>
> change.you will see an exception where you dont expect it to occur.<br>
> libvirt : 0.6.3 and libvirt-java: 0.4.2 i am using. Please let me know if i<br>
> miss to provide you any other details.<br>
><br>
><br>
> On Fri, Sep 3, 2010 at 3:29 AM, Matthias Bolte<br>
> <<a href="mailto:matthias.bolte@googlemail.com">matthias.bolte@googlemail.com</a>> wrote:<br>
>><br>
>> 2010/9/2 Ravi Pawar <<a href="mailto:ravifc@gmail.com">ravifc@gmail.com</a>>:<br>
>> > please check the java file attached they throws the exception in case of<br>
>> > passing.<br>
>> > please let me know if i am missing something.<br>
>> ><br>
>><br>
>> Can you explain in more detail what one should do to reproduce the<br>
>> problem you seem to see with the attached code? Also you didn't<br>
>> mention which versions of libvirt and libvirt-java you're using.<br>
>><br>
>> When I run you example code (with a guest name that exists in my setup<br>
>> and libvirt and libvirt-java form current git head) I don't see any<br>
>> exceptions. Even when I add e.printStackTrace() to the catch block of<br>
>> TestMultiThreadingLibvirtWithError I don't see exceptions.<br>
>><br>
>> $ java -classpath<br>
>> ./target/libvirt-0.4.6.jar:./ravi:/usr/share/java/jna.jar Test<br>
>> start class 0<br>
>> start class 1<br>
>> start class 2<br>
>> start class 3<br>
>> start class 4<br>
>> start class 5<br>
>> start class 6<br>
>> start class 7<br>
>> start class 8<br>
>> start class 9<br>
>><br>
>> So this works for me.<br>
>><br>
>> Matthias<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>