diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-05-01 11:27:52 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-05-01 11:27:52 +0100 |
commit | 24bee20ce4196d45891925332a47a05aa5e40938 (patch) | |
tree | 434b56343dde38ae0c877cab236ada753e2f8549 /ruby | |
parent | 8c60f5c681b5d7cf90bc798fcaf94cd4e242e27f (diff) | |
download | libguestfs-24bee20ce4196d45891925332a47a05aa5e40938.tar.gz libguestfs-24bee20ce4196d45891925332a47a05aa5e40938.tar.xz libguestfs-24bee20ce4196d45891925332a47a05aa5e40938.zip |
Generated code for dmesg command.
Diffstat (limited to 'ruby')
-rw-r--r-- | ruby/ext/guestfs/_guestfs.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c index 12ca6ded..c0fc1804 100644 --- a/ruby/ext/guestfs/_guestfs.c +++ b/ruby/ext/guestfs/_guestfs.c @@ -2679,6 +2679,25 @@ static VALUE ruby_guestfs_drop_caches (VALUE gv, VALUE whattodropv) return Qnil; } +static VALUE ruby_guestfs_dmesg (VALUE gv) +{ + guestfs_h *g; + Data_Get_Struct (gv, guestfs_h, g); + if (!g) + rb_raise (rb_eArgError, "%s: used handle after closing it", "dmesg"); + + + char *r; + + r = guestfs_dmesg (g); + if (r == NULL) + rb_raise (e_Error, "%s", guestfs_last_error (g)); + + VALUE rv = rb_str_new2 (r); + free (r); + return rv; +} + /* Initialize the module. */ void Init__guestfs () { @@ -2911,4 +2930,6 @@ void Init__guestfs () ruby_guestfs_mv, 2); rb_define_method (c_guestfs, "drop_caches", ruby_guestfs_drop_caches, 1); + rb_define_method (c_guestfs, "dmesg", + ruby_guestfs_dmesg, 0); } |