From d1a1ab972bb22f4c38a21fcc73f81650aaa03b4e Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Tue, 2 Jun 2009 14:25:25 +0100 Subject: Generated code for 'add_drive_ro' call. --- haskell/Guestfs.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'haskell') 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) -- cgit