diff options
author | Richard Jones <rjones@trick.home.annexia.org> | 2009-06-02 14:25:25 +0100 |
---|---|---|
committer | Richard Jones <rjones@trick.home.annexia.org> | 2009-06-02 14:25:25 +0100 |
commit | d1a1ab972bb22f4c38a21fcc73f81650aaa03b4e (patch) | |
tree | 48c33472221810fbe42a515b217f82d3da3bd04f /ruby | |
parent | bfdc03be234d6d95f18450846433bce4f97e184c (diff) | |
download | libguestfs-d1a1ab972bb22f4c38a21fcc73f81650aaa03b4e.tar.gz libguestfs-d1a1ab972bb22f4c38a21fcc73f81650aaa03b4e.tar.xz libguestfs-d1a1ab972bb22f4c38a21fcc73f81650aaa03b4e.zip |
Generated code for 'add_drive_ro' call.
Diffstat (limited to 'ruby')
-rw-r--r-- | ruby/ext/guestfs/_guestfs.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c index 6fb26089..4983932f 100644 --- a/ruby/ext/guestfs/_guestfs.c +++ b/ruby/ext/guestfs/_guestfs.c @@ -941,6 +941,27 @@ static VALUE ruby_guestfs_add_cdrom (VALUE gv, VALUE filenamev) return Qnil; } +static VALUE ruby_guestfs_add_drive_ro (VALUE gv, VALUE filenamev) +{ + guestfs_h *g; + Data_Get_Struct (gv, guestfs_h, g); + if (!g) + rb_raise (rb_eArgError, "%s: used handle after closing it", "add_drive_ro"); + + const char *filename = StringValueCStr (filenamev); + if (!filename) + rb_raise (rb_eTypeError, "expected string for parameter %s of %s", + "filename", "add_drive_ro"); + + int r; + + r = guestfs_add_drive_ro (g, filename); + if (r == -1) + rb_raise (e_Error, "%s", guestfs_last_error (g)); + + return Qnil; +} + static VALUE ruby_guestfs_config (VALUE gv, VALUE qemuparamv, VALUE qemuvaluev) { guestfs_h *g; @@ -4016,6 +4037,8 @@ void Init__guestfs () ruby_guestfs_add_drive, 1); rb_define_method (c_guestfs, "add_cdrom", ruby_guestfs_add_cdrom, 1); + rb_define_method (c_guestfs, "add_drive_ro", + ruby_guestfs_add_drive_ro, 1); rb_define_method (c_guestfs, "config", ruby_guestfs_config, 2); rb_define_method (c_guestfs, "set_qemu", |