[libvirt] RFC: libvirt java bindings based on JNA

2009-07-25 Thread Bryan Kearney
I would like to get some comments on an initial cut of the java bindings 
on top of JNA[1]. They are not 100% complete (see below), but they are 
good enough to be criticized. In addition, if there are features 
additions to the API which people are interested in, I would appreciate 
the feedback on that.


JNA is a java implementation of the Foreign Function Interface [2]. The 
main benefit is that it removes the need for all the nasty C glue code.
What replaces it is pure java mapping files. If you look in the 
org.libvirt.jna package in the code, you will see that the 2928 lines of 
jni code have been replaced by 427 lines of java code. To be fair, some 
of the business logic from the C code is now in the org.libvirt 
package... but you get the point.


The original java API has remained the same. The open issues with the 
code are:


1) Authorization callback has not been tested.
2) GetUUID is not returning the correct int array.
3) Find by UUID is not working

These all are mapping issues to be worked out. The rest of the code 
should be working, but I would appreciate it being exercised. The main 
drawback to this approach is that it requires the use of java 1.6. I 
looked on EPEL, F10, and F11.. and java 1.6 and the JNA jar file are 
available so I did not believe this was an issue.


I will send a patch stream to the list, but you can also get the code 
via an SRPM [3] or via github [4].


-- bk

[1] https://jna.dev.java.net/
[2] http://en.wikipedia.org/wiki/Foreign_function_interface
[3] http://bkearney.fedorapeople.org/libvirt-java-0.3.0pre-1.fc10.src.rpm
[4] http://github.com/bkearney/libvirt-java/tree/jna

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] Java JNA Patch series

2009-07-25 Thread Bryan Kearney
Per the earlier email, here is the patch series

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] Auth code to review

2009-07-25 Thread Bryan Kearney
---
 src/org/libvirt/Connect.java  |  187 ++-
 src/org/libvirt/ConnectAuth.java  |   15 ++-
 src/org/libvirt/Domain.java   |7 +-
 src/org/libvirt/ErrorHandler.java |3 +-
 src/org/libvirt/Network.java  |5 +-
 src/org/libvirt/StoragePool.java  |  129 ++--
 src/org/libvirt/StoragePoolInfo.java  |6 +
 src/org/libvirt/StorageVol.java   |   67 ++---
 src/org/libvirt/StorageVolInfo.java   |6 +
 src/org/libvirt/jna/Libvirt.java  |  209 +++--
 src/org/libvirt/jna/virConnectAuth.java   |   11 ++
 src/org/libvirt/jna/virConnectCredential.java |   12 ++
 src/test.java |   16 +-
 13 files changed, 438 insertions(+), 235 deletions(-)
 create mode 100644 src/org/libvirt/jna/virConnectAuth.java
 create mode 100644 src/org/libvirt/jna/virConnectCredential.java

diff --git a/src/org/libvirt/Connect.java b/src/org/libvirt/Connect.java
index bab1d23..900f6fc 100644
--- a/src/org/libvirt/Connect.java
+++ b/src/org/libvirt/Connect.java
@@ -1,13 +1,22 @@
 package org.libvirt;
 
+import java.util.Arrays;
+
 import org.libvirt.LibvirtException;
 import org.libvirt.StoragePool;
 import org.libvirt.StorageVol;
+import org.libvirt.jna.ConnectionPointer;
+import org.libvirt.jna.DomainPointer;
 import org.libvirt.jna.Libvirt;
+import org.libvirt.jna.NetworkPointer;
+import org.libvirt.jna.StoragePoolPointer;
+import org.libvirt.jna.StorageVolPointer;
+import org.libvirt.jna.virConnectAuth;
 import org.libvirt.jna.virError;
 import org.libvirt.jna.virNodeInfo;
 
 import com.sun.jna.Native;
+import com.sun.jna.NativeLong;
 import com.sun.jna.Pointer;
 import com.sun.jna.ptr.ByReference;
 import com.sun.jna.ptr.LongByReference;
@@ -34,7 +43,7 @@ public class Connect {
/**
 * the native virConnectPtr.
 */
-   protected Pointer VCP;
+   protected ConnectionPointer VCP;
 
 
/**
@@ -82,8 +91,18 @@ public class Connect {
 * @see a href=http://libvirt.org/uri.html;The URI documentation/a
 */
public Connect(String uri, ConnectAuth auth, int flags) throws 
LibvirtException {
-throw new RuntimeException(Not Implemented) ;  
-// VCP = _openAuth(uri, auth, flags);
+   virConnectAuth vAuth = new virConnectAuth() ;
+   vAuth.cb = auth ;
+   vAuth.cbdata = null ;
+   vAuth.ncredtype = auth.credType.length ;
+   vAuth.credtype = new int[vAuth.ncredtype] ;
+   
+   for (int x = 0 ; x  vAuth.ncredtype ; x++) {
+   vAuth.credtype[x] = auth.credType[x].ordinal() ;
+   }
+   
+VCP = libvirt.virConnectOpenAuth(uri, vAuth, flags) ;  
+processError() ;
}
 
/**
@@ -378,7 +397,7 @@ public class Connect {
public Network networkLookupByName(String name)
throws LibvirtException {
Network returnValue = null ;
-   Pointer ptr = libvirt.virNetworkLookupByName(VCP, name) ;
+   NetworkPointer ptr = libvirt.virNetworkLookupByName(VCP, name) ;
 processError() ;   
if (ptr != null) {
returnValue = new Network(this, ptr) ;
@@ -397,12 +416,9 @@ public class Connect {
 */
public Network networkLookupByUUID(int[] UUID)
throws LibvirtException {
-   StringBuilder uuidString = new StringBuilder() ;
-   for (int i : UUID) {
-   uuidString.append(i) ;
-   }
+String uuidString = Connect.createUUIDString(UUID) ;
 Network returnValue = null ;
-Pointer ptr = libvirt.virNetworkLookupByUUID(VCP, 
uuidString.toString()) ;
+NetworkPointer ptr = libvirt.virNetworkLookupByUUID(VCP, uuidString) ;
 processError() ;
 if (ptr != null) {
 returnValue = new Network(this, ptr) ;
@@ -421,7 +437,7 @@ public class Connect {
public Network networkLookupByUUIDString(String UUID)
throws LibvirtException {
 Network returnValue = null ;
-Pointer ptr = libvirt.virNetworkLookupByUUIDString(VCP, UUID);
+NetworkPointer ptr = libvirt.virNetworkLookupByUUIDString(VCP, UUID);
 processError() ;
 if (ptr != null) {
 returnValue = new Network(this, ptr) ;
@@ -442,7 +458,7 @@ public class Connect {
public Network networkCreateXML(String xmlDesc)
throws LibvirtException {
 Network returnValue = null ;
-Pointer ptr = libvirt.virNetworkCreateXML(VCP, xmlDesc) ;
+NetworkPointer ptr = libvirt.virNetworkCreateXML(VCP, xmlDesc) ;
 processError() ;
 if (ptr != null) {
 returnValue = new Network(this, ptr) ;
@@ -463,7 +479,7 @@ public class Connect {

[libvirt] [PATCH] Domain object is converted

2009-07-25 Thread Bryan Kearney
---
 src/org/libvirt/Connect.java |9 +
 src/org/libvirt/Domain.java  |  307 +-
 src/org/libvirt/DomainBlockStats.java|   13 +
 src/org/libvirt/DomainInfo.java  |   14 +
 src/org/libvirt/DomainInterfaceStats.java|   17 ++
 src/org/libvirt/ErrorHandler.java|   11 +-
 src/org/libvirt/Network.java |8 +-
 src/org/libvirt/NodeInfo.java|4 +-
 src/org/libvirt/SchedBooleanParameter.java   |   20 ++-
 src/org/libvirt/SchedDoubleParameter.java|   13 +
 src/org/libvirt/SchedIntParameter.java   |   13 +
 src/org/libvirt/SchedLongParameter.java  |   14 +
 src/org/libvirt/SchedParameter.java  |   43 +++
 src/org/libvirt/SchedUintParameter.java  |   13 +
 src/org/libvirt/SchedUlongParameter.java |   13 +
 src/org/libvirt/VcpuInfo.java|   13 +
 src/org/libvirt/jna/Libvirt.java |   42 +++-
 src/org/libvirt/jna/virDomainBlockStats.java |   12 +
 src/org/libvirt/jna/virDomainInfo.java   |   13 +
 src/org/libvirt/jna/virDomainInterfaceStats.java |   16 ++
 src/org/libvirt/jna/virSchedParameter.java   |   11 +
 src/org/libvirt/jna/virSchedParameterValue.java  |   13 +
 src/org/libvirt/jna/virVcpuInfo.java |   12 +
 src/test.java|  154 ++-
 24 files changed, 595 insertions(+), 203 deletions(-)
 create mode 100644 src/org/libvirt/jna/virDomainBlockStats.java
 create mode 100644 src/org/libvirt/jna/virDomainInfo.java
 create mode 100644 src/org/libvirt/jna/virDomainInterfaceStats.java
 create mode 100644 src/org/libvirt/jna/virSchedParameter.java
 create mode 100644 src/org/libvirt/jna/virSchedParameterValue.java
 create mode 100644 src/org/libvirt/jna/virVcpuInfo.java

diff --git a/src/org/libvirt/Connect.java b/src/org/libvirt/Connect.java
index 218bda3..bab1d23 100644
--- a/src/org/libvirt/Connect.java
+++ b/src/org/libvirt/Connect.java
@@ -820,4 +820,13 @@ public class Connect {
 protected void processError() throws LibvirtException {
 ErrorHandler.processError(libvirt, VCP) ;
 }
+
+public static int[] convertUUIDBytes(byte bytes[]) {
+int[] returnValue = new int[Libvirt.VIR_UUID_BUFLEN] ;
+for (int x = 0 ; x  Libvirt.VIR_UUID_BUFLEN ; x++) {
+returnValue[x] = (int) bytes[x] ;
+}
+return returnValue ;
+}
+  
 }
diff --git a/src/org/libvirt/Domain.java b/src/org/libvirt/Domain.java
index e9b5d57..ab8cd94 100644
--- a/src/org/libvirt/Domain.java
+++ b/src/org/libvirt/Domain.java
@@ -1,6 +1,16 @@
 package org.libvirt;
 
+import org.libvirt.jna.Libvirt;
+import org.libvirt.jna.virDomainBlockStats;
+import org.libvirt.jna.virDomainInfo;
+import org.libvirt.jna.virDomainInterfaceStats;
+import org.libvirt.jna.virSchedParameter;
+import org.libvirt.jna.virVcpuInfo;
+
+import com.sun.jna.Native;
+import com.sun.jna.NativeLong;
 import com.sun.jna.Pointer;
+import com.sun.jna.ptr.IntByReference;
 
 public class Domain {
 
@@ -35,6 +45,11 @@ public class Domain {
 * The Connect Object that represents the Hypervisor of this Domain
 */
private Connect virConnect;
+   
+/**
+ * The libvirt connection from the hypervisor
+ */
+protected Libvirt libvirt ;
 
 
/**
@@ -47,6 +62,7 @@ public class Domain {
Domain(Connect virConnect, Pointer VDP){
this.virConnect = virConnect;
this.VDP = VDP;
+this.libvirt = virConnect.libvirt ;
}
 
/**
@@ -59,11 +75,11 @@ public class Domain {
 * @see a href=http://libvirt.org/format.html#Normal1; The XML 
Description format /a
 */
public String getXMLDesc(int flags) throws LibvirtException{
-// return _getXMLDesc(VDP, flags);
-throw new RuntimeException(Not Implemented) ;
+String returnValue = libvirt.virDomainGetXMLDesc(VDP, flags) ;
+processError() ;
+return returnValue  ;
}
 
-// private native String _getXMLDesc(long VDP, int flags) throws 
LibvirtException;
 
/**
 * Provides a boolean value indicating whether the network is 
configured to be automatically started when the host machine boots.
@@ -72,13 +88,13 @@ public class Domain {
 * @throws LibvirtException
 */
public boolean getAutostart() throws LibvirtException{
-// return _getAutostart(VDP);
-throw new RuntimeException(Not Implemented) ;
+IntByReference autoStart = new IntByReference() ;
+libvirt.virDomainGetAutostart(VDP, autoStart) ;
+processError() ;
+return autoStart.getValue() != 0 ? true : false ; 
}
 
 
-// private native boolean _getAutostart(long VDP) throws LibvirtException;
-
 

[libvirt] [PATCH] A bit of clean up from the list

2009-07-25 Thread Bryan Kearney
---
 src/org/libvirt/Connect.java |9 +++--
 src/org/libvirt/ConnectAuth.java |2 +-
 src/org/libvirt/jna/Libvirt.java |2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/org/libvirt/Connect.java b/src/org/libvirt/Connect.java
index 900f6fc..5041611 100644
--- a/src/org/libvirt/Connect.java
+++ b/src/org/libvirt/Connect.java
@@ -78,6 +78,7 @@ public class Connect {
}
// Check for an error   
 processError() ;   
+ErrorHandler.processError(Libvirt.INSTANCE) ;
}
 
/**
@@ -102,7 +103,9 @@ public class Connect {
}

 VCP = libvirt.virConnectOpenAuth(uri, vAuth, flags) ;  
-processError() ;
+   // Check for an error   
+processError() ;   
+ErrorHandler.processError(Libvirt.INSTANCE) ;  
}
 
/**
@@ -114,7 +117,9 @@ public class Connect {
 */
public Connect(String uri) throws LibvirtException {
 VCP = libvirt.virConnectOpen(uri) ;
-processError() ;
+   // Check for an error   
+processError() ;   
+ErrorHandler.processError(Libvirt.INSTANCE) ;
}
 
public void finalize() throws LibvirtException {
diff --git a/src/org/libvirt/ConnectAuth.java b/src/org/libvirt/ConnectAuth.java
index ad70365..e29f010 100644
--- a/src/org/libvirt/ConnectAuth.java
+++ b/src/org/libvirt/ConnectAuth.java
@@ -133,7 +133,7 @@ public abstract class ConnectAuth implements 
Libvirt.VirConnectAuthCallback {
}

 
-   public int authCallback(virConnectCredential[] cred, int ncred, Pointer 
cbdata) {
+   public int authCallback(virConnectCredential cred, int ncred, Pointer 
cbdata) {
System.out.println(HELLO!) ;
return 1 ;
}
diff --git a/src/org/libvirt/jna/Libvirt.java b/src/org/libvirt/jna/Libvirt.java
index 1d51e2d..5ed9fad 100644
--- a/src/org/libvirt/jna/Libvirt.java
+++ b/src/org/libvirt/jna/Libvirt.java
@@ -156,7 +156,7 @@ public interface Libvirt extends Library
 
 // Callbacks
 interface VirConnectAuthCallback extends Callback {
-   public int authCallback(virConnectCredential[] cred, int ncred, Pointer 
cbdata) ;
+   public int authCallback(virConnectCredential cred, int ncred, Pointer 
cbdata) ;

 }
 }
-- 
1.6.0.6

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] Add type safe pointers based on reviewing the RHQ code

2009-07-25 Thread Bryan Kearney
---
 src/org/libvirt/jna/ConnectionPointer.java |7 +++
 src/org/libvirt/jna/DomainPointer.java |7 +++
 src/org/libvirt/jna/NetworkPointer.java|7 +++
 3 files changed, 21 insertions(+), 0 deletions(-)
 create mode 100644 src/org/libvirt/jna/ConnectionPointer.java
 create mode 100644 src/org/libvirt/jna/DomainPointer.java
 create mode 100644 src/org/libvirt/jna/NetworkPointer.java

diff --git a/src/org/libvirt/jna/ConnectionPointer.java 
b/src/org/libvirt/jna/ConnectionPointer.java
new file mode 100644
index 000..ab98489
--- /dev/null
+++ b/src/org/libvirt/jna/ConnectionPointer.java
@@ -0,0 +1,7 @@
+package org.libvirt.jna;
+
+import com.sun.jna.PointerType;
+
+public class ConnectionPointer extends PointerType 
+{
+}
diff --git a/src/org/libvirt/jna/DomainPointer.java 
b/src/org/libvirt/jna/DomainPointer.java
new file mode 100644
index 000..8abb852
--- /dev/null
+++ b/src/org/libvirt/jna/DomainPointer.java
@@ -0,0 +1,7 @@
+package org.libvirt.jna;
+
+import com.sun.jna.PointerType;
+
+public class DomainPointer extends PointerType
+{
+}
diff --git a/src/org/libvirt/jna/NetworkPointer.java 
b/src/org/libvirt/jna/NetworkPointer.java
new file mode 100644
index 000..62b710c
--- /dev/null
+++ b/src/org/libvirt/jna/NetworkPointer.java
@@ -0,0 +1,7 @@
+package org.libvirt.jna;
+
+import com.sun.jna.PointerType;
+
+public class NetworkPointer extends PointerType
+{
+}
-- 
1.6.0.6

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] Exceptions are working using the callback

2009-07-25 Thread Bryan Kearney
---
 src/org/libvirt/Connect.java  |   86 +---
 src/org/libvirt/Error.java|8 ++-
 src/org/libvirt/ErrorHandler.java |   16 ---
 src/org/libvirt/Network.java  |   24 +-
 src/org/libvirt/jna/Libvirt.java  |   12 ++---
 src/org/libvirt/jna/virError.java |7 ++-
 src/test.java |8 ++--
 7 files changed, 108 insertions(+), 53 deletions(-)

diff --git a/src/org/libvirt/Connect.java b/src/org/libvirt/Connect.java
index b559b52..218bda3 100644
--- a/src/org/libvirt/Connect.java
+++ b/src/org/libvirt/Connect.java
@@ -23,7 +23,12 @@ public class Connect {
// Load the native part
static {
Libvirt.INSTANCE.virInitialize() ;
-   Libvirt.INSTANCE.virSetErrorFunc(0, ErrorHandler.INSTANCE) ;
+   try {
+   ErrorHandler.processError(Libvirt.INSTANCE) ;
+   }
+   catch (Exception e) {
+   e.printStackTrace() ;
+   }
}
 
/**
@@ -63,8 +68,7 @@ public class Connect {
 VCP = libvirt.virConnectOpen(uri) ;
}
// Check for an error   
-//processError(libvirt.virGetLastError()) ;
-libvirt.virConnSetErrorFunc(VCP,0,ErrorHandler.INSTANCE) ; 
+processError() ;   
}
 
/**
@@ -91,10 +95,11 @@ public class Connect {
 */
public Connect(String uri) throws LibvirtException {
 VCP = libvirt.virConnectOpen(uri) ;
+processError() ;
}
 
public void finalize() throws LibvirtException {
-   close();
+   close();
}
 
 
@@ -105,6 +110,7 @@ public class Connect {
 */
public void close() throws LibvirtException {
libvirt.virConnectClose(VCP) ;
+processError() ;   
// If leave an invalid pointer dangling around JVM crashes and 
burns if
// someone tries to call a method on us
// We rely on the underlying libvirt error handling to detect 
that it's called with a null virConnectPointer
@@ -121,7 +127,9 @@ public class Connect {
 *
 */
public String getCapabilities() throws LibvirtException {
-   return libvirt.virConnectGetCapabilities(VCP) ;
+   String returnValue = libvirt.virConnectGetCapabilities(VCP) ;
+processError() ;   
+return returnValue ;
}
 
 
@@ -135,6 +143,7 @@ public class Connect {
 */
public String getHostName() throws LibvirtException {
String returnValue = libvirt.virConnectGetHostname(VCP) ;
+processError() ;   
 return returnValue ;

}
@@ -149,7 +158,9 @@ public class Connect {
 * @throws LibvirtException
 */
public int getMaxVcpus(String type) throws LibvirtException {
-   return libvirt.virConnectGetMaxVcpus(VCP, type) ;
+   int returnValue = libvirt.virConnectGetMaxVcpus(VCP, type) ;
+processError() ;
+return returnValue ;
}
 
 
@@ -160,7 +171,9 @@ public class Connect {
 * @throws LibvirtException
 */
public String getType() throws LibvirtException {
-   return libvirt.virConnectGetType(VCP) ;
+   String returnValue = libvirt.virConnectGetType(VCP) ;
+processError() ;
+return returnValue ;
}
 

@@ -174,7 +187,9 @@ public class Connect {
 * @throws LibvirtException
 */
public String getURI() throws LibvirtException {
-   return libvirt.virConnectGetURI(VCP) ;
+   String returnValue = libvirt.virConnectGetURI(VCP) ;
+processError() ;  
+return returnValue ;
}
 
 
@@ -190,6 +205,7 @@ public class Connect {
public long getVersion() throws LibvirtException {
LongByReference hvVer = new LongByReference() ;
libvirt.virConnectGetVersion(VCP, hvVer) ;
+processError() ;   
return hvVer.getValue();
}
 
@@ -204,6 +220,7 @@ public class Connect {
 LongByReference libVer = new LongByReference() ;
 LongByReference typeVer = new LongByReference() ;
 libvirt.virGetVersion(libVer, null, typeVer) ;
+processError() ;
 return libVer.getValue();  
}
 
@@ -220,6 +237,7 @@ public class Connect {
 LongByReference libVer = new LongByReference() ;
 LongByReference typeVer = new LongByReference() ;
 libvirt.virGetVersion(libVer, type, typeVer) ;
+processError() ;
 return libVer.getValue();   
}
 
@@ -233,8 +251,9 @@ public class Connect {
public String[] 

[libvirt] [PATCH] Cleaned up the javadoc and the javadoc rpm

2009-07-25 Thread Bryan Kearney
---
 INSTALL|   33 
 README |8 +
 build.xml  |   14 
 src/main/java/org/libvirt/ConnectAuthDefault.java  |2 +-
 .../java/org/libvirt/jna/ConnectionPointer.java|4 ++
 src/main/java/org/libvirt/jna/DomainPointer.java   |4 ++
 src/main/java/org/libvirt/jna/Libvirt.java |6 +++
 src/main/java/org/libvirt/jna/NetworkPointer.java  |4 ++
 .../java/org/libvirt/jna/StoragePoolPointer.java   |4 ++
 .../java/org/libvirt/jna/StorageVolPointer.java|4 ++
 src/main/java/org/libvirt/jna/package.html |   10 ++
 src/main/java/org/libvirt/jna/virConnectAuth.java  |3 ++
 .../java/org/libvirt/jna/virConnectCredential.java |3 ++
 .../java/org/libvirt/jna/virDomainBlockStats.java  |3 ++
 src/main/java/org/libvirt/jna/virDomainInfo.java   |3 ++
 .../org/libvirt/jna/virDomainInterfaceStats.java   |3 ++
 src/main/java/org/libvirt/jna/virError.java|3 ++
 src/main/java/org/libvirt/jna/virNodeInfo.java |3 ++
 .../java/org/libvirt/jna/virSchedParameter.java|3 ++
 .../org/libvirt/jna/virSchedParameterValue.java|3 ++
 .../java/org/libvirt/jna/virStoragePoolInfo.java   |3 ++
 .../java/org/libvirt/jna/virStorageVolInfo.java|3 ++
 src/main/java/org/libvirt/jna/virVcpuInfo.java |3 ++
 src/main/java/org/libvirt/package.html |   10 ++
 24 files changed, 104 insertions(+), 35 deletions(-)
 create mode 100644 src/main/java/org/libvirt/jna/package.html
 create mode 100644 src/main/java/org/libvirt/package.html

diff --git a/INSTALL b/INSTALL
index 2da2921..3664da9 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,30 +1,23 @@
-The current build procedure is based on the
-classic:
-  tar xvzf libvirt-java-xxx.tar.gz
-  cd libvirt-java
-  ./configure [--prefix=/usr] ; make ; make install
+The current build procedure is based on ant. You can build
+the code by
+   cd libvirt-java
+   ant build
+   
+Type in ant -projecthelp to see all the tasks you can execute
+with the build script.
 
-You will need a Java Development Kit accepting the version 1.5
-of the language since the bindings use enums which were added
-in that version.
+You will need a Java Development Kit accepting the version 1.6
+of the language since the bindings use enums as well as the new 
+for loop syntax
 
-You can select the Java Development Kit to use by providing
-a --with-java-home=path_to_jdk_directory configure argument
-or by using the JAVA_HOME environment variable. This can
-be useful if you have multiple JDK installed or if it is
-installed in a non standard path.
+You can select the Java Development Kit by using the JAVA_HOME 
+environment variable. This can be useful if you have multiple 
+JDK installed or if it is installed in a non standard path.
 
 Please report any compatibility problem to the libvirt
 mailing list at:
  https://www.redhat.com/mailman/listinfo/libvir-list
 
-Of course if provided, ant based XML config files or
-Eclipse one will be integrated to the source distribution
-but they are not yet available.
-
-When building from a CVS checkout you need instead to
-run autogen.sh [--prefix=/usr] to build the configure,
-since it's a generated file it's not commited in CVS.
 
 Daniel Veillard
 veill...@redhat.com
diff --git a/README b/README
index 655090f..95c9ec6 100644
--- a/README
+++ b/README
@@ -1,17 +1,11 @@
   This is the java binding to the libvirt library.
 
 To use it, your program needs to access both the java library (.jar file),
-and the JNI library (.so file)
+and the JNA library (.jar file)
 
 1. You must have the libvirt.jar file in your classpath.
 By default the installs it to /usr/local/share/java/libvirt-0.2.1.jar
 
-2. You must have the libvirt_jni.so accessible by the dynamic linker.
-By default the RPM installs it to /usr/lib or /usr/lib64, so the linker will
-find it automatically. If it's in a different location, you have to set
-the LD_LIBRARY_PATH variable to the directory containing the libvirt_jni.so
-file.
-
 There is a rudimentary functional test program that the libvirt-java-devel
 installs put it into /usr/local/share/doc/libvirt-java-devel-0.2.1/test.java
 
diff --git a/build.xml b/build.xml
index e1ee51f..596b93a 100644
--- a/build.xml
+++ b/build.xml
@@ -26,11 +26,11 @@
mkdir dir=target/testclasses/   
/target

-   target name=clean
+   target name=clean description=cleans up all created artifacts
delete dir=target/
/target   

-   target name=build depends=init
+   target name=build depends=init description=builds the code and 
jar files
javac srcdir=src/main/java
   includes=**/*.java
   classpathref=compile.classpath
@@ -43,14 +43,14 @@
 

Re: [libvirt] VMware ESX driver progress

2009-07-25 Thread Matthias Bolte
2009/7/23 Daniel Veillard veill...@redhat.com:
 On Tue, Jul 21, 2009 at 04:58:50PM +0200, Matthias Bolte wrote:
 Hi,

 the development was hindered by our testing cluster being offline
 since 2 weeks due to server room cooling system maintenance. But I
 finally got a basic version of dump-XML done, that fills all fields of
 the virDomainDef that the VMX file contains data for.

 Changes since first announcement:

 - Move code into esx subdirectory
 - Add esxNodeGetInfo()
 - Fix esxDomainGetInfo() to report the correct value for memory
 - Add memory and max-memory getter/setters
 - Add CPU scheduler getter/setters
 - Validate a migration before trying to perform it
 - Replace esxUtil_Strdup() with strdup() and remove
 esxUtil_MigrateStringFromLibXML()
 - Add esxVI_EnsureSession() to handle expiring sessions
 - Separate VI client code into multiple files and generate most of the
 type handling code with macros
 - Add esxDomainDumpXML() based on esxVMX_ParseConfig()

 The ESX driver isn't complete yet, currently it supports:

 - domain lookup by ID, UUID and name
 - domain listing
 - domain info retrieval
 - domain suspend and resume
 - domain start and destroy
 - domain reboot and shutdown, if the VMware tools are installed inside
 the domain
 - domain migration with previous validation
 - domain memory configuration
 - domain CPU amount and scheduler configuration
 - domain XML-dump
 - domain XML-from-native (VMX)
 - node info retrieval
 - node hostname retrieval

  It's in ! I have no way to really test it (except for the phantom
 trick) but it's commited in git, congratulations, well done !

Thanks!

If you have a computer with a supported NIC (an Intel NIC will do) and
some time, you could download the stripped down ESXi 3.5
60-days-evaluation version from VMware, dd it onto an USB thumb drive,
boot from it and provide some storage via NFS from a second computer.
You could also provide storage from a local harddisk if you have a
supported SCSI controller (SATA may also work, I'm not sure). That's
how I started playing with ESX before we had out testing cluster
available.

Regards,
  Matthias

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] How to get access to QEMU monitor?

2009-07-25 Thread Jim Paris
Jun Koi wrote:
 Hi,
 
 I am running QEMU via libvirt (using virsh  virt-manager). Now I want
 to get access to the monitor interface of QEMU, so I can issue some
 commands to monitor. Is there anyway to do that?

That isn't supported, because libvirt won't know what you've changed
and can't deal with it in the general case.

If there's a specific feature you need, it would be better to get that
integrated into libvirt directly.

That said, you might be able to go around libvirt's back by killing
libvirt, connecting to the monitor PTY (see /var/run/libvirt/vm.xml
for the location), and then disconnecting and restarting libvirt.  If
you do anything that changes the domain state, though, you'll mess up
libvirt.

-jim

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list