From e8ecc08f663b44f3d79517affe52f137858dfe00 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 13 May 2009 17:51:14 +0100 Subject: Add 'append', LIBGUESTFS_APPEND to set additional kernel options. --- java/com/redhat/et/libguestfs/GuestFS.java | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'java/com') diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index 70efb8d0..d0b34465 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -315,6 +315,54 @@ public class GuestFS { private native String _get_path (long g) throws LibGuestFSException; + /** + * add options to kernel command line + * + * This function is used to add additional options to the + * guest kernel command line. + * + * The default is "NULL" unless overridden by setting + * "LIBGUESTFS_APPEND" environment variable. + * + * The string "append" is stashed in the libguestfs handle, + * so the caller must make sure it remains valid for the + * lifetime of the handle. + * + * Setting "append" to "NULL" means *no* additional options + * are passed (libguestfs always adds a few of its own). + * + * @throws LibGuestFSException + */ + public void set_append (String append) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("set_append: handle is closed"); + _set_append (g, append); + } + private native void _set_append (long g, String append) + throws LibGuestFSException; + + /** + * get the additional kernel options + * + * Return the additional kernel options which are added to + * the guest kernel command line. + * + * If "NULL" then no options are added. + * + * @throws LibGuestFSException + */ + public String get_append () + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("get_append: handle is closed"); + return _get_append (g); + } + private native String _get_append (long g) + throws LibGuestFSException; + /** * set autosync mode * -- cgit