diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 20:24:47 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 20:25:20 +0100 |
commit | da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6 (patch) | |
tree | 5555f9addd140af8cf2b40c9526d1b1837abdd7f /java | |
parent | 662617ae725c5e41c24128a037060419fbe4b026 (diff) | |
download | libguestfs-da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6.tar.gz libguestfs-da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6.tar.xz libguestfs-da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6.zip |
Generated code for the 'mkswap*' commands.
Diffstat (limited to 'java')
-rw-r--r-- | java/com/redhat/et/libguestfs/GuestFS.java | 51 | ||||
-rw-r--r-- | java/com_redhat_et_libguestfs_GuestFS.c | 57 |
2 files changed, 108 insertions, 0 deletions
diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index f2901497..c5d4364a 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -3839,4 +3839,55 @@ public HashMap<String,String> test0rhashtableerr () private native void _mount_loop (long g, String file, String mountpoint) throws LibGuestFSException; + /** + * create a swap partition + * <p> + * Create a swap partition on "device". + * <p> + * @throws LibGuestFSException + */ + public void mkswap (String device) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("mkswap: handle is closed"); + _mkswap (g, device); + } + private native void _mkswap (long g, String device) + throws LibGuestFSException; + + /** + * create a swap partition with a label + * <p> + * Create a swap partition on "device" with label "label". + * <p> + * @throws LibGuestFSException + */ + public void mkswap_L (String label, String device) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("mkswap_L: handle is closed"); + _mkswap_L (g, label, device); + } + private native void _mkswap_L (long g, String label, String device) + throws LibGuestFSException; + + /** + * create a swap partition with an explicit UUID + * <p> + * Create a swap partition on "device" with UUID "uuid". + * <p> + * @throws LibGuestFSException + */ + public void mkswap_U (String uuid, String device) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("mkswap_U: handle is closed"); + _mkswap_U (g, uuid, device); + } + private native void _mkswap_U (long g, String uuid, String device) + throws LibGuestFSException; + } diff --git a/java/com_redhat_et_libguestfs_GuestFS.c b/java/com_redhat_et_libguestfs_GuestFS.c index a58b489a..43cad683 100644 --- a/java/com_redhat_et_libguestfs_GuestFS.c +++ b/java/com_redhat_et_libguestfs_GuestFS.c @@ -4442,3 +4442,60 @@ Java_com_redhat_et_libguestfs_GuestFS__1mount_1loop } } +JNIEXPORT void JNICALL +Java_com_redhat_et_libguestfs_GuestFS__1mkswap + (JNIEnv *env, jobject obj, jlong jg, jstring jdevice) +{ + guestfs_h *g = (guestfs_h *) (long) jg; + int r; + const char *device; + + device = (*env)->GetStringUTFChars (env, jdevice, NULL); + r = guestfs_mkswap (g, device); + (*env)->ReleaseStringUTFChars (env, jdevice, device); + if (r == -1) { + throw_exception (env, guestfs_last_error (g)); + return ; + } +} + +JNIEXPORT void JNICALL +Java_com_redhat_et_libguestfs_GuestFS__1mkswap_1L + (JNIEnv *env, jobject obj, jlong jg, jstring jlabel, jstring jdevice) +{ + guestfs_h *g = (guestfs_h *) (long) jg; + int r; + const char *label; + const char *device; + + label = (*env)->GetStringUTFChars (env, jlabel, NULL); + device = (*env)->GetStringUTFChars (env, jdevice, NULL); + r = guestfs_mkswap_L (g, label, device); + (*env)->ReleaseStringUTFChars (env, jlabel, label); + (*env)->ReleaseStringUTFChars (env, jdevice, device); + if (r == -1) { + throw_exception (env, guestfs_last_error (g)); + return ; + } +} + +JNIEXPORT void JNICALL +Java_com_redhat_et_libguestfs_GuestFS__1mkswap_1U + (JNIEnv *env, jobject obj, jlong jg, jstring juuid, jstring jdevice) +{ + guestfs_h *g = (guestfs_h *) (long) jg; + int r; + const char *uuid; + const char *device; + + uuid = (*env)->GetStringUTFChars (env, juuid, NULL); + device = (*env)->GetStringUTFChars (env, jdevice, NULL); + r = guestfs_mkswap_U (g, uuid, device); + (*env)->ReleaseStringUTFChars (env, juuid, uuid); + (*env)->ReleaseStringUTFChars (env, jdevice, device); + if (r == -1) { + throw_exception (env, guestfs_last_error (g)); + return ; + } +} + |