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 #-}
110 import Foreign.C.Types
112 import Control.Exception
115 data GuestfsS = GuestfsS -- represents the opaque C struct
116 type GuestfsP = Ptr GuestfsS -- guestfs_h *
117 type GuestfsH = ForeignPtr GuestfsS -- guestfs_h * with attached finalizer
119 -- XXX define properly later XXX
123 data IntBool = IntBool
125 data StatVFS = StatVFS
126 data Hashtable = Hashtable
128 foreign import ccall unsafe "guestfs_create" c_create
130 foreign import ccall unsafe "&guestfs_close" c_close
131 :: FunPtr (GuestfsP -> IO ())
132 foreign import ccall unsafe "guestfs_set_error_handler" c_set_error_handler
133 :: GuestfsP -> Ptr CInt -> Ptr CInt -> IO ()
135 create :: IO GuestfsH
138 c_set_error_handler p nullPtr nullPtr
139 h <- newForeignPtr c_close p
142 foreign import ccall unsafe "guestfs_last_error" c_last_error
143 :: GuestfsP -> IO CString
145 -- last_error :: GuestfsH -> IO (Maybe String)
147 -- str <- withForeignPtr h (\p -> c_last_error p)
148 -- maybePeek peekCString str
150 last_error :: GuestfsH -> IO (String)
152 str <- withForeignPtr h (\p -> c_last_error p)
154 then return "no error"
157 foreign import ccall unsafe "guestfs_test0" c_test0
158 :: GuestfsP -> CString -> CString -> Ptr CString -> CInt -> CInt -> CString -> CString -> IO (CInt)
160 test0 :: GuestfsH -> String -> Maybe String -> [String] -> Bool -> Int -> String -> String -> IO ()
161 test0 h str optstr strlist b integer filein fileout = do
162 r <- withCString str $ \str -> maybeWith withCString optstr $ \optstr -> withMany withCString strlist $ \strlist -> withArray0 nullPtr strlist $ \strlist -> withCString filein $ \filein -> withCString fileout $ \fileout -> withForeignPtr h (\p -> c_test0 p str optstr strlist (fromBool b) (fromIntegral integer) filein fileout)
169 foreign import ccall unsafe "guestfs_launch" c_launch
170 :: GuestfsP -> IO (CInt)
172 launch :: GuestfsH -> IO ()
174 r <- withForeignPtr h (\p -> c_launch p)
181 foreign import ccall unsafe "guestfs_wait_ready" c_wait_ready
182 :: GuestfsP -> IO (CInt)
184 wait_ready :: GuestfsH -> IO ()
186 r <- withForeignPtr h (\p -> c_wait_ready p)
193 foreign import ccall unsafe "guestfs_kill_subprocess" c_kill_subprocess
194 :: GuestfsP -> IO (CInt)
196 kill_subprocess :: GuestfsH -> IO ()
197 kill_subprocess h = do
198 r <- withForeignPtr h (\p -> c_kill_subprocess p)
205 foreign import ccall unsafe "guestfs_add_drive" c_add_drive
206 :: GuestfsP -> CString -> IO (CInt)
208 add_drive :: GuestfsH -> String -> IO ()
209 add_drive h filename = do
210 r <- withCString filename $ \filename -> withForeignPtr h (\p -> c_add_drive p filename)
217 foreign import ccall unsafe "guestfs_add_cdrom" c_add_cdrom
218 :: GuestfsP -> CString -> IO (CInt)
220 add_cdrom :: GuestfsH -> String -> IO ()
221 add_cdrom h filename = do
222 r <- withCString filename $ \filename -> withForeignPtr h (\p -> c_add_cdrom p filename)
229 foreign import ccall unsafe "guestfs_add_drive_ro" c_add_drive_ro
230 :: GuestfsP -> CString -> IO (CInt)
232 add_drive_ro :: GuestfsH -> String -> IO ()
233 add_drive_ro h filename = do
234 r <- withCString filename $ \filename -> withForeignPtr h (\p -> c_add_drive_ro p filename)
241 foreign import ccall unsafe "guestfs_config" c_config
242 :: GuestfsP -> CString -> CString -> IO (CInt)
244 config :: GuestfsH -> String -> Maybe String -> IO ()
245 config h qemuparam qemuvalue = do
246 r <- withCString qemuparam $ \qemuparam -> maybeWith withCString qemuvalue $ \qemuvalue -> withForeignPtr h (\p -> c_config p qemuparam qemuvalue)
253 foreign import ccall unsafe "guestfs_set_qemu" c_set_qemu
254 :: GuestfsP -> CString -> IO (CInt)
256 set_qemu :: GuestfsH -> String -> IO ()
258 r <- withCString qemu $ \qemu -> withForeignPtr h (\p -> c_set_qemu p qemu)
265 foreign import ccall unsafe "guestfs_set_path" c_set_path
266 :: GuestfsP -> CString -> IO (CInt)
268 set_path :: GuestfsH -> String -> IO ()
270 r <- withCString path $ \path -> withForeignPtr h (\p -> c_set_path p path)
277 foreign import ccall unsafe "guestfs_set_append" c_set_append
278 :: GuestfsP -> CString -> IO (CInt)
280 set_append :: GuestfsH -> String -> IO ()
281 set_append h append = do
282 r <- withCString append $ \append -> withForeignPtr h (\p -> c_set_append p append)
289 foreign import ccall unsafe "guestfs_set_autosync" c_set_autosync
290 :: GuestfsP -> CInt -> IO (CInt)
292 set_autosync :: GuestfsH -> Bool -> IO ()
293 set_autosync h autosync = do
294 r <- withForeignPtr h (\p -> c_set_autosync p (fromBool autosync))
301 foreign import ccall unsafe "guestfs_set_verbose" c_set_verbose
302 :: GuestfsP -> CInt -> IO (CInt)
304 set_verbose :: GuestfsH -> Bool -> IO ()
305 set_verbose h verbose = do
306 r <- withForeignPtr h (\p -> c_set_verbose p (fromBool verbose))
313 foreign import ccall unsafe "guestfs_set_busy" c_set_busy
314 :: GuestfsP -> IO (CInt)
316 set_busy :: GuestfsH -> IO ()
318 r <- withForeignPtr h (\p -> c_set_busy p)
325 foreign import ccall unsafe "guestfs_set_ready" c_set_ready
326 :: GuestfsP -> IO (CInt)
328 set_ready :: GuestfsH -> IO ()
330 r <- withForeignPtr h (\p -> c_set_ready p)
337 foreign import ccall unsafe "guestfs_end_busy" c_end_busy
338 :: GuestfsP -> IO (CInt)
340 end_busy :: GuestfsH -> IO ()
342 r <- withForeignPtr h (\p -> c_end_busy p)
349 foreign import ccall unsafe "guestfs_mount" c_mount
350 :: GuestfsP -> CString -> CString -> IO (CInt)
352 mount :: GuestfsH -> String -> String -> IO ()
353 mount h device mountpoint = do
354 r <- withCString device $ \device -> withCString mountpoint $ \mountpoint -> withForeignPtr h (\p -> c_mount p device mountpoint)
361 foreign import ccall unsafe "guestfs_sync" c_sync
362 :: GuestfsP -> IO (CInt)
364 sync :: GuestfsH -> IO ()
366 r <- withForeignPtr h (\p -> c_sync p)
373 foreign import ccall unsafe "guestfs_touch" c_touch
374 :: GuestfsP -> CString -> IO (CInt)
376 touch :: GuestfsH -> String -> IO ()
378 r <- withCString path $ \path -> withForeignPtr h (\p -> c_touch p path)
385 foreign import ccall unsafe "guestfs_aug_init" c_aug_init
386 :: GuestfsP -> CString -> CInt -> IO (CInt)
388 aug_init :: GuestfsH -> String -> Int -> IO ()
389 aug_init h root flags = do
390 r <- withCString root $ \root -> withForeignPtr h (\p -> c_aug_init p root (fromIntegral flags))
397 foreign import ccall unsafe "guestfs_aug_close" c_aug_close
398 :: GuestfsP -> IO (CInt)
400 aug_close :: GuestfsH -> IO ()
402 r <- withForeignPtr h (\p -> c_aug_close p)
409 foreign import ccall unsafe "guestfs_aug_set" c_aug_set
410 :: GuestfsP -> CString -> CString -> IO (CInt)
412 aug_set :: GuestfsH -> String -> String -> IO ()
413 aug_set h path val = do
414 r <- withCString path $ \path -> withCString val $ \val -> withForeignPtr h (\p -> c_aug_set p path val)
421 foreign import ccall unsafe "guestfs_aug_insert" c_aug_insert
422 :: GuestfsP -> CString -> CString -> CInt -> IO (CInt)
424 aug_insert :: GuestfsH -> String -> String -> Bool -> IO ()
425 aug_insert h path label before = do
426 r <- withCString path $ \path -> withCString label $ \label -> withForeignPtr h (\p -> c_aug_insert p path label (fromBool before))
433 foreign import ccall unsafe "guestfs_aug_mv" c_aug_mv
434 :: GuestfsP -> CString -> CString -> IO (CInt)
436 aug_mv :: GuestfsH -> String -> String -> IO ()
437 aug_mv h src dest = do
438 r <- withCString src $ \src -> withCString dest $ \dest -> withForeignPtr h (\p -> c_aug_mv p src dest)
445 foreign import ccall unsafe "guestfs_aug_save" c_aug_save
446 :: GuestfsP -> IO (CInt)
448 aug_save :: GuestfsH -> IO ()
450 r <- withForeignPtr h (\p -> c_aug_save p)
457 foreign import ccall unsafe "guestfs_aug_load" c_aug_load
458 :: GuestfsP -> IO (CInt)
460 aug_load :: GuestfsH -> IO ()
462 r <- withForeignPtr h (\p -> c_aug_load p)
469 foreign import ccall unsafe "guestfs_rm" c_rm
470 :: GuestfsP -> CString -> IO (CInt)
472 rm :: GuestfsH -> String -> IO ()
474 r <- withCString path $ \path -> withForeignPtr h (\p -> c_rm p path)
481 foreign import ccall unsafe "guestfs_rmdir" c_rmdir
482 :: GuestfsP -> CString -> IO (CInt)
484 rmdir :: GuestfsH -> String -> IO ()
486 r <- withCString path $ \path -> withForeignPtr h (\p -> c_rmdir p path)
493 foreign import ccall unsafe "guestfs_rm_rf" c_rm_rf
494 :: GuestfsP -> CString -> IO (CInt)
496 rm_rf :: GuestfsH -> String -> IO ()
498 r <- withCString path $ \path -> withForeignPtr h (\p -> c_rm_rf p path)
505 foreign import ccall unsafe "guestfs_mkdir" c_mkdir
506 :: GuestfsP -> CString -> IO (CInt)
508 mkdir :: GuestfsH -> String -> IO ()
510 r <- withCString path $ \path -> withForeignPtr h (\p -> c_mkdir p path)
517 foreign import ccall unsafe "guestfs_mkdir_p" c_mkdir_p
518 :: GuestfsP -> CString -> IO (CInt)
520 mkdir_p :: GuestfsH -> String -> IO ()
522 r <- withCString path $ \path -> withForeignPtr h (\p -> c_mkdir_p p path)
529 foreign import ccall unsafe "guestfs_chmod" c_chmod
530 :: GuestfsP -> CInt -> CString -> IO (CInt)
532 chmod :: GuestfsH -> Int -> String -> IO ()
533 chmod h mode path = do
534 r <- withCString path $ \path -> withForeignPtr h (\p -> c_chmod p (fromIntegral mode) path)
541 foreign import ccall unsafe "guestfs_chown" c_chown
542 :: GuestfsP -> CInt -> CInt -> CString -> IO (CInt)
544 chown :: GuestfsH -> Int -> Int -> String -> IO ()
545 chown h owner group path = do
546 r <- withCString path $ \path -> withForeignPtr h (\p -> c_chown p (fromIntegral owner) (fromIntegral group) path)
553 foreign import ccall unsafe "guestfs_pvcreate" c_pvcreate
554 :: GuestfsP -> CString -> IO (CInt)
556 pvcreate :: GuestfsH -> String -> IO ()
557 pvcreate h device = do
558 r <- withCString device $ \device -> withForeignPtr h (\p -> c_pvcreate p device)
565 foreign import ccall unsafe "guestfs_vgcreate" c_vgcreate
566 :: GuestfsP -> CString -> Ptr CString -> IO (CInt)
568 vgcreate :: GuestfsH -> String -> [String] -> IO ()
569 vgcreate h volgroup physvols = do
570 r <- withCString volgroup $ \volgroup -> withMany withCString physvols $ \physvols -> withArray0 nullPtr physvols $ \physvols -> withForeignPtr h (\p -> c_vgcreate p volgroup physvols)
577 foreign import ccall unsafe "guestfs_lvcreate" c_lvcreate
578 :: GuestfsP -> CString -> CString -> CInt -> IO (CInt)
580 lvcreate :: GuestfsH -> String -> String -> Int -> IO ()
581 lvcreate h logvol volgroup mbytes = do
582 r <- withCString logvol $ \logvol -> withCString volgroup $ \volgroup -> withForeignPtr h (\p -> c_lvcreate p logvol volgroup (fromIntegral mbytes))
589 foreign import ccall unsafe "guestfs_mkfs" c_mkfs
590 :: GuestfsP -> CString -> CString -> IO (CInt)
592 mkfs :: GuestfsH -> String -> String -> IO ()
593 mkfs h fstype device = do
594 r <- withCString fstype $ \fstype -> withCString device $ \device -> withForeignPtr h (\p -> c_mkfs p fstype device)
601 foreign import ccall unsafe "guestfs_sfdisk" c_sfdisk
602 :: GuestfsP -> CString -> CInt -> CInt -> CInt -> Ptr CString -> IO (CInt)
604 sfdisk :: GuestfsH -> String -> Int -> Int -> Int -> [String] -> IO ()
605 sfdisk h device cyls heads sectors lines = do
606 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)
613 foreign import ccall unsafe "guestfs_write_file" c_write_file
614 :: GuestfsP -> CString -> CString -> CInt -> IO (CInt)
616 write_file :: GuestfsH -> String -> String -> Int -> IO ()
617 write_file h path content size = do
618 r <- withCString path $ \path -> withCString content $ \content -> withForeignPtr h (\p -> c_write_file p path content (fromIntegral size))
625 foreign import ccall unsafe "guestfs_umount" c_umount
626 :: GuestfsP -> CString -> IO (CInt)
628 umount :: GuestfsH -> String -> IO ()
629 umount h pathordevice = do
630 r <- withCString pathordevice $ \pathordevice -> withForeignPtr h (\p -> c_umount p pathordevice)
637 foreign import ccall unsafe "guestfs_umount_all" c_umount_all
638 :: GuestfsP -> IO (CInt)
640 umount_all :: GuestfsH -> IO ()
642 r <- withForeignPtr h (\p -> c_umount_all p)
649 foreign import ccall unsafe "guestfs_lvm_remove_all" c_lvm_remove_all
650 :: GuestfsP -> IO (CInt)
652 lvm_remove_all :: GuestfsH -> IO ()
653 lvm_remove_all h = do
654 r <- withForeignPtr h (\p -> c_lvm_remove_all p)
661 foreign import ccall unsafe "guestfs_blockdev_setro" c_blockdev_setro
662 :: GuestfsP -> CString -> IO (CInt)
664 blockdev_setro :: GuestfsH -> String -> IO ()
665 blockdev_setro h device = do
666 r <- withCString device $ \device -> withForeignPtr h (\p -> c_blockdev_setro p device)
673 foreign import ccall unsafe "guestfs_blockdev_setrw" c_blockdev_setrw
674 :: GuestfsP -> CString -> IO (CInt)
676 blockdev_setrw :: GuestfsH -> String -> IO ()
677 blockdev_setrw h device = do
678 r <- withCString device $ \device -> withForeignPtr h (\p -> c_blockdev_setrw p device)
685 foreign import ccall unsafe "guestfs_blockdev_setbsz" c_blockdev_setbsz
686 :: GuestfsP -> CString -> CInt -> IO (CInt)
688 blockdev_setbsz :: GuestfsH -> String -> Int -> IO ()
689 blockdev_setbsz h device blocksize = do
690 r <- withCString device $ \device -> withForeignPtr h (\p -> c_blockdev_setbsz p device (fromIntegral blocksize))
697 foreign import ccall unsafe "guestfs_blockdev_flushbufs" c_blockdev_flushbufs
698 :: GuestfsP -> CString -> IO (CInt)
700 blockdev_flushbufs :: GuestfsH -> String -> IO ()
701 blockdev_flushbufs h device = do
702 r <- withCString device $ \device -> withForeignPtr h (\p -> c_blockdev_flushbufs p device)
709 foreign import ccall unsafe "guestfs_blockdev_rereadpt" c_blockdev_rereadpt
710 :: GuestfsP -> CString -> IO (CInt)
712 blockdev_rereadpt :: GuestfsH -> String -> IO ()
713 blockdev_rereadpt h device = do
714 r <- withCString device $ \device -> withForeignPtr h (\p -> c_blockdev_rereadpt p device)
721 foreign import ccall unsafe "guestfs_upload" c_upload
722 :: GuestfsP -> CString -> CString -> IO (CInt)
724 upload :: GuestfsH -> String -> String -> IO ()
725 upload h filename remotefilename = do
726 r <- withCString filename $ \filename -> withCString remotefilename $ \remotefilename -> withForeignPtr h (\p -> c_upload p filename remotefilename)
733 foreign import ccall unsafe "guestfs_download" c_download
734 :: GuestfsP -> CString -> CString -> IO (CInt)
736 download :: GuestfsH -> String -> String -> IO ()
737 download h remotefilename filename = do
738 r <- withCString remotefilename $ \remotefilename -> withCString filename $ \filename -> withForeignPtr h (\p -> c_download p remotefilename filename)
745 foreign import ccall unsafe "guestfs_tar_in" c_tar_in
746 :: GuestfsP -> CString -> CString -> IO (CInt)
748 tar_in :: GuestfsH -> String -> String -> IO ()
749 tar_in h tarfile directory = do
750 r <- withCString tarfile $ \tarfile -> withCString directory $ \directory -> withForeignPtr h (\p -> c_tar_in p tarfile directory)
757 foreign import ccall unsafe "guestfs_tar_out" c_tar_out
758 :: GuestfsP -> CString -> CString -> IO (CInt)
760 tar_out :: GuestfsH -> String -> String -> IO ()
761 tar_out h directory tarfile = do
762 r <- withCString directory $ \directory -> withCString tarfile $ \tarfile -> withForeignPtr h (\p -> c_tar_out p directory tarfile)
769 foreign import ccall unsafe "guestfs_tgz_in" c_tgz_in
770 :: GuestfsP -> CString -> CString -> IO (CInt)
772 tgz_in :: GuestfsH -> String -> String -> IO ()
773 tgz_in h tarball directory = do
774 r <- withCString tarball $ \tarball -> withCString directory $ \directory -> withForeignPtr h (\p -> c_tgz_in p tarball directory)
781 foreign import ccall unsafe "guestfs_tgz_out" c_tgz_out
782 :: GuestfsP -> CString -> CString -> IO (CInt)
784 tgz_out :: GuestfsH -> String -> String -> IO ()
785 tgz_out h directory tarball = do
786 r <- withCString directory $ \directory -> withCString tarball $ \tarball -> withForeignPtr h (\p -> c_tgz_out p directory tarball)
793 foreign import ccall unsafe "guestfs_mount_ro" c_mount_ro
794 :: GuestfsP -> CString -> CString -> IO (CInt)
796 mount_ro :: GuestfsH -> String -> String -> IO ()
797 mount_ro h device mountpoint = do
798 r <- withCString device $ \device -> withCString mountpoint $ \mountpoint -> withForeignPtr h (\p -> c_mount_ro p device mountpoint)
805 foreign import ccall unsafe "guestfs_mount_options" c_mount_options
806 :: GuestfsP -> CString -> CString -> CString -> IO (CInt)
808 mount_options :: GuestfsH -> String -> String -> String -> IO ()
809 mount_options h options device mountpoint = do
810 r <- withCString options $ \options -> withCString device $ \device -> withCString mountpoint $ \mountpoint -> withForeignPtr h (\p -> c_mount_options p options device mountpoint)
817 foreign import ccall unsafe "guestfs_mount_vfs" c_mount_vfs
818 :: GuestfsP -> CString -> CString -> CString -> CString -> IO (CInt)
820 mount_vfs :: GuestfsH -> String -> String -> String -> String -> IO ()
821 mount_vfs h options vfstype device mountpoint = do
822 r <- withCString options $ \options -> withCString vfstype $ \vfstype -> withCString device $ \device -> withCString mountpoint $ \mountpoint -> withForeignPtr h (\p -> c_mount_vfs p options vfstype device mountpoint)
829 foreign import ccall unsafe "guestfs_lvremove" c_lvremove
830 :: GuestfsP -> CString -> IO (CInt)
832 lvremove :: GuestfsH -> String -> IO ()
833 lvremove h device = do
834 r <- withCString device $ \device -> withForeignPtr h (\p -> c_lvremove p device)
841 foreign import ccall unsafe "guestfs_vgremove" c_vgremove
842 :: GuestfsP -> CString -> IO (CInt)
844 vgremove :: GuestfsH -> String -> IO ()
845 vgremove h vgname = do
846 r <- withCString vgname $ \vgname -> withForeignPtr h (\p -> c_vgremove p vgname)
853 foreign import ccall unsafe "guestfs_pvremove" c_pvremove
854 :: GuestfsP -> CString -> IO (CInt)
856 pvremove :: GuestfsH -> String -> IO ()
857 pvremove h device = do
858 r <- withCString device $ \device -> withForeignPtr h (\p -> c_pvremove p device)
865 foreign import ccall unsafe "guestfs_set_e2label" c_set_e2label
866 :: GuestfsP -> CString -> CString -> IO (CInt)
868 set_e2label :: GuestfsH -> String -> String -> IO ()
869 set_e2label h device label = do
870 r <- withCString device $ \device -> withCString label $ \label -> withForeignPtr h (\p -> c_set_e2label p device label)
877 foreign import ccall unsafe "guestfs_set_e2uuid" c_set_e2uuid
878 :: GuestfsP -> CString -> CString -> IO (CInt)
880 set_e2uuid :: GuestfsH -> String -> String -> IO ()
881 set_e2uuid h device uuid = do
882 r <- withCString device $ \device -> withCString uuid $ \uuid -> withForeignPtr h (\p -> c_set_e2uuid p device uuid)
889 foreign import ccall unsafe "guestfs_zero" c_zero
890 :: GuestfsP -> CString -> IO (CInt)
892 zero :: GuestfsH -> String -> IO ()
894 r <- withCString device $ \device -> withForeignPtr h (\p -> c_zero p device)
901 foreign import ccall unsafe "guestfs_grub_install" c_grub_install
902 :: GuestfsP -> CString -> CString -> IO (CInt)
904 grub_install :: GuestfsH -> String -> String -> IO ()
905 grub_install h root device = do
906 r <- withCString root $ \root -> withCString device $ \device -> withForeignPtr h (\p -> c_grub_install p root device)
913 foreign import ccall unsafe "guestfs_cp" c_cp
914 :: GuestfsP -> CString -> CString -> IO (CInt)
916 cp :: GuestfsH -> String -> String -> IO ()
918 r <- withCString src $ \src -> withCString dest $ \dest -> withForeignPtr h (\p -> c_cp p src dest)
925 foreign import ccall unsafe "guestfs_cp_a" c_cp_a
926 :: GuestfsP -> CString -> CString -> IO (CInt)
928 cp_a :: GuestfsH -> String -> String -> IO ()
930 r <- withCString src $ \src -> withCString dest $ \dest -> withForeignPtr h (\p -> c_cp_a p src dest)
937 foreign import ccall unsafe "guestfs_mv" c_mv
938 :: GuestfsP -> CString -> CString -> IO (CInt)
940 mv :: GuestfsH -> String -> String -> IO ()
942 r <- withCString src $ \src -> withCString dest $ \dest -> withForeignPtr h (\p -> c_mv p src dest)
949 foreign import ccall unsafe "guestfs_drop_caches" c_drop_caches
950 :: GuestfsP -> CInt -> IO (CInt)
952 drop_caches :: GuestfsH -> Int -> IO ()
953 drop_caches h whattodrop = do
954 r <- withForeignPtr h (\p -> c_drop_caches p (fromIntegral whattodrop))
961 foreign import ccall unsafe "guestfs_ping_daemon" c_ping_daemon
962 :: GuestfsP -> IO (CInt)
964 ping_daemon :: GuestfsH -> IO ()
966 r <- withForeignPtr h (\p -> c_ping_daemon p)
973 foreign import ccall unsafe "guestfs_zerofree" c_zerofree
974 :: GuestfsP -> CString -> IO (CInt)
976 zerofree :: GuestfsH -> String -> IO ()
977 zerofree h device = do
978 r <- withCString device $ \device -> withForeignPtr h (\p -> c_zerofree p device)
985 foreign import ccall unsafe "guestfs_pvresize" c_pvresize
986 :: GuestfsP -> CString -> IO (CInt)
988 pvresize :: GuestfsH -> String -> IO ()
989 pvresize h device = do
990 r <- withCString device $ \device -> withForeignPtr h (\p -> c_pvresize p device)
997 foreign import ccall unsafe "guestfs_sfdisk_N" c_sfdisk_N
998 :: GuestfsP -> CString -> CInt -> CInt -> CInt -> CInt -> CString -> IO (CInt)
1000 sfdisk_N :: GuestfsH -> String -> Int -> Int -> Int -> Int -> String -> IO ()
1001 sfdisk_N h device n cyls heads sectors line = do
1002 r <- withCString device $ \device -> withCString line $ \line -> withForeignPtr h (\p -> c_sfdisk_N p device (fromIntegral n) (fromIntegral cyls) (fromIntegral heads) (fromIntegral sectors) line)
1009 foreign import ccall unsafe "guestfs_vg_activate_all" c_vg_activate_all
1010 :: GuestfsP -> CInt -> IO (CInt)
1012 vg_activate_all :: GuestfsH -> Bool -> IO ()
1013 vg_activate_all h activate = do
1014 r <- withForeignPtr h (\p -> c_vg_activate_all p (fromBool activate))
1021 foreign import ccall unsafe "guestfs_vg_activate" c_vg_activate
1022 :: GuestfsP -> CInt -> Ptr CString -> IO (CInt)
1024 vg_activate :: GuestfsH -> Bool -> [String] -> IO ()
1025 vg_activate h activate volgroups = do
1026 r <- withMany withCString volgroups $ \volgroups -> withArray0 nullPtr volgroups $ \volgroups -> withForeignPtr h (\p -> c_vg_activate p (fromBool activate) volgroups)
1033 foreign import ccall unsafe "guestfs_lvresize" c_lvresize
1034 :: GuestfsP -> CString -> CInt -> IO (CInt)
1036 lvresize :: GuestfsH -> String -> Int -> IO ()
1037 lvresize h device mbytes = do
1038 r <- withCString device $ \device -> withForeignPtr h (\p -> c_lvresize p device (fromIntegral mbytes))
1045 foreign import ccall unsafe "guestfs_resize2fs" c_resize2fs
1046 :: GuestfsP -> CString -> IO (CInt)
1048 resize2fs :: GuestfsH -> String -> IO ()
1049 resize2fs h device = do
1050 r <- withCString device $ \device -> withForeignPtr h (\p -> c_resize2fs p device)
1057 foreign import ccall unsafe "guestfs_e2fsck_f" c_e2fsck_f
1058 :: GuestfsP -> CString -> IO (CInt)
1060 e2fsck_f :: GuestfsH -> String -> IO ()
1061 e2fsck_f h device = do
1062 r <- withCString device $ \device -> withForeignPtr h (\p -> c_e2fsck_f p device)
1069 foreign import ccall unsafe "guestfs_sleep" c_sleep
1070 :: GuestfsP -> CInt -> IO (CInt)
1072 sleep :: GuestfsH -> Int -> IO ()
1074 r <- withForeignPtr h (\p -> c_sleep p (fromIntegral secs))
1081 foreign import ccall unsafe "guestfs_scrub_device" c_scrub_device
1082 :: GuestfsP -> CString -> IO (CInt)
1084 scrub_device :: GuestfsH -> String -> IO ()
1085 scrub_device h device = do
1086 r <- withCString device $ \device -> withForeignPtr h (\p -> c_scrub_device p device)
1093 foreign import ccall unsafe "guestfs_scrub_file" c_scrub_file
1094 :: GuestfsP -> CString -> IO (CInt)
1096 scrub_file :: GuestfsH -> String -> IO ()
1097 scrub_file h file = do
1098 r <- withCString file $ \file -> withForeignPtr h (\p -> c_scrub_file p file)
1105 foreign import ccall unsafe "guestfs_scrub_freespace" c_scrub_freespace
1106 :: GuestfsP -> CString -> IO (CInt)
1108 scrub_freespace :: GuestfsH -> String -> IO ()
1109 scrub_freespace h dir = do
1110 r <- withCString dir $ \dir -> withForeignPtr h (\p -> c_scrub_freespace p dir)