summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-06-30 11:17:06 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-06-30 13:10:44 +0100
commitf68b3ac861ae607a333211c775dded82ae2b2c4a (patch)
tree03dfee58ccfd723bcbc9dc6c6d7270629ae4489d /java
parent3d15f7e652340777514ff30c3cfc560a90b612ec (diff)
downloadlibguestfs-f68b3ac861ae607a333211c775dded82ae2b2c4a.tar.gz
libguestfs-f68b3ac861ae607a333211c775dded82ae2b2c4a.tar.xz
libguestfs-f68b3ac861ae607a333211c775dded82ae2b2c4a.zip
Generated code for 'set_memsize'/'get_memsize' calls.
Diffstat (limited to 'java')
-rw-r--r--java/com/redhat/et/libguestfs/GuestFS.java51
-rw-r--r--java/com_redhat_et_libguestfs_GuestFS.c31
2 files changed, 82 insertions, 0 deletions
diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java
index c5d4364a..1e13b3a1 100644
--- a/java/com/redhat/et/libguestfs/GuestFS.java
+++ b/java/com/redhat/et/libguestfs/GuestFS.java
@@ -908,6 +908,57 @@ public HashMap<String,String> test0rhashtableerr ()
throws LibGuestFSException;
/**
+ * set memory allocated to the qemu subprocess
+ * <p>
+ * This sets the memory size in megabytes allocated to the
+ * qemu subprocess. This only has any effect if called
+ * before "g.launch".
+ * <p>
+ * You can also change this by setting the environment
+ * variable "LIBGUESTFS_MEMSIZE" before the handle is
+ * created.
+ * <p>
+ * For more information on the architecture of libguestfs,
+ * see guestfs(3).
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public void set_memsize (int memsize)
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("set_memsize: handle is closed");
+ _set_memsize (g, memsize);
+ }
+ private native void _set_memsize (long g, int memsize)
+ throws LibGuestFSException;
+
+ /**
+ * get memory allocated to the qemu subprocess
+ * <p>
+ * This gets the memory size in megabytes allocated to the
+ * qemu subprocess.
+ * <p>
+ * If "g.set_memsize" was not called on this handle, and if
+ * "LIBGUESTFS_MEMSIZE" was not set, then this returns the
+ * compiled-in default value for memsize.
+ * <p>
+ * For more information on the architecture of libguestfs,
+ * see guestfs(3).
+ * <p>
+ * @throws LibGuestFSException
+ */
+ public int get_memsize ()
+ throws LibGuestFSException
+ {
+ if (g == 0)
+ throw new LibGuestFSException ("get_memsize: handle is closed");
+ return _get_memsize (g);
+ }
+ private native int _get_memsize (long g)
+ throws LibGuestFSException;
+
+ /**
* mount a guest disk at a position in the filesystem
* <p>
* Mount a guest disk at a position in the filesystem.
diff --git a/java/com_redhat_et_libguestfs_GuestFS.c b/java/com_redhat_et_libguestfs_GuestFS.c
index 43cad683..df161025 100644
--- a/java/com_redhat_et_libguestfs_GuestFS.c
+++ b/java/com_redhat_et_libguestfs_GuestFS.c
@@ -1402,6 +1402,37 @@ Java_com_redhat_et_libguestfs_GuestFS__1end_1busy
}
JNIEXPORT void JNICALL
+Java_com_redhat_et_libguestfs_GuestFS__1set_1memsize
+ (JNIEnv *env, jobject obj, jlong jg, jint jmemsize)
+{
+ guestfs_h *g = (guestfs_h *) (long) jg;
+ int r;
+ int memsize;
+
+ memsize = jmemsize;
+ r = guestfs_set_memsize (g, memsize);
+ if (r == -1) {
+ throw_exception (env, guestfs_last_error (g));
+ return ;
+ }
+}
+
+JNIEXPORT jint JNICALL
+Java_com_redhat_et_libguestfs_GuestFS__1get_1memsize
+ (JNIEnv *env, jobject obj, jlong jg)
+{
+ guestfs_h *g = (guestfs_h *) (long) jg;
+ int r;
+
+ r = guestfs_get_memsize (g);
+ if (r == -1) {
+ throw_exception (env, guestfs_last_error (g));
+ return 0;
+ }
+ return (jint) r;
+}
+
+JNIEXPORT void JNICALL
Java_com_redhat_et_libguestfs_GuestFS__1mount
(JNIEnv *env, jobject obj, jlong jg, jstring jdevice, jstring jmountpoint)
{