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 /haskell | |
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 'haskell')
-rw-r--r-- | haskell/Guestfs.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/haskell/Guestfs.hs b/haskell/Guestfs.hs index ee7dabd1..210274ef 100644 --- a/haskell/Guestfs.hs +++ b/haskell/Guestfs.hs @@ -29,6 +29,7 @@ module Guestfs ( kill_subprocess, add_drive, add_cdrom, + add_drive_ro, config, set_qemu, set_path, @@ -192,6 +193,18 @@ add_cdrom h filename = do fail err else return () +foreign import ccall unsafe "guestfs_add_drive_ro" c_add_drive_ro + :: GuestfsP -> CString -> IO (CInt) + +add_drive_ro :: GuestfsH -> String -> IO () +add_drive_ro h filename = do + r <- withCString filename $ \filename -> withForeignPtr h (\p -> c_add_drive_ro p filename) + if (r == -1) + then do + err <- last_error h + fail err + else return () + foreign import ccall unsafe "guestfs_config" c_config :: GuestfsP -> CString -> CString -> IO (CInt) |