diff options
author | Richard Jones <rjones@redhat.com> | 2009-05-18 20:22:53 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-05-18 20:22:53 +0100 |
commit | ca49c50e06834bbc68e21630a5552c57494f2b53 (patch) | |
tree | 0d1c98fd038abf05d7491f044c8affbfb461ce00 /java | |
parent | 0695593702b8612b500ff0b3bf800e5934f9b56e (diff) | |
download | libguestfs-ca49c50e06834bbc68e21630a5552c57494f2b53.tar.gz libguestfs-ca49c50e06834bbc68e21630a5552c57494f2b53.tar.xz libguestfs-ca49c50e06834bbc68e21630a5552c57494f2b53.zip |
Generated code for lvresize, resize2fs.
Diffstat (limited to 'java')
-rw-r--r-- | java/com/redhat/et/libguestfs/GuestFS.java | 37 | ||||
-rw-r--r-- | java/com_redhat_et_libguestfs_GuestFS.c | 36 |
2 files changed, 73 insertions, 0 deletions
diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index a6d6f6db..2846a80b 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -2914,4 +2914,41 @@ public class GuestFS { private native void _vg_activate (long g, boolean activate, String[] volgroups) throws LibGuestFSException; + /** + * resize an LVM logical volume + * + * This resizes (expands or shrinks) an existing LVM + * logical volume to "mbytes". When reducing, data in the + * reduced part is lost. + * + * @throws LibGuestFSException + */ + public void lvresize (String device, int mbytes) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("lvresize: handle is closed"); + _lvresize (g, device, mbytes); + } + private native void _lvresize (long g, String device, int mbytes) + throws LibGuestFSException; + + /** + * resize an ext2/ext3 filesystem + * + * This resizes an ext2 or ext3 filesystem to match the + * size of the underlying device. + * + * @throws LibGuestFSException + */ + public void resize2fs (String device) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("resize2fs: handle is closed"); + _resize2fs (g, device); + } + private native void _resize2fs (long g, String device) + throws LibGuestFSException; + } diff --git a/java/com_redhat_et_libguestfs_GuestFS.c b/java/com_redhat_et_libguestfs_GuestFS.c index 3bf5c7e5..1850f214 100644 --- a/java/com_redhat_et_libguestfs_GuestFS.c +++ b/java/com_redhat_et_libguestfs_GuestFS.c @@ -2894,3 +2894,39 @@ Java_com_redhat_et_libguestfs_GuestFS__1vg_1activate } } +JNIEXPORT void JNICALL +Java_com_redhat_et_libguestfs_GuestFS__1lvresize + (JNIEnv *env, jobject obj, jlong jg, jstring jdevice, jint jmbytes) +{ + guestfs_h *g = (guestfs_h *) (long) jg; + int r; + const char *device; + int mbytes; + + device = (*env)->GetStringUTFChars (env, jdevice, NULL); + mbytes = jmbytes; + r = guestfs_lvresize (g, device, mbytes); + (*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__1resize2fs + (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_resize2fs (g, device); + (*env)->ReleaseStringUTFChars (env, jdevice, device); + if (r == -1) { + throw_exception (env, guestfs_last_error (g)); + return ; + } +} + |