diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 20:24:47 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 20:25:20 +0100 |
commit | da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6 (patch) | |
tree | 5555f9addd140af8cf2b40c9526d1b1837abdd7f /haskell | |
parent | 662617ae725c5e41c24128a037060419fbe4b026 (diff) | |
download | libguestfs-da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6.tar.gz libguestfs-da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6.tar.xz libguestfs-da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6.zip |
Generated code for the 'mkswap*' commands.
Diffstat (limited to 'haskell')
-rw-r--r-- | haskell/Guestfs.hs | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/haskell/Guestfs.hs b/haskell/Guestfs.hs index 32e7aedd..adf416f1 100644 --- a/haskell/Guestfs.hs +++ b/haskell/Guestfs.hs @@ -121,7 +121,10 @@ module Guestfs ( wc_w, wc_c, du, - mount_loop + mount_loop, + mkswap, + mkswap_L, + mkswap_U ) where import Foreign import Foreign.C @@ -1348,3 +1351,39 @@ mount_loop h file mountpoint = do fail err else return () +foreign import ccall unsafe "guestfs_mkswap" c_mkswap + :: GuestfsP -> CString -> IO (CInt) + +mkswap :: GuestfsH -> String -> IO () +mkswap h device = do + r <- withCString device $ \device -> withForeignPtr h (\p -> c_mkswap p device) + if (r == -1) + then do + err <- last_error h + fail err + else return () + +foreign import ccall unsafe "guestfs_mkswap_L" c_mkswap_L + :: GuestfsP -> CString -> CString -> IO (CInt) + +mkswap_L :: GuestfsH -> String -> String -> IO () +mkswap_L h label device = do + r <- withCString label $ \label -> withCString device $ \device -> withForeignPtr h (\p -> c_mkswap_L p label device) + if (r == -1) + then do + err <- last_error h + fail err + else return () + +foreign import ccall unsafe "guestfs_mkswap_U" c_mkswap_U + :: GuestfsP -> CString -> CString -> IO (CInt) + +mkswap_U :: GuestfsH -> String -> String -> IO () +mkswap_U h uuid device = do + r <- withCString uuid $ \uuid -> withCString device $ \device -> withForeignPtr h (\p -> c_mkswap_U p uuid device) + if (r == -1) + then do + err <- last_error h + fail err + else return () + |