mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
Generated code for mount-loop command.
This commit is contained in:
@@ -3820,4 +3820,23 @@ public HashMap<String,String> test0rhashtableerr ()
|
||||
private native String[] _initrd_list (long g, String path)
|
||||
throws LibGuestFSException;
|
||||
|
||||
/**
|
||||
* mount a file using the loop device
|
||||
* <p>
|
||||
* This command lets you mount "file" (a filesystem image
|
||||
* in a file) on a mount point. It is entirely equivalent
|
||||
* to the command "mount -o loop file mountpoint".
|
||||
* <p>
|
||||
* @throws LibGuestFSException
|
||||
*/
|
||||
public void mount_loop (String file, String mountpoint)
|
||||
throws LibGuestFSException
|
||||
{
|
||||
if (g == 0)
|
||||
throw new LibGuestFSException ("mount_loop: handle is closed");
|
||||
_mount_loop (g, file, mountpoint);
|
||||
}
|
||||
private native void _mount_loop (long g, String file, String mountpoint)
|
||||
throws LibGuestFSException;
|
||||
|
||||
}
|
||||
|
||||
@@ -4422,3 +4422,23 @@ Java_com_redhat_et_libguestfs_GuestFS__1initrd_1list
|
||||
return jr;
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_redhat_et_libguestfs_GuestFS__1mount_1loop
|
||||
(JNIEnv *env, jobject obj, jlong jg, jstring jfile, jstring jmountpoint)
|
||||
{
|
||||
guestfs_h *g = (guestfs_h *) (long) jg;
|
||||
int r;
|
||||
const char *file;
|
||||
const char *mountpoint;
|
||||
|
||||
file = (*env)->GetStringUTFChars (env, jfile, NULL);
|
||||
mountpoint = (*env)->GetStringUTFChars (env, jmountpoint, NULL);
|
||||
r = guestfs_mount_loop (g, file, mountpoint);
|
||||
(*env)->ReleaseStringUTFChars (env, jfile, file);
|
||||
(*env)->ReleaseStringUTFChars (env, jmountpoint, mountpoint);
|
||||
if (r == -1) {
|
||||
throw_exception (env, guestfs_last_error (g));
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user