diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-30 11:17:06 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-30 13:10:44 +0100 |
commit | f68b3ac861ae607a333211c775dded82ae2b2c4a (patch) | |
tree | 03dfee58ccfd723bcbc9dc6c6d7270629ae4489d /ruby | |
parent | 3d15f7e652340777514ff30c3cfc560a90b612ec (diff) | |
download | libguestfs-f68b3ac861ae607a333211c775dded82ae2b2c4a.tar.gz libguestfs-f68b3ac861ae607a333211c775dded82ae2b2c4a.tar.xz libguestfs-f68b3ac861ae607a333211c775dded82ae2b2c4a.zip |
Generated code for 'set_memsize'/'get_memsize' calls.
Diffstat (limited to 'ruby')
-rw-r--r-- | ruby/ext/guestfs/_guestfs.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c index 28f99687..9ac8e254 100644 --- a/ruby/ext/guestfs/_guestfs.c +++ b/ruby/ext/guestfs/_guestfs.c @@ -1329,6 +1329,41 @@ static VALUE ruby_guestfs_end_busy (VALUE gv) return Qnil; } +static VALUE ruby_guestfs_set_memsize (VALUE gv, VALUE memsizev) +{ + guestfs_h *g; + Data_Get_Struct (gv, guestfs_h, g); + if (!g) + rb_raise (rb_eArgError, "%s: used handle after closing it", "set_memsize"); + + int memsize = NUM2INT (memsizev); + + int r; + + r = guestfs_set_memsize (g, memsize); + if (r == -1) + rb_raise (e_Error, "%s", guestfs_last_error (g)); + + return Qnil; +} + +static VALUE ruby_guestfs_get_memsize (VALUE gv) +{ + guestfs_h *g; + Data_Get_Struct (gv, guestfs_h, g); + if (!g) + rb_raise (rb_eArgError, "%s: used handle after closing it", "get_memsize"); + + + int r; + + r = guestfs_get_memsize (g); + if (r == -1) + rb_raise (e_Error, "%s", guestfs_last_error (g)); + + return INT2NUM (r); +} + static VALUE ruby_guestfs_mount (VALUE gv, VALUE devicev, VALUE mountpointv) { guestfs_h *g; @@ -4828,6 +4863,10 @@ void Init__guestfs () ruby_guestfs_set_ready, 0); rb_define_method (c_guestfs, "end_busy", ruby_guestfs_end_busy, 0); + rb_define_method (c_guestfs, "set_memsize", + ruby_guestfs_set_memsize, 1); + rb_define_method (c_guestfs, "get_memsize", + ruby_guestfs_get_memsize, 0); rb_define_method (c_guestfs, "mount", ruby_guestfs_mount, 2); rb_define_method (c_guestfs, "sync", |