summaryrefslogtreecommitdiffstats
path: root/ruby
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-05-18 20:22:53 +0100
committerRichard Jones <rjones@redhat.com>2009-05-18 20:22:53 +0100
commitca49c50e06834bbc68e21630a5552c57494f2b53 (patch)
tree0d1c98fd038abf05d7491f044c8affbfb461ce00 /ruby
parent0695593702b8612b500ff0b3bf800e5934f9b56e (diff)
downloadlibguestfs-ca49c50e06834bbc68e21630a5552c57494f2b53.tar.gz
libguestfs-ca49c50e06834bbc68e21630a5552c57494f2b53.tar.xz
libguestfs-ca49c50e06834bbc68e21630a5552c57494f2b53.zip
Generated code for lvresize, resize2fs.
Diffstat (limited to 'ruby')
-rw-r--r--ruby/ext/guestfs/_guestfs.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c
index c57dcb3a..d7a4aa32 100644
--- a/ruby/ext/guestfs/_guestfs.c
+++ b/ruby/ext/guestfs/_guestfs.c
@@ -3072,6 +3072,49 @@ static VALUE ruby_guestfs_vg_activate (VALUE gv, VALUE activatev, VALUE volgroup
return Qnil;
}
+static VALUE ruby_guestfs_lvresize (VALUE gv, VALUE devicev, VALUE mbytesv)
+{
+ guestfs_h *g;
+ Data_Get_Struct (gv, guestfs_h, g);
+ if (!g)
+ rb_raise (rb_eArgError, "%s: used handle after closing it", "lvresize");
+
+ const char *device = StringValueCStr (devicev);
+ if (!device)
+ rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+ "device", "lvresize");
+ int mbytes = NUM2INT (mbytesv);
+
+ int r;
+
+ r = guestfs_lvresize (g, device, mbytes);
+ if (r == -1)
+ rb_raise (e_Error, "%s", guestfs_last_error (g));
+
+ return Qnil;
+}
+
+static VALUE ruby_guestfs_resize2fs (VALUE gv, VALUE devicev)
+{
+ guestfs_h *g;
+ Data_Get_Struct (gv, guestfs_h, g);
+ if (!g)
+ rb_raise (rb_eArgError, "%s: used handle after closing it", "resize2fs");
+
+ const char *device = StringValueCStr (devicev);
+ if (!device)
+ rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+ "device", "resize2fs");
+
+ int r;
+
+ r = guestfs_resize2fs (g, device);
+ if (r == -1)
+ rb_raise (e_Error, "%s", guestfs_last_error (g));
+
+ return Qnil;
+}
+
/* Initialize the module. */
void Init__guestfs ()
{
@@ -3338,4 +3381,8 @@ void Init__guestfs ()
ruby_guestfs_vg_activate_all, 1);
rb_define_method (c_guestfs, "vg_activate",
ruby_guestfs_vg_activate, 2);
+ rb_define_method (c_guestfs, "lvresize",
+ ruby_guestfs_lvresize, 2);
+ rb_define_method (c_guestfs, "resize2fs",
+ ruby_guestfs_resize2fs, 1);
}