+foreign import ccall unsafe "guestfs_zerofree" c_zerofree
+ :: GuestfsP -> CString -> IO (CInt)
+
+zerofree :: GuestfsH -> String -> IO ()
+zerofree h device = do
+ r <- withCString device $ \device -> withForeignPtr h (\p -> c_zerofree p device)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return ()
+
+foreign import ccall unsafe "guestfs_pvresize" c_pvresize
+ :: GuestfsP -> CString -> IO (CInt)
+
+pvresize :: GuestfsH -> String -> IO ()
+pvresize h device = do
+ r <- withCString device $ \device -> withForeignPtr h (\p -> c_pvresize p device)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return ()
+
+foreign import ccall unsafe "guestfs_sfdisk_N" c_sfdisk_N
+ :: GuestfsP -> CString -> CInt -> CInt -> CInt -> CInt -> CString -> IO (CInt)
+
+sfdisk_N :: GuestfsH -> String -> Int -> Int -> Int -> Int -> String -> IO ()
+sfdisk_N h device partnum cyls heads sectors line = do
+ r <- withCString device $ \device -> withCString line $ \line -> withForeignPtr h (\p -> c_sfdisk_N p device (fromIntegral partnum) (fromIntegral cyls) (fromIntegral heads) (fromIntegral sectors) line)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return ()
+
+foreign import ccall unsafe "guestfs_vg_activate_all" c_vg_activate_all
+ :: GuestfsP -> CInt -> IO (CInt)
+
+vg_activate_all :: GuestfsH -> Bool -> IO ()
+vg_activate_all h activate = do
+ r <- withForeignPtr h (\p -> c_vg_activate_all p (fromBool activate))
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return ()
+
+foreign import ccall unsafe "guestfs_vg_activate" c_vg_activate
+ :: GuestfsP -> CInt -> Ptr CString -> IO (CInt)
+
+vg_activate :: GuestfsH -> Bool -> [String] -> IO ()
+vg_activate h activate volgroups = do
+ r <- withMany withCString volgroups $ \volgroups -> withArray0 nullPtr volgroups $ \volgroups -> withForeignPtr h (\p -> c_vg_activate p (fromBool activate) volgroups)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return ()
+
+foreign import ccall unsafe "guestfs_lvresize" c_lvresize
+ :: GuestfsP -> CString -> CInt -> IO (CInt)
+
+lvresize :: GuestfsH -> String -> Int -> IO ()
+lvresize h device mbytes = do
+ r <- withCString device $ \device -> withForeignPtr h (\p -> c_lvresize p device (fromIntegral mbytes))
+ if (r == -1)
+ then do
+ err <- last_error h
+ 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 ()
+
+foreign import ccall unsafe "guestfs_e2fsck_f" c_e2fsck_f
+ :: GuestfsP -> CString -> IO (CInt)
+
+e2fsck_f :: GuestfsH -> String -> IO ()
+e2fsck_f h device = do
+ r <- withCString device $ \device -> withForeignPtr h (\p -> c_e2fsck_f p device)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return ()
+
+foreign import ccall unsafe "guestfs_sleep" c_sleep
+ :: GuestfsP -> CInt -> IO (CInt)
+
+sleep :: GuestfsH -> Int -> IO ()
+sleep h secs = do
+ r <- withForeignPtr h (\p -> c_sleep p (fromIntegral secs))
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return ()
+
+foreign import ccall unsafe "guestfs_ntfs_3g_probe" c_ntfs_3g_probe
+ :: GuestfsP -> CInt -> CString -> IO (CInt)
+
+ntfs_3g_probe :: GuestfsH -> Bool -> String -> IO (Int)
+ntfs_3g_probe h rw device = do
+ r <- withCString device $ \device -> withForeignPtr h (\p -> c_ntfs_3g_probe p (fromBool rw) device)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return (fromIntegral r)
+
+foreign import ccall unsafe "guestfs_scrub_device" c_scrub_device
+ :: GuestfsP -> CString -> IO (CInt)
+
+scrub_device :: GuestfsH -> String -> IO ()
+scrub_device h device = do
+ r <- withCString device $ \device -> withForeignPtr h (\p -> c_scrub_device p device)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return ()
+
+foreign import ccall unsafe "guestfs_scrub_file" c_scrub_file
+ :: GuestfsP -> CString -> IO (CInt)
+
+scrub_file :: GuestfsH -> String -> IO ()
+scrub_file h file = do
+ r <- withCString file $ \file -> withForeignPtr h (\p -> c_scrub_file p file)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return ()
+
+foreign import ccall unsafe "guestfs_scrub_freespace" c_scrub_freespace
+ :: GuestfsP -> CString -> IO (CInt)
+
+scrub_freespace :: GuestfsH -> String -> IO ()
+scrub_freespace h dir = do
+ r <- withCString dir $ \dir -> withForeignPtr h (\p -> c_scrub_freespace p dir)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return ()
+
+foreign import ccall unsafe "guestfs_wc_l" c_wc_l
+ :: GuestfsP -> CString -> IO (CInt)
+
+wc_l :: GuestfsH -> String -> IO (Int)
+wc_l h path = do
+ r <- withCString path $ \path -> withForeignPtr h (\p -> c_wc_l p path)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return (fromIntegral r)
+
+foreign import ccall unsafe "guestfs_wc_w" c_wc_w
+ :: GuestfsP -> CString -> IO (CInt)
+
+wc_w :: GuestfsH -> String -> IO (Int)
+wc_w h path = do
+ r <- withCString path $ \path -> withForeignPtr h (\p -> c_wc_w p path)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return (fromIntegral r)
+
+foreign import ccall unsafe "guestfs_wc_c" c_wc_c
+ :: GuestfsP -> CString -> IO (CInt)
+
+wc_c :: GuestfsH -> String -> IO (Int)
+wc_c h path = do
+ r <- withCString path $ \path -> withForeignPtr h (\p -> c_wc_c p path)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return (fromIntegral r)
+
+foreign import ccall unsafe "guestfs_du" c_du
+ :: GuestfsP -> CString -> IO (Int64)
+
+du :: GuestfsH -> String -> IO (Integer)
+du h path = do
+ r <- withCString path $ \path -> withForeignPtr h (\p -> c_du p path)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return (fromIntegral r)
+
+foreign import ccall unsafe "guestfs_mount_loop" c_mount_loop
+ :: GuestfsP -> CString -> CString -> IO (CInt)
+
+mount_loop :: GuestfsH -> String -> String -> IO ()
+mount_loop h file mountpoint = do
+ r <- withCString file $ \file -> withCString mountpoint $ \mountpoint -> withForeignPtr h (\p -> c_mount_loop p file mountpoint)
+ if (r == -1)
+ then do
+ err <- last_error h
+ fail err
+ else return ()
+