diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-20 00:22:02 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-20 00:22:02 +0100 |
commit | 170f262f0413de843af62b968f6d12c1c476ae7f (patch) | |
tree | b9be7ae0e59f784dfdd57ef063536218ee3f0c7d /ruby | |
parent | d5151686d82b66c50935010fd5458be0e4386bab (diff) | |
download | libguestfs-170f262f0413de843af62b968f6d12c1c476ae7f.tar.gz libguestfs-170f262f0413de843af62b968f6d12c1c476ae7f.tar.xz libguestfs-170f262f0413de843af62b968f6d12c1c476ae7f.zip |
Implement upload and download commands.
Diffstat (limited to 'ruby')
-rw-r--r-- | ruby/ext/guestfs/_guestfs.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c index f73a3b78..0104017c 100644 --- a/ruby/ext/guestfs/_guestfs.c +++ b/ruby/ext/guestfs/_guestfs.c @@ -374,6 +374,40 @@ static VALUE ruby_guestfs_get_state (VALUE gv) return INT2NUM (r); } +static VALUE ruby_guestfs_set_busy (VALUE gv) +{ + guestfs_h *g; + Data_Get_Struct (gv, guestfs_h, g); + if (!g) + rb_raise (rb_eArgError, "%s: used handle after closing it", "set_busy"); + + + int r; + + r = guestfs_set_busy (g); + if (r == -1) + rb_raise (e_Error, "%s", guestfs_last_error (g)); + + return Qnil; +} + +static VALUE ruby_guestfs_set_ready (VALUE gv) +{ + guestfs_h *g; + Data_Get_Struct (gv, guestfs_h, g); + if (!g) + rb_raise (rb_eArgError, "%s: used handle after closing it", "set_ready"); + + + int r; + + r = guestfs_set_ready (g); + if (r == -1) + rb_raise (e_Error, "%s", guestfs_last_error (g)); + + return Qnil; +} + static VALUE ruby_guestfs_mount (VALUE gv, VALUE devicev, VALUE mountpointv) { guestfs_h *g; @@ -2076,6 +2110,10 @@ void Init__guestfs () ruby_guestfs_is_busy, 0); rb_define_method (c_guestfs, "get_state", ruby_guestfs_get_state, 0); + rb_define_method (c_guestfs, "set_busy", + ruby_guestfs_set_busy, 0); + rb_define_method (c_guestfs, "set_ready", + ruby_guestfs_set_ready, 0); rb_define_method (c_guestfs, "mount", ruby_guestfs_mount, 2); rb_define_method (c_guestfs, "sync", |