summaryrefslogtreecommitdiffstats
path: root/ruby
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-05-01 11:18:53 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-05-01 11:18:53 +0100
commit9222136ac9b2e404dba128b1ac74dacaa8bf1038 (patch)
tree84d74f0c966b925c3e22bf3322256df10455d94b /ruby
parent2dc9e8a858b62830d15a8186fe575eb7903d2171 (diff)
downloadlibguestfs-9222136ac9b2e404dba128b1ac74dacaa8bf1038.tar.gz
libguestfs-9222136ac9b2e404dba128b1ac74dacaa8bf1038.tar.xz
libguestfs-9222136ac9b2e404dba128b1ac74dacaa8bf1038.zip
Generated code for drop-caches command.
Diffstat (limited to 'ruby')
-rw-r--r--ruby/ext/guestfs/_guestfs.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c
index 9d97f960..12ca6ded 100644
--- a/ruby/ext/guestfs/_guestfs.c
+++ b/ruby/ext/guestfs/_guestfs.c
@@ -2661,6 +2661,24 @@ static VALUE ruby_guestfs_mv (VALUE gv, VALUE srcv, VALUE destv)
return Qnil;
}
+static VALUE ruby_guestfs_drop_caches (VALUE gv, VALUE whattodropv)
+{
+ guestfs_h *g;
+ Data_Get_Struct (gv, guestfs_h, g);
+ if (!g)
+ rb_raise (rb_eArgError, "%s: used handle after closing it", "drop_caches");
+
+ int whattodrop = NUM2INT (whattodropv);
+
+ int r;
+
+ r = guestfs_drop_caches (g, whattodrop);
+ if (r == -1)
+ rb_raise (e_Error, "%s", guestfs_last_error (g));
+
+ return Qnil;
+}
+
/* Initialize the module. */
void Init__guestfs ()
{
@@ -2891,4 +2909,6 @@ void Init__guestfs ()
ruby_guestfs_cp_a, 2);
rb_define_method (c_guestfs, "mv",
ruby_guestfs_mv, 2);
+ rb_define_method (c_guestfs, "drop_caches",
+ ruby_guestfs_drop_caches, 1);
}