1 {- libguestfs generated file
2 WARNING: THIS FILE IS GENERATED BY 'src/generator.ml'.
3 ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
5 Copyright (C) 2009 Red Hat Inc.
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 {-# INCLUDE <guestfs.h> #-}
23 {-# LANGUAGE ForeignFunctionInterface #-}
104 import Foreign.C.Types
106 import Control.Exception
109 data GuestfsS = GuestfsS -- represents the opaque C struct
110 type GuestfsP = Ptr GuestfsS -- guestfs_h *
111 type GuestfsH = ForeignPtr GuestfsS -- guestfs_h * with attached finalizer
113 -- XXX define properly later XXX
117 data IntBool = IntBool
119 data StatVFS = StatVFS
120 data Hashtable = Hashtable
122 foreign import ccall unsafe "guestfs_create" c_create
124 foreign import ccall unsafe "&guestfs_close" c_close
125 :: FunPtr (GuestfsP -> IO ())
126 foreign import ccall unsafe "guestfs_set_error_handler" c_set_error_handler
127 :: GuestfsP -> Ptr CInt -> Ptr CInt -> IO ()
129 create :: IO GuestfsH
132 c_set_error_handler p nullPtr nullPtr
133 h <- newForeignPtr c_close p
136 foreign import ccall unsafe "guestfs_last_error" c_last_error
137 :: GuestfsP -> IO CString
139 -- last_error :: GuestfsH -> IO (Maybe String)
141 -- str <- withForeignPtr h (\p -> c_last_error p)
142 -- maybePeek peekCString str
144 last_error :: GuestfsH -> IO (String)
146 str <- withForeignPtr h (\p -> c_last_error p)
148 then return "no error"
151 foreign import ccall unsafe "guestfs_launch" c_launch
152 :: GuestfsP -> IO (CInt)
154 launch :: GuestfsH -> IO ()
156 r <- withForeignPtr h (\p -> c_launch p)
163 foreign import ccall unsafe "guestfs_wait_ready" c_wait_ready
164 :: GuestfsP -> IO (CInt)
166 wait_ready :: GuestfsH -> IO ()
168 r <- withForeignPtr h (\p -> c_wait_ready p)
175 foreign import ccall unsafe "guestfs_kill_subprocess" c_kill_subprocess
176 :: GuestfsP -> IO (CInt)
178 kill_subprocess :: GuestfsH -> IO ()
179 kill_subprocess h = do
180 r <- withForeignPtr h (\p -> c_kill_subprocess p)
187 foreign import ccall unsafe "guestfs_add_drive" c_add_drive
188 :: GuestfsP -> CString -> IO (CInt)
190 add_drive :: GuestfsH -> String -> IO ()
191 add_drive h filename = do
192 r <- withCString filename $ \filename -> withForeignPtr h (\p -> c_add_drive p filename)
199 foreign import ccall unsafe "guestfs_add_cdrom" c_add_cdrom
200 :: GuestfsP -> CString -> IO (CInt)
202 add_cdrom :: GuestfsH -> String -> IO ()
203 add_cdrom h filename = do
204 r <- withCString filename $ \filename -> withForeignPtr h (\p -> c_add_cdrom p filename)
211 foreign import ccall unsafe "guestfs_add_drive_ro" c_add_drive_ro
212 :: GuestfsP -> CString -> IO (CInt)
214 add_drive_ro :: GuestfsH -> String -> IO ()
215 add_drive_ro h filename = do
216 r <- withCString filename $ \filename -> withForeignPtr h (\p -> c_add_drive_ro p filename)
223 foreign import ccall unsafe "guestfs_config" c_config
224 :: GuestfsP -> CString -> CString -> IO (CInt)
226 config :: GuestfsH -> String -> Maybe String -> IO ()
227 config h qemuparam qemuvalue = do
228 r <- withCString qemuparam $ \qemuparam -> maybeWith withCString qemuvalue $ \qemuvalue -> withForeignPtr h (\p -> c_config p qemuparam qemuvalue)
235 foreign import ccall unsafe "guestfs_set_qemu" c_set_qemu
236 :: GuestfsP -> CString -> IO (CInt)
238 set_qemu :: GuestfsH -> String -> IO ()
240 r <- withCString qemu $ \qemu -> withForeignPtr h (\p -> c_set_qemu p qemu)
247 foreign import ccall unsafe "guestfs_set_path" c_set_path
248 :: GuestfsP -> CString -> IO (CInt)
250 set_path :: GuestfsH -> String -> IO ()
252 r <- withCString path $ \path -> withForeignPtr h (\p -> c_set_path p path)
259 foreign import ccall unsafe "guestfs_set_append" c_set_append
260 :: GuestfsP -> CString -> IO (CInt)
262 set_append :: GuestfsH -> String -> IO ()
263 set_append h append = do
264 r <- withCString append $ \append -> withForeignPtr h (\p -> c_set_append p append)
271 foreign import ccall unsafe "guestfs_set_busy" c_set_busy
272 :: GuestfsP -> IO (CInt)
274 set_busy :: GuestfsH -> IO ()
276 r <- withForeignPtr h (\p -> c_set_busy p)
283 foreign import ccall unsafe "guestfs_set_ready" c_set_ready
284 :: GuestfsP -> IO (CInt)
286 set_ready :: GuestfsH -> IO ()
288 r <- withForeignPtr h (\p -> c_set_ready p)
295 foreign import ccall unsafe "guestfs_end_busy" c_end_busy
296 :: GuestfsP -> IO (CInt)
298 end_busy :: GuestfsH -> IO ()
300 r <- withForeignPtr h (\p -> c_end_busy p)
307 foreign import ccall unsafe "guestfs_mount" c_mount
308 :: GuestfsP -> CString -> CString -> IO (CInt)
310 mount :: GuestfsH -> String -> String -> IO ()
311 mount h device mountpoint = do
312 r <- withCString device $ \device -> withCString mountpoint $ \mountpoint -> withForeignPtr h (\p -> c_mount p device mountpoint)
319 foreign import ccall unsafe "guestfs_sync" c_sync
320 :: GuestfsP -> IO (CInt)
322 sync :: GuestfsH -> IO ()
324 r <- withForeignPtr h (\p -> c_sync p)
331 foreign import ccall unsafe "guestfs_touch" c_touch
332 :: GuestfsP -> CString -> IO (CInt)
334 touch :: GuestfsH -> String -> IO ()
336 r <- withCString path $ \path -> withForeignPtr h (\p -> c_touch p path)
343 foreign import ccall unsafe "guestfs_aug_init" c_aug_init
344 :: GuestfsP -> CString -> CInt -> IO (CInt)
346 aug_init :: GuestfsH -> String -> Int -> IO ()
347 aug_init h root flags = do
348 r <- withCString root $ \root -> withForeignPtr h (\p -> c_aug_init p root (fromIntegral flags))
355 foreign import ccall unsafe "guestfs_aug_close" c_aug_close
356 :: GuestfsP -> IO (CInt)
358 aug_close :: GuestfsH -> IO ()
360 r <- withForeignPtr h (\p -> c_aug_close p)
367 foreign import ccall unsafe "guestfs_aug_set" c_aug_set
368 :: GuestfsP -> CString -> CString -> IO (CInt)
370 aug_set :: GuestfsH -> String -> String -> IO ()
371 aug_set h path val = do
372 r <- withCString path $ \path -> withCString val $ \val -> withForeignPtr h (\p -> c_aug_set p path val)
379 foreign import ccall unsafe "guestfs_aug_mv" c_aug_mv
380 :: GuestfsP -> CString -> CString -> IO (CInt)
382 aug_mv :: GuestfsH -> String -> String -> IO ()
383 aug_mv h src dest = do
384 r <- withCString src $ \src -> withCString dest $ \dest -> withForeignPtr h (\p -> c_aug_mv p src dest)
391 foreign import ccall unsafe "guestfs_aug_save" c_aug_save
392 :: GuestfsP -> IO (CInt)
394 aug_save :: GuestfsH -> IO ()
396 r <- withForeignPtr h (\p -> c_aug_save p)
403 foreign import ccall unsafe "guestfs_aug_load" c_aug_load
404 :: GuestfsP -> IO (CInt)
406 aug_load :: GuestfsH -> IO ()
408 r <- withForeignPtr h (\p -> c_aug_load p)
415 foreign import ccall unsafe "guestfs_rm" c_rm
416 :: GuestfsP -> CString -> IO (CInt)
418 rm :: GuestfsH -> String -> IO ()
420 r <- withCString path $ \path -> withForeignPtr h (\p -> c_rm p path)
427 foreign import ccall unsafe "guestfs_rmdir" c_rmdir
428 :: GuestfsP -> CString -> IO (CInt)
430 rmdir :: GuestfsH -> String -> IO ()
432 r <- withCString path $ \path -> withForeignPtr h (\p -> c_rmdir p path)
439 foreign import ccall unsafe "guestfs_rm_rf" c_rm_rf
440 :: GuestfsP -> CString -> IO (CInt)
442 rm_rf :: GuestfsH -> String -> IO ()
444 r <- withCString path $ \path -> withForeignPtr h (\p -> c_rm_rf p path)
451 foreign import ccall unsafe "guestfs_mkdir" c_mkdir
452 :: GuestfsP -> CString -> IO (CInt)
454 mkdir :: GuestfsH -> String -> IO ()
456 r <- withCString path $ \path -> withForeignPtr h (\p -> c_mkdir p path)
463 foreign import ccall unsafe "guestfs_mkdir_p" c_mkdir_p
464 :: GuestfsP -> CString -> IO (CInt)
466 mkdir_p :: GuestfsH -> String -> IO ()
468 r <- withCString path $ \path -> withForeignPtr h (\p -> c_mkdir_p p path)
475 foreign import ccall unsafe "guestfs_chmod" c_chmod
476 :: GuestfsP -> CInt -> CString -> IO (CInt)
478 chmod :: GuestfsH -> Int -> String -> IO ()
479 chmod h mode path = do
480 r <- withCString path $ \path -> withForeignPtr h (\p -> c_chmod p (fromIntegral mode) path)
487 foreign import ccall unsafe "guestfs_chown" c_chown
488 :: GuestfsP -> CInt -> CInt -> CString -> IO (CInt)
490 chown :: GuestfsH -> Int -> Int -> String -> IO ()
491 chown h owner group path = do
492 r <- withCString path $ \path -> withForeignPtr h (\p -> c_chown p (fromIntegral owner) (fromIntegral group) path)
499 foreign import ccall unsafe "guestfs_pvcreate" c_pvcreate
500 :: GuestfsP -> CString -> IO (CInt)
502 pvcreate :: GuestfsH -> String -> IO ()
503 pvcreate h device = do
504 r <- withCString device $ \device -> withForeignPtr h (\p -> c_pvcreate p device)
511 foreign import ccall unsafe "guestfs_vgcreate" c_vgcreate
512 :: GuestfsP -> CString -> Ptr CString -> IO (CInt)
514 vgcreate :: GuestfsH -> String -> [String] -> IO ()
515 vgcreate h volgroup physvols = do
516 r <- withCString volgroup $ \volgroup -> withMany withCString physvols $ \physvols -> withArray0 nullPtr physvols $ \physvols -> withForeignPtr h (\p -> c_vgcreate p volgroup physvols)
523 foreign import ccall unsafe "guestfs_lvcreate" c_lvcreate
524 :: GuestfsP -> CString -> CString -> CInt -> IO (CInt)
526 lvcreate :: GuestfsH -> String -> String -> Int -> IO ()
527 lvcreate h logvol volgroup mbytes = do
528 r <- withCString logvol $ \logvol -> withCString volgroup $ \volgroup -> withForeignPtr h (\p -> c_lvcreate p logvol volgroup (fromIntegral mbytes))
535 foreign import ccall unsafe "guestfs_mkfs" c_mkfs
536 :: GuestfsP -> CString -> CString -> IO (CInt)
538 mkfs :: GuestfsH -> String -> String -> IO ()
539 mkfs h fstype device = do
540 r <- withCString fstype $ \fstype -> withCString device $ \device -> withForeignPtr h (\p -> c_mkfs p fstype device)
547 foreign import ccall unsafe "guestfs_sfdisk" c_sfdisk
548 :: GuestfsP -> CString -> CInt -> CInt -> CInt -> Ptr CString -> IO (CInt)
550 sfdisk :: GuestfsH -> String -> Int -> Int -> Int -> [String] -> IO ()
551 sfdisk h device cyls heads sectors lines = do
552 r <- withCString device $ \device -> withMany withCString lines $ \lines -> withArray0 nullPtr lines $ \lines -> withForeignPtr h (\p -> c_sfdisk p device (fromIntegral cyls) (fromIntegral heads) (fromIntegral sectors) lines)
559 foreign import ccall unsafe "guestfs_write_file" c_write_file
560 :: GuestfsP -> CString -> CString -> CInt -> IO (CInt)
562 write_file :: GuestfsH -> String -> String -> Int -> IO ()
563 write_file h path content size = do
564 r <- withCString path $ \path -> withCString content $ \content -> withForeignPtr h (\p -> c_write_file p path content (fromIntegral size))
571 foreign import ccall unsafe "guestfs_umount" c_umount
572 :: GuestfsP -> CString -> IO (CInt)
574 umount :: GuestfsH -> String -> IO ()
575 umount h pathordevice = do
576 r <- withCString pathordevice $ \pathordevice -> withForeignPtr h (\p -> c_umount p pathordevice)
583 foreign import ccall unsafe "guestfs_umount_all" c_umount_all
584 :: GuestfsP -> IO (CInt)
586 umount_all :: GuestfsH -> IO ()
588 r <- withForeignPtr h (\p -> c_umount_all p)
595 foreign import ccall unsafe "guestfs_lvm_remove_all" c_lvm_remove_all
596 :: GuestfsP -> IO (CInt)
598 lvm_remove_all :: GuestfsH -> IO ()
599 lvm_remove_all h = do
600 r <- withForeignPtr h (\p -> c_lvm_remove_all p)
607 foreign import ccall unsafe "guestfs_blockdev_setro" c_blockdev_setro
608 :: GuestfsP -> CString -> IO (CInt)
610 blockdev_setro :: GuestfsH -> String -> IO ()
611 blockdev_setro h device = do
612 r <- withCString device $ \device -> withForeignPtr h (\p -> c_blockdev_setro p device)
619 foreign import ccall unsafe "guestfs_blockdev_setrw" c_blockdev_setrw
620 :: GuestfsP -> CString -> IO (CInt)
622 blockdev_setrw :: GuestfsH -> String -> IO ()
623 blockdev_setrw h device = do
624 r <- withCString device $ \device -> withForeignPtr h (\p -> c_blockdev_setrw p device)
631 foreign import ccall unsafe "guestfs_blockdev_setbsz" c_blockdev_setbsz
632 :: GuestfsP -> CString -> CInt -> IO (CInt)
634 blockdev_setbsz :: GuestfsH -> String -> Int -> IO ()
635 blockdev_setbsz h device blocksize = do
636 r <- withCString device $ \device -> withForeignPtr h (\p -> c_blockdev_setbsz p device (fromIntegral blocksize))
643 foreign import ccall unsafe "guestfs_blockdev_flushbufs" c_blockdev_flushbufs
644 :: GuestfsP -> CString -> IO (CInt)
646 blockdev_flushbufs :: GuestfsH -> String -> IO ()
647 blockdev_flushbufs h device = do
648 r <- withCString device $ \device -> withForeignPtr h (\p -> c_blockdev_flushbufs p device)
655 foreign import ccall unsafe "guestfs_blockdev_rereadpt" c_blockdev_rereadpt
656 :: GuestfsP -> CString -> IO (CInt)
658 blockdev_rereadpt :: GuestfsH -> String -> IO ()
659 blockdev_rereadpt h device = do
660 r <- withCString device $ \device -> withForeignPtr h (\p -> c_blockdev_rereadpt p device)
667 foreign import ccall unsafe "guestfs_upload" c_upload
668 :: GuestfsP -> CString -> CString -> IO (CInt)
670 upload :: GuestfsH -> String -> String -> IO ()
671 upload h filename remotefilename = do
672 r <- withCString filename $ \filename -> withCString remotefilename $ \remotefilename -> withForeignPtr h (\p -> c_upload p filename remotefilename)
679 foreign import ccall unsafe "guestfs_download" c_download
680 :: GuestfsP -> CString -> CString -> IO (CInt)
682 download :: GuestfsH -> String -> String -> IO ()
683 download h remotefilename filename = do
684 r <- withCString remotefilename $ \remotefilename -> withCString filename $ \filename -> withForeignPtr h (\p -> c_download p remotefilename filename)
691 foreign import ccall unsafe "guestfs_tar_in" c_tar_in
692 :: GuestfsP -> CString -> CString -> IO (CInt)
694 tar_in :: GuestfsH -> String -> String -> IO ()
695 tar_in h tarfile directory = do
696 r <- withCString tarfile $ \tarfile -> withCString directory $ \directory -> withForeignPtr h (\p -> c_tar_in p tarfile directory)
703 foreign import ccall unsafe "guestfs_tar_out" c_tar_out
704 :: GuestfsP -> CString -> CString -> IO (CInt)
706 tar_out :: GuestfsH -> String -> String -> IO ()
707 tar_out h directory tarfile = do
708 r <- withCString directory $ \directory -> withCString tarfile $ \tarfile -> withForeignPtr h (\p -> c_tar_out p directory tarfile)
715 foreign import ccall unsafe "guestfs_tgz_in" c_tgz_in
716 :: GuestfsP -> CString -> CString -> IO (CInt)
718 tgz_in :: GuestfsH -> String -> String -> IO ()
719 tgz_in h tarball directory = do
720 r <- withCString tarball $ \tarball -> withCString directory $ \directory -> withForeignPtr h (\p -> c_tgz_in p tarball directory)
727 foreign import ccall unsafe "guestfs_tgz_out" c_tgz_out
728 :: GuestfsP -> CString -> CString -> IO (CInt)
730 tgz_out :: GuestfsH -> String -> String -> IO ()
731 tgz_out h directory tarball = do
732 r <- withCString directory $ \directory -> withCString tarball $ \tarball -> withForeignPtr h (\p -> c_tgz_out p directory tarball)
739 foreign import ccall unsafe "guestfs_mount_ro" c_mount_ro
740 :: GuestfsP -> CString -> CString -> IO (CInt)
742 mount_ro :: GuestfsH -> String -> String -> IO ()
743 mount_ro h device mountpoint = do
744 r <- withCString device $ \device -> withCString mountpoint $ \mountpoint -> withForeignPtr h (\p -> c_mount_ro p device mountpoint)
751 foreign import ccall unsafe "guestfs_mount_options" c_mount_options
752 :: GuestfsP -> CString -> CString -> CString -> IO (CInt)
754 mount_options :: GuestfsH -> String -> String -> String -> IO ()
755 mount_options h options device mountpoint = do
756 r <- withCString options $ \options -> withCString device $ \device -> withCString mountpoint $ \mountpoint -> withForeignPtr h (\p -> c_mount_options p options device mountpoint)
763 foreign import ccall unsafe "guestfs_mount_vfs" c_mount_vfs
764 :: GuestfsP -> CString -> CString -> CString -> CString -> IO (CInt)
766 mount_vfs :: GuestfsH -> String -> String -> String -> String -> IO ()
767 mount_vfs h options vfstype device mountpoint = do
768 r <- withCString options $ \options -> withCString vfstype $ \vfstype -> withCString device $ \device -> withCString mountpoint $ \mountpoint -> withForeignPtr h (\p -> c_mount_vfs p options vfstype device mountpoint)
775 foreign import ccall unsafe "guestfs_lvremove" c_lvremove
776 :: GuestfsP -> CString -> IO (CInt)
778 lvremove :: GuestfsH -> String -> IO ()
779 lvremove h device = do
780 r <- withCString device $ \device -> withForeignPtr h (\p -> c_lvremove p device)
787 foreign import ccall unsafe "guestfs_vgremove" c_vgremove
788 :: GuestfsP -> CString -> IO (CInt)
790 vgremove :: GuestfsH -> String -> IO ()
791 vgremove h vgname = do
792 r <- withCString vgname $ \vgname -> withForeignPtr h (\p -> c_vgremove p vgname)
799 foreign import ccall unsafe "guestfs_pvremove" c_pvremove
800 :: GuestfsP -> CString -> IO (CInt)
802 pvremove :: GuestfsH -> String -> IO ()
803 pvremove h device = do
804 r <- withCString device $ \device -> withForeignPtr h (\p -> c_pvremove p device)
811 foreign import ccall unsafe "guestfs_set_e2label" c_set_e2label
812 :: GuestfsP -> CString -> CString -> IO (CInt)
814 set_e2label :: GuestfsH -> String -> String -> IO ()
815 set_e2label h device label = do
816 r <- withCString device $ \device -> withCString label $ \label -> withForeignPtr h (\p -> c_set_e2label p device label)
823 foreign import ccall unsafe "guestfs_set_e2uuid" c_set_e2uuid
824 :: GuestfsP -> CString -> CString -> IO (CInt)
826 set_e2uuid :: GuestfsH -> String -> String -> IO ()
827 set_e2uuid h device uuid = do
828 r <- withCString device $ \device -> withCString uuid $ \uuid -> withForeignPtr h (\p -> c_set_e2uuid p device uuid)
835 foreign import ccall unsafe "guestfs_zero" c_zero
836 :: GuestfsP -> CString -> IO (CInt)
838 zero :: GuestfsH -> String -> IO ()
840 r <- withCString device $ \device -> withForeignPtr h (\p -> c_zero p device)
847 foreign import ccall unsafe "guestfs_grub_install" c_grub_install
848 :: GuestfsP -> CString -> CString -> IO (CInt)
850 grub_install :: GuestfsH -> String -> String -> IO ()
851 grub_install h root device = do
852 r <- withCString root $ \root -> withCString device $ \device -> withForeignPtr h (\p -> c_grub_install p root device)
859 foreign import ccall unsafe "guestfs_cp" c_cp
860 :: GuestfsP -> CString -> CString -> IO (CInt)
862 cp :: GuestfsH -> String -> String -> IO ()
864 r <- withCString src $ \src -> withCString dest $ \dest -> withForeignPtr h (\p -> c_cp p src dest)
871 foreign import ccall unsafe "guestfs_cp_a" c_cp_a
872 :: GuestfsP -> CString -> CString -> IO (CInt)
874 cp_a :: GuestfsH -> String -> String -> IO ()
876 r <- withCString src $ \src -> withCString dest $ \dest -> withForeignPtr h (\p -> c_cp_a p src dest)
883 foreign import ccall unsafe "guestfs_mv" c_mv
884 :: GuestfsP -> CString -> CString -> IO (CInt)
886 mv :: GuestfsH -> String -> String -> IO ()
888 r <- withCString src $ \src -> withCString dest $ \dest -> withForeignPtr h (\p -> c_mv p src dest)
895 foreign import ccall unsafe "guestfs_drop_caches" c_drop_caches
896 :: GuestfsP -> CInt -> IO (CInt)
898 drop_caches :: GuestfsH -> Int -> IO ()
899 drop_caches h whattodrop = do
900 r <- withForeignPtr h (\p -> c_drop_caches p (fromIntegral whattodrop))
907 foreign import ccall unsafe "guestfs_ping_daemon" c_ping_daemon
908 :: GuestfsP -> IO (CInt)
910 ping_daemon :: GuestfsH -> IO ()
912 r <- withForeignPtr h (\p -> c_ping_daemon p)
919 foreign import ccall unsafe "guestfs_zerofree" c_zerofree
920 :: GuestfsP -> CString -> IO (CInt)
922 zerofree :: GuestfsH -> String -> IO ()
923 zerofree h device = do
924 r <- withCString device $ \device -> withForeignPtr h (\p -> c_zerofree p device)
931 foreign import ccall unsafe "guestfs_pvresize" c_pvresize
932 :: GuestfsP -> CString -> IO (CInt)
934 pvresize :: GuestfsH -> String -> IO ()
935 pvresize h device = do
936 r <- withCString device $ \device -> withForeignPtr h (\p -> c_pvresize p device)
943 foreign import ccall unsafe "guestfs_sfdisk_N" c_sfdisk_N
944 :: GuestfsP -> CString -> CInt -> CInt -> CInt -> CInt -> CString -> IO (CInt)
946 sfdisk_N :: GuestfsH -> String -> Int -> Int -> Int -> Int -> String -> IO ()
947 sfdisk_N h device n cyls heads sectors line = do
948 r <- withCString device $ \device -> withCString line $ \line -> withForeignPtr h (\p -> c_sfdisk_N p device (fromIntegral n) (fromIntegral cyls) (fromIntegral heads) (fromIntegral sectors) line)
955 foreign import ccall unsafe "guestfs_lvresize" c_lvresize
956 :: GuestfsP -> CString -> CInt -> IO (CInt)
958 lvresize :: GuestfsH -> String -> Int -> IO ()
959 lvresize h device mbytes = do
960 r <- withCString device $ \device -> withForeignPtr h (\p -> c_lvresize p device (fromIntegral mbytes))
967 foreign import ccall unsafe "guestfs_resize2fs" c_resize2fs
968 :: GuestfsP -> CString -> IO (CInt)
970 resize2fs :: GuestfsH -> String -> IO ()
971 resize2fs h device = do
972 r <- withCString device $ \device -> withForeignPtr h (\p -> c_resize2fs p device)
979 foreign import ccall unsafe "guestfs_e2fsck_f" c_e2fsck_f
980 :: GuestfsP -> CString -> IO (CInt)
982 e2fsck_f :: GuestfsH -> String -> IO ()
983 e2fsck_f h device = do
984 r <- withCString device $ \device -> withForeignPtr h (\p -> c_e2fsck_f p device)
991 foreign import ccall unsafe "guestfs_sleep" c_sleep
992 :: GuestfsP -> CInt -> IO (CInt)
994 sleep :: GuestfsH -> Int -> IO ()
996 r <- withForeignPtr h (\p -> c_sleep p (fromIntegral secs))
1003 foreign import ccall unsafe "guestfs_scrub_device" c_scrub_device
1004 :: GuestfsP -> CString -> IO (CInt)
1006 scrub_device :: GuestfsH -> String -> IO ()
1007 scrub_device h device = do
1008 r <- withCString device $ \device -> withForeignPtr h (\p -> c_scrub_device p device)
1015 foreign import ccall unsafe "guestfs_scrub_file" c_scrub_file
1016 :: GuestfsP -> CString -> IO (CInt)
1018 scrub_file :: GuestfsH -> String -> IO ()
1019 scrub_file h file = do
1020 r <- withCString file $ \file -> withForeignPtr h (\p -> c_scrub_file p file)
1027 foreign import ccall unsafe "guestfs_scrub_freespace" c_scrub_freespace
1028 :: GuestfsP -> CString -> IO (CInt)
1030 scrub_freespace :: GuestfsH -> String -> IO ()
1031 scrub_freespace h dir = do
1032 r <- withCString dir $ \dir -> withForeignPtr h (\p -> c_scrub_freespace p dir)