diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-30 23:10:22 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-30 23:10:22 +0100 |
commit | e118c14b9552de311cbc1734e03a3226b484c1e8 (patch) | |
tree | 6e7952088d10df67004db83bfe2f370e2e4ffba2 /java | |
parent | b55bf8158f0b7f6b1760b7b3b5f7c1274a149127 (diff) | |
download | libguestfs-e118c14b9552de311cbc1734e03a3226b484c1e8.tar.gz libguestfs-e118c14b9552de311cbc1734e03a3226b484c1e8.tar.xz libguestfs-e118c14b9552de311cbc1734e03a3226b484c1e8.zip |
Generated code for grub-install command.
Diffstat (limited to 'java')
-rw-r--r-- | java/com/redhat/et/libguestfs/GuestFS.java | 19 | ||||
-rw-r--r-- | java/com_redhat_et_libguestfs_GuestFS.c | 20 |
2 files changed, 39 insertions, 0 deletions
diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index 5b816238..dc414d6a 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -2414,4 +2414,23 @@ public class GuestFS { private native void _zero (long g, String device) throws LibGuestFSException; + /** + * install GRUB + * + * This command installs GRUB (the Grand Unified + * Bootloader) on "device", with the root directory being + * "root". + * + * @throws LibGuestFSException + */ + public void grub_install (String root, String device) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("grub_install: handle is closed"); + _grub_install (g, root, device); + } + private native void _grub_install (long g, String root, String device) + throws LibGuestFSException; + } diff --git a/java/com_redhat_et_libguestfs_GuestFS.c b/java/com_redhat_et_libguestfs_GuestFS.c index 466ced85..d70f88a9 100644 --- a/java/com_redhat_et_libguestfs_GuestFS.c +++ b/java/com_redhat_et_libguestfs_GuestFS.c @@ -2437,3 +2437,23 @@ Java_com_redhat_et_libguestfs_GuestFS__1zero } } +JNIEXPORT void JNICALL +Java_com_redhat_et_libguestfs_GuestFS__1grub_1install + (JNIEnv *env, jobject obj, jlong jg, jstring jroot, jstring jdevice) +{ + guestfs_h *g = (guestfs_h *) (long) jg; + int r; + const char *root; + const char *device; + + root = (*env)->GetStringUTFChars (env, jroot, NULL); + device = (*env)->GetStringUTFChars (env, jdevice, NULL); + r = guestfs_grub_install (g, root, device); + (*env)->ReleaseStringUTFChars (env, jroot, root); + (*env)->ReleaseStringUTFChars (env, jdevice, device); + if (r == -1) { + throw_exception (env, guestfs_last_error (g)); + return ; + } +} + |