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
33 my_newSVll(long long val) {
39 len = snprintf(buf, 100, "%" PRId64, val);
40 return newSVpv(buf, len);
49 my_newSVull(unsigned long long val) {
55 len = snprintf(buf, 100, "%" PRIu64, val);
56 return newSVpv(buf, len);
60 /* http://www.perlmonks.org/?node_id=680842 */
62 XS_unpack_charPtrPtr (SV *arg) {
67 if (!arg || !SvOK (arg) || !SvROK (arg) || SvTYPE (SvRV (arg)) != SVt_PVAV)
68 croak ("array reference expected");
70 av = (AV *)SvRV (arg);
71 ret = malloc (av_len (av) + 1 + 1);
73 croak ("malloc failed");
75 for (i = 0; i <= av_len (av); i++) {
76 SV **elem = av_fetch (av, i, 0);
79 croak ("missing element in list");
81 ret[i] = SvPV_nolen (*elem);
89 MODULE = Sys::Guestfs PACKAGE = Sys::Guestfs
96 RETVAL = guestfs_create ();
98 croak ("could not create guestfs handle");
99 guestfs_set_error_handler (RETVAL, NULL, NULL);
115 r = guestfs_launch (g);
117 croak ("launch: %s", guestfs_last_error (g));
125 r = guestfs_wait_ready (g);
127 croak ("wait_ready: %s", guestfs_last_error (g));
135 r = guestfs_kill_subprocess (g);
137 croak ("kill_subprocess: %s", guestfs_last_error (g));
140 add_drive (g, filename)
146 r = guestfs_add_drive (g, filename);
148 croak ("add_drive: %s", guestfs_last_error (g));
151 add_cdrom (g, filename)
157 r = guestfs_add_cdrom (g, filename);
159 croak ("add_cdrom: %s", guestfs_last_error (g));
162 config (g, qemuparam, qemuvalue)
169 r = guestfs_config (g, qemuparam, qemuvalue);
171 croak ("config: %s", guestfs_last_error (g));
180 r = guestfs_set_qemu (g, qemu);
182 croak ("set_qemu: %s", guestfs_last_error (g));
190 qemu = guestfs_get_qemu (g);
192 croak ("get_qemu: %s", guestfs_last_error (g));
193 RETVAL = newSVpv (qemu, 0);
204 r = guestfs_set_path (g, path);
206 croak ("set_path: %s", guestfs_last_error (g));
214 path = guestfs_get_path (g);
216 croak ("get_path: %s", guestfs_last_error (g));
217 RETVAL = newSVpv (path, 0);
222 set_autosync (g, autosync)
228 r = guestfs_set_autosync (g, autosync);
230 croak ("set_autosync: %s", guestfs_last_error (g));
238 autosync = guestfs_get_autosync (g);
240 croak ("get_autosync: %s", guestfs_last_error (g));
241 RETVAL = newSViv (autosync);
246 set_verbose (g, verbose)
252 r = guestfs_set_verbose (g, verbose);
254 croak ("set_verbose: %s", guestfs_last_error (g));
262 verbose = guestfs_get_verbose (g);
264 croak ("get_verbose: %s", guestfs_last_error (g));
265 RETVAL = newSViv (verbose);
275 ready = guestfs_is_ready (g);
277 croak ("is_ready: %s", guestfs_last_error (g));
278 RETVAL = newSViv (ready);
288 config = guestfs_is_config (g);
290 croak ("is_config: %s", guestfs_last_error (g));
291 RETVAL = newSViv (config);
301 launching = guestfs_is_launching (g);
303 croak ("is_launching: %s", guestfs_last_error (g));
304 RETVAL = newSViv (launching);
314 busy = guestfs_is_busy (g);
316 croak ("is_busy: %s", guestfs_last_error (g));
317 RETVAL = newSViv (busy);
327 state = guestfs_get_state (g);
329 croak ("get_state: %s", guestfs_last_error (g));
330 RETVAL = newSViv (state);
340 r = guestfs_set_busy (g);
342 croak ("set_busy: %s", guestfs_last_error (g));
350 r = guestfs_set_ready (g);
352 croak ("set_ready: %s", guestfs_last_error (g));
355 mount (g, device, mountpoint)
362 r = guestfs_mount (g, device, mountpoint);
364 croak ("mount: %s", guestfs_last_error (g));
372 r = guestfs_sync (g);
374 croak ("sync: %s", guestfs_last_error (g));
383 r = guestfs_touch (g, path);
385 croak ("touch: %s", guestfs_last_error (g));
394 content = guestfs_cat (g, path);
396 croak ("cat: %s", guestfs_last_error (g));
397 RETVAL = newSVpv (content, 0);
409 listing = guestfs_ll (g, directory);
411 croak ("ll: %s", guestfs_last_error (g));
412 RETVAL = newSVpv (listing, 0);
425 listing = guestfs_ls (g, directory);
427 croak ("ls: %s", guestfs_last_error (g));
428 for (n = 0; listing[n] != NULL; ++n) /**/;
430 for (i = 0; i < n; ++i) {
431 PUSHs (sv_2mortal (newSVpv (listing[i], 0)));
443 devices = guestfs_list_devices (g);
445 croak ("list_devices: %s", guestfs_last_error (g));
446 for (n = 0; devices[n] != NULL; ++n) /**/;
448 for (i = 0; i < n; ++i) {
449 PUSHs (sv_2mortal (newSVpv (devices[i], 0)));
461 partitions = guestfs_list_partitions (g);
462 if (partitions == NULL)
463 croak ("list_partitions: %s", guestfs_last_error (g));
464 for (n = 0; partitions[n] != NULL; ++n) /**/;
466 for (i = 0; i < n; ++i) {
467 PUSHs (sv_2mortal (newSVpv (partitions[i], 0)));
468 free (partitions[i]);
479 physvols = guestfs_pvs (g);
480 if (physvols == NULL)
481 croak ("pvs: %s", guestfs_last_error (g));
482 for (n = 0; physvols[n] != NULL; ++n) /**/;
484 for (i = 0; i < n; ++i) {
485 PUSHs (sv_2mortal (newSVpv (physvols[i], 0)));
497 volgroups = guestfs_vgs (g);
498 if (volgroups == NULL)
499 croak ("vgs: %s", guestfs_last_error (g));
500 for (n = 0; volgroups[n] != NULL; ++n) /**/;
502 for (i = 0; i < n; ++i) {
503 PUSHs (sv_2mortal (newSVpv (volgroups[i], 0)));
515 logvols = guestfs_lvs (g);
517 croak ("lvs: %s", guestfs_last_error (g));
518 for (n = 0; logvols[n] != NULL; ++n) /**/;
520 for (i = 0; i < n; ++i) {
521 PUSHs (sv_2mortal (newSVpv (logvols[i], 0)));
530 struct guestfs_lvm_pv_list *physvols;
534 physvols = guestfs_pvs_full (g);
535 if (physvols == NULL)
536 croak ("pvs_full: %s", guestfs_last_error (g));
537 EXTEND (SP, physvols->len);
538 for (i = 0; i < physvols->len; ++i) {
540 (void) hv_store (hv, "pv_name", 7, newSVpv (physvols->val[i].pv_name, 0), 0);
541 (void) hv_store (hv, "pv_uuid", 7, newSVpv (physvols->val[i].pv_uuid, 32), 0);
542 (void) hv_store (hv, "pv_fmt", 6, newSVpv (physvols->val[i].pv_fmt, 0), 0);
543 (void) hv_store (hv, "pv_size", 7, my_newSVull (physvols->val[i].pv_size), 0);
544 (void) hv_store (hv, "dev_size", 8, my_newSVull (physvols->val[i].dev_size), 0);
545 (void) hv_store (hv, "pv_free", 7, my_newSVull (physvols->val[i].pv_free), 0);
546 (void) hv_store (hv, "pv_used", 7, my_newSVull (physvols->val[i].pv_used), 0);
547 (void) hv_store (hv, "pv_attr", 7, newSVpv (physvols->val[i].pv_attr, 0), 0);
548 (void) hv_store (hv, "pv_pe_count", 11, my_newSVll (physvols->val[i].pv_pe_count), 0);
549 (void) hv_store (hv, "pv_pe_alloc_count", 17, my_newSVll (physvols->val[i].pv_pe_alloc_count), 0);
550 (void) hv_store (hv, "pv_tags", 7, newSVpv (physvols->val[i].pv_tags, 0), 0);
551 (void) hv_store (hv, "pe_start", 8, my_newSVull (physvols->val[i].pe_start), 0);
552 (void) hv_store (hv, "pv_mda_count", 12, my_newSVll (physvols->val[i].pv_mda_count), 0);
553 (void) hv_store (hv, "pv_mda_free", 11, my_newSVull (physvols->val[i].pv_mda_free), 0);
554 PUSHs (sv_2mortal ((SV *) hv));
556 guestfs_free_lvm_pv_list (physvols);
562 struct guestfs_lvm_vg_list *volgroups;
566 volgroups = guestfs_vgs_full (g);
567 if (volgroups == NULL)
568 croak ("vgs_full: %s", guestfs_last_error (g));
569 EXTEND (SP, volgroups->len);
570 for (i = 0; i < volgroups->len; ++i) {
572 (void) hv_store (hv, "vg_name", 7, newSVpv (volgroups->val[i].vg_name, 0), 0);
573 (void) hv_store (hv, "vg_uuid", 7, newSVpv (volgroups->val[i].vg_uuid, 32), 0);
574 (void) hv_store (hv, "vg_fmt", 6, newSVpv (volgroups->val[i].vg_fmt, 0), 0);
575 (void) hv_store (hv, "vg_attr", 7, newSVpv (volgroups->val[i].vg_attr, 0), 0);
576 (void) hv_store (hv, "vg_size", 7, my_newSVull (volgroups->val[i].vg_size), 0);
577 (void) hv_store (hv, "vg_free", 7, my_newSVull (volgroups->val[i].vg_free), 0);
578 (void) hv_store (hv, "vg_sysid", 8, newSVpv (volgroups->val[i].vg_sysid, 0), 0);
579 (void) hv_store (hv, "vg_extent_size", 14, my_newSVull (volgroups->val[i].vg_extent_size), 0);
580 (void) hv_store (hv, "vg_extent_count", 15, my_newSVll (volgroups->val[i].vg_extent_count), 0);
581 (void) hv_store (hv, "vg_free_count", 13, my_newSVll (volgroups->val[i].vg_free_count), 0);
582 (void) hv_store (hv, "max_lv", 6, my_newSVll (volgroups->val[i].max_lv), 0);
583 (void) hv_store (hv, "max_pv", 6, my_newSVll (volgroups->val[i].max_pv), 0);
584 (void) hv_store (hv, "pv_count", 8, my_newSVll (volgroups->val[i].pv_count), 0);
585 (void) hv_store (hv, "lv_count", 8, my_newSVll (volgroups->val[i].lv_count), 0);
586 (void) hv_store (hv, "snap_count", 10, my_newSVll (volgroups->val[i].snap_count), 0);
587 (void) hv_store (hv, "vg_seqno", 8, my_newSVll (volgroups->val[i].vg_seqno), 0);
588 (void) hv_store (hv, "vg_tags", 7, newSVpv (volgroups->val[i].vg_tags, 0), 0);
589 (void) hv_store (hv, "vg_mda_count", 12, my_newSVll (volgroups->val[i].vg_mda_count), 0);
590 (void) hv_store (hv, "vg_mda_free", 11, my_newSVull (volgroups->val[i].vg_mda_free), 0);
591 PUSHs (sv_2mortal ((SV *) hv));
593 guestfs_free_lvm_vg_list (volgroups);
599 struct guestfs_lvm_lv_list *logvols;
603 logvols = guestfs_lvs_full (g);
605 croak ("lvs_full: %s", guestfs_last_error (g));
606 EXTEND (SP, logvols->len);
607 for (i = 0; i < logvols->len; ++i) {
609 (void) hv_store (hv, "lv_name", 7, newSVpv (logvols->val[i].lv_name, 0), 0);
610 (void) hv_store (hv, "lv_uuid", 7, newSVpv (logvols->val[i].lv_uuid, 32), 0);
611 (void) hv_store (hv, "lv_attr", 7, newSVpv (logvols->val[i].lv_attr, 0), 0);
612 (void) hv_store (hv, "lv_major", 8, my_newSVll (logvols->val[i].lv_major), 0);
613 (void) hv_store (hv, "lv_minor", 8, my_newSVll (logvols->val[i].lv_minor), 0);
614 (void) hv_store (hv, "lv_kernel_major", 15, my_newSVll (logvols->val[i].lv_kernel_major), 0);
615 (void) hv_store (hv, "lv_kernel_minor", 15, my_newSVll (logvols->val[i].lv_kernel_minor), 0);
616 (void) hv_store (hv, "lv_size", 7, my_newSVull (logvols->val[i].lv_size), 0);
617 (void) hv_store (hv, "seg_count", 9, my_newSVll (logvols->val[i].seg_count), 0);
618 (void) hv_store (hv, "origin", 6, newSVpv (logvols->val[i].origin, 0), 0);
619 (void) hv_store (hv, "snap_percent", 12, newSVnv (logvols->val[i].snap_percent), 0);
620 (void) hv_store (hv, "copy_percent", 12, newSVnv (logvols->val[i].copy_percent), 0);
621 (void) hv_store (hv, "move_pv", 7, newSVpv (logvols->val[i].move_pv, 0), 0);
622 (void) hv_store (hv, "lv_tags", 7, newSVpv (logvols->val[i].lv_tags, 0), 0);
623 (void) hv_store (hv, "mirror_log", 10, newSVpv (logvols->val[i].mirror_log, 0), 0);
624 (void) hv_store (hv, "modules", 7, newSVpv (logvols->val[i].modules, 0), 0);
625 PUSHs (sv_2mortal ((SV *) hv));
627 guestfs_free_lvm_lv_list (logvols);
637 lines = guestfs_read_lines (g, path);
639 croak ("read_lines: %s", guestfs_last_error (g));
640 for (n = 0; lines[n] != NULL; ++n) /**/;
642 for (i = 0; i < n; ++i) {
643 PUSHs (sv_2mortal (newSVpv (lines[i], 0)));
649 aug_init (g, root, flags)
656 r = guestfs_aug_init (g, root, flags);
658 croak ("aug_init: %s", guestfs_last_error (g));
666 r = guestfs_aug_close (g);
668 croak ("aug_close: %s", guestfs_last_error (g));
671 aug_defvar (g, name, expr)
678 nrnodes = guestfs_aug_defvar (g, name, expr);
680 croak ("aug_defvar: %s", guestfs_last_error (g));
681 RETVAL = newSViv (nrnodes);
686 aug_defnode (g, name, expr, val)
692 struct guestfs_int_bool *r;
694 r = guestfs_aug_defnode (g, name, expr, val);
696 croak ("aug_defnode: %s", guestfs_last_error (g));
698 PUSHs (sv_2mortal (newSViv (r->i)));
699 PUSHs (sv_2mortal (newSViv (r->b)));
700 guestfs_free_int_bool (r);
709 val = guestfs_aug_get (g, path);
711 croak ("aug_get: %s", guestfs_last_error (g));
712 RETVAL = newSVpv (val, 0);
718 aug_set (g, path, val)
725 r = guestfs_aug_set (g, path, val);
727 croak ("aug_set: %s", guestfs_last_error (g));
730 aug_insert (g, path, label, before)
738 r = guestfs_aug_insert (g, path, label, before);
740 croak ("aug_insert: %s", guestfs_last_error (g));
749 nrnodes = guestfs_aug_rm (g, path);
751 croak ("aug_rm: %s", guestfs_last_error (g));
752 RETVAL = newSViv (nrnodes);
757 aug_mv (g, src, dest)
764 r = guestfs_aug_mv (g, src, dest);
766 croak ("aug_mv: %s", guestfs_last_error (g));
776 matches = guestfs_aug_match (g, path);
778 croak ("aug_match: %s", guestfs_last_error (g));
779 for (n = 0; matches[n] != NULL; ++n) /**/;
781 for (i = 0; i < n; ++i) {
782 PUSHs (sv_2mortal (newSVpv (matches[i], 0)));
793 r = guestfs_aug_save (g);
795 croak ("aug_save: %s", guestfs_last_error (g));
803 r = guestfs_aug_load (g);
805 croak ("aug_load: %s", guestfs_last_error (g));
815 matches = guestfs_aug_ls (g, path);
817 croak ("aug_ls: %s", guestfs_last_error (g));
818 for (n = 0; matches[n] != NULL; ++n) /**/;
820 for (i = 0; i < n; ++i) {
821 PUSHs (sv_2mortal (newSVpv (matches[i], 0)));
833 r = guestfs_rm (g, path);
835 croak ("rm: %s", guestfs_last_error (g));
844 r = guestfs_rmdir (g, path);
846 croak ("rmdir: %s", guestfs_last_error (g));
855 r = guestfs_rm_rf (g, path);
857 croak ("rm_rf: %s", guestfs_last_error (g));
866 r = guestfs_mkdir (g, path);
868 croak ("mkdir: %s", guestfs_last_error (g));
877 r = guestfs_mkdir_p (g, path);
879 croak ("mkdir_p: %s", guestfs_last_error (g));
882 chmod (g, mode, path)
889 r = guestfs_chmod (g, mode, path);
891 croak ("chmod: %s", guestfs_last_error (g));
894 chown (g, owner, group, path)
902 r = guestfs_chown (g, owner, group, path);
904 croak ("chown: %s", guestfs_last_error (g));
913 existsflag = guestfs_exists (g, path);
914 if (existsflag == -1)
915 croak ("exists: %s", guestfs_last_error (g));
916 RETVAL = newSViv (existsflag);
927 fileflag = guestfs_is_file (g, path);
929 croak ("is_file: %s", guestfs_last_error (g));
930 RETVAL = newSViv (fileflag);
941 dirflag = guestfs_is_dir (g, path);
943 croak ("is_dir: %s", guestfs_last_error (g));
944 RETVAL = newSViv (dirflag);
955 r = guestfs_pvcreate (g, device);
957 croak ("pvcreate: %s", guestfs_last_error (g));
960 vgcreate (g, volgroup, physvols)
967 r = guestfs_vgcreate (g, volgroup, physvols);
970 croak ("vgcreate: %s", guestfs_last_error (g));
973 lvcreate (g, logvol, volgroup, mbytes)
981 r = guestfs_lvcreate (g, logvol, volgroup, mbytes);
983 croak ("lvcreate: %s", guestfs_last_error (g));
986 mkfs (g, fstype, device)
993 r = guestfs_mkfs (g, fstype, device);
995 croak ("mkfs: %s", guestfs_last_error (g));
998 sfdisk (g, device, cyls, heads, sectors, lines)
1008 r = guestfs_sfdisk (g, device, cyls, heads, sectors, lines);
1011 croak ("sfdisk: %s", guestfs_last_error (g));
1014 write_file (g, path, content, size)
1022 r = guestfs_write_file (g, path, content, size);
1024 croak ("write_file: %s", guestfs_last_error (g));
1027 umount (g, pathordevice)
1033 r = guestfs_umount (g, pathordevice);
1035 croak ("umount: %s", guestfs_last_error (g));
1044 devices = guestfs_mounts (g);
1045 if (devices == NULL)
1046 croak ("mounts: %s", guestfs_last_error (g));
1047 for (n = 0; devices[n] != NULL; ++n) /**/;
1049 for (i = 0; i < n; ++i) {
1050 PUSHs (sv_2mortal (newSVpv (devices[i], 0)));
1061 r = guestfs_umount_all (g);
1063 croak ("umount_all: %s", guestfs_last_error (g));
1071 r = guestfs_lvm_remove_all (g);
1073 croak ("lvm_remove_all: %s", guestfs_last_error (g));
1082 description = guestfs_file (g, path);
1083 if (description == NULL)
1084 croak ("file: %s", guestfs_last_error (g));
1085 RETVAL = newSVpv (description, 0);
1091 command (g, arguments)
1097 output = guestfs_command (g, arguments);
1100 croak ("command: %s", guestfs_last_error (g));
1101 RETVAL = newSVpv (output, 0);
1107 command_lines (g, arguments)
1114 lines = guestfs_command_lines (g, arguments);
1117 croak ("command_lines: %s", guestfs_last_error (g));
1118 for (n = 0; lines[n] != NULL; ++n) /**/;
1120 for (i = 0; i < n; ++i) {
1121 PUSHs (sv_2mortal (newSVpv (lines[i], 0)));
1131 struct guestfs_stat *statbuf;
1133 statbuf = guestfs_stat (g, path);
1134 if (statbuf == NULL)
1135 croak ("stat: %s", guestfs_last_error (g));
1137 PUSHs (sv_2mortal (my_newSVll (statbuf->dev)));
1138 PUSHs (sv_2mortal (my_newSVll (statbuf->ino)));
1139 PUSHs (sv_2mortal (my_newSVll (statbuf->mode)));
1140 PUSHs (sv_2mortal (my_newSVll (statbuf->nlink)));
1141 PUSHs (sv_2mortal (my_newSVll (statbuf->uid)));
1142 PUSHs (sv_2mortal (my_newSVll (statbuf->gid)));
1143 PUSHs (sv_2mortal (my_newSVll (statbuf->rdev)));
1144 PUSHs (sv_2mortal (my_newSVll (statbuf->size)));
1145 PUSHs (sv_2mortal (my_newSVll (statbuf->blksize)));
1146 PUSHs (sv_2mortal (my_newSVll (statbuf->blocks)));
1147 PUSHs (sv_2mortal (my_newSVll (statbuf->atime)));
1148 PUSHs (sv_2mortal (my_newSVll (statbuf->mtime)));
1149 PUSHs (sv_2mortal (my_newSVll (statbuf->ctime)));
1157 struct guestfs_stat *statbuf;
1159 statbuf = guestfs_lstat (g, path);
1160 if (statbuf == NULL)
1161 croak ("lstat: %s", guestfs_last_error (g));
1163 PUSHs (sv_2mortal (my_newSVll (statbuf->dev)));
1164 PUSHs (sv_2mortal (my_newSVll (statbuf->ino)));
1165 PUSHs (sv_2mortal (my_newSVll (statbuf->mode)));
1166 PUSHs (sv_2mortal (my_newSVll (statbuf->nlink)));
1167 PUSHs (sv_2mortal (my_newSVll (statbuf->uid)));
1168 PUSHs (sv_2mortal (my_newSVll (statbuf->gid)));
1169 PUSHs (sv_2mortal (my_newSVll (statbuf->rdev)));
1170 PUSHs (sv_2mortal (my_newSVll (statbuf->size)));
1171 PUSHs (sv_2mortal (my_newSVll (statbuf->blksize)));
1172 PUSHs (sv_2mortal (my_newSVll (statbuf->blocks)));
1173 PUSHs (sv_2mortal (my_newSVll (statbuf->atime)));
1174 PUSHs (sv_2mortal (my_newSVll (statbuf->mtime)));
1175 PUSHs (sv_2mortal (my_newSVll (statbuf->ctime)));
1183 struct guestfs_statvfs *statbuf;
1185 statbuf = guestfs_statvfs (g, path);
1186 if (statbuf == NULL)
1187 croak ("statvfs: %s", guestfs_last_error (g));
1189 PUSHs (sv_2mortal (my_newSVll (statbuf->bsize)));
1190 PUSHs (sv_2mortal (my_newSVll (statbuf->frsize)));
1191 PUSHs (sv_2mortal (my_newSVll (statbuf->blocks)));
1192 PUSHs (sv_2mortal (my_newSVll (statbuf->bfree)));
1193 PUSHs (sv_2mortal (my_newSVll (statbuf->bavail)));
1194 PUSHs (sv_2mortal (my_newSVll (statbuf->files)));
1195 PUSHs (sv_2mortal (my_newSVll (statbuf->ffree)));
1196 PUSHs (sv_2mortal (my_newSVll (statbuf->favail)));
1197 PUSHs (sv_2mortal (my_newSVll (statbuf->fsid)));
1198 PUSHs (sv_2mortal (my_newSVll (statbuf->flag)));
1199 PUSHs (sv_2mortal (my_newSVll (statbuf->namemax)));
1203 tune2fs_l (g, device)
1210 superblock = guestfs_tune2fs_l (g, device);
1211 if (superblock == NULL)
1212 croak ("tune2fs_l: %s", guestfs_last_error (g));
1213 for (n = 0; superblock[n] != NULL; ++n) /**/;
1215 for (i = 0; i < n; ++i) {
1216 PUSHs (sv_2mortal (newSVpv (superblock[i], 0)));
1217 free (superblock[i]);
1222 blockdev_setro (g, device)
1228 r = guestfs_blockdev_setro (g, device);
1230 croak ("blockdev_setro: %s", guestfs_last_error (g));
1233 blockdev_setrw (g, device)
1239 r = guestfs_blockdev_setrw (g, device);
1241 croak ("blockdev_setrw: %s", guestfs_last_error (g));
1244 blockdev_getro (g, device)
1250 ro = guestfs_blockdev_getro (g, device);
1252 croak ("blockdev_getro: %s", guestfs_last_error (g));
1253 RETVAL = newSViv (ro);
1258 blockdev_getss (g, device)
1264 sectorsize = guestfs_blockdev_getss (g, device);
1265 if (sectorsize == -1)
1266 croak ("blockdev_getss: %s", guestfs_last_error (g));
1267 RETVAL = newSViv (sectorsize);
1272 blockdev_getbsz (g, device)
1278 blocksize = guestfs_blockdev_getbsz (g, device);
1279 if (blocksize == -1)
1280 croak ("blockdev_getbsz: %s", guestfs_last_error (g));
1281 RETVAL = newSViv (blocksize);
1286 blockdev_setbsz (g, device, blocksize)
1293 r = guestfs_blockdev_setbsz (g, device, blocksize);
1295 croak ("blockdev_setbsz: %s", guestfs_last_error (g));
1298 blockdev_getsz (g, device)
1302 int64_t sizeinsectors;
1304 sizeinsectors = guestfs_blockdev_getsz (g, device);
1305 if (sizeinsectors == -1)
1306 croak ("blockdev_getsz: %s", guestfs_last_error (g));
1307 RETVAL = my_newSVll (sizeinsectors);
1312 blockdev_getsize64 (g, device)
1316 int64_t sizeinbytes;
1318 sizeinbytes = guestfs_blockdev_getsize64 (g, device);
1319 if (sizeinbytes == -1)
1320 croak ("blockdev_getsize64: %s", guestfs_last_error (g));
1321 RETVAL = my_newSVll (sizeinbytes);
1326 blockdev_flushbufs (g, device)
1332 r = guestfs_blockdev_flushbufs (g, device);
1334 croak ("blockdev_flushbufs: %s", guestfs_last_error (g));
1337 blockdev_rereadpt (g, device)
1343 r = guestfs_blockdev_rereadpt (g, device);
1345 croak ("blockdev_rereadpt: %s", guestfs_last_error (g));
1348 upload (g, filename, remotefilename)
1351 char *remotefilename;
1355 r = guestfs_upload (g, filename, remotefilename);
1357 croak ("upload: %s", guestfs_last_error (g));
1360 download (g, remotefilename, filename)
1362 char *remotefilename;
1367 r = guestfs_download (g, remotefilename, filename);
1369 croak ("download: %s", guestfs_last_error (g));
1372 checksum (g, csumtype, path)
1379 checksum = guestfs_checksum (g, csumtype, path);
1380 if (checksum == NULL)
1381 croak ("checksum: %s", guestfs_last_error (g));
1382 RETVAL = newSVpv (checksum, 0);
1388 tar_in (g, tarfile, directory)
1395 r = guestfs_tar_in (g, tarfile, directory);
1397 croak ("tar_in: %s", guestfs_last_error (g));
1400 tar_out (g, directory, tarfile)
1407 r = guestfs_tar_out (g, directory, tarfile);
1409 croak ("tar_out: %s", guestfs_last_error (g));
1412 tgz_in (g, tarball, directory)
1419 r = guestfs_tgz_in (g, tarball, directory);
1421 croak ("tgz_in: %s", guestfs_last_error (g));
1424 tgz_out (g, directory, tarball)
1431 r = guestfs_tgz_out (g, directory, tarball);
1433 croak ("tgz_out: %s", guestfs_last_error (g));
1436 mount_ro (g, device, mountpoint)
1443 r = guestfs_mount_ro (g, device, mountpoint);
1445 croak ("mount_ro: %s", guestfs_last_error (g));
1448 mount_options (g, options, device, mountpoint)
1456 r = guestfs_mount_options (g, options, device, mountpoint);
1458 croak ("mount_options: %s", guestfs_last_error (g));
1461 mount_vfs (g, options, vfstype, device, mountpoint)
1470 r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint);
1472 croak ("mount_vfs: %s", guestfs_last_error (g));
1475 debug (g, subcmd, extraargs)
1482 result = guestfs_debug (g, subcmd, extraargs);
1485 croak ("debug: %s", guestfs_last_error (g));
1486 RETVAL = newSVpv (result, 0);
1492 lvremove (g, device)
1498 r = guestfs_lvremove (g, device);
1500 croak ("lvremove: %s", guestfs_last_error (g));
1503 vgremove (g, vgname)
1509 r = guestfs_vgremove (g, vgname);
1511 croak ("vgremove: %s", guestfs_last_error (g));
1514 pvremove (g, device)
1520 r = guestfs_pvremove (g, device);
1522 croak ("pvremove: %s", guestfs_last_error (g));
1525 set_e2label (g, device, label)
1532 r = guestfs_set_e2label (g, device, label);
1534 croak ("set_e2label: %s", guestfs_last_error (g));
1537 get_e2label (g, device)
1543 label = guestfs_get_e2label (g, device);
1545 croak ("get_e2label: %s", guestfs_last_error (g));
1546 RETVAL = newSVpv (label, 0);
1552 set_e2uuid (g, device, uuid)
1559 r = guestfs_set_e2uuid (g, device, uuid);
1561 croak ("set_e2uuid: %s", guestfs_last_error (g));
1564 get_e2uuid (g, device)
1570 uuid = guestfs_get_e2uuid (g, device);
1572 croak ("get_e2uuid: %s", guestfs_last_error (g));
1573 RETVAL = newSVpv (uuid, 0);
1579 fsck (g, fstype, device)
1586 status = guestfs_fsck (g, fstype, device);
1588 croak ("fsck: %s", guestfs_last_error (g));
1589 RETVAL = newSViv (status);
1600 r = guestfs_zero (g, device);
1602 croak ("zero: %s", guestfs_last_error (g));
1605 grub_install (g, root, device)
1612 r = guestfs_grub_install (g, root, device);
1614 croak ("grub_install: %s", guestfs_last_error (g));
1624 r = guestfs_cp (g, src, dest);
1626 croak ("cp: %s", guestfs_last_error (g));
1636 r = guestfs_cp_a (g, src, dest);
1638 croak ("cp_a: %s", guestfs_last_error (g));
1648 r = guestfs_mv (g, src, dest);
1650 croak ("mv: %s", guestfs_last_error (g));
1653 drop_caches (g, whattodrop)
1659 r = guestfs_drop_caches (g, whattodrop);
1661 croak ("drop_caches: %s", guestfs_last_error (g));
1669 kmsgs = guestfs_dmesg (g);
1671 croak ("dmesg: %s", guestfs_last_error (g));
1672 RETVAL = newSVpv (kmsgs, 0);
1683 r = guestfs_ping_daemon (g);
1685 croak ("ping_daemon: %s", guestfs_last_error (g));
1688 equal (g, file1, file2)
1695 equality = guestfs_equal (g, file1, file2);
1697 croak ("equal: %s", guestfs_last_error (g));
1698 RETVAL = newSViv (equality);
1710 stringsout = guestfs_strings (g, path);
1711 if (stringsout == NULL)
1712 croak ("strings: %s", guestfs_last_error (g));
1713 for (n = 0; stringsout[n] != NULL; ++n) /**/;
1715 for (i = 0; i < n; ++i) {
1716 PUSHs (sv_2mortal (newSVpv (stringsout[i], 0)));
1717 free (stringsout[i]);
1722 strings_e (g, encoding, path)
1730 stringsout = guestfs_strings_e (g, encoding, path);
1731 if (stringsout == NULL)
1732 croak ("strings_e: %s", guestfs_last_error (g));
1733 for (n = 0; stringsout[n] != NULL; ++n) /**/;
1735 for (i = 0; i < n; ++i) {
1736 PUSHs (sv_2mortal (newSVpv (stringsout[i], 0)));
1737 free (stringsout[i]);
1748 dump = guestfs_hexdump (g, path);
1750 croak ("hexdump: %s", guestfs_last_error (g));
1751 RETVAL = newSVpv (dump, 0);