I've got 2 doubts:<br>1.I've been trying to write an application using Libvirt's Java API which should run on both Xen and KVM running machines and execute the Xen or KVM code based on the hypervisor used. I want the physical machine to know if it's running Xen or KVM and execute only that code. <br>
<br>While using getURI(), I need to use it as <br>conn.getURI() <br>but then I can't use conn without declaring it previously as Connect conn=new Connect("URI");<br><br>Is there any way to get the URI used and hence the hypervisor used?<br>
<br>2. This question concerns the usage of the listDomains(). When I run this piece of code in KVM, it works perfectly fine but throws an array out of bounds exception in Xen.<br><br>Connect conn=null;<br>             conn = new Connect("xen:///", true);<br>
             int[] id = conn.listDomains();<br>             System.out.println("lD of VM " +id[0]);<br><br>Thanks for your time.<br>P Ramesh<br>