summaryrefslogtreecommitdiffstats
path: root/haskell
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-06-29 20:24:47 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-06-29 20:25:20 +0100
commitda8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6 (patch)
tree5555f9addd140af8cf2b40c9526d1b1837abdd7f /haskell
parent662617ae725c5e41c24128a037060419fbe4b026 (diff)
downloadlibguestfs-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.hs41
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 ()
+