X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=haskell%2FGuestfs.hs;fp=haskell%2FGuestfs.hs;h=8f90ee8cf6f878e0cf8bff9ca89fb902b3118a8a;hb=ca49c50e06834bbc68e21630a5552c57494f2b53;hp=170f0403736fbac97be057663d54b17129650696;hpb=0695593702b8612b500ff0b3bf800e5934f9b56e;p=libguestfs.git diff --git a/haskell/Guestfs.hs b/haskell/Guestfs.hs index 170f040..8f90ee8 100644 --- a/haskell/Guestfs.hs +++ b/haskell/Guestfs.hs @@ -80,7 +80,8 @@ module Guestfs ( mv, ping_daemon, zerofree, - pvresize + pvresize, + resize2fs ) where import Foreign import Foreign.C @@ -814,3 +815,15 @@ pvresize h device = do fail err else return () +foreign import ccall unsafe "guestfs_resize2fs" c_resize2fs + :: GuestfsP -> CString -> IO (CInt) + +resize2fs :: GuestfsH -> String -> IO () +resize2fs h device = do + r <- withCString device $ \device -> withForeignPtr h (\p -> c_resize2fs p device) + if (r == -1) + then do + err <- last_error h + fail err + else return () +