Generated code for 'wc_*' commands.
[libguestfs.git] / perl / Guestfs.xs
index f19b9d0..1dc634f 100644 (file)
@@ -68,7 +68,7 @@ XS_unpack_charPtrPtr (SV *arg) {
     croak ("array reference expected");
 
   av = (AV *)SvRV (arg);
-  ret = malloc (av_len (av) + 1 + 1);
+  ret = malloc ((av_len (av) + 1 + 1) * sizeof (char *));
   if (!ret)
     croak ("malloc failed");
 
@@ -88,6 +88,8 @@ XS_unpack_charPtrPtr (SV *arg) {
 
 MODULE = Sys::Guestfs  PACKAGE = Sys::Guestfs
 
+PROTOTYPES: ENABLE
+
 guestfs_h *
 _create ()
    CODE:
@@ -105,6 +107,571 @@ DESTROY (g)
       guestfs_close (g);
 
 void
+test0 (g, str, optstr, strlist, b, integer, filein, fileout)
+      guestfs_h *g;
+      char *str;
+      char *optstr = SvOK(ST(2)) ? SvPV_nolen(ST(2)) : NULL;
+      char **strlist;
+      int b;
+      int integer;
+      char *filein;
+      char *fileout;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_test0 (g, str, optstr, strlist, b, integer, filein, fileout);
+      free (strlist);
+      if (r == -1)
+        croak ("test0: %s", guestfs_last_error (g));
+
+SV *
+test0rint (g, val)
+      guestfs_h *g;
+      char *val;
+PREINIT:
+      int valout;
+   CODE:
+      valout = guestfs_test0rint (g, val);
+      if (valout == -1)
+        croak ("test0rint: %s", guestfs_last_error (g));
+      RETVAL = newSViv (valout);
+ OUTPUT:
+      RETVAL
+
+SV *
+test0rinterr (g)
+      guestfs_h *g;
+PREINIT:
+      int valout;
+   CODE:
+      valout = guestfs_test0rinterr (g);
+      if (valout == -1)
+        croak ("test0rinterr: %s", guestfs_last_error (g));
+      RETVAL = newSViv (valout);
+ OUTPUT:
+      RETVAL
+
+SV *
+test0rint64 (g, val)
+      guestfs_h *g;
+      char *val;
+PREINIT:
+      int64_t valout;
+   CODE:
+      valout = guestfs_test0rint64 (g, val);
+      if (valout == -1)
+        croak ("test0rint64: %s", guestfs_last_error (g));
+      RETVAL = my_newSVll (valout);
+ OUTPUT:
+      RETVAL
+
+SV *
+test0rint64err (g)
+      guestfs_h *g;
+PREINIT:
+      int64_t valout;
+   CODE:
+      valout = guestfs_test0rint64err (g);
+      if (valout == -1)
+        croak ("test0rint64err: %s", guestfs_last_error (g));
+      RETVAL = my_newSVll (valout);
+ OUTPUT:
+      RETVAL
+
+SV *
+test0rbool (g, val)
+      guestfs_h *g;
+      char *val;
+PREINIT:
+      int valout;
+   CODE:
+      valout = guestfs_test0rbool (g, val);
+      if (valout == -1)
+        croak ("test0rbool: %s", guestfs_last_error (g));
+      RETVAL = newSViv (valout);
+ OUTPUT:
+      RETVAL
+
+SV *
+test0rboolerr (g)
+      guestfs_h *g;
+PREINIT:
+      int valout;
+   CODE:
+      valout = guestfs_test0rboolerr (g);
+      if (valout == -1)
+        croak ("test0rboolerr: %s", guestfs_last_error (g));
+      RETVAL = newSViv (valout);
+ OUTPUT:
+      RETVAL
+
+SV *
+test0rconststring (g, val)
+      guestfs_h *g;
+      char *val;
+PREINIT:
+      const char *valout;
+   CODE:
+      valout = guestfs_test0rconststring (g, val);
+      if (valout == NULL)
+        croak ("test0rconststring: %s", guestfs_last_error (g));
+      RETVAL = newSVpv (valout, 0);
+ OUTPUT:
+      RETVAL
+
+SV *
+test0rconststringerr (g)
+      guestfs_h *g;
+PREINIT:
+      const char *valout;
+   CODE:
+      valout = guestfs_test0rconststringerr (g);
+      if (valout == NULL)
+        croak ("test0rconststringerr: %s", guestfs_last_error (g));
+      RETVAL = newSVpv (valout, 0);
+ OUTPUT:
+      RETVAL
+
+SV *
+test0rstring (g, val)
+      guestfs_h *g;
+      char *val;
+PREINIT:
+      char *valout;
+   CODE:
+      valout = guestfs_test0rstring (g, val);
+      if (valout == NULL)
+        croak ("test0rstring: %s", guestfs_last_error (g));
+      RETVAL = newSVpv (valout, 0);
+      free (valout);
+ OUTPUT:
+      RETVAL
+
+SV *
+test0rstringerr (g)
+      guestfs_h *g;
+PREINIT:
+      char *valout;
+   CODE:
+      valout = guestfs_test0rstringerr (g);
+      if (valout == NULL)
+        croak ("test0rstringerr: %s", guestfs_last_error (g));
+      RETVAL = newSVpv (valout, 0);
+      free (valout);
+ OUTPUT:
+      RETVAL
+
+void
+test0rstringlist (g, val)
+      guestfs_h *g;
+      char *val;
+PREINIT:
+      char **valout;
+      int i, n;
+ PPCODE:
+      valout = guestfs_test0rstringlist (g, val);
+      if (valout == NULL)
+        croak ("test0rstringlist: %s", guestfs_last_error (g));
+      for (n = 0; valout[n] != NULL; ++n) /**/;
+      EXTEND (SP, n);
+      for (i = 0; i < n; ++i) {
+        PUSHs (sv_2mortal (newSVpv (valout[i], 0)));
+        free (valout[i]);
+      }
+      free (valout);
+
+void
+test0rstringlisterr (g)
+      guestfs_h *g;
+PREINIT:
+      char **valout;
+      int i, n;
+ PPCODE:
+      valout = guestfs_test0rstringlisterr (g);
+      if (valout == NULL)
+        croak ("test0rstringlisterr: %s", guestfs_last_error (g));
+      for (n = 0; valout[n] != NULL; ++n) /**/;
+      EXTEND (SP, n);
+      for (i = 0; i < n; ++i) {
+        PUSHs (sv_2mortal (newSVpv (valout[i], 0)));
+        free (valout[i]);
+      }
+      free (valout);
+
+void
+test0rintbool (g, val)
+      guestfs_h *g;
+      char *val;
+PREINIT:
+      struct guestfs_int_bool *r;
+ PPCODE:
+      r = guestfs_test0rintbool (g, val);
+      if (r == NULL)
+        croak ("test0rintbool: %s", guestfs_last_error (g));
+      EXTEND (SP, 2);
+      PUSHs (sv_2mortal (newSViv (r->i)));
+      PUSHs (sv_2mortal (newSViv (r->b)));
+      guestfs_free_int_bool (r);
+
+void
+test0rintboolerr (g)
+      guestfs_h *g;
+PREINIT:
+      struct guestfs_int_bool *r;
+ PPCODE:
+      r = guestfs_test0rintboolerr (g);
+      if (r == NULL)
+        croak ("test0rintboolerr: %s", guestfs_last_error (g));
+      EXTEND (SP, 2);
+      PUSHs (sv_2mortal (newSViv (r->i)));
+      PUSHs (sv_2mortal (newSViv (r->b)));
+      guestfs_free_int_bool (r);
+
+void
+test0rpvlist (g, val)
+      guestfs_h *g;
+      char *val;
+PREINIT:
+      struct guestfs_lvm_pv_list *valout;
+      int i;
+      HV *hv;
+ PPCODE:
+      valout = guestfs_test0rpvlist (g, val);
+      if (valout == NULL)
+        croak ("test0rpvlist: %s", guestfs_last_error (g));
+      EXTEND (SP, valout->len);
+      for (i = 0; i < valout->len; ++i) {
+        hv = newHV ();
+        (void) hv_store (hv, "pv_name", 7, newSVpv (valout->val[i].pv_name, 0), 0);
+        (void) hv_store (hv, "pv_uuid", 7, newSVpv (valout->val[i].pv_uuid, 32), 0);
+        (void) hv_store (hv, "pv_fmt", 6, newSVpv (valout->val[i].pv_fmt, 0), 0);
+        (void) hv_store (hv, "pv_size", 7, my_newSVull (valout->val[i].pv_size), 0);
+        (void) hv_store (hv, "dev_size", 8, my_newSVull (valout->val[i].dev_size), 0);
+        (void) hv_store (hv, "pv_free", 7, my_newSVull (valout->val[i].pv_free), 0);
+        (void) hv_store (hv, "pv_used", 7, my_newSVull (valout->val[i].pv_used), 0);
+        (void) hv_store (hv, "pv_attr", 7, newSVpv (valout->val[i].pv_attr, 0), 0);
+        (void) hv_store (hv, "pv_pe_count", 11, my_newSVll (valout->val[i].pv_pe_count), 0);
+        (void) hv_store (hv, "pv_pe_alloc_count", 17, my_newSVll (valout->val[i].pv_pe_alloc_count), 0);
+        (void) hv_store (hv, "pv_tags", 7, newSVpv (valout->val[i].pv_tags, 0), 0);
+        (void) hv_store (hv, "pe_start", 8, my_newSVull (valout->val[i].pe_start), 0);
+        (void) hv_store (hv, "pv_mda_count", 12, my_newSVll (valout->val[i].pv_mda_count), 0);
+        (void) hv_store (hv, "pv_mda_free", 11, my_newSVull (valout->val[i].pv_mda_free), 0);
+        PUSHs (sv_2mortal ((SV *) hv));
+      }
+      guestfs_free_lvm_pv_list (valout);
+
+void
+test0rpvlisterr (g)
+      guestfs_h *g;
+PREINIT:
+      struct guestfs_lvm_pv_list *valout;
+      int i;
+      HV *hv;
+ PPCODE:
+      valout = guestfs_test0rpvlisterr (g);
+      if (valout == NULL)
+        croak ("test0rpvlisterr: %s", guestfs_last_error (g));
+      EXTEND (SP, valout->len);
+      for (i = 0; i < valout->len; ++i) {
+        hv = newHV ();
+        (void) hv_store (hv, "pv_name", 7, newSVpv (valout->val[i].pv_name, 0), 0);
+        (void) hv_store (hv, "pv_uuid", 7, newSVpv (valout->val[i].pv_uuid, 32), 0);
+        (void) hv_store (hv, "pv_fmt", 6, newSVpv (valout->val[i].pv_fmt, 0), 0);
+        (void) hv_store (hv, "pv_size", 7, my_newSVull (valout->val[i].pv_size), 0);
+        (void) hv_store (hv, "dev_size", 8, my_newSVull (valout->val[i].dev_size), 0);
+        (void) hv_store (hv, "pv_free", 7, my_newSVull (valout->val[i].pv_free), 0);
+        (void) hv_store (hv, "pv_used", 7, my_newSVull (valout->val[i].pv_used), 0);
+        (void) hv_store (hv, "pv_attr", 7, newSVpv (valout->val[i].pv_attr, 0), 0);
+        (void) hv_store (hv, "pv_pe_count", 11, my_newSVll (valout->val[i].pv_pe_count), 0);
+        (void) hv_store (hv, "pv_pe_alloc_count", 17, my_newSVll (valout->val[i].pv_pe_alloc_count), 0);
+        (void) hv_store (hv, "pv_tags", 7, newSVpv (valout->val[i].pv_tags, 0), 0);
+        (void) hv_store (hv, "pe_start", 8, my_newSVull (valout->val[i].pe_start), 0);
+        (void) hv_store (hv, "pv_mda_count", 12, my_newSVll (valout->val[i].pv_mda_count), 0);
+        (void) hv_store (hv, "pv_mda_free", 11, my_newSVull (valout->val[i].pv_mda_free), 0);
+        PUSHs (sv_2mortal ((SV *) hv));
+      }
+      guestfs_free_lvm_pv_list (valout);
+
+void
+test0rvglist (g, val)
+      guestfs_h *g;
+      char *val;
+PREINIT:
+      struct guestfs_lvm_vg_list *valout;
+      int i;
+      HV *hv;
+ PPCODE:
+      valout = guestfs_test0rvglist (g, val);
+      if (valout == NULL)
+        croak ("test0rvglist: %s", guestfs_last_error (g));
+      EXTEND (SP, valout->len);
+      for (i = 0; i < valout->len; ++i) {
+        hv = newHV ();
+        (void) hv_store (hv, "vg_name", 7, newSVpv (valout->val[i].vg_name, 0), 0);
+        (void) hv_store (hv, "vg_uuid", 7, newSVpv (valout->val[i].vg_uuid, 32), 0);
+        (void) hv_store (hv, "vg_fmt", 6, newSVpv (valout->val[i].vg_fmt, 0), 0);
+        (void) hv_store (hv, "vg_attr", 7, newSVpv (valout->val[i].vg_attr, 0), 0);
+        (void) hv_store (hv, "vg_size", 7, my_newSVull (valout->val[i].vg_size), 0);
+        (void) hv_store (hv, "vg_free", 7, my_newSVull (valout->val[i].vg_free), 0);
+        (void) hv_store (hv, "vg_sysid", 8, newSVpv (valout->val[i].vg_sysid, 0), 0);
+        (void) hv_store (hv, "vg_extent_size", 14, my_newSVull (valout->val[i].vg_extent_size), 0);
+        (void) hv_store (hv, "vg_extent_count", 15, my_newSVll (valout->val[i].vg_extent_count), 0);
+        (void) hv_store (hv, "vg_free_count", 13, my_newSVll (valout->val[i].vg_free_count), 0);
+        (void) hv_store (hv, "max_lv", 6, my_newSVll (valout->val[i].max_lv), 0);
+        (void) hv_store (hv, "max_pv", 6, my_newSVll (valout->val[i].max_pv), 0);
+        (void) hv_store (hv, "pv_count", 8, my_newSVll (valout->val[i].pv_count), 0);
+        (void) hv_store (hv, "lv_count", 8, my_newSVll (valout->val[i].lv_count), 0);
+        (void) hv_store (hv, "snap_count", 10, my_newSVll (valout->val[i].snap_count), 0);
+        (void) hv_store (hv, "vg_seqno", 8, my_newSVll (valout->val[i].vg_seqno), 0);
+        (void) hv_store (hv, "vg_tags", 7, newSVpv (valout->val[i].vg_tags, 0), 0);
+        (void) hv_store (hv, "vg_mda_count", 12, my_newSVll (valout->val[i].vg_mda_count), 0);
+        (void) hv_store (hv, "vg_mda_free", 11, my_newSVull (valout->val[i].vg_mda_free), 0);
+        PUSHs (sv_2mortal ((SV *) hv));
+      }
+      guestfs_free_lvm_vg_list (valout);
+
+void
+test0rvglisterr (g)
+      guestfs_h *g;
+PREINIT:
+      struct guestfs_lvm_vg_list *valout;
+      int i;
+      HV *hv;
+ PPCODE:
+      valout = guestfs_test0rvglisterr (g);
+      if (valout == NULL)
+        croak ("test0rvglisterr: %s", guestfs_last_error (g));
+      EXTEND (SP, valout->len);
+      for (i = 0; i < valout->len; ++i) {
+        hv = newHV ();
+        (void) hv_store (hv, "vg_name", 7, newSVpv (valout->val[i].vg_name, 0), 0);
+        (void) hv_store (hv, "vg_uuid", 7, newSVpv (valout->val[i].vg_uuid, 32), 0);
+        (void) hv_store (hv, "vg_fmt", 6, newSVpv (valout->val[i].vg_fmt, 0), 0);
+        (void) hv_store (hv, "vg_attr", 7, newSVpv (valout->val[i].vg_attr, 0), 0);
+        (void) hv_store (hv, "vg_size", 7, my_newSVull (valout->val[i].vg_size), 0);
+        (void) hv_store (hv, "vg_free", 7, my_newSVull (valout->val[i].vg_free), 0);
+        (void) hv_store (hv, "vg_sysid", 8, newSVpv (valout->val[i].vg_sysid, 0), 0);
+        (void) hv_store (hv, "vg_extent_size", 14, my_newSVull (valout->val[i].vg_extent_size), 0);
+        (void) hv_store (hv, "vg_extent_count", 15, my_newSVll (valout->val[i].vg_extent_count), 0);
+        (void) hv_store (hv, "vg_free_count", 13, my_newSVll (valout->val[i].vg_free_count), 0);
+        (void) hv_store (hv, "max_lv", 6, my_newSVll (valout->val[i].max_lv), 0);
+        (void) hv_store (hv, "max_pv", 6, my_newSVll (valout->val[i].max_pv), 0);
+        (void) hv_store (hv, "pv_count", 8, my_newSVll (valout->val[i].pv_count), 0);
+        (void) hv_store (hv, "lv_count", 8, my_newSVll (valout->val[i].lv_count), 0);
+        (void) hv_store (hv, "snap_count", 10, my_newSVll (valout->val[i].snap_count), 0);
+        (void) hv_store (hv, "vg_seqno", 8, my_newSVll (valout->val[i].vg_seqno), 0);
+        (void) hv_store (hv, "vg_tags", 7, newSVpv (valout->val[i].vg_tags, 0), 0);
+        (void) hv_store (hv, "vg_mda_count", 12, my_newSVll (valout->val[i].vg_mda_count), 0);
+        (void) hv_store (hv, "vg_mda_free", 11, my_newSVull (valout->val[i].vg_mda_free), 0);
+        PUSHs (sv_2mortal ((SV *) hv));
+      }
+      guestfs_free_lvm_vg_list (valout);
+
+void
+test0rlvlist (g, val)
+      guestfs_h *g;
+      char *val;
+PREINIT:
+      struct guestfs_lvm_lv_list *valout;
+      int i;
+      HV *hv;
+ PPCODE:
+      valout = guestfs_test0rlvlist (g, val);
+      if (valout == NULL)
+        croak ("test0rlvlist: %s", guestfs_last_error (g));
+      EXTEND (SP, valout->len);
+      for (i = 0; i < valout->len; ++i) {
+        hv = newHV ();
+        (void) hv_store (hv, "lv_name", 7, newSVpv (valout->val[i].lv_name, 0), 0);
+        (void) hv_store (hv, "lv_uuid", 7, newSVpv (valout->val[i].lv_uuid, 32), 0);
+        (void) hv_store (hv, "lv_attr", 7, newSVpv (valout->val[i].lv_attr, 0), 0);
+        (void) hv_store (hv, "lv_major", 8, my_newSVll (valout->val[i].lv_major), 0);
+        (void) hv_store (hv, "lv_minor", 8, my_newSVll (valout->val[i].lv_minor), 0);
+        (void) hv_store (hv, "lv_kernel_major", 15, my_newSVll (valout->val[i].lv_kernel_major), 0);
+        (void) hv_store (hv, "lv_kernel_minor", 15, my_newSVll (valout->val[i].lv_kernel_minor), 0);
+        (void) hv_store (hv, "lv_size", 7, my_newSVull (valout->val[i].lv_size), 0);
+        (void) hv_store (hv, "seg_count", 9, my_newSVll (valout->val[i].seg_count), 0);
+        (void) hv_store (hv, "origin", 6, newSVpv (valout->val[i].origin, 0), 0);
+        (void) hv_store (hv, "snap_percent", 12, newSVnv (valout->val[i].snap_percent), 0);
+        (void) hv_store (hv, "copy_percent", 12, newSVnv (valout->val[i].copy_percent), 0);
+        (void) hv_store (hv, "move_pv", 7, newSVpv (valout->val[i].move_pv, 0), 0);
+        (void) hv_store (hv, "lv_tags", 7, newSVpv (valout->val[i].lv_tags, 0), 0);
+        (void) hv_store (hv, "mirror_log", 10, newSVpv (valout->val[i].mirror_log, 0), 0);
+        (void) hv_store (hv, "modules", 7, newSVpv (valout->val[i].modules, 0), 0);
+        PUSHs (sv_2mortal ((SV *) hv));
+      }
+      guestfs_free_lvm_lv_list (valout);
+
+void
+test0rlvlisterr (g)
+      guestfs_h *g;
+PREINIT:
+      struct guestfs_lvm_lv_list *valout;
+      int i;
+      HV *hv;
+ PPCODE:
+      valout = guestfs_test0rlvlisterr (g);
+      if (valout == NULL)
+        croak ("test0rlvlisterr: %s", guestfs_last_error (g));
+      EXTEND (SP, valout->len);
+      for (i = 0; i < valout->len; ++i) {
+        hv = newHV ();
+        (void) hv_store (hv, "lv_name", 7, newSVpv (valout->val[i].lv_name, 0), 0);
+        (void) hv_store (hv, "lv_uuid", 7, newSVpv (valout->val[i].lv_uuid, 32), 0);
+        (void) hv_store (hv, "lv_attr", 7, newSVpv (valout->val[i].lv_attr, 0), 0);
+        (void) hv_store (hv, "lv_major", 8, my_newSVll (valout->val[i].lv_major), 0);
+        (void) hv_store (hv, "lv_minor", 8, my_newSVll (valout->val[i].lv_minor), 0);
+        (void) hv_store (hv, "lv_kernel_major", 15, my_newSVll (valout->val[i].lv_kernel_major), 0);
+        (void) hv_store (hv, "lv_kernel_minor", 15, my_newSVll (valout->val[i].lv_kernel_minor), 0);
+        (void) hv_store (hv, "lv_size", 7, my_newSVull (valout->val[i].lv_size), 0);
+        (void) hv_store (hv, "seg_count", 9, my_newSVll (valout->val[i].seg_count), 0);
+        (void) hv_store (hv, "origin", 6, newSVpv (valout->val[i].origin, 0), 0);
+        (void) hv_store (hv, "snap_percent", 12, newSVnv (valout->val[i].snap_percent), 0);
+        (void) hv_store (hv, "copy_percent", 12, newSVnv (valout->val[i].copy_percent), 0);
+        (void) hv_store (hv, "move_pv", 7, newSVpv (valout->val[i].move_pv, 0), 0);
+        (void) hv_store (hv, "lv_tags", 7, newSVpv (valout->val[i].lv_tags, 0), 0);
+        (void) hv_store (hv, "mirror_log", 10, newSVpv (valout->val[i].mirror_log, 0), 0);
+        (void) hv_store (hv, "modules", 7, newSVpv (valout->val[i].modules, 0), 0);
+        PUSHs (sv_2mortal ((SV *) hv));
+      }
+      guestfs_free_lvm_lv_list (valout);
+
+void
+test0rstat (g, val)
+      guestfs_h *g;
+      char *val;
+PREINIT:
+      struct guestfs_stat *valout;
+ PPCODE:
+      valout = guestfs_test0rstat (g, val);
+      if (valout == NULL)
+        croak ("test0rstat: %s", guestfs_last_error (g));
+      EXTEND (SP, 13);
+      PUSHs (sv_2mortal (my_newSVll (valout->dev)));
+      PUSHs (sv_2mortal (my_newSVll (valout->ino)));
+      PUSHs (sv_2mortal (my_newSVll (valout->mode)));
+      PUSHs (sv_2mortal (my_newSVll (valout->nlink)));
+      PUSHs (sv_2mortal (my_newSVll (valout->uid)));
+      PUSHs (sv_2mortal (my_newSVll (valout->gid)));
+      PUSHs (sv_2mortal (my_newSVll (valout->rdev)));
+      PUSHs (sv_2mortal (my_newSVll (valout->size)));
+      PUSHs (sv_2mortal (my_newSVll (valout->blksize)));
+      PUSHs (sv_2mortal (my_newSVll (valout->blocks)));
+      PUSHs (sv_2mortal (my_newSVll (valout->atime)));
+      PUSHs (sv_2mortal (my_newSVll (valout->mtime)));
+      PUSHs (sv_2mortal (my_newSVll (valout->ctime)));
+      free (valout);
+
+void
+test0rstaterr (g)
+      guestfs_h *g;
+PREINIT:
+      struct guestfs_stat *valout;
+ PPCODE:
+      valout = guestfs_test0rstaterr (g);
+      if (valout == NULL)
+        croak ("test0rstaterr: %s", guestfs_last_error (g));
+      EXTEND (SP, 13);
+      PUSHs (sv_2mortal (my_newSVll (valout->dev)));
+      PUSHs (sv_2mortal (my_newSVll (valout->ino)));
+      PUSHs (sv_2mortal (my_newSVll (valout->mode)));
+      PUSHs (sv_2mortal (my_newSVll (valout->nlink)));
+      PUSHs (sv_2mortal (my_newSVll (valout->uid)));
+      PUSHs (sv_2mortal (my_newSVll (valout->gid)));
+      PUSHs (sv_2mortal (my_newSVll (valout->rdev)));
+      PUSHs (sv_2mortal (my_newSVll (valout->size)));
+      PUSHs (sv_2mortal (my_newSVll (valout->blksize)));
+      PUSHs (sv_2mortal (my_newSVll (valout->blocks)));
+      PUSHs (sv_2mortal (my_newSVll (valout->atime)));
+      PUSHs (sv_2mortal (my_newSVll (valout->mtime)));
+      PUSHs (sv_2mortal (my_newSVll (valout->ctime)));
+      free (valout);
+
+void
+test0rstatvfs (g, val)
+      guestfs_h *g;
+      char *val;
+PREINIT:
+      struct guestfs_statvfs *valout;
+ PPCODE:
+      valout = guestfs_test0rstatvfs (g, val);
+      if (valout == NULL)
+        croak ("test0rstatvfs: %s", guestfs_last_error (g));
+      EXTEND (SP, 11);
+      PUSHs (sv_2mortal (my_newSVll (valout->bsize)));
+      PUSHs (sv_2mortal (my_newSVll (valout->frsize)));
+      PUSHs (sv_2mortal (my_newSVll (valout->blocks)));
+      PUSHs (sv_2mortal (my_newSVll (valout->bfree)));
+      PUSHs (sv_2mortal (my_newSVll (valout->bavail)));
+      PUSHs (sv_2mortal (my_newSVll (valout->files)));
+      PUSHs (sv_2mortal (my_newSVll (valout->ffree)));
+      PUSHs (sv_2mortal (my_newSVll (valout->favail)));
+      PUSHs (sv_2mortal (my_newSVll (valout->fsid)));
+      PUSHs (sv_2mortal (my_newSVll (valout->flag)));
+      PUSHs (sv_2mortal (my_newSVll (valout->namemax)));
+      free (valout);
+
+void
+test0rstatvfserr (g)
+      guestfs_h *g;
+PREINIT:
+      struct guestfs_statvfs *valout;
+ PPCODE:
+      valout = guestfs_test0rstatvfserr (g);
+      if (valout == NULL)
+        croak ("test0rstatvfserr: %s", guestfs_last_error (g));
+      EXTEND (SP, 11);
+      PUSHs (sv_2mortal (my_newSVll (valout->bsize)));
+      PUSHs (sv_2mortal (my_newSVll (valout->frsize)));
+      PUSHs (sv_2mortal (my_newSVll (valout->blocks)));
+      PUSHs (sv_2mortal (my_newSVll (valout->bfree)));
+      PUSHs (sv_2mortal (my_newSVll (valout->bavail)));
+      PUSHs (sv_2mortal (my_newSVll (valout->files)));
+      PUSHs (sv_2mortal (my_newSVll (valout->ffree)));
+      PUSHs (sv_2mortal (my_newSVll (valout->favail)));
+      PUSHs (sv_2mortal (my_newSVll (valout->fsid)));
+      PUSHs (sv_2mortal (my_newSVll (valout->flag)));
+      PUSHs (sv_2mortal (my_newSVll (valout->namemax)));
+      free (valout);
+
+void
+test0rhashtable (g, val)
+      guestfs_h *g;
+      char *val;
+PREINIT:
+      char **valout;
+      int i, n;
+ PPCODE:
+      valout = guestfs_test0rhashtable (g, val);
+      if (valout == NULL)
+        croak ("test0rhashtable: %s", guestfs_last_error (g));
+      for (n = 0; valout[n] != NULL; ++n) /**/;
+      EXTEND (SP, n);
+      for (i = 0; i < n; ++i) {
+        PUSHs (sv_2mortal (newSVpv (valout[i], 0)));
+        free (valout[i]);
+      }
+      free (valout);
+
+void
+test0rhashtableerr (g)
+      guestfs_h *g;
+PREINIT:
+      char **valout;
+      int i, n;
+ PPCODE:
+      valout = guestfs_test0rhashtableerr (g);
+      if (valout == NULL)
+        croak ("test0rhashtableerr: %s", guestfs_last_error (g));
+      for (n = 0; valout[n] != NULL; ++n) /**/;
+      EXTEND (SP, n);
+      for (i = 0; i < n; ++i) {
+        PUSHs (sv_2mortal (newSVpv (valout[i], 0)));
+        free (valout[i]);
+      }
+      free (valout);
+
+void
 launch (g)
       guestfs_h *g;
 PREINIT:
@@ -157,10 +724,21 @@ PREINIT:
         croak ("add_cdrom: %s", guestfs_last_error (g));
 
 void
+add_drive_ro (g, filename)
+      guestfs_h *g;
+      char *filename;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_add_drive_ro (g, filename);
+      if (r == -1)
+        croak ("add_drive_ro: %s", guestfs_last_error (g));
+
+void
 config (g, qemuparam, qemuvalue)
       guestfs_h *g;
       char *qemuparam;
-      char *qemuvalue;
+      char *qemuvalue = SvOK(ST(2)) ? SvPV_nolen(ST(2)) : NULL;
 PREINIT:
       int r;
  PPCODE:
@@ -217,6 +795,30 @@ PREINIT:
       RETVAL
 
 void
+set_append (g, append)
+      guestfs_h *g;
+      char *append;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_set_append (g, append);
+      if (r == -1)
+        croak ("set_append: %s", guestfs_last_error (g));
+
+SV *
+get_append (g)
+      guestfs_h *g;
+PREINIT:
+      const char *append;
+   CODE:
+      append = guestfs_get_append (g);
+      if (append == NULL)
+        croak ("get_append: %s", guestfs_last_error (g));
+      RETVAL = newSVpv (append, 0);
+ OUTPUT:
+      RETVAL
+
+void
 set_autosync (g, autosync)
       guestfs_h *g;
       int autosync;
@@ -350,6 +952,16 @@ PREINIT:
         croak ("set_ready: %s", guestfs_last_error (g));
 
 void
+end_busy (g)
+      guestfs_h *g;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_end_busy (g);
+      if (r == -1)
+        croak ("end_busy: %s", guestfs_last_error (g));
+
+void
 mount (g, device, mountpoint)
       guestfs_h *g;
       char *device;
@@ -669,7 +1281,7 @@ SV *
 aug_defvar (g, name, expr)
       guestfs_h *g;
       char *name;
-      char *expr;
+      char *expr = SvOK(ST(2)) ? SvPV_nolen(ST(2)) : NULL;
 PREINIT:
       int nrnodes;
    CODE:
@@ -1611,3 +2223,472 @@ PREINIT:
       if (r == -1)
         croak ("grub_install: %s", guestfs_last_error (g));
 
+void
+cp (g, src, dest)
+      guestfs_h *g;
+      char *src;
+      char *dest;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_cp (g, src, dest);
+      if (r == -1)
+        croak ("cp: %s", guestfs_last_error (g));
+
+void
+cp_a (g, src, dest)
+      guestfs_h *g;
+      char *src;
+      char *dest;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_cp_a (g, src, dest);
+      if (r == -1)
+        croak ("cp_a: %s", guestfs_last_error (g));
+
+void
+mv (g, src, dest)
+      guestfs_h *g;
+      char *src;
+      char *dest;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_mv (g, src, dest);
+      if (r == -1)
+        croak ("mv: %s", guestfs_last_error (g));
+
+void
+drop_caches (g, whattodrop)
+      guestfs_h *g;
+      int whattodrop;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_drop_caches (g, whattodrop);
+      if (r == -1)
+        croak ("drop_caches: %s", guestfs_last_error (g));
+
+SV *
+dmesg (g)
+      guestfs_h *g;
+PREINIT:
+      char *kmsgs;
+   CODE:
+      kmsgs = guestfs_dmesg (g);
+      if (kmsgs == NULL)
+        croak ("dmesg: %s", guestfs_last_error (g));
+      RETVAL = newSVpv (kmsgs, 0);
+      free (kmsgs);
+ OUTPUT:
+      RETVAL
+
+void
+ping_daemon (g)
+      guestfs_h *g;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_ping_daemon (g);
+      if (r == -1)
+        croak ("ping_daemon: %s", guestfs_last_error (g));
+
+SV *
+equal (g, file1, file2)
+      guestfs_h *g;
+      char *file1;
+      char *file2;
+PREINIT:
+      int equality;
+   CODE:
+      equality = guestfs_equal (g, file1, file2);
+      if (equality == -1)
+        croak ("equal: %s", guestfs_last_error (g));
+      RETVAL = newSViv (equality);
+ OUTPUT:
+      RETVAL
+
+void
+strings (g, path)
+      guestfs_h *g;
+      char *path;
+PREINIT:
+      char **stringsout;
+      int i, n;
+ PPCODE:
+      stringsout = guestfs_strings (g, path);
+      if (stringsout == NULL)
+        croak ("strings: %s", guestfs_last_error (g));
+      for (n = 0; stringsout[n] != NULL; ++n) /**/;
+      EXTEND (SP, n);
+      for (i = 0; i < n; ++i) {
+        PUSHs (sv_2mortal (newSVpv (stringsout[i], 0)));
+        free (stringsout[i]);
+      }
+      free (stringsout);
+
+void
+strings_e (g, encoding, path)
+      guestfs_h *g;
+      char *encoding;
+      char *path;
+PREINIT:
+      char **stringsout;
+      int i, n;
+ PPCODE:
+      stringsout = guestfs_strings_e (g, encoding, path);
+      if (stringsout == NULL)
+        croak ("strings_e: %s", guestfs_last_error (g));
+      for (n = 0; stringsout[n] != NULL; ++n) /**/;
+      EXTEND (SP, n);
+      for (i = 0; i < n; ++i) {
+        PUSHs (sv_2mortal (newSVpv (stringsout[i], 0)));
+        free (stringsout[i]);
+      }
+      free (stringsout);
+
+SV *
+hexdump (g, path)
+      guestfs_h *g;
+      char *path;
+PREINIT:
+      char *dump;
+   CODE:
+      dump = guestfs_hexdump (g, path);
+      if (dump == NULL)
+        croak ("hexdump: %s", guestfs_last_error (g));
+      RETVAL = newSVpv (dump, 0);
+      free (dump);
+ OUTPUT:
+      RETVAL
+
+void
+zerofree (g, device)
+      guestfs_h *g;
+      char *device;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_zerofree (g, device);
+      if (r == -1)
+        croak ("zerofree: %s", guestfs_last_error (g));
+
+void
+pvresize (g, device)
+      guestfs_h *g;
+      char *device;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_pvresize (g, device);
+      if (r == -1)
+        croak ("pvresize: %s", guestfs_last_error (g));
+
+void
+sfdisk_N (g, device, n, cyls, heads, sectors, line)
+      guestfs_h *g;
+      char *device;
+      int n;
+      int cyls;
+      int heads;
+      int sectors;
+      char *line;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_sfdisk_N (g, device, n, cyls, heads, sectors, line);
+      if (r == -1)
+        croak ("sfdisk_N: %s", guestfs_last_error (g));
+
+SV *
+sfdisk_l (g, device)
+      guestfs_h *g;
+      char *device;
+PREINIT:
+      char *partitions;
+   CODE:
+      partitions = guestfs_sfdisk_l (g, device);
+      if (partitions == NULL)
+        croak ("sfdisk_l: %s", guestfs_last_error (g));
+      RETVAL = newSVpv (partitions, 0);
+      free (partitions);
+ OUTPUT:
+      RETVAL
+
+SV *
+sfdisk_kernel_geometry (g, device)
+      guestfs_h *g;
+      char *device;
+PREINIT:
+      char *partitions;
+   CODE:
+      partitions = guestfs_sfdisk_kernel_geometry (g, device);
+      if (partitions == NULL)
+        croak ("sfdisk_kernel_geometry: %s", guestfs_last_error (g));
+      RETVAL = newSVpv (partitions, 0);
+      free (partitions);
+ OUTPUT:
+      RETVAL
+
+SV *
+sfdisk_disk_geometry (g, device)
+      guestfs_h *g;
+      char *device;
+PREINIT:
+      char *partitions;
+   CODE:
+      partitions = guestfs_sfdisk_disk_geometry (g, device);
+      if (partitions == NULL)
+        croak ("sfdisk_disk_geometry: %s", guestfs_last_error (g));
+      RETVAL = newSVpv (partitions, 0);
+      free (partitions);
+ OUTPUT:
+      RETVAL
+
+void
+vg_activate_all (g, activate)
+      guestfs_h *g;
+      int activate;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_vg_activate_all (g, activate);
+      if (r == -1)
+        croak ("vg_activate_all: %s", guestfs_last_error (g));
+
+void
+vg_activate (g, activate, volgroups)
+      guestfs_h *g;
+      int activate;
+      char **volgroups;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_vg_activate (g, activate, volgroups);
+      free (volgroups);
+      if (r == -1)
+        croak ("vg_activate: %s", guestfs_last_error (g));
+
+void
+lvresize (g, device, mbytes)
+      guestfs_h *g;
+      char *device;
+      int mbytes;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_lvresize (g, device, mbytes);
+      if (r == -1)
+        croak ("lvresize: %s", guestfs_last_error (g));
+
+void
+resize2fs (g, device)
+      guestfs_h *g;
+      char *device;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_resize2fs (g, device);
+      if (r == -1)
+        croak ("resize2fs: %s", guestfs_last_error (g));
+
+void
+find (g, directory)
+      guestfs_h *g;
+      char *directory;
+PREINIT:
+      char **names;
+      int i, n;
+ PPCODE:
+      names = guestfs_find (g, directory);
+      if (names == NULL)
+        croak ("find: %s", guestfs_last_error (g));
+      for (n = 0; names[n] != NULL; ++n) /**/;
+      EXTEND (SP, n);
+      for (i = 0; i < n; ++i) {
+        PUSHs (sv_2mortal (newSVpv (names[i], 0)));
+        free (names[i]);
+      }
+      free (names);
+
+void
+e2fsck_f (g, device)
+      guestfs_h *g;
+      char *device;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_e2fsck_f (g, device);
+      if (r == -1)
+        croak ("e2fsck_f: %s", guestfs_last_error (g));
+
+void
+sleep (g, secs)
+      guestfs_h *g;
+      int secs;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_sleep (g, secs);
+      if (r == -1)
+        croak ("sleep: %s", guestfs_last_error (g));
+
+SV *
+ntfs_3g_probe (g, rw, device)
+      guestfs_h *g;
+      int rw;
+      char *device;
+PREINIT:
+      int status;
+   CODE:
+      status = guestfs_ntfs_3g_probe (g, rw, device);
+      if (status == -1)
+        croak ("ntfs_3g_probe: %s", guestfs_last_error (g));
+      RETVAL = newSViv (status);
+ OUTPUT:
+      RETVAL
+
+SV *
+sh (g, command)
+      guestfs_h *g;
+      char *command;
+PREINIT:
+      char *output;
+   CODE:
+      output = guestfs_sh (g, command);
+      if (output == NULL)
+        croak ("sh: %s", guestfs_last_error (g));
+      RETVAL = newSVpv (output, 0);
+      free (output);
+ OUTPUT:
+      RETVAL
+
+void
+sh_lines (g, command)
+      guestfs_h *g;
+      char *command;
+PREINIT:
+      char **lines;
+      int i, n;
+ PPCODE:
+      lines = guestfs_sh_lines (g, command);
+      if (lines == NULL)
+        croak ("sh_lines: %s", guestfs_last_error (g));
+      for (n = 0; lines[n] != NULL; ++n) /**/;
+      EXTEND (SP, n);
+      for (i = 0; i < n; ++i) {
+        PUSHs (sv_2mortal (newSVpv (lines[i], 0)));
+        free (lines[i]);
+      }
+      free (lines);
+
+void
+glob_expand (g, pattern)
+      guestfs_h *g;
+      char *pattern;
+PREINIT:
+      char **paths;
+      int i, n;
+ PPCODE:
+      paths = guestfs_glob_expand (g, pattern);
+      if (paths == NULL)
+        croak ("glob_expand: %s", guestfs_last_error (g));
+      for (n = 0; paths[n] != NULL; ++n) /**/;
+      EXTEND (SP, n);
+      for (i = 0; i < n; ++i) {
+        PUSHs (sv_2mortal (newSVpv (paths[i], 0)));
+        free (paths[i]);
+      }
+      free (paths);
+
+void
+scrub_device (g, device)
+      guestfs_h *g;
+      char *device;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_scrub_device (g, device);
+      if (r == -1)
+        croak ("scrub_device: %s", guestfs_last_error (g));
+
+void
+scrub_file (g, file)
+      guestfs_h *g;
+      char *file;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_scrub_file (g, file);
+      if (r == -1)
+        croak ("scrub_file: %s", guestfs_last_error (g));
+
+void
+scrub_freespace (g, dir)
+      guestfs_h *g;
+      char *dir;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_scrub_freespace (g, dir);
+      if (r == -1)
+        croak ("scrub_freespace: %s", guestfs_last_error (g));
+
+SV *
+mkdtemp (g, template)
+      guestfs_h *g;
+      char *template;
+PREINIT:
+      char *dir;
+   CODE:
+      dir = guestfs_mkdtemp (g, template);
+      if (dir == NULL)
+        croak ("mkdtemp: %s", guestfs_last_error (g));
+      RETVAL = newSVpv (dir, 0);
+      free (dir);
+ OUTPUT:
+      RETVAL
+
+SV *
+wc_l (g, path)
+      guestfs_h *g;
+      char *path;
+PREINIT:
+      int lines;
+   CODE:
+      lines = guestfs_wc_l (g, path);
+      if (lines == -1)
+        croak ("wc_l: %s", guestfs_last_error (g));
+      RETVAL = newSViv (lines);
+ OUTPUT:
+      RETVAL
+
+SV *
+wc_w (g, path)
+      guestfs_h *g;
+      char *path;
+PREINIT:
+      int words;
+   CODE:
+      words = guestfs_wc_w (g, path);
+      if (words == -1)
+        croak ("wc_w: %s", guestfs_last_error (g));
+      RETVAL = newSViv (words);
+ OUTPUT:
+      RETVAL
+
+SV *
+wc_c (g, path)
+      guestfs_h *g;
+      char *path;
+PREINIT:
+      int chars;
+   CODE:
+      chars = guestfs_wc_c (g, path);
+      if (chars == -1)
+        croak ("wc_c: %s", guestfs_last_error (g));
+      RETVAL = newSViv (chars);
+ OUTPUT:
+      RETVAL
+