Blame SOURCES/0001-Fix-build-with-jna-3.5.0.patch

9cc870
From 307ba7a1974bf7fdd920b85c73015887873a4502 Mon Sep 17 00:00:00 2001
9cc870
Message-Id: <307ba7a1974bf7fdd920b85c73015887873a4502.1363641114.git.crobinso@redhat.com>
9cc870
From: Jiri Denemark <jdenemar@redhat.com>
9cc870
Date: Tue, 27 Nov 2012 18:33:22 +0100
9cc870
Subject: [PATCH] Fix build with jna >= 3.5.0
9cc870
9cc870
Since jna-3.5.0, all subclasses of com.sun.jna.Structure are required to
9cc870
implement getFieldOrder method which is supposed to return a list of
9cc870
fields the wrapped structure contains.
9cc870
---
9cc870
 src/main/java/org/libvirt/jna/virConnectAuth.java          | 5 +++++
9cc870
 src/main/java/org/libvirt/jna/virConnectCredential.java    | 6 ++++++
9cc870
 src/main/java/org/libvirt/jna/virDomainBlockInfo.java      | 4 ++++
9cc870
 src/main/java/org/libvirt/jna/virDomainBlockStats.java     | 5 +++++
9cc870
 src/main/java/org/libvirt/jna/virDomainInfo.java           | 5 +++++
9cc870
 src/main/java/org/libvirt/jna/virDomainInterfaceStats.java | 5 +++++
9cc870
 src/main/java/org/libvirt/jna/virDomainJobInfo.java        | 7 +++++++
9cc870
 src/main/java/org/libvirt/jna/virDomainMemoryStats.java    | 4 ++++
9cc870
 src/main/java/org/libvirt/jna/virError.java                | 6 ++++++
9cc870
 src/main/java/org/libvirt/jna/virNodeInfo.java             | 8 +++++++-
9cc870
 src/main/java/org/libvirt/jna/virSchedParameter.java       | 5 +++++
9cc870
 src/main/java/org/libvirt/jna/virStoragePoolInfo.java      | 5 +++++
9cc870
 src/main/java/org/libvirt/jna/virStorageVolInfo.java       | 6 +++++-
9cc870
 src/main/java/org/libvirt/jna/virVcpuInfo.java             | 4 ++++
9cc870
 14 files changed, 73 insertions(+), 2 deletions(-)
9cc870
9cc870
diff --git a/src/main/java/org/libvirt/jna/virConnectAuth.java b/src/main/java/org/libvirt/jna/virConnectAuth.java
9cc870
index 74dd65c..369d2e5 100644
9cc870
--- a/src/main/java/org/libvirt/jna/virConnectAuth.java
9cc870
+++ b/src/main/java/org/libvirt/jna/virConnectAuth.java
9cc870
@@ -11,4 +11,9 @@ public class virConnectAuth extends Structure {
9cc870
     public int ncredtype;
9cc870
     public Libvirt.VirConnectAuthCallback cb;
9cc870
     public Pointer cbdata;
9cc870
+
9cc870
+    protected java.util.List getFieldOrder() {
9cc870
+        return java.util.Arrays.asList(new String[] {
9cc870
+            "credtype", "ncredtype", "cb", "cbdata" });
9cc870
+    }
9cc870
 }
9cc870
diff --git a/src/main/java/org/libvirt/jna/virConnectCredential.java b/src/main/java/org/libvirt/jna/virConnectCredential.java
9cc870
index ba47482..dbfc38e 100644
9cc870
--- a/src/main/java/org/libvirt/jna/virConnectCredential.java
9cc870
+++ b/src/main/java/org/libvirt/jna/virConnectCredential.java
9cc870
@@ -13,4 +13,10 @@ public class virConnectCredential extends Structure implements Structure.ByRefer
9cc870
     // public Pointer result;
9cc870
     public String result;
9cc870
     public int resultlen;
9cc870
+
9cc870
+    protected java.util.List getFieldOrder() {
9cc870
+        return java.util.Arrays.asList(new String[] {
9cc870
+            "type", "prompt", "challenge", "defresult",
9cc870
+            "result", "resultlen" });
9cc870
+    }
9cc870
 }
9cc870
diff --git a/src/main/java/org/libvirt/jna/virDomainBlockInfo.java b/src/main/java/org/libvirt/jna/virDomainBlockInfo.java
9cc870
index 234a381..cbd7385 100644
9cc870
--- a/src/main/java/org/libvirt/jna/virDomainBlockInfo.java
9cc870
+++ b/src/main/java/org/libvirt/jna/virDomainBlockInfo.java
9cc870
@@ -7,4 +7,8 @@ public class virDomainBlockInfo extends Structure {
9cc870
     public long allocation;
9cc870
     public long physical;
9cc870
 
9cc870
+    protected java.util.List getFieldOrder() {
9cc870
+        return java.util.Arrays.asList(new String[] {
9cc870
+            "capacity", "allocation", "physical" });
9cc870
+    }
9cc870
 }
9cc870
diff --git a/src/main/java/org/libvirt/jna/virDomainBlockStats.java b/src/main/java/org/libvirt/jna/virDomainBlockStats.java
9cc870
index f29dba0..71041cc 100644
9cc870
--- a/src/main/java/org/libvirt/jna/virDomainBlockStats.java
9cc870
+++ b/src/main/java/org/libvirt/jna/virDomainBlockStats.java
9cc870
@@ -16,4 +16,9 @@ public class virDomainBlockStats extends Structure {
9cc870
     // is correct
9cc870
     public long errs; // this is a long long in the code, so a long mapping is
9cc870
     // correct
9cc870
+
9cc870
+    protected java.util.List getFieldOrder() {
9cc870
+        return java.util.Arrays.asList(new String[] {
9cc870
+            "rd_req", "rd_bytes", "wr_req", "wr_bytes", "errs" });
9cc870
+    }
9cc870
 }
9cc870
diff --git a/src/main/java/org/libvirt/jna/virDomainInfo.java b/src/main/java/org/libvirt/jna/virDomainInfo.java
9cc870
index a93c0a5..994042a 100644
9cc870
--- a/src/main/java/org/libvirt/jna/virDomainInfo.java
9cc870
+++ b/src/main/java/org/libvirt/jna/virDomainInfo.java
9cc870
@@ -12,4 +12,9 @@ public class virDomainInfo extends Structure {
9cc870
     public NativeLong memory;
9cc870
     public short nrVirtCpu;
9cc870
     public long cpuTime;
9cc870
+
9cc870
+    protected java.util.List getFieldOrder() {
9cc870
+        return java.util.Arrays.asList(new String[] {
9cc870
+            "state", "maxMem", "memory", "nrVirtCpu", "cpuTime" });
9cc870
+    }
9cc870
 }
9cc870
diff --git a/src/main/java/org/libvirt/jna/virDomainInterfaceStats.java b/src/main/java/org/libvirt/jna/virDomainInterfaceStats.java
9cc870
index 1cb0e66..dcdd529 100644
9cc870
--- a/src/main/java/org/libvirt/jna/virDomainInterfaceStats.java
9cc870
+++ b/src/main/java/org/libvirt/jna/virDomainInterfaceStats.java
9cc870
@@ -23,4 +23,9 @@ public class virDomainInterfaceStats extends Structure {
9cc870
     public long tx_drop; // this is a long long in the code, so a long mapping
9cc870
     // is correct
9cc870
 
9cc870
+    protected java.util.List getFieldOrder() {
9cc870
+        return java.util.Arrays.asList(new String[] {
9cc870
+            "rx_bytes", "rx_packets", "rx_errs", "rx_drop",
9cc870
+            "tx_bytes", "tx_packets", "tx_errs", "tx_drop" });
9cc870
+    }
9cc870
 }
9cc870
diff --git a/src/main/java/org/libvirt/jna/virDomainJobInfo.java b/src/main/java/org/libvirt/jna/virDomainJobInfo.java
9cc870
index 98b4f59..af934ad 100644
9cc870
--- a/src/main/java/org/libvirt/jna/virDomainJobInfo.java
9cc870
+++ b/src/main/java/org/libvirt/jna/virDomainJobInfo.java
9cc870
@@ -15,4 +15,11 @@ public class virDomainJobInfo extends Structure {
9cc870
     public long fileTotal;
9cc870
     public long fileProcessed;
9cc870
     public long fileRemaining;
9cc870
+
9cc870
+    protected java.util.List getFieldOrder() {
9cc870
+        return java.util.Arrays.asList(new String[] {
9cc870
+            "type", "timeElapsed", "timeRemaining", "dataTotal",
9cc870
+            "dataProcessed", "dataRemaining", "memTotal", "memProcessed",
9cc870
+            "memRemaining", "fileTotal", "fileProcessed", "fileRemaining" });
9cc870
+    }
9cc870
 }
9cc870
diff --git a/src/main/java/org/libvirt/jna/virDomainMemoryStats.java b/src/main/java/org/libvirt/jna/virDomainMemoryStats.java
9cc870
index 7a9f5d2..ec7b29e 100644
9cc870
--- a/src/main/java/org/libvirt/jna/virDomainMemoryStats.java
9cc870
+++ b/src/main/java/org/libvirt/jna/virDomainMemoryStats.java
9cc870
@@ -5,4 +5,8 @@ import com.sun.jna.Structure;
9cc870
 public class virDomainMemoryStats extends Structure {
9cc870
     public int tag ;
9cc870
     public long val ;
9cc870
+
9cc870
+    protected java.util.List getFieldOrder() {
9cc870
+        return java.util.Arrays.asList(new String[] { "tag", "val" });
9cc870
+    }
9cc870
 }
9cc870
diff --git a/src/main/java/org/libvirt/jna/virError.java b/src/main/java/org/libvirt/jna/virError.java
9cc870
index e2580dd..9009280 100644
9cc870
--- a/src/main/java/org/libvirt/jna/virError.java
9cc870
+++ b/src/main/java/org/libvirt/jna/virError.java
9cc870
@@ -19,4 +19,10 @@ public class virError extends Structure {
9cc870
     public int int1;
9cc870
     public int int2;
9cc870
     public NetworkPointer net;
9cc870
+
9cc870
+    protected java.util.List getFieldOrder() {
9cc870
+        return java.util.Arrays.asList(new String[] {
9cc870
+            "code", "domain", "message", "level", "conn", "dom",
9cc870
+            "str1", "str2", "str3", "int1", "int2", "net" });
9cc870
+    }
9cc870
 }
9cc870
diff --git a/src/main/java/org/libvirt/jna/virNodeInfo.java b/src/main/java/org/libvirt/jna/virNodeInfo.java
9cc870
index 532aad9..f13eddc 100644
9cc870
--- a/src/main/java/org/libvirt/jna/virNodeInfo.java
9cc870
+++ b/src/main/java/org/libvirt/jna/virNodeInfo.java
9cc870
@@ -21,4 +21,10 @@ public class virNodeInfo extends Structure {
9cc870
     public int sockets;
9cc870
     public int cores;
9cc870
     public int threads;
9cc870
-}
9cc870
\ No newline at end of file
9cc870
+
9cc870
+    protected java.util.List getFieldOrder() {
9cc870
+        return java.util.Arrays.asList(new String[] {
9cc870
+            "model", "memory", "cpus", "mhz", "nodes",
9cc870
+            "sockets", "cores", "threads" });
9cc870
+    }
9cc870
+}
9cc870
diff --git a/src/main/java/org/libvirt/jna/virSchedParameter.java b/src/main/java/org/libvirt/jna/virSchedParameter.java
9cc870
index 0013fff..9496121 100644
9cc870
--- a/src/main/java/org/libvirt/jna/virSchedParameter.java
9cc870
+++ b/src/main/java/org/libvirt/jna/virSchedParameter.java
9cc870
@@ -9,4 +9,9 @@ public class virSchedParameter extends Structure {
9cc870
     public byte field[] = new byte[Libvirt.VIR_DOMAIN_SCHED_FIELD_LENGTH];
9cc870
     public int type;
9cc870
     public virSchedParameterValue value;
9cc870
+
9cc870
+    protected java.util.List getFieldOrder() {
9cc870
+        return java.util.Arrays.asList(new String[] {
9cc870
+            "field", "type", "value" });
9cc870
+    }
9cc870
 }
9cc870
diff --git a/src/main/java/org/libvirt/jna/virStoragePoolInfo.java b/src/main/java/org/libvirt/jna/virStoragePoolInfo.java
9cc870
index 5a98e08..7f370cd 100644
9cc870
--- a/src/main/java/org/libvirt/jna/virStoragePoolInfo.java
9cc870
+++ b/src/main/java/org/libvirt/jna/virStoragePoolInfo.java
9cc870
@@ -13,4 +13,9 @@ public class virStoragePoolInfo extends Structure {
9cc870
     // mapping is correct
9cc870
     public long available; // this is a long long in the code, so a long mapping
9cc870
     // is correct
9cc870
+
9cc870
+    protected java.util.List getFieldOrder() {
9cc870
+        return java.util.Arrays.asList(new String[] {
9cc870
+            "state", "capacity", "allocation", "available" });
9cc870
+    }
9cc870
 }
9cc870
diff --git a/src/main/java/org/libvirt/jna/virStorageVolInfo.java b/src/main/java/org/libvirt/jna/virStorageVolInfo.java
9cc870
index db8a5bd..a02219e 100644
9cc870
--- a/src/main/java/org/libvirt/jna/virStorageVolInfo.java
9cc870
+++ b/src/main/java/org/libvirt/jna/virStorageVolInfo.java
9cc870
@@ -12,4 +12,8 @@ public class virStorageVolInfo extends Structure {
9cc870
     public long allocation; // this is a long long in the code, so a long
9cc870
     // mapping is correct
9cc870
 
9cc870
-}
9cc870
\ No newline at end of file
9cc870
+    protected java.util.List getFieldOrder() {
9cc870
+        return java.util.Arrays.asList(new String[] {
9cc870
+            "type", "capacity", "allocation" });
9cc870
+    }
9cc870
+}
9cc870
diff --git a/src/main/java/org/libvirt/jna/virVcpuInfo.java b/src/main/java/org/libvirt/jna/virVcpuInfo.java
9cc870
index 16f237d..e5f4363 100644
9cc870
--- a/src/main/java/org/libvirt/jna/virVcpuInfo.java
9cc870
+++ b/src/main/java/org/libvirt/jna/virVcpuInfo.java
9cc870
@@ -12,4 +12,8 @@ public class virVcpuInfo extends Structure {
9cc870
     // is correct
9cc870
     public int cpu;
9cc870
 
9cc870
+    protected java.util.List getFieldOrder() {
9cc870
+        return java.util.Arrays.asList(new String[] {
9cc870
+            "number", "state", "cpuTime", "cpu" });
9cc870
+    }
9cc870
 }
9cc870
-- 
9cc870
1.8.1.4
9cc870