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
94 RETVAL = guestfs_create ();
96 croak ("could not create guestfs handle");
97 guestfs_set_error_handler (RETVAL, NULL, NULL);
113 r = guestfs_launch (g);
115 croak ("launch: %s", guestfs_last_error (g));
123 r = guestfs_wait_ready (g);
125 croak ("wait_ready: %s", guestfs_last_error (g));
133 r = guestfs_kill_subprocess (g);
135 croak ("kill_subprocess: %s", guestfs_last_error (g));
138 add_drive (g, filename)
144 r = guestfs_add_drive (g, filename);
146 croak ("add_drive: %s", guestfs_last_error (g));
149 add_cdrom (g, filename)
155 r = guestfs_add_cdrom (g, filename);
157 croak ("add_cdrom: %s", guestfs_last_error (g));
160 config (g, qemuparam, qemuvalue)
167 r = guestfs_config (g, qemuparam, qemuvalue);
169 croak ("config: %s", guestfs_last_error (g));
178 r = guestfs_set_qemu (g, qemu);
180 croak ("set_qemu: %s", guestfs_last_error (g));
188 qemu = guestfs_get_qemu (g);
190 croak ("get_qemu: %s", guestfs_last_error (g));
191 RETVAL = newSVpv (qemu, 0);
202 r = guestfs_set_path (g, path);
204 croak ("set_path: %s", guestfs_last_error (g));
212 path = guestfs_get_path (g);
214 croak ("get_path: %s", guestfs_last_error (g));
215 RETVAL = newSVpv (path, 0);
220 set_autosync (g, autosync)
226 r = guestfs_set_autosync (g, autosync);
228 croak ("set_autosync: %s", guestfs_last_error (g));
236 autosync = guestfs_get_autosync (g);
238 croak ("get_autosync: %s", guestfs_last_error (g));
239 RETVAL = newSViv (autosync);
244 set_verbose (g, verbose)
250 r = guestfs_set_verbose (g, verbose);
252 croak ("set_verbose: %s", guestfs_last_error (g));
260 verbose = guestfs_get_verbose (g);
262 croak ("get_verbose: %s", guestfs_last_error (g));
263 RETVAL = newSViv (verbose);
273 ready = guestfs_is_ready (g);
275 croak ("is_ready: %s", guestfs_last_error (g));
276 RETVAL = newSViv (ready);
286 config = guestfs_is_config (g);
288 croak ("is_config: %s", guestfs_last_error (g));
289 RETVAL = newSViv (config);
299 launching = guestfs_is_launching (g);
301 croak ("is_launching: %s", guestfs_last_error (g));
302 RETVAL = newSViv (launching);
312 busy = guestfs_is_busy (g);
314 croak ("is_busy: %s", guestfs_last_error (g));
315 RETVAL = newSViv (busy);
325 state = guestfs_get_state (g);
327 croak ("get_state: %s", guestfs_last_error (g));
328 RETVAL = newSViv (state);
338 r = guestfs_set_busy (g);
340 croak ("set_busy: %s", guestfs_last_error (g));
348 r = guestfs_set_ready (g);
350 croak ("set_ready: %s", guestfs_last_error (g));
353 mount (g, device, mountpoint)
360 r = guestfs_mount (g, device, mountpoint);
362 croak ("mount: %s", guestfs_last_error (g));
370 r = guestfs_sync (g);
372 croak ("sync: %s", guestfs_last_error (g));
381 r = guestfs_touch (g, path);
383 croak ("touch: %s", guestfs_last_error (g));
392 content = guestfs_cat (g, path);
394 croak ("cat: %s", guestfs_last_error (g));
395 RETVAL = newSVpv (content, 0);
407 listing = guestfs_ll (g, directory);
409 croak ("ll: %s", guestfs_last_error (g));
410 RETVAL = newSVpv (listing, 0);
423 listing = guestfs_ls (g, directory);
425 croak ("ls: %s", guestfs_last_error (g));
426 for (n = 0; listing[n] != NULL; ++n) /**/;
428 for (i = 0; i < n; ++i) {
429 PUSHs (sv_2mortal (newSVpv (listing[i], 0)));
441 devices = guestfs_list_devices (g);
443 croak ("list_devices: %s", guestfs_last_error (g));
444 for (n = 0; devices[n] != NULL; ++n) /**/;
446 for (i = 0; i < n; ++i) {
447 PUSHs (sv_2mortal (newSVpv (devices[i], 0)));
459 partitions = guestfs_list_partitions (g);
460 if (partitions == NULL)
461 croak ("list_partitions: %s", guestfs_last_error (g));
462 for (n = 0; partitions[n] != NULL; ++n) /**/;
464 for (i = 0; i < n; ++i) {
465 PUSHs (sv_2mortal (newSVpv (partitions[i], 0)));
466 free (partitions[i]);
477 physvols = guestfs_pvs (g);
478 if (physvols == NULL)
479 croak ("pvs: %s", guestfs_last_error (g));
480 for (n = 0; physvols[n] != NULL; ++n) /**/;
482 for (i = 0; i < n; ++i) {
483 PUSHs (sv_2mortal (newSVpv (physvols[i], 0)));
495 volgroups = guestfs_vgs (g);
496 if (volgroups == NULL)
497 croak ("vgs: %s", guestfs_last_error (g));
498 for (n = 0; volgroups[n] != NULL; ++n) /**/;
500 for (i = 0; i < n; ++i) {
501 PUSHs (sv_2mortal (newSVpv (volgroups[i], 0)));
513 logvols = guestfs_lvs (g);
515 croak ("lvs: %s", guestfs_last_error (g));
516 for (n = 0; logvols[n] != NULL; ++n) /**/;
518 for (i = 0; i < n; ++i) {
519 PUSHs (sv_2mortal (newSVpv (logvols[i], 0)));
528 struct guestfs_lvm_pv_list *physvols;
532 physvols = guestfs_pvs_full (g);
533 if (physvols == NULL)
534 croak ("pvs_full: %s", guestfs_last_error (g));
535 EXTEND (SP, physvols->len);
536 for (i = 0; i < physvols->len; ++i) {
538 (void) hv_store (hv, "pv_name", 7, newSVpv (physvols->val[i].pv_name, 0), 0);
539 (void) hv_store (hv, "pv_uuid", 7, newSVpv (physvols->val[i].pv_uuid, 32), 0);
540 (void) hv_store (hv, "pv_fmt", 6, newSVpv (physvols->val[i].pv_fmt, 0), 0);
541 (void) hv_store (hv, "pv_size", 7, my_newSVull (physvols->val[i].pv_size), 0);
542 (void) hv_store (hv, "dev_size", 8, my_newSVull (physvols->val[i].dev_size), 0);
543 (void) hv_store (hv, "pv_free", 7, my_newSVull (physvols->val[i].pv_free), 0);
544 (void) hv_store (hv, "pv_used", 7, my_newSVull (physvols->val[i].pv_used), 0);
545 (void) hv_store (hv, "pv_attr", 7, newSVpv (physvols->val[i].pv_attr, 0), 0);
546 (void) hv_store (hv, "pv_pe_count", 11, my_newSVll (physvols->val[i].pv_pe_count), 0);
547 (void) hv_store (hv, "pv_pe_alloc_count", 17, my_newSVll (physvols->val[i].pv_pe_alloc_count), 0);
548 (void) hv_store (hv, "pv_tags", 7, newSVpv (physvols->val[i].pv_tags, 0), 0);
549 (void) hv_store (hv, "pe_start", 8, my_newSVull (physvols->val[i].pe_start), 0);
550 (void) hv_store (hv, "pv_mda_count", 12, my_newSVll (physvols->val[i].pv_mda_count), 0);
551 (void) hv_store (hv, "pv_mda_free", 11, my_newSVull (physvols->val[i].pv_mda_free), 0);
552 PUSHs (sv_2mortal ((SV *) hv));
554 guestfs_free_lvm_pv_list (physvols);
560 struct guestfs_lvm_vg_list *volgroups;
564 volgroups = guestfs_vgs_full (g);
565 if (volgroups == NULL)
566 croak ("vgs_full: %s", guestfs_last_error (g));
567 EXTEND (SP, volgroups->len);
568 for (i = 0; i < volgroups->len; ++i) {
570 (void) hv_store (hv, "vg_name", 7, newSVpv (volgroups->val[i].vg_name, 0), 0);
571 (void) hv_store (hv, "vg_uuid", 7, newSVpv (volgroups->val[i].vg_uuid, 32), 0);
572 (void) hv_store (hv, "vg_fmt", 6, newSVpv (volgroups->val[i].vg_fmt, 0), 0);
573 (void) hv_store (hv, "vg_attr", 7, newSVpv (volgroups->val[i].vg_attr, 0), 0);
574 (void) hv_store (hv, "vg_size", 7, my_newSVull (volgroups->val[i].vg_size), 0);
575 (void) hv_store (hv, "vg_free", 7, my_newSVull (volgroups->val[i].vg_free), 0);
576 (void) hv_store (hv, "vg_sysid", 8, newSVpv (volgroups->val[i].vg_sysid, 0), 0);
577 (void) hv_store (hv, "vg_extent_size", 14, my_newSVull (volgroups->val[i].vg_extent_size), 0);
578 (void) hv_store (hv, "vg_extent_count", 15, my_newSVll (volgroups->val[i].vg_extent_count), 0);
579 (void) hv_store (hv, "vg_free_count", 13, my_newSVll (volgroups->val[i].vg_free_count), 0);
580 (void) hv_store (hv, "max_lv", 6, my_newSVll (volgroups->val[i].max_lv), 0);
581 (void) hv_store (hv, "max_pv", 6, my_newSVll (volgroups->val[i].max_pv), 0);
582 (void) hv_store (hv, "pv_count", 8, my_newSVll (volgroups->val[i].pv_count), 0);
583 (void) hv_store (hv, "lv_count", 8, my_newSVll (volgroups->val[i].lv_count), 0);
584 (void) hv_store (hv, "snap_count", 10, my_newSVll (volgroups->val[i].snap_count), 0);
585 (void) hv_store (hv, "vg_seqno", 8, my_newSVll (volgroups->val[i].vg_seqno), 0);
586 (void) hv_store (hv, "vg_tags", 7, newSVpv (volgroups->val[i].vg_tags, 0), 0);
587 (void) hv_store (hv, "vg_mda_count", 12, my_newSVll (volgroups->val[i].vg_mda_count), 0);
588 (void) hv_store (hv, "vg_mda_free", 11, my_newSVull (volgroups->val[i].vg_mda_free), 0);
589 PUSHs (sv_2mortal ((SV *) hv));
591 guestfs_free_lvm_vg_list (volgroups);
597 struct guestfs_lvm_lv_list *logvols;
601 logvols = guestfs_lvs_full (g);
603 croak ("lvs_full: %s", guestfs_last_error (g));
604 EXTEND (SP, logvols->len);
605 for (i = 0; i < logvols->len; ++i) {
607 (void) hv_store (hv, "lv_name", 7, newSVpv (logvols->val[i].lv_name, 0), 0);
608 (void) hv_store (hv, "lv_uuid", 7, newSVpv (logvols->val[i].lv_uuid, 32), 0);
609 (void) hv_store (hv, "lv_attr", 7, newSVpv (logvols->val[i].lv_attr, 0), 0);
610 (void) hv_store (hv, "lv_major", 8, my_newSVll (logvols->val[i].lv_major), 0);
611 (void) hv_store (hv, "lv_minor", 8, my_newSVll (logvols->val[i].lv_minor), 0);
612 (void) hv_store (hv, "lv_kernel_major", 15, my_newSVll (logvols->val[i].lv_kernel_major), 0);
613 (void) hv_store (hv, "lv_kernel_minor", 15, my_newSVll (logvols->val[i].lv_kernel_minor), 0);
614 (void) hv_store (hv, "lv_size", 7, my_newSVull (logvols->val[i].lv_size), 0);
615 (void) hv_store (hv, "seg_count", 9, my_newSVll (logvols->val[i].seg_count), 0);
616 (void) hv_store (hv, "origin", 6, newSVpv (logvols->val[i].origin, 0), 0);
617 (void) hv_store (hv, "snap_percent", 12, newSVnv (logvols->val[i].snap_percent), 0);
618 (void) hv_store (hv, "copy_percent", 12, newSVnv (logvols->val[i].copy_percent), 0);
619 (void) hv_store (hv, "move_pv", 7, newSVpv (logvols->val[i].move_pv, 0), 0);
620 (void) hv_store (hv, "lv_tags", 7, newSVpv (logvols->val[i].lv_tags, 0), 0);
621 (void) hv_store (hv, "mirror_log", 10, newSVpv (logvols->val[i].mirror_log, 0), 0);
622 (void) hv_store (hv, "modules", 7, newSVpv (logvols->val[i].modules, 0), 0);
623 PUSHs (sv_2mortal ((SV *) hv));
625 guestfs_free_lvm_lv_list (logvols);
635 lines = guestfs_read_lines (g, path);
637 croak ("read_lines: %s", guestfs_last_error (g));
638 for (n = 0; lines[n] != NULL; ++n) /**/;
640 for (i = 0; i < n; ++i) {
641 PUSHs (sv_2mortal (newSVpv (lines[i], 0)));
647 aug_init (g, root, flags)
654 r = guestfs_aug_init (g, root, flags);
656 croak ("aug_init: %s", guestfs_last_error (g));
664 r = guestfs_aug_close (g);
666 croak ("aug_close: %s", guestfs_last_error (g));
669 aug_defvar (g, name, expr)
676 nrnodes = guestfs_aug_defvar (g, name, expr);
678 croak ("aug_defvar: %s", guestfs_last_error (g));
679 RETVAL = newSViv (nrnodes);
684 aug_defnode (g, name, expr, val)
690 struct guestfs_int_bool *r;
692 r = guestfs_aug_defnode (g, name, expr, val);
694 croak ("aug_defnode: %s", guestfs_last_error (g));
696 PUSHs (sv_2mortal (newSViv (r->i)));
697 PUSHs (sv_2mortal (newSViv (r->b)));
698 guestfs_free_int_bool (r);
707 val = guestfs_aug_get (g, path);
709 croak ("aug_get: %s", guestfs_last_error (g));
710 RETVAL = newSVpv (val, 0);
716 aug_set (g, path, val)
723 r = guestfs_aug_set (g, path, val);
725 croak ("aug_set: %s", guestfs_last_error (g));
728 aug_insert (g, path, label, before)
736 r = guestfs_aug_insert (g, path, label, before);
738 croak ("aug_insert: %s", guestfs_last_error (g));
747 nrnodes = guestfs_aug_rm (g, path);
749 croak ("aug_rm: %s", guestfs_last_error (g));
750 RETVAL = newSViv (nrnodes);
755 aug_mv (g, src, dest)
762 r = guestfs_aug_mv (g, src, dest);
764 croak ("aug_mv: %s", guestfs_last_error (g));
774 matches = guestfs_aug_match (g, path);
776 croak ("aug_match: %s", guestfs_last_error (g));
777 for (n = 0; matches[n] != NULL; ++n) /**/;
779 for (i = 0; i < n; ++i) {
780 PUSHs (sv_2mortal (newSVpv (matches[i], 0)));
791 r = guestfs_aug_save (g);
793 croak ("aug_save: %s", guestfs_last_error (g));
801 r = guestfs_aug_load (g);
803 croak ("aug_load: %s", guestfs_last_error (g));
813 matches = guestfs_aug_ls (g, path);
815 croak ("aug_ls: %s", guestfs_last_error (g));
816 for (n = 0; matches[n] != NULL; ++n) /**/;
818 for (i = 0; i < n; ++i) {
819 PUSHs (sv_2mortal (newSVpv (matches[i], 0)));
831 r = guestfs_rm (g, path);
833 croak ("rm: %s", guestfs_last_error (g));
842 r = guestfs_rmdir (g, path);
844 croak ("rmdir: %s", guestfs_last_error (g));
853 r = guestfs_rm_rf (g, path);
855 croak ("rm_rf: %s", guestfs_last_error (g));
864 r = guestfs_mkdir (g, path);
866 croak ("mkdir: %s", guestfs_last_error (g));
875 r = guestfs_mkdir_p (g, path);
877 croak ("mkdir_p: %s", guestfs_last_error (g));
880 chmod (g, mode, path)
887 r = guestfs_chmod (g, mode, path);
889 croak ("chmod: %s", guestfs_last_error (g));
892 chown (g, owner, group, path)
900 r = guestfs_chown (g, owner, group, path);
902 croak ("chown: %s", guestfs_last_error (g));
911 existsflag = guestfs_exists (g, path);
912 if (existsflag == -1)
913 croak ("exists: %s", guestfs_last_error (g));
914 RETVAL = newSViv (existsflag);
925 fileflag = guestfs_is_file (g, path);
927 croak ("is_file: %s", guestfs_last_error (g));
928 RETVAL = newSViv (fileflag);
939 dirflag = guestfs_is_dir (g, path);
941 croak ("is_dir: %s", guestfs_last_error (g));
942 RETVAL = newSViv (dirflag);
953 r = guestfs_pvcreate (g, device);
955 croak ("pvcreate: %s", guestfs_last_error (g));
958 vgcreate (g, volgroup, physvols)
965 r = guestfs_vgcreate (g, volgroup, physvols);
968 croak ("vgcreate: %s", guestfs_last_error (g));
971 lvcreate (g, logvol, volgroup, mbytes)
979 r = guestfs_lvcreate (g, logvol, volgroup, mbytes);
981 croak ("lvcreate: %s", guestfs_last_error (g));
984 mkfs (g, fstype, device)
991 r = guestfs_mkfs (g, fstype, device);
993 croak ("mkfs: %s", guestfs_last_error (g));
996 sfdisk (g, device, cyls, heads, sectors, lines)
1006 r = guestfs_sfdisk (g, device, cyls, heads, sectors, lines);
1009 croak ("sfdisk: %s", guestfs_last_error (g));
1012 write_file (g, path, content, size)
1020 r = guestfs_write_file (g, path, content, size);
1022 croak ("write_file: %s", guestfs_last_error (g));
1025 umount (g, pathordevice)
1031 r = guestfs_umount (g, pathordevice);
1033 croak ("umount: %s", guestfs_last_error (g));
1042 devices = guestfs_mounts (g);
1043 if (devices == NULL)
1044 croak ("mounts: %s", guestfs_last_error (g));
1045 for (n = 0; devices[n] != NULL; ++n) /**/;
1047 for (i = 0; i < n; ++i) {
1048 PUSHs (sv_2mortal (newSVpv (devices[i], 0)));
1059 r = guestfs_umount_all (g);
1061 croak ("umount_all: %s", guestfs_last_error (g));
1069 r = guestfs_lvm_remove_all (g);
1071 croak ("lvm_remove_all: %s", guestfs_last_error (g));
1080 description = guestfs_file (g, path);
1081 if (description == NULL)
1082 croak ("file: %s", guestfs_last_error (g));
1083 RETVAL = newSVpv (description, 0);
1089 command (g, arguments)
1095 output = guestfs_command (g, arguments);
1098 croak ("command: %s", guestfs_last_error (g));
1099 RETVAL = newSVpv (output, 0);
1105 command_lines (g, arguments)
1112 lines = guestfs_command_lines (g, arguments);
1115 croak ("command_lines: %s", guestfs_last_error (g));
1116 for (n = 0; lines[n] != NULL; ++n) /**/;
1118 for (i = 0; i < n; ++i) {
1119 PUSHs (sv_2mortal (newSVpv (lines[i], 0)));
1129 struct guestfs_stat *statbuf;
1131 statbuf = guestfs_stat (g, path);
1132 if (statbuf == NULL)
1133 croak ("stat: %s", guestfs_last_error (g));
1135 PUSHs (sv_2mortal (my_newSVll (statbuf->dev)));
1136 PUSHs (sv_2mortal (my_newSVll (statbuf->ino)));
1137 PUSHs (sv_2mortal (my_newSVll (statbuf->mode)));
1138 PUSHs (sv_2mortal (my_newSVll (statbuf->nlink)));
1139 PUSHs (sv_2mortal (my_newSVll (statbuf->uid)));
1140 PUSHs (sv_2mortal (my_newSVll (statbuf->gid)));
1141 PUSHs (sv_2mortal (my_newSVll (statbuf->rdev)));
1142 PUSHs (sv_2mortal (my_newSVll (statbuf->size)));
1143 PUSHs (sv_2mortal (my_newSVll (statbuf->blksize)));
1144 PUSHs (sv_2mortal (my_newSVll (statbuf->blocks)));
1145 PUSHs (sv_2mortal (my_newSVll (statbuf->atime)));
1146 PUSHs (sv_2mortal (my_newSVll (statbuf->mtime)));
1147 PUSHs (sv_2mortal (my_newSVll (statbuf->ctime)));
1155 struct guestfs_stat *statbuf;
1157 statbuf = guestfs_lstat (g, path);
1158 if (statbuf == NULL)
1159 croak ("lstat: %s", guestfs_last_error (g));
1161 PUSHs (sv_2mortal (my_newSVll (statbuf->dev)));
1162 PUSHs (sv_2mortal (my_newSVll (statbuf->ino)));
1163 PUSHs (sv_2mortal (my_newSVll (statbuf->mode)));
1164 PUSHs (sv_2mortal (my_newSVll (statbuf->nlink)));
1165 PUSHs (sv_2mortal (my_newSVll (statbuf->uid)));
1166 PUSHs (sv_2mortal (my_newSVll (statbuf->gid)));
1167 PUSHs (sv_2mortal (my_newSVll (statbuf->rdev)));
1168 PUSHs (sv_2mortal (my_newSVll (statbuf->size)));
1169 PUSHs (sv_2mortal (my_newSVll (statbuf->blksize)));
1170 PUSHs (sv_2mortal (my_newSVll (statbuf->blocks)));
1171 PUSHs (sv_2mortal (my_newSVll (statbuf->atime)));
1172 PUSHs (sv_2mortal (my_newSVll (statbuf->mtime)));
1173 PUSHs (sv_2mortal (my_newSVll (statbuf->ctime)));
1181 struct guestfs_statvfs *statbuf;
1183 statbuf = guestfs_statvfs (g, path);
1184 if (statbuf == NULL)
1185 croak ("statvfs: %s", guestfs_last_error (g));
1187 PUSHs (sv_2mortal (my_newSVll (statbuf->bsize)));
1188 PUSHs (sv_2mortal (my_newSVll (statbuf->frsize)));
1189 PUSHs (sv_2mortal (my_newSVll (statbuf->blocks)));
1190 PUSHs (sv_2mortal (my_newSVll (statbuf->bfree)));
1191 PUSHs (sv_2mortal (my_newSVll (statbuf->bavail)));
1192 PUSHs (sv_2mortal (my_newSVll (statbuf->files)));
1193 PUSHs (sv_2mortal (my_newSVll (statbuf->ffree)));
1194 PUSHs (sv_2mortal (my_newSVll (statbuf->favail)));
1195 PUSHs (sv_2mortal (my_newSVll (statbuf->fsid)));
1196 PUSHs (sv_2mortal (my_newSVll (statbuf->flag)));
1197 PUSHs (sv_2mortal (my_newSVll (statbuf->namemax)));
1201 tune2fs_l (g, device)
1208 superblock = guestfs_tune2fs_l (g, device);
1209 if (superblock == NULL)
1210 croak ("tune2fs_l: %s", guestfs_last_error (g));
1211 for (n = 0; superblock[n] != NULL; ++n) /**/;
1213 for (i = 0; i < n; ++i) {
1214 PUSHs (sv_2mortal (newSVpv (superblock[i], 0)));
1215 free (superblock[i]);
1220 blockdev_setro (g, device)
1226 r = guestfs_blockdev_setro (g, device);
1228 croak ("blockdev_setro: %s", guestfs_last_error (g));
1231 blockdev_setrw (g, device)
1237 r = guestfs_blockdev_setrw (g, device);
1239 croak ("blockdev_setrw: %s", guestfs_last_error (g));
1242 blockdev_getro (g, device)
1248 ro = guestfs_blockdev_getro (g, device);
1250 croak ("blockdev_getro: %s", guestfs_last_error (g));
1251 RETVAL = newSViv (ro);
1256 blockdev_getss (g, device)
1262 sectorsize = guestfs_blockdev_getss (g, device);
1263 if (sectorsize == -1)
1264 croak ("blockdev_getss: %s", guestfs_last_error (g));
1265 RETVAL = newSViv (sectorsize);
1270 blockdev_getbsz (g, device)
1276 blocksize = guestfs_blockdev_getbsz (g, device);
1277 if (blocksize == -1)
1278 croak ("blockdev_getbsz: %s", guestfs_last_error (g));
1279 RETVAL = newSViv (blocksize);
1284 blockdev_setbsz (g, device, blocksize)
1291 r = guestfs_blockdev_setbsz (g, device, blocksize);
1293 croak ("blockdev_setbsz: %s", guestfs_last_error (g));
1296 blockdev_getsz (g, device)
1300 int64_t sizeinsectors;
1302 sizeinsectors = guestfs_blockdev_getsz (g, device);
1303 if (sizeinsectors == -1)
1304 croak ("blockdev_getsz: %s", guestfs_last_error (g));
1305 RETVAL = my_newSVll (sizeinsectors);
1310 blockdev_getsize64 (g, device)
1314 int64_t sizeinbytes;
1316 sizeinbytes = guestfs_blockdev_getsize64 (g, device);
1317 if (sizeinbytes == -1)
1318 croak ("blockdev_getsize64: %s", guestfs_last_error (g));
1319 RETVAL = my_newSVll (sizeinbytes);
1324 blockdev_flushbufs (g, device)
1330 r = guestfs_blockdev_flushbufs (g, device);
1332 croak ("blockdev_flushbufs: %s", guestfs_last_error (g));
1335 blockdev_rereadpt (g, device)
1341 r = guestfs_blockdev_rereadpt (g, device);
1343 croak ("blockdev_rereadpt: %s", guestfs_last_error (g));
1346 upload (g, filename, remotefilename)
1349 char *remotefilename;
1353 r = guestfs_upload (g, filename, remotefilename);
1355 croak ("upload: %s", guestfs_last_error (g));
1358 download (g, remotefilename, filename)
1360 char *remotefilename;
1365 r = guestfs_download (g, remotefilename, filename);
1367 croak ("download: %s", guestfs_last_error (g));
1370 checksum (g, csumtype, path)
1377 checksum = guestfs_checksum (g, csumtype, path);
1378 if (checksum == NULL)
1379 croak ("checksum: %s", guestfs_last_error (g));
1380 RETVAL = newSVpv (checksum, 0);
1386 tar_in (g, tarfile, directory)
1393 r = guestfs_tar_in (g, tarfile, directory);
1395 croak ("tar_in: %s", guestfs_last_error (g));
1398 tar_out (g, directory, tarfile)
1405 r = guestfs_tar_out (g, directory, tarfile);
1407 croak ("tar_out: %s", guestfs_last_error (g));
1410 tgz_in (g, tarball, directory)
1417 r = guestfs_tgz_in (g, tarball, directory);
1419 croak ("tgz_in: %s", guestfs_last_error (g));
1422 tgz_out (g, directory, tarball)
1429 r = guestfs_tgz_out (g, directory, tarball);
1431 croak ("tgz_out: %s", guestfs_last_error (g));
1434 mount_ro (g, device, mountpoint)
1441 r = guestfs_mount_ro (g, device, mountpoint);
1443 croak ("mount_ro: %s", guestfs_last_error (g));
1446 mount_options (g, options, device, mountpoint)
1454 r = guestfs_mount_options (g, options, device, mountpoint);
1456 croak ("mount_options: %s", guestfs_last_error (g));
1459 mount_vfs (g, options, vfstype, device, mountpoint)
1468 r = guestfs_mount_vfs (g, options, vfstype, device, mountpoint);
1470 croak ("mount_vfs: %s", guestfs_last_error (g));
1473 debug (g, subcmd, extraargs)
1480 result = guestfs_debug (g, subcmd, extraargs);
1483 croak ("debug: %s", guestfs_last_error (g));
1484 RETVAL = newSVpv (result, 0);
1490 lvremove (g, device)
1496 r = guestfs_lvremove (g, device);
1498 croak ("lvremove: %s", guestfs_last_error (g));
1501 vgremove (g, vgname)
1507 r = guestfs_vgremove (g, vgname);
1509 croak ("vgremove: %s", guestfs_last_error (g));
1512 pvremove (g, device)
1518 r = guestfs_pvremove (g, device);
1520 croak ("pvremove: %s", guestfs_last_error (g));
1523 set_e2label (g, device, label)
1530 r = guestfs_set_e2label (g, device, label);
1532 croak ("set_e2label: %s", guestfs_last_error (g));
1535 get_e2label (g, device)
1541 label = guestfs_get_e2label (g, device);
1543 croak ("get_e2label: %s", guestfs_last_error (g));
1544 RETVAL = newSVpv (label, 0);
1550 set_e2uuid (g, device, uuid)
1557 r = guestfs_set_e2uuid (g, device, uuid);
1559 croak ("set_e2uuid: %s", guestfs_last_error (g));
1562 get_e2uuid (g, device)
1568 uuid = guestfs_get_e2uuid (g, device);
1570 croak ("get_e2uuid: %s", guestfs_last_error (g));
1571 RETVAL = newSVpv (uuid, 0);
1577 fsck (g, fstype, device)
1584 status = guestfs_fsck (g, fstype, device);
1586 croak ("fsck: %s", guestfs_last_error (g));
1587 RETVAL = newSViv (status);
1598 r = guestfs_zero (g, device);
1600 croak ("zero: %s", guestfs_last_error (g));
1603 grub_install (g, root, device)
1610 r = guestfs_grub_install (g, root, device);
1612 croak ("grub_install: %s", guestfs_last_error (g));
1622 r = guestfs_cp (g, src, dest);
1624 croak ("cp: %s", guestfs_last_error (g));
1634 r = guestfs_cp_a (g, src, dest);
1636 croak ("cp_a: %s", guestfs_last_error (g));
1646 r = guestfs_mv (g, src, dest);
1648 croak ("mv: %s", guestfs_last_error (g));
1651 drop_caches (g, whattodrop)
1657 r = guestfs_drop_caches (g, whattodrop);
1659 croak ("drop_caches: %s", guestfs_last_error (g));
1667 kmsgs = guestfs_dmesg (g);
1669 croak ("dmesg: %s", guestfs_last_error (g));
1670 RETVAL = newSVpv (kmsgs, 0);
1681 r = guestfs_ping_daemon (g);
1683 croak ("ping_daemon: %s", guestfs_last_error (g));
1686 equal (g, file1, file2)
1693 equality = guestfs_equal (g, file1, file2);
1695 croak ("equal: %s", guestfs_last_error (g));
1696 RETVAL = newSViv (equality);