/*
 * This file was generated automatically by ExtUtils::ParseXS version 3.57 from the
 * contents of Guestfs.xs. Do not edit this file, edit Guestfs.xs instead.
 *
 *    ANY CHANGES MADE HERE WILL BE LOST!
 *
 */

#line 1 "lib/Sys/Guestfs.xs"
/* libguestfs generated file
 * WARNING: THIS FILE IS GENERATED FROM THE FOLLOWING FILES:
 *          generator/perl.ml
 *          and from the code in the generator/ subdirectory.
 * ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST.
 *
 * Copyright (C) 2009-2025 Red Hat Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#include <config.h>

/* It is safe to call deprecated functions from this file. */
#define GUESTFS_NO_WARN_DEPRECATED
#undef GUESTFS_NO_DEPRECATED

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <errno.h>

#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

/* perl CORE/config.h defines '_' to something completely bonkers. */
#ifdef _
#undef _
#endif

#include <guestfs.h>
#include "guestfs-internal-all.h"

static SV *
my_newSVll(long long val) {
#ifdef USE_64_BIT_ALL
  return newSViv(val);
#else
  char buf[100];
  int len;
  len = snprintf(buf, 100, "%" PRId64, val);
  return newSVpv(buf, len);
#endif
}

static SV *
my_newSVull(unsigned long long val) {
#ifdef USE_64_BIT_ALL
  return newSVuv(val);
#else
  char buf[100];
  int len;
  len = snprintf(buf, 100, "%" PRIu64, val);
  return newSVpv(buf, len);
#endif
}

/* Convert a 64 bit int on input.  To cope with the case of having
 * a 32 bit Perl interpreter, we allow the user to pass a string
 * here which is scanned as a 64 bit integer.
 */
static int64_t
my_SvIV64 (SV *sv)
{
#ifdef USE_64_BIT_ALL
  return SvIV (sv);
#else
  if (SvTYPE (sv) == SVt_PV) {
    const char *str = SvPV_nolen (sv);
    int64_t r;

    sscanf (str, "%" SCNi64, &r);
    return r;
  }
  else
    return SvIV (sv);
#endif
}

/* http://www.perlmonks.org/?node_id=680842 */
static char **
XS_unpack_charPtrPtr (SV *arg) {
  char **ret;
  AV *av;
  I32 i;

  if (!arg || !SvOK (arg) || !SvROK (arg) || SvTYPE (SvRV (arg)) != SVt_PVAV)
    croak ("array reference expected");

  av = (AV *)SvRV (arg);
  ret = malloc ((av_len (av) + 1 + 1) * sizeof (char *));
  if (!ret)
    croak ("malloc failed");

  for (i = 0; i <= av_len (av); i++) {
    SV **elem = av_fetch (av, i, 0);

    if (!elem || !*elem) {
      free (ret);
      croak ("missing element in list");
    }

    ret[i] = SvPV_nolen (*elem);
  }

  ret[i] = NULL;

  return ret;
}

/* http://www.perlmonks.org/?node=338857 */
static void
_event_callback_wrapper (guestfs_h *g,
                         void *cb,
                         uint64_t event,
                         int event_handle,
                         int flags,
                         const char *buf, size_t buf_len,
                         const uint64_t *array, size_t array_len)
{
  dSP;
  ENTER;
  SAVETMPS;
  PUSHMARK (SP);
  XPUSHs (sv_2mortal (my_newSVull (event)));
  XPUSHs (sv_2mortal (newSViv (event_handle)));
  XPUSHs (sv_2mortal (newSVpvn (buf ? buf : "", buf_len)));
  AV *av = newAV ();
  size_t i;
  for (i = 0; i < array_len; ++i)
    av_push (av, my_newSVull (array[i]));
  XPUSHs (sv_2mortal (newRV ((SV *) av)));
  PUTBACK;
  call_sv ((SV *) cb, G_VOID | G_DISCARD | G_EVAL);
  FREETMPS;
  LEAVE;
}

static SV **
get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
{
  SV **r;
  size_t i;
  const char *key;
  SV *cb;

  /* Count the length of the array that will be needed. */
  *len_rtn = 0;
  cb = guestfs_first_private (g, &key);
  while (cb != NULL) {
    if (strncmp (key, "_perl_event_", strlen ("_perl_event_")) == 0)
      (*len_rtn)++;
    cb = guestfs_next_private (g, &key);
  }

  /* Copy them into the return array. */
  r = malloc (sizeof (SV *) * (*len_rtn));
  if (r == NULL) croak ("malloc: %m");

  i = 0;
  cb = guestfs_first_private (g, &key);
  while (cb != NULL) {
    if (strncmp (key, "_perl_event_", strlen ("_perl_event_")) == 0) {
      r[i] = cb;
      i++;
    }
    cb = guestfs_next_private (g, &key);
  }

  return r;
}

static void
_close_handle (guestfs_h *g)
{
  size_t i, len;
  SV **cbs;

  assert (g != NULL);

  /* As in the OCaml bindings, there is a hard to solve case where the
   * caller can delete a callback from within the callback, resulting
   * in a double-free here.  XXX
   */
  cbs = get_all_event_callbacks (g, &len);

  guestfs_close (g);

  for (i = 0; i < len; ++i)
    SvREFCNT_dec (cbs[i]);
  free (cbs);
}

#line 218 "lib/Sys/Guestfs.c"
#ifndef PERL_UNUSED_VAR
#  define PERL_UNUSED_VAR(var) if (0) var = var
#endif

#ifndef dVAR
#  define dVAR		dNOOP
#endif


/* This stuff is not part of the API! You have been warned. */
#ifndef PERL_VERSION_DECIMAL
#  define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
#endif
#ifndef PERL_DECIMAL_VERSION
#  define PERL_DECIMAL_VERSION \
	  PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
#endif
#ifndef PERL_VERSION_GE
#  define PERL_VERSION_GE(r,v,s) \
	  (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
#endif
#ifndef PERL_VERSION_LE
#  define PERL_VERSION_LE(r,v,s) \
	  (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
#endif

/* XS_INTERNAL is the explicit static-linkage variant of the default
 * XS macro.
 *
 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
 * "STATIC", ie. it exports XSUB symbols. You probably don't want that
 * for anything but the BOOT XSUB.
 *
 * See XSUB.h in core!
 */


/* TODO: This might be compatible further back than 5.10.0. */
#if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
#  undef XS_EXTERNAL
#  undef XS_INTERNAL
#  if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
#    define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
#    define XS_INTERNAL(name) STATIC XSPROTO(name)
#  endif
#  if defined(__SYMBIAN32__)
#    define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
#    define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
#  endif
#  ifndef XS_EXTERNAL
#    if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
#      define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
#      define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
#    else
#      ifdef __cplusplus
#        define XS_EXTERNAL(name) extern "C" XSPROTO(name)
#        define XS_INTERNAL(name) static XSPROTO(name)
#      else
#        define XS_EXTERNAL(name) XSPROTO(name)
#        define XS_INTERNAL(name) STATIC XSPROTO(name)
#      endif
#    endif
#  endif
#endif

/* perl >= 5.10.0 && perl <= 5.15.1 */


/* The XS_EXTERNAL macro is used for functions that must not be static
 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
 * macro defined, the best we can do is assume XS is the same.
 * Dito for XS_INTERNAL.
 */
#ifndef XS_EXTERNAL
#  define XS_EXTERNAL(name) XS(name)
#endif
#ifndef XS_INTERNAL
#  define XS_INTERNAL(name) XS(name)
#endif

/* Now, finally, after all this mess, we want an ExtUtils::ParseXS
 * internal macro that we're free to redefine for varying linkage due
 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
 */

#undef XS_EUPXS
#if defined(PERL_EUPXS_ALWAYS_EXPORT)
#  define XS_EUPXS(name) XS_EXTERNAL(name)
#else
   /* default to internal */
#  define XS_EUPXS(name) XS_INTERNAL(name)
#endif

#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)

/* prototype to pass -Wmissing-prototypes */
STATIC void
S_croak_xs_usage(const CV *const cv, const char *const params);

STATIC void
S_croak_xs_usage(const CV *const cv, const char *const params)
{
    const GV *const gv = CvGV(cv);

    PERL_ARGS_ASSERT_CROAK_XS_USAGE;

    if (gv) {
        const char *const gvname = GvNAME(gv);
        const HV *const stash = GvSTASH(gv);
        const char *const hvname = stash ? HvNAME(stash) : NULL;

        if (hvname)
	    Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
        else
	    Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
    } else {
        /* Pants. I don't think that it should be possible to get here. */
	Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
    }
}
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE

#define croak_xs_usage        S_croak_xs_usage

#endif

/* NOTE: the prototype of newXSproto() is different in versions of perls,
 * so we define a portable version of newXSproto()
 */
#ifdef newXS_flags
#define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
#else
#define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
#endif /* !defined(newXS_flags) */

#if PERL_VERSION_LE(5, 21, 5)
#  define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file)
#else
#  define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
#endif

/* simple backcompat versions of the TARGx() macros with no optimisation */
#ifndef TARGi
#  define TARGi(iv, do_taint) sv_setiv_mg(TARG, iv)
#  define TARGu(uv, do_taint) sv_setuv_mg(TARG, uv)
#  define TARGn(nv, do_taint) sv_setnv_mg(TARG, nv)
#endif

#line 369 "lib/Sys/Guestfs.c"

XS_EUPXS(XS_Sys__Guestfs__create); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs__create)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "flags");
    {
	unsigned	flags = (unsigned)SvUV(ST(0))
;
	guestfs_h *	RETVAL;
	dXSTARG;
#line 216 "lib/Sys/Guestfs.xs"
      RETVAL = guestfs_create_flags (flags);
      if (!RETVAL)
        croak ("could not create guestfs handle");
      guestfs_set_error_handler (RETVAL, NULL, NULL);
#line 387 "lib/Sys/Guestfs.c"
    sv_setiv (TARG, PTR2IV (RETVAL));
	ST(0) = TARG;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_DESTROY); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_DESTROY)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "sv");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	SV *	sv = ST(0)
;
#line 227 "lib/Sys/Guestfs.xs"
      /* For the 'g' argument above we do the conversion explicitly and
       * don't rely on the typemap, because if the handle has been
       * explicitly closed we don't want the typemap conversion to
       * display an error.
       */
      HV *hv = (HV *) SvRV (sv);
      SV **svp = hv_fetch (hv, "_g", 2, 0);
      if (svp != NULL) {
        guestfs_h *g = INT2PTR (guestfs_h *, SvIV (*svp));
        _close_handle (g);
      }
#line 418 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_close); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_close)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::close(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::close(): g is not a blessed HV reference");
    }
;
#line 243 "lib/Sys/Guestfs.xs"
      _close_handle (g);
      /* Avoid double-free in DESTROY method. */
      HV *hv = (HV *) SvRV (ST(0));
      (void) hv_delete (hv, "_g", 2, G_DISCARD);
#line 453 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_event_callback); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_event_callback)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, cb, event_bitmask");
    {
	guestfs_h *	g;
	SV *	cb = ST(1)
;
	int	event_bitmask = (int)SvIV(ST(2))
;
#line 254 "lib/Sys/Guestfs.xs"
      int eh;
      char key[64];
#line 475 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_event_callback(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_event_callback(): g is not a blessed HV reference");
    }
;
#line 257 "lib/Sys/Guestfs.xs"
      eh = guestfs_set_event_callback (g, _event_callback_wrapper,
                                       event_bitmask, 0, cb);
      if (eh == -1)
        croak ("%s", guestfs_last_error (g));

      /* Increase the refcount for this callback, since we are storing
       * it in the opaque C libguestfs handle.  We need to remember that
       * we did this, so we can decrease the refcount for all undeleted
       * callbacks left around at close time (see _close_handle).
       */
      SvREFCNT_inc (cb);

      snprintf (key, sizeof key, "_perl_event_%d", eh);
      guestfs_set_private (g, key, cb);

      RETVAL = newSViv (eh);
#line 507 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_delete_event_callback); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_delete_event_callback)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, event_handle");
    {
	guestfs_h *	g;
	int	event_handle = (int)SvIV(ST(1))
;
#line 281 "lib/Sys/Guestfs.xs"
      char key[64];
      SV *cb;
#line 528 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::delete_event_callback(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::delete_event_callback(): g is not a blessed HV reference");
    }
;
#line 284 "lib/Sys/Guestfs.xs"
      snprintf (key, sizeof key, "_perl_event_%d", event_handle);
      cb = guestfs_get_private (g, key);
      if (cb) {
        SvREFCNT_dec (cb);
        guestfs_set_private (g, key, NULL);
        guestfs_delete_event_callback (g, event_handle);
      }
#line 550 "lib/Sys/Guestfs.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_Sys__Guestfs_event_to_string); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_event_to_string)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "event_bitmask");
    {
	int	event_bitmask = (int)SvIV(ST(0))
;
#line 296 "lib/Sys/Guestfs.xs"
      char *str;
#line 567 "lib/Sys/Guestfs.c"
	SV *	RETVAL;
#line 298 "lib/Sys/Guestfs.xs"
      str = guestfs_event_to_string (event_bitmask);
      if (str == NULL)
        croak ("%m");
      RETVAL = newSVpv (str, 0);
      free (str);
#line 575 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_last_errno); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_last_errno)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 310 "lib/Sys/Guestfs.xs"
      int errnum;
#line 593 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::last_errno(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::last_errno(): g is not a blessed HV reference");
    }
;
#line 312 "lib/Sys/Guestfs.xs"
      errnum = guestfs_last_errno (g);
      RETVAL = newSViv (errnum);
#line 611 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_acl_delete_def_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_acl_delete_def_file)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, dir");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	dir = (char *)SvPV_nolen(ST(1))
;
#line 322 "lib/Sys/Guestfs.xs"
      int r;
#line 633 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::acl_delete_def_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::acl_delete_def_file(): g is not a blessed HV reference");
    }
;
#line 324 "lib/Sys/Guestfs.xs"
      r = guestfs_acl_delete_def_file (g, dir);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 651 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_acl_get_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_acl_get_file)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, acltype");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	char *	acltype = (char *)SvPV_nolen(ST(2))
;
#line 334 "lib/Sys/Guestfs.xs"
      char *r;
#line 672 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::acl_get_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::acl_get_file(): g is not a blessed HV reference");
    }
;
#line 336 "lib/Sys/Guestfs.xs"
      r = guestfs_acl_get_file (g, path, acltype);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 693 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_acl_set_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_acl_set_file)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, path, acltype, acl");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	char *	acltype = (char *)SvPV_nolen(ST(2))
;
	char *	acl = (char *)SvPV_nolen(ST(3))
;
#line 351 "lib/Sys/Guestfs.xs"
      int r;
#line 719 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::acl_set_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::acl_set_file(): g is not a blessed HV reference");
    }
;
#line 353 "lib/Sys/Guestfs.xs"
      r = guestfs_acl_set_file (g, path, acltype, acl);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 737 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_add_cdrom); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_add_cdrom)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, filename");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
#line 362 "lib/Sys/Guestfs.xs"
      int r;
#line 758 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::add_cdrom(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::add_cdrom(): g is not a blessed HV reference");
    }
;
#line 364 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::add_cdrom is deprecated; use Sys::Guestfs::add_drive_ro instead");
      r = guestfs_add_cdrom (g, filename);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 778 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_add_domain); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_add_domain)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, dom, ...");
    {
	guestfs_h *	g;
	char *	dom = (char *)SvPV_nolen(ST(1))
;
#line 375 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_add_domain_argv optargs_s = { .bitmask = 0 };
      struct guestfs_add_domain_argv *optargs = &optargs_s;
      size_t items_i;
#line 800 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::add_domain(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::add_domain(): g is not a blessed HV reference");
    }
;
#line 380 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "libvirturi")) {
          optargs_s.libvirturi = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DOMAIN_LIBVIRTURI_BITMASK;
        }
        else if (STREQ (this_arg, "readonly")) {
          optargs_s.readonly = SvIV (ST (items_i+1));
          this_mask = GUESTFS_ADD_DOMAIN_READONLY_BITMASK;
        }
        else if (STREQ (this_arg, "iface")) {
          optargs_s.iface = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DOMAIN_IFACE_BITMASK;
        }
        else if (STREQ (this_arg, "live")) {
          optargs_s.live = SvIV (ST (items_i+1));
          this_mask = GUESTFS_ADD_DOMAIN_LIVE_BITMASK;
        }
        else if (STREQ (this_arg, "allowuuid")) {
          optargs_s.allowuuid = SvIV (ST (items_i+1));
          this_mask = GUESTFS_ADD_DOMAIN_ALLOWUUID_BITMASK;
        }
        else if (STREQ (this_arg, "readonlydisk")) {
          optargs_s.readonlydisk = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DOMAIN_READONLYDISK_BITMASK;
        }
        else if (STREQ (this_arg, "cachemode")) {
          optargs_s.cachemode = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DOMAIN_CACHEMODE_BITMASK;
        }
        else if (STREQ (this_arg, "discard")) {
          optargs_s.discard = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DOMAIN_DISCARD_BITMASK;
        }
        else if (STREQ (this_arg, "copyonread")) {
          optargs_s.copyonread = SvIV (ST (items_i+1));
          this_mask = GUESTFS_ADD_DOMAIN_COPYONREAD_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_add_domain_argv (g, dom, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 870 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_add_drive); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_add_drive)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, filename, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
#line 442 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_add_drive_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_add_drive_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 895 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::add_drive(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::add_drive(): g is not a blessed HV reference");
    }
;
#line 447 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "readonly")) {
          optargs_s.readonly = SvIV (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK;
        }
        else if (STREQ (this_arg, "format")) {
          optargs_s.format = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK;
        }
        else if (STREQ (this_arg, "iface")) {
          optargs_s.iface = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_OPTS_IFACE_BITMASK;
        }
        else if (STREQ (this_arg, "name")) {
          optargs_s.name = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_OPTS_NAME_BITMASK;
        }
        else if (STREQ (this_arg, "label")) {
          optargs_s.label = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_OPTS_LABEL_BITMASK;
        }
        else if (STREQ (this_arg, "protocol")) {
          optargs_s.protocol = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_OPTS_PROTOCOL_BITMASK;
        }
        else if (STREQ (this_arg, "server")) {
          size_t i, len;
          char **r;
          SV *arg;
          AV *av;
          SV **svp;

          arg = ST (items_i+1);
          if (!SvROK (arg) || SvTYPE (SvRV (arg)) != SVt_PVAV)
            croak ("array reference expected for '%s' argument", "server");
          av = (AV *) SvRV (ST (items_i+1));

          /* Note av_len returns index of final element. */
          len = av_len (av) + 1;

          r = malloc ((len+1) * sizeof (char *));
          if (r == NULL) croak ("malloc: %m");
          for (i = 0; i < len; ++i) {
            svp = av_fetch (av, i, 0);
            r[i] = SvPV_nolen (*svp);
          }
          r[i] = NULL;
          optargs_s.server = r;
          this_mask = GUESTFS_ADD_DRIVE_OPTS_SERVER_BITMASK;
        }
        else if (STREQ (this_arg, "username")) {
          optargs_s.username = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_OPTS_USERNAME_BITMASK;
        }
        else if (STREQ (this_arg, "secret")) {
          optargs_s.secret = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_OPTS_SECRET_BITMASK;
        }
        else if (STREQ (this_arg, "cachemode")) {
          optargs_s.cachemode = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_OPTS_CACHEMODE_BITMASK;
        }
        else if (STREQ (this_arg, "discard")) {
          optargs_s.discard = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_OPTS_DISCARD_BITMASK;
        }
        else if (STREQ (this_arg, "copyonread")) {
          optargs_s.copyonread = SvIV (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_OPTS_COPYONREAD_BITMASK;
        }
        else if (STREQ (this_arg, "blocksize")) {
          optargs_s.blocksize = SvIV (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_OPTS_BLOCKSIZE_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_add_drive_opts_argv (g, filename, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 1000 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_add_drive_ro); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_add_drive_ro)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, filename");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
#line 543 "lib/Sys/Guestfs.xs"
      int r;
#line 1021 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::add_drive_ro(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::add_drive_ro(): g is not a blessed HV reference");
    }
;
#line 545 "lib/Sys/Guestfs.xs"
      r = guestfs_add_drive_ro (g, filename);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 1039 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_add_drive_ro_with_if); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_add_drive_ro_with_if)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, filename, iface");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
	char *	iface = (char *)SvPV_nolen(ST(2))
;
#line 555 "lib/Sys/Guestfs.xs"
      int r;
#line 1062 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::add_drive_ro_with_if(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::add_drive_ro_with_if(): g is not a blessed HV reference");
    }
;
#line 557 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::add_drive_ro_with_if is deprecated; use Sys::Guestfs::add_drive instead");
      r = guestfs_add_drive_ro_with_if (g, filename, iface);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 1082 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_add_drive_scratch); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_add_drive_scratch)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, size, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int64_t	size = my_SvIV64 (ST(1))
;
#line 568 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_add_drive_scratch_argv optargs_s = { .bitmask = 0 };
      struct guestfs_add_drive_scratch_argv *optargs = &optargs_s;
      size_t items_i;
#line 1106 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::add_drive_scratch(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::add_drive_scratch(): g is not a blessed HV reference");
    }
;
#line 573 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "name")) {
          optargs_s.name = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_SCRATCH_NAME_BITMASK;
        }
        else if (STREQ (this_arg, "label")) {
          optargs_s.label = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_SCRATCH_LABEL_BITMASK;
        }
        else if (STREQ (this_arg, "blocksize")) {
          optargs_s.blocksize = SvIV (ST (items_i+1));
          this_mask = GUESTFS_ADD_DRIVE_SCRATCH_BLOCKSIZE_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_add_drive_scratch_argv (g, size, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 1150 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_add_drive_with_if); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_add_drive_with_if)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, filename, iface");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
	char *	iface = (char *)SvPV_nolen(ST(2))
;
#line 609 "lib/Sys/Guestfs.xs"
      int r;
#line 1173 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::add_drive_with_if(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::add_drive_with_if(): g is not a blessed HV reference");
    }
;
#line 611 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::add_drive_with_if is deprecated; use Sys::Guestfs::add_drive instead");
      r = guestfs_add_drive_with_if (g, filename, iface);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 1193 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_add_libvirt_dom); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_add_libvirt_dom)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, dom, ...");
    {
	guestfs_h *	g;
	void * /* virDomainPtr */	dom;
#line 622 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_add_libvirt_dom_argv optargs_s = { .bitmask = 0 };
      struct guestfs_add_libvirt_dom_argv *optargs = &optargs_s;
      size_t items_i;
#line 1214 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::add_libvirt_dom(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::add_libvirt_dom(): g is not a blessed HV reference");
    }
;

    /* This is copied directly from the Sys::Virt typemap.  Dan has assured
     * me that he doesn't intend to change this implementation!
     */
    if (sv_isobject (ST(1)) && SvTYPE (SvRV (ST(1))) == SVt_PVMG)
        dom = INT2PTR (void *, SvIV ((SV*) SvRV (ST(1))));
    else {
        warn ("Sys::Guestfs::add_libvirt_dom() -- dom is not a blessed SV reference");
        XSRETURN_UNDEF;
    }
;
#line 627 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "readonly")) {
          optargs_s.readonly = SvIV (ST (items_i+1));
          this_mask = GUESTFS_ADD_LIBVIRT_DOM_READONLY_BITMASK;
        }
        else if (STREQ (this_arg, "iface")) {
          optargs_s.iface = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_LIBVIRT_DOM_IFACE_BITMASK;
        }
        else if (STREQ (this_arg, "live")) {
          optargs_s.live = SvIV (ST (items_i+1));
          this_mask = GUESTFS_ADD_LIBVIRT_DOM_LIVE_BITMASK;
        }
        else if (STREQ (this_arg, "readonlydisk")) {
          optargs_s.readonlydisk = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_LIBVIRT_DOM_READONLYDISK_BITMASK;
        }
        else if (STREQ (this_arg, "cachemode")) {
          optargs_s.cachemode = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_LIBVIRT_DOM_CACHEMODE_BITMASK;
        }
        else if (STREQ (this_arg, "discard")) {
          optargs_s.discard = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_ADD_LIBVIRT_DOM_DISCARD_BITMASK;
        }
        else if (STREQ (this_arg, "copyonread")) {
          optargs_s.copyonread = SvIV (ST (items_i+1));
          this_mask = GUESTFS_ADD_LIBVIRT_DOM_COPYONREAD_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_add_libvirt_dom_argv (g, dom, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 1287 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_aug_clear); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_clear)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, augpath");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	augpath = (char *)SvPV_nolen(ST(1))
;
#line 681 "lib/Sys/Guestfs.xs"
      int r;
#line 1309 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_clear(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_clear(): g is not a blessed HV reference");
    }
;
#line 683 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_clear (g, augpath);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 1327 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_aug_close); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_close)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 691 "lib/Sys/Guestfs.xs"
      int r;
#line 1346 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_close(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_close(): g is not a blessed HV reference");
    }
;
#line 693 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_close (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 1364 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_aug_defnode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_defnode)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, name, expr, val");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	name = (char *)SvPV_nolen(ST(1))
;
	char *	expr = (char *)SvPV_nolen(ST(2))
;
	char *	val = (char *)SvPV_nolen(ST(3))
;
#line 704 "lib/Sys/Guestfs.xs"
      struct guestfs_int_bool *r;
#line 1389 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_defnode(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_defnode(): g is not a blessed HV reference");
    }
;
#line 706 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_defnode (g, name, expr, val);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 2);
      PUSHs (sv_2mortal (newSVpv ("i", 0)));
      PUSHs (sv_2mortal (newSVnv (r->i)));
      PUSHs (sv_2mortal (newSVpv ("b", 0)));
      PUSHs (sv_2mortal (newSVnv (r->b)));
      guestfs_free_int_bool (r);
#line 1413 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_aug_defvar); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_defvar)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, name, expr");
    {
	guestfs_h *	g;
	char *	name = (char *)SvPV_nolen(ST(1))
;
	char *	expr = SvOK(ST(2)) ? SvPV_nolen(ST(2)) : NULL;
#line 722 "lib/Sys/Guestfs.xs"
      int r;
#line 1433 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_defvar(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_defvar(): g is not a blessed HV reference");
    }
;
#line 724 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_defvar (g, name, expr);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 1453 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_aug_get); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_get)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, augpath");
    {
	guestfs_h *	g;
	char *	augpath = (char *)SvPV_nolen(ST(1))
;
#line 736 "lib/Sys/Guestfs.xs"
      char *r;
#line 1473 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_get(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_get(): g is not a blessed HV reference");
    }
;
#line 738 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_get (g, augpath);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 1494 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_aug_init); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_init)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, root, flags");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
	int	flags = (int)SvIV(ST(2))
;
#line 752 "lib/Sys/Guestfs.xs"
      int r;
#line 1518 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_init(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_init(): g is not a blessed HV reference");
    }
;
#line 754 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_init (g, root, flags);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 1536 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_aug_insert); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_insert)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, augpath, label, before");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	augpath = (char *)SvPV_nolen(ST(1))
;
	char *	label = (char *)SvPV_nolen(ST(2))
;
	int	before = (int)SvIV(ST(3))
;
#line 765 "lib/Sys/Guestfs.xs"
      int r;
#line 1561 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_insert(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_insert(): g is not a blessed HV reference");
    }
;
#line 767 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_insert (g, augpath, label, before);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 1579 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_aug_label); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_label)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, augpath");
    {
	guestfs_h *	g;
	char *	augpath = (char *)SvPV_nolen(ST(1))
;
#line 776 "lib/Sys/Guestfs.xs"
      char *r;
#line 1598 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_label(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_label(): g is not a blessed HV reference");
    }
;
#line 778 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_label (g, augpath);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 1619 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_aug_load); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_load)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 790 "lib/Sys/Guestfs.xs"
      int r;
#line 1639 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_load(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_load(): g is not a blessed HV reference");
    }
;
#line 792 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_load (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 1657 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_aug_ls); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_ls)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, augpath");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	augpath = (char *)SvPV_nolen(ST(1))
;
#line 801 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 1679 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_ls(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_ls(): g is not a blessed HV reference");
    }
;
#line 804 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_ls (g, augpath);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 1704 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_aug_match); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_match)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, augpath");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	augpath = (char *)SvPV_nolen(ST(1))
;
#line 820 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 1726 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_match(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_match(): g is not a blessed HV reference");
    }
;
#line 823 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_match (g, augpath);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 1751 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_aug_mv); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_mv)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, src, dest");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
#line 840 "lib/Sys/Guestfs.xs"
      int r;
#line 1774 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_mv(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_mv(): g is not a blessed HV reference");
    }
;
#line 842 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_mv (g, src, dest);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 1792 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_aug_rm); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_rm)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, augpath");
    {
	guestfs_h *	g;
	char *	augpath = (char *)SvPV_nolen(ST(1))
;
#line 851 "lib/Sys/Guestfs.xs"
      int r;
#line 1811 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_rm(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_rm(): g is not a blessed HV reference");
    }
;
#line 853 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_rm (g, augpath);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 1831 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_aug_save); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_save)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 864 "lib/Sys/Guestfs.xs"
      int r;
#line 1851 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_save(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_save(): g is not a blessed HV reference");
    }
;
#line 866 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_save (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 1869 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_aug_set); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_set)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, augpath, val");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	augpath = (char *)SvPV_nolen(ST(1))
;
	char *	val = (char *)SvPV_nolen(ST(2))
;
#line 876 "lib/Sys/Guestfs.xs"
      int r;
#line 1892 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_set(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_set(): g is not a blessed HV reference");
    }
;
#line 878 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_set (g, augpath, val);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 1910 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_aug_setm); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_setm)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, base, sub, val");
    {
	guestfs_h *	g;
	char *	base = (char *)SvPV_nolen(ST(1))
;
	char *	sub = SvOK(ST(2)) ? SvPV_nolen(ST(2)) : NULL;
	char *	val = (char *)SvPV_nolen(ST(3))
;
#line 889 "lib/Sys/Guestfs.xs"
      int r;
#line 1932 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_setm(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_setm(): g is not a blessed HV reference");
    }
;
#line 891 "lib/Sys/Guestfs.xs"
      r = guestfs_aug_setm (g, base, sub, val);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 1952 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_aug_transform); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_aug_transform)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, lens, file, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	lens = (char *)SvPV_nolen(ST(1))
;
	char *	file = (char *)SvPV_nolen(ST(2))
;
#line 904 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_aug_transform_argv optargs_s = { .bitmask = 0 };
      struct guestfs_aug_transform_argv *optargs = &optargs_s;
      size_t items_i;
#line 1979 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::aug_transform(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::aug_transform(): g is not a blessed HV reference");
    }
;
#line 909 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "remove")) {
          optargs_s.remove = SvIV (ST (items_i+1));
          this_mask = GUESTFS_AUG_TRANSFORM_REMOVE_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_aug_transform_argv (g, lens, file, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2015 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_available); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_available)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, groups");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char **	groups = XS_unpack_charPtrPtr(ST(1))
;
#line 936 "lib/Sys/Guestfs.xs"
      int r;
#line 2036 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::available(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::available(): g is not a blessed HV reference");
    }
;
#line 938 "lib/Sys/Guestfs.xs"
      r = guestfs_available (g, groups);
      free (groups);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2055 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_available_all_groups); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_available_all_groups)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 947 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 2075 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::available_all_groups(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::available_all_groups(): g is not a blessed HV reference");
    }
;
#line 950 "lib/Sys/Guestfs.xs"
      r = guestfs_available_all_groups (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 2100 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_base64_in); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_base64_in)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, base64file, filename");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	base64file = (char *)SvPV_nolen(ST(1))
;
	char *	filename = (char *)SvPV_nolen(ST(2))
;
#line 967 "lib/Sys/Guestfs.xs"
      int r;
#line 2123 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::base64_in(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::base64_in(): g is not a blessed HV reference");
    }
;
#line 969 "lib/Sys/Guestfs.xs"
      r = guestfs_base64_in (g, base64file, filename);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2141 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_base64_out); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_base64_out)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, filename, base64file");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
	char *	base64file = (char *)SvPV_nolen(ST(2))
;
#line 979 "lib/Sys/Guestfs.xs"
      int r;
#line 2164 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::base64_out(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::base64_out(): g is not a blessed HV reference");
    }
;
#line 981 "lib/Sys/Guestfs.xs"
      r = guestfs_base64_out (g, filename, base64file);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2182 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_blkdiscard); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_blkdiscard)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 990 "lib/Sys/Guestfs.xs"
      int r;
#line 2203 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::blkdiscard(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::blkdiscard(): g is not a blessed HV reference");
    }
;
#line 992 "lib/Sys/Guestfs.xs"
      r = guestfs_blkdiscard (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2221 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_blkdiscardzeroes); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_blkdiscardzeroes)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1001 "lib/Sys/Guestfs.xs"
      int r;
#line 2240 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::blkdiscardzeroes(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::blkdiscardzeroes(): g is not a blessed HV reference");
    }
;
#line 1003 "lib/Sys/Guestfs.xs"
      r = guestfs_blkdiscardzeroes (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 2260 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_blkid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_blkid)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1015 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 2283 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::blkid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::blkid(): g is not a blessed HV reference");
    }
;
#line 1018 "lib/Sys/Guestfs.xs"
      r = guestfs_blkid (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 2308 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_blockdev_flushbufs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_blockdev_flushbufs)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1034 "lib/Sys/Guestfs.xs"
      int r;
#line 2329 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::blockdev_flushbufs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::blockdev_flushbufs(): g is not a blessed HV reference");
    }
;
#line 1036 "lib/Sys/Guestfs.xs"
      r = guestfs_blockdev_flushbufs (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2347 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_blockdev_getbsz); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_blockdev_getbsz)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1045 "lib/Sys/Guestfs.xs"
      int r;
#line 2366 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::blockdev_getbsz(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::blockdev_getbsz(): g is not a blessed HV reference");
    }
;
#line 1047 "lib/Sys/Guestfs.xs"
      r = guestfs_blockdev_getbsz (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 2386 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_blockdev_getro); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_blockdev_getro)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1059 "lib/Sys/Guestfs.xs"
      int r;
#line 2406 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::blockdev_getro(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::blockdev_getro(): g is not a blessed HV reference");
    }
;
#line 1061 "lib/Sys/Guestfs.xs"
      r = guestfs_blockdev_getro (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 2426 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_blockdev_getsize64); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_blockdev_getsize64)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1073 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 2446 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::blockdev_getsize64(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::blockdev_getsize64(): g is not a blessed HV reference");
    }
;
#line 1075 "lib/Sys/Guestfs.xs"
      r = guestfs_blockdev_getsize64 (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 2466 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_blockdev_getss); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_blockdev_getss)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1087 "lib/Sys/Guestfs.xs"
      int r;
#line 2486 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::blockdev_getss(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::blockdev_getss(): g is not a blessed HV reference");
    }
;
#line 1089 "lib/Sys/Guestfs.xs"
      r = guestfs_blockdev_getss (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 2506 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_blockdev_getsz); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_blockdev_getsz)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1101 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 2526 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::blockdev_getsz(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::blockdev_getsz(): g is not a blessed HV reference");
    }
;
#line 1103 "lib/Sys/Guestfs.xs"
      r = guestfs_blockdev_getsz (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 2546 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_blockdev_rereadpt); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_blockdev_rereadpt)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1115 "lib/Sys/Guestfs.xs"
      int r;
#line 2568 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::blockdev_rereadpt(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::blockdev_rereadpt(): g is not a blessed HV reference");
    }
;
#line 1117 "lib/Sys/Guestfs.xs"
      r = guestfs_blockdev_rereadpt (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2586 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_blockdev_setbsz); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_blockdev_setbsz)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, blocksize");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	blocksize = (int)SvIV(ST(2))
;
#line 1127 "lib/Sys/Guestfs.xs"
      int r;
#line 2609 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::blockdev_setbsz(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::blockdev_setbsz(): g is not a blessed HV reference");
    }
;
#line 1129 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::blockdev_setbsz is deprecated");
      r = guestfs_blockdev_setbsz (g, device, blocksize);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2629 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_blockdev_setra); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_blockdev_setra)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, sectors");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	sectors = (int)SvIV(ST(2))
;
#line 1141 "lib/Sys/Guestfs.xs"
      int r;
#line 2652 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::blockdev_setra(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::blockdev_setra(): g is not a blessed HV reference");
    }
;
#line 1143 "lib/Sys/Guestfs.xs"
      r = guestfs_blockdev_setra (g, device, sectors);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2670 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_blockdev_setro); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_blockdev_setro)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1152 "lib/Sys/Guestfs.xs"
      int r;
#line 2691 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::blockdev_setro(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::blockdev_setro(): g is not a blessed HV reference");
    }
;
#line 1154 "lib/Sys/Guestfs.xs"
      r = guestfs_blockdev_setro (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2709 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_blockdev_setrw); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_blockdev_setrw)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1163 "lib/Sys/Guestfs.xs"
      int r;
#line 2730 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::blockdev_setrw(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::blockdev_setrw(): g is not a blessed HV reference");
    }
;
#line 1165 "lib/Sys/Guestfs.xs"
      r = guestfs_blockdev_setrw (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2748 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_balance_cancel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_balance_cancel)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 1174 "lib/Sys/Guestfs.xs"
      int r;
#line 2769 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_balance_cancel(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_balance_cancel(): g is not a blessed HV reference");
    }
;
#line 1176 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_balance_cancel (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2787 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_balance_pause); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_balance_pause)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 1185 "lib/Sys/Guestfs.xs"
      int r;
#line 2808 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_balance_pause(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_balance_pause(): g is not a blessed HV reference");
    }
;
#line 1187 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_balance_pause (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2826 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_balance_resume); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_balance_resume)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 1196 "lib/Sys/Guestfs.xs"
      int r;
#line 2847 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_balance_resume(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_balance_resume(): g is not a blessed HV reference");
    }
;
#line 1198 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_balance_resume (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2865 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_balance_status); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_balance_status)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 1207 "lib/Sys/Guestfs.xs"
      struct guestfs_btrfsbalance *r;
#line 2886 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_balance_status(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_balance_status(): g is not a blessed HV reference");
    }
;
#line 1209 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_balance_status (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 5);
      PUSHs (sv_2mortal (newSVpv ("btrfsbalance_status", 0)));
      PUSHs (sv_2mortal (newSVpv (r->btrfsbalance_status, 0)));
      PUSHs (sv_2mortal (newSVpv ("btrfsbalance_total", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsbalance_total)));
      PUSHs (sv_2mortal (newSVpv ("btrfsbalance_balanced", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsbalance_balanced)));
      PUSHs (sv_2mortal (newSVpv ("btrfsbalance_considered", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsbalance_considered)));
      PUSHs (sv_2mortal (newSVpv ("btrfsbalance_left", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsbalance_left)));
      guestfs_free_btrfsbalance (r);
#line 2916 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_device_add); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_device_add)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, devices, fs");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char **	devices = XS_unpack_charPtrPtr(ST(1))
;
	char *	fs = (char *)SvPV_nolen(ST(2))
;
#line 1231 "lib/Sys/Guestfs.xs"
      int r;
#line 2939 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_device_add(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_device_add(): g is not a blessed HV reference");
    }
;
#line 1233 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_device_add (g, devices, fs);
      free (devices);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 2958 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_device_delete); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_device_delete)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, devices, fs");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char **	devices = XS_unpack_charPtrPtr(ST(1))
;
	char *	fs = (char *)SvPV_nolen(ST(2))
;
#line 1244 "lib/Sys/Guestfs.xs"
      int r;
#line 2981 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_device_delete(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_device_delete(): g is not a blessed HV reference");
    }
;
#line 1246 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_device_delete (g, devices, fs);
      free (devices);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3000 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_filesystem_balance); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_filesystem_balance)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, fs");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	fs = (char *)SvPV_nolen(ST(1))
;
#line 1256 "lib/Sys/Guestfs.xs"
      int r;
#line 3021 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_filesystem_balance(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_filesystem_balance(): g is not a blessed HV reference");
    }
;
#line 1258 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_filesystem_balance (g, fs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3039 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_filesystem_defragment); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_filesystem_defragment)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, path, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 1267 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_btrfs_filesystem_defragment_argv optargs_s = { .bitmask = 0 };
      struct guestfs_btrfs_filesystem_defragment_argv *optargs = &optargs_s;
      size_t items_i;
#line 3063 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_filesystem_defragment(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_filesystem_defragment(): g is not a blessed HV reference");
    }
;
#line 1272 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "flush")) {
          optargs_s.flush = SvIV (ST (items_i+1));
          this_mask = GUESTFS_BTRFS_FILESYSTEM_DEFRAGMENT_FLUSH_BITMASK;
        }
        else if (STREQ (this_arg, "compress")) {
          optargs_s.compress = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_BTRFS_FILESYSTEM_DEFRAGMENT_COMPRESS_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_btrfs_filesystem_defragment_argv (g, path, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3103 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_filesystem_resize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_filesystem_resize)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, mountpoint, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	mountpoint = (char *)SvPV_nolen(ST(1))
;
#line 1303 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_btrfs_filesystem_resize_argv optargs_s = { .bitmask = 0 };
      struct guestfs_btrfs_filesystem_resize_argv *optargs = &optargs_s;
      size_t items_i;
#line 3127 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_filesystem_resize(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_filesystem_resize(): g is not a blessed HV reference");
    }
;
#line 1308 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "size")) {
          optargs_s.size = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_btrfs_filesystem_resize_argv (g, mountpoint, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3163 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_filesystem_show); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_filesystem_show)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1335 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 3185 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_filesystem_show(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_filesystem_show(): g is not a blessed HV reference");
    }
;
#line 1338 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_filesystem_show (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 3210 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_filesystem_sync); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_filesystem_sync)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, fs");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	fs = (char *)SvPV_nolen(ST(1))
;
#line 1354 "lib/Sys/Guestfs.xs"
      int r;
#line 3231 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_filesystem_sync(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_filesystem_sync(): g is not a blessed HV reference");
    }
;
#line 1356 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_filesystem_sync (g, fs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3249 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_fsck); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_fsck)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, device, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1365 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_btrfs_fsck_argv optargs_s = { .bitmask = 0 };
      struct guestfs_btrfs_fsck_argv *optargs = &optargs_s;
      size_t items_i;
#line 3273 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_fsck(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_fsck(): g is not a blessed HV reference");
    }
;
#line 1370 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::btrfs_fsck is deprecated; use Sys::Guestfs::btrfs_scrub_full instead");
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "superblock")) {
          optargs_s.superblock = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_BTRFS_FSCK_SUPERBLOCK_BITMASK;
        }
        else if (STREQ (this_arg, "repair")) {
          optargs_s.repair = SvIV (ST (items_i+1));
          this_mask = GUESTFS_BTRFS_FSCK_REPAIR_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_btrfs_fsck_argv (g, device, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3315 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_image); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_image)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, source, image, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char **	source = XS_unpack_charPtrPtr(ST(1))
;
	char *	image = (char *)SvPV_nolen(ST(2))
;
#line 1404 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_btrfs_image_argv optargs_s = { .bitmask = 0 };
      struct guestfs_btrfs_image_argv *optargs = &optargs_s;
      size_t items_i;
#line 3341 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_image(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_image(): g is not a blessed HV reference");
    }
;
#line 1409 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "compresslevel")) {
          optargs_s.compresslevel = SvIV (ST (items_i+1));
          this_mask = GUESTFS_BTRFS_IMAGE_COMPRESSLEVEL_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_btrfs_image_argv (g, source, image, optargs);
      free (source);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3378 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_qgroup_assign); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_qgroup_assign)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, src, dst, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dst = (char *)SvPV_nolen(ST(2))
;
	char *	path = (char *)SvPV_nolen(ST(3))
;
#line 1439 "lib/Sys/Guestfs.xs"
      int r;
#line 3403 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_qgroup_assign(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_qgroup_assign(): g is not a blessed HV reference");
    }
;
#line 1441 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_qgroup_assign (g, src, dst, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3421 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_qgroup_create); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_qgroup_create)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, qgroupid, subvolume");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	qgroupid = (char *)SvPV_nolen(ST(1))
;
	char *	subvolume = (char *)SvPV_nolen(ST(2))
;
#line 1451 "lib/Sys/Guestfs.xs"
      int r;
#line 3444 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_qgroup_create(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_qgroup_create(): g is not a blessed HV reference");
    }
;
#line 1453 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_qgroup_create (g, qgroupid, subvolume);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3462 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_qgroup_destroy); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_qgroup_destroy)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, qgroupid, subvolume");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	qgroupid = (char *)SvPV_nolen(ST(1))
;
	char *	subvolume = (char *)SvPV_nolen(ST(2))
;
#line 1463 "lib/Sys/Guestfs.xs"
      int r;
#line 3485 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_qgroup_destroy(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_qgroup_destroy(): g is not a blessed HV reference");
    }
;
#line 1465 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_qgroup_destroy (g, qgroupid, subvolume);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3503 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_qgroup_limit); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_qgroup_limit)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, subvolume, size");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	subvolume = (char *)SvPV_nolen(ST(1))
;
	int64_t	size = my_SvIV64 (ST(2))
;
#line 1475 "lib/Sys/Guestfs.xs"
      int r;
#line 3526 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_qgroup_limit(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_qgroup_limit(): g is not a blessed HV reference");
    }
;
#line 1477 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_qgroup_limit (g, subvolume, size);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3544 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_qgroup_remove); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_qgroup_remove)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, src, dst, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dst = (char *)SvPV_nolen(ST(2))
;
	char *	path = (char *)SvPV_nolen(ST(3))
;
#line 1488 "lib/Sys/Guestfs.xs"
      int r;
#line 3569 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_qgroup_remove(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_qgroup_remove(): g is not a blessed HV reference");
    }
;
#line 1490 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_qgroup_remove (g, src, dst, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3587 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_qgroup_show); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_qgroup_show)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 1499 "lib/Sys/Guestfs.xs"
      struct guestfs_btrfsqgroup_list *r;
      size_t i;
      HV *hv;
#line 3610 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_qgroup_show(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_qgroup_show(): g is not a blessed HV reference");
    }
;
#line 1503 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_qgroup_show (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "btrfsqgroup_id", 14, newSVpv (r->val[i].btrfsqgroup_id, 0), 0);
        (void) hv_store (hv, "btrfsqgroup_rfer", 16, my_newSVull (r->val[i].btrfsqgroup_rfer), 0);
        (void) hv_store (hv, "btrfsqgroup_excl", 16, my_newSVull (r->val[i].btrfsqgroup_excl), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_btrfsqgroup_list (r);
#line 3637 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_quota_enable); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_quota_enable)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, fs, enable");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	fs = (char *)SvPV_nolen(ST(1))
;
	int	enable = (int)SvIV(ST(2))
;
#line 1522 "lib/Sys/Guestfs.xs"
      int r;
#line 3660 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_quota_enable(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_quota_enable(): g is not a blessed HV reference");
    }
;
#line 1524 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_quota_enable (g, fs, enable);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3678 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_quota_rescan); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_quota_rescan)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, fs");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	fs = (char *)SvPV_nolen(ST(1))
;
#line 1533 "lib/Sys/Guestfs.xs"
      int r;
#line 3699 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_quota_rescan(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_quota_rescan(): g is not a blessed HV reference");
    }
;
#line 1535 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_quota_rescan (g, fs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3717 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_replace); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_replace)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, srcdev, targetdev, mntpoint");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	srcdev = (char *)SvPV_nolen(ST(1))
;
	char *	targetdev = (char *)SvPV_nolen(ST(2))
;
	char *	mntpoint = (char *)SvPV_nolen(ST(3))
;
#line 1546 "lib/Sys/Guestfs.xs"
      int r;
#line 3742 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_replace(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_replace(): g is not a blessed HV reference");
    }
;
#line 1548 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_replace (g, srcdev, targetdev, mntpoint);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3760 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_rescue_chunk_recover); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_rescue_chunk_recover)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1557 "lib/Sys/Guestfs.xs"
      int r;
#line 3781 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_rescue_chunk_recover(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_rescue_chunk_recover(): g is not a blessed HV reference");
    }
;
#line 1559 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_rescue_chunk_recover (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3799 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_rescue_super_recover); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_rescue_super_recover)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1568 "lib/Sys/Guestfs.xs"
      int r;
#line 3820 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_rescue_super_recover(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_rescue_super_recover(): g is not a blessed HV reference");
    }
;
#line 1570 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_rescue_super_recover (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3838 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_scrub_cancel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_scrub_cancel)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 1579 "lib/Sys/Guestfs.xs"
      int r;
#line 3859 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_scrub_cancel(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_scrub_cancel(): g is not a blessed HV reference");
    }
;
#line 1581 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_scrub_cancel (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3877 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_scrub_full); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_scrub_full)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, path, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 1590 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_btrfs_scrub_full_argv optargs_s = { .bitmask = 0 };
      struct guestfs_btrfs_scrub_full_argv *optargs = &optargs_s;
      size_t items_i;
#line 3901 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_scrub_full(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_scrub_full(): g is not a blessed HV reference");
    }
;
#line 1595 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "readonly")) {
          optargs_s.readonly = SvIV (ST (items_i+1));
          this_mask = GUESTFS_BTRFS_SCRUB_FULL_READONLY_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_btrfs_scrub_full_argv (g, path, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3937 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_scrub_resume); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_scrub_resume)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 1622 "lib/Sys/Guestfs.xs"
      int r;
#line 3958 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_scrub_resume(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_scrub_resume(): g is not a blessed HV reference");
    }
;
#line 1624 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_scrub_resume (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 3976 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_scrub_start); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_scrub_start)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 1633 "lib/Sys/Guestfs.xs"
      int r;
#line 3997 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_scrub_start(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_scrub_start(): g is not a blessed HV reference");
    }
;
#line 1635 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_scrub_start (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 4015 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_scrub_status); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_scrub_status)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 1644 "lib/Sys/Guestfs.xs"
      struct guestfs_btrfsscrub *r;
#line 4036 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_scrub_status(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_scrub_status(): g is not a blessed HV reference");
    }
;
#line 1646 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_scrub_status (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 15);
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_data_extents_scrubbed", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_data_extents_scrubbed)));
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_tree_extents_scrubbed", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_tree_extents_scrubbed)));
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_data_bytes_scrubbed", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_data_bytes_scrubbed)));
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_tree_bytes_scrubbed", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_tree_bytes_scrubbed)));
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_read_errors", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_read_errors)));
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_csum_errors", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_csum_errors)));
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_verify_errors", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_verify_errors)));
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_no_csum", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_no_csum)));
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_csum_discards", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_csum_discards)));
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_super_errors", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_super_errors)));
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_malloc_errors", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_malloc_errors)));
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_uncorrectable_errors", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_uncorrectable_errors)));
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_unverified_errors", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_unverified_errors)));
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_corrected_errors", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_corrected_errors)));
      PUSHs (sv_2mortal (newSVpv ("btrfsscrub_last_physical", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->btrfsscrub_last_physical)));
      guestfs_free_btrfsscrub (r);
#line 4086 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_set_seeding); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_set_seeding)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, seeding");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	seeding = (int)SvIV(ST(2))
;
#line 1688 "lib/Sys/Guestfs.xs"
      int r;
#line 4109 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_set_seeding(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_set_seeding(): g is not a blessed HV reference");
    }
;
#line 1690 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_set_seeding (g, device, seeding);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 4127 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_subvolume_create); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_subvolume_create)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, dest, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	dest = (char *)SvPV_nolen(ST(1))
;
#line 1699 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_btrfs_subvolume_create_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_btrfs_subvolume_create_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 4151 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_subvolume_create(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_subvolume_create(): g is not a blessed HV reference");
    }
;
#line 1704 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "qgroupid")) {
          optargs_s.qgroupid = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_BTRFS_SUBVOLUME_CREATE_OPTS_QGROUPID_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_btrfs_subvolume_create_opts_argv (g, dest, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 4187 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_subvolume_delete); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_subvolume_delete)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, subvolume");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	subvolume = (char *)SvPV_nolen(ST(1))
;
#line 1731 "lib/Sys/Guestfs.xs"
      int r;
#line 4208 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_subvolume_delete(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_subvolume_delete(): g is not a blessed HV reference");
    }
;
#line 1733 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_subvolume_delete (g, subvolume);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 4226 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_subvolume_get_default); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_subvolume_get_default)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, fs");
    {
	guestfs_h *	g;
	char *	fs = (char *)SvPV_nolen(ST(1))
;
#line 1742 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 4245 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_subvolume_get_default(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_subvolume_get_default(): g is not a blessed HV reference");
    }
;
#line 1744 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_subvolume_get_default (g, fs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 4265 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_subvolume_list); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_subvolume_list)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, fs");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	fs = (char *)SvPV_nolen(ST(1))
;
#line 1756 "lib/Sys/Guestfs.xs"
      struct guestfs_btrfssubvolume_list *r;
      size_t i;
      HV *hv;
#line 4289 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_subvolume_list(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_subvolume_list(): g is not a blessed HV reference");
    }
;
#line 1760 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_subvolume_list (g, fs);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "btrfssubvolume_id", 17, my_newSVull (r->val[i].btrfssubvolume_id), 0);
        (void) hv_store (hv, "btrfssubvolume_top_level_id", 27, my_newSVull (r->val[i].btrfssubvolume_top_level_id), 0);
        (void) hv_store (hv, "btrfssubvolume_path", 19, newSVpv (r->val[i].btrfssubvolume_path, 0), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_btrfssubvolume_list (r);
#line 4316 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_subvolume_set_default); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_subvolume_set_default)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, id, fs");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int64_t	id = my_SvIV64 (ST(1))
;
	char *	fs = (char *)SvPV_nolen(ST(2))
;
#line 1779 "lib/Sys/Guestfs.xs"
      int r;
#line 4339 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_subvolume_set_default(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_subvolume_set_default(): g is not a blessed HV reference");
    }
;
#line 1781 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_subvolume_set_default (g, id, fs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 4357 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_subvolume_show); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_subvolume_show)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, subvolume");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	subvolume = (char *)SvPV_nolen(ST(1))
;
#line 1790 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 4379 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_subvolume_show(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_subvolume_show(): g is not a blessed HV reference");
    }
;
#line 1793 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfs_subvolume_show (g, subvolume);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 4404 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfs_subvolume_snapshot); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfs_subvolume_snapshot)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, source, dest, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	source = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
#line 1810 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_btrfs_subvolume_snapshot_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_btrfs_subvolume_snapshot_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 4430 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfs_subvolume_snapshot(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfs_subvolume_snapshot(): g is not a blessed HV reference");
    }
;
#line 1815 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "ro")) {
          optargs_s.ro = SvIV (ST (items_i+1));
          this_mask = GUESTFS_BTRFS_SUBVOLUME_SNAPSHOT_OPTS_RO_BITMASK;
        }
        else if (STREQ (this_arg, "qgroupid")) {
          optargs_s.qgroupid = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_BTRFS_SUBVOLUME_SNAPSHOT_OPTS_QGROUPID_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_btrfs_subvolume_snapshot_opts_argv (g, source, dest, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 4470 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfstune_enable_extended_inode_refs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfstune_enable_extended_inode_refs)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1846 "lib/Sys/Guestfs.xs"
      int r;
#line 4491 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfstune_enable_extended_inode_refs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfstune_enable_extended_inode_refs(): g is not a blessed HV reference");
    }
;
#line 1848 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfstune_enable_extended_inode_refs (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 4509 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfstune_enable_skinny_metadata_extent_refs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfstune_enable_skinny_metadata_extent_refs)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1857 "lib/Sys/Guestfs.xs"
      int r;
#line 4530 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfstune_enable_skinny_metadata_extent_refs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfstune_enable_skinny_metadata_extent_refs(): g is not a blessed HV reference");
    }
;
#line 1859 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfstune_enable_skinny_metadata_extent_refs (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 4548 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_btrfstune_seeding); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_btrfstune_seeding)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, seeding");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	seeding = (int)SvIV(ST(2))
;
#line 1869 "lib/Sys/Guestfs.xs"
      int r;
#line 4571 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::btrfstune_seeding(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::btrfstune_seeding(): g is not a blessed HV reference");
    }
;
#line 1871 "lib/Sys/Guestfs.xs"
      r = guestfs_btrfstune_seeding (g, device, seeding);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 4589 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_c_pointer); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_c_pointer)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 1879 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 4606 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::c_pointer(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::c_pointer(): g is not a blessed HV reference");
    }
;
#line 1881 "lib/Sys/Guestfs.xs"
      r = guestfs_c_pointer (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 4626 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_canonical_device_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_canonical_device_name)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 1893 "lib/Sys/Guestfs.xs"
      char *r;
#line 4646 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::canonical_device_name(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::canonical_device_name(): g is not a blessed HV reference");
    }
;
#line 1895 "lib/Sys/Guestfs.xs"
      r = guestfs_canonical_device_name (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 4667 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_cap_get_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_cap_get_file)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 1908 "lib/Sys/Guestfs.xs"
      char *r;
#line 4687 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::cap_get_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::cap_get_file(): g is not a blessed HV reference");
    }
;
#line 1910 "lib/Sys/Guestfs.xs"
      r = guestfs_cap_get_file (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 4708 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_cap_set_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_cap_set_file)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, cap");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	char *	cap = (char *)SvPV_nolen(ST(2))
;
#line 1924 "lib/Sys/Guestfs.xs"
      int r;
#line 4732 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::cap_set_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::cap_set_file(): g is not a blessed HV reference");
    }
;
#line 1926 "lib/Sys/Guestfs.xs"
      r = guestfs_cap_set_file (g, path, cap);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 4750 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_case_sensitive_path); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_case_sensitive_path)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 1935 "lib/Sys/Guestfs.xs"
      char *r;
#line 4769 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::case_sensitive_path(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::case_sensitive_path(): g is not a blessed HV reference");
    }
;
#line 1937 "lib/Sys/Guestfs.xs"
      r = guestfs_case_sensitive_path (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 4790 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_cat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_cat)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 1950 "lib/Sys/Guestfs.xs"
      char *r;
#line 4810 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::cat(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::cat(): g is not a blessed HV reference");
    }
;
#line 1952 "lib/Sys/Guestfs.xs"
      r = guestfs_cat (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 4831 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_checksum); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_checksum)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, csumtype, path");
    {
	guestfs_h *	g;
	char *	csumtype = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 1966 "lib/Sys/Guestfs.xs"
      char *r;
#line 4853 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::checksum(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::checksum(): g is not a blessed HV reference");
    }
;
#line 1968 "lib/Sys/Guestfs.xs"
      r = guestfs_checksum (g, csumtype, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 4874 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_checksum_device); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_checksum_device)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, csumtype, device");
    {
	guestfs_h *	g;
	char *	csumtype = (char *)SvPV_nolen(ST(1))
;
	char *	device = (char *)SvPV_nolen(ST(2))
;
#line 1982 "lib/Sys/Guestfs.xs"
      char *r;
#line 4896 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::checksum_device(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::checksum_device(): g is not a blessed HV reference");
    }
;
#line 1984 "lib/Sys/Guestfs.xs"
      r = guestfs_checksum_device (g, csumtype, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 4917 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_checksums_out); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_checksums_out)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, csumtype, directory, sumsfile");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	csumtype = (char *)SvPV_nolen(ST(1))
;
	char *	directory = (char *)SvPV_nolen(ST(2))
;
	char *	sumsfile = (char *)SvPV_nolen(ST(3))
;
#line 1999 "lib/Sys/Guestfs.xs"
      int r;
#line 4943 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::checksums_out(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::checksums_out(): g is not a blessed HV reference");
    }
;
#line 2001 "lib/Sys/Guestfs.xs"
      r = guestfs_checksums_out (g, csumtype, directory, sumsfile);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 4961 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_chmod); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_chmod)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, mode, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	mode = (int)SvIV(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 2011 "lib/Sys/Guestfs.xs"
      int r;
#line 4984 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::chmod(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::chmod(): g is not a blessed HV reference");
    }
;
#line 2013 "lib/Sys/Guestfs.xs"
      r = guestfs_chmod (g, mode, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5002 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_chown); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_chown)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, owner, group, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	owner = (int)SvIV(ST(1))
;
	int	group = (int)SvIV(ST(2))
;
	char *	path = (char *)SvPV_nolen(ST(3))
;
#line 2024 "lib/Sys/Guestfs.xs"
      int r;
#line 5027 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::chown(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::chown(): g is not a blessed HV reference");
    }
;
#line 2026 "lib/Sys/Guestfs.xs"
      r = guestfs_chown (g, owner, group, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5045 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_clear_backend_setting); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_clear_backend_setting)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, name");
    {
	guestfs_h *	g;
	char *	name = (char *)SvPV_nolen(ST(1))
;
#line 2035 "lib/Sys/Guestfs.xs"
      int r;
#line 5064 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::clear_backend_setting(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::clear_backend_setting(): g is not a blessed HV reference");
    }
;
#line 2037 "lib/Sys/Guestfs.xs"
      r = guestfs_clear_backend_setting (g, name);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 5084 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_clevis_luks_unlock); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_clevis_luks_unlock)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, mapname");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	mapname = (char *)SvPV_nolen(ST(2))
;
#line 2050 "lib/Sys/Guestfs.xs"
      int r;
#line 5108 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::clevis_luks_unlock(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::clevis_luks_unlock(): g is not a blessed HV reference");
    }
;
#line 2052 "lib/Sys/Guestfs.xs"
      r = guestfs_clevis_luks_unlock (g, device, mapname);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5126 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_command); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_command)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, arguments");
    {
	guestfs_h *	g;
	char **	arguments = XS_unpack_charPtrPtr(ST(1))
;
#line 2061 "lib/Sys/Guestfs.xs"
      char *r;
#line 5145 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::command(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::command(): g is not a blessed HV reference");
    }
;
#line 2063 "lib/Sys/Guestfs.xs"
      r = guestfs_command (g, arguments);
      free (arguments);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 5167 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_command_lines); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_command_lines)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, arguments");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char **	arguments = XS_unpack_charPtrPtr(ST(1))
;
#line 2077 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 5190 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::command_lines(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::command_lines(): g is not a blessed HV reference");
    }
;
#line 2080 "lib/Sys/Guestfs.xs"
      r = guestfs_command_lines (g, arguments);
      free (arguments);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 5216 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_command_out); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_command_out)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, arguments, output");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char **	arguments = XS_unpack_charPtrPtr(ST(1))
;
	char *	output = (char *)SvPV_nolen(ST(2))
;
#line 2098 "lib/Sys/Guestfs.xs"
      int r;
#line 5239 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::command_out(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::command_out(): g is not a blessed HV reference");
    }
;
#line 2100 "lib/Sys/Guestfs.xs"
      r = guestfs_command_out (g, arguments, output);
      free (arguments);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5258 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_compress_device_out); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_compress_device_out)
{
    dVAR; dXSARGS;
    if (items < 4)
       croak_xs_usage(cv,  "g, ctype, device, zdevice, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	ctype = (char *)SvPV_nolen(ST(1))
;
	char *	device = (char *)SvPV_nolen(ST(2))
;
	char *	zdevice = (char *)SvPV_nolen(ST(3))
;
#line 2112 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_compress_device_out_argv optargs_s = { .bitmask = 0 };
      struct guestfs_compress_device_out_argv *optargs = &optargs_s;
      size_t items_i;
#line 5286 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::compress_device_out(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::compress_device_out(): g is not a blessed HV reference");
    }
;
#line 2117 "lib/Sys/Guestfs.xs"
      if (((items - 4) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 4; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "level")) {
          optargs_s.level = SvIV (ST (items_i+1));
          this_mask = GUESTFS_COMPRESS_DEVICE_OUT_LEVEL_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_compress_device_out_argv (g, ctype, device, zdevice, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5322 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_compress_out); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_compress_out)
{
    dVAR; dXSARGS;
    if (items < 4)
       croak_xs_usage(cv,  "g, ctype, file, zfile, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	ctype = (char *)SvPV_nolen(ST(1))
;
	char *	file = (char *)SvPV_nolen(ST(2))
;
	char *	zfile = (char *)SvPV_nolen(ST(3))
;
#line 2146 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_compress_out_argv optargs_s = { .bitmask = 0 };
      struct guestfs_compress_out_argv *optargs = &optargs_s;
      size_t items_i;
#line 5350 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::compress_out(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::compress_out(): g is not a blessed HV reference");
    }
;
#line 2151 "lib/Sys/Guestfs.xs"
      if (((items - 4) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 4; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "level")) {
          optargs_s.level = SvIV (ST (items_i+1));
          this_mask = GUESTFS_COMPRESS_OUT_LEVEL_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_compress_out_argv (g, ctype, file, zfile, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5386 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_config); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_config)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, hvparam, hvvalue");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	hvparam = (char *)SvPV_nolen(ST(1))
;
	char *	hvvalue = SvOK(ST(2)) ? SvPV_nolen(ST(2)) : NULL;
#line 2179 "lib/Sys/Guestfs.xs"
      int r;
#line 5408 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::config(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::config(): g is not a blessed HV reference");
    }
;
#line 2181 "lib/Sys/Guestfs.xs"
      r = guestfs_config (g, hvparam, hvvalue);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5426 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_copy_attributes); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_copy_attributes)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, src, dest, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
#line 2191 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_copy_attributes_argv optargs_s = { .bitmask = 0 };
      struct guestfs_copy_attributes_argv *optargs = &optargs_s;
      size_t items_i;
#line 5452 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::copy_attributes(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::copy_attributes(): g is not a blessed HV reference");
    }
;
#line 2196 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "all")) {
          optargs_s.all = SvIV (ST (items_i+1));
          this_mask = GUESTFS_COPY_ATTRIBUTES_ALL_BITMASK;
        }
        else if (STREQ (this_arg, "mode")) {
          optargs_s.mode = SvIV (ST (items_i+1));
          this_mask = GUESTFS_COPY_ATTRIBUTES_MODE_BITMASK;
        }
        else if (STREQ (this_arg, "xattributes")) {
          optargs_s.xattributes = SvIV (ST (items_i+1));
          this_mask = GUESTFS_COPY_ATTRIBUTES_XATTRIBUTES_BITMASK;
        }
        else if (STREQ (this_arg, "ownership")) {
          optargs_s.ownership = SvIV (ST (items_i+1));
          this_mask = GUESTFS_COPY_ATTRIBUTES_OWNERSHIP_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_copy_attributes_argv (g, src, dest, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5500 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_copy_device_to_device); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_copy_device_to_device)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, src, dest, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
#line 2236 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_copy_device_to_device_argv optargs_s = { .bitmask = 0 };
      struct guestfs_copy_device_to_device_argv *optargs = &optargs_s;
      size_t items_i;
#line 5526 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::copy_device_to_device(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::copy_device_to_device(): g is not a blessed HV reference");
    }
;
#line 2241 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "srcoffset")) {
          optargs_s.srcoffset = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_COPY_DEVICE_TO_DEVICE_SRCOFFSET_BITMASK;
        }
        else if (STREQ (this_arg, "destoffset")) {
          optargs_s.destoffset = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_COPY_DEVICE_TO_DEVICE_DESTOFFSET_BITMASK;
        }
        else if (STREQ (this_arg, "size")) {
          optargs_s.size = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE_BITMASK;
        }
        else if (STREQ (this_arg, "sparse")) {
          optargs_s.sparse = SvIV (ST (items_i+1));
          this_mask = GUESTFS_COPY_DEVICE_TO_DEVICE_SPARSE_BITMASK;
        }
        else if (STREQ (this_arg, "append")) {
          optargs_s.append = SvIV (ST (items_i+1));
          this_mask = GUESTFS_COPY_DEVICE_TO_DEVICE_APPEND_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_copy_device_to_device_argv (g, src, dest, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5578 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_copy_device_to_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_copy_device_to_file)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, src, dest, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
#line 2285 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_copy_device_to_file_argv optargs_s = { .bitmask = 0 };
      struct guestfs_copy_device_to_file_argv *optargs = &optargs_s;
      size_t items_i;
#line 5604 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::copy_device_to_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::copy_device_to_file(): g is not a blessed HV reference");
    }
;
#line 2290 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "srcoffset")) {
          optargs_s.srcoffset = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_COPY_DEVICE_TO_FILE_SRCOFFSET_BITMASK;
        }
        else if (STREQ (this_arg, "destoffset")) {
          optargs_s.destoffset = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_COPY_DEVICE_TO_FILE_DESTOFFSET_BITMASK;
        }
        else if (STREQ (this_arg, "size")) {
          optargs_s.size = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_COPY_DEVICE_TO_FILE_SIZE_BITMASK;
        }
        else if (STREQ (this_arg, "sparse")) {
          optargs_s.sparse = SvIV (ST (items_i+1));
          this_mask = GUESTFS_COPY_DEVICE_TO_FILE_SPARSE_BITMASK;
        }
        else if (STREQ (this_arg, "append")) {
          optargs_s.append = SvIV (ST (items_i+1));
          this_mask = GUESTFS_COPY_DEVICE_TO_FILE_APPEND_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_copy_device_to_file_argv (g, src, dest, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5656 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_copy_file_to_device); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_copy_file_to_device)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, src, dest, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
#line 2334 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_copy_file_to_device_argv optargs_s = { .bitmask = 0 };
      struct guestfs_copy_file_to_device_argv *optargs = &optargs_s;
      size_t items_i;
#line 5682 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::copy_file_to_device(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::copy_file_to_device(): g is not a blessed HV reference");
    }
;
#line 2339 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "srcoffset")) {
          optargs_s.srcoffset = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_COPY_FILE_TO_DEVICE_SRCOFFSET_BITMASK;
        }
        else if (STREQ (this_arg, "destoffset")) {
          optargs_s.destoffset = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_COPY_FILE_TO_DEVICE_DESTOFFSET_BITMASK;
        }
        else if (STREQ (this_arg, "size")) {
          optargs_s.size = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_COPY_FILE_TO_DEVICE_SIZE_BITMASK;
        }
        else if (STREQ (this_arg, "sparse")) {
          optargs_s.sparse = SvIV (ST (items_i+1));
          this_mask = GUESTFS_COPY_FILE_TO_DEVICE_SPARSE_BITMASK;
        }
        else if (STREQ (this_arg, "append")) {
          optargs_s.append = SvIV (ST (items_i+1));
          this_mask = GUESTFS_COPY_FILE_TO_DEVICE_APPEND_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_copy_file_to_device_argv (g, src, dest, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5734 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_copy_file_to_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_copy_file_to_file)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, src, dest, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
#line 2383 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_copy_file_to_file_argv optargs_s = { .bitmask = 0 };
      struct guestfs_copy_file_to_file_argv *optargs = &optargs_s;
      size_t items_i;
#line 5760 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::copy_file_to_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::copy_file_to_file(): g is not a blessed HV reference");
    }
;
#line 2388 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "srcoffset")) {
          optargs_s.srcoffset = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_COPY_FILE_TO_FILE_SRCOFFSET_BITMASK;
        }
        else if (STREQ (this_arg, "destoffset")) {
          optargs_s.destoffset = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_COPY_FILE_TO_FILE_DESTOFFSET_BITMASK;
        }
        else if (STREQ (this_arg, "size")) {
          optargs_s.size = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_COPY_FILE_TO_FILE_SIZE_BITMASK;
        }
        else if (STREQ (this_arg, "sparse")) {
          optargs_s.sparse = SvIV (ST (items_i+1));
          this_mask = GUESTFS_COPY_FILE_TO_FILE_SPARSE_BITMASK;
        }
        else if (STREQ (this_arg, "append")) {
          optargs_s.append = SvIV (ST (items_i+1));
          this_mask = GUESTFS_COPY_FILE_TO_FILE_APPEND_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_copy_file_to_file_argv (g, src, dest, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5812 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_copy_in); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_copy_in)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, localpath, remotedir");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	localpath = (char *)SvPV_nolen(ST(1))
;
	char *	remotedir = (char *)SvPV_nolen(ST(2))
;
#line 2432 "lib/Sys/Guestfs.xs"
      int r;
#line 5835 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::copy_in(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::copy_in(): g is not a blessed HV reference");
    }
;
#line 2434 "lib/Sys/Guestfs.xs"
      r = guestfs_copy_in (g, localpath, remotedir);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5853 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_copy_out); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_copy_out)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, remotepath, localdir");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	remotepath = (char *)SvPV_nolen(ST(1))
;
	char *	localdir = (char *)SvPV_nolen(ST(2))
;
#line 2444 "lib/Sys/Guestfs.xs"
      int r;
#line 5876 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::copy_out(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::copy_out(): g is not a blessed HV reference");
    }
;
#line 2446 "lib/Sys/Guestfs.xs"
      r = guestfs_copy_out (g, remotepath, localdir);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5894 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_copy_size); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_copy_size)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, src, dest, size");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
	int64_t	size = my_SvIV64 (ST(3))
;
#line 2457 "lib/Sys/Guestfs.xs"
      int r;
#line 5919 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::copy_size(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::copy_size(): g is not a blessed HV reference");
    }
;
#line 2459 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::copy_size is deprecated; use Sys::Guestfs::copy_device_to_device instead");
      r = guestfs_copy_size (g, src, dest, size);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5939 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_cp); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_cp)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, src, dest");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
#line 2471 "lib/Sys/Guestfs.xs"
      int r;
#line 5962 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::cp(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::cp(): g is not a blessed HV reference");
    }
;
#line 2473 "lib/Sys/Guestfs.xs"
      r = guestfs_cp (g, src, dest);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 5980 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_cp_a); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_cp_a)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, src, dest");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
#line 2483 "lib/Sys/Guestfs.xs"
      int r;
#line 6003 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::cp_a(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::cp_a(): g is not a blessed HV reference");
    }
;
#line 2485 "lib/Sys/Guestfs.xs"
      r = guestfs_cp_a (g, src, dest);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 6021 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_cp_r); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_cp_r)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, src, dest");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
#line 2495 "lib/Sys/Guestfs.xs"
      int r;
#line 6044 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::cp_r(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::cp_r(): g is not a blessed HV reference");
    }
;
#line 2497 "lib/Sys/Guestfs.xs"
      r = guestfs_cp_r (g, src, dest);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 6062 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_cpio_out); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_cpio_out)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, directory, cpiofile, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	directory = (char *)SvPV_nolen(ST(1))
;
	char *	cpiofile = (char *)SvPV_nolen(ST(2))
;
#line 2507 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_cpio_out_argv optargs_s = { .bitmask = 0 };
      struct guestfs_cpio_out_argv *optargs = &optargs_s;
      size_t items_i;
#line 6088 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::cpio_out(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::cpio_out(): g is not a blessed HV reference");
    }
;
#line 2512 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "format")) {
          optargs_s.format = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_CPIO_OUT_FORMAT_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_cpio_out_argv (g, directory, cpiofile, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 6124 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_cryptsetup_close); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_cryptsetup_close)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 2539 "lib/Sys/Guestfs.xs"
      int r;
#line 6145 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::cryptsetup_close(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::cryptsetup_close(): g is not a blessed HV reference");
    }
;
#line 2541 "lib/Sys/Guestfs.xs"
      r = guestfs_cryptsetup_close (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 6163 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_cryptsetup_open); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_cryptsetup_open)
{
    dVAR; dXSARGS;
    if (items < 4)
       croak_xs_usage(cv,  "g, device, key, mapname, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	key = (char *)SvPV_nolen(ST(2))
;
	char *	mapname = (char *)SvPV_nolen(ST(3))
;
#line 2552 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_cryptsetup_open_argv optargs_s = { .bitmask = 0 };
      struct guestfs_cryptsetup_open_argv *optargs = &optargs_s;
      size_t items_i;
#line 6191 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::cryptsetup_open(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::cryptsetup_open(): g is not a blessed HV reference");
    }
;
#line 2557 "lib/Sys/Guestfs.xs"
      if (((items - 4) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 4; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "readonly")) {
          optargs_s.readonly = SvIV (ST (items_i+1));
          this_mask = GUESTFS_CRYPTSETUP_OPEN_READONLY_BITMASK;
        }
        else if (STREQ (this_arg, "crypttype")) {
          optargs_s.crypttype = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_CRYPTSETUP_OPEN_CRYPTTYPE_BITMASK;
        }
        else if (STREQ (this_arg, "cipher")) {
          optargs_s.cipher = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_CRYPTSETUP_OPEN_CIPHER_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_cryptsetup_open_argv (g, device, key, mapname, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 6235 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_dd); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_dd)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, src, dest");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
#line 2593 "lib/Sys/Guestfs.xs"
      int r;
#line 6258 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::dd(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::dd(): g is not a blessed HV reference");
    }
;
#line 2595 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::dd is deprecated; use Sys::Guestfs::copy_device_to_device instead");
      r = guestfs_dd (g, src, dest);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 6278 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_debug); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_debug)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, subcmd, extraargs");
    {
	guestfs_h *	g;
	char *	subcmd = (char *)SvPV_nolen(ST(1))
;
	char **	extraargs = XS_unpack_charPtrPtr(ST(2))
;
#line 2607 "lib/Sys/Guestfs.xs"
      char *r;
#line 6299 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::debug(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::debug(): g is not a blessed HV reference");
    }
;
#line 2609 "lib/Sys/Guestfs.xs"
      r = guestfs_debug (g, subcmd, extraargs);
      free (extraargs);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 6321 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_debug_drives); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_debug_drives)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 2622 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 6342 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::debug_drives(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::debug_drives(): g is not a blessed HV reference");
    }
;
#line 2625 "lib/Sys/Guestfs.xs"
      r = guestfs_debug_drives (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 6367 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_debug_upload); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_debug_upload)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, filename, tmpname, mode");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
	char *	tmpname = (char *)SvPV_nolen(ST(2))
;
	int	mode = (int)SvIV(ST(3))
;
#line 2643 "lib/Sys/Guestfs.xs"
      int r;
#line 6392 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::debug_upload(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::debug_upload(): g is not a blessed HV reference");
    }
;
#line 2645 "lib/Sys/Guestfs.xs"
      r = guestfs_debug_upload (g, filename, tmpname, mode);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 6410 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_device_index); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_device_index)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 2654 "lib/Sys/Guestfs.xs"
      int r;
#line 6429 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::device_index(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::device_index(): g is not a blessed HV reference");
    }
;
#line 2656 "lib/Sys/Guestfs.xs"
      r = guestfs_device_index (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 6449 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_device_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_device_name)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, index");
    {
	guestfs_h *	g;
	int	index = (int)SvIV(ST(1))
;
#line 2668 "lib/Sys/Guestfs.xs"
      char *r;
#line 6469 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::device_name(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::device_name(): g is not a blessed HV reference");
    }
;
#line 2670 "lib/Sys/Guestfs.xs"
      r = guestfs_device_name (g, index);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 6490 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_df); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_df)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 2682 "lib/Sys/Guestfs.xs"
      char *r;
#line 6508 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::df(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::df(): g is not a blessed HV reference");
    }
;
#line 2684 "lib/Sys/Guestfs.xs"
      r = guestfs_df (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 6529 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_df_h); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_df_h)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 2696 "lib/Sys/Guestfs.xs"
      char *r;
#line 6547 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::df_h(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::df_h(): g is not a blessed HV reference");
    }
;
#line 2698 "lib/Sys/Guestfs.xs"
      r = guestfs_df_h (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 6568 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_disk_create); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_disk_create)
{
    dVAR; dXSARGS;
    if (items < 4)
       croak_xs_usage(cv,  "g, filename, format, size, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
	char *	format = (char *)SvPV_nolen(ST(2))
;
	int64_t	size = my_SvIV64 (ST(3))
;
#line 2713 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_disk_create_argv optargs_s = { .bitmask = 0 };
      struct guestfs_disk_create_argv *optargs = &optargs_s;
      size_t items_i;
#line 6597 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::disk_create(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::disk_create(): g is not a blessed HV reference");
    }
;
#line 2718 "lib/Sys/Guestfs.xs"
      if (((items - 4) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 4; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "backingfile")) {
          optargs_s.backingfile = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_DISK_CREATE_BACKINGFILE_BITMASK;
        }
        else if (STREQ (this_arg, "backingformat")) {
          optargs_s.backingformat = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_DISK_CREATE_BACKINGFORMAT_BITMASK;
        }
        else if (STREQ (this_arg, "preallocation")) {
          optargs_s.preallocation = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_DISK_CREATE_PREALLOCATION_BITMASK;
        }
        else if (STREQ (this_arg, "compat")) {
          optargs_s.compat = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_DISK_CREATE_COMPAT_BITMASK;
        }
        else if (STREQ (this_arg, "clustersize")) {
          optargs_s.clustersize = SvIV (ST (items_i+1));
          this_mask = GUESTFS_DISK_CREATE_CLUSTERSIZE_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_disk_create_argv (g, filename, format, size, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 6649 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_disk_format); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_disk_format)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, filename");
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
#line 2761 "lib/Sys/Guestfs.xs"
      char *r;
#line 6668 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::disk_format(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::disk_format(): g is not a blessed HV reference");
    }
;
#line 2763 "lib/Sys/Guestfs.xs"
      r = guestfs_disk_format (g, filename);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 6689 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_disk_has_backing_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_disk_has_backing_file)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, filename");
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
#line 2776 "lib/Sys/Guestfs.xs"
      int r;
#line 6709 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::disk_has_backing_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::disk_has_backing_file(): g is not a blessed HV reference");
    }
;
#line 2778 "lib/Sys/Guestfs.xs"
      r = guestfs_disk_has_backing_file (g, filename);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 6729 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_disk_virtual_size); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_disk_virtual_size)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, filename");
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
#line 2790 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 6749 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::disk_virtual_size(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::disk_virtual_size(): g is not a blessed HV reference");
    }
;
#line 2792 "lib/Sys/Guestfs.xs"
      r = guestfs_disk_virtual_size (g, filename);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 6769 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_dmesg); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_dmesg)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 2803 "lib/Sys/Guestfs.xs"
      char *r;
#line 6787 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::dmesg(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::dmesg(): g is not a blessed HV reference");
    }
;
#line 2805 "lib/Sys/Guestfs.xs"
      r = guestfs_dmesg (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 6808 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_download); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_download)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, remotefilename, filename");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	remotefilename = (char *)SvPV_nolen(ST(1))
;
	char *	filename = (char *)SvPV_nolen(ST(2))
;
#line 2819 "lib/Sys/Guestfs.xs"
      int r;
#line 6832 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::download(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::download(): g is not a blessed HV reference");
    }
;
#line 2821 "lib/Sys/Guestfs.xs"
      r = guestfs_download (g, remotefilename, filename);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 6850 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_download_blocks); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_download_blocks)
{
    dVAR; dXSARGS;
    if (items < 5)
       croak_xs_usage(cv,  "g, device, start, stop, filename, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int64_t	start = my_SvIV64 (ST(2))
;
	int64_t	stop = my_SvIV64 (ST(3))
;
	char *	filename = (char *)SvPV_nolen(ST(4))
;
#line 2833 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_download_blocks_argv optargs_s = { .bitmask = 0 };
      struct guestfs_download_blocks_argv *optargs = &optargs_s;
      size_t items_i;
#line 6880 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::download_blocks(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::download_blocks(): g is not a blessed HV reference");
    }
;
#line 2838 "lib/Sys/Guestfs.xs"
      if (((items - 5) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 5; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "unallocated")) {
          optargs_s.unallocated = SvIV (ST (items_i+1));
          this_mask = GUESTFS_DOWNLOAD_BLOCKS_UNALLOCATED_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_download_blocks_argv (g, device, start, stop, filename, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 6916 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_download_inode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_download_inode)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, inode, filename");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int64_t	inode = my_SvIV64 (ST(2))
;
	char *	filename = (char *)SvPV_nolen(ST(3))
;
#line 2867 "lib/Sys/Guestfs.xs"
      int r;
#line 6941 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::download_inode(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::download_inode(): g is not a blessed HV reference");
    }
;
#line 2869 "lib/Sys/Guestfs.xs"
      r = guestfs_download_inode (g, device, inode, filename);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 6959 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_download_offset); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_download_offset)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "g, remotefilename, filename, offset, size");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	remotefilename = (char *)SvPV_nolen(ST(1))
;
	char *	filename = (char *)SvPV_nolen(ST(2))
;
	int64_t	offset = my_SvIV64 (ST(3))
;
	int64_t	size = my_SvIV64 (ST(4))
;
#line 2881 "lib/Sys/Guestfs.xs"
      int r;
#line 6986 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::download_offset(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::download_offset(): g is not a blessed HV reference");
    }
;
#line 2883 "lib/Sys/Guestfs.xs"
      r = guestfs_download_offset (g, remotefilename, filename, offset, size);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 7004 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_drop_caches); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_drop_caches)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, whattodrop");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	whattodrop = (int)SvIV(ST(1))
;
#line 2892 "lib/Sys/Guestfs.xs"
      int r;
#line 7025 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::drop_caches(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::drop_caches(): g is not a blessed HV reference");
    }
;
#line 2894 "lib/Sys/Guestfs.xs"
      r = guestfs_drop_caches (g, whattodrop);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 7043 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_du); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_du)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 2903 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 7062 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::du(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::du(): g is not a blessed HV reference");
    }
;
#line 2905 "lib/Sys/Guestfs.xs"
      r = guestfs_du (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 7082 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_e2fsck); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_e2fsck)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, device, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 2917 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_e2fsck_argv optargs_s = { .bitmask = 0 };
      struct guestfs_e2fsck_argv *optargs = &optargs_s;
      size_t items_i;
#line 7107 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::e2fsck(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::e2fsck(): g is not a blessed HV reference");
    }
;
#line 2922 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "correct")) {
          optargs_s.correct = SvIV (ST (items_i+1));
          this_mask = GUESTFS_E2FSCK_CORRECT_BITMASK;
        }
        else if (STREQ (this_arg, "forceall")) {
          optargs_s.forceall = SvIV (ST (items_i+1));
          this_mask = GUESTFS_E2FSCK_FORCEALL_BITMASK;
        }
        else if (STREQ (this_arg, "forceno")) {
          optargs_s.forceno = SvIV (ST (items_i+1));
          this_mask = GUESTFS_E2FSCK_FORCENO_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_e2fsck_argv (g, device, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 7151 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_e2fsck_f); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_e2fsck_f)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 2957 "lib/Sys/Guestfs.xs"
      int r;
#line 7172 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::e2fsck_f(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::e2fsck_f(): g is not a blessed HV reference");
    }
;
#line 2959 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::e2fsck_f is deprecated; use Sys::Guestfs::e2fsck instead");
      r = guestfs_e2fsck_f (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 7192 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_echo_daemon); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_echo_daemon)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, words");
    {
	guestfs_h *	g;
	char **	words = XS_unpack_charPtrPtr(ST(1))
;
#line 2970 "lib/Sys/Guestfs.xs"
      char *r;
#line 7211 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::echo_daemon(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::echo_daemon(): g is not a blessed HV reference");
    }
;
#line 2972 "lib/Sys/Guestfs.xs"
      r = guestfs_echo_daemon (g, words);
      free (words);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 7233 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_egrep); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_egrep)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, regex, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	regex = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 2987 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 7258 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::egrep(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::egrep(): g is not a blessed HV reference");
    }
;
#line 2990 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::egrep is deprecated; use Sys::Guestfs::grep instead");
      r = guestfs_egrep (g, regex, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 7285 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_egrepi); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_egrepi)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, regex, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	regex = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 3009 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 7309 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::egrepi(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::egrepi(): g is not a blessed HV reference");
    }
;
#line 3012 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::egrepi is deprecated; use Sys::Guestfs::grep instead");
      r = guestfs_egrepi (g, regex, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 7336 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_equal); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_equal)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, file1, file2");
    {
	guestfs_h *	g;
	char *	file1 = (char *)SvPV_nolen(ST(1))
;
	char *	file2 = (char *)SvPV_nolen(ST(2))
;
#line 3031 "lib/Sys/Guestfs.xs"
      int r;
#line 7357 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::equal(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::equal(): g is not a blessed HV reference");
    }
;
#line 3033 "lib/Sys/Guestfs.xs"
      r = guestfs_equal (g, file1, file2);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 7377 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_exists); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_exists)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 3045 "lib/Sys/Guestfs.xs"
      int r;
#line 7397 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::exists(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::exists(): g is not a blessed HV reference");
    }
;
#line 3047 "lib/Sys/Guestfs.xs"
      r = guestfs_exists (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 7417 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_extlinux); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_extlinux)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, directory");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	directory = (char *)SvPV_nolen(ST(1))
;
#line 3059 "lib/Sys/Guestfs.xs"
      int r;
#line 7439 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::extlinux(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::extlinux(): g is not a blessed HV reference");
    }
;
#line 3061 "lib/Sys/Guestfs.xs"
      r = guestfs_extlinux (g, directory);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 7457 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_f2fs_expand); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_f2fs_expand)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 3070 "lib/Sys/Guestfs.xs"
      int r;
#line 7478 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::f2fs_expand(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::f2fs_expand(): g is not a blessed HV reference");
    }
;
#line 3072 "lib/Sys/Guestfs.xs"
      r = guestfs_f2fs_expand (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 7496 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_fallocate); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_fallocate)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, len");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	int	len = (int)SvIV(ST(2))
;
#line 3082 "lib/Sys/Guestfs.xs"
      int r;
#line 7519 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::fallocate(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::fallocate(): g is not a blessed HV reference");
    }
;
#line 3084 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::fallocate is deprecated; use Sys::Guestfs::fallocate64 instead");
      r = guestfs_fallocate (g, path, len);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 7539 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_fallocate64); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_fallocate64)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, len");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	int64_t	len = my_SvIV64 (ST(2))
;
#line 3096 "lib/Sys/Guestfs.xs"
      int r;
#line 7562 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::fallocate64(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::fallocate64(): g is not a blessed HV reference");
    }
;
#line 3098 "lib/Sys/Guestfs.xs"
      r = guestfs_fallocate64 (g, path, len);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 7580 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_feature_available); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_feature_available)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, groups");
    {
	guestfs_h *	g;
	char **	groups = XS_unpack_charPtrPtr(ST(1))
;
#line 3107 "lib/Sys/Guestfs.xs"
      int r;
#line 7599 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::feature_available(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::feature_available(): g is not a blessed HV reference");
    }
;
#line 3109 "lib/Sys/Guestfs.xs"
      r = guestfs_feature_available (g, groups);
      free (groups);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 7620 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_fgrep); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_fgrep)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, pattern, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	pattern = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 3123 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 7645 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::fgrep(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::fgrep(): g is not a blessed HV reference");
    }
;
#line 3126 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::fgrep is deprecated; use Sys::Guestfs::grep instead");
      r = guestfs_fgrep (g, pattern, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 7672 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_fgrepi); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_fgrepi)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, pattern, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	pattern = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 3145 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 7696 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::fgrepi(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::fgrepi(): g is not a blessed HV reference");
    }
;
#line 3148 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::fgrepi is deprecated; use Sys::Guestfs::grep instead");
      r = guestfs_fgrepi (g, pattern, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 7723 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_file)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 3166 "lib/Sys/Guestfs.xs"
      char *r;
#line 7742 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::file(): g is not a blessed HV reference");
    }
;
#line 3168 "lib/Sys/Guestfs.xs"
      r = guestfs_file (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 7763 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_file_architecture); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_file_architecture)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, filename");
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
#line 3181 "lib/Sys/Guestfs.xs"
      char *r;
#line 7783 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::file_architecture(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::file_architecture(): g is not a blessed HV reference");
    }
;
#line 3183 "lib/Sys/Guestfs.xs"
      r = guestfs_file_architecture (g, filename);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 7804 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_filesize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_filesize)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, file");
    {
	guestfs_h *	g;
	char *	file = (char *)SvPV_nolen(ST(1))
;
#line 3196 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 7824 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::filesize(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::filesize(): g is not a blessed HV reference");
    }
;
#line 3198 "lib/Sys/Guestfs.xs"
      r = guestfs_filesize (g, file);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 7844 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_filesystem_available); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_filesystem_available)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, filesystem");
    {
	guestfs_h *	g;
	char *	filesystem = (char *)SvPV_nolen(ST(1))
;
#line 3210 "lib/Sys/Guestfs.xs"
      int r;
#line 7864 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::filesystem_available(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::filesystem_available(): g is not a blessed HV reference");
    }
;
#line 3212 "lib/Sys/Guestfs.xs"
      r = guestfs_filesystem_available (g, filesystem);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 7884 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_filesystem_walk); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_filesystem_walk)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 3224 "lib/Sys/Guestfs.xs"
      struct guestfs_tsk_dirent_list *r;
      size_t i;
      HV *hv;
#line 7908 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::filesystem_walk(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::filesystem_walk(): g is not a blessed HV reference");
    }
;
#line 3228 "lib/Sys/Guestfs.xs"
      r = guestfs_filesystem_walk (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "tsk_inode", 9, my_newSVull (r->val[i].tsk_inode), 0);
        (void) hv_store (hv, "tsk_type", 8, newSVpv (&r->val[i].tsk_type, 1), 0);
        (void) hv_store (hv, "tsk_size", 8, my_newSVll (r->val[i].tsk_size), 0);
        (void) hv_store (hv, "tsk_name", 8, newSVpv (r->val[i].tsk_name, 0), 0);
        (void) hv_store (hv, "tsk_flags", 9, newSVnv (r->val[i].tsk_flags), 0);
        (void) hv_store (hv, "tsk_atime_sec", 13, my_newSVll (r->val[i].tsk_atime_sec), 0);
        (void) hv_store (hv, "tsk_atime_nsec", 14, my_newSVll (r->val[i].tsk_atime_nsec), 0);
        (void) hv_store (hv, "tsk_mtime_sec", 13, my_newSVll (r->val[i].tsk_mtime_sec), 0);
        (void) hv_store (hv, "tsk_mtime_nsec", 14, my_newSVll (r->val[i].tsk_mtime_nsec), 0);
        (void) hv_store (hv, "tsk_ctime_sec", 13, my_newSVll (r->val[i].tsk_ctime_sec), 0);
        (void) hv_store (hv, "tsk_ctime_nsec", 14, my_newSVll (r->val[i].tsk_ctime_nsec), 0);
        (void) hv_store (hv, "tsk_crtime_sec", 14, my_newSVll (r->val[i].tsk_crtime_sec), 0);
        (void) hv_store (hv, "tsk_crtime_nsec", 15, my_newSVll (r->val[i].tsk_crtime_nsec), 0);
        (void) hv_store (hv, "tsk_nlink", 9, my_newSVll (r->val[i].tsk_nlink), 0);
        (void) hv_store (hv, "tsk_link", 8, newSVpv (r->val[i].tsk_link, 0), 0);
        (void) hv_store (hv, "tsk_spare1", 10, my_newSVll (r->val[i].tsk_spare1), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_tsk_dirent_list (r);
#line 7948 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_fill); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_fill)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, c, len, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	c = (int)SvIV(ST(1))
;
	int	len = (int)SvIV(ST(2))
;
	char *	path = (char *)SvPV_nolen(ST(3))
;
#line 3261 "lib/Sys/Guestfs.xs"
      int r;
#line 7973 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::fill(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::fill(): g is not a blessed HV reference");
    }
;
#line 3263 "lib/Sys/Guestfs.xs"
      r = guestfs_fill (g, c, len, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 7991 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_fill_dir); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_fill_dir)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, dir, nr");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	dir = (char *)SvPV_nolen(ST(1))
;
	int	nr = (int)SvIV(ST(2))
;
#line 3273 "lib/Sys/Guestfs.xs"
      int r;
#line 8014 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::fill_dir(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::fill_dir(): g is not a blessed HV reference");
    }
;
#line 3275 "lib/Sys/Guestfs.xs"
      r = guestfs_fill_dir (g, dir, nr);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 8032 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_fill_pattern); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_fill_pattern)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, pattern, len, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	pattern = (char *)SvPV_nolen(ST(1))
;
	int	len = (int)SvIV(ST(2))
;
	char *	path = (char *)SvPV_nolen(ST(3))
;
#line 3286 "lib/Sys/Guestfs.xs"
      int r;
#line 8057 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::fill_pattern(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::fill_pattern(): g is not a blessed HV reference");
    }
;
#line 3288 "lib/Sys/Guestfs.xs"
      r = guestfs_fill_pattern (g, pattern, len, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 8075 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_find); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_find)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, directory");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	directory = (char *)SvPV_nolen(ST(1))
;
#line 3297 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 8097 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::find(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::find(): g is not a blessed HV reference");
    }
;
#line 3300 "lib/Sys/Guestfs.xs"
      r = guestfs_find (g, directory);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 8122 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_find0); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_find0)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, directory, files");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	directory = (char *)SvPV_nolen(ST(1))
;
	char *	files = (char *)SvPV_nolen(ST(2))
;
#line 3317 "lib/Sys/Guestfs.xs"
      int r;
#line 8145 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::find0(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::find0(): g is not a blessed HV reference");
    }
;
#line 3319 "lib/Sys/Guestfs.xs"
      r = guestfs_find0 (g, directory, files);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 8163 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_find_inode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_find_inode)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, inode");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int64_t	inode = my_SvIV64 (ST(2))
;
#line 3329 "lib/Sys/Guestfs.xs"
      struct guestfs_tsk_dirent_list *r;
      size_t i;
      HV *hv;
#line 8188 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::find_inode(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::find_inode(): g is not a blessed HV reference");
    }
;
#line 3333 "lib/Sys/Guestfs.xs"
      r = guestfs_find_inode (g, device, inode);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "tsk_inode", 9, my_newSVull (r->val[i].tsk_inode), 0);
        (void) hv_store (hv, "tsk_type", 8, newSVpv (&r->val[i].tsk_type, 1), 0);
        (void) hv_store (hv, "tsk_size", 8, my_newSVll (r->val[i].tsk_size), 0);
        (void) hv_store (hv, "tsk_name", 8, newSVpv (r->val[i].tsk_name, 0), 0);
        (void) hv_store (hv, "tsk_flags", 9, newSVnv (r->val[i].tsk_flags), 0);
        (void) hv_store (hv, "tsk_atime_sec", 13, my_newSVll (r->val[i].tsk_atime_sec), 0);
        (void) hv_store (hv, "tsk_atime_nsec", 14, my_newSVll (r->val[i].tsk_atime_nsec), 0);
        (void) hv_store (hv, "tsk_mtime_sec", 13, my_newSVll (r->val[i].tsk_mtime_sec), 0);
        (void) hv_store (hv, "tsk_mtime_nsec", 14, my_newSVll (r->val[i].tsk_mtime_nsec), 0);
        (void) hv_store (hv, "tsk_ctime_sec", 13, my_newSVll (r->val[i].tsk_ctime_sec), 0);
        (void) hv_store (hv, "tsk_ctime_nsec", 14, my_newSVll (r->val[i].tsk_ctime_nsec), 0);
        (void) hv_store (hv, "tsk_crtime_sec", 14, my_newSVll (r->val[i].tsk_crtime_sec), 0);
        (void) hv_store (hv, "tsk_crtime_nsec", 15, my_newSVll (r->val[i].tsk_crtime_nsec), 0);
        (void) hv_store (hv, "tsk_nlink", 9, my_newSVll (r->val[i].tsk_nlink), 0);
        (void) hv_store (hv, "tsk_link", 8, newSVpv (r->val[i].tsk_link, 0), 0);
        (void) hv_store (hv, "tsk_spare1", 10, my_newSVll (r->val[i].tsk_spare1), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_tsk_dirent_list (r);
#line 8228 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_findfs_label); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_findfs_label)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, label");
    {
	guestfs_h *	g;
	char *	label = (char *)SvPV_nolen(ST(1))
;
#line 3364 "lib/Sys/Guestfs.xs"
      char *r;
#line 8247 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::findfs_label(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::findfs_label(): g is not a blessed HV reference");
    }
;
#line 3366 "lib/Sys/Guestfs.xs"
      r = guestfs_findfs_label (g, label);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 8268 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_findfs_partlabel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_findfs_partlabel)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, label");
    {
	guestfs_h *	g;
	char *	label = (char *)SvPV_nolen(ST(1))
;
#line 3379 "lib/Sys/Guestfs.xs"
      char *r;
#line 8288 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::findfs_partlabel(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::findfs_partlabel(): g is not a blessed HV reference");
    }
;
#line 3381 "lib/Sys/Guestfs.xs"
      r = guestfs_findfs_partlabel (g, label);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 8309 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_findfs_partuuid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_findfs_partuuid)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, uuid");
    {
	guestfs_h *	g;
	char *	uuid = (char *)SvPV_nolen(ST(1))
;
#line 3394 "lib/Sys/Guestfs.xs"
      char *r;
#line 8329 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::findfs_partuuid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::findfs_partuuid(): g is not a blessed HV reference");
    }
;
#line 3396 "lib/Sys/Guestfs.xs"
      r = guestfs_findfs_partuuid (g, uuid);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 8350 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_findfs_uuid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_findfs_uuid)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, uuid");
    {
	guestfs_h *	g;
	char *	uuid = (char *)SvPV_nolen(ST(1))
;
#line 3409 "lib/Sys/Guestfs.xs"
      char *r;
#line 8370 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::findfs_uuid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::findfs_uuid(): g is not a blessed HV reference");
    }
;
#line 3411 "lib/Sys/Guestfs.xs"
      r = guestfs_findfs_uuid (g, uuid);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 8391 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_fsck); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_fsck)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, fstype, device");
    {
	guestfs_h *	g;
	char *	fstype = (char *)SvPV_nolen(ST(1))
;
	char *	device = (char *)SvPV_nolen(ST(2))
;
#line 3425 "lib/Sys/Guestfs.xs"
      int r;
#line 8413 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::fsck(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::fsck(): g is not a blessed HV reference");
    }
;
#line 3427 "lib/Sys/Guestfs.xs"
      r = guestfs_fsck (g, fstype, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 8433 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_fstrim); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_fstrim)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, mountpoint, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	mountpoint = (char *)SvPV_nolen(ST(1))
;
#line 3439 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_fstrim_argv optargs_s = { .bitmask = 0 };
      struct guestfs_fstrim_argv *optargs = &optargs_s;
      size_t items_i;
#line 8458 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::fstrim(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::fstrim(): g is not a blessed HV reference");
    }
;
#line 3444 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "offset")) {
          optargs_s.offset = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_FSTRIM_OFFSET_BITMASK;
        }
        else if (STREQ (this_arg, "length")) {
          optargs_s.length = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_FSTRIM_LENGTH_BITMASK;
        }
        else if (STREQ (this_arg, "minimumfreeextent")) {
          optargs_s.minimumfreeextent = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_FSTRIM_MINIMUMFREEEXTENT_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_fstrim_argv (g, mountpoint, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 8502 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_get_append); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_append)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3478 "lib/Sys/Guestfs.xs"
      const char *r;
#line 8519 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_append(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_append(): g is not a blessed HV reference");
    }
;
#line 3480 "lib/Sys/Guestfs.xs"
      r = guestfs_get_append (g);
      if (r == NULL)
        RETVAL = &PL_sv_undef;
      else
        RETVAL = newSVpv (r, 0);
#line 8540 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_attach_method); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_attach_method)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3492 "lib/Sys/Guestfs.xs"
      char *r;
#line 8558 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_attach_method(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_attach_method(): g is not a blessed HV reference");
    }
;
#line 3494 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::get_attach_method is deprecated; use Sys::Guestfs::get_backend instead");
      r = guestfs_get_attach_method (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 8581 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_autosync); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_autosync)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3508 "lib/Sys/Guestfs.xs"
      int r;
#line 8599 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_autosync(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_autosync(): g is not a blessed HV reference");
    }
;
#line 3510 "lib/Sys/Guestfs.xs"
      r = guestfs_get_autosync (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 8619 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_backend); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_backend)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3521 "lib/Sys/Guestfs.xs"
      char *r;
#line 8637 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_backend(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_backend(): g is not a blessed HV reference");
    }
;
#line 3523 "lib/Sys/Guestfs.xs"
      r = guestfs_get_backend (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 8658 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_backend_setting); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_backend_setting)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, name");
    {
	guestfs_h *	g;
	char *	name = (char *)SvPV_nolen(ST(1))
;
#line 3536 "lib/Sys/Guestfs.xs"
      char *r;
#line 8678 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_backend_setting(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_backend_setting(): g is not a blessed HV reference");
    }
;
#line 3538 "lib/Sys/Guestfs.xs"
      r = guestfs_get_backend_setting (g, name);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 8699 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_backend_settings); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_backend_settings)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 3550 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 8720 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_backend_settings(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_backend_settings(): g is not a blessed HV reference");
    }
;
#line 3553 "lib/Sys/Guestfs.xs"
      r = guestfs_get_backend_settings (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 8745 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_get_cachedir); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_cachedir)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3568 "lib/Sys/Guestfs.xs"
      char *r;
#line 8762 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_cachedir(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_cachedir(): g is not a blessed HV reference");
    }
;
#line 3570 "lib/Sys/Guestfs.xs"
      r = guestfs_get_cachedir (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 8783 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_direct); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_direct)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3582 "lib/Sys/Guestfs.xs"
      int r;
#line 8801 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_direct(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_direct(): g is not a blessed HV reference");
    }
;
#line 3584 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::get_direct is deprecated; use Sys::Guestfs::internal_get_console_socket instead");
      r = guestfs_get_direct (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 8823 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_e2attrs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_e2attrs)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, file");
    {
	guestfs_h *	g;
	char *	file = (char *)SvPV_nolen(ST(1))
;
#line 3598 "lib/Sys/Guestfs.xs"
      char *r;
#line 8843 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_e2attrs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_e2attrs(): g is not a blessed HV reference");
    }
;
#line 3600 "lib/Sys/Guestfs.xs"
      r = guestfs_get_e2attrs (g, file);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 8864 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_e2generation); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_e2generation)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, file");
    {
	guestfs_h *	g;
	char *	file = (char *)SvPV_nolen(ST(1))
;
#line 3613 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 8884 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_e2generation(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_e2generation(): g is not a blessed HV reference");
    }
;
#line 3615 "lib/Sys/Guestfs.xs"
      r = guestfs_get_e2generation (g, file);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 8904 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_e2label); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_e2label)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 3627 "lib/Sys/Guestfs.xs"
      char *r;
#line 8924 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_e2label(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_e2label(): g is not a blessed HV reference");
    }
;
#line 3629 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::get_e2label is deprecated; use Sys::Guestfs::vfs_label instead");
      r = guestfs_get_e2label (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 8947 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_e2uuid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_e2uuid)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 3644 "lib/Sys/Guestfs.xs"
      char *r;
#line 8967 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_e2uuid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_e2uuid(): g is not a blessed HV reference");
    }
;
#line 3646 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::get_e2uuid is deprecated; use Sys::Guestfs::vfs_uuid instead");
      r = guestfs_get_e2uuid (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 8990 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_hv); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_hv)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3660 "lib/Sys/Guestfs.xs"
      char *r;
#line 9008 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_hv(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_hv(): g is not a blessed HV reference");
    }
;
#line 3662 "lib/Sys/Guestfs.xs"
      r = guestfs_get_hv (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 9029 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_identifier); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_identifier)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3674 "lib/Sys/Guestfs.xs"
      const char *r;
#line 9047 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_identifier(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_identifier(): g is not a blessed HV reference");
    }
;
#line 3676 "lib/Sys/Guestfs.xs"
      r = guestfs_get_identifier (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
#line 9067 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_libvirt_requested_credential_challenge); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_libvirt_requested_credential_challenge)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, index");
    {
	guestfs_h *	g;
	int	index = (int)SvIV(ST(1))
;
#line 3688 "lib/Sys/Guestfs.xs"
      char *r;
#line 9087 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_libvirt_requested_credential_challenge(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_libvirt_requested_credential_challenge(): g is not a blessed HV reference");
    }
;
#line 3690 "lib/Sys/Guestfs.xs"
      r = guestfs_get_libvirt_requested_credential_challenge (g, index);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 9108 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_libvirt_requested_credential_defresult); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_libvirt_requested_credential_defresult)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, index");
    {
	guestfs_h *	g;
	int	index = (int)SvIV(ST(1))
;
#line 3703 "lib/Sys/Guestfs.xs"
      char *r;
#line 9128 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_libvirt_requested_credential_defresult(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_libvirt_requested_credential_defresult(): g is not a blessed HV reference");
    }
;
#line 3705 "lib/Sys/Guestfs.xs"
      r = guestfs_get_libvirt_requested_credential_defresult (g, index);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 9149 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_libvirt_requested_credential_prompt); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_libvirt_requested_credential_prompt)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, index");
    {
	guestfs_h *	g;
	int	index = (int)SvIV(ST(1))
;
#line 3718 "lib/Sys/Guestfs.xs"
      char *r;
#line 9169 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_libvirt_requested_credential_prompt(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_libvirt_requested_credential_prompt(): g is not a blessed HV reference");
    }
;
#line 3720 "lib/Sys/Guestfs.xs"
      r = guestfs_get_libvirt_requested_credential_prompt (g, index);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 9190 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_libvirt_requested_credentials); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_libvirt_requested_credentials)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 3732 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 9211 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_libvirt_requested_credentials(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_libvirt_requested_credentials(): g is not a blessed HV reference");
    }
;
#line 3735 "lib/Sys/Guestfs.xs"
      r = guestfs_get_libvirt_requested_credentials (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 9236 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_get_memsize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_memsize)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3750 "lib/Sys/Guestfs.xs"
      int r;
#line 9253 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_memsize(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_memsize(): g is not a blessed HV reference");
    }
;
#line 3752 "lib/Sys/Guestfs.xs"
      r = guestfs_get_memsize (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 9273 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_network); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_network)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3763 "lib/Sys/Guestfs.xs"
      int r;
#line 9291 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_network(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_network(): g is not a blessed HV reference");
    }
;
#line 3765 "lib/Sys/Guestfs.xs"
      r = guestfs_get_network (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 9311 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_path); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_path)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3776 "lib/Sys/Guestfs.xs"
      const char *r;
#line 9329 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_path(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_path(): g is not a blessed HV reference");
    }
;
#line 3778 "lib/Sys/Guestfs.xs"
      r = guestfs_get_path (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
#line 9349 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_pgroup); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_pgroup)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3789 "lib/Sys/Guestfs.xs"
      int r;
#line 9367 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_pgroup(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_pgroup(): g is not a blessed HV reference");
    }
;
#line 3791 "lib/Sys/Guestfs.xs"
      r = guestfs_get_pgroup (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 9387 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_pid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_pid)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3802 "lib/Sys/Guestfs.xs"
      int r;
#line 9405 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_pid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_pid(): g is not a blessed HV reference");
    }
;
#line 3804 "lib/Sys/Guestfs.xs"
      r = guestfs_get_pid (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 9425 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_program); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_program)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3815 "lib/Sys/Guestfs.xs"
      const char *r;
#line 9443 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_program(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_program(): g is not a blessed HV reference");
    }
;
#line 3817 "lib/Sys/Guestfs.xs"
      r = guestfs_get_program (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
#line 9463 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_qemu); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_qemu)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3828 "lib/Sys/Guestfs.xs"
      const char *r;
#line 9481 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_qemu(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_qemu(): g is not a blessed HV reference");
    }
;
#line 3830 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::get_qemu is deprecated; use Sys::Guestfs::get_hv instead");
      r = guestfs_get_qemu (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
#line 9503 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_recovery_proc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_recovery_proc)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3843 "lib/Sys/Guestfs.xs"
      int r;
#line 9521 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_recovery_proc(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_recovery_proc(): g is not a blessed HV reference");
    }
;
#line 3845 "lib/Sys/Guestfs.xs"
      r = guestfs_get_recovery_proc (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 9541 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_selinux); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_selinux)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3856 "lib/Sys/Guestfs.xs"
      int r;
#line 9559 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_selinux(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_selinux(): g is not a blessed HV reference");
    }
;
#line 3858 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::get_selinux is deprecated; use Sys::Guestfs::selinux_relabel instead");
      r = guestfs_get_selinux (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 9581 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_smp); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_smp)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3871 "lib/Sys/Guestfs.xs"
      int r;
#line 9599 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_smp(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_smp(): g is not a blessed HV reference");
    }
;
#line 3873 "lib/Sys/Guestfs.xs"
      r = guestfs_get_smp (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 9619 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_sockdir); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_sockdir)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3884 "lib/Sys/Guestfs.xs"
      char *r;
#line 9637 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_sockdir(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_sockdir(): g is not a blessed HV reference");
    }
;
#line 3886 "lib/Sys/Guestfs.xs"
      r = guestfs_get_sockdir (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 9658 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_state); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_state)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3898 "lib/Sys/Guestfs.xs"
      int r;
#line 9676 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_state(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_state(): g is not a blessed HV reference");
    }
;
#line 3900 "lib/Sys/Guestfs.xs"
      r = guestfs_get_state (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 9696 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_tmpdir); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_tmpdir)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3911 "lib/Sys/Guestfs.xs"
      char *r;
#line 9714 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_tmpdir(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_tmpdir(): g is not a blessed HV reference");
    }
;
#line 3913 "lib/Sys/Guestfs.xs"
      r = guestfs_get_tmpdir (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 9735 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_trace); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_trace)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3925 "lib/Sys/Guestfs.xs"
      int r;
#line 9753 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_trace(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_trace(): g is not a blessed HV reference");
    }
;
#line 3927 "lib/Sys/Guestfs.xs"
      r = guestfs_get_trace (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 9773 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_umask); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_umask)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3938 "lib/Sys/Guestfs.xs"
      int r;
#line 9791 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_umask(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_umask(): g is not a blessed HV reference");
    }
;
#line 3940 "lib/Sys/Guestfs.xs"
      r = guestfs_get_umask (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 9811 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_get_verbose); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_get_verbose)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3951 "lib/Sys/Guestfs.xs"
      int r;
#line 9829 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::get_verbose(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::get_verbose(): g is not a blessed HV reference");
    }
;
#line 3953 "lib/Sys/Guestfs.xs"
      r = guestfs_get_verbose (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 9849 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_getcon); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_getcon)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 3964 "lib/Sys/Guestfs.xs"
      char *r;
#line 9867 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::getcon(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::getcon(): g is not a blessed HV reference");
    }
;
#line 3966 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::getcon is deprecated; use Sys::Guestfs::selinux_relabel instead");
      r = guestfs_getcon (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 9890 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_getxattr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_getxattr)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, name");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	char *	name = (char *)SvPV_nolen(ST(2))
;
#line 3982 "lib/Sys/Guestfs.xs"
      char *r;
      size_t size;
#line 9913 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::getxattr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::getxattr(): g is not a blessed HV reference");
    }
;
#line 3985 "lib/Sys/Guestfs.xs"
      r = guestfs_getxattr (g, path, name, &size);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpvn (r, size);
      free (r);
#line 9934 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_getxattrs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_getxattrs)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 3998 "lib/Sys/Guestfs.xs"
      struct guestfs_xattr_list *r;
      size_t i;
      HV *hv;
#line 9958 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::getxattrs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::getxattrs(): g is not a blessed HV reference");
    }
;
#line 4002 "lib/Sys/Guestfs.xs"
      r = guestfs_getxattrs (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "attrname", 8, newSVpv (r->val[i].attrname, 0), 0);
        (void) hv_store (hv, "attrval", 7, newSVpvn (r->val[i].attrval, r->val[i].attrval_len), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_xattr_list (r);
#line 9984 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_glob_expand); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_glob_expand)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, pattern, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	pattern = (char *)SvPV_nolen(ST(1))
;
#line 4019 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
      struct guestfs_glob_expand_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_glob_expand_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 10009 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::glob_expand(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::glob_expand(): g is not a blessed HV reference");
    }
;
#line 4025 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "directoryslash")) {
          optargs_s.directoryslash = SvIV (ST (items_i+1));
          this_mask = GUESTFS_GLOB_EXPAND_OPTS_DIRECTORYSLASH_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_glob_expand_opts_argv (g, pattern, optargs);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 10052 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_grep); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_grep)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, regex, path, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	regex = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 4060 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
      struct guestfs_grep_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_grep_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 10079 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::grep(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::grep(): g is not a blessed HV reference");
    }
;
#line 4066 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "extended")) {
          optargs_s.extended = SvIV (ST (items_i+1));
          this_mask = GUESTFS_GREP_OPTS_EXTENDED_BITMASK;
        }
        else if (STREQ (this_arg, "fixed")) {
          optargs_s.fixed = SvIV (ST (items_i+1));
          this_mask = GUESTFS_GREP_OPTS_FIXED_BITMASK;
        }
        else if (STREQ (this_arg, "insensitive")) {
          optargs_s.insensitive = SvIV (ST (items_i+1));
          this_mask = GUESTFS_GREP_OPTS_INSENSITIVE_BITMASK;
        }
        else if (STREQ (this_arg, "compressed")) {
          optargs_s.compressed = SvIV (ST (items_i+1));
          this_mask = GUESTFS_GREP_OPTS_COMPRESSED_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_grep_opts_argv (g, regex, path, optargs);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 10134 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_grepi); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_grepi)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, regex, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	regex = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 4113 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 10158 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::grepi(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::grepi(): g is not a blessed HV reference");
    }
;
#line 4116 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::grepi is deprecated; use Sys::Guestfs::grep instead");
      r = guestfs_grepi (g, regex, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 10185 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_grub_install); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_grub_install)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, root, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
	char *	device = (char *)SvPV_nolen(ST(2))
;
#line 4135 "lib/Sys/Guestfs.xs"
      int r;
#line 10208 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::grub_install(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::grub_install(): g is not a blessed HV reference");
    }
;
#line 4137 "lib/Sys/Guestfs.xs"
      r = guestfs_grub_install (g, root, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 10226 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_head); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_head)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 4146 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 10248 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::head(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::head(): g is not a blessed HV reference");
    }
;
#line 4149 "lib/Sys/Guestfs.xs"
      r = guestfs_head (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 10273 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_head_n); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_head_n)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, nrlines, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	nrlines = (int)SvIV(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 4166 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 10297 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::head_n(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::head_n(): g is not a blessed HV reference");
    }
;
#line 4169 "lib/Sys/Guestfs.xs"
      r = guestfs_head_n (g, nrlines, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 10322 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_hexdump); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hexdump)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 4185 "lib/Sys/Guestfs.xs"
      char *r;
#line 10341 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hexdump(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hexdump(): g is not a blessed HV reference");
    }
;
#line 4187 "lib/Sys/Guestfs.xs"
      r = guestfs_hexdump (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 10362 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_hivex_close); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_close)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 4199 "lib/Sys/Guestfs.xs"
      int r;
#line 10382 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_close(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_close(): g is not a blessed HV reference");
    }
;
#line 4201 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_close (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 10400 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_hivex_commit); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_commit)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, filename");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	filename = SvOK(ST(1)) ? SvPV_nolen(ST(1)) : NULL;
#line 4210 "lib/Sys/Guestfs.xs"
      int r;
#line 10420 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_commit(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_commit(): g is not a blessed HV reference");
    }
;
#line 4212 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_commit (g, filename);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 10438 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_hivex_node_add_child); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_node_add_child)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, parent, name");
    {
	guestfs_h *	g;
	int64_t	parent = my_SvIV64 (ST(1))
;
	char *	name = (char *)SvPV_nolen(ST(2))
;
#line 4222 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 10459 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_node_add_child(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_node_add_child(): g is not a blessed HV reference");
    }
;
#line 4224 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_node_add_child (g, parent, name);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 10479 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_hivex_node_children); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_node_children)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, nodeh");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int64_t	nodeh = my_SvIV64 (ST(1))
;
#line 4236 "lib/Sys/Guestfs.xs"
      struct guestfs_hivex_node_list *r;
      size_t i;
      HV *hv;
#line 10503 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_node_children(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_node_children(): g is not a blessed HV reference");
    }
;
#line 4240 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_node_children (g, nodeh);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "hivex_node_h", 12, my_newSVll (r->val[i].hivex_node_h), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_hivex_node_list (r);
#line 10528 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_hivex_node_delete_child); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_node_delete_child)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, nodeh");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int64_t	nodeh = my_SvIV64 (ST(1))
;
#line 4256 "lib/Sys/Guestfs.xs"
      int r;
#line 10549 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_node_delete_child(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_node_delete_child(): g is not a blessed HV reference");
    }
;
#line 4258 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_node_delete_child (g, nodeh);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 10567 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_hivex_node_get_child); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_node_get_child)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, nodeh, name");
    {
	guestfs_h *	g;
	int64_t	nodeh = my_SvIV64 (ST(1))
;
	char *	name = (char *)SvPV_nolen(ST(2))
;
#line 4268 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 10588 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_node_get_child(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_node_get_child(): g is not a blessed HV reference");
    }
;
#line 4270 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_node_get_child (g, nodeh, name);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 10608 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_hivex_node_get_value); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_node_get_value)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, nodeh, key");
    {
	guestfs_h *	g;
	int64_t	nodeh = my_SvIV64 (ST(1))
;
	char *	key = (char *)SvPV_nolen(ST(2))
;
#line 4283 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 10630 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_node_get_value(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_node_get_value(): g is not a blessed HV reference");
    }
;
#line 4285 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_node_get_value (g, nodeh, key);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 10650 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_hivex_node_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_node_name)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, nodeh");
    {
	guestfs_h *	g;
	int64_t	nodeh = my_SvIV64 (ST(1))
;
#line 4297 "lib/Sys/Guestfs.xs"
      char *r;
#line 10670 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_node_name(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_node_name(): g is not a blessed HV reference");
    }
;
#line 4299 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_node_name (g, nodeh);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 10691 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_hivex_node_parent); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_node_parent)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, nodeh");
    {
	guestfs_h *	g;
	int64_t	nodeh = my_SvIV64 (ST(1))
;
#line 4312 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 10711 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_node_parent(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_node_parent(): g is not a blessed HV reference");
    }
;
#line 4314 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_node_parent (g, nodeh);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 10731 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_hivex_node_set_value); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_node_set_value)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "g, nodeh, key, t, val");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int64_t	nodeh = my_SvIV64 (ST(1))
;
	char *	key = (char *)SvPV_nolen(ST(2))
;
	int64_t	t = my_SvIV64 (ST(3))
;
	char *	val = (char *)SvPV_nolen(ST(4))
;
	size_t	val_size = SvCUR (ST(4));
#line 4330 "lib/Sys/Guestfs.xs"
      int r;
#line 10760 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_node_set_value(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_node_set_value(): g is not a blessed HV reference");
    }
;
#line 4332 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_node_set_value (g, nodeh, key, t, val, val_size);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 10778 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_hivex_node_values); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_node_values)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, nodeh");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int64_t	nodeh = my_SvIV64 (ST(1))
;
#line 4341 "lib/Sys/Guestfs.xs"
      struct guestfs_hivex_value_list *r;
      size_t i;
      HV *hv;
#line 10801 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_node_values(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_node_values(): g is not a blessed HV reference");
    }
;
#line 4345 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_node_values (g, nodeh);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "hivex_value_h", 13, my_newSVll (r->val[i].hivex_value_h), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_hivex_value_list (r);
#line 10826 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_hivex_open); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_open)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, filename, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
#line 4361 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_hivex_open_argv optargs_s = { .bitmask = 0 };
      struct guestfs_hivex_open_argv *optargs = &optargs_s;
      size_t items_i;
#line 10850 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_open(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_open(): g is not a blessed HV reference");
    }
;
#line 4366 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "verbose")) {
          optargs_s.verbose = SvIV (ST (items_i+1));
          this_mask = GUESTFS_HIVEX_OPEN_VERBOSE_BITMASK;
        }
        else if (STREQ (this_arg, "debug")) {
          optargs_s.debug = SvIV (ST (items_i+1));
          this_mask = GUESTFS_HIVEX_OPEN_DEBUG_BITMASK;
        }
        else if (STREQ (this_arg, "write")) {
          optargs_s.write = SvIV (ST (items_i+1));
          this_mask = GUESTFS_HIVEX_OPEN_WRITE_BITMASK;
        }
        else if (STREQ (this_arg, "unsafe")) {
          optargs_s.unsafe = SvIV (ST (items_i+1));
          this_mask = GUESTFS_HIVEX_OPEN_UNSAFE_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_hivex_open_argv (g, filename, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 10898 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_hivex_root); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_root)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 4404 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 10915 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_root(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_root(): g is not a blessed HV reference");
    }
;
#line 4406 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_root (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 10935 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_hivex_value_key); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_value_key)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, valueh");
    {
	guestfs_h *	g;
	int64_t	valueh = my_SvIV64 (ST(1))
;
#line 4418 "lib/Sys/Guestfs.xs"
      char *r;
#line 10955 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_value_key(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_value_key(): g is not a blessed HV reference");
    }
;
#line 4420 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_value_key (g, valueh);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 10976 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_hivex_value_string); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_value_string)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, valueh");
    {
	guestfs_h *	g;
	int64_t	valueh = my_SvIV64 (ST(1))
;
#line 4433 "lib/Sys/Guestfs.xs"
      char *r;
#line 10996 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_value_string(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_value_string(): g is not a blessed HV reference");
    }
;
#line 4435 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_value_string (g, valueh);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 11017 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_hivex_value_type); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_value_type)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, valueh");
    {
	guestfs_h *	g;
	int64_t	valueh = my_SvIV64 (ST(1))
;
#line 4448 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 11037 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_value_type(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_value_type(): g is not a blessed HV reference");
    }
;
#line 4450 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_value_type (g, valueh);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 11057 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_hivex_value_utf8); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_value_utf8)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, valueh");
    {
	guestfs_h *	g;
	int64_t	valueh = my_SvIV64 (ST(1))
;
#line 4462 "lib/Sys/Guestfs.xs"
      char *r;
#line 11077 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_value_utf8(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_value_utf8(): g is not a blessed HV reference");
    }
;
#line 4464 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::hivex_value_utf8 is deprecated; use Sys::Guestfs::hivex_value_string instead");
      r = guestfs_hivex_value_utf8 (g, valueh);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 11100 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_hivex_value_value); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_hivex_value_value)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, valueh");
    {
	guestfs_h *	g;
	int64_t	valueh = my_SvIV64 (ST(1))
;
#line 4479 "lib/Sys/Guestfs.xs"
      char *r;
      size_t size;
#line 11121 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::hivex_value_value(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::hivex_value_value(): g is not a blessed HV reference");
    }
;
#line 4482 "lib/Sys/Guestfs.xs"
      r = guestfs_hivex_value_value (g, valueh, &size);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpvn (r, size);
      free (r);
#line 11142 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_initrd_cat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_initrd_cat)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, initrdpath, filename");
    {
	guestfs_h *	g;
	char *	initrdpath = (char *)SvPV_nolen(ST(1))
;
	char *	filename = (char *)SvPV_nolen(ST(2))
;
#line 4496 "lib/Sys/Guestfs.xs"
      char *r;
      size_t size;
#line 11165 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::initrd_cat(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::initrd_cat(): g is not a blessed HV reference");
    }
;
#line 4499 "lib/Sys/Guestfs.xs"
      r = guestfs_initrd_cat (g, initrdpath, filename, &size);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpvn (r, size);
      free (r);
#line 11186 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_initrd_list); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_initrd_list)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 4512 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 11209 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::initrd_list(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::initrd_list(): g is not a blessed HV reference");
    }
;
#line 4515 "lib/Sys/Guestfs.xs"
      r = guestfs_initrd_list (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 11234 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_inotify_add_watch); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inotify_add_watch)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, mask");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	int	mask = (int)SvIV(ST(2))
;
#line 4532 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 11255 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inotify_add_watch(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inotify_add_watch(): g is not a blessed HV reference");
    }
;
#line 4534 "lib/Sys/Guestfs.xs"
      r = guestfs_inotify_add_watch (g, path, mask);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 11275 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inotify_close); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inotify_close)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 4545 "lib/Sys/Guestfs.xs"
      int r;
#line 11295 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inotify_close(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inotify_close(): g is not a blessed HV reference");
    }
;
#line 4547 "lib/Sys/Guestfs.xs"
      r = guestfs_inotify_close (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 11313 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_inotify_files); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inotify_files)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 4555 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 11333 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inotify_files(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inotify_files(): g is not a blessed HV reference");
    }
;
#line 4558 "lib/Sys/Guestfs.xs"
      r = guestfs_inotify_files (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 11358 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_inotify_init); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inotify_init)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, maxevents");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	maxevents = (int)SvIV(ST(1))
;
#line 4574 "lib/Sys/Guestfs.xs"
      int r;
#line 11379 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inotify_init(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inotify_init(): g is not a blessed HV reference");
    }
;
#line 4576 "lib/Sys/Guestfs.xs"
      r = guestfs_inotify_init (g, maxevents);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 11397 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_inotify_read); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inotify_read)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 4584 "lib/Sys/Guestfs.xs"
      struct guestfs_inotify_event_list *r;
      size_t i;
      HV *hv;
#line 11418 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inotify_read(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inotify_read(): g is not a blessed HV reference");
    }
;
#line 4588 "lib/Sys/Guestfs.xs"
      r = guestfs_inotify_read (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "in_wd", 5, my_newSVll (r->val[i].in_wd), 0);
        (void) hv_store (hv, "in_mask", 7, newSVnv (r->val[i].in_mask), 0);
        (void) hv_store (hv, "in_cookie", 9, newSVnv (r->val[i].in_cookie), 0);
        (void) hv_store (hv, "in_name", 7, newSVpv (r->val[i].in_name, 0), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_inotify_event_list (r);
#line 11446 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_inotify_rm_watch); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inotify_rm_watch)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, wd");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	wd = (int)SvIV(ST(1))
;
#line 4607 "lib/Sys/Guestfs.xs"
      int r;
#line 11467 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inotify_rm_watch(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inotify_rm_watch(): g is not a blessed HV reference");
    }
;
#line 4609 "lib/Sys/Guestfs.xs"
      r = guestfs_inotify_rm_watch (g, wd);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 11485 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_arch); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_arch)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4618 "lib/Sys/Guestfs.xs"
      char *r;
#line 11504 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_arch(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_arch(): g is not a blessed HV reference");
    }
;
#line 4620 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_arch (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 11525 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_build_id); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_build_id)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4633 "lib/Sys/Guestfs.xs"
      char *r;
#line 11545 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_build_id(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_build_id(): g is not a blessed HV reference");
    }
;
#line 4635 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_build_id (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 11566 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_distro); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_distro)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4648 "lib/Sys/Guestfs.xs"
      char *r;
#line 11586 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_distro(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_distro(): g is not a blessed HV reference");
    }
;
#line 4650 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_distro (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 11607 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_drive_mappings); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_drive_mappings)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4663 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 11630 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_drive_mappings(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_drive_mappings(): g is not a blessed HV reference");
    }
;
#line 4666 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_drive_mappings (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 11655 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_filesystems); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_filesystems)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4682 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 11677 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_filesystems(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_filesystems(): g is not a blessed HV reference");
    }
;
#line 4685 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_filesystems (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 11702 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_format); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_format)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4701 "lib/Sys/Guestfs.xs"
      char *r;
#line 11721 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_format(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_format(): g is not a blessed HV reference");
    }
;
#line 4703 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::inspect_get_format is deprecated");
      r = guestfs_inspect_get_format (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 11744 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_hostname); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_hostname)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4718 "lib/Sys/Guestfs.xs"
      char *r;
#line 11764 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_hostname(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_hostname(): g is not a blessed HV reference");
    }
;
#line 4720 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_hostname (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 11785 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_icon); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_icon)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, root, ...");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4733 "lib/Sys/Guestfs.xs"
      char *r;
      size_t size;
      struct guestfs_inspect_get_icon_argv optargs_s = { .bitmask = 0 };
      struct guestfs_inspect_get_icon_argv *optargs = &optargs_s;
      size_t items_i;
#line 11809 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_icon(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_icon(): g is not a blessed HV reference");
    }
;
#line 4739 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "favicon")) {
          optargs_s.favicon = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INSPECT_GET_ICON_FAVICON_BITMASK;
        }
        else if (STREQ (this_arg, "highquality")) {
          optargs_s.highquality = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INSPECT_GET_ICON_HIGHQUALITY_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_inspect_get_icon_argv (g, root, &size, optargs);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpvn (r, size);
      free (r);
#line 11852 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_major_version); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_major_version)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4774 "lib/Sys/Guestfs.xs"
      int r;
#line 11872 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_major_version(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_major_version(): g is not a blessed HV reference");
    }
;
#line 4776 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_major_version (g, root);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 11892 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_minor_version); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_minor_version)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4788 "lib/Sys/Guestfs.xs"
      int r;
#line 11912 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_minor_version(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_minor_version(): g is not a blessed HV reference");
    }
;
#line 4790 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_minor_version (g, root);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 11932 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_mountpoints); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_mountpoints)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4802 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 11955 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_mountpoints(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_mountpoints(): g is not a blessed HV reference");
    }
;
#line 4805 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_mountpoints (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 11980 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_osinfo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_osinfo)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4821 "lib/Sys/Guestfs.xs"
      char *r;
#line 11999 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_osinfo(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_osinfo(): g is not a blessed HV reference");
    }
;
#line 4823 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_osinfo (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 12020 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_package_format); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_package_format)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4836 "lib/Sys/Guestfs.xs"
      char *r;
#line 12040 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_package_format(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_package_format(): g is not a blessed HV reference");
    }
;
#line 4838 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_package_format (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 12061 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_package_management); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_package_management)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4851 "lib/Sys/Guestfs.xs"
      char *r;
#line 12081 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_package_management(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_package_management(): g is not a blessed HV reference");
    }
;
#line 4853 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_package_management (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 12102 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_product_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_product_name)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4866 "lib/Sys/Guestfs.xs"
      char *r;
#line 12122 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_product_name(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_product_name(): g is not a blessed HV reference");
    }
;
#line 4868 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_product_name (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 12143 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_product_variant); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_product_variant)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4881 "lib/Sys/Guestfs.xs"
      char *r;
#line 12163 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_product_variant(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_product_variant(): g is not a blessed HV reference");
    }
;
#line 4883 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_product_variant (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 12184 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_roots); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_roots)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 4895 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 12205 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_roots(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_roots(): g is not a blessed HV reference");
    }
;
#line 4898 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_roots (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 12230 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_type); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_type)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4914 "lib/Sys/Guestfs.xs"
      char *r;
#line 12249 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_type(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_type(): g is not a blessed HV reference");
    }
;
#line 4916 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_type (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 12270 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_windows_current_control_set); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_windows_current_control_set)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4929 "lib/Sys/Guestfs.xs"
      char *r;
#line 12290 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_windows_current_control_set(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_windows_current_control_set(): g is not a blessed HV reference");
    }
;
#line 4931 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_windows_current_control_set (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 12311 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_windows_group_policy); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_windows_group_policy)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4944 "lib/Sys/Guestfs.xs"
      int r;
#line 12331 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_windows_group_policy(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_windows_group_policy(): g is not a blessed HV reference");
    }
;
#line 4946 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_windows_group_policy (g, root);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 12351 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_windows_software_hive); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_windows_software_hive)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4958 "lib/Sys/Guestfs.xs"
      char *r;
#line 12371 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_windows_software_hive(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_windows_software_hive(): g is not a blessed HV reference");
    }
;
#line 4960 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_windows_software_hive (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 12392 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_windows_system_hive); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_windows_system_hive)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4973 "lib/Sys/Guestfs.xs"
      char *r;
#line 12412 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_windows_system_hive(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_windows_system_hive(): g is not a blessed HV reference");
    }
;
#line 4975 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_windows_system_hive (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 12433 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_get_windows_systemroot); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_get_windows_systemroot)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 4988 "lib/Sys/Guestfs.xs"
      char *r;
#line 12453 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_get_windows_systemroot(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_get_windows_systemroot(): g is not a blessed HV reference");
    }
;
#line 4990 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_get_windows_systemroot (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 12474 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_is_live); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_is_live)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 5003 "lib/Sys/Guestfs.xs"
      int r;
#line 12494 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_is_live(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_is_live(): g is not a blessed HV reference");
    }
;
#line 5005 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::inspect_is_live is deprecated");
      r = guestfs_inspect_is_live (g, root);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 12516 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_is_multipart); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_is_multipart)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 5019 "lib/Sys/Guestfs.xs"
      int r;
#line 12536 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_is_multipart(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_is_multipart(): g is not a blessed HV reference");
    }
;
#line 5021 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::inspect_is_multipart is deprecated");
      r = guestfs_inspect_is_multipart (g, root);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 12558 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_is_netinst); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_is_netinst)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 5035 "lib/Sys/Guestfs.xs"
      int r;
#line 12578 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_is_netinst(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_is_netinst(): g is not a blessed HV reference");
    }
;
#line 5037 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::inspect_is_netinst is deprecated");
      r = guestfs_inspect_is_netinst (g, root);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 12600 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_inspect_list_applications); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_list_applications)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 5051 "lib/Sys/Guestfs.xs"
      struct guestfs_application_list *r;
      size_t i;
      HV *hv;
#line 12624 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_list_applications(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_list_applications(): g is not a blessed HV reference");
    }
;
#line 5055 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::inspect_list_applications is deprecated; use Sys::Guestfs::inspect_list_applications2 instead");
      r = guestfs_inspect_list_applications (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "app_name", 8, newSVpv (r->val[i].app_name, 0), 0);
        (void) hv_store (hv, "app_display_name", 16, newSVpv (r->val[i].app_display_name, 0), 0);
        (void) hv_store (hv, "app_epoch", 9, newSVnv (r->val[i].app_epoch), 0);
        (void) hv_store (hv, "app_version", 11, newSVpv (r->val[i].app_version, 0), 0);
        (void) hv_store (hv, "app_release", 11, newSVpv (r->val[i].app_release, 0), 0);
        (void) hv_store (hv, "app_install_path", 16, newSVpv (r->val[i].app_install_path, 0), 0);
        (void) hv_store (hv, "app_trans_path", 14, newSVpv (r->val[i].app_trans_path, 0), 0);
        (void) hv_store (hv, "app_publisher", 13, newSVpv (r->val[i].app_publisher, 0), 0);
        (void) hv_store (hv, "app_url", 7, newSVpv (r->val[i].app_url, 0), 0);
        (void) hv_store (hv, "app_source_package", 18, newSVpv (r->val[i].app_source_package, 0), 0);
        (void) hv_store (hv, "app_summary", 11, newSVpv (r->val[i].app_summary, 0), 0);
        (void) hv_store (hv, "app_description", 15, newSVpv (r->val[i].app_description, 0), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_application_list (r);
#line 12662 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_inspect_list_applications2); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_list_applications2)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, root");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	root = (char *)SvPV_nolen(ST(1))
;
#line 5084 "lib/Sys/Guestfs.xs"
      struct guestfs_application2_list *r;
      size_t i;
      HV *hv;
#line 12685 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_list_applications2(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_list_applications2(): g is not a blessed HV reference");
    }
;
#line 5088 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_list_applications2 (g, root);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "app2_name", 9, newSVpv (r->val[i].app2_name, 0), 0);
        (void) hv_store (hv, "app2_display_name", 17, newSVpv (r->val[i].app2_display_name, 0), 0);
        (void) hv_store (hv, "app2_epoch", 10, newSVnv (r->val[i].app2_epoch), 0);
        (void) hv_store (hv, "app2_version", 12, newSVpv (r->val[i].app2_version, 0), 0);
        (void) hv_store (hv, "app2_release", 12, newSVpv (r->val[i].app2_release, 0), 0);
        (void) hv_store (hv, "app2_arch", 9, newSVpv (r->val[i].app2_arch, 0), 0);
        (void) hv_store (hv, "app2_install_path", 17, newSVpv (r->val[i].app2_install_path, 0), 0);
        (void) hv_store (hv, "app2_trans_path", 15, newSVpv (r->val[i].app2_trans_path, 0), 0);
        (void) hv_store (hv, "app2_publisher", 14, newSVpv (r->val[i].app2_publisher, 0), 0);
        (void) hv_store (hv, "app2_url", 8, newSVpv (r->val[i].app2_url, 0), 0);
        (void) hv_store (hv, "app2_source_package", 19, newSVpv (r->val[i].app2_source_package, 0), 0);
        (void) hv_store (hv, "app2_summary", 12, newSVpv (r->val[i].app2_summary, 0), 0);
        (void) hv_store (hv, "app2_description", 16, newSVpv (r->val[i].app2_description, 0), 0);
        (void) hv_store (hv, "app2_class", 10, newSVpv (r->val[i].app2_class, 0), 0);
        (void) hv_store (hv, "app2_spare2", 11, newSVpv (r->val[i].app2_spare2, 0), 0);
        (void) hv_store (hv, "app2_spare3", 11, newSVpv (r->val[i].app2_spare3, 0), 0);
        (void) hv_store (hv, "app2_spare4", 11, newSVpv (r->val[i].app2_spare4, 0), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_application2_list (r);
#line 12726 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_inspect_os); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_inspect_os)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 5119 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 12746 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::inspect_os(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::inspect_os(): g is not a blessed HV reference");
    }
;
#line 5122 "lib/Sys/Guestfs.xs"
      r = guestfs_inspect_os (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 12771 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_internal_exit); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_exit)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 5137 "lib/Sys/Guestfs.xs"
      int r;
#line 12790 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_exit(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_exit(): g is not a blessed HV reference");
    }
;
#line 5139 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_exit (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 12808 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_internal_test); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test)
{
    dVAR; dXSARGS;
    if (items < 10)
       croak_xs_usage(cv,  "g, str, optstr, strlist, b, integer, integer64, filein, fileout, bufferin, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	str = (char *)SvPV_nolen(ST(1))
;
	char *	optstr = SvOK(ST(2)) ? SvPV_nolen(ST(2)) : NULL;
	char **	strlist = XS_unpack_charPtrPtr(ST(3))
;
	int	b = (int)SvIV(ST(4))
;
	int	integer = (int)SvIV(ST(5))
;
	int64_t	integer64 = my_SvIV64 (ST(6))
;
	char *	filein = (char *)SvPV_nolen(ST(7))
;
	char *	fileout = (char *)SvPV_nolen(ST(8))
;
	char *	bufferin = (char *)SvPV_nolen(ST(9))
;
	size_t	bufferin_size = SvCUR (ST(9));
#line 5157 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_internal_test_argv optargs_s = { .bitmask = 0 };
      struct guestfs_internal_test_argv *optargs = &optargs_s;
      size_t items_i;
#line 12848 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test(): g is not a blessed HV reference");
    }
;
#line 5162 "lib/Sys/Guestfs.xs"
      if (((items - 10) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 10; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "obool")) {
          optargs_s.obool = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_OBOOL_BITMASK;
        }
        else if (STREQ (this_arg, "oint")) {
          optargs_s.oint = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_OINT_BITMASK;
        }
        else if (STREQ (this_arg, "oint64")) {
          optargs_s.oint64 = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_OINT64_BITMASK;
        }
        else if (STREQ (this_arg, "ostring")) {
          optargs_s.ostring = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_OSTRING_BITMASK;
        }
        else if (STREQ (this_arg, "ostringlist")) {
          size_t i, len;
          char **r;
          SV *arg;
          AV *av;
          SV **svp;

          arg = ST (items_i+1);
          if (!SvROK (arg) || SvTYPE (SvRV (arg)) != SVt_PVAV)
            croak ("array reference expected for '%s' argument", "ostringlist");
          av = (AV *) SvRV (ST (items_i+1));

          /* Note av_len returns index of final element. */
          len = av_len (av) + 1;

          r = malloc ((len+1) * sizeof (char *));
          if (r == NULL) croak ("malloc: %m");
          for (i = 0; i < len; ++i) {
            svp = av_fetch (av, i, 0);
            r[i] = SvPV_nolen (*svp);
          }
          r[i] = NULL;
          optargs_s.ostringlist = r;
          this_mask = GUESTFS_INTERNAL_TEST_OSTRINGLIST_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_internal_test_argv (g, str, optstr, strlist, b, integer, integer64, filein, fileout, bufferin, bufferin_size, optargs);
      free (strlist);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 12922 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_63_optargs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_63_optargs)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "g, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 5226 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_internal_test_63_optargs_argv optargs_s = { .bitmask = 0 };
      struct guestfs_internal_test_63_optargs_argv *optargs = &optargs_s;
      size_t items_i;
#line 12944 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_63_optargs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_63_optargs(): g is not a blessed HV reference");
    }
;
#line 5231 "lib/Sys/Guestfs.xs"
      if (((items - 1) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 1; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "opt1")) {
          optargs_s.opt1 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT1_BITMASK;
        }
        else if (STREQ (this_arg, "opt2")) {
          optargs_s.opt2 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT2_BITMASK;
        }
        else if (STREQ (this_arg, "opt3")) {
          optargs_s.opt3 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT3_BITMASK;
        }
        else if (STREQ (this_arg, "opt4")) {
          optargs_s.opt4 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT4_BITMASK;
        }
        else if (STREQ (this_arg, "opt5")) {
          optargs_s.opt5 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT5_BITMASK;
        }
        else if (STREQ (this_arg, "opt6")) {
          optargs_s.opt6 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT6_BITMASK;
        }
        else if (STREQ (this_arg, "opt7")) {
          optargs_s.opt7 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT7_BITMASK;
        }
        else if (STREQ (this_arg, "opt8")) {
          optargs_s.opt8 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT8_BITMASK;
        }
        else if (STREQ (this_arg, "opt9")) {
          optargs_s.opt9 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT9_BITMASK;
        }
        else if (STREQ (this_arg, "opt10")) {
          optargs_s.opt10 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT10_BITMASK;
        }
        else if (STREQ (this_arg, "opt11")) {
          optargs_s.opt11 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT11_BITMASK;
        }
        else if (STREQ (this_arg, "opt12")) {
          optargs_s.opt12 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT12_BITMASK;
        }
        else if (STREQ (this_arg, "opt13")) {
          optargs_s.opt13 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT13_BITMASK;
        }
        else if (STREQ (this_arg, "opt14")) {
          optargs_s.opt14 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT14_BITMASK;
        }
        else if (STREQ (this_arg, "opt15")) {
          optargs_s.opt15 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT15_BITMASK;
        }
        else if (STREQ (this_arg, "opt16")) {
          optargs_s.opt16 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT16_BITMASK;
        }
        else if (STREQ (this_arg, "opt17")) {
          optargs_s.opt17 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT17_BITMASK;
        }
        else if (STREQ (this_arg, "opt18")) {
          optargs_s.opt18 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT18_BITMASK;
        }
        else if (STREQ (this_arg, "opt19")) {
          optargs_s.opt19 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT19_BITMASK;
        }
        else if (STREQ (this_arg, "opt20")) {
          optargs_s.opt20 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT20_BITMASK;
        }
        else if (STREQ (this_arg, "opt21")) {
          optargs_s.opt21 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT21_BITMASK;
        }
        else if (STREQ (this_arg, "opt22")) {
          optargs_s.opt22 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT22_BITMASK;
        }
        else if (STREQ (this_arg, "opt23")) {
          optargs_s.opt23 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT23_BITMASK;
        }
        else if (STREQ (this_arg, "opt24")) {
          optargs_s.opt24 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT24_BITMASK;
        }
        else if (STREQ (this_arg, "opt25")) {
          optargs_s.opt25 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT25_BITMASK;
        }
        else if (STREQ (this_arg, "opt26")) {
          optargs_s.opt26 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT26_BITMASK;
        }
        else if (STREQ (this_arg, "opt27")) {
          optargs_s.opt27 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT27_BITMASK;
        }
        else if (STREQ (this_arg, "opt28")) {
          optargs_s.opt28 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT28_BITMASK;
        }
        else if (STREQ (this_arg, "opt29")) {
          optargs_s.opt29 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT29_BITMASK;
        }
        else if (STREQ (this_arg, "opt30")) {
          optargs_s.opt30 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT30_BITMASK;
        }
        else if (STREQ (this_arg, "opt31")) {
          optargs_s.opt31 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT31_BITMASK;
        }
        else if (STREQ (this_arg, "opt32")) {
          optargs_s.opt32 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT32_BITMASK;
        }
        else if (STREQ (this_arg, "opt33")) {
          optargs_s.opt33 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT33_BITMASK;
        }
        else if (STREQ (this_arg, "opt34")) {
          optargs_s.opt34 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT34_BITMASK;
        }
        else if (STREQ (this_arg, "opt35")) {
          optargs_s.opt35 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT35_BITMASK;
        }
        else if (STREQ (this_arg, "opt36")) {
          optargs_s.opt36 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT36_BITMASK;
        }
        else if (STREQ (this_arg, "opt37")) {
          optargs_s.opt37 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT37_BITMASK;
        }
        else if (STREQ (this_arg, "opt38")) {
          optargs_s.opt38 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT38_BITMASK;
        }
        else if (STREQ (this_arg, "opt39")) {
          optargs_s.opt39 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT39_BITMASK;
        }
        else if (STREQ (this_arg, "opt40")) {
          optargs_s.opt40 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT40_BITMASK;
        }
        else if (STREQ (this_arg, "opt41")) {
          optargs_s.opt41 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT41_BITMASK;
        }
        else if (STREQ (this_arg, "opt42")) {
          optargs_s.opt42 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT42_BITMASK;
        }
        else if (STREQ (this_arg, "opt43")) {
          optargs_s.opt43 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT43_BITMASK;
        }
        else if (STREQ (this_arg, "opt44")) {
          optargs_s.opt44 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT44_BITMASK;
        }
        else if (STREQ (this_arg, "opt45")) {
          optargs_s.opt45 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT45_BITMASK;
        }
        else if (STREQ (this_arg, "opt46")) {
          optargs_s.opt46 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT46_BITMASK;
        }
        else if (STREQ (this_arg, "opt47")) {
          optargs_s.opt47 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT47_BITMASK;
        }
        else if (STREQ (this_arg, "opt48")) {
          optargs_s.opt48 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT48_BITMASK;
        }
        else if (STREQ (this_arg, "opt49")) {
          optargs_s.opt49 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT49_BITMASK;
        }
        else if (STREQ (this_arg, "opt50")) {
          optargs_s.opt50 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT50_BITMASK;
        }
        else if (STREQ (this_arg, "opt51")) {
          optargs_s.opt51 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT51_BITMASK;
        }
        else if (STREQ (this_arg, "opt52")) {
          optargs_s.opt52 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT52_BITMASK;
        }
        else if (STREQ (this_arg, "opt53")) {
          optargs_s.opt53 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT53_BITMASK;
        }
        else if (STREQ (this_arg, "opt54")) {
          optargs_s.opt54 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT54_BITMASK;
        }
        else if (STREQ (this_arg, "opt55")) {
          optargs_s.opt55 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT55_BITMASK;
        }
        else if (STREQ (this_arg, "opt56")) {
          optargs_s.opt56 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT56_BITMASK;
        }
        else if (STREQ (this_arg, "opt57")) {
          optargs_s.opt57 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT57_BITMASK;
        }
        else if (STREQ (this_arg, "opt58")) {
          optargs_s.opt58 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT58_BITMASK;
        }
        else if (STREQ (this_arg, "opt59")) {
          optargs_s.opt59 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT59_BITMASK;
        }
        else if (STREQ (this_arg, "opt60")) {
          optargs_s.opt60 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT60_BITMASK;
        }
        else if (STREQ (this_arg, "opt61")) {
          optargs_s.opt61 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT61_BITMASK;
        }
        else if (STREQ (this_arg, "opt62")) {
          optargs_s.opt62 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT62_BITMASK;
        }
        else if (STREQ (this_arg, "opt63")) {
          optargs_s.opt63 = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_63_OPTARGS_OPT63_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_internal_test_63_optargs_argv (g, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 13228 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_close_output); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_close_output)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 5505 "lib/Sys/Guestfs.xs"
      int r;
#line 13247 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_close_output(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_close_output(): g is not a blessed HV reference");
    }
;
#line 5507 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_close_output (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 13265 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_only_optargs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_only_optargs)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "g, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 5515 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_internal_test_only_optargs_argv optargs_s = { .bitmask = 0 };
      struct guestfs_internal_test_only_optargs_argv *optargs = &optargs_s;
      size_t items_i;
#line 13287 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_only_optargs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_only_optargs(): g is not a blessed HV reference");
    }
;
#line 5520 "lib/Sys/Guestfs.xs"
      if (((items - 1) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 1; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "test")) {
          optargs_s.test = SvIV (ST (items_i+1));
          this_mask = GUESTFS_INTERNAL_TEST_ONLY_OPTARGS_TEST_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_internal_test_only_optargs_argv (g, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 13323 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rbool); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rbool)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, val");
    {
	guestfs_h *	g;
	char *	val = (char *)SvPV_nolen(ST(1))
;
#line 5547 "lib/Sys/Guestfs.xs"
      int r;
#line 13342 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rbool(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rbool(): g is not a blessed HV reference");
    }
;
#line 5549 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rbool (g, val);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 13362 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rboolerr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rboolerr)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 5560 "lib/Sys/Guestfs.xs"
      int r;
#line 13380 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rboolerr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rboolerr(): g is not a blessed HV reference");
    }
;
#line 5562 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rboolerr (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 13400 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rbufferout); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rbufferout)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, val");
    {
	guestfs_h *	g;
	char *	val = (char *)SvPV_nolen(ST(1))
;
#line 5574 "lib/Sys/Guestfs.xs"
      char *r;
      size_t size;
#line 13421 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rbufferout(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rbufferout(): g is not a blessed HV reference");
    }
;
#line 5577 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rbufferout (g, val, &size);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpvn (r, size);
      free (r);
#line 13442 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rbufferouterr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rbufferouterr)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 5589 "lib/Sys/Guestfs.xs"
      char *r;
      size_t size;
#line 13461 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rbufferouterr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rbufferouterr(): g is not a blessed HV reference");
    }
;
#line 5592 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rbufferouterr (g, &size);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpvn (r, size);
      free (r);
#line 13482 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rconstoptstring); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rconstoptstring)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, val");
    {
	guestfs_h *	g;
	char *	val = (char *)SvPV_nolen(ST(1))
;
#line 5605 "lib/Sys/Guestfs.xs"
      const char *r;
#line 13502 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rconstoptstring(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rconstoptstring(): g is not a blessed HV reference");
    }
;
#line 5607 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rconstoptstring (g, val);
      if (r == NULL)
        RETVAL = &PL_sv_undef;
      else
        RETVAL = newSVpv (r, 0);
#line 13523 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rconstoptstringerr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rconstoptstringerr)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 5619 "lib/Sys/Guestfs.xs"
      const char *r;
#line 13541 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rconstoptstringerr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rconstoptstringerr(): g is not a blessed HV reference");
    }
;
#line 5621 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rconstoptstringerr (g);
      if (r == NULL)
        RETVAL = &PL_sv_undef;
      else
        RETVAL = newSVpv (r, 0);
#line 13562 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rconststring); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rconststring)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, val");
    {
	guestfs_h *	g;
	char *	val = (char *)SvPV_nolen(ST(1))
;
#line 5634 "lib/Sys/Guestfs.xs"
      const char *r;
#line 13582 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rconststring(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rconststring(): g is not a blessed HV reference");
    }
;
#line 5636 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rconststring (g, val);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
#line 13602 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rconststringerr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rconststringerr)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 5647 "lib/Sys/Guestfs.xs"
      const char *r;
#line 13620 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rconststringerr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rconststringerr(): g is not a blessed HV reference");
    }
;
#line 5649 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rconststringerr (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
#line 13640 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rhashtable); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rhashtable)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, val");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	val = (char *)SvPV_nolen(ST(1))
;
#line 5661 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 13663 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rhashtable(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rhashtable(): g is not a blessed HV reference");
    }
;
#line 5664 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rhashtable (g, val);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 13688 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rhashtableerr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rhashtableerr)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 5679 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 13708 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rhashtableerr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rhashtableerr(): g is not a blessed HV reference");
    }
;
#line 5682 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rhashtableerr (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 13733 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rint); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rint)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, val");
    {
	guestfs_h *	g;
	char *	val = (char *)SvPV_nolen(ST(1))
;
#line 5698 "lib/Sys/Guestfs.xs"
      int r;
#line 13752 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rint(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rint(): g is not a blessed HV reference");
    }
;
#line 5700 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rint (g, val);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 13772 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rint64); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rint64)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, val");
    {
	guestfs_h *	g;
	char *	val = (char *)SvPV_nolen(ST(1))
;
#line 5712 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 13792 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rint64(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rint64(): g is not a blessed HV reference");
    }
;
#line 5714 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rint64 (g, val);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 13812 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rint64err); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rint64err)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 5725 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 13830 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rint64err(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rint64err(): g is not a blessed HV reference");
    }
;
#line 5727 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rint64err (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 13850 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rinterr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rinterr)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 5738 "lib/Sys/Guestfs.xs"
      int r;
#line 13868 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rinterr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rinterr(): g is not a blessed HV reference");
    }
;
#line 5740 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rinterr (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 13888 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rstring); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rstring)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, val");
    {
	guestfs_h *	g;
	char *	val = (char *)SvPV_nolen(ST(1))
;
#line 5752 "lib/Sys/Guestfs.xs"
      char *r;
#line 13908 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rstring(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rstring(): g is not a blessed HV reference");
    }
;
#line 5754 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rstring (g, val);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 13929 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rstringerr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rstringerr)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 5766 "lib/Sys/Guestfs.xs"
      char *r;
#line 13947 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rstringerr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rstringerr(): g is not a blessed HV reference");
    }
;
#line 5768 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rstringerr (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 13968 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rstringlist); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rstringlist)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, val");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	val = (char *)SvPV_nolen(ST(1))
;
#line 5781 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 13991 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rstringlist(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rstringlist(): g is not a blessed HV reference");
    }
;
#line 5784 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rstringlist (g, val);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 14016 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rstringlisterr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rstringlisterr)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 5799 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 14036 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rstringlisterr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rstringlisterr(): g is not a blessed HV reference");
    }
;
#line 5802 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rstringlisterr (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 14061 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rstruct); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rstruct)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, val");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	val = (char *)SvPV_nolen(ST(1))
;
#line 5818 "lib/Sys/Guestfs.xs"
      struct guestfs_lvm_pv *r;
#line 14082 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rstruct(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rstruct(): g is not a blessed HV reference");
    }
;
#line 5820 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rstruct (g, val);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 14);
      PUSHs (sv_2mortal (newSVpv ("pv_name", 0)));
      PUSHs (sv_2mortal (newSVpv (r->pv_name, 0)));
      PUSHs (sv_2mortal (newSVpv ("pv_uuid", 0)));
      PUSHs (sv_2mortal (newSVpv (r->pv_uuid, 32)));
      PUSHs (sv_2mortal (newSVpv ("pv_fmt", 0)));
      PUSHs (sv_2mortal (newSVpv (r->pv_fmt, 0)));
      PUSHs (sv_2mortal (newSVpv ("pv_size", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->pv_size)));
      PUSHs (sv_2mortal (newSVpv ("dev_size", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->dev_size)));
      PUSHs (sv_2mortal (newSVpv ("pv_free", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->pv_free)));
      PUSHs (sv_2mortal (newSVpv ("pv_used", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->pv_used)));
      PUSHs (sv_2mortal (newSVpv ("pv_attr", 0)));
      PUSHs (sv_2mortal (newSVpv (r->pv_attr, 0)));
      PUSHs (sv_2mortal (newSVpv ("pv_pe_count", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->pv_pe_count)));
      PUSHs (sv_2mortal (newSVpv ("pv_pe_alloc_count", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->pv_pe_alloc_count)));
      PUSHs (sv_2mortal (newSVpv ("pv_tags", 0)));
      PUSHs (sv_2mortal (newSVpv (r->pv_tags, 0)));
      PUSHs (sv_2mortal (newSVpv ("pe_start", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->pe_start)));
      PUSHs (sv_2mortal (newSVpv ("pv_mda_count", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->pv_mda_count)));
      PUSHs (sv_2mortal (newSVpv ("pv_mda_free", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->pv_mda_free)));
      guestfs_free_lvm_pv (r);
#line 14130 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rstructerr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rstructerr)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 5858 "lib/Sys/Guestfs.xs"
      struct guestfs_lvm_pv *r;
#line 14149 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rstructerr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rstructerr(): g is not a blessed HV reference");
    }
;
#line 5860 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rstructerr (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 14);
      PUSHs (sv_2mortal (newSVpv ("pv_name", 0)));
      PUSHs (sv_2mortal (newSVpv (r->pv_name, 0)));
      PUSHs (sv_2mortal (newSVpv ("pv_uuid", 0)));
      PUSHs (sv_2mortal (newSVpv (r->pv_uuid, 32)));
      PUSHs (sv_2mortal (newSVpv ("pv_fmt", 0)));
      PUSHs (sv_2mortal (newSVpv (r->pv_fmt, 0)));
      PUSHs (sv_2mortal (newSVpv ("pv_size", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->pv_size)));
      PUSHs (sv_2mortal (newSVpv ("dev_size", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->dev_size)));
      PUSHs (sv_2mortal (newSVpv ("pv_free", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->pv_free)));
      PUSHs (sv_2mortal (newSVpv ("pv_used", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->pv_used)));
      PUSHs (sv_2mortal (newSVpv ("pv_attr", 0)));
      PUSHs (sv_2mortal (newSVpv (r->pv_attr, 0)));
      PUSHs (sv_2mortal (newSVpv ("pv_pe_count", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->pv_pe_count)));
      PUSHs (sv_2mortal (newSVpv ("pv_pe_alloc_count", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->pv_pe_alloc_count)));
      PUSHs (sv_2mortal (newSVpv ("pv_tags", 0)));
      PUSHs (sv_2mortal (newSVpv (r->pv_tags, 0)));
      PUSHs (sv_2mortal (newSVpv ("pe_start", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->pe_start)));
      PUSHs (sv_2mortal (newSVpv ("pv_mda_count", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->pv_mda_count)));
      PUSHs (sv_2mortal (newSVpv ("pv_mda_free", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->pv_mda_free)));
      guestfs_free_lvm_pv (r);
#line 14197 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rstructlist); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rstructlist)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, val");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	val = (char *)SvPV_nolen(ST(1))
;
#line 5899 "lib/Sys/Guestfs.xs"
      struct guestfs_lvm_pv_list *r;
      size_t i;
      HV *hv;
#line 14220 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rstructlist(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rstructlist(): g is not a blessed HV reference");
    }
;
#line 5903 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rstructlist (g, val);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "pv_name", 7, newSVpv (r->val[i].pv_name, 0), 0);
        (void) hv_store (hv, "pv_uuid", 7, newSVpv (r->val[i].pv_uuid, 32), 0);
        (void) hv_store (hv, "pv_fmt", 6, newSVpv (r->val[i].pv_fmt, 0), 0);
        (void) hv_store (hv, "pv_size", 7, my_newSVull (r->val[i].pv_size), 0);
        (void) hv_store (hv, "dev_size", 8, my_newSVull (r->val[i].dev_size), 0);
        (void) hv_store (hv, "pv_free", 7, my_newSVull (r->val[i].pv_free), 0);
        (void) hv_store (hv, "pv_used", 7, my_newSVull (r->val[i].pv_used), 0);
        (void) hv_store (hv, "pv_attr", 7, newSVpv (r->val[i].pv_attr, 0), 0);
        (void) hv_store (hv, "pv_pe_count", 11, my_newSVll (r->val[i].pv_pe_count), 0);
        (void) hv_store (hv, "pv_pe_alloc_count", 17, my_newSVll (r->val[i].pv_pe_alloc_count), 0);
        (void) hv_store (hv, "pv_tags", 7, newSVpv (r->val[i].pv_tags, 0), 0);
        (void) hv_store (hv, "pe_start", 8, my_newSVull (r->val[i].pe_start), 0);
        (void) hv_store (hv, "pv_mda_count", 12, my_newSVll (r->val[i].pv_mda_count), 0);
        (void) hv_store (hv, "pv_mda_free", 11, my_newSVull (r->val[i].pv_mda_free), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_lvm_pv_list (r);
#line 14258 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_rstructlisterr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_rstructlisterr)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 5931 "lib/Sys/Guestfs.xs"
      struct guestfs_lvm_pv_list *r;
      size_t i;
      HV *hv;
#line 14279 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_rstructlisterr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_rstructlisterr(): g is not a blessed HV reference");
    }
;
#line 5935 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_rstructlisterr (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "pv_name", 7, newSVpv (r->val[i].pv_name, 0), 0);
        (void) hv_store (hv, "pv_uuid", 7, newSVpv (r->val[i].pv_uuid, 32), 0);
        (void) hv_store (hv, "pv_fmt", 6, newSVpv (r->val[i].pv_fmt, 0), 0);
        (void) hv_store (hv, "pv_size", 7, my_newSVull (r->val[i].pv_size), 0);
        (void) hv_store (hv, "dev_size", 8, my_newSVull (r->val[i].dev_size), 0);
        (void) hv_store (hv, "pv_free", 7, my_newSVull (r->val[i].pv_free), 0);
        (void) hv_store (hv, "pv_used", 7, my_newSVull (r->val[i].pv_used), 0);
        (void) hv_store (hv, "pv_attr", 7, newSVpv (r->val[i].pv_attr, 0), 0);
        (void) hv_store (hv, "pv_pe_count", 11, my_newSVll (r->val[i].pv_pe_count), 0);
        (void) hv_store (hv, "pv_pe_alloc_count", 17, my_newSVll (r->val[i].pv_pe_alloc_count), 0);
        (void) hv_store (hv, "pv_tags", 7, newSVpv (r->val[i].pv_tags, 0), 0);
        (void) hv_store (hv, "pe_start", 8, my_newSVull (r->val[i].pe_start), 0);
        (void) hv_store (hv, "pv_mda_count", 12, my_newSVll (r->val[i].pv_mda_count), 0);
        (void) hv_store (hv, "pv_mda_free", 11, my_newSVull (r->val[i].pv_mda_free), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_lvm_pv_list (r);
#line 14317 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_internal_test_set_output); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_internal_test_set_output)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, filename");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
#line 5964 "lib/Sys/Guestfs.xs"
      int r;
#line 14338 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::internal_test_set_output(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::internal_test_set_output(): g is not a blessed HV reference");
    }
;
#line 5966 "lib/Sys/Guestfs.xs"
      r = guestfs_internal_test_set_output (g, filename);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 14356 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_is_blockdev); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_blockdev)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, path, ...");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 5975 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_is_blockdev_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_is_blockdev_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 14378 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_blockdev(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_blockdev(): g is not a blessed HV reference");
    }
;
#line 5980 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "followsymlinks")) {
          optargs_s.followsymlinks = SvIV (ST (items_i+1));
          this_mask = GUESTFS_IS_BLOCKDEV_OPTS_FOLLOWSYMLINKS_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_is_blockdev_opts_argv (g, path, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 14416 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_is_busy); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_busy)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 6009 "lib/Sys/Guestfs.xs"
      int r;
#line 14434 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_busy(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_busy(): g is not a blessed HV reference");
    }
;
#line 6011 "lib/Sys/Guestfs.xs"
      r = guestfs_is_busy (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 14454 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_is_chardev); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_chardev)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, path, ...");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 6023 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_is_chardev_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_is_chardev_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 14477 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_chardev(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_chardev(): g is not a blessed HV reference");
    }
;
#line 6028 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "followsymlinks")) {
          optargs_s.followsymlinks = SvIV (ST (items_i+1));
          this_mask = GUESTFS_IS_CHARDEV_OPTS_FOLLOWSYMLINKS_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_is_chardev_opts_argv (g, path, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 14515 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_is_config); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_config)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 6057 "lib/Sys/Guestfs.xs"
      int r;
#line 14533 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_config(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_config(): g is not a blessed HV reference");
    }
;
#line 6059 "lib/Sys/Guestfs.xs"
      r = guestfs_is_config (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 14553 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_is_dir); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_dir)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, path, ...");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 6071 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_is_dir_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_is_dir_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 14576 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_dir(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_dir(): g is not a blessed HV reference");
    }
;
#line 6076 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "followsymlinks")) {
          optargs_s.followsymlinks = SvIV (ST (items_i+1));
          this_mask = GUESTFS_IS_DIR_OPTS_FOLLOWSYMLINKS_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_is_dir_opts_argv (g, path, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 14614 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_is_fifo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_fifo)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, path, ...");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 6106 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_is_fifo_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_is_fifo_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 14637 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_fifo(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_fifo(): g is not a blessed HV reference");
    }
;
#line 6111 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "followsymlinks")) {
          optargs_s.followsymlinks = SvIV (ST (items_i+1));
          this_mask = GUESTFS_IS_FIFO_OPTS_FOLLOWSYMLINKS_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_is_fifo_opts_argv (g, path, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 14675 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_is_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_file)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, path, ...");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 6141 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_is_file_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_is_file_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 14698 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_file(): g is not a blessed HV reference");
    }
;
#line 6146 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "followsymlinks")) {
          optargs_s.followsymlinks = SvIV (ST (items_i+1));
          this_mask = GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_is_file_opts_argv (g, path, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 14736 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_is_launching); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_launching)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 6175 "lib/Sys/Guestfs.xs"
      int r;
#line 14754 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_launching(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_launching(): g is not a blessed HV reference");
    }
;
#line 6177 "lib/Sys/Guestfs.xs"
      r = guestfs_is_launching (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 14774 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_is_lv); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_lv)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, mountable");
    {
	guestfs_h *	g;
	char *	mountable = (char *)SvPV_nolen(ST(1))
;
#line 6189 "lib/Sys/Guestfs.xs"
      int r;
#line 14794 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_lv(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_lv(): g is not a blessed HV reference");
    }
;
#line 6191 "lib/Sys/Guestfs.xs"
      r = guestfs_is_lv (g, mountable);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 14814 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_is_ready); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_ready)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 6202 "lib/Sys/Guestfs.xs"
      int r;
#line 14832 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_ready(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_ready(): g is not a blessed HV reference");
    }
;
#line 6204 "lib/Sys/Guestfs.xs"
      r = guestfs_is_ready (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 14852 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_is_socket); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_socket)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, path, ...");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 6216 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_is_socket_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_is_socket_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 14875 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_socket(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_socket(): g is not a blessed HV reference");
    }
;
#line 6221 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "followsymlinks")) {
          optargs_s.followsymlinks = SvIV (ST (items_i+1));
          this_mask = GUESTFS_IS_SOCKET_OPTS_FOLLOWSYMLINKS_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_is_socket_opts_argv (g, path, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 14913 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_is_symlink); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_symlink)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 6251 "lib/Sys/Guestfs.xs"
      int r;
#line 14933 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_symlink(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_symlink(): g is not a blessed HV reference");
    }
;
#line 6253 "lib/Sys/Guestfs.xs"
      r = guestfs_is_symlink (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 14953 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_is_whole_device); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_whole_device)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 6265 "lib/Sys/Guestfs.xs"
      int r;
#line 14973 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_whole_device(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_whole_device(): g is not a blessed HV reference");
    }
;
#line 6267 "lib/Sys/Guestfs.xs"
      r = guestfs_is_whole_device (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 14993 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_is_zero); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_zero)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 6279 "lib/Sys/Guestfs.xs"
      int r;
#line 15013 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_zero(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_zero(): g is not a blessed HV reference");
    }
;
#line 6281 "lib/Sys/Guestfs.xs"
      r = guestfs_is_zero (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 15033 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_is_zero_device); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_is_zero_device)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 6293 "lib/Sys/Guestfs.xs"
      int r;
#line 15053 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::is_zero_device(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::is_zero_device(): g is not a blessed HV reference");
    }
;
#line 6295 "lib/Sys/Guestfs.xs"
      r = guestfs_is_zero_device (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 15073 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_isoinfo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_isoinfo)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, isofile");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	isofile = (char *)SvPV_nolen(ST(1))
;
#line 6307 "lib/Sys/Guestfs.xs"
      struct guestfs_isoinfo *r;
#line 15095 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::isoinfo(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::isoinfo(): g is not a blessed HV reference");
    }
;
#line 6309 "lib/Sys/Guestfs.xs"
      r = guestfs_isoinfo (g, isofile);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 17);
      PUSHs (sv_2mortal (newSVpv ("iso_system_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_system_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_volume_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_space_size", 0)));
      PUSHs (sv_2mortal (newSVnv (r->iso_volume_space_size)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_set_size", 0)));
      PUSHs (sv_2mortal (newSVnv (r->iso_volume_set_size)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_sequence_number", 0)));
      PUSHs (sv_2mortal (newSVnv (r->iso_volume_sequence_number)));
      PUSHs (sv_2mortal (newSVpv ("iso_logical_block_size", 0)));
      PUSHs (sv_2mortal (newSVnv (r->iso_logical_block_size)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_set_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_volume_set_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_publisher_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_publisher_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_data_preparer_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_data_preparer_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_application_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_application_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_copyright_file_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_copyright_file_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_abstract_file_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_abstract_file_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_bibliographic_file_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_bibliographic_file_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_creation_t", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->iso_volume_creation_t)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_modification_t", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->iso_volume_modification_t)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_expiration_t", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->iso_volume_expiration_t)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_effective_t", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->iso_volume_effective_t)));
      guestfs_free_isoinfo (r);
#line 15149 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_isoinfo_device); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_isoinfo_device)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 6354 "lib/Sys/Guestfs.xs"
      struct guestfs_isoinfo *r;
#line 15170 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::isoinfo_device(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::isoinfo_device(): g is not a blessed HV reference");
    }
;
#line 6356 "lib/Sys/Guestfs.xs"
      r = guestfs_isoinfo_device (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 17);
      PUSHs (sv_2mortal (newSVpv ("iso_system_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_system_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_volume_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_space_size", 0)));
      PUSHs (sv_2mortal (newSVnv (r->iso_volume_space_size)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_set_size", 0)));
      PUSHs (sv_2mortal (newSVnv (r->iso_volume_set_size)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_sequence_number", 0)));
      PUSHs (sv_2mortal (newSVnv (r->iso_volume_sequence_number)));
      PUSHs (sv_2mortal (newSVpv ("iso_logical_block_size", 0)));
      PUSHs (sv_2mortal (newSVnv (r->iso_logical_block_size)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_set_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_volume_set_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_publisher_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_publisher_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_data_preparer_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_data_preparer_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_application_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_application_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_copyright_file_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_copyright_file_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_abstract_file_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_abstract_file_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_bibliographic_file_id", 0)));
      PUSHs (sv_2mortal (newSVpv (r->iso_bibliographic_file_id, 0)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_creation_t", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->iso_volume_creation_t)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_modification_t", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->iso_volume_modification_t)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_expiration_t", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->iso_volume_expiration_t)));
      PUSHs (sv_2mortal (newSVpv ("iso_volume_effective_t", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->iso_volume_effective_t)));
      guestfs_free_isoinfo (r);
#line 15224 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_journal_close); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_journal_close)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6400 "lib/Sys/Guestfs.xs"
      int r;
#line 15243 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::journal_close(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::journal_close(): g is not a blessed HV reference");
    }
;
#line 6402 "lib/Sys/Guestfs.xs"
      r = guestfs_journal_close (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 15261 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_journal_get); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_journal_get)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6410 "lib/Sys/Guestfs.xs"
      struct guestfs_xattr_list *r;
      size_t i;
      HV *hv;
#line 15282 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::journal_get(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::journal_get(): g is not a blessed HV reference");
    }
;
#line 6414 "lib/Sys/Guestfs.xs"
      r = guestfs_journal_get (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "attrname", 8, newSVpv (r->val[i].attrname, 0), 0);
        (void) hv_store (hv, "attrval", 7, newSVpvn (r->val[i].attrval, r->val[i].attrval_len), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_xattr_list (r);
#line 15308 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_journal_get_data_threshold); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_journal_get_data_threshold)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 6430 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 15325 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::journal_get_data_threshold(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::journal_get_data_threshold(): g is not a blessed HV reference");
    }
;
#line 6432 "lib/Sys/Guestfs.xs"
      r = guestfs_journal_get_data_threshold (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 15345 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_journal_get_realtime_usec); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_journal_get_realtime_usec)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 6443 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 15363 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::journal_get_realtime_usec(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::journal_get_realtime_usec(): g is not a blessed HV reference");
    }
;
#line 6445 "lib/Sys/Guestfs.xs"
      r = guestfs_journal_get_realtime_usec (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 15383 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_journal_next); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_journal_next)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 6456 "lib/Sys/Guestfs.xs"
      int r;
#line 15401 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::journal_next(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::journal_next(): g is not a blessed HV reference");
    }
;
#line 6458 "lib/Sys/Guestfs.xs"
      r = guestfs_journal_next (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 15421 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_journal_open); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_journal_open)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, directory");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	directory = (char *)SvPV_nolen(ST(1))
;
#line 6470 "lib/Sys/Guestfs.xs"
      int r;
#line 15443 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::journal_open(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::journal_open(): g is not a blessed HV reference");
    }
;
#line 6472 "lib/Sys/Guestfs.xs"
      r = guestfs_journal_open (g, directory);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 15461 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_journal_set_data_threshold); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_journal_set_data_threshold)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, threshold");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int64_t	threshold = my_SvIV64 (ST(1))
;
#line 6481 "lib/Sys/Guestfs.xs"
      int r;
#line 15482 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::journal_set_data_threshold(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::journal_set_data_threshold(): g is not a blessed HV reference");
    }
;
#line 6483 "lib/Sys/Guestfs.xs"
      r = guestfs_journal_set_data_threshold (g, threshold);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 15500 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_journal_skip); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_journal_skip)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, skip");
    {
	guestfs_h *	g;
	int64_t	skip = my_SvIV64 (ST(1))
;
#line 6492 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 15519 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::journal_skip(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::journal_skip(): g is not a blessed HV reference");
    }
;
#line 6494 "lib/Sys/Guestfs.xs"
      r = guestfs_journal_skip (g, skip);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 15539 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_kill_subprocess); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_kill_subprocess)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6505 "lib/Sys/Guestfs.xs"
      int r;
#line 15559 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::kill_subprocess(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::kill_subprocess(): g is not a blessed HV reference");
    }
;
#line 6507 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::kill_subprocess is deprecated; use Sys::Guestfs::shutdown instead");
      r = guestfs_kill_subprocess (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 15579 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_launch); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_launch)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6517 "lib/Sys/Guestfs.xs"
      int r;
#line 15598 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::launch(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::launch(): g is not a blessed HV reference");
    }
;
#line 6519 "lib/Sys/Guestfs.xs"
      r = guestfs_launch (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 15616 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lchown); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lchown)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, owner, group, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	owner = (int)SvIV(ST(1))
;
	int	group = (int)SvIV(ST(2))
;
	char *	path = (char *)SvPV_nolen(ST(3))
;
#line 6530 "lib/Sys/Guestfs.xs"
      int r;
#line 15641 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lchown(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lchown(): g is not a blessed HV reference");
    }
;
#line 6532 "lib/Sys/Guestfs.xs"
      r = guestfs_lchown (g, owner, group, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 15659 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ldmtool_create_all); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ldmtool_create_all)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6540 "lib/Sys/Guestfs.xs"
      int r;
#line 15678 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ldmtool_create_all(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ldmtool_create_all(): g is not a blessed HV reference");
    }
;
#line 6542 "lib/Sys/Guestfs.xs"
      r = guestfs_ldmtool_create_all (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 15696 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ldmtool_diskgroup_disks); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ldmtool_diskgroup_disks)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, diskgroup");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	diskgroup = (char *)SvPV_nolen(ST(1))
;
#line 6551 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 15718 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ldmtool_diskgroup_disks(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ldmtool_diskgroup_disks(): g is not a blessed HV reference");
    }
;
#line 6554 "lib/Sys/Guestfs.xs"
      r = guestfs_ldmtool_diskgroup_disks (g, diskgroup);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 15743 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ldmtool_diskgroup_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ldmtool_diskgroup_name)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, diskgroup");
    {
	guestfs_h *	g;
	char *	diskgroup = (char *)SvPV_nolen(ST(1))
;
#line 6570 "lib/Sys/Guestfs.xs"
      char *r;
#line 15762 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ldmtool_diskgroup_name(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ldmtool_diskgroup_name(): g is not a blessed HV reference");
    }
;
#line 6572 "lib/Sys/Guestfs.xs"
      r = guestfs_ldmtool_diskgroup_name (g, diskgroup);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 15783 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_ldmtool_diskgroup_volumes); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ldmtool_diskgroup_volumes)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, diskgroup");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	diskgroup = (char *)SvPV_nolen(ST(1))
;
#line 6585 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 15806 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ldmtool_diskgroup_volumes(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ldmtool_diskgroup_volumes(): g is not a blessed HV reference");
    }
;
#line 6588 "lib/Sys/Guestfs.xs"
      r = guestfs_ldmtool_diskgroup_volumes (g, diskgroup);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 15831 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ldmtool_remove_all); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ldmtool_remove_all)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6603 "lib/Sys/Guestfs.xs"
      int r;
#line 15850 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ldmtool_remove_all(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ldmtool_remove_all(): g is not a blessed HV reference");
    }
;
#line 6605 "lib/Sys/Guestfs.xs"
      r = guestfs_ldmtool_remove_all (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 15868 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ldmtool_scan); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ldmtool_scan)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6613 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 15888 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ldmtool_scan(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ldmtool_scan(): g is not a blessed HV reference");
    }
;
#line 6616 "lib/Sys/Guestfs.xs"
      r = guestfs_ldmtool_scan (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 15913 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ldmtool_scan_devices); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ldmtool_scan_devices)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, devices");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char **	devices = XS_unpack_charPtrPtr(ST(1))
;
#line 6632 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 15935 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ldmtool_scan_devices(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ldmtool_scan_devices(): g is not a blessed HV reference");
    }
;
#line 6635 "lib/Sys/Guestfs.xs"
      r = guestfs_ldmtool_scan_devices (g, devices);
      free (devices);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 15961 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ldmtool_volume_hint); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ldmtool_volume_hint)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, diskgroup, volume");
    {
	guestfs_h *	g;
	char *	diskgroup = (char *)SvPV_nolen(ST(1))
;
	char *	volume = (char *)SvPV_nolen(ST(2))
;
#line 6653 "lib/Sys/Guestfs.xs"
      char *r;
#line 15982 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ldmtool_volume_hint(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ldmtool_volume_hint(): g is not a blessed HV reference");
    }
;
#line 6655 "lib/Sys/Guestfs.xs"
      r = guestfs_ldmtool_volume_hint (g, diskgroup, volume);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 16003 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_ldmtool_volume_partitions); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ldmtool_volume_partitions)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, diskgroup, volume");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	diskgroup = (char *)SvPV_nolen(ST(1))
;
	char *	volume = (char *)SvPV_nolen(ST(2))
;
#line 6669 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 16028 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ldmtool_volume_partitions(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ldmtool_volume_partitions(): g is not a blessed HV reference");
    }
;
#line 6672 "lib/Sys/Guestfs.xs"
      r = guestfs_ldmtool_volume_partitions (g, diskgroup, volume);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 16053 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ldmtool_volume_type); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ldmtool_volume_type)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, diskgroup, volume");
    {
	guestfs_h *	g;
	char *	diskgroup = (char *)SvPV_nolen(ST(1))
;
	char *	volume = (char *)SvPV_nolen(ST(2))
;
#line 6689 "lib/Sys/Guestfs.xs"
      char *r;
#line 16074 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ldmtool_volume_type(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ldmtool_volume_type(): g is not a blessed HV reference");
    }
;
#line 6691 "lib/Sys/Guestfs.xs"
      r = guestfs_ldmtool_volume_type (g, diskgroup, volume);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 16095 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_lgetxattr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lgetxattr)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, name");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	char *	name = (char *)SvPV_nolen(ST(2))
;
#line 6705 "lib/Sys/Guestfs.xs"
      char *r;
      size_t size;
#line 16118 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lgetxattr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lgetxattr(): g is not a blessed HV reference");
    }
;
#line 6708 "lib/Sys/Guestfs.xs"
      r = guestfs_lgetxattr (g, path, name, &size);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpvn (r, size);
      free (r);
#line 16139 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_lgetxattrs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lgetxattrs)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 6721 "lib/Sys/Guestfs.xs"
      struct guestfs_xattr_list *r;
      size_t i;
      HV *hv;
#line 16163 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lgetxattrs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lgetxattrs(): g is not a blessed HV reference");
    }
;
#line 6725 "lib/Sys/Guestfs.xs"
      r = guestfs_lgetxattrs (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "attrname", 8, newSVpv (r->val[i].attrname, 0), 0);
        (void) hv_store (hv, "attrval", 7, newSVpvn (r->val[i].attrval, r->val[i].attrval_len), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_xattr_list (r);
#line 16189 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_list_9p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_list_9p)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6741 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 16209 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::list_9p(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::list_9p(): g is not a blessed HV reference");
    }
;
#line 6744 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::list_9p is deprecated");
      r = guestfs_list_9p (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 16236 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_list_devices); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_list_devices)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6761 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 16256 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::list_devices(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::list_devices(): g is not a blessed HV reference");
    }
;
#line 6764 "lib/Sys/Guestfs.xs"
      r = guestfs_list_devices (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 16281 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_list_disk_labels); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_list_disk_labels)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6779 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 16301 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::list_disk_labels(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::list_disk_labels(): g is not a blessed HV reference");
    }
;
#line 6782 "lib/Sys/Guestfs.xs"
      r = guestfs_list_disk_labels (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 16326 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_list_dm_devices); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_list_dm_devices)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6797 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 16346 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::list_dm_devices(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::list_dm_devices(): g is not a blessed HV reference");
    }
;
#line 6800 "lib/Sys/Guestfs.xs"
      r = guestfs_list_dm_devices (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 16371 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_list_filesystems); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_list_filesystems)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6815 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 16391 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::list_filesystems(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::list_filesystems(): g is not a blessed HV reference");
    }
;
#line 6818 "lib/Sys/Guestfs.xs"
      r = guestfs_list_filesystems (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 16416 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_list_ldm_partitions); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_list_ldm_partitions)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6833 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 16436 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::list_ldm_partitions(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::list_ldm_partitions(): g is not a blessed HV reference");
    }
;
#line 6836 "lib/Sys/Guestfs.xs"
      r = guestfs_list_ldm_partitions (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 16461 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_list_ldm_volumes); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_list_ldm_volumes)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6851 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 16481 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::list_ldm_volumes(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::list_ldm_volumes(): g is not a blessed HV reference");
    }
;
#line 6854 "lib/Sys/Guestfs.xs"
      r = guestfs_list_ldm_volumes (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 16506 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_list_md_devices); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_list_md_devices)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6869 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 16526 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::list_md_devices(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::list_md_devices(): g is not a blessed HV reference");
    }
;
#line 6872 "lib/Sys/Guestfs.xs"
      r = guestfs_list_md_devices (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 16551 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_list_partitions); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_list_partitions)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 6887 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 16571 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::list_partitions(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::list_partitions(): g is not a blessed HV reference");
    }
;
#line 6890 "lib/Sys/Guestfs.xs"
      r = guestfs_list_partitions (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 16596 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ll); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ll)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, directory");
    {
	guestfs_h *	g;
	char *	directory = (char *)SvPV_nolen(ST(1))
;
#line 6906 "lib/Sys/Guestfs.xs"
      char *r;
#line 16615 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ll(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ll(): g is not a blessed HV reference");
    }
;
#line 6908 "lib/Sys/Guestfs.xs"
      r = guestfs_ll (g, directory);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 16636 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_llz); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_llz)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, directory");
    {
	guestfs_h *	g;
	char *	directory = (char *)SvPV_nolen(ST(1))
;
#line 6921 "lib/Sys/Guestfs.xs"
      char *r;
#line 16656 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::llz(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::llz(): g is not a blessed HV reference");
    }
;
#line 6923 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::llz is deprecated; use Sys::Guestfs::lgetxattrs instead");
      r = guestfs_llz (g, directory);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 16679 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_ln); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ln)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, target, linkname");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	target = (char *)SvPV_nolen(ST(1))
;
	char *	linkname = (char *)SvPV_nolen(ST(2))
;
#line 6939 "lib/Sys/Guestfs.xs"
      int r;
#line 16703 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ln(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ln(): g is not a blessed HV reference");
    }
;
#line 6941 "lib/Sys/Guestfs.xs"
      r = guestfs_ln (g, target, linkname);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 16721 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ln_f); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ln_f)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, target, linkname");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	target = (char *)SvPV_nolen(ST(1))
;
	char *	linkname = (char *)SvPV_nolen(ST(2))
;
#line 6951 "lib/Sys/Guestfs.xs"
      int r;
#line 16744 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ln_f(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ln_f(): g is not a blessed HV reference");
    }
;
#line 6953 "lib/Sys/Guestfs.xs"
      r = guestfs_ln_f (g, target, linkname);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 16762 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ln_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ln_s)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, target, linkname");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	target = (char *)SvPV_nolen(ST(1))
;
	char *	linkname = (char *)SvPV_nolen(ST(2))
;
#line 6963 "lib/Sys/Guestfs.xs"
      int r;
#line 16785 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ln_s(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ln_s(): g is not a blessed HV reference");
    }
;
#line 6965 "lib/Sys/Guestfs.xs"
      r = guestfs_ln_s (g, target, linkname);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 16803 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ln_sf); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ln_sf)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, target, linkname");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	target = (char *)SvPV_nolen(ST(1))
;
	char *	linkname = (char *)SvPV_nolen(ST(2))
;
#line 6975 "lib/Sys/Guestfs.xs"
      int r;
#line 16826 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ln_sf(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ln_sf(): g is not a blessed HV reference");
    }
;
#line 6977 "lib/Sys/Guestfs.xs"
      r = guestfs_ln_sf (g, target, linkname);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 16844 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lremovexattr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lremovexattr)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, xattr, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	xattr = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 6987 "lib/Sys/Guestfs.xs"
      int r;
#line 16867 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lremovexattr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lremovexattr(): g is not a blessed HV reference");
    }
;
#line 6989 "lib/Sys/Guestfs.xs"
      r = guestfs_lremovexattr (g, xattr, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 16885 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ls); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ls)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, directory");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	directory = (char *)SvPV_nolen(ST(1))
;
#line 6998 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 16907 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ls(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ls(): g is not a blessed HV reference");
    }
;
#line 7001 "lib/Sys/Guestfs.xs"
      r = guestfs_ls (g, directory);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 16932 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ls0); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ls0)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, dir, filenames");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	dir = (char *)SvPV_nolen(ST(1))
;
	char *	filenames = (char *)SvPV_nolen(ST(2))
;
#line 7018 "lib/Sys/Guestfs.xs"
      int r;
#line 16955 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ls0(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ls0(): g is not a blessed HV reference");
    }
;
#line 7020 "lib/Sys/Guestfs.xs"
      r = guestfs_ls0 (g, dir, filenames);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 16973 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lsetxattr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lsetxattr)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "g, xattr, val, vallen, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	xattr = (char *)SvPV_nolen(ST(1))
;
	char *	val = (char *)SvPV_nolen(ST(2))
;
	int	vallen = (int)SvIV(ST(3))
;
	char *	path = (char *)SvPV_nolen(ST(4))
;
#line 7032 "lib/Sys/Guestfs.xs"
      int r;
#line 17000 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lsetxattr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lsetxattr(): g is not a blessed HV reference");
    }
;
#line 7034 "lib/Sys/Guestfs.xs"
      r = guestfs_lsetxattr (g, xattr, val, vallen, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17018 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lstat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lstat)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 7043 "lib/Sys/Guestfs.xs"
      struct guestfs_stat *r;
#line 17039 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lstat(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lstat(): g is not a blessed HV reference");
    }
;
#line 7045 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::lstat is deprecated; use Sys::Guestfs::lstatns instead");
      r = guestfs_lstat (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 13);
      PUSHs (sv_2mortal (newSVpv ("dev", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->dev)));
      PUSHs (sv_2mortal (newSVpv ("ino", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->ino)));
      PUSHs (sv_2mortal (newSVpv ("mode", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->mode)));
      PUSHs (sv_2mortal (newSVpv ("nlink", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->nlink)));
      PUSHs (sv_2mortal (newSVpv ("uid", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->uid)));
      PUSHs (sv_2mortal (newSVpv ("gid", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->gid)));
      PUSHs (sv_2mortal (newSVpv ("rdev", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->rdev)));
      PUSHs (sv_2mortal (newSVpv ("size", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->size)));
      PUSHs (sv_2mortal (newSVpv ("blksize", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->blksize)));
      PUSHs (sv_2mortal (newSVpv ("blocks", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->blocks)));
      PUSHs (sv_2mortal (newSVpv ("atime", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->atime)));
      PUSHs (sv_2mortal (newSVpv ("mtime", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->mtime)));
      PUSHs (sv_2mortal (newSVpv ("ctime", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->ctime)));
      guestfs_free_stat (r);
#line 17087 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lstatlist); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lstatlist)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, names");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	char **	names = XS_unpack_charPtrPtr(ST(2))
;
#line 7085 "lib/Sys/Guestfs.xs"
      struct guestfs_stat_list *r;
      size_t i;
      HV *hv;
#line 17112 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lstatlist(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lstatlist(): g is not a blessed HV reference");
    }
;
#line 7089 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::lstatlist is deprecated; use Sys::Guestfs::lstatnslist instead");
      r = guestfs_lstatlist (g, path, names);
      free (names);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "dev", 3, my_newSVll (r->val[i].dev), 0);
        (void) hv_store (hv, "ino", 3, my_newSVll (r->val[i].ino), 0);
        (void) hv_store (hv, "mode", 4, my_newSVll (r->val[i].mode), 0);
        (void) hv_store (hv, "nlink", 5, my_newSVll (r->val[i].nlink), 0);
        (void) hv_store (hv, "uid", 3, my_newSVll (r->val[i].uid), 0);
        (void) hv_store (hv, "gid", 3, my_newSVll (r->val[i].gid), 0);
        (void) hv_store (hv, "rdev", 4, my_newSVll (r->val[i].rdev), 0);
        (void) hv_store (hv, "size", 4, my_newSVll (r->val[i].size), 0);
        (void) hv_store (hv, "blksize", 7, my_newSVll (r->val[i].blksize), 0);
        (void) hv_store (hv, "blocks", 6, my_newSVll (r->val[i].blocks), 0);
        (void) hv_store (hv, "atime", 5, my_newSVll (r->val[i].atime), 0);
        (void) hv_store (hv, "mtime", 5, my_newSVll (r->val[i].mtime), 0);
        (void) hv_store (hv, "ctime", 5, my_newSVll (r->val[i].ctime), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_stat_list (r);
#line 17152 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lstatns); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lstatns)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 7120 "lib/Sys/Guestfs.xs"
      struct guestfs_statns *r;
#line 17173 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lstatns(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lstatns(): g is not a blessed HV reference");
    }
;
#line 7122 "lib/Sys/Guestfs.xs"
      r = guestfs_lstatns (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 22);
      PUSHs (sv_2mortal (newSVpv ("st_dev", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_dev)));
      PUSHs (sv_2mortal (newSVpv ("st_ino", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_ino)));
      PUSHs (sv_2mortal (newSVpv ("st_mode", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_mode)));
      PUSHs (sv_2mortal (newSVpv ("st_nlink", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_nlink)));
      PUSHs (sv_2mortal (newSVpv ("st_uid", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_uid)));
      PUSHs (sv_2mortal (newSVpv ("st_gid", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_gid)));
      PUSHs (sv_2mortal (newSVpv ("st_rdev", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_rdev)));
      PUSHs (sv_2mortal (newSVpv ("st_size", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_size)));
      PUSHs (sv_2mortal (newSVpv ("st_blksize", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_blksize)));
      PUSHs (sv_2mortal (newSVpv ("st_blocks", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_blocks)));
      PUSHs (sv_2mortal (newSVpv ("st_atime_sec", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_atime_sec)));
      PUSHs (sv_2mortal (newSVpv ("st_atime_nsec", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_atime_nsec)));
      PUSHs (sv_2mortal (newSVpv ("st_mtime_sec", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_mtime_sec)));
      PUSHs (sv_2mortal (newSVpv ("st_mtime_nsec", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_mtime_nsec)));
      PUSHs (sv_2mortal (newSVpv ("st_ctime_sec", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_ctime_sec)));
      PUSHs (sv_2mortal (newSVpv ("st_ctime_nsec", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_ctime_nsec)));
      PUSHs (sv_2mortal (newSVpv ("st_spare1", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_spare1)));
      PUSHs (sv_2mortal (newSVpv ("st_spare2", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_spare2)));
      PUSHs (sv_2mortal (newSVpv ("st_spare3", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_spare3)));
      PUSHs (sv_2mortal (newSVpv ("st_spare4", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_spare4)));
      PUSHs (sv_2mortal (newSVpv ("st_spare5", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_spare5)));
      PUSHs (sv_2mortal (newSVpv ("st_spare6", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_spare6)));
      guestfs_free_statns (r);
#line 17237 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lstatnslist); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lstatnslist)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, names");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	char **	names = XS_unpack_charPtrPtr(ST(2))
;
#line 7178 "lib/Sys/Guestfs.xs"
      struct guestfs_statns_list *r;
      size_t i;
      HV *hv;
#line 17262 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lstatnslist(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lstatnslist(): g is not a blessed HV reference");
    }
;
#line 7182 "lib/Sys/Guestfs.xs"
      r = guestfs_lstatnslist (g, path, names);
      free (names);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "st_dev", 6, my_newSVll (r->val[i].st_dev), 0);
        (void) hv_store (hv, "st_ino", 6, my_newSVll (r->val[i].st_ino), 0);
        (void) hv_store (hv, "st_mode", 7, my_newSVll (r->val[i].st_mode), 0);
        (void) hv_store (hv, "st_nlink", 8, my_newSVll (r->val[i].st_nlink), 0);
        (void) hv_store (hv, "st_uid", 6, my_newSVll (r->val[i].st_uid), 0);
        (void) hv_store (hv, "st_gid", 6, my_newSVll (r->val[i].st_gid), 0);
        (void) hv_store (hv, "st_rdev", 7, my_newSVll (r->val[i].st_rdev), 0);
        (void) hv_store (hv, "st_size", 7, my_newSVll (r->val[i].st_size), 0);
        (void) hv_store (hv, "st_blksize", 10, my_newSVll (r->val[i].st_blksize), 0);
        (void) hv_store (hv, "st_blocks", 9, my_newSVll (r->val[i].st_blocks), 0);
        (void) hv_store (hv, "st_atime_sec", 12, my_newSVll (r->val[i].st_atime_sec), 0);
        (void) hv_store (hv, "st_atime_nsec", 13, my_newSVll (r->val[i].st_atime_nsec), 0);
        (void) hv_store (hv, "st_mtime_sec", 12, my_newSVll (r->val[i].st_mtime_sec), 0);
        (void) hv_store (hv, "st_mtime_nsec", 13, my_newSVll (r->val[i].st_mtime_nsec), 0);
        (void) hv_store (hv, "st_ctime_sec", 12, my_newSVll (r->val[i].st_ctime_sec), 0);
        (void) hv_store (hv, "st_ctime_nsec", 13, my_newSVll (r->val[i].st_ctime_nsec), 0);
        (void) hv_store (hv, "st_spare1", 9, my_newSVll (r->val[i].st_spare1), 0);
        (void) hv_store (hv, "st_spare2", 9, my_newSVll (r->val[i].st_spare2), 0);
        (void) hv_store (hv, "st_spare3", 9, my_newSVll (r->val[i].st_spare3), 0);
        (void) hv_store (hv, "st_spare4", 9, my_newSVll (r->val[i].st_spare4), 0);
        (void) hv_store (hv, "st_spare5", 9, my_newSVll (r->val[i].st_spare5), 0);
        (void) hv_store (hv, "st_spare6", 9, my_newSVll (r->val[i].st_spare6), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_statns_list (r);
#line 17309 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_luks_add_key); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_luks_add_key)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "g, device, key, newkey, keyslot");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	key = (char *)SvPV_nolen(ST(2))
;
	char *	newkey = (char *)SvPV_nolen(ST(3))
;
	int	keyslot = (int)SvIV(ST(4))
;
#line 7223 "lib/Sys/Guestfs.xs"
      int r;
#line 17336 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::luks_add_key(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::luks_add_key(): g is not a blessed HV reference");
    }
;
#line 7225 "lib/Sys/Guestfs.xs"
      r = guestfs_luks_add_key (g, device, key, newkey, keyslot);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17354 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_luks_close); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_luks_close)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 7234 "lib/Sys/Guestfs.xs"
      int r;
#line 17375 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::luks_close(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::luks_close(): g is not a blessed HV reference");
    }
;
#line 7236 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::luks_close is deprecated; use Sys::Guestfs::cryptsetup_close instead");
      r = guestfs_luks_close (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17395 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_luks_format); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_luks_format)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, key, keyslot");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	key = (char *)SvPV_nolen(ST(2))
;
	int	keyslot = (int)SvIV(ST(3))
;
#line 7249 "lib/Sys/Guestfs.xs"
      int r;
#line 17420 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::luks_format(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::luks_format(): g is not a blessed HV reference");
    }
;
#line 7251 "lib/Sys/Guestfs.xs"
      r = guestfs_luks_format (g, device, key, keyslot);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17438 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_luks_format_cipher); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_luks_format_cipher)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "g, device, key, keyslot, cipher");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	key = (char *)SvPV_nolen(ST(2))
;
	int	keyslot = (int)SvIV(ST(3))
;
	char *	cipher = (char *)SvPV_nolen(ST(4))
;
#line 7263 "lib/Sys/Guestfs.xs"
      int r;
#line 17465 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::luks_format_cipher(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::luks_format_cipher(): g is not a blessed HV reference");
    }
;
#line 7265 "lib/Sys/Guestfs.xs"
      r = guestfs_luks_format_cipher (g, device, key, keyslot, cipher);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17483 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_luks_kill_slot); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_luks_kill_slot)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, key, keyslot");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	key = (char *)SvPV_nolen(ST(2))
;
	int	keyslot = (int)SvIV(ST(3))
;
#line 7276 "lib/Sys/Guestfs.xs"
      int r;
#line 17508 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::luks_kill_slot(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::luks_kill_slot(): g is not a blessed HV reference");
    }
;
#line 7278 "lib/Sys/Guestfs.xs"
      r = guestfs_luks_kill_slot (g, device, key, keyslot);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17526 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_luks_open); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_luks_open)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, key, mapname");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	key = (char *)SvPV_nolen(ST(2))
;
	char *	mapname = (char *)SvPV_nolen(ST(3))
;
#line 7289 "lib/Sys/Guestfs.xs"
      int r;
#line 17551 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::luks_open(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::luks_open(): g is not a blessed HV reference");
    }
;
#line 7291 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::luks_open is deprecated; use Sys::Guestfs::cryptsetup_open instead");
      r = guestfs_luks_open (g, device, key, mapname);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17571 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_luks_open_ro); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_luks_open_ro)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, key, mapname");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	key = (char *)SvPV_nolen(ST(2))
;
	char *	mapname = (char *)SvPV_nolen(ST(3))
;
#line 7304 "lib/Sys/Guestfs.xs"
      int r;
#line 17596 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::luks_open_ro(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::luks_open_ro(): g is not a blessed HV reference");
    }
;
#line 7306 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::luks_open_ro is deprecated; use Sys::Guestfs::cryptsetup_open instead");
      r = guestfs_luks_open_ro (g, device, key, mapname);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17616 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_luks_uuid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_luks_uuid)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 7317 "lib/Sys/Guestfs.xs"
      char *r;
#line 17635 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::luks_uuid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::luks_uuid(): g is not a blessed HV reference");
    }
;
#line 7319 "lib/Sys/Guestfs.xs"
      r = guestfs_luks_uuid (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 17656 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_lvcreate); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lvcreate)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, logvol, volgroup, mbytes");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	logvol = (char *)SvPV_nolen(ST(1))
;
	char *	volgroup = (char *)SvPV_nolen(ST(2))
;
	int	mbytes = (int)SvIV(ST(3))
;
#line 7334 "lib/Sys/Guestfs.xs"
      int r;
#line 17682 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lvcreate(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lvcreate(): g is not a blessed HV reference");
    }
;
#line 7336 "lib/Sys/Guestfs.xs"
      r = guestfs_lvcreate (g, logvol, volgroup, mbytes);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17700 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lvcreate_free); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lvcreate_free)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, logvol, volgroup, percent");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	logvol = (char *)SvPV_nolen(ST(1))
;
	char *	volgroup = (char *)SvPV_nolen(ST(2))
;
	int	percent = (int)SvIV(ST(3))
;
#line 7347 "lib/Sys/Guestfs.xs"
      int r;
#line 17725 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lvcreate_free(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lvcreate_free(): g is not a blessed HV reference");
    }
;
#line 7349 "lib/Sys/Guestfs.xs"
      r = guestfs_lvcreate_free (g, logvol, volgroup, percent);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17743 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lvm_canonical_lv_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lvm_canonical_lv_name)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, lvname");
    {
	guestfs_h *	g;
	char *	lvname = (char *)SvPV_nolen(ST(1))
;
#line 7358 "lib/Sys/Guestfs.xs"
      char *r;
#line 17762 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lvm_canonical_lv_name(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lvm_canonical_lv_name(): g is not a blessed HV reference");
    }
;
#line 7360 "lib/Sys/Guestfs.xs"
      r = guestfs_lvm_canonical_lv_name (g, lvname);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 17783 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_lvm_clear_filter); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lvm_clear_filter)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 7372 "lib/Sys/Guestfs.xs"
      int r;
#line 17803 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lvm_clear_filter(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lvm_clear_filter(): g is not a blessed HV reference");
    }
;
#line 7374 "lib/Sys/Guestfs.xs"
      r = guestfs_lvm_clear_filter (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17821 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lvm_remove_all); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lvm_remove_all)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 7382 "lib/Sys/Guestfs.xs"
      int r;
#line 17840 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lvm_remove_all(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lvm_remove_all(): g is not a blessed HV reference");
    }
;
#line 7384 "lib/Sys/Guestfs.xs"
      r = guestfs_lvm_remove_all (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17858 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lvm_scan); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lvm_scan)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, activate");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	activate = (int)SvIV(ST(1))
;
#line 7393 "lib/Sys/Guestfs.xs"
      int r;
#line 17879 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lvm_scan(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lvm_scan(): g is not a blessed HV reference");
    }
;
#line 7395 "lib/Sys/Guestfs.xs"
      r = guestfs_lvm_scan (g, activate);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17897 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lvm_set_filter); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lvm_set_filter)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, devices");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char **	devices = XS_unpack_charPtrPtr(ST(1))
;
#line 7404 "lib/Sys/Guestfs.xs"
      int r;
#line 17918 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lvm_set_filter(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lvm_set_filter(): g is not a blessed HV reference");
    }
;
#line 7406 "lib/Sys/Guestfs.xs"
      r = guestfs_lvm_set_filter (g, devices);
      free (devices);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17937 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lvremove); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lvremove)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 7416 "lib/Sys/Guestfs.xs"
      int r;
#line 17958 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lvremove(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lvremove(): g is not a blessed HV reference");
    }
;
#line 7418 "lib/Sys/Guestfs.xs"
      r = guestfs_lvremove (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 17976 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lvrename); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lvrename)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, logvol, newlogvol");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	logvol = (char *)SvPV_nolen(ST(1))
;
	char *	newlogvol = (char *)SvPV_nolen(ST(2))
;
#line 7428 "lib/Sys/Guestfs.xs"
      int r;
#line 17999 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lvrename(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lvrename(): g is not a blessed HV reference");
    }
;
#line 7430 "lib/Sys/Guestfs.xs"
      r = guestfs_lvrename (g, logvol, newlogvol);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 18017 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lvresize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lvresize)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, mbytes");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	mbytes = (int)SvIV(ST(2))
;
#line 7440 "lib/Sys/Guestfs.xs"
      int r;
#line 18040 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lvresize(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lvresize(): g is not a blessed HV reference");
    }
;
#line 7442 "lib/Sys/Guestfs.xs"
      r = guestfs_lvresize (g, device, mbytes);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 18058 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lvresize_free); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lvresize_free)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, lv, percent");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	lv = (char *)SvPV_nolen(ST(1))
;
	int	percent = (int)SvIV(ST(2))
;
#line 7452 "lib/Sys/Guestfs.xs"
      int r;
#line 18081 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lvresize_free(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lvresize_free(): g is not a blessed HV reference");
    }
;
#line 7454 "lib/Sys/Guestfs.xs"
      r = guestfs_lvresize_free (g, lv, percent);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 18099 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lvs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lvs)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 7462 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 18119 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lvs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lvs(): g is not a blessed HV reference");
    }
;
#line 7465 "lib/Sys/Guestfs.xs"
      r = guestfs_lvs (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 18144 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lvs_full); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lvs_full)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 7480 "lib/Sys/Guestfs.xs"
      struct guestfs_lvm_lv_list *r;
      size_t i;
      HV *hv;
#line 18165 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lvs_full(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lvs_full(): g is not a blessed HV reference");
    }
;
#line 7484 "lib/Sys/Guestfs.xs"
      r = guestfs_lvs_full (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "lv_name", 7, newSVpv (r->val[i].lv_name, 0), 0);
        (void) hv_store (hv, "lv_uuid", 7, newSVpv (r->val[i].lv_uuid, 32), 0);
        (void) hv_store (hv, "lv_attr", 7, newSVpv (r->val[i].lv_attr, 0), 0);
        (void) hv_store (hv, "lv_major", 8, my_newSVll (r->val[i].lv_major), 0);
        (void) hv_store (hv, "lv_minor", 8, my_newSVll (r->val[i].lv_minor), 0);
        (void) hv_store (hv, "lv_kernel_major", 15, my_newSVll (r->val[i].lv_kernel_major), 0);
        (void) hv_store (hv, "lv_kernel_minor", 15, my_newSVll (r->val[i].lv_kernel_minor), 0);
        (void) hv_store (hv, "lv_size", 7, my_newSVull (r->val[i].lv_size), 0);
        (void) hv_store (hv, "seg_count", 9, my_newSVll (r->val[i].seg_count), 0);
        (void) hv_store (hv, "origin", 6, newSVpv (r->val[i].origin, 0), 0);
        (void) hv_store (hv, "snap_percent", 12, newSVnv (r->val[i].snap_percent), 0);
        (void) hv_store (hv, "copy_percent", 12, newSVnv (r->val[i].copy_percent), 0);
        (void) hv_store (hv, "move_pv", 7, newSVpv (r->val[i].move_pv, 0), 0);
        (void) hv_store (hv, "lv_tags", 7, newSVpv (r->val[i].lv_tags, 0), 0);
        (void) hv_store (hv, "mirror_log", 10, newSVpv (r->val[i].mirror_log, 0), 0);
        (void) hv_store (hv, "modules", 7, newSVpv (r->val[i].modules, 0), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_lvm_lv_list (r);
#line 18205 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_lvuuid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lvuuid)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 7515 "lib/Sys/Guestfs.xs"
      char *r;
#line 18224 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lvuuid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lvuuid(): g is not a blessed HV reference");
    }
;
#line 7517 "lib/Sys/Guestfs.xs"
      r = guestfs_lvuuid (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 18245 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_lxattrlist); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_lxattrlist)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, names");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	char **	names = XS_unpack_charPtrPtr(ST(2))
;
#line 7531 "lib/Sys/Guestfs.xs"
      struct guestfs_xattr_list *r;
      size_t i;
      HV *hv;
#line 18271 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::lxattrlist(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::lxattrlist(): g is not a blessed HV reference");
    }
;
#line 7535 "lib/Sys/Guestfs.xs"
      r = guestfs_lxattrlist (g, path, names);
      free (names);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "attrname", 8, newSVpv (r->val[i].attrname, 0), 0);
        (void) hv_store (hv, "attrval", 7, newSVpvn (r->val[i].attrval, r->val[i].attrval_len), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_xattr_list (r);
#line 18298 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_max_disks); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_max_disks)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 7552 "lib/Sys/Guestfs.xs"
      int r;
#line 18315 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::max_disks(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::max_disks(): g is not a blessed HV reference");
    }
;
#line 7554 "lib/Sys/Guestfs.xs"
      r = guestfs_max_disks (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 18335 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_md_create); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_md_create)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, name, devices, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	name = (char *)SvPV_nolen(ST(1))
;
	char **	devices = XS_unpack_charPtrPtr(ST(2))
;
#line 7567 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_md_create_argv optargs_s = { .bitmask = 0 };
      struct guestfs_md_create_argv *optargs = &optargs_s;
      size_t items_i;
#line 18362 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::md_create(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::md_create(): g is not a blessed HV reference");
    }
;
#line 7572 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "missingbitmap")) {
          optargs_s.missingbitmap = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MD_CREATE_MISSINGBITMAP_BITMASK;
        }
        else if (STREQ (this_arg, "nrdevices")) {
          optargs_s.nrdevices = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MD_CREATE_NRDEVICES_BITMASK;
        }
        else if (STREQ (this_arg, "spare")) {
          optargs_s.spare = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MD_CREATE_SPARE_BITMASK;
        }
        else if (STREQ (this_arg, "chunk")) {
          optargs_s.chunk = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MD_CREATE_CHUNK_BITMASK;
        }
        else if (STREQ (this_arg, "level")) {
          optargs_s.level = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MD_CREATE_LEVEL_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_md_create_argv (g, name, devices, optargs);
      free (devices);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 18415 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_md_detail); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_md_detail)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, md");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	md = (char *)SvPV_nolen(ST(1))
;
#line 7616 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 18437 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::md_detail(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::md_detail(): g is not a blessed HV reference");
    }
;
#line 7619 "lib/Sys/Guestfs.xs"
      r = guestfs_md_detail (g, md);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 18462 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_md_stat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_md_stat)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, md");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	md = (char *)SvPV_nolen(ST(1))
;
#line 7635 "lib/Sys/Guestfs.xs"
      struct guestfs_mdstat_list *r;
      size_t i;
      HV *hv;
#line 18485 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::md_stat(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::md_stat(): g is not a blessed HV reference");
    }
;
#line 7639 "lib/Sys/Guestfs.xs"
      r = guestfs_md_stat (g, md);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "mdstat_device", 13, newSVpv (r->val[i].mdstat_device, 0), 0);
        (void) hv_store (hv, "mdstat_index", 12, newSVnv (r->val[i].mdstat_index), 0);
        (void) hv_store (hv, "mdstat_flags", 12, newSVpv (r->val[i].mdstat_flags, 0), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_mdstat_list (r);
#line 18512 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_md_stop); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_md_stop)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, md");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	md = (char *)SvPV_nolen(ST(1))
;
#line 7657 "lib/Sys/Guestfs.xs"
      int r;
#line 18533 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::md_stop(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::md_stop(): g is not a blessed HV reference");
    }
;
#line 7659 "lib/Sys/Guestfs.xs"
      r = guestfs_md_stop (g, md);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 18551 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mkdir); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mkdir)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 7668 "lib/Sys/Guestfs.xs"
      int r;
#line 18572 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mkdir(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mkdir(): g is not a blessed HV reference");
    }
;
#line 7670 "lib/Sys/Guestfs.xs"
      r = guestfs_mkdir (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 18590 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mkdir_mode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mkdir_mode)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, mode");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	int	mode = (int)SvIV(ST(2))
;
#line 7680 "lib/Sys/Guestfs.xs"
      int r;
#line 18613 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mkdir_mode(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mkdir_mode(): g is not a blessed HV reference");
    }
;
#line 7682 "lib/Sys/Guestfs.xs"
      r = guestfs_mkdir_mode (g, path, mode);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 18631 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mkdir_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mkdir_p)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 7691 "lib/Sys/Guestfs.xs"
      int r;
#line 18652 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mkdir_p(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mkdir_p(): g is not a blessed HV reference");
    }
;
#line 7693 "lib/Sys/Guestfs.xs"
      r = guestfs_mkdir_p (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 18670 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mkdtemp); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mkdtemp)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, tmpl");
    {
	guestfs_h *	g;
	char *	tmpl = (char *)SvPV_nolen(ST(1))
;
#line 7702 "lib/Sys/Guestfs.xs"
      char *r;
#line 18689 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mkdtemp(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mkdtemp(): g is not a blessed HV reference");
    }
;
#line 7704 "lib/Sys/Guestfs.xs"
      r = guestfs_mkdtemp (g, tmpl);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 18710 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_mke2fs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mke2fs)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, device, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 7717 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_mke2fs_argv optargs_s = { .bitmask = 0 };
      struct guestfs_mke2fs_argv *optargs = &optargs_s;
      size_t items_i;
#line 18735 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mke2fs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mke2fs(): g is not a blessed HV reference");
    }
;
#line 7722 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "blockscount")) {
          optargs_s.blockscount = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_BLOCKSCOUNT_BITMASK;
        }
        else if (STREQ (this_arg, "blocksize")) {
          optargs_s.blocksize = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_BLOCKSIZE_BITMASK;
        }
        else if (STREQ (this_arg, "fragsize")) {
          optargs_s.fragsize = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_FRAGSIZE_BITMASK;
        }
        else if (STREQ (this_arg, "blockspergroup")) {
          optargs_s.blockspergroup = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_BLOCKSPERGROUP_BITMASK;
        }
        else if (STREQ (this_arg, "numberofgroups")) {
          optargs_s.numberofgroups = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_NUMBEROFGROUPS_BITMASK;
        }
        else if (STREQ (this_arg, "bytesperinode")) {
          optargs_s.bytesperinode = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_BYTESPERINODE_BITMASK;
        }
        else if (STREQ (this_arg, "inodesize")) {
          optargs_s.inodesize = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_INODESIZE_BITMASK;
        }
        else if (STREQ (this_arg, "journalsize")) {
          optargs_s.journalsize = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_JOURNALSIZE_BITMASK;
        }
        else if (STREQ (this_arg, "numberofinodes")) {
          optargs_s.numberofinodes = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_NUMBEROFINODES_BITMASK;
        }
        else if (STREQ (this_arg, "stridesize")) {
          optargs_s.stridesize = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_STRIDESIZE_BITMASK;
        }
        else if (STREQ (this_arg, "stripewidth")) {
          optargs_s.stripewidth = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_STRIPEWIDTH_BITMASK;
        }
        else if (STREQ (this_arg, "maxonlineresize")) {
          optargs_s.maxonlineresize = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_MAXONLINERESIZE_BITMASK;
        }
        else if (STREQ (this_arg, "reservedblockspercentage")) {
          optargs_s.reservedblockspercentage = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_RESERVEDBLOCKSPERCENTAGE_BITMASK;
        }
        else if (STREQ (this_arg, "mmpupdateinterval")) {
          optargs_s.mmpupdateinterval = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_MMPUPDATEINTERVAL_BITMASK;
        }
        else if (STREQ (this_arg, "journaldevice")) {
          optargs_s.journaldevice = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_JOURNALDEVICE_BITMASK;
        }
        else if (STREQ (this_arg, "label")) {
          optargs_s.label = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_LABEL_BITMASK;
        }
        else if (STREQ (this_arg, "lastmounteddir")) {
          optargs_s.lastmounteddir = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_LASTMOUNTEDDIR_BITMASK;
        }
        else if (STREQ (this_arg, "creatoros")) {
          optargs_s.creatoros = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_CREATOROS_BITMASK;
        }
        else if (STREQ (this_arg, "fstype")) {
          optargs_s.fstype = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_FSTYPE_BITMASK;
        }
        else if (STREQ (this_arg, "usagetype")) {
          optargs_s.usagetype = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_USAGETYPE_BITMASK;
        }
        else if (STREQ (this_arg, "uuid")) {
          optargs_s.uuid = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_UUID_BITMASK;
        }
        else if (STREQ (this_arg, "forcecreate")) {
          optargs_s.forcecreate = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_FORCECREATE_BITMASK;
        }
        else if (STREQ (this_arg, "writesbandgrouponly")) {
          optargs_s.writesbandgrouponly = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_WRITESBANDGROUPONLY_BITMASK;
        }
        else if (STREQ (this_arg, "lazyitableinit")) {
          optargs_s.lazyitableinit = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_LAZYITABLEINIT_BITMASK;
        }
        else if (STREQ (this_arg, "lazyjournalinit")) {
          optargs_s.lazyjournalinit = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_LAZYJOURNALINIT_BITMASK;
        }
        else if (STREQ (this_arg, "testfs")) {
          optargs_s.testfs = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_TESTFS_BITMASK;
        }
        else if (STREQ (this_arg, "discard")) {
          optargs_s.discard = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_DISCARD_BITMASK;
        }
        else if (STREQ (this_arg, "quotatype")) {
          optargs_s.quotatype = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_QUOTATYPE_BITMASK;
        }
        else if (STREQ (this_arg, "extent")) {
          optargs_s.extent = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_EXTENT_BITMASK;
        }
        else if (STREQ (this_arg, "filetype")) {
          optargs_s.filetype = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_FILETYPE_BITMASK;
        }
        else if (STREQ (this_arg, "flexbg")) {
          optargs_s.flexbg = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_FLEXBG_BITMASK;
        }
        else if (STREQ (this_arg, "hasjournal")) {
          optargs_s.hasjournal = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_HASJOURNAL_BITMASK;
        }
        else if (STREQ (this_arg, "journaldev")) {
          optargs_s.journaldev = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_JOURNALDEV_BITMASK;
        }
        else if (STREQ (this_arg, "largefile")) {
          optargs_s.largefile = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_LARGEFILE_BITMASK;
        }
        else if (STREQ (this_arg, "quota")) {
          optargs_s.quota = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_QUOTA_BITMASK;
        }
        else if (STREQ (this_arg, "resizeinode")) {
          optargs_s.resizeinode = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_RESIZEINODE_BITMASK;
        }
        else if (STREQ (this_arg, "sparsesuper")) {
          optargs_s.sparsesuper = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_SPARSESUPER_BITMASK;
        }
        else if (STREQ (this_arg, "uninitbg")) {
          optargs_s.uninitbg = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKE2FS_UNINITBG_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_mke2fs_argv (g, device, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 18919 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mke2fs_J); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mke2fs_J)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "g, fstype, blocksize, device, journal");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	fstype = (char *)SvPV_nolen(ST(1))
;
	int	blocksize = (int)SvIV(ST(2))
;
	char *	device = (char *)SvPV_nolen(ST(3))
;
	char *	journal = (char *)SvPV_nolen(ST(4))
;
#line 7900 "lib/Sys/Guestfs.xs"
      int r;
#line 18946 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mke2fs_J(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mke2fs_J(): g is not a blessed HV reference");
    }
;
#line 7902 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::mke2fs_J is deprecated; use Sys::Guestfs::mke2fs instead");
      r = guestfs_mke2fs_J (g, fstype, blocksize, device, journal);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 18966 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mke2fs_JL); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mke2fs_JL)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "g, fstype, blocksize, device, label");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	fstype = (char *)SvPV_nolen(ST(1))
;
	int	blocksize = (int)SvIV(ST(2))
;
	char *	device = (char *)SvPV_nolen(ST(3))
;
	char *	label = (char *)SvPV_nolen(ST(4))
;
#line 7916 "lib/Sys/Guestfs.xs"
      int r;
#line 18993 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mke2fs_JL(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mke2fs_JL(): g is not a blessed HV reference");
    }
;
#line 7918 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::mke2fs_JL is deprecated; use Sys::Guestfs::mke2fs instead");
      r = guestfs_mke2fs_JL (g, fstype, blocksize, device, label);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19013 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mke2fs_JU); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mke2fs_JU)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "g, fstype, blocksize, device, uuid");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	fstype = (char *)SvPV_nolen(ST(1))
;
	int	blocksize = (int)SvIV(ST(2))
;
	char *	device = (char *)SvPV_nolen(ST(3))
;
	char *	uuid = (char *)SvPV_nolen(ST(4))
;
#line 7932 "lib/Sys/Guestfs.xs"
      int r;
#line 19040 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mke2fs_JU(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mke2fs_JU(): g is not a blessed HV reference");
    }
;
#line 7934 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::mke2fs_JU is deprecated; use Sys::Guestfs::mke2fs instead");
      r = guestfs_mke2fs_JU (g, fstype, blocksize, device, uuid);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19060 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mke2journal); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mke2journal)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, blocksize, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	blocksize = (int)SvIV(ST(1))
;
	char *	device = (char *)SvPV_nolen(ST(2))
;
#line 7946 "lib/Sys/Guestfs.xs"
      int r;
#line 19083 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mke2journal(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mke2journal(): g is not a blessed HV reference");
    }
;
#line 7948 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::mke2journal is deprecated; use Sys::Guestfs::mke2fs instead");
      r = guestfs_mke2journal (g, blocksize, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19103 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mke2journal_L); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mke2journal_L)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, blocksize, label, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	blocksize = (int)SvIV(ST(1))
;
	char *	label = (char *)SvPV_nolen(ST(2))
;
	char *	device = (char *)SvPV_nolen(ST(3))
;
#line 7961 "lib/Sys/Guestfs.xs"
      int r;
#line 19128 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mke2journal_L(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mke2journal_L(): g is not a blessed HV reference");
    }
;
#line 7963 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::mke2journal_L is deprecated; use Sys::Guestfs::mke2fs instead");
      r = guestfs_mke2journal_L (g, blocksize, label, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19148 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mke2journal_U); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mke2journal_U)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, blocksize, uuid, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	blocksize = (int)SvIV(ST(1))
;
	char *	uuid = (char *)SvPV_nolen(ST(2))
;
	char *	device = (char *)SvPV_nolen(ST(3))
;
#line 7976 "lib/Sys/Guestfs.xs"
      int r;
#line 19173 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mke2journal_U(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mke2journal_U(): g is not a blessed HV reference");
    }
;
#line 7978 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::mke2journal_U is deprecated; use Sys::Guestfs::mke2fs instead");
      r = guestfs_mke2journal_U (g, blocksize, uuid, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19193 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mkfifo); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mkfifo)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, mode, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	mode = (int)SvIV(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 7990 "lib/Sys/Guestfs.xs"
      int r;
#line 19216 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mkfifo(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mkfifo(): g is not a blessed HV reference");
    }
;
#line 7992 "lib/Sys/Guestfs.xs"
      r = guestfs_mkfifo (g, mode, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19234 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mkfs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mkfs)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, fstype, device, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	fstype = (char *)SvPV_nolen(ST(1))
;
	char *	device = (char *)SvPV_nolen(ST(2))
;
#line 8002 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_mkfs_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_mkfs_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 19260 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mkfs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mkfs(): g is not a blessed HV reference");
    }
;
#line 8007 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "blocksize")) {
          optargs_s.blocksize = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKFS_OPTS_BLOCKSIZE_BITMASK;
        }
        else if (STREQ (this_arg, "features")) {
          optargs_s.features = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKFS_OPTS_FEATURES_BITMASK;
        }
        else if (STREQ (this_arg, "inode")) {
          optargs_s.inode = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKFS_OPTS_INODE_BITMASK;
        }
        else if (STREQ (this_arg, "sectorsize")) {
          optargs_s.sectorsize = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKFS_OPTS_SECTORSIZE_BITMASK;
        }
        else if (STREQ (this_arg, "label")) {
          optargs_s.label = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKFS_OPTS_LABEL_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_mkfs_opts_argv (g, fstype, device, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19312 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mkfs_b); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mkfs_b)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, fstype, blocksize, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	fstype = (char *)SvPV_nolen(ST(1))
;
	int	blocksize = (int)SvIV(ST(2))
;
	char *	device = (char *)SvPV_nolen(ST(3))
;
#line 8052 "lib/Sys/Guestfs.xs"
      int r;
#line 19337 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mkfs_b(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mkfs_b(): g is not a blessed HV reference");
    }
;
#line 8054 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::mkfs_b is deprecated; use Sys::Guestfs::mkfs instead");
      r = guestfs_mkfs_b (g, fstype, blocksize, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19357 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mkfs_btrfs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mkfs_btrfs)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, devices, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char **	devices = XS_unpack_charPtrPtr(ST(1))
;
#line 8065 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_mkfs_btrfs_argv optargs_s = { .bitmask = 0 };
      struct guestfs_mkfs_btrfs_argv *optargs = &optargs_s;
      size_t items_i;
#line 19381 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mkfs_btrfs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mkfs_btrfs(): g is not a blessed HV reference");
    }
;
#line 8070 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "allocstart")) {
          optargs_s.allocstart = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MKFS_BTRFS_ALLOCSTART_BITMASK;
        }
        else if (STREQ (this_arg, "bytecount")) {
          optargs_s.bytecount = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_MKFS_BTRFS_BYTECOUNT_BITMASK;
        }
        else if (STREQ (this_arg, "datatype")) {
          optargs_s.datatype = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKFS_BTRFS_DATATYPE_BITMASK;
        }
        else if (STREQ (this_arg, "leafsize")) {
          optargs_s.leafsize = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKFS_BTRFS_LEAFSIZE_BITMASK;
        }
        else if (STREQ (this_arg, "label")) {
          optargs_s.label = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKFS_BTRFS_LABEL_BITMASK;
        }
        else if (STREQ (this_arg, "metadata")) {
          optargs_s.metadata = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKFS_BTRFS_METADATA_BITMASK;
        }
        else if (STREQ (this_arg, "nodesize")) {
          optargs_s.nodesize = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKFS_BTRFS_NODESIZE_BITMASK;
        }
        else if (STREQ (this_arg, "sectorsize")) {
          optargs_s.sectorsize = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MKFS_BTRFS_SECTORSIZE_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_mkfs_btrfs_argv (g, devices, optargs);
      free (devices);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19446 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mklost_and_found); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mklost_and_found)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, mountpoint");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	mountpoint = (char *)SvPV_nolen(ST(1))
;
#line 8126 "lib/Sys/Guestfs.xs"
      int r;
#line 19467 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mklost_and_found(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mklost_and_found(): g is not a blessed HV reference");
    }
;
#line 8128 "lib/Sys/Guestfs.xs"
      r = guestfs_mklost_and_found (g, mountpoint);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19485 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mkmountpoint); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mkmountpoint)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, exemptpath");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	exemptpath = (char *)SvPV_nolen(ST(1))
;
#line 8137 "lib/Sys/Guestfs.xs"
      int r;
#line 19506 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mkmountpoint(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mkmountpoint(): g is not a blessed HV reference");
    }
;
#line 8139 "lib/Sys/Guestfs.xs"
      r = guestfs_mkmountpoint (g, exemptpath);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19524 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mknod); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mknod)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "g, mode, devmajor, devminor, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	mode = (int)SvIV(ST(1))
;
	int	devmajor = (int)SvIV(ST(2))
;
	int	devminor = (int)SvIV(ST(3))
;
	char *	path = (char *)SvPV_nolen(ST(4))
;
#line 8151 "lib/Sys/Guestfs.xs"
      int r;
#line 19551 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mknod(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mknod(): g is not a blessed HV reference");
    }
;
#line 8153 "lib/Sys/Guestfs.xs"
      r = guestfs_mknod (g, mode, devmajor, devminor, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19569 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mknod_b); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mknod_b)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "g, mode, devmajor, devminor, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	mode = (int)SvIV(ST(1))
;
	int	devmajor = (int)SvIV(ST(2))
;
	int	devminor = (int)SvIV(ST(3))
;
	char *	path = (char *)SvPV_nolen(ST(4))
;
#line 8165 "lib/Sys/Guestfs.xs"
      int r;
#line 19596 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mknod_b(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mknod_b(): g is not a blessed HV reference");
    }
;
#line 8167 "lib/Sys/Guestfs.xs"
      r = guestfs_mknod_b (g, mode, devmajor, devminor, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19614 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mknod_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mknod_c)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "g, mode, devmajor, devminor, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	mode = (int)SvIV(ST(1))
;
	int	devmajor = (int)SvIV(ST(2))
;
	int	devminor = (int)SvIV(ST(3))
;
	char *	path = (char *)SvPV_nolen(ST(4))
;
#line 8179 "lib/Sys/Guestfs.xs"
      int r;
#line 19641 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mknod_c(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mknod_c(): g is not a blessed HV reference");
    }
;
#line 8181 "lib/Sys/Guestfs.xs"
      r = guestfs_mknod_c (g, mode, devmajor, devminor, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19659 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mksquashfs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mksquashfs)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, path, filename, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	char *	filename = (char *)SvPV_nolen(ST(2))
;
#line 8191 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_mksquashfs_argv optargs_s = { .bitmask = 0 };
      struct guestfs_mksquashfs_argv *optargs = &optargs_s;
      size_t items_i;
#line 19685 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mksquashfs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mksquashfs(): g is not a blessed HV reference");
    }
;
#line 8196 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "compress")) {
          optargs_s.compress = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKSQUASHFS_COMPRESS_BITMASK;
        }
        else if (STREQ (this_arg, "excludes")) {
          size_t i, len;
          char **r;
          SV *arg;
          AV *av;
          SV **svp;

          arg = ST (items_i+1);
          if (!SvROK (arg) || SvTYPE (SvRV (arg)) != SVt_PVAV)
            croak ("array reference expected for '%s' argument", "excludes");
          av = (AV *) SvRV (ST (items_i+1));

          /* Note av_len returns index of final element. */
          len = av_len (av) + 1;

          r = malloc ((len+1) * sizeof (char *));
          if (r == NULL) croak ("malloc: %m");
          for (i = 0; i < len; ++i) {
            svp = av_fetch (av, i, 0);
            r[i] = SvPV_nolen (*svp);
          }
          r[i] = NULL;
          optargs_s.excludes = r;
          this_mask = GUESTFS_MKSQUASHFS_EXCLUDES_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_mksquashfs_argv (g, path, filename, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19746 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mkswap); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mkswap)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, device, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 8248 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_mkswap_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_mkswap_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 19770 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mkswap(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mkswap(): g is not a blessed HV reference");
    }
;
#line 8253 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "label")) {
          optargs_s.label = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKSWAP_OPTS_LABEL_BITMASK;
        }
        else if (STREQ (this_arg, "uuid")) {
          optargs_s.uuid = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKSWAP_OPTS_UUID_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_mkswap_opts_argv (g, device, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19810 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mkswap_L); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mkswap_L)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, label, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	label = (char *)SvPV_nolen(ST(1))
;
	char *	device = (char *)SvPV_nolen(ST(2))
;
#line 8285 "lib/Sys/Guestfs.xs"
      int r;
#line 19833 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mkswap_L(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mkswap_L(): g is not a blessed HV reference");
    }
;
#line 8287 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::mkswap_L is deprecated; use Sys::Guestfs::mkswap instead");
      r = guestfs_mkswap_L (g, label, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19853 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mkswap_U); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mkswap_U)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, uuid, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	uuid = (char *)SvPV_nolen(ST(1))
;
	char *	device = (char *)SvPV_nolen(ST(2))
;
#line 8299 "lib/Sys/Guestfs.xs"
      int r;
#line 19876 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mkswap_U(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mkswap_U(): g is not a blessed HV reference");
    }
;
#line 8301 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::mkswap_U is deprecated; use Sys::Guestfs::mkswap instead");
      r = guestfs_mkswap_U (g, uuid, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19896 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mkswap_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mkswap_file)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 8312 "lib/Sys/Guestfs.xs"
      int r;
#line 19917 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mkswap_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mkswap_file(): g is not a blessed HV reference");
    }
;
#line 8314 "lib/Sys/Guestfs.xs"
      r = guestfs_mkswap_file (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 19935 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mktemp); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mktemp)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, tmpl, ...");
    {
	guestfs_h *	g;
	char *	tmpl = (char *)SvPV_nolen(ST(1))
;
#line 8323 "lib/Sys/Guestfs.xs"
      char *r;
      struct guestfs_mktemp_argv optargs_s = { .bitmask = 0 };
      struct guestfs_mktemp_argv *optargs = &optargs_s;
      size_t items_i;
#line 19957 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mktemp(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mktemp(): g is not a blessed HV reference");
    }
;
#line 8328 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "suffix")) {
          optargs_s.suffix = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MKTEMP_SUFFIX_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_mktemp_argv (g, tmpl, optargs);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 19996 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_modprobe); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_modprobe)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, modulename");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	modulename = (char *)SvPV_nolen(ST(1))
;
#line 8359 "lib/Sys/Guestfs.xs"
      int r;
#line 20018 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::modprobe(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::modprobe(): g is not a blessed HV reference");
    }
;
#line 8361 "lib/Sys/Guestfs.xs"
      r = guestfs_modprobe (g, modulename);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20036 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mount); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mount)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, mountable, mountpoint");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	mountable = (char *)SvPV_nolen(ST(1))
;
	char *	mountpoint = (char *)SvPV_nolen(ST(2))
;
#line 8371 "lib/Sys/Guestfs.xs"
      int r;
#line 20059 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mount(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mount(): g is not a blessed HV reference");
    }
;
#line 8373 "lib/Sys/Guestfs.xs"
      r = guestfs_mount (g, mountable, mountpoint);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20077 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mount_9p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mount_9p)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, mounttag, mountpoint, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	mounttag = (char *)SvPV_nolen(ST(1))
;
	char *	mountpoint = (char *)SvPV_nolen(ST(2))
;
#line 8383 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_mount_9p_argv optargs_s = { .bitmask = 0 };
      struct guestfs_mount_9p_argv *optargs = &optargs_s;
      size_t items_i;
#line 20103 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mount_9p(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mount_9p(): g is not a blessed HV reference");
    }
;
#line 8388 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::mount_9p is deprecated");
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "options")) {
          optargs_s.options = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MOUNT_9P_OPTIONS_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_mount_9p_argv (g, mounttag, mountpoint, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20141 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mount_local); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mount_local)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, localmountpoint, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	localmountpoint = (char *)SvPV_nolen(ST(1))
;
#line 8417 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_mount_local_argv optargs_s = { .bitmask = 0 };
      struct guestfs_mount_local_argv *optargs = &optargs_s;
      size_t items_i;
#line 20165 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mount_local(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mount_local(): g is not a blessed HV reference");
    }
;
#line 8422 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "readonly")) {
          optargs_s.readonly = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MOUNT_LOCAL_READONLY_BITMASK;
        }
        else if (STREQ (this_arg, "options")) {
          optargs_s.options = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_MOUNT_LOCAL_OPTIONS_BITMASK;
        }
        else if (STREQ (this_arg, "cachetimeout")) {
          optargs_s.cachetimeout = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MOUNT_LOCAL_CACHETIMEOUT_BITMASK;
        }
        else if (STREQ (this_arg, "debugcalls")) {
          optargs_s.debugcalls = SvIV (ST (items_i+1));
          this_mask = GUESTFS_MOUNT_LOCAL_DEBUGCALLS_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_mount_local_argv (g, localmountpoint, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20213 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mount_local_run); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mount_local_run)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 8460 "lib/Sys/Guestfs.xs"
      int r;
#line 20232 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mount_local_run(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mount_local_run(): g is not a blessed HV reference");
    }
;
#line 8462 "lib/Sys/Guestfs.xs"
      r = guestfs_mount_local_run (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20250 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mount_loop); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mount_loop)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, file, mountpoint");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	file = (char *)SvPV_nolen(ST(1))
;
	char *	mountpoint = (char *)SvPV_nolen(ST(2))
;
#line 8472 "lib/Sys/Guestfs.xs"
      int r;
#line 20273 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mount_loop(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mount_loop(): g is not a blessed HV reference");
    }
;
#line 8474 "lib/Sys/Guestfs.xs"
      r = guestfs_mount_loop (g, file, mountpoint);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20291 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mount_options); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mount_options)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, options, mountable, mountpoint");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	options = (char *)SvPV_nolen(ST(1))
;
	char *	mountable = (char *)SvPV_nolen(ST(2))
;
	char *	mountpoint = (char *)SvPV_nolen(ST(3))
;
#line 8485 "lib/Sys/Guestfs.xs"
      int r;
#line 20316 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mount_options(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mount_options(): g is not a blessed HV reference");
    }
;
#line 8487 "lib/Sys/Guestfs.xs"
      r = guestfs_mount_options (g, options, mountable, mountpoint);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20334 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mount_ro); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mount_ro)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, mountable, mountpoint");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	mountable = (char *)SvPV_nolen(ST(1))
;
	char *	mountpoint = (char *)SvPV_nolen(ST(2))
;
#line 8497 "lib/Sys/Guestfs.xs"
      int r;
#line 20357 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mount_ro(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mount_ro(): g is not a blessed HV reference");
    }
;
#line 8499 "lib/Sys/Guestfs.xs"
      r = guestfs_mount_ro (g, mountable, mountpoint);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20375 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mount_vfs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mount_vfs)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "g, options, vfstype, mountable, mountpoint");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	options = (char *)SvPV_nolen(ST(1))
;
	char *	vfstype = (char *)SvPV_nolen(ST(2))
;
	char *	mountable = (char *)SvPV_nolen(ST(3))
;
	char *	mountpoint = (char *)SvPV_nolen(ST(4))
;
#line 8511 "lib/Sys/Guestfs.xs"
      int r;
#line 20402 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mount_vfs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mount_vfs(): g is not a blessed HV reference");
    }
;
#line 8513 "lib/Sys/Guestfs.xs"
      r = guestfs_mount_vfs (g, options, vfstype, mountable, mountpoint);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20420 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mountable_device); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mountable_device)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, mountable");
    {
	guestfs_h *	g;
	char *	mountable = (char *)SvPV_nolen(ST(1))
;
#line 8522 "lib/Sys/Guestfs.xs"
      char *r;
#line 20439 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mountable_device(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mountable_device(): g is not a blessed HV reference");
    }
;
#line 8524 "lib/Sys/Guestfs.xs"
      r = guestfs_mountable_device (g, mountable);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 20460 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_mountable_subvolume); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mountable_subvolume)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, mountable");
    {
	guestfs_h *	g;
	char *	mountable = (char *)SvPV_nolen(ST(1))
;
#line 8537 "lib/Sys/Guestfs.xs"
      char *r;
#line 20480 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mountable_subvolume(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mountable_subvolume(): g is not a blessed HV reference");
    }
;
#line 8539 "lib/Sys/Guestfs.xs"
      r = guestfs_mountable_subvolume (g, mountable);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 20501 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_mountpoints); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mountpoints)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 8551 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 20522 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mountpoints(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mountpoints(): g is not a blessed HV reference");
    }
;
#line 8554 "lib/Sys/Guestfs.xs"
      r = guestfs_mountpoints (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 20547 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mounts); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mounts)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 8569 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 20567 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mounts(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mounts(): g is not a blessed HV reference");
    }
;
#line 8572 "lib/Sys/Guestfs.xs"
      r = guestfs_mounts (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 20592 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_mv); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_mv)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, src, dest");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
#line 8589 "lib/Sys/Guestfs.xs"
      int r;
#line 20615 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::mv(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::mv(): g is not a blessed HV reference");
    }
;
#line 8591 "lib/Sys/Guestfs.xs"
      r = guestfs_mv (g, src, dest);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20633 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_nr_devices); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_nr_devices)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    {
	guestfs_h *	g;
#line 8599 "lib/Sys/Guestfs.xs"
      int r;
#line 20650 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::nr_devices(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::nr_devices(): g is not a blessed HV reference");
    }
;
#line 8601 "lib/Sys/Guestfs.xs"
      r = guestfs_nr_devices (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 20670 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_ntfs_3g_probe); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ntfs_3g_probe)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, rw, device");
    {
	guestfs_h *	g;
	int	rw = (int)SvIV(ST(1))
;
	char *	device = (char *)SvPV_nolen(ST(2))
;
#line 8614 "lib/Sys/Guestfs.xs"
      int r;
#line 20692 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ntfs_3g_probe(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ntfs_3g_probe(): g is not a blessed HV reference");
    }
;
#line 8616 "lib/Sys/Guestfs.xs"
      r = guestfs_ntfs_3g_probe (g, rw, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 20712 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_ntfs_chmod); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ntfs_chmod)
{
    dVAR; dXSARGS;
    if (items < 4)
       croak_xs_usage(cv,  "g, device, mode, path, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	mode = (int)SvIV(ST(2))
;
	char *	path = (char *)SvPV_nolen(ST(3))
;
#line 8630 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_ntfs_chmod_argv optargs_s = { .bitmask = 0 };
      struct guestfs_ntfs_chmod_argv *optargs = &optargs_s;
      size_t items_i;
#line 20741 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ntfs_chmod(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ntfs_chmod(): g is not a blessed HV reference");
    }
;
#line 8635 "lib/Sys/Guestfs.xs"
      if (((items - 4) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 4; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "recursive")) {
          optargs_s.recursive = SvIV (ST (items_i+1));
          this_mask = GUESTFS_NTFS_CHMOD_RECURSIVE_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_ntfs_chmod_argv (g, device, mode, path, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20777 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ntfscat_i); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ntfscat_i)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, inode, filename");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int64_t	inode = my_SvIV64 (ST(2))
;
	char *	filename = (char *)SvPV_nolen(ST(3))
;
#line 8664 "lib/Sys/Guestfs.xs"
      int r;
#line 20802 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ntfscat_i(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ntfscat_i(): g is not a blessed HV reference");
    }
;
#line 8666 "lib/Sys/Guestfs.xs"
      r = guestfs_ntfscat_i (g, device, inode, filename);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20820 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ntfsclone_in); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ntfsclone_in)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, backupfile, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	backupfile = (char *)SvPV_nolen(ST(1))
;
	char *	device = (char *)SvPV_nolen(ST(2))
;
#line 8676 "lib/Sys/Guestfs.xs"
      int r;
#line 20843 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ntfsclone_in(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ntfsclone_in(): g is not a blessed HV reference");
    }
;
#line 8678 "lib/Sys/Guestfs.xs"
      r = guestfs_ntfsclone_in (g, backupfile, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20861 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ntfsclone_out); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ntfsclone_out)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, device, backupfile, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	backupfile = (char *)SvPV_nolen(ST(2))
;
#line 8688 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_ntfsclone_out_argv optargs_s = { .bitmask = 0 };
      struct guestfs_ntfsclone_out_argv *optargs = &optargs_s;
      size_t items_i;
#line 20887 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ntfsclone_out(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ntfsclone_out(): g is not a blessed HV reference");
    }
;
#line 8693 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "metadataonly")) {
          optargs_s.metadataonly = SvIV (ST (items_i+1));
          this_mask = GUESTFS_NTFSCLONE_OUT_METADATAONLY_BITMASK;
        }
        else if (STREQ (this_arg, "rescue")) {
          optargs_s.rescue = SvIV (ST (items_i+1));
          this_mask = GUESTFS_NTFSCLONE_OUT_RESCUE_BITMASK;
        }
        else if (STREQ (this_arg, "ignorefscheck")) {
          optargs_s.ignorefscheck = SvIV (ST (items_i+1));
          this_mask = GUESTFS_NTFSCLONE_OUT_IGNOREFSCHECK_BITMASK;
        }
        else if (STREQ (this_arg, "preservetimestamps")) {
          optargs_s.preservetimestamps = SvIV (ST (items_i+1));
          this_mask = GUESTFS_NTFSCLONE_OUT_PRESERVETIMESTAMPS_BITMASK;
        }
        else if (STREQ (this_arg, "force")) {
          optargs_s.force = SvIV (ST (items_i+1));
          this_mask = GUESTFS_NTFSCLONE_OUT_FORCE_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_ntfsclone_out_argv (g, device, backupfile, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20939 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ntfsfix); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ntfsfix)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, device, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 8736 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_ntfsfix_argv optargs_s = { .bitmask = 0 };
      struct guestfs_ntfsfix_argv *optargs = &optargs_s;
      size_t items_i;
#line 20963 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ntfsfix(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ntfsfix(): g is not a blessed HV reference");
    }
;
#line 8741 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "clearbadsectors")) {
          optargs_s.clearbadsectors = SvIV (ST (items_i+1));
          this_mask = GUESTFS_NTFSFIX_CLEARBADSECTORS_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_ntfsfix_argv (g, device, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 20999 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ntfsresize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ntfsresize)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, device, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 8768 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_ntfsresize_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_ntfsresize_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 21023 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ntfsresize(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ntfsresize(): g is not a blessed HV reference");
    }
;
#line 8773 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "size")) {
          optargs_s.size = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_NTFSRESIZE_OPTS_SIZE_BITMASK;
        }
        else if (STREQ (this_arg, "force")) {
          optargs_s.force = SvIV (ST (items_i+1));
          this_mask = GUESTFS_NTFSRESIZE_OPTS_FORCE_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_ntfsresize_opts_argv (g, device, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 21063 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_ntfsresize_size); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ntfsresize_size)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, size");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int64_t	size = my_SvIV64 (ST(2))
;
#line 8805 "lib/Sys/Guestfs.xs"
      int r;
#line 21086 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ntfsresize_size(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ntfsresize_size(): g is not a blessed HV reference");
    }
;
#line 8807 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::ntfsresize_size is deprecated; use Sys::Guestfs::ntfsresize instead");
      r = guestfs_ntfsresize_size (g, device, size);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 21106 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_parse_environment); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_parse_environment)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 8817 "lib/Sys/Guestfs.xs"
      int r;
#line 21125 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::parse_environment(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::parse_environment(): g is not a blessed HV reference");
    }
;
#line 8819 "lib/Sys/Guestfs.xs"
      r = guestfs_parse_environment (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 21143 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_parse_environment_list); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_parse_environment_list)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, environment");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char **	environment = XS_unpack_charPtrPtr(ST(1))
;
#line 8828 "lib/Sys/Guestfs.xs"
      int r;
#line 21164 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::parse_environment_list(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::parse_environment_list(): g is not a blessed HV reference");
    }
;
#line 8830 "lib/Sys/Guestfs.xs"
      r = guestfs_parse_environment_list (g, environment);
      free (environment);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 21183 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_add); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_add)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "g, device, prlogex, startsect, endsect");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	prlogex = (char *)SvPV_nolen(ST(2))
;
	int64_t	startsect = my_SvIV64 (ST(3))
;
	int64_t	endsect = my_SvIV64 (ST(4))
;
#line 8843 "lib/Sys/Guestfs.xs"
      int r;
#line 21210 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_add(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_add(): g is not a blessed HV reference");
    }
;
#line 8845 "lib/Sys/Guestfs.xs"
      r = guestfs_part_add (g, device, prlogex, startsect, endsect);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 21228 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_del); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_del)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, partnum");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
#line 8855 "lib/Sys/Guestfs.xs"
      int r;
#line 21251 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_del(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_del(): g is not a blessed HV reference");
    }
;
#line 8857 "lib/Sys/Guestfs.xs"
      r = guestfs_part_del (g, device, partnum);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 21269 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_disk); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_disk)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, parttype");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	parttype = (char *)SvPV_nolen(ST(2))
;
#line 8867 "lib/Sys/Guestfs.xs"
      int r;
#line 21292 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_disk(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_disk(): g is not a blessed HV reference");
    }
;
#line 8869 "lib/Sys/Guestfs.xs"
      r = guestfs_part_disk (g, device, parttype);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 21310 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_expand_gpt); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_expand_gpt)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 8878 "lib/Sys/Guestfs.xs"
      int r;
#line 21331 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_expand_gpt(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_expand_gpt(): g is not a blessed HV reference");
    }
;
#line 8880 "lib/Sys/Guestfs.xs"
      r = guestfs_part_expand_gpt (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 21349 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_get_bootable); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_get_bootable)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, partnum");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
#line 8890 "lib/Sys/Guestfs.xs"
      int r;
#line 21370 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_get_bootable(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_get_bootable(): g is not a blessed HV reference");
    }
;
#line 8892 "lib/Sys/Guestfs.xs"
      r = guestfs_part_get_bootable (g, device, partnum);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 21390 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_part_get_disk_guid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_get_disk_guid)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 8904 "lib/Sys/Guestfs.xs"
      char *r;
#line 21410 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_get_disk_guid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_get_disk_guid(): g is not a blessed HV reference");
    }
;
#line 8906 "lib/Sys/Guestfs.xs"
      r = guestfs_part_get_disk_guid (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 21431 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_part_get_gpt_attributes); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_get_gpt_attributes)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, partnum");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
#line 8920 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 21453 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_get_gpt_attributes(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_get_gpt_attributes(): g is not a blessed HV reference");
    }
;
#line 8922 "lib/Sys/Guestfs.xs"
      r = guestfs_part_get_gpt_attributes (g, device, partnum);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 21473 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_part_get_gpt_guid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_get_gpt_guid)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, partnum");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
#line 8935 "lib/Sys/Guestfs.xs"
      char *r;
#line 21495 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_get_gpt_guid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_get_gpt_guid(): g is not a blessed HV reference");
    }
;
#line 8937 "lib/Sys/Guestfs.xs"
      r = guestfs_part_get_gpt_guid (g, device, partnum);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 21516 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_part_get_gpt_type); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_get_gpt_type)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, partnum");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
#line 8951 "lib/Sys/Guestfs.xs"
      char *r;
#line 21538 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_get_gpt_type(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_get_gpt_type(): g is not a blessed HV reference");
    }
;
#line 8953 "lib/Sys/Guestfs.xs"
      r = guestfs_part_get_gpt_type (g, device, partnum);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 21559 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_part_get_mbr_id); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_get_mbr_id)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, partnum");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
#line 8967 "lib/Sys/Guestfs.xs"
      int r;
#line 21581 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_get_mbr_id(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_get_mbr_id(): g is not a blessed HV reference");
    }
;
#line 8969 "lib/Sys/Guestfs.xs"
      r = guestfs_part_get_mbr_id (g, device, partnum);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 21601 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_part_get_mbr_part_type); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_get_mbr_part_type)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, partnum");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
#line 8982 "lib/Sys/Guestfs.xs"
      char *r;
#line 21623 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_get_mbr_part_type(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_get_mbr_part_type(): g is not a blessed HV reference");
    }
;
#line 8984 "lib/Sys/Guestfs.xs"
      r = guestfs_part_get_mbr_part_type (g, device, partnum);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 21644 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_part_get_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_get_name)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, partnum");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
#line 8998 "lib/Sys/Guestfs.xs"
      char *r;
#line 21666 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_get_name(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_get_name(): g is not a blessed HV reference");
    }
;
#line 9000 "lib/Sys/Guestfs.xs"
      r = guestfs_part_get_name (g, device, partnum);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 21687 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_part_get_parttype); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_get_parttype)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 9013 "lib/Sys/Guestfs.xs"
      char *r;
#line 21707 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_get_parttype(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_get_parttype(): g is not a blessed HV reference");
    }
;
#line 9015 "lib/Sys/Guestfs.xs"
      r = guestfs_part_get_parttype (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 21728 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_part_init); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_init)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, parttype");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	parttype = (char *)SvPV_nolen(ST(2))
;
#line 9029 "lib/Sys/Guestfs.xs"
      int r;
#line 21752 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_init(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_init(): g is not a blessed HV reference");
    }
;
#line 9031 "lib/Sys/Guestfs.xs"
      r = guestfs_part_init (g, device, parttype);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 21770 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_list); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_list)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 9040 "lib/Sys/Guestfs.xs"
      struct guestfs_partition_list *r;
      size_t i;
      HV *hv;
#line 21793 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_list(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_list(): g is not a blessed HV reference");
    }
;
#line 9044 "lib/Sys/Guestfs.xs"
      r = guestfs_part_list (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "part_num", 8, newSVnv (r->val[i].part_num), 0);
        (void) hv_store (hv, "part_start", 10, my_newSVull (r->val[i].part_start), 0);
        (void) hv_store (hv, "part_end", 8, my_newSVull (r->val[i].part_end), 0);
        (void) hv_store (hv, "part_size", 9, my_newSVull (r->val[i].part_size), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_partition_list (r);
#line 21821 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_resize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_resize)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, partnum, endsect");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
	int64_t	endsect = my_SvIV64 (ST(3))
;
#line 9065 "lib/Sys/Guestfs.xs"
      int r;
#line 21846 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_resize(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_resize(): g is not a blessed HV reference");
    }
;
#line 9067 "lib/Sys/Guestfs.xs"
      r = guestfs_part_resize (g, device, partnum, endsect);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 21864 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_set_bootable); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_set_bootable)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, partnum, bootable");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
	int	bootable = (int)SvIV(ST(3))
;
#line 9078 "lib/Sys/Guestfs.xs"
      int r;
#line 21889 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_set_bootable(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_set_bootable(): g is not a blessed HV reference");
    }
;
#line 9080 "lib/Sys/Guestfs.xs"
      r = guestfs_part_set_bootable (g, device, partnum, bootable);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 21907 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_set_disk_guid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_set_disk_guid)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, guid");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	guid = (char *)SvPV_nolen(ST(2))
;
#line 9090 "lib/Sys/Guestfs.xs"
      int r;
#line 21930 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_set_disk_guid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_set_disk_guid(): g is not a blessed HV reference");
    }
;
#line 9092 "lib/Sys/Guestfs.xs"
      r = guestfs_part_set_disk_guid (g, device, guid);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 21948 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_set_disk_guid_random); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_set_disk_guid_random)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 9101 "lib/Sys/Guestfs.xs"
      int r;
#line 21969 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_set_disk_guid_random(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_set_disk_guid_random(): g is not a blessed HV reference");
    }
;
#line 9103 "lib/Sys/Guestfs.xs"
      r = guestfs_part_set_disk_guid_random (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 21987 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_set_gpt_attributes); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_set_gpt_attributes)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, partnum, attributes");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
	int64_t	attributes = my_SvIV64 (ST(3))
;
#line 9114 "lib/Sys/Guestfs.xs"
      int r;
#line 22012 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_set_gpt_attributes(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_set_gpt_attributes(): g is not a blessed HV reference");
    }
;
#line 9116 "lib/Sys/Guestfs.xs"
      r = guestfs_part_set_gpt_attributes (g, device, partnum, attributes);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 22030 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_set_gpt_guid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_set_gpt_guid)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, partnum, guid");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
	char *	guid = (char *)SvPV_nolen(ST(3))
;
#line 9127 "lib/Sys/Guestfs.xs"
      int r;
#line 22055 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_set_gpt_guid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_set_gpt_guid(): g is not a blessed HV reference");
    }
;
#line 9129 "lib/Sys/Guestfs.xs"
      r = guestfs_part_set_gpt_guid (g, device, partnum, guid);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 22073 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_set_gpt_type); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_set_gpt_type)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, partnum, guid");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
	char *	guid = (char *)SvPV_nolen(ST(3))
;
#line 9140 "lib/Sys/Guestfs.xs"
      int r;
#line 22098 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_set_gpt_type(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_set_gpt_type(): g is not a blessed HV reference");
    }
;
#line 9142 "lib/Sys/Guestfs.xs"
      r = guestfs_part_set_gpt_type (g, device, partnum, guid);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 22116 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_set_mbr_id); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_set_mbr_id)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, partnum, idbyte");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
	int	idbyte = (int)SvIV(ST(3))
;
#line 9153 "lib/Sys/Guestfs.xs"
      int r;
#line 22141 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_set_mbr_id(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_set_mbr_id(): g is not a blessed HV reference");
    }
;
#line 9155 "lib/Sys/Guestfs.xs"
      r = guestfs_part_set_mbr_id (g, device, partnum, idbyte);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 22159 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_set_name); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_set_name)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, partnum, name");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
	char *	name = (char *)SvPV_nolen(ST(3))
;
#line 9166 "lib/Sys/Guestfs.xs"
      int r;
#line 22184 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_set_name(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_set_name(): g is not a blessed HV reference");
    }
;
#line 9168 "lib/Sys/Guestfs.xs"
      r = guestfs_part_set_name (g, device, partnum, name);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 22202 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_part_to_dev); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_to_dev)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, partition");
    {
	guestfs_h *	g;
	char *	partition = (char *)SvPV_nolen(ST(1))
;
#line 9177 "lib/Sys/Guestfs.xs"
      char *r;
#line 22221 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_to_dev(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_to_dev(): g is not a blessed HV reference");
    }
;
#line 9179 "lib/Sys/Guestfs.xs"
      r = guestfs_part_to_dev (g, partition);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 22242 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_part_to_partnum); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_part_to_partnum)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, partition");
    {
	guestfs_h *	g;
	char *	partition = (char *)SvPV_nolen(ST(1))
;
#line 9192 "lib/Sys/Guestfs.xs"
      int r;
#line 22262 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::part_to_partnum(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::part_to_partnum(): g is not a blessed HV reference");
    }
;
#line 9194 "lib/Sys/Guestfs.xs"
      r = guestfs_part_to_partnum (g, partition);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 22282 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_ping_daemon); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_ping_daemon)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 9205 "lib/Sys/Guestfs.xs"
      int r;
#line 22302 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::ping_daemon(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::ping_daemon(): g is not a blessed HV reference");
    }
;
#line 9207 "lib/Sys/Guestfs.xs"
      r = guestfs_ping_daemon (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 22320 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_pread); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_pread)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, path, count, offset");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	int	count = (int)SvIV(ST(2))
;
	int64_t	offset = my_SvIV64 (ST(3))
;
#line 9218 "lib/Sys/Guestfs.xs"
      char *r;
      size_t size;
#line 22344 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::pread(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::pread(): g is not a blessed HV reference");
    }
;
#line 9221 "lib/Sys/Guestfs.xs"
      r = guestfs_pread (g, path, count, offset, &size);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpvn (r, size);
      free (r);
#line 22365 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_pread_device); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_pread_device)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, count, offset");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	count = (int)SvIV(ST(2))
;
	int64_t	offset = my_SvIV64 (ST(3))
;
#line 9236 "lib/Sys/Guestfs.xs"
      char *r;
      size_t size;
#line 22390 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::pread_device(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::pread_device(): g is not a blessed HV reference");
    }
;
#line 9239 "lib/Sys/Guestfs.xs"
      r = guestfs_pread_device (g, device, count, offset, &size);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpvn (r, size);
      free (r);
#line 22411 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_pvchange_uuid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_pvchange_uuid)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 9252 "lib/Sys/Guestfs.xs"
      int r;
#line 22433 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::pvchange_uuid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::pvchange_uuid(): g is not a blessed HV reference");
    }
;
#line 9254 "lib/Sys/Guestfs.xs"
      r = guestfs_pvchange_uuid (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 22451 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_pvchange_uuid_all); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_pvchange_uuid_all)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 9262 "lib/Sys/Guestfs.xs"
      int r;
#line 22470 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::pvchange_uuid_all(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::pvchange_uuid_all(): g is not a blessed HV reference");
    }
;
#line 9264 "lib/Sys/Guestfs.xs"
      r = guestfs_pvchange_uuid_all (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 22488 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_pvcreate); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_pvcreate)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 9273 "lib/Sys/Guestfs.xs"
      int r;
#line 22509 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::pvcreate(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::pvcreate(): g is not a blessed HV reference");
    }
;
#line 9275 "lib/Sys/Guestfs.xs"
      r = guestfs_pvcreate (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 22527 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_pvremove); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_pvremove)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 9284 "lib/Sys/Guestfs.xs"
      int r;
#line 22548 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::pvremove(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::pvremove(): g is not a blessed HV reference");
    }
;
#line 9286 "lib/Sys/Guestfs.xs"
      r = guestfs_pvremove (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 22566 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_pvresize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_pvresize)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 9295 "lib/Sys/Guestfs.xs"
      int r;
#line 22587 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::pvresize(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::pvresize(): g is not a blessed HV reference");
    }
;
#line 9297 "lib/Sys/Guestfs.xs"
      r = guestfs_pvresize (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 22605 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_pvresize_size); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_pvresize_size)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, size");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int64_t	size = my_SvIV64 (ST(2))
;
#line 9307 "lib/Sys/Guestfs.xs"
      int r;
#line 22628 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::pvresize_size(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::pvresize_size(): g is not a blessed HV reference");
    }
;
#line 9309 "lib/Sys/Guestfs.xs"
      r = guestfs_pvresize_size (g, device, size);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 22646 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_pvs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_pvs)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 9317 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 22666 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::pvs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::pvs(): g is not a blessed HV reference");
    }
;
#line 9320 "lib/Sys/Guestfs.xs"
      r = guestfs_pvs (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 22691 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_pvs_full); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_pvs_full)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 9335 "lib/Sys/Guestfs.xs"
      struct guestfs_lvm_pv_list *r;
      size_t i;
      HV *hv;
#line 22712 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::pvs_full(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::pvs_full(): g is not a blessed HV reference");
    }
;
#line 9339 "lib/Sys/Guestfs.xs"
      r = guestfs_pvs_full (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "pv_name", 7, newSVpv (r->val[i].pv_name, 0), 0);
        (void) hv_store (hv, "pv_uuid", 7, newSVpv (r->val[i].pv_uuid, 32), 0);
        (void) hv_store (hv, "pv_fmt", 6, newSVpv (r->val[i].pv_fmt, 0), 0);
        (void) hv_store (hv, "pv_size", 7, my_newSVull (r->val[i].pv_size), 0);
        (void) hv_store (hv, "dev_size", 8, my_newSVull (r->val[i].dev_size), 0);
        (void) hv_store (hv, "pv_free", 7, my_newSVull (r->val[i].pv_free), 0);
        (void) hv_store (hv, "pv_used", 7, my_newSVull (r->val[i].pv_used), 0);
        (void) hv_store (hv, "pv_attr", 7, newSVpv (r->val[i].pv_attr, 0), 0);
        (void) hv_store (hv, "pv_pe_count", 11, my_newSVll (r->val[i].pv_pe_count), 0);
        (void) hv_store (hv, "pv_pe_alloc_count", 17, my_newSVll (r->val[i].pv_pe_alloc_count), 0);
        (void) hv_store (hv, "pv_tags", 7, newSVpv (r->val[i].pv_tags, 0), 0);
        (void) hv_store (hv, "pe_start", 8, my_newSVull (r->val[i].pe_start), 0);
        (void) hv_store (hv, "pv_mda_count", 12, my_newSVll (r->val[i].pv_mda_count), 0);
        (void) hv_store (hv, "pv_mda_free", 11, my_newSVull (r->val[i].pv_mda_free), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_lvm_pv_list (r);
#line 22750 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_pvuuid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_pvuuid)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 9368 "lib/Sys/Guestfs.xs"
      char *r;
#line 22769 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::pvuuid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::pvuuid(): g is not a blessed HV reference");
    }
;
#line 9370 "lib/Sys/Guestfs.xs"
      r = guestfs_pvuuid (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 22790 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_pwrite); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_pwrite)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, path, content, offset");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	char *	content = (char *)SvPV_nolen(ST(2))
;
	size_t	content_size = SvCUR (ST(2));
	int64_t	offset = my_SvIV64 (ST(3))
;
#line 9386 "lib/Sys/Guestfs.xs"
      int r;
#line 22815 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::pwrite(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::pwrite(): g is not a blessed HV reference");
    }
;
#line 9388 "lib/Sys/Guestfs.xs"
      r = guestfs_pwrite (g, path, content, content_size, offset);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 22835 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_pwrite_device); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_pwrite_device)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, device, content, offset");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	content = (char *)SvPV_nolen(ST(2))
;
	size_t	content_size = SvCUR (ST(2));
	int64_t	offset = my_SvIV64 (ST(3))
;
#line 9403 "lib/Sys/Guestfs.xs"
      int r;
#line 22860 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::pwrite_device(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::pwrite_device(): g is not a blessed HV reference");
    }
;
#line 9405 "lib/Sys/Guestfs.xs"
      r = guestfs_pwrite_device (g, device, content, content_size, offset);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 22880 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_read_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_read_file)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 9417 "lib/Sys/Guestfs.xs"
      char *r;
      size_t size;
#line 22901 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::read_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::read_file(): g is not a blessed HV reference");
    }
;
#line 9420 "lib/Sys/Guestfs.xs"
      r = guestfs_read_file (g, path, &size);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpvn (r, size);
      free (r);
#line 22922 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_read_lines); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_read_lines)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 9433 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 22945 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::read_lines(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::read_lines(): g is not a blessed HV reference");
    }
;
#line 9436 "lib/Sys/Guestfs.xs"
      r = guestfs_read_lines (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 22970 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_readdir); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_readdir)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, dir");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	dir = (char *)SvPV_nolen(ST(1))
;
#line 9452 "lib/Sys/Guestfs.xs"
      struct guestfs_dirent_list *r;
      size_t i;
      HV *hv;
#line 22993 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::readdir(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::readdir(): g is not a blessed HV reference");
    }
;
#line 9456 "lib/Sys/Guestfs.xs"
      r = guestfs_readdir (g, dir);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "ino", 3, my_newSVll (r->val[i].ino), 0);
        (void) hv_store (hv, "ftyp", 4, newSVpv (&r->val[i].ftyp, 1), 0);
        (void) hv_store (hv, "name", 4, newSVpv (r->val[i].name, 0), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_dirent_list (r);
#line 23020 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_readlink); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_readlink)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 9474 "lib/Sys/Guestfs.xs"
      char *r;
#line 23039 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::readlink(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::readlink(): g is not a blessed HV reference");
    }
;
#line 9476 "lib/Sys/Guestfs.xs"
      r = guestfs_readlink (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 23060 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_readlinklist); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_readlinklist)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, names");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	char **	names = XS_unpack_charPtrPtr(ST(2))
;
#line 9490 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 23085 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::readlinklist(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::readlinklist(): g is not a blessed HV reference");
    }
;
#line 9493 "lib/Sys/Guestfs.xs"
      r = guestfs_readlinklist (g, path, names);
      free (names);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 23111 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_realpath); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_realpath)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 9510 "lib/Sys/Guestfs.xs"
      char *r;
#line 23130 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::realpath(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::realpath(): g is not a blessed HV reference");
    }
;
#line 9512 "lib/Sys/Guestfs.xs"
      r = guestfs_realpath (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 23151 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_remount); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_remount)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, mountpoint, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	mountpoint = (char *)SvPV_nolen(ST(1))
;
#line 9525 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_remount_argv optargs_s = { .bitmask = 0 };
      struct guestfs_remount_argv *optargs = &optargs_s;
      size_t items_i;
#line 23176 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::remount(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::remount(): g is not a blessed HV reference");
    }
;
#line 9530 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "rw")) {
          optargs_s.rw = SvIV (ST (items_i+1));
          this_mask = GUESTFS_REMOUNT_RW_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_remount_argv (g, mountpoint, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23212 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_remove_drive); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_remove_drive)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, label");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	label = (char *)SvPV_nolen(ST(1))
;
#line 9557 "lib/Sys/Guestfs.xs"
      int r;
#line 23233 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::remove_drive(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::remove_drive(): g is not a blessed HV reference");
    }
;
#line 9559 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::remove_drive is deprecated");
      r = guestfs_remove_drive (g, label);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23253 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_removexattr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_removexattr)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, xattr, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	xattr = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 9571 "lib/Sys/Guestfs.xs"
      int r;
#line 23276 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::removexattr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::removexattr(): g is not a blessed HV reference");
    }
;
#line 9573 "lib/Sys/Guestfs.xs"
      r = guestfs_removexattr (g, xattr, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23294 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_rename); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_rename)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, oldpath, newpath");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	oldpath = (char *)SvPV_nolen(ST(1))
;
	char *	newpath = (char *)SvPV_nolen(ST(2))
;
#line 9583 "lib/Sys/Guestfs.xs"
      int r;
#line 23317 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::rename(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::rename(): g is not a blessed HV reference");
    }
;
#line 9585 "lib/Sys/Guestfs.xs"
      r = guestfs_rename (g, oldpath, newpath);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23335 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_resize2fs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_resize2fs)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 9594 "lib/Sys/Guestfs.xs"
      int r;
#line 23356 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::resize2fs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::resize2fs(): g is not a blessed HV reference");
    }
;
#line 9596 "lib/Sys/Guestfs.xs"
      r = guestfs_resize2fs (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23374 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_resize2fs_M); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_resize2fs_M)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 9605 "lib/Sys/Guestfs.xs"
      int r;
#line 23395 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::resize2fs_M(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::resize2fs_M(): g is not a blessed HV reference");
    }
;
#line 9607 "lib/Sys/Guestfs.xs"
      r = guestfs_resize2fs_M (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23413 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_resize2fs_size); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_resize2fs_size)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, size");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int64_t	size = my_SvIV64 (ST(2))
;
#line 9617 "lib/Sys/Guestfs.xs"
      int r;
#line 23436 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::resize2fs_size(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::resize2fs_size(): g is not a blessed HV reference");
    }
;
#line 9619 "lib/Sys/Guestfs.xs"
      r = guestfs_resize2fs_size (g, device, size);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23454 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_rm); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_rm)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 9628 "lib/Sys/Guestfs.xs"
      int r;
#line 23475 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::rm(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::rm(): g is not a blessed HV reference");
    }
;
#line 9630 "lib/Sys/Guestfs.xs"
      r = guestfs_rm (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23493 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_rm_f); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_rm_f)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 9639 "lib/Sys/Guestfs.xs"
      int r;
#line 23514 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::rm_f(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::rm_f(): g is not a blessed HV reference");
    }
;
#line 9641 "lib/Sys/Guestfs.xs"
      r = guestfs_rm_f (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23532 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_rm_rf); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_rm_rf)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 9650 "lib/Sys/Guestfs.xs"
      int r;
#line 23553 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::rm_rf(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::rm_rf(): g is not a blessed HV reference");
    }
;
#line 9652 "lib/Sys/Guestfs.xs"
      r = guestfs_rm_rf (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23571 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_rmdir); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_rmdir)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 9661 "lib/Sys/Guestfs.xs"
      int r;
#line 23592 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::rmdir(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::rmdir(): g is not a blessed HV reference");
    }
;
#line 9663 "lib/Sys/Guestfs.xs"
      r = guestfs_rmdir (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23610 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_rmmountpoint); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_rmmountpoint)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, exemptpath");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	exemptpath = (char *)SvPV_nolen(ST(1))
;
#line 9672 "lib/Sys/Guestfs.xs"
      int r;
#line 23631 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::rmmountpoint(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::rmmountpoint(): g is not a blessed HV reference");
    }
;
#line 9674 "lib/Sys/Guestfs.xs"
      r = guestfs_rmmountpoint (g, exemptpath);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23649 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_rsync); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_rsync)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, src, dest, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
#line 9684 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_rsync_argv optargs_s = { .bitmask = 0 };
      struct guestfs_rsync_argv *optargs = &optargs_s;
      size_t items_i;
#line 23675 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::rsync(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::rsync(): g is not a blessed HV reference");
    }
;
#line 9689 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "archive")) {
          optargs_s.archive = SvIV (ST (items_i+1));
          this_mask = GUESTFS_RSYNC_ARCHIVE_BITMASK;
        }
        else if (STREQ (this_arg, "deletedest")) {
          optargs_s.deletedest = SvIV (ST (items_i+1));
          this_mask = GUESTFS_RSYNC_DELETEDEST_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_rsync_argv (g, src, dest, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23715 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_rsync_in); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_rsync_in)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, remote, dest, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	remote = (char *)SvPV_nolen(ST(1))
;
	char *	dest = (char *)SvPV_nolen(ST(2))
;
#line 9721 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_rsync_in_argv optargs_s = { .bitmask = 0 };
      struct guestfs_rsync_in_argv *optargs = &optargs_s;
      size_t items_i;
#line 23741 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::rsync_in(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::rsync_in(): g is not a blessed HV reference");
    }
;
#line 9726 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "archive")) {
          optargs_s.archive = SvIV (ST (items_i+1));
          this_mask = GUESTFS_RSYNC_IN_ARCHIVE_BITMASK;
        }
        else if (STREQ (this_arg, "deletedest")) {
          optargs_s.deletedest = SvIV (ST (items_i+1));
          this_mask = GUESTFS_RSYNC_IN_DELETEDEST_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_rsync_in_argv (g, remote, dest, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23781 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_rsync_out); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_rsync_out)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, src, remote, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	src = (char *)SvPV_nolen(ST(1))
;
	char *	remote = (char *)SvPV_nolen(ST(2))
;
#line 9758 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_rsync_out_argv optargs_s = { .bitmask = 0 };
      struct guestfs_rsync_out_argv *optargs = &optargs_s;
      size_t items_i;
#line 23807 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::rsync_out(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::rsync_out(): g is not a blessed HV reference");
    }
;
#line 9763 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "archive")) {
          optargs_s.archive = SvIV (ST (items_i+1));
          this_mask = GUESTFS_RSYNC_OUT_ARCHIVE_BITMASK;
        }
        else if (STREQ (this_arg, "deletedest")) {
          optargs_s.deletedest = SvIV (ST (items_i+1));
          this_mask = GUESTFS_RSYNC_OUT_DELETEDEST_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_rsync_out_argv (g, src, remote, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23847 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_scrub_device); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_scrub_device)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 9794 "lib/Sys/Guestfs.xs"
      int r;
#line 23868 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::scrub_device(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::scrub_device(): g is not a blessed HV reference");
    }
;
#line 9796 "lib/Sys/Guestfs.xs"
      r = guestfs_scrub_device (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23886 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_scrub_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_scrub_file)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, file");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	file = (char *)SvPV_nolen(ST(1))
;
#line 9805 "lib/Sys/Guestfs.xs"
      int r;
#line 23907 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::scrub_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::scrub_file(): g is not a blessed HV reference");
    }
;
#line 9807 "lib/Sys/Guestfs.xs"
      r = guestfs_scrub_file (g, file);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23925 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_scrub_freespace); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_scrub_freespace)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, dir");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	dir = (char *)SvPV_nolen(ST(1))
;
#line 9816 "lib/Sys/Guestfs.xs"
      int r;
#line 23946 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::scrub_freespace(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::scrub_freespace(): g is not a blessed HV reference");
    }
;
#line 9818 "lib/Sys/Guestfs.xs"
      r = guestfs_scrub_freespace (g, dir);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 23964 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_selinux_relabel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_selinux_relabel)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, specfile, path, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	specfile = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 9828 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_selinux_relabel_argv optargs_s = { .bitmask = 0 };
      struct guestfs_selinux_relabel_argv *optargs = &optargs_s;
      size_t items_i;
#line 23990 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::selinux_relabel(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::selinux_relabel(): g is not a blessed HV reference");
    }
;
#line 9833 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::selinux_relabel is deprecated; use Sys::Guestfs::setfiles instead");
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "force")) {
          optargs_s.force = SvIV (ST (items_i+1));
          this_mask = GUESTFS_SELINUX_RELABEL_FORCE_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_selinux_relabel_argv (g, specfile, path, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24028 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_append); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_append)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, append");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	append = SvOK(ST(1)) ? SvPV_nolen(ST(1)) : NULL;
#line 9862 "lib/Sys/Guestfs.xs"
      int r;
#line 24048 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_append(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_append(): g is not a blessed HV reference");
    }
;
#line 9864 "lib/Sys/Guestfs.xs"
      r = guestfs_set_append (g, append);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24066 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_attach_method); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_attach_method)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, backend");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	backend = (char *)SvPV_nolen(ST(1))
;
#line 9873 "lib/Sys/Guestfs.xs"
      int r;
#line 24087 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_attach_method(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_attach_method(): g is not a blessed HV reference");
    }
;
#line 9875 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::set_attach_method is deprecated; use Sys::Guestfs::set_backend instead");
      r = guestfs_set_attach_method (g, backend);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24107 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_autosync); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_autosync)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, autosync");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	autosync = (int)SvIV(ST(1))
;
#line 9886 "lib/Sys/Guestfs.xs"
      int r;
#line 24128 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_autosync(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_autosync(): g is not a blessed HV reference");
    }
;
#line 9888 "lib/Sys/Guestfs.xs"
      r = guestfs_set_autosync (g, autosync);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24146 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_backend); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_backend)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, backend");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	backend = (char *)SvPV_nolen(ST(1))
;
#line 9897 "lib/Sys/Guestfs.xs"
      int r;
#line 24167 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_backend(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_backend(): g is not a blessed HV reference");
    }
;
#line 9899 "lib/Sys/Guestfs.xs"
      r = guestfs_set_backend (g, backend);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24185 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_backend_setting); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_backend_setting)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, name, val");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	name = (char *)SvPV_nolen(ST(1))
;
	char *	val = (char *)SvPV_nolen(ST(2))
;
#line 9909 "lib/Sys/Guestfs.xs"
      int r;
#line 24208 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_backend_setting(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_backend_setting(): g is not a blessed HV reference");
    }
;
#line 9911 "lib/Sys/Guestfs.xs"
      r = guestfs_set_backend_setting (g, name, val);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24226 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_backend_settings); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_backend_settings)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, settings");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char **	settings = XS_unpack_charPtrPtr(ST(1))
;
#line 9920 "lib/Sys/Guestfs.xs"
      int r;
#line 24247 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_backend_settings(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_backend_settings(): g is not a blessed HV reference");
    }
;
#line 9922 "lib/Sys/Guestfs.xs"
      r = guestfs_set_backend_settings (g, settings);
      free (settings);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24266 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_cachedir); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_cachedir)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, cachedir");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	cachedir = SvOK(ST(1)) ? SvPV_nolen(ST(1)) : NULL;
#line 9932 "lib/Sys/Guestfs.xs"
      int r;
#line 24286 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_cachedir(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_cachedir(): g is not a blessed HV reference");
    }
;
#line 9934 "lib/Sys/Guestfs.xs"
      r = guestfs_set_cachedir (g, cachedir);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24304 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_direct); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_direct)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, direct");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	direct = (int)SvIV(ST(1))
;
#line 9943 "lib/Sys/Guestfs.xs"
      int r;
#line 24325 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_direct(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_direct(): g is not a blessed HV reference");
    }
;
#line 9945 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::set_direct is deprecated; use Sys::Guestfs::internal_get_console_socket instead");
      r = guestfs_set_direct (g, direct);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24345 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_e2attrs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_e2attrs)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, file, attrs, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	file = (char *)SvPV_nolen(ST(1))
;
	char *	attrs = (char *)SvPV_nolen(ST(2))
;
#line 9957 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_set_e2attrs_argv optargs_s = { .bitmask = 0 };
      struct guestfs_set_e2attrs_argv *optargs = &optargs_s;
      size_t items_i;
#line 24371 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_e2attrs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_e2attrs(): g is not a blessed HV reference");
    }
;
#line 9962 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "clear")) {
          optargs_s.clear = SvIV (ST (items_i+1));
          this_mask = GUESTFS_SET_E2ATTRS_CLEAR_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_set_e2attrs_argv (g, file, attrs, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24407 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_e2generation); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_e2generation)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, file, generation");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	file = (char *)SvPV_nolen(ST(1))
;
	int64_t	generation = my_SvIV64 (ST(2))
;
#line 9990 "lib/Sys/Guestfs.xs"
      int r;
#line 24430 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_e2generation(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_e2generation(): g is not a blessed HV reference");
    }
;
#line 9992 "lib/Sys/Guestfs.xs"
      r = guestfs_set_e2generation (g, file, generation);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24448 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_e2label); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_e2label)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, label");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	label = (char *)SvPV_nolen(ST(2))
;
#line 10002 "lib/Sys/Guestfs.xs"
      int r;
#line 24471 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_e2label(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_e2label(): g is not a blessed HV reference");
    }
;
#line 10004 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::set_e2label is deprecated; use Sys::Guestfs::set_label instead");
      r = guestfs_set_e2label (g, device, label);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24491 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_e2uuid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_e2uuid)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, uuid");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	uuid = (char *)SvPV_nolen(ST(2))
;
#line 10016 "lib/Sys/Guestfs.xs"
      int r;
#line 24514 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_e2uuid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_e2uuid(): g is not a blessed HV reference");
    }
;
#line 10018 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::set_e2uuid is deprecated; use Sys::Guestfs::set_uuid instead");
      r = guestfs_set_e2uuid (g, device, uuid);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24534 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_hv); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_hv)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, hv");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	hv = (char *)SvPV_nolen(ST(1))
;
#line 10029 "lib/Sys/Guestfs.xs"
      int r;
#line 24555 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_hv(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_hv(): g is not a blessed HV reference");
    }
;
#line 10031 "lib/Sys/Guestfs.xs"
      r = guestfs_set_hv (g, hv);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24573 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_identifier); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_identifier)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, identifier");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	identifier = (char *)SvPV_nolen(ST(1))
;
#line 10040 "lib/Sys/Guestfs.xs"
      int r;
#line 24594 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_identifier(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_identifier(): g is not a blessed HV reference");
    }
;
#line 10042 "lib/Sys/Guestfs.xs"
      r = guestfs_set_identifier (g, identifier);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24612 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_label); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_label)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, mountable, label");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	mountable = (char *)SvPV_nolen(ST(1))
;
	char *	label = (char *)SvPV_nolen(ST(2))
;
#line 10052 "lib/Sys/Guestfs.xs"
      int r;
#line 24635 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_label(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_label(): g is not a blessed HV reference");
    }
;
#line 10054 "lib/Sys/Guestfs.xs"
      r = guestfs_set_label (g, mountable, label);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24653 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_libvirt_requested_credential); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_libvirt_requested_credential)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, index, cred");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	index = (int)SvIV(ST(1))
;
	char *	cred = (char *)SvPV_nolen(ST(2))
;
	size_t	cred_size = SvCUR (ST(2));
#line 10065 "lib/Sys/Guestfs.xs"
      int r;
#line 24677 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_libvirt_requested_credential(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_libvirt_requested_credential(): g is not a blessed HV reference");
    }
;
#line 10067 "lib/Sys/Guestfs.xs"
      r = guestfs_set_libvirt_requested_credential (g, index, cred, cred_size);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24695 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_libvirt_supported_credentials); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_libvirt_supported_credentials)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, creds");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char **	creds = XS_unpack_charPtrPtr(ST(1))
;
#line 10076 "lib/Sys/Guestfs.xs"
      int r;
#line 24716 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_libvirt_supported_credentials(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_libvirt_supported_credentials(): g is not a blessed HV reference");
    }
;
#line 10078 "lib/Sys/Guestfs.xs"
      r = guestfs_set_libvirt_supported_credentials (g, creds);
      free (creds);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24735 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_memsize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_memsize)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, memsize");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	memsize = (int)SvIV(ST(1))
;
#line 10088 "lib/Sys/Guestfs.xs"
      int r;
#line 24756 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_memsize(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_memsize(): g is not a blessed HV reference");
    }
;
#line 10090 "lib/Sys/Guestfs.xs"
      r = guestfs_set_memsize (g, memsize);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24774 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_network); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_network)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, network");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	network = (int)SvIV(ST(1))
;
#line 10099 "lib/Sys/Guestfs.xs"
      int r;
#line 24795 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_network(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_network(): g is not a blessed HV reference");
    }
;
#line 10101 "lib/Sys/Guestfs.xs"
      r = guestfs_set_network (g, network);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24813 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_path); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_path)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, searchpath");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	searchpath = SvOK(ST(1)) ? SvPV_nolen(ST(1)) : NULL;
#line 10110 "lib/Sys/Guestfs.xs"
      int r;
#line 24833 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_path(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_path(): g is not a blessed HV reference");
    }
;
#line 10112 "lib/Sys/Guestfs.xs"
      r = guestfs_set_path (g, searchpath);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24851 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_pgroup); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_pgroup)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, pgroup");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	pgroup = (int)SvIV(ST(1))
;
#line 10121 "lib/Sys/Guestfs.xs"
      int r;
#line 24872 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_pgroup(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_pgroup(): g is not a blessed HV reference");
    }
;
#line 10123 "lib/Sys/Guestfs.xs"
      r = guestfs_set_pgroup (g, pgroup);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24890 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_program); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_program)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, program");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	program = (char *)SvPV_nolen(ST(1))
;
#line 10132 "lib/Sys/Guestfs.xs"
      int r;
#line 24911 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_program(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_program(): g is not a blessed HV reference");
    }
;
#line 10134 "lib/Sys/Guestfs.xs"
      r = guestfs_set_program (g, program);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24929 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_qemu); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_qemu)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, hv");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	hv = SvOK(ST(1)) ? SvPV_nolen(ST(1)) : NULL;
#line 10143 "lib/Sys/Guestfs.xs"
      int r;
#line 24949 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_qemu(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_qemu(): g is not a blessed HV reference");
    }
;
#line 10145 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::set_qemu is deprecated; use Sys::Guestfs::set_hv instead");
      r = guestfs_set_qemu (g, hv);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 24969 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_recovery_proc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_recovery_proc)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, recoveryproc");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	recoveryproc = (int)SvIV(ST(1))
;
#line 10156 "lib/Sys/Guestfs.xs"
      int r;
#line 24990 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_recovery_proc(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_recovery_proc(): g is not a blessed HV reference");
    }
;
#line 10158 "lib/Sys/Guestfs.xs"
      r = guestfs_set_recovery_proc (g, recoveryproc);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25008 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_selinux); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_selinux)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, selinux");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	selinux = (int)SvIV(ST(1))
;
#line 10167 "lib/Sys/Guestfs.xs"
      int r;
#line 25029 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_selinux(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_selinux(): g is not a blessed HV reference");
    }
;
#line 10169 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::set_selinux is deprecated; use Sys::Guestfs::selinux_relabel instead");
      r = guestfs_set_selinux (g, selinux);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25049 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_smp); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_smp)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, smp");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	smp = (int)SvIV(ST(1))
;
#line 10180 "lib/Sys/Guestfs.xs"
      int r;
#line 25070 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_smp(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_smp(): g is not a blessed HV reference");
    }
;
#line 10182 "lib/Sys/Guestfs.xs"
      r = guestfs_set_smp (g, smp);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25088 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_tmpdir); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_tmpdir)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, tmpdir");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	tmpdir = SvOK(ST(1)) ? SvPV_nolen(ST(1)) : NULL;
#line 10191 "lib/Sys/Guestfs.xs"
      int r;
#line 25108 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_tmpdir(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_tmpdir(): g is not a blessed HV reference");
    }
;
#line 10193 "lib/Sys/Guestfs.xs"
      r = guestfs_set_tmpdir (g, tmpdir);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25126 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_trace); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_trace)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, trace");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	trace = (int)SvIV(ST(1))
;
#line 10202 "lib/Sys/Guestfs.xs"
      int r;
#line 25147 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_trace(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_trace(): g is not a blessed HV reference");
    }
;
#line 10204 "lib/Sys/Guestfs.xs"
      r = guestfs_set_trace (g, trace);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25165 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_uuid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_uuid)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, uuid");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char *	uuid = (char *)SvPV_nolen(ST(2))
;
#line 10214 "lib/Sys/Guestfs.xs"
      int r;
#line 25188 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_uuid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_uuid(): g is not a blessed HV reference");
    }
;
#line 10216 "lib/Sys/Guestfs.xs"
      r = guestfs_set_uuid (g, device, uuid);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25206 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_uuid_random); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_uuid_random)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 10225 "lib/Sys/Guestfs.xs"
      int r;
#line 25227 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_uuid_random(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_uuid_random(): g is not a blessed HV reference");
    }
;
#line 10227 "lib/Sys/Guestfs.xs"
      r = guestfs_set_uuid_random (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25245 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_set_verbose); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_set_verbose)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, verbose");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	verbose = (int)SvIV(ST(1))
;
#line 10236 "lib/Sys/Guestfs.xs"
      int r;
#line 25266 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::set_verbose(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::set_verbose(): g is not a blessed HV reference");
    }
;
#line 10238 "lib/Sys/Guestfs.xs"
      r = guestfs_set_verbose (g, verbose);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25284 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_setcon); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_setcon)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, context");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	context = (char *)SvPV_nolen(ST(1))
;
#line 10247 "lib/Sys/Guestfs.xs"
      int r;
#line 25305 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::setcon(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::setcon(): g is not a blessed HV reference");
    }
;
#line 10249 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::setcon is deprecated; use Sys::Guestfs::selinux_relabel instead");
      r = guestfs_setcon (g, context);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25325 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_setfiles); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_setfiles)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, specfile, paths, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	specfile = (char *)SvPV_nolen(ST(1))
;
	char **	paths = XS_unpack_charPtrPtr(ST(2))
;
#line 10261 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_setfiles_argv optargs_s = { .bitmask = 0 };
      struct guestfs_setfiles_argv *optargs = &optargs_s;
      size_t items_i;
#line 25351 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::setfiles(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::setfiles(): g is not a blessed HV reference");
    }
;
#line 10266 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "force")) {
          optargs_s.force = SvIV (ST (items_i+1));
          this_mask = GUESTFS_SETFILES_FORCE_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_setfiles_argv (g, specfile, paths, optargs);
      free (paths);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25388 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_setxattr); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_setxattr)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "g, xattr, val, vallen, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	xattr = (char *)SvPV_nolen(ST(1))
;
	char *	val = (char *)SvPV_nolen(ST(2))
;
	int	vallen = (int)SvIV(ST(3))
;
	char *	path = (char *)SvPV_nolen(ST(4))
;
#line 10297 "lib/Sys/Guestfs.xs"
      int r;
#line 25415 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::setxattr(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::setxattr(): g is not a blessed HV reference");
    }
;
#line 10299 "lib/Sys/Guestfs.xs"
      r = guestfs_setxattr (g, xattr, val, vallen, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25433 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_sfdisk); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_sfdisk)
{
    dVAR; dXSARGS;
    if (items != 6)
       croak_xs_usage(cv,  "g, device, cyls, heads, sectors, lines");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	cyls = (int)SvIV(ST(2))
;
	int	heads = (int)SvIV(ST(3))
;
	int	sectors = (int)SvIV(ST(4))
;
	char **	lines = XS_unpack_charPtrPtr(ST(5))
;
#line 10312 "lib/Sys/Guestfs.xs"
      int r;
#line 25462 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::sfdisk(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::sfdisk(): g is not a blessed HV reference");
    }
;
#line 10314 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::sfdisk is deprecated; use Sys::Guestfs::part_add instead");
      r = guestfs_sfdisk (g, device, cyls, heads, sectors, lines);
      free (lines);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25483 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_sfdiskM); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_sfdiskM)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, device, lines");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	char **	lines = XS_unpack_charPtrPtr(ST(2))
;
#line 10327 "lib/Sys/Guestfs.xs"
      int r;
#line 25506 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::sfdiskM(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::sfdiskM(): g is not a blessed HV reference");
    }
;
#line 10329 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::sfdiskM is deprecated; use Sys::Guestfs::part_add instead");
      r = guestfs_sfdiskM (g, device, lines);
      free (lines);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25527 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_sfdisk_N); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_sfdisk_N)
{
    dVAR; dXSARGS;
    if (items != 7)
       croak_xs_usage(cv,  "g, device, partnum, cyls, heads, sectors, line");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
	int	partnum = (int)SvIV(ST(2))
;
	int	cyls = (int)SvIV(ST(3))
;
	int	heads = (int)SvIV(ST(4))
;
	int	sectors = (int)SvIV(ST(5))
;
	char *	line = (char *)SvPV_nolen(ST(6))
;
#line 10346 "lib/Sys/Guestfs.xs"
      int r;
#line 25558 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::sfdisk_N(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::sfdisk_N(): g is not a blessed HV reference");
    }
;
#line 10348 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::sfdisk_N is deprecated; use Sys::Guestfs::part_add instead");
      r = guestfs_sfdisk_N (g, device, partnum, cyls, heads, sectors, line);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25578 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_sfdisk_disk_geometry); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_sfdisk_disk_geometry)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 10359 "lib/Sys/Guestfs.xs"
      char *r;
#line 25597 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::sfdisk_disk_geometry(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::sfdisk_disk_geometry(): g is not a blessed HV reference");
    }
;
#line 10361 "lib/Sys/Guestfs.xs"
      r = guestfs_sfdisk_disk_geometry (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 25618 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_sfdisk_kernel_geometry); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_sfdisk_kernel_geometry)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 10374 "lib/Sys/Guestfs.xs"
      char *r;
#line 25638 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::sfdisk_kernel_geometry(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::sfdisk_kernel_geometry(): g is not a blessed HV reference");
    }
;
#line 10376 "lib/Sys/Guestfs.xs"
      r = guestfs_sfdisk_kernel_geometry (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 25659 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_sfdisk_l); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_sfdisk_l)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 10389 "lib/Sys/Guestfs.xs"
      char *r;
#line 25679 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::sfdisk_l(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::sfdisk_l(): g is not a blessed HV reference");
    }
;
#line 10391 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::sfdisk_l is deprecated; use Sys::Guestfs::part_list instead");
      r = guestfs_sfdisk_l (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 25702 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_sh); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_sh)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, command");
    {
	guestfs_h *	g;
	char *	command = (char *)SvPV_nolen(ST(1))
;
#line 10406 "lib/Sys/Guestfs.xs"
      char *r;
#line 25722 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::sh(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::sh(): g is not a blessed HV reference");
    }
;
#line 10408 "lib/Sys/Guestfs.xs"
      r = guestfs_sh (g, command);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 25743 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_sh_lines); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_sh_lines)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, command");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	command = (char *)SvPV_nolen(ST(1))
;
#line 10421 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 25766 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::sh_lines(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::sh_lines(): g is not a blessed HV reference");
    }
;
#line 10424 "lib/Sys/Guestfs.xs"
      r = guestfs_sh_lines (g, command);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 25791 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_sh_out); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_sh_out)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, command, output");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	command = (char *)SvPV_nolen(ST(1))
;
	char *	output = (char *)SvPV_nolen(ST(2))
;
#line 10441 "lib/Sys/Guestfs.xs"
      int r;
#line 25814 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::sh_out(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::sh_out(): g is not a blessed HV reference");
    }
;
#line 10443 "lib/Sys/Guestfs.xs"
      r = guestfs_sh_out (g, command, output);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25832 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_shutdown); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_shutdown)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 10451 "lib/Sys/Guestfs.xs"
      int r;
#line 25851 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::shutdown(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::shutdown(): g is not a blessed HV reference");
    }
;
#line 10453 "lib/Sys/Guestfs.xs"
      r = guestfs_shutdown (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25869 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_sleep); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_sleep)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, secs");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	secs = (int)SvIV(ST(1))
;
#line 10462 "lib/Sys/Guestfs.xs"
      int r;
#line 25890 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::sleep(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::sleep(): g is not a blessed HV reference");
    }
;
#line 10464 "lib/Sys/Guestfs.xs"
      r = guestfs_sleep (g, secs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 25908 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_stat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_stat)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 10473 "lib/Sys/Guestfs.xs"
      struct guestfs_stat *r;
#line 25929 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::stat(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::stat(): g is not a blessed HV reference");
    }
;
#line 10475 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::stat is deprecated; use Sys::Guestfs::statns instead");
      r = guestfs_stat (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 13);
      PUSHs (sv_2mortal (newSVpv ("dev", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->dev)));
      PUSHs (sv_2mortal (newSVpv ("ino", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->ino)));
      PUSHs (sv_2mortal (newSVpv ("mode", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->mode)));
      PUSHs (sv_2mortal (newSVpv ("nlink", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->nlink)));
      PUSHs (sv_2mortal (newSVpv ("uid", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->uid)));
      PUSHs (sv_2mortal (newSVpv ("gid", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->gid)));
      PUSHs (sv_2mortal (newSVpv ("rdev", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->rdev)));
      PUSHs (sv_2mortal (newSVpv ("size", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->size)));
      PUSHs (sv_2mortal (newSVpv ("blksize", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->blksize)));
      PUSHs (sv_2mortal (newSVpv ("blocks", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->blocks)));
      PUSHs (sv_2mortal (newSVpv ("atime", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->atime)));
      PUSHs (sv_2mortal (newSVpv ("mtime", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->mtime)));
      PUSHs (sv_2mortal (newSVpv ("ctime", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->ctime)));
      guestfs_free_stat (r);
#line 25977 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_statns); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_statns)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 10514 "lib/Sys/Guestfs.xs"
      struct guestfs_statns *r;
#line 25998 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::statns(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::statns(): g is not a blessed HV reference");
    }
;
#line 10516 "lib/Sys/Guestfs.xs"
      r = guestfs_statns (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 22);
      PUSHs (sv_2mortal (newSVpv ("st_dev", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_dev)));
      PUSHs (sv_2mortal (newSVpv ("st_ino", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_ino)));
      PUSHs (sv_2mortal (newSVpv ("st_mode", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_mode)));
      PUSHs (sv_2mortal (newSVpv ("st_nlink", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_nlink)));
      PUSHs (sv_2mortal (newSVpv ("st_uid", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_uid)));
      PUSHs (sv_2mortal (newSVpv ("st_gid", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_gid)));
      PUSHs (sv_2mortal (newSVpv ("st_rdev", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_rdev)));
      PUSHs (sv_2mortal (newSVpv ("st_size", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_size)));
      PUSHs (sv_2mortal (newSVpv ("st_blksize", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_blksize)));
      PUSHs (sv_2mortal (newSVpv ("st_blocks", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_blocks)));
      PUSHs (sv_2mortal (newSVpv ("st_atime_sec", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_atime_sec)));
      PUSHs (sv_2mortal (newSVpv ("st_atime_nsec", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_atime_nsec)));
      PUSHs (sv_2mortal (newSVpv ("st_mtime_sec", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_mtime_sec)));
      PUSHs (sv_2mortal (newSVpv ("st_mtime_nsec", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_mtime_nsec)));
      PUSHs (sv_2mortal (newSVpv ("st_ctime_sec", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_ctime_sec)));
      PUSHs (sv_2mortal (newSVpv ("st_ctime_nsec", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_ctime_nsec)));
      PUSHs (sv_2mortal (newSVpv ("st_spare1", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_spare1)));
      PUSHs (sv_2mortal (newSVpv ("st_spare2", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_spare2)));
      PUSHs (sv_2mortal (newSVpv ("st_spare3", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_spare3)));
      PUSHs (sv_2mortal (newSVpv ("st_spare4", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_spare4)));
      PUSHs (sv_2mortal (newSVpv ("st_spare5", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_spare5)));
      PUSHs (sv_2mortal (newSVpv ("st_spare6", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->st_spare6)));
      guestfs_free_statns (r);
#line 26062 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_statvfs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_statvfs)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 10571 "lib/Sys/Guestfs.xs"
      struct guestfs_statvfs *r;
#line 26083 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::statvfs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::statvfs(): g is not a blessed HV reference");
    }
;
#line 10573 "lib/Sys/Guestfs.xs"
      r = guestfs_statvfs (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 11);
      PUSHs (sv_2mortal (newSVpv ("bsize", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->bsize)));
      PUSHs (sv_2mortal (newSVpv ("frsize", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->frsize)));
      PUSHs (sv_2mortal (newSVpv ("blocks", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->blocks)));
      PUSHs (sv_2mortal (newSVpv ("bfree", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->bfree)));
      PUSHs (sv_2mortal (newSVpv ("bavail", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->bavail)));
      PUSHs (sv_2mortal (newSVpv ("files", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->files)));
      PUSHs (sv_2mortal (newSVpv ("ffree", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->ffree)));
      PUSHs (sv_2mortal (newSVpv ("favail", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->favail)));
      PUSHs (sv_2mortal (newSVpv ("fsid", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->fsid)));
      PUSHs (sv_2mortal (newSVpv ("flag", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->flag)));
      PUSHs (sv_2mortal (newSVpv ("namemax", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->namemax)));
      guestfs_free_statvfs (r);
#line 26125 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_strings); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_strings)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 10606 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 26147 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::strings(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::strings(): g is not a blessed HV reference");
    }
;
#line 10609 "lib/Sys/Guestfs.xs"
      r = guestfs_strings (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 26172 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_strings_e); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_strings_e)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, encoding, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	encoding = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 10626 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 26196 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::strings_e(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::strings_e(): g is not a blessed HV reference");
    }
;
#line 10629 "lib/Sys/Guestfs.xs"
      r = guestfs_strings_e (g, encoding, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 26221 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_swapoff_device); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_swapoff_device)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 10645 "lib/Sys/Guestfs.xs"
      int r;
#line 26242 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::swapoff_device(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::swapoff_device(): g is not a blessed HV reference");
    }
;
#line 10647 "lib/Sys/Guestfs.xs"
      r = guestfs_swapoff_device (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 26260 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_swapoff_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_swapoff_file)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, file");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	file = (char *)SvPV_nolen(ST(1))
;
#line 10656 "lib/Sys/Guestfs.xs"
      int r;
#line 26281 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::swapoff_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::swapoff_file(): g is not a blessed HV reference");
    }
;
#line 10658 "lib/Sys/Guestfs.xs"
      r = guestfs_swapoff_file (g, file);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 26299 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_swapoff_label); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_swapoff_label)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, label");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	label = (char *)SvPV_nolen(ST(1))
;
#line 10667 "lib/Sys/Guestfs.xs"
      int r;
#line 26320 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::swapoff_label(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::swapoff_label(): g is not a blessed HV reference");
    }
;
#line 10669 "lib/Sys/Guestfs.xs"
      r = guestfs_swapoff_label (g, label);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 26338 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_swapoff_uuid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_swapoff_uuid)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, uuid");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	uuid = (char *)SvPV_nolen(ST(1))
;
#line 10678 "lib/Sys/Guestfs.xs"
      int r;
#line 26359 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::swapoff_uuid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::swapoff_uuid(): g is not a blessed HV reference");
    }
;
#line 10680 "lib/Sys/Guestfs.xs"
      r = guestfs_swapoff_uuid (g, uuid);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 26377 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_swapon_device); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_swapon_device)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 10689 "lib/Sys/Guestfs.xs"
      int r;
#line 26398 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::swapon_device(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::swapon_device(): g is not a blessed HV reference");
    }
;
#line 10691 "lib/Sys/Guestfs.xs"
      r = guestfs_swapon_device (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 26416 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_swapon_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_swapon_file)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, file");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	file = (char *)SvPV_nolen(ST(1))
;
#line 10700 "lib/Sys/Guestfs.xs"
      int r;
#line 26437 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::swapon_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::swapon_file(): g is not a blessed HV reference");
    }
;
#line 10702 "lib/Sys/Guestfs.xs"
      r = guestfs_swapon_file (g, file);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 26455 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_swapon_label); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_swapon_label)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, label");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	label = (char *)SvPV_nolen(ST(1))
;
#line 10711 "lib/Sys/Guestfs.xs"
      int r;
#line 26476 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::swapon_label(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::swapon_label(): g is not a blessed HV reference");
    }
;
#line 10713 "lib/Sys/Guestfs.xs"
      r = guestfs_swapon_label (g, label);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 26494 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_swapon_uuid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_swapon_uuid)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, uuid");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	uuid = (char *)SvPV_nolen(ST(1))
;
#line 10722 "lib/Sys/Guestfs.xs"
      int r;
#line 26515 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::swapon_uuid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::swapon_uuid(): g is not a blessed HV reference");
    }
;
#line 10724 "lib/Sys/Guestfs.xs"
      r = guestfs_swapon_uuid (g, uuid);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 26533 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_sync); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_sync)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 10732 "lib/Sys/Guestfs.xs"
      int r;
#line 26552 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::sync(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::sync(): g is not a blessed HV reference");
    }
;
#line 10734 "lib/Sys/Guestfs.xs"
      r = guestfs_sync (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 26570 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_syslinux); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_syslinux)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, device, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 10743 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_syslinux_argv optargs_s = { .bitmask = 0 };
      struct guestfs_syslinux_argv *optargs = &optargs_s;
      size_t items_i;
#line 26594 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::syslinux(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::syslinux(): g is not a blessed HV reference");
    }
;
#line 10748 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "directory")) {
          optargs_s.directory = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_SYSLINUX_DIRECTORY_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_syslinux_argv (g, device, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 26630 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_tail); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_tail)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 10775 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 26652 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::tail(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::tail(): g is not a blessed HV reference");
    }
;
#line 10778 "lib/Sys/Guestfs.xs"
      r = guestfs_tail (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 26677 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_tail_n); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_tail_n)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, nrlines, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	nrlines = (int)SvIV(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 10795 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 26701 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::tail_n(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::tail_n(): g is not a blessed HV reference");
    }
;
#line 10798 "lib/Sys/Guestfs.xs"
      r = guestfs_tail_n (g, nrlines, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 26726 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_tar_in); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_tar_in)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, tarfile, directory, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	tarfile = (char *)SvPV_nolen(ST(1))
;
	char *	directory = (char *)SvPV_nolen(ST(2))
;
#line 10815 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_tar_in_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_tar_in_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 26752 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::tar_in(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::tar_in(): g is not a blessed HV reference");
    }
;
#line 10820 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "compress")) {
          optargs_s.compress = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_TAR_IN_OPTS_COMPRESS_BITMASK;
        }
        else if (STREQ (this_arg, "xattrs")) {
          optargs_s.xattrs = SvIV (ST (items_i+1));
          this_mask = GUESTFS_TAR_IN_OPTS_XATTRS_BITMASK;
        }
        else if (STREQ (this_arg, "selinux")) {
          optargs_s.selinux = SvIV (ST (items_i+1));
          this_mask = GUESTFS_TAR_IN_OPTS_SELINUX_BITMASK;
        }
        else if (STREQ (this_arg, "acls")) {
          optargs_s.acls = SvIV (ST (items_i+1));
          this_mask = GUESTFS_TAR_IN_OPTS_ACLS_BITMASK;
        }
        else if (STREQ (this_arg, "keepdirlink")) {
          optargs_s.keepdirlink = SvIV (ST (items_i+1));
          this_mask = GUESTFS_TAR_IN_OPTS_KEEPDIRLINK_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_tar_in_opts_argv (g, tarfile, directory, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 26804 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_tar_out); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_tar_out)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "g, directory, tarfile, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	directory = (char *)SvPV_nolen(ST(1))
;
	char *	tarfile = (char *)SvPV_nolen(ST(2))
;
#line 10864 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_tar_out_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_tar_out_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 26830 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::tar_out(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::tar_out(): g is not a blessed HV reference");
    }
;
#line 10869 "lib/Sys/Guestfs.xs"
      if (((items - 3) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 3; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "compress")) {
          optargs_s.compress = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_TAR_OUT_OPTS_COMPRESS_BITMASK;
        }
        else if (STREQ (this_arg, "numericowner")) {
          optargs_s.numericowner = SvIV (ST (items_i+1));
          this_mask = GUESTFS_TAR_OUT_OPTS_NUMERICOWNER_BITMASK;
        }
        else if (STREQ (this_arg, "excludes")) {
          size_t i, len;
          char **r;
          SV *arg;
          AV *av;
          SV **svp;

          arg = ST (items_i+1);
          if (!SvROK (arg) || SvTYPE (SvRV (arg)) != SVt_PVAV)
            croak ("array reference expected for '%s' argument", "excludes");
          av = (AV *) SvRV (ST (items_i+1));

          /* Note av_len returns index of final element. */
          len = av_len (av) + 1;

          r = malloc ((len+1) * sizeof (char *));
          if (r == NULL) croak ("malloc: %m");
          for (i = 0; i < len; ++i) {
            svp = av_fetch (av, i, 0);
            r[i] = SvPV_nolen (*svp);
          }
          r[i] = NULL;
          optargs_s.excludes = r;
          this_mask = GUESTFS_TAR_OUT_OPTS_EXCLUDES_BITMASK;
        }
        else if (STREQ (this_arg, "xattrs")) {
          optargs_s.xattrs = SvIV (ST (items_i+1));
          this_mask = GUESTFS_TAR_OUT_OPTS_XATTRS_BITMASK;
        }
        else if (STREQ (this_arg, "selinux")) {
          optargs_s.selinux = SvIV (ST (items_i+1));
          this_mask = GUESTFS_TAR_OUT_OPTS_SELINUX_BITMASK;
        }
        else if (STREQ (this_arg, "acls")) {
          optargs_s.acls = SvIV (ST (items_i+1));
          this_mask = GUESTFS_TAR_OUT_OPTS_ACLS_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_tar_out_opts_argv (g, directory, tarfile, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 26907 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_tgz_in); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_tgz_in)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, tarball, directory");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	tarball = (char *)SvPV_nolen(ST(1))
;
	char *	directory = (char *)SvPV_nolen(ST(2))
;
#line 10938 "lib/Sys/Guestfs.xs"
      int r;
#line 26930 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::tgz_in(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::tgz_in(): g is not a blessed HV reference");
    }
;
#line 10940 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::tgz_in is deprecated; use Sys::Guestfs::tar_in instead");
      r = guestfs_tgz_in (g, tarball, directory);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 26950 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_tgz_out); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_tgz_out)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, directory, tarball");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	directory = (char *)SvPV_nolen(ST(1))
;
	char *	tarball = (char *)SvPV_nolen(ST(2))
;
#line 10952 "lib/Sys/Guestfs.xs"
      int r;
#line 26973 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::tgz_out(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::tgz_out(): g is not a blessed HV reference");
    }
;
#line 10954 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::tgz_out is deprecated; use Sys::Guestfs::tar_out instead");
      r = guestfs_tgz_out (g, directory, tarball);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 26993 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_touch); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_touch)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 10965 "lib/Sys/Guestfs.xs"
      int r;
#line 27014 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::touch(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::touch(): g is not a blessed HV reference");
    }
;
#line 10967 "lib/Sys/Guestfs.xs"
      r = guestfs_touch (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 27032 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_truncate); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_truncate)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 10976 "lib/Sys/Guestfs.xs"
      int r;
#line 27053 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::truncate(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::truncate(): g is not a blessed HV reference");
    }
;
#line 10978 "lib/Sys/Guestfs.xs"
      r = guestfs_truncate (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 27071 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_truncate_size); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_truncate_size)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, size");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	int64_t	size = my_SvIV64 (ST(2))
;
#line 10988 "lib/Sys/Guestfs.xs"
      int r;
#line 27094 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::truncate_size(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::truncate_size(): g is not a blessed HV reference");
    }
;
#line 10990 "lib/Sys/Guestfs.xs"
      r = guestfs_truncate_size (g, path, size);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 27112 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_tune2fs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_tune2fs)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, device, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 10999 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_tune2fs_argv optargs_s = { .bitmask = 0 };
      struct guestfs_tune2fs_argv *optargs = &optargs_s;
      size_t items_i;
#line 27136 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::tune2fs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::tune2fs(): g is not a blessed HV reference");
    }
;
#line 11004 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "force")) {
          optargs_s.force = SvIV (ST (items_i+1));
          this_mask = GUESTFS_TUNE2FS_FORCE_BITMASK;
        }
        else if (STREQ (this_arg, "maxmountcount")) {
          optargs_s.maxmountcount = SvIV (ST (items_i+1));
          this_mask = GUESTFS_TUNE2FS_MAXMOUNTCOUNT_BITMASK;
        }
        else if (STREQ (this_arg, "mountcount")) {
          optargs_s.mountcount = SvIV (ST (items_i+1));
          this_mask = GUESTFS_TUNE2FS_MOUNTCOUNT_BITMASK;
        }
        else if (STREQ (this_arg, "errorbehavior")) {
          optargs_s.errorbehavior = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_TUNE2FS_ERRORBEHAVIOR_BITMASK;
        }
        else if (STREQ (this_arg, "group")) {
          optargs_s.group = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_TUNE2FS_GROUP_BITMASK;
        }
        else if (STREQ (this_arg, "intervalbetweenchecks")) {
          optargs_s.intervalbetweenchecks = SvIV (ST (items_i+1));
          this_mask = GUESTFS_TUNE2FS_INTERVALBETWEENCHECKS_BITMASK;
        }
        else if (STREQ (this_arg, "reservedblockspercentage")) {
          optargs_s.reservedblockspercentage = SvIV (ST (items_i+1));
          this_mask = GUESTFS_TUNE2FS_RESERVEDBLOCKSPERCENTAGE_BITMASK;
        }
        else if (STREQ (this_arg, "lastmounteddirectory")) {
          optargs_s.lastmounteddirectory = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_TUNE2FS_LASTMOUNTEDDIRECTORY_BITMASK;
        }
        else if (STREQ (this_arg, "reservedblockscount")) {
          optargs_s.reservedblockscount = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_TUNE2FS_RESERVEDBLOCKSCOUNT_BITMASK;
        }
        else if (STREQ (this_arg, "user")) {
          optargs_s.user = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_TUNE2FS_USER_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_tune2fs_argv (g, device, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 27208 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_tune2fs_l); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_tune2fs_l)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 11067 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 27230 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::tune2fs_l(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::tune2fs_l(): g is not a blessed HV reference");
    }
;
#line 11070 "lib/Sys/Guestfs.xs"
      r = guestfs_tune2fs_l (g, device);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 27255 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_txz_in); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_txz_in)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, tarball, directory");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	tarball = (char *)SvPV_nolen(ST(1))
;
	char *	directory = (char *)SvPV_nolen(ST(2))
;
#line 11087 "lib/Sys/Guestfs.xs"
      int r;
#line 27278 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::txz_in(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::txz_in(): g is not a blessed HV reference");
    }
;
#line 11089 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::txz_in is deprecated; use Sys::Guestfs::tar_in instead");
      r = guestfs_txz_in (g, tarball, directory);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 27298 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_txz_out); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_txz_out)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, directory, tarball");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	directory = (char *)SvPV_nolen(ST(1))
;
	char *	tarball = (char *)SvPV_nolen(ST(2))
;
#line 11101 "lib/Sys/Guestfs.xs"
      int r;
#line 27321 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::txz_out(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::txz_out(): g is not a blessed HV reference");
    }
;
#line 11103 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::txz_out is deprecated; use Sys::Guestfs::tar_out instead");
      r = guestfs_txz_out (g, directory, tarball);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 27341 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_umask); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_umask)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, mask");
    {
	guestfs_h *	g;
	int	mask = (int)SvIV(ST(1))
;
#line 11114 "lib/Sys/Guestfs.xs"
      int r;
#line 27360 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::umask(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::umask(): g is not a blessed HV reference");
    }
;
#line 11116 "lib/Sys/Guestfs.xs"
      r = guestfs_umask (g, mask);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 27380 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_umount); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_umount)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, pathordevice, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	pathordevice = (char *)SvPV_nolen(ST(1))
;
#line 11128 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_umount_opts_argv optargs_s = { .bitmask = 0 };
      struct guestfs_umount_opts_argv *optargs = &optargs_s;
      size_t items_i;
#line 27405 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::umount(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::umount(): g is not a blessed HV reference");
    }
;
#line 11133 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "force")) {
          optargs_s.force = SvIV (ST (items_i+1));
          this_mask = GUESTFS_UMOUNT_OPTS_FORCE_BITMASK;
        }
        else if (STREQ (this_arg, "lazyunmount")) {
          optargs_s.lazyunmount = SvIV (ST (items_i+1));
          this_mask = GUESTFS_UMOUNT_OPTS_LAZYUNMOUNT_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_umount_opts_argv (g, pathordevice, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 27445 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_umount_all); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_umount_all)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 11163 "lib/Sys/Guestfs.xs"
      int r;
#line 27464 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::umount_all(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::umount_all(): g is not a blessed HV reference");
    }
;
#line 11165 "lib/Sys/Guestfs.xs"
      r = guestfs_umount_all (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 27482 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_umount_local); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_umount_local)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "g, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 11173 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_umount_local_argv optargs_s = { .bitmask = 0 };
      struct guestfs_umount_local_argv *optargs = &optargs_s;
      size_t items_i;
#line 27504 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::umount_local(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::umount_local(): g is not a blessed HV reference");
    }
;
#line 11178 "lib/Sys/Guestfs.xs"
      if (((items - 1) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 1; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "retry")) {
          optargs_s.retry = SvIV (ST (items_i+1));
          this_mask = GUESTFS_UMOUNT_LOCAL_RETRY_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_umount_local_argv (g, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 27540 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_upload); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_upload)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, filename, remotefilename");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
	char *	remotefilename = (char *)SvPV_nolen(ST(2))
;
#line 11206 "lib/Sys/Guestfs.xs"
      int r;
#line 27563 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::upload(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::upload(): g is not a blessed HV reference");
    }
;
#line 11208 "lib/Sys/Guestfs.xs"
      r = guestfs_upload (g, filename, remotefilename);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 27581 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_upload_offset); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_upload_offset)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, filename, remotefilename, offset");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
	char *	remotefilename = (char *)SvPV_nolen(ST(2))
;
	int64_t	offset = my_SvIV64 (ST(3))
;
#line 11219 "lib/Sys/Guestfs.xs"
      int r;
#line 27606 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::upload_offset(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::upload_offset(): g is not a blessed HV reference");
    }
;
#line 11221 "lib/Sys/Guestfs.xs"
      r = guestfs_upload_offset (g, filename, remotefilename, offset);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 27624 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_user_cancel); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_user_cancel)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 11229 "lib/Sys/Guestfs.xs"
      int r;
#line 27643 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::user_cancel(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::user_cancel(): g is not a blessed HV reference");
    }
;
#line 11231 "lib/Sys/Guestfs.xs"
      r = guestfs_user_cancel (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 27661 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_utimens); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_utimens)
{
    dVAR; dXSARGS;
    if (items != 6)
       croak_xs_usage(cv,  "g, path, atsecs, atnsecs, mtsecs, mtnsecs");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	int64_t	atsecs = my_SvIV64 (ST(2))
;
	int64_t	atnsecs = my_SvIV64 (ST(3))
;
	int64_t	mtsecs = my_SvIV64 (ST(4))
;
	int64_t	mtnsecs = my_SvIV64 (ST(5))
;
#line 11244 "lib/Sys/Guestfs.xs"
      int r;
#line 27690 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::utimens(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::utimens(): g is not a blessed HV reference");
    }
;
#line 11246 "lib/Sys/Guestfs.xs"
      r = guestfs_utimens (g, path, atsecs, atnsecs, mtsecs, mtnsecs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 27708 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_utsname); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_utsname)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 11254 "lib/Sys/Guestfs.xs"
      struct guestfs_utsname *r;
#line 27727 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::utsname(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::utsname(): g is not a blessed HV reference");
    }
;
#line 11256 "lib/Sys/Guestfs.xs"
      r = guestfs_utsname (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 4);
      PUSHs (sv_2mortal (newSVpv ("uts_sysname", 0)));
      PUSHs (sv_2mortal (newSVpv (r->uts_sysname, 0)));
      PUSHs (sv_2mortal (newSVpv ("uts_release", 0)));
      PUSHs (sv_2mortal (newSVpv (r->uts_release, 0)));
      PUSHs (sv_2mortal (newSVpv ("uts_version", 0)));
      PUSHs (sv_2mortal (newSVpv (r->uts_version, 0)));
      PUSHs (sv_2mortal (newSVpv ("uts_machine", 0)));
      PUSHs (sv_2mortal (newSVpv (r->uts_machine, 0)));
      guestfs_free_utsname (r);
#line 27755 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_version); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_version)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 11274 "lib/Sys/Guestfs.xs"
      struct guestfs_version *r;
#line 27774 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::version(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::version(): g is not a blessed HV reference");
    }
;
#line 11276 "lib/Sys/Guestfs.xs"
      r = guestfs_version (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 4);
      PUSHs (sv_2mortal (newSVpv ("major", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->major)));
      PUSHs (sv_2mortal (newSVpv ("minor", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->minor)));
      PUSHs (sv_2mortal (newSVpv ("release", 0)));
      PUSHs (sv_2mortal (my_newSVll (r->release)));
      PUSHs (sv_2mortal (newSVpv ("extra", 0)));
      PUSHs (sv_2mortal (newSVpv (r->extra, 0)));
      guestfs_free_version (r);
#line 27802 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_vfs_label); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vfs_label)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, mountable");
    {
	guestfs_h *	g;
	char *	mountable = (char *)SvPV_nolen(ST(1))
;
#line 11295 "lib/Sys/Guestfs.xs"
      char *r;
#line 27821 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vfs_label(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vfs_label(): g is not a blessed HV reference");
    }
;
#line 11297 "lib/Sys/Guestfs.xs"
      r = guestfs_vfs_label (g, mountable);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 27842 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_vfs_minimum_size); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vfs_minimum_size)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, mountable");
    {
	guestfs_h *	g;
	char *	mountable = (char *)SvPV_nolen(ST(1))
;
#line 11310 "lib/Sys/Guestfs.xs"
      int64_t r;
#line 27862 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vfs_minimum_size(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vfs_minimum_size(): g is not a blessed HV reference");
    }
;
#line 11312 "lib/Sys/Guestfs.xs"
      r = guestfs_vfs_minimum_size (g, mountable);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = my_newSVll (r);
#line 27882 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_vfs_type); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vfs_type)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, mountable");
    {
	guestfs_h *	g;
	char *	mountable = (char *)SvPV_nolen(ST(1))
;
#line 11324 "lib/Sys/Guestfs.xs"
      char *r;
#line 27902 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vfs_type(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vfs_type(): g is not a blessed HV reference");
    }
;
#line 11326 "lib/Sys/Guestfs.xs"
      r = guestfs_vfs_type (g, mountable);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 27923 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_vfs_uuid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vfs_uuid)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, mountable");
    {
	guestfs_h *	g;
	char *	mountable = (char *)SvPV_nolen(ST(1))
;
#line 11339 "lib/Sys/Guestfs.xs"
      char *r;
#line 27943 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vfs_uuid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vfs_uuid(): g is not a blessed HV reference");
    }
;
#line 11341 "lib/Sys/Guestfs.xs"
      r = guestfs_vfs_uuid (g, mountable);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 27964 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_vg_activate); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vg_activate)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, activate, volgroups");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	activate = (int)SvIV(ST(1))
;
	char **	volgroups = XS_unpack_charPtrPtr(ST(2))
;
#line 11355 "lib/Sys/Guestfs.xs"
      int r;
#line 27988 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vg_activate(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vg_activate(): g is not a blessed HV reference");
    }
;
#line 11357 "lib/Sys/Guestfs.xs"
      r = guestfs_vg_activate (g, activate, volgroups);
      free (volgroups);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 28007 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_vg_activate_all); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vg_activate_all)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, activate");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	int	activate = (int)SvIV(ST(1))
;
#line 11367 "lib/Sys/Guestfs.xs"
      int r;
#line 28028 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vg_activate_all(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vg_activate_all(): g is not a blessed HV reference");
    }
;
#line 11369 "lib/Sys/Guestfs.xs"
      r = guestfs_vg_activate_all (g, activate);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 28046 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_vgchange_uuid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vgchange_uuid)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, vg");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	vg = (char *)SvPV_nolen(ST(1))
;
#line 11378 "lib/Sys/Guestfs.xs"
      int r;
#line 28067 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vgchange_uuid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vgchange_uuid(): g is not a blessed HV reference");
    }
;
#line 11380 "lib/Sys/Guestfs.xs"
      r = guestfs_vgchange_uuid (g, vg);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 28085 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_vgchange_uuid_all); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vgchange_uuid_all)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 11388 "lib/Sys/Guestfs.xs"
      int r;
#line 28104 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vgchange_uuid_all(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vgchange_uuid_all(): g is not a blessed HV reference");
    }
;
#line 11390 "lib/Sys/Guestfs.xs"
      r = guestfs_vgchange_uuid_all (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 28122 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_vgcreate); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vgcreate)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, volgroup, physvols");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	volgroup = (char *)SvPV_nolen(ST(1))
;
	char **	physvols = XS_unpack_charPtrPtr(ST(2))
;
#line 11400 "lib/Sys/Guestfs.xs"
      int r;
#line 28145 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vgcreate(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vgcreate(): g is not a blessed HV reference");
    }
;
#line 11402 "lib/Sys/Guestfs.xs"
      r = guestfs_vgcreate (g, volgroup, physvols);
      free (physvols);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 28164 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_vglvuuids); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vglvuuids)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, vgname");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	vgname = (char *)SvPV_nolen(ST(1))
;
#line 11412 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 28186 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vglvuuids(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vglvuuids(): g is not a blessed HV reference");
    }
;
#line 11415 "lib/Sys/Guestfs.xs"
      r = guestfs_vglvuuids (g, vgname);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 28211 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_vgmeta); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vgmeta)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, vgname");
    {
	guestfs_h *	g;
	char *	vgname = (char *)SvPV_nolen(ST(1))
;
#line 11431 "lib/Sys/Guestfs.xs"
      char *r;
      size_t size;
#line 28231 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vgmeta(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vgmeta(): g is not a blessed HV reference");
    }
;
#line 11434 "lib/Sys/Guestfs.xs"
      r = guestfs_vgmeta (g, vgname, &size);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpvn (r, size);
      free (r);
#line 28252 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_vgpvuuids); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vgpvuuids)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, vgname");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	vgname = (char *)SvPV_nolen(ST(1))
;
#line 11447 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 28275 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vgpvuuids(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vgpvuuids(): g is not a blessed HV reference");
    }
;
#line 11450 "lib/Sys/Guestfs.xs"
      r = guestfs_vgpvuuids (g, vgname);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 28300 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_vgremove); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vgremove)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, vgname");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	vgname = (char *)SvPV_nolen(ST(1))
;
#line 11466 "lib/Sys/Guestfs.xs"
      int r;
#line 28321 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vgremove(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vgremove(): g is not a blessed HV reference");
    }
;
#line 11468 "lib/Sys/Guestfs.xs"
      r = guestfs_vgremove (g, vgname);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 28339 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_vgrename); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vgrename)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, volgroup, newvolgroup");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	volgroup = (char *)SvPV_nolen(ST(1))
;
	char *	newvolgroup = (char *)SvPV_nolen(ST(2))
;
#line 11478 "lib/Sys/Guestfs.xs"
      int r;
#line 28362 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vgrename(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vgrename(): g is not a blessed HV reference");
    }
;
#line 11480 "lib/Sys/Guestfs.xs"
      r = guestfs_vgrename (g, volgroup, newvolgroup);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 28380 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_vgs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vgs)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 11488 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 28400 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vgs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vgs(): g is not a blessed HV reference");
    }
;
#line 11491 "lib/Sys/Guestfs.xs"
      r = guestfs_vgs (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 28425 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_vgs_full); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vgs_full)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 11506 "lib/Sys/Guestfs.xs"
      struct guestfs_lvm_vg_list *r;
      size_t i;
      HV *hv;
#line 28446 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vgs_full(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vgs_full(): g is not a blessed HV reference");
    }
;
#line 11510 "lib/Sys/Guestfs.xs"
      r = guestfs_vgs_full (g);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "vg_name", 7, newSVpv (r->val[i].vg_name, 0), 0);
        (void) hv_store (hv, "vg_uuid", 7, newSVpv (r->val[i].vg_uuid, 32), 0);
        (void) hv_store (hv, "vg_fmt", 6, newSVpv (r->val[i].vg_fmt, 0), 0);
        (void) hv_store (hv, "vg_attr", 7, newSVpv (r->val[i].vg_attr, 0), 0);
        (void) hv_store (hv, "vg_size", 7, my_newSVull (r->val[i].vg_size), 0);
        (void) hv_store (hv, "vg_free", 7, my_newSVull (r->val[i].vg_free), 0);
        (void) hv_store (hv, "vg_sysid", 8, newSVpv (r->val[i].vg_sysid, 0), 0);
        (void) hv_store (hv, "vg_extent_size", 14, my_newSVull (r->val[i].vg_extent_size), 0);
        (void) hv_store (hv, "vg_extent_count", 15, my_newSVll (r->val[i].vg_extent_count), 0);
        (void) hv_store (hv, "vg_free_count", 13, my_newSVll (r->val[i].vg_free_count), 0);
        (void) hv_store (hv, "max_lv", 6, my_newSVll (r->val[i].max_lv), 0);
        (void) hv_store (hv, "max_pv", 6, my_newSVll (r->val[i].max_pv), 0);
        (void) hv_store (hv, "pv_count", 8, my_newSVll (r->val[i].pv_count), 0);
        (void) hv_store (hv, "lv_count", 8, my_newSVll (r->val[i].lv_count), 0);
        (void) hv_store (hv, "snap_count", 10, my_newSVll (r->val[i].snap_count), 0);
        (void) hv_store (hv, "vg_seqno", 8, my_newSVll (r->val[i].vg_seqno), 0);
        (void) hv_store (hv, "vg_tags", 7, newSVpv (r->val[i].vg_tags, 0), 0);
        (void) hv_store (hv, "vg_mda_count", 12, my_newSVll (r->val[i].vg_mda_count), 0);
        (void) hv_store (hv, "vg_mda_free", 11, my_newSVull (r->val[i].vg_mda_free), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_lvm_vg_list (r);
#line 28489 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_vgscan); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vgscan)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 11543 "lib/Sys/Guestfs.xs"
      int r;
#line 28508 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vgscan(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vgscan(): g is not a blessed HV reference");
    }
;
#line 11545 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::vgscan is deprecated; use Sys::Guestfs::lvm_scan instead");
      r = guestfs_vgscan (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 28528 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_vguuid); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_vguuid)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, vgname");
    {
	guestfs_h *	g;
	char *	vgname = (char *)SvPV_nolen(ST(1))
;
#line 11556 "lib/Sys/Guestfs.xs"
      char *r;
#line 28547 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::vguuid(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::vguuid(): g is not a blessed HV reference");
    }
;
#line 11558 "lib/Sys/Guestfs.xs"
      r = guestfs_vguuid (g, vgname);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 28568 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_wait_ready); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_wait_ready)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 11570 "lib/Sys/Guestfs.xs"
      int r;
#line 28588 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::wait_ready(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::wait_ready(): g is not a blessed HV reference");
    }
;
#line 11572 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::wait_ready is deprecated");
      r = guestfs_wait_ready (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 28608 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_wc_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_wc_c)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 11583 "lib/Sys/Guestfs.xs"
      int r;
#line 28627 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::wc_c(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::wc_c(): g is not a blessed HV reference");
    }
;
#line 11585 "lib/Sys/Guestfs.xs"
      r = guestfs_wc_c (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 28647 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_wc_l); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_wc_l)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 11597 "lib/Sys/Guestfs.xs"
      int r;
#line 28667 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::wc_l(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::wc_l(): g is not a blessed HV reference");
    }
;
#line 11599 "lib/Sys/Guestfs.xs"
      r = guestfs_wc_l (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 28687 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_wc_w); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_wc_w)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 11611 "lib/Sys/Guestfs.xs"
      int r;
#line 28707 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::wc_w(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::wc_w(): g is not a blessed HV reference");
    }
;
#line 11613 "lib/Sys/Guestfs.xs"
      r = guestfs_wc_w (g, path);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 28727 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_wipefs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_wipefs)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 11625 "lib/Sys/Guestfs.xs"
      int r;
#line 28749 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::wipefs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::wipefs(): g is not a blessed HV reference");
    }
;
#line 11627 "lib/Sys/Guestfs.xs"
      r = guestfs_wipefs (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 28767 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_write); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_write)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, content");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	char *	content = (char *)SvPV_nolen(ST(2))
;
	size_t	content_size = SvCUR (ST(2));
#line 11638 "lib/Sys/Guestfs.xs"
      int r;
#line 28791 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::write(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::write(): g is not a blessed HV reference");
    }
;
#line 11640 "lib/Sys/Guestfs.xs"
      r = guestfs_write (g, path, content, content_size);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 28809 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_write_append); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_write_append)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, path, content");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	char *	content = (char *)SvPV_nolen(ST(2))
;
	size_t	content_size = SvCUR (ST(2));
#line 11651 "lib/Sys/Guestfs.xs"
      int r;
#line 28833 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::write_append(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::write_append(): g is not a blessed HV reference");
    }
;
#line 11653 "lib/Sys/Guestfs.xs"
      r = guestfs_write_append (g, path, content, content_size);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 28851 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_write_file); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_write_file)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "g, path, content, size");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
	char *	content = (char *)SvPV_nolen(ST(2))
;
	int	size = (int)SvIV(ST(3))
;
#line 11664 "lib/Sys/Guestfs.xs"
      int r;
#line 28876 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::write_file(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::write_file(): g is not a blessed HV reference");
    }
;
#line 11666 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::write_file is deprecated; use Sys::Guestfs::write instead");
      r = guestfs_write_file (g, path, content, size);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 28896 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_xfs_admin); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_xfs_admin)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, device, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 11677 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_xfs_admin_argv optargs_s = { .bitmask = 0 };
      struct guestfs_xfs_admin_argv *optargs = &optargs_s;
      size_t items_i;
#line 28920 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::xfs_admin(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::xfs_admin(): g is not a blessed HV reference");
    }
;
#line 11682 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "extunwritten")) {
          optargs_s.extunwritten = SvIV (ST (items_i+1));
          this_mask = GUESTFS_XFS_ADMIN_EXTUNWRITTEN_BITMASK;
        }
        else if (STREQ (this_arg, "imgfile")) {
          optargs_s.imgfile = SvIV (ST (items_i+1));
          this_mask = GUESTFS_XFS_ADMIN_IMGFILE_BITMASK;
        }
        else if (STREQ (this_arg, "v2log")) {
          optargs_s.v2log = SvIV (ST (items_i+1));
          this_mask = GUESTFS_XFS_ADMIN_V2LOG_BITMASK;
        }
        else if (STREQ (this_arg, "projid32bit")) {
          optargs_s.projid32bit = SvIV (ST (items_i+1));
          this_mask = GUESTFS_XFS_ADMIN_PROJID32BIT_BITMASK;
        }
        else if (STREQ (this_arg, "lazycounter")) {
          optargs_s.lazycounter = SvIV (ST (items_i+1));
          this_mask = GUESTFS_XFS_ADMIN_LAZYCOUNTER_BITMASK;
        }
        else if (STREQ (this_arg, "label")) {
          optargs_s.label = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_XFS_ADMIN_LABEL_BITMASK;
        }
        else if (STREQ (this_arg, "uuid")) {
          optargs_s.uuid = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_XFS_ADMIN_UUID_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_xfs_admin_argv (g, device, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 28980 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_xfs_growfs); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_xfs_growfs)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, path, ...");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 11733 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_xfs_growfs_argv optargs_s = { .bitmask = 0 };
      struct guestfs_xfs_growfs_argv *optargs = &optargs_s;
      size_t items_i;
#line 29004 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::xfs_growfs(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::xfs_growfs(): g is not a blessed HV reference");
    }
;
#line 11738 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "datasec")) {
          optargs_s.datasec = SvIV (ST (items_i+1));
          this_mask = GUESTFS_XFS_GROWFS_DATASEC_BITMASK;
        }
        else if (STREQ (this_arg, "logsec")) {
          optargs_s.logsec = SvIV (ST (items_i+1));
          this_mask = GUESTFS_XFS_GROWFS_LOGSEC_BITMASK;
        }
        else if (STREQ (this_arg, "rtsec")) {
          optargs_s.rtsec = SvIV (ST (items_i+1));
          this_mask = GUESTFS_XFS_GROWFS_RTSEC_BITMASK;
        }
        else if (STREQ (this_arg, "datasize")) {
          optargs_s.datasize = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_XFS_GROWFS_DATASIZE_BITMASK;
        }
        else if (STREQ (this_arg, "logsize")) {
          optargs_s.logsize = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_XFS_GROWFS_LOGSIZE_BITMASK;
        }
        else if (STREQ (this_arg, "rtsize")) {
          optargs_s.rtsize = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_XFS_GROWFS_RTSIZE_BITMASK;
        }
        else if (STREQ (this_arg, "rtextsize")) {
          optargs_s.rtextsize = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_XFS_GROWFS_RTEXTSIZE_BITMASK;
        }
        else if (STREQ (this_arg, "maxpct")) {
          optargs_s.maxpct = SvIV (ST (items_i+1));
          this_mask = GUESTFS_XFS_GROWFS_MAXPCT_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_xfs_growfs_argv (g, path, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 29068 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_xfs_info); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_xfs_info)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, pathordevice");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	pathordevice = (char *)SvPV_nolen(ST(1))
;
#line 11793 "lib/Sys/Guestfs.xs"
      struct guestfs_xfsinfo *r;
#line 29089 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::xfs_info(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::xfs_info(): g is not a blessed HV reference");
    }
;
#line 11795 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::xfs_info is deprecated; use Sys::Guestfs::xfs_info2 instead");
      r = guestfs_xfs_info (g, pathordevice);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, 2 * 25);
      PUSHs (sv_2mortal (newSVpv ("xfs_mntpoint", 0)));
      PUSHs (sv_2mortal (newSVpv (r->xfs_mntpoint, 0)));
      PUSHs (sv_2mortal (newSVpv ("xfs_inodesize", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_inodesize)));
      PUSHs (sv_2mortal (newSVpv ("xfs_agcount", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_agcount)));
      PUSHs (sv_2mortal (newSVpv ("xfs_agsize", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_agsize)));
      PUSHs (sv_2mortal (newSVpv ("xfs_sectsize", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_sectsize)));
      PUSHs (sv_2mortal (newSVpv ("xfs_attr", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_attr)));
      PUSHs (sv_2mortal (newSVpv ("xfs_blocksize", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_blocksize)));
      PUSHs (sv_2mortal (newSVpv ("xfs_datablocks", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->xfs_datablocks)));
      PUSHs (sv_2mortal (newSVpv ("xfs_imaxpct", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_imaxpct)));
      PUSHs (sv_2mortal (newSVpv ("xfs_sunit", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_sunit)));
      PUSHs (sv_2mortal (newSVpv ("xfs_swidth", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_swidth)));
      PUSHs (sv_2mortal (newSVpv ("xfs_dirversion", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_dirversion)));
      PUSHs (sv_2mortal (newSVpv ("xfs_dirblocksize", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_dirblocksize)));
      PUSHs (sv_2mortal (newSVpv ("xfs_cimode", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_cimode)));
      PUSHs (sv_2mortal (newSVpv ("xfs_logname", 0)));
      PUSHs (sv_2mortal (newSVpv (r->xfs_logname, 0)));
      PUSHs (sv_2mortal (newSVpv ("xfs_logblocksize", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_logblocksize)));
      PUSHs (sv_2mortal (newSVpv ("xfs_logblocks", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_logblocks)));
      PUSHs (sv_2mortal (newSVpv ("xfs_logversion", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_logversion)));
      PUSHs (sv_2mortal (newSVpv ("xfs_logsectsize", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_logsectsize)));
      PUSHs (sv_2mortal (newSVpv ("xfs_logsunit", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_logsunit)));
      PUSHs (sv_2mortal (newSVpv ("xfs_lazycount", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_lazycount)));
      PUSHs (sv_2mortal (newSVpv ("xfs_rtname", 0)));
      PUSHs (sv_2mortal (newSVpv (r->xfs_rtname, 0)));
      PUSHs (sv_2mortal (newSVpv ("xfs_rtextsize", 0)));
      PUSHs (sv_2mortal (newSVnv (r->xfs_rtextsize)));
      PUSHs (sv_2mortal (newSVpv ("xfs_rtblocks", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->xfs_rtblocks)));
      PUSHs (sv_2mortal (newSVpv ("xfs_rtextents", 0)));
      PUSHs (sv_2mortal (my_newSVull (r->xfs_rtextents)));
      guestfs_free_xfsinfo (r);
#line 29161 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_xfs_info2); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_xfs_info2)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, pathordevice");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	pathordevice = (char *)SvPV_nolen(ST(1))
;
#line 11858 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 29183 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::xfs_info2(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::xfs_info2(): g is not a blessed HV reference");
    }
;
#line 11861 "lib/Sys/Guestfs.xs"
      r = guestfs_xfs_info2 (g, pathordevice);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 29208 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_xfs_repair); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_xfs_repair)
{
    dVAR; dXSARGS;
    if (items < 2)
       croak_xs_usage(cv,  "g, device, ...");
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 11877 "lib/Sys/Guestfs.xs"
      int r;
      struct guestfs_xfs_repair_argv optargs_s = { .bitmask = 0 };
      struct guestfs_xfs_repair_argv *optargs = &optargs_s;
      size_t items_i;
#line 29230 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::xfs_repair(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::xfs_repair(): g is not a blessed HV reference");
    }
;
#line 11882 "lib/Sys/Guestfs.xs"
      if (((items - 2) & 1) != 0)
        croak ("expecting an even number of extra parameters");
      for (items_i = 2; items_i < items; items_i += 2) {
        uint64_t this_mask;
        const char *this_arg;

        this_arg = SvPV_nolen (ST (items_i));
        if (STREQ (this_arg, "forcelogzero")) {
          optargs_s.forcelogzero = SvIV (ST (items_i+1));
          this_mask = GUESTFS_XFS_REPAIR_FORCELOGZERO_BITMASK;
        }
        else if (STREQ (this_arg, "nomodify")) {
          optargs_s.nomodify = SvIV (ST (items_i+1));
          this_mask = GUESTFS_XFS_REPAIR_NOMODIFY_BITMASK;
        }
        else if (STREQ (this_arg, "noprefetch")) {
          optargs_s.noprefetch = SvIV (ST (items_i+1));
          this_mask = GUESTFS_XFS_REPAIR_NOPREFETCH_BITMASK;
        }
        else if (STREQ (this_arg, "forcegeometry")) {
          optargs_s.forcegeometry = SvIV (ST (items_i+1));
          this_mask = GUESTFS_XFS_REPAIR_FORCEGEOMETRY_BITMASK;
        }
        else if (STREQ (this_arg, "maxmem")) {
          optargs_s.maxmem = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_XFS_REPAIR_MAXMEM_BITMASK;
        }
        else if (STREQ (this_arg, "ihashsize")) {
          optargs_s.ihashsize = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_XFS_REPAIR_IHASHSIZE_BITMASK;
        }
        else if (STREQ (this_arg, "bhashsize")) {
          optargs_s.bhashsize = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_XFS_REPAIR_BHASHSIZE_BITMASK;
        }
        else if (STREQ (this_arg, "agstride")) {
          optargs_s.agstride = my_SvIV64 (ST (items_i+1));
          this_mask = GUESTFS_XFS_REPAIR_AGSTRIDE_BITMASK;
        }
        else if (STREQ (this_arg, "logdev")) {
          optargs_s.logdev = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_XFS_REPAIR_LOGDEV_BITMASK;
        }
        else if (STREQ (this_arg, "rtdev")) {
          optargs_s.rtdev = SvPV_nolen (ST (items_i+1));
          this_mask = GUESTFS_XFS_REPAIR_RTDEV_BITMASK;
        }
        else croak ("unknown optional argument '%s'", this_arg);
        if (optargs_s.bitmask & this_mask)
          croak ("optional argument '%s' given more than once",
                 this_arg);
        optargs_s.bitmask |= this_mask;
      }

      r = guestfs_xfs_repair_argv (g, device, optargs);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSViv (r);
#line 29304 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_yara_destroy); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_yara_destroy)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "g");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
#line 11947 "lib/Sys/Guestfs.xs"
      int r;
#line 29324 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::yara_destroy(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::yara_destroy(): g is not a blessed HV reference");
    }
;
#line 11949 "lib/Sys/Guestfs.xs"
      r = guestfs_yara_destroy (g);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 29342 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_yara_load); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_yara_load)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, filename");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	filename = (char *)SvPV_nolen(ST(1))
;
#line 11958 "lib/Sys/Guestfs.xs"
      int r;
#line 29363 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::yara_load(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::yara_load(): g is not a blessed HV reference");
    }
;
#line 11960 "lib/Sys/Guestfs.xs"
      r = guestfs_yara_load (g, filename);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 29381 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_yara_scan); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_yara_scan)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	path = (char *)SvPV_nolen(ST(1))
;
#line 11969 "lib/Sys/Guestfs.xs"
      struct guestfs_yara_detection_list *r;
      size_t i;
      HV *hv;
#line 29404 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::yara_scan(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::yara_scan(): g is not a blessed HV reference");
    }
;
#line 11973 "lib/Sys/Guestfs.xs"
      r = guestfs_yara_scan (g, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      EXTEND (SP, r->len);
      for (i = 0; i < r->len; ++i) {
        hv = newHV ();
        (void) hv_store (hv, "yara_name", 9, newSVpv (r->val[i].yara_name, 0), 0);
        (void) hv_store (hv, "yara_rule", 9, newSVpv (r->val[i].yara_rule, 0), 0);
        PUSHs (sv_2mortal (newRV ((SV *) hv)));
      }
      guestfs_free_yara_detection_list (r);
#line 29430 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_zegrep); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_zegrep)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, regex, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	regex = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 11991 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 29454 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::zegrep(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::zegrep(): g is not a blessed HV reference");
    }
;
#line 11994 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::zegrep is deprecated; use Sys::Guestfs::grep instead");
      r = guestfs_zegrep (g, regex, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 29481 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_zegrepi); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_zegrepi)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, regex, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	regex = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 12013 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 29505 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::zegrepi(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::zegrepi(): g is not a blessed HV reference");
    }
;
#line 12016 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::zegrepi is deprecated; use Sys::Guestfs::grep instead");
      r = guestfs_zegrepi (g, regex, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 29532 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_zero); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_zero)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 12034 "lib/Sys/Guestfs.xs"
      int r;
#line 29553 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::zero(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::zero(): g is not a blessed HV reference");
    }
;
#line 12036 "lib/Sys/Guestfs.xs"
      r = guestfs_zero (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 29571 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_zero_device); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_zero_device)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 12045 "lib/Sys/Guestfs.xs"
      int r;
#line 29592 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::zero_device(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::zero_device(): g is not a blessed HV reference");
    }
;
#line 12047 "lib/Sys/Guestfs.xs"
      r = guestfs_zero_device (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 29610 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_zero_free_space); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_zero_free_space)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, directory");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	directory = (char *)SvPV_nolen(ST(1))
;
#line 12056 "lib/Sys/Guestfs.xs"
      int r;
#line 29631 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::zero_free_space(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::zero_free_space(): g is not a blessed HV reference");
    }
;
#line 12058 "lib/Sys/Guestfs.xs"
      r = guestfs_zero_free_space (g, directory);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 29649 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_zerofree); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_zerofree)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "g, device");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	device = (char *)SvPV_nolen(ST(1))
;
#line 12067 "lib/Sys/Guestfs.xs"
      int r;
#line 29670 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::zerofree(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::zerofree(): g is not a blessed HV reference");
    }
;
#line 12069 "lib/Sys/Guestfs.xs"
      r = guestfs_zerofree (g, device);
      if (r == -1)
        croak ("%s", guestfs_last_error (g));
#line 29688 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_zfgrep); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_zfgrep)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, pattern, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	pattern = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 12079 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 29712 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::zfgrep(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::zfgrep(): g is not a blessed HV reference");
    }
;
#line 12082 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::zfgrep is deprecated; use Sys::Guestfs::grep instead");
      r = guestfs_zfgrep (g, pattern, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 29739 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_zfgrepi); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_zfgrepi)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, pattern, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	pattern = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 12101 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 29763 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::zfgrepi(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::zfgrepi(): g is not a blessed HV reference");
    }
;
#line 12104 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::zfgrepi is deprecated; use Sys::Guestfs::grep instead");
      r = guestfs_zfgrepi (g, pattern, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 29790 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_zfile); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_zfile)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, meth, path");
    {
	guestfs_h *	g;
	char *	meth = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 12123 "lib/Sys/Guestfs.xs"
      char *r;
#line 29811 "lib/Sys/Guestfs.c"
	SV *	RETVAL;

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::zfile(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::zfile(): g is not a blessed HV reference");
    }
;
#line 12125 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::zfile is deprecated; use Sys::Guestfs::file instead");
      r = guestfs_zfile (g, meth, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      RETVAL = newSVpv (r, 0);
      free (r);
#line 29834 "lib/Sys/Guestfs.c"
	RETVAL = sv_2mortal(RETVAL);
	ST(0) = RETVAL;
    }
    XSRETURN(1);
}


XS_EUPXS(XS_Sys__Guestfs_zgrep); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_zgrep)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, regex, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	regex = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 12141 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 29859 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::zgrep(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::zgrep(): g is not a blessed HV reference");
    }
;
#line 12144 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::zgrep is deprecated; use Sys::Guestfs::grep instead");
      r = guestfs_zgrep (g, regex, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 29886 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_Sys__Guestfs_zgrepi); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_Sys__Guestfs_zgrepi)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "g, regex, path");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	guestfs_h *	g;
	char *	regex = (char *)SvPV_nolen(ST(1))
;
	char *	path = (char *)SvPV_nolen(ST(2))
;
#line 12163 "lib/Sys/Guestfs.xs"
      char **r;
      size_t i, n;
#line 29910 "lib/Sys/Guestfs.c"

    if (sv_isobject (ST(0)) && sv_derived_from (ST(0), "Sys::Guestfs") &&
        SvTYPE (ST(0)) == SVt_RV &&
        SvTYPE (SvRV (ST(0))) == SVt_PVHV) {
        HV *hv = (HV *) SvRV (ST(0));
        SV **svp = hv_fetch (hv, "_g", 2, 0);
        if (svp == NULL)
            croak ("Sys::Guestfs::zgrepi(): called on a closed handle");
        g = INT2PTR (guestfs_h *, SvIV (*svp));
    } else {
        croak ("Sys::Guestfs::zgrepi(): g is not a blessed HV reference");
    }
;
#line 12166 "lib/Sys/Guestfs.xs"
      Perl_ck_warner (aTHX_ packWARN(WARN_DEPRECATED),
        "Sys::Guestfs::zgrepi is deprecated; use Sys::Guestfs::grep instead");
      r = guestfs_zgrepi (g, regex, path);
      if (r == NULL)
        croak ("%s", guestfs_last_error (g));
      for (n = 0; r[n] != NULL; ++n) /**/;
      EXTEND (SP, n);
      for (i = 0; i < n; ++i) {
        PUSHs (sv_2mortal (newSVpv (r[i], 0)));
        free (r[i]);
      }
      free (r);
#line 29937 "lib/Sys/Guestfs.c"
	PUTBACK;
	return;
    }
}

#ifdef __cplusplus
extern "C" {
#endif
XS_EXTERNAL(boot_Sys__Guestfs); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_Sys__Guestfs)
{
#if PERL_VERSION_LE(5, 21, 5)
    dVAR; dXSARGS;
#else
    dVAR; dXSBOOTARGSXSAPIVERCHK;
#endif
#if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
    char* file = __FILE__;
#else
    const char* file = __FILE__;
#endif

    PERL_UNUSED_VAR(file);

    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
#if PERL_VERSION_LE(5, 21, 5)
    XS_VERSION_BOOTCHECK;
#  ifdef XS_APIVERSION_BOOTCHECK
    XS_APIVERSION_BOOTCHECK;
#  endif
#endif

        (void)newXSproto_portable("Sys::Guestfs::_create", XS_Sys__Guestfs__create, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::DESTROY", XS_Sys__Guestfs_DESTROY, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::close", XS_Sys__Guestfs_close, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::set_event_callback", XS_Sys__Guestfs_set_event_callback, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::delete_event_callback", XS_Sys__Guestfs_delete_event_callback, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::event_to_string", XS_Sys__Guestfs_event_to_string, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::last_errno", XS_Sys__Guestfs_last_errno, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::acl_delete_def_file", XS_Sys__Guestfs_acl_delete_def_file, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::acl_get_file", XS_Sys__Guestfs_acl_get_file, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::acl_set_file", XS_Sys__Guestfs_acl_set_file, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::add_cdrom", XS_Sys__Guestfs_add_cdrom, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::add_domain", XS_Sys__Guestfs_add_domain, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::add_drive", XS_Sys__Guestfs_add_drive, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::add_drive_ro", XS_Sys__Guestfs_add_drive_ro, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::add_drive_ro_with_if", XS_Sys__Guestfs_add_drive_ro_with_if, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::add_drive_scratch", XS_Sys__Guestfs_add_drive_scratch, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::add_drive_with_if", XS_Sys__Guestfs_add_drive_with_if, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::add_libvirt_dom", XS_Sys__Guestfs_add_libvirt_dom, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::aug_clear", XS_Sys__Guestfs_aug_clear, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::aug_close", XS_Sys__Guestfs_aug_close, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::aug_defnode", XS_Sys__Guestfs_aug_defnode, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::aug_defvar", XS_Sys__Guestfs_aug_defvar, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::aug_get", XS_Sys__Guestfs_aug_get, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::aug_init", XS_Sys__Guestfs_aug_init, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::aug_insert", XS_Sys__Guestfs_aug_insert, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::aug_label", XS_Sys__Guestfs_aug_label, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::aug_load", XS_Sys__Guestfs_aug_load, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::aug_ls", XS_Sys__Guestfs_aug_ls, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::aug_match", XS_Sys__Guestfs_aug_match, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::aug_mv", XS_Sys__Guestfs_aug_mv, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::aug_rm", XS_Sys__Guestfs_aug_rm, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::aug_save", XS_Sys__Guestfs_aug_save, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::aug_set", XS_Sys__Guestfs_aug_set, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::aug_setm", XS_Sys__Guestfs_aug_setm, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::aug_transform", XS_Sys__Guestfs_aug_transform, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::available", XS_Sys__Guestfs_available, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::available_all_groups", XS_Sys__Guestfs_available_all_groups, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::base64_in", XS_Sys__Guestfs_base64_in, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::base64_out", XS_Sys__Guestfs_base64_out, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::blkdiscard", XS_Sys__Guestfs_blkdiscard, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::blkdiscardzeroes", XS_Sys__Guestfs_blkdiscardzeroes, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::blkid", XS_Sys__Guestfs_blkid, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::blockdev_flushbufs", XS_Sys__Guestfs_blockdev_flushbufs, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::blockdev_getbsz", XS_Sys__Guestfs_blockdev_getbsz, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::blockdev_getro", XS_Sys__Guestfs_blockdev_getro, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::blockdev_getsize64", XS_Sys__Guestfs_blockdev_getsize64, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::blockdev_getss", XS_Sys__Guestfs_blockdev_getss, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::blockdev_getsz", XS_Sys__Guestfs_blockdev_getsz, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::blockdev_rereadpt", XS_Sys__Guestfs_blockdev_rereadpt, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::blockdev_setbsz", XS_Sys__Guestfs_blockdev_setbsz, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::blockdev_setra", XS_Sys__Guestfs_blockdev_setra, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::blockdev_setro", XS_Sys__Guestfs_blockdev_setro, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::blockdev_setrw", XS_Sys__Guestfs_blockdev_setrw, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_balance_cancel", XS_Sys__Guestfs_btrfs_balance_cancel, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_balance_pause", XS_Sys__Guestfs_btrfs_balance_pause, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_balance_resume", XS_Sys__Guestfs_btrfs_balance_resume, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_balance_status", XS_Sys__Guestfs_btrfs_balance_status, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_device_add", XS_Sys__Guestfs_btrfs_device_add, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_device_delete", XS_Sys__Guestfs_btrfs_device_delete, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_filesystem_balance", XS_Sys__Guestfs_btrfs_filesystem_balance, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_filesystem_defragment", XS_Sys__Guestfs_btrfs_filesystem_defragment, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_filesystem_resize", XS_Sys__Guestfs_btrfs_filesystem_resize, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_filesystem_show", XS_Sys__Guestfs_btrfs_filesystem_show, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_filesystem_sync", XS_Sys__Guestfs_btrfs_filesystem_sync, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_fsck", XS_Sys__Guestfs_btrfs_fsck, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_image", XS_Sys__Guestfs_btrfs_image, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_qgroup_assign", XS_Sys__Guestfs_btrfs_qgroup_assign, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_qgroup_create", XS_Sys__Guestfs_btrfs_qgroup_create, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_qgroup_destroy", XS_Sys__Guestfs_btrfs_qgroup_destroy, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_qgroup_limit", XS_Sys__Guestfs_btrfs_qgroup_limit, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_qgroup_remove", XS_Sys__Guestfs_btrfs_qgroup_remove, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_qgroup_show", XS_Sys__Guestfs_btrfs_qgroup_show, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_quota_enable", XS_Sys__Guestfs_btrfs_quota_enable, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_quota_rescan", XS_Sys__Guestfs_btrfs_quota_rescan, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_replace", XS_Sys__Guestfs_btrfs_replace, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_rescue_chunk_recover", XS_Sys__Guestfs_btrfs_rescue_chunk_recover, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_rescue_super_recover", XS_Sys__Guestfs_btrfs_rescue_super_recover, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_scrub_cancel", XS_Sys__Guestfs_btrfs_scrub_cancel, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_scrub_full", XS_Sys__Guestfs_btrfs_scrub_full, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_scrub_resume", XS_Sys__Guestfs_btrfs_scrub_resume, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_scrub_start", XS_Sys__Guestfs_btrfs_scrub_start, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_scrub_status", XS_Sys__Guestfs_btrfs_scrub_status, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_set_seeding", XS_Sys__Guestfs_btrfs_set_seeding, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_subvolume_create", XS_Sys__Guestfs_btrfs_subvolume_create, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_subvolume_delete", XS_Sys__Guestfs_btrfs_subvolume_delete, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_subvolume_get_default", XS_Sys__Guestfs_btrfs_subvolume_get_default, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_subvolume_list", XS_Sys__Guestfs_btrfs_subvolume_list, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_subvolume_set_default", XS_Sys__Guestfs_btrfs_subvolume_set_default, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_subvolume_show", XS_Sys__Guestfs_btrfs_subvolume_show, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfs_subvolume_snapshot", XS_Sys__Guestfs_btrfs_subvolume_snapshot, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::btrfstune_enable_extended_inode_refs", XS_Sys__Guestfs_btrfstune_enable_extended_inode_refs, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfstune_enable_skinny_metadata_extent_refs", XS_Sys__Guestfs_btrfstune_enable_skinny_metadata_extent_refs, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::btrfstune_seeding", XS_Sys__Guestfs_btrfstune_seeding, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::c_pointer", XS_Sys__Guestfs_c_pointer, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::canonical_device_name", XS_Sys__Guestfs_canonical_device_name, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::cap_get_file", XS_Sys__Guestfs_cap_get_file, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::cap_set_file", XS_Sys__Guestfs_cap_set_file, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::case_sensitive_path", XS_Sys__Guestfs_case_sensitive_path, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::cat", XS_Sys__Guestfs_cat, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::checksum", XS_Sys__Guestfs_checksum, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::checksum_device", XS_Sys__Guestfs_checksum_device, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::checksums_out", XS_Sys__Guestfs_checksums_out, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::chmod", XS_Sys__Guestfs_chmod, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::chown", XS_Sys__Guestfs_chown, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::clear_backend_setting", XS_Sys__Guestfs_clear_backend_setting, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::clevis_luks_unlock", XS_Sys__Guestfs_clevis_luks_unlock, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::command", XS_Sys__Guestfs_command, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::command_lines", XS_Sys__Guestfs_command_lines, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::command_out", XS_Sys__Guestfs_command_out, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::compress_device_out", XS_Sys__Guestfs_compress_device_out, file, "$$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::compress_out", XS_Sys__Guestfs_compress_out, file, "$$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::config", XS_Sys__Guestfs_config, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::copy_attributes", XS_Sys__Guestfs_copy_attributes, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::copy_device_to_device", XS_Sys__Guestfs_copy_device_to_device, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::copy_device_to_file", XS_Sys__Guestfs_copy_device_to_file, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::copy_file_to_device", XS_Sys__Guestfs_copy_file_to_device, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::copy_file_to_file", XS_Sys__Guestfs_copy_file_to_file, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::copy_in", XS_Sys__Guestfs_copy_in, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::copy_out", XS_Sys__Guestfs_copy_out, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::copy_size", XS_Sys__Guestfs_copy_size, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::cp", XS_Sys__Guestfs_cp, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::cp_a", XS_Sys__Guestfs_cp_a, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::cp_r", XS_Sys__Guestfs_cp_r, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::cpio_out", XS_Sys__Guestfs_cpio_out, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::cryptsetup_close", XS_Sys__Guestfs_cryptsetup_close, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::cryptsetup_open", XS_Sys__Guestfs_cryptsetup_open, file, "$$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::dd", XS_Sys__Guestfs_dd, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::debug", XS_Sys__Guestfs_debug, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::debug_drives", XS_Sys__Guestfs_debug_drives, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::debug_upload", XS_Sys__Guestfs_debug_upload, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::device_index", XS_Sys__Guestfs_device_index, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::device_name", XS_Sys__Guestfs_device_name, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::df", XS_Sys__Guestfs_df, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::df_h", XS_Sys__Guestfs_df_h, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::disk_create", XS_Sys__Guestfs_disk_create, file, "$$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::disk_format", XS_Sys__Guestfs_disk_format, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::disk_has_backing_file", XS_Sys__Guestfs_disk_has_backing_file, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::disk_virtual_size", XS_Sys__Guestfs_disk_virtual_size, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::dmesg", XS_Sys__Guestfs_dmesg, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::download", XS_Sys__Guestfs_download, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::download_blocks", XS_Sys__Guestfs_download_blocks, file, "$$$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::download_inode", XS_Sys__Guestfs_download_inode, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::download_offset", XS_Sys__Guestfs_download_offset, file, "$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::drop_caches", XS_Sys__Guestfs_drop_caches, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::du", XS_Sys__Guestfs_du, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::e2fsck", XS_Sys__Guestfs_e2fsck, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::e2fsck_f", XS_Sys__Guestfs_e2fsck_f, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::echo_daemon", XS_Sys__Guestfs_echo_daemon, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::egrep", XS_Sys__Guestfs_egrep, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::egrepi", XS_Sys__Guestfs_egrepi, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::equal", XS_Sys__Guestfs_equal, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::exists", XS_Sys__Guestfs_exists, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::extlinux", XS_Sys__Guestfs_extlinux, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::f2fs_expand", XS_Sys__Guestfs_f2fs_expand, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::fallocate", XS_Sys__Guestfs_fallocate, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::fallocate64", XS_Sys__Guestfs_fallocate64, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::feature_available", XS_Sys__Guestfs_feature_available, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::fgrep", XS_Sys__Guestfs_fgrep, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::fgrepi", XS_Sys__Guestfs_fgrepi, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::file", XS_Sys__Guestfs_file, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::file_architecture", XS_Sys__Guestfs_file_architecture, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::filesize", XS_Sys__Guestfs_filesize, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::filesystem_available", XS_Sys__Guestfs_filesystem_available, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::filesystem_walk", XS_Sys__Guestfs_filesystem_walk, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::fill", XS_Sys__Guestfs_fill, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::fill_dir", XS_Sys__Guestfs_fill_dir, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::fill_pattern", XS_Sys__Guestfs_fill_pattern, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::find", XS_Sys__Guestfs_find, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::find0", XS_Sys__Guestfs_find0, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::find_inode", XS_Sys__Guestfs_find_inode, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::findfs_label", XS_Sys__Guestfs_findfs_label, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::findfs_partlabel", XS_Sys__Guestfs_findfs_partlabel, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::findfs_partuuid", XS_Sys__Guestfs_findfs_partuuid, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::findfs_uuid", XS_Sys__Guestfs_findfs_uuid, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::fsck", XS_Sys__Guestfs_fsck, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::fstrim", XS_Sys__Guestfs_fstrim, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::get_append", XS_Sys__Guestfs_get_append, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_attach_method", XS_Sys__Guestfs_get_attach_method, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_autosync", XS_Sys__Guestfs_get_autosync, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_backend", XS_Sys__Guestfs_get_backend, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_backend_setting", XS_Sys__Guestfs_get_backend_setting, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::get_backend_settings", XS_Sys__Guestfs_get_backend_settings, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_cachedir", XS_Sys__Guestfs_get_cachedir, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_direct", XS_Sys__Guestfs_get_direct, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_e2attrs", XS_Sys__Guestfs_get_e2attrs, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::get_e2generation", XS_Sys__Guestfs_get_e2generation, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::get_e2label", XS_Sys__Guestfs_get_e2label, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::get_e2uuid", XS_Sys__Guestfs_get_e2uuid, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::get_hv", XS_Sys__Guestfs_get_hv, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_identifier", XS_Sys__Guestfs_get_identifier, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_libvirt_requested_credential_challenge", XS_Sys__Guestfs_get_libvirt_requested_credential_challenge, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::get_libvirt_requested_credential_defresult", XS_Sys__Guestfs_get_libvirt_requested_credential_defresult, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::get_libvirt_requested_credential_prompt", XS_Sys__Guestfs_get_libvirt_requested_credential_prompt, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::get_libvirt_requested_credentials", XS_Sys__Guestfs_get_libvirt_requested_credentials, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_memsize", XS_Sys__Guestfs_get_memsize, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_network", XS_Sys__Guestfs_get_network, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_path", XS_Sys__Guestfs_get_path, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_pgroup", XS_Sys__Guestfs_get_pgroup, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_pid", XS_Sys__Guestfs_get_pid, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_program", XS_Sys__Guestfs_get_program, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_qemu", XS_Sys__Guestfs_get_qemu, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_recovery_proc", XS_Sys__Guestfs_get_recovery_proc, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_selinux", XS_Sys__Guestfs_get_selinux, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_smp", XS_Sys__Guestfs_get_smp, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_sockdir", XS_Sys__Guestfs_get_sockdir, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_state", XS_Sys__Guestfs_get_state, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_tmpdir", XS_Sys__Guestfs_get_tmpdir, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_trace", XS_Sys__Guestfs_get_trace, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_umask", XS_Sys__Guestfs_get_umask, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::get_verbose", XS_Sys__Guestfs_get_verbose, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::getcon", XS_Sys__Guestfs_getcon, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::getxattr", XS_Sys__Guestfs_getxattr, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::getxattrs", XS_Sys__Guestfs_getxattrs, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::glob_expand", XS_Sys__Guestfs_glob_expand, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::grep", XS_Sys__Guestfs_grep, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::grepi", XS_Sys__Guestfs_grepi, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::grub_install", XS_Sys__Guestfs_grub_install, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::head", XS_Sys__Guestfs_head, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::head_n", XS_Sys__Guestfs_head_n, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::hexdump", XS_Sys__Guestfs_hexdump, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_close", XS_Sys__Guestfs_hivex_close, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_commit", XS_Sys__Guestfs_hivex_commit, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_node_add_child", XS_Sys__Guestfs_hivex_node_add_child, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_node_children", XS_Sys__Guestfs_hivex_node_children, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_node_delete_child", XS_Sys__Guestfs_hivex_node_delete_child, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_node_get_child", XS_Sys__Guestfs_hivex_node_get_child, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_node_get_value", XS_Sys__Guestfs_hivex_node_get_value, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_node_name", XS_Sys__Guestfs_hivex_node_name, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_node_parent", XS_Sys__Guestfs_hivex_node_parent, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_node_set_value", XS_Sys__Guestfs_hivex_node_set_value, file, "$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_node_values", XS_Sys__Guestfs_hivex_node_values, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_open", XS_Sys__Guestfs_hivex_open, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::hivex_root", XS_Sys__Guestfs_hivex_root, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_value_key", XS_Sys__Guestfs_hivex_value_key, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_value_string", XS_Sys__Guestfs_hivex_value_string, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_value_type", XS_Sys__Guestfs_hivex_value_type, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_value_utf8", XS_Sys__Guestfs_hivex_value_utf8, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::hivex_value_value", XS_Sys__Guestfs_hivex_value_value, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::initrd_cat", XS_Sys__Guestfs_initrd_cat, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::initrd_list", XS_Sys__Guestfs_initrd_list, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inotify_add_watch", XS_Sys__Guestfs_inotify_add_watch, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::inotify_close", XS_Sys__Guestfs_inotify_close, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::inotify_files", XS_Sys__Guestfs_inotify_files, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::inotify_init", XS_Sys__Guestfs_inotify_init, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inotify_read", XS_Sys__Guestfs_inotify_read, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::inotify_rm_watch", XS_Sys__Guestfs_inotify_rm_watch, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_arch", XS_Sys__Guestfs_inspect_get_arch, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_build_id", XS_Sys__Guestfs_inspect_get_build_id, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_distro", XS_Sys__Guestfs_inspect_get_distro, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_drive_mappings", XS_Sys__Guestfs_inspect_get_drive_mappings, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_filesystems", XS_Sys__Guestfs_inspect_get_filesystems, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_format", XS_Sys__Guestfs_inspect_get_format, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_hostname", XS_Sys__Guestfs_inspect_get_hostname, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_icon", XS_Sys__Guestfs_inspect_get_icon, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_major_version", XS_Sys__Guestfs_inspect_get_major_version, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_minor_version", XS_Sys__Guestfs_inspect_get_minor_version, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_mountpoints", XS_Sys__Guestfs_inspect_get_mountpoints, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_osinfo", XS_Sys__Guestfs_inspect_get_osinfo, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_package_format", XS_Sys__Guestfs_inspect_get_package_format, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_package_management", XS_Sys__Guestfs_inspect_get_package_management, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_product_name", XS_Sys__Guestfs_inspect_get_product_name, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_product_variant", XS_Sys__Guestfs_inspect_get_product_variant, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_roots", XS_Sys__Guestfs_inspect_get_roots, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_type", XS_Sys__Guestfs_inspect_get_type, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_windows_current_control_set", XS_Sys__Guestfs_inspect_get_windows_current_control_set, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_windows_group_policy", XS_Sys__Guestfs_inspect_get_windows_group_policy, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_windows_software_hive", XS_Sys__Guestfs_inspect_get_windows_software_hive, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_windows_system_hive", XS_Sys__Guestfs_inspect_get_windows_system_hive, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_get_windows_systemroot", XS_Sys__Guestfs_inspect_get_windows_systemroot, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_is_live", XS_Sys__Guestfs_inspect_is_live, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_is_multipart", XS_Sys__Guestfs_inspect_is_multipart, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_is_netinst", XS_Sys__Guestfs_inspect_is_netinst, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_list_applications", XS_Sys__Guestfs_inspect_list_applications, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_list_applications2", XS_Sys__Guestfs_inspect_list_applications2, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::inspect_os", XS_Sys__Guestfs_inspect_os, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::internal_exit", XS_Sys__Guestfs_internal_exit, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test", XS_Sys__Guestfs_internal_test, file, "$$$$$$$$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_63_optargs", XS_Sys__Guestfs_internal_test_63_optargs, file, "$;@");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_close_output", XS_Sys__Guestfs_internal_test_close_output, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_only_optargs", XS_Sys__Guestfs_internal_test_only_optargs, file, "$;@");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rbool", XS_Sys__Guestfs_internal_test_rbool, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rboolerr", XS_Sys__Guestfs_internal_test_rboolerr, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rbufferout", XS_Sys__Guestfs_internal_test_rbufferout, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rbufferouterr", XS_Sys__Guestfs_internal_test_rbufferouterr, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rconstoptstring", XS_Sys__Guestfs_internal_test_rconstoptstring, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rconstoptstringerr", XS_Sys__Guestfs_internal_test_rconstoptstringerr, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rconststring", XS_Sys__Guestfs_internal_test_rconststring, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rconststringerr", XS_Sys__Guestfs_internal_test_rconststringerr, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rhashtable", XS_Sys__Guestfs_internal_test_rhashtable, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rhashtableerr", XS_Sys__Guestfs_internal_test_rhashtableerr, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rint", XS_Sys__Guestfs_internal_test_rint, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rint64", XS_Sys__Guestfs_internal_test_rint64, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rint64err", XS_Sys__Guestfs_internal_test_rint64err, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rinterr", XS_Sys__Guestfs_internal_test_rinterr, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rstring", XS_Sys__Guestfs_internal_test_rstring, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rstringerr", XS_Sys__Guestfs_internal_test_rstringerr, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rstringlist", XS_Sys__Guestfs_internal_test_rstringlist, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rstringlisterr", XS_Sys__Guestfs_internal_test_rstringlisterr, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rstruct", XS_Sys__Guestfs_internal_test_rstruct, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rstructerr", XS_Sys__Guestfs_internal_test_rstructerr, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rstructlist", XS_Sys__Guestfs_internal_test_rstructlist, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_rstructlisterr", XS_Sys__Guestfs_internal_test_rstructlisterr, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::internal_test_set_output", XS_Sys__Guestfs_internal_test_set_output, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::is_blockdev", XS_Sys__Guestfs_is_blockdev, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::is_busy", XS_Sys__Guestfs_is_busy, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::is_chardev", XS_Sys__Guestfs_is_chardev, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::is_config", XS_Sys__Guestfs_is_config, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::is_dir", XS_Sys__Guestfs_is_dir, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::is_fifo", XS_Sys__Guestfs_is_fifo, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::is_file", XS_Sys__Guestfs_is_file, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::is_launching", XS_Sys__Guestfs_is_launching, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::is_lv", XS_Sys__Guestfs_is_lv, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::is_ready", XS_Sys__Guestfs_is_ready, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::is_socket", XS_Sys__Guestfs_is_socket, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::is_symlink", XS_Sys__Guestfs_is_symlink, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::is_whole_device", XS_Sys__Guestfs_is_whole_device, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::is_zero", XS_Sys__Guestfs_is_zero, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::is_zero_device", XS_Sys__Guestfs_is_zero_device, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::isoinfo", XS_Sys__Guestfs_isoinfo, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::isoinfo_device", XS_Sys__Guestfs_isoinfo_device, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::journal_close", XS_Sys__Guestfs_journal_close, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::journal_get", XS_Sys__Guestfs_journal_get, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::journal_get_data_threshold", XS_Sys__Guestfs_journal_get_data_threshold, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::journal_get_realtime_usec", XS_Sys__Guestfs_journal_get_realtime_usec, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::journal_next", XS_Sys__Guestfs_journal_next, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::journal_open", XS_Sys__Guestfs_journal_open, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::journal_set_data_threshold", XS_Sys__Guestfs_journal_set_data_threshold, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::journal_skip", XS_Sys__Guestfs_journal_skip, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::kill_subprocess", XS_Sys__Guestfs_kill_subprocess, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::launch", XS_Sys__Guestfs_launch, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::lchown", XS_Sys__Guestfs_lchown, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::ldmtool_create_all", XS_Sys__Guestfs_ldmtool_create_all, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::ldmtool_diskgroup_disks", XS_Sys__Guestfs_ldmtool_diskgroup_disks, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::ldmtool_diskgroup_name", XS_Sys__Guestfs_ldmtool_diskgroup_name, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::ldmtool_diskgroup_volumes", XS_Sys__Guestfs_ldmtool_diskgroup_volumes, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::ldmtool_remove_all", XS_Sys__Guestfs_ldmtool_remove_all, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::ldmtool_scan", XS_Sys__Guestfs_ldmtool_scan, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::ldmtool_scan_devices", XS_Sys__Guestfs_ldmtool_scan_devices, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::ldmtool_volume_hint", XS_Sys__Guestfs_ldmtool_volume_hint, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::ldmtool_volume_partitions", XS_Sys__Guestfs_ldmtool_volume_partitions, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::ldmtool_volume_type", XS_Sys__Guestfs_ldmtool_volume_type, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::lgetxattr", XS_Sys__Guestfs_lgetxattr, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::lgetxattrs", XS_Sys__Guestfs_lgetxattrs, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::list_9p", XS_Sys__Guestfs_list_9p, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::list_devices", XS_Sys__Guestfs_list_devices, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::list_disk_labels", XS_Sys__Guestfs_list_disk_labels, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::list_dm_devices", XS_Sys__Guestfs_list_dm_devices, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::list_filesystems", XS_Sys__Guestfs_list_filesystems, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::list_ldm_partitions", XS_Sys__Guestfs_list_ldm_partitions, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::list_ldm_volumes", XS_Sys__Guestfs_list_ldm_volumes, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::list_md_devices", XS_Sys__Guestfs_list_md_devices, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::list_partitions", XS_Sys__Guestfs_list_partitions, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::ll", XS_Sys__Guestfs_ll, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::llz", XS_Sys__Guestfs_llz, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::ln", XS_Sys__Guestfs_ln, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::ln_f", XS_Sys__Guestfs_ln_f, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::ln_s", XS_Sys__Guestfs_ln_s, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::ln_sf", XS_Sys__Guestfs_ln_sf, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::lremovexattr", XS_Sys__Guestfs_lremovexattr, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::ls", XS_Sys__Guestfs_ls, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::ls0", XS_Sys__Guestfs_ls0, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::lsetxattr", XS_Sys__Guestfs_lsetxattr, file, "$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::lstat", XS_Sys__Guestfs_lstat, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::lstatlist", XS_Sys__Guestfs_lstatlist, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::lstatns", XS_Sys__Guestfs_lstatns, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::lstatnslist", XS_Sys__Guestfs_lstatnslist, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::luks_add_key", XS_Sys__Guestfs_luks_add_key, file, "$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::luks_close", XS_Sys__Guestfs_luks_close, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::luks_format", XS_Sys__Guestfs_luks_format, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::luks_format_cipher", XS_Sys__Guestfs_luks_format_cipher, file, "$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::luks_kill_slot", XS_Sys__Guestfs_luks_kill_slot, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::luks_open", XS_Sys__Guestfs_luks_open, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::luks_open_ro", XS_Sys__Guestfs_luks_open_ro, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::luks_uuid", XS_Sys__Guestfs_luks_uuid, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::lvcreate", XS_Sys__Guestfs_lvcreate, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::lvcreate_free", XS_Sys__Guestfs_lvcreate_free, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::lvm_canonical_lv_name", XS_Sys__Guestfs_lvm_canonical_lv_name, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::lvm_clear_filter", XS_Sys__Guestfs_lvm_clear_filter, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::lvm_remove_all", XS_Sys__Guestfs_lvm_remove_all, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::lvm_scan", XS_Sys__Guestfs_lvm_scan, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::lvm_set_filter", XS_Sys__Guestfs_lvm_set_filter, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::lvremove", XS_Sys__Guestfs_lvremove, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::lvrename", XS_Sys__Guestfs_lvrename, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::lvresize", XS_Sys__Guestfs_lvresize, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::lvresize_free", XS_Sys__Guestfs_lvresize_free, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::lvs", XS_Sys__Guestfs_lvs, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::lvs_full", XS_Sys__Guestfs_lvs_full, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::lvuuid", XS_Sys__Guestfs_lvuuid, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::lxattrlist", XS_Sys__Guestfs_lxattrlist, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::max_disks", XS_Sys__Guestfs_max_disks, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::md_create", XS_Sys__Guestfs_md_create, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::md_detail", XS_Sys__Guestfs_md_detail, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::md_stat", XS_Sys__Guestfs_md_stat, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::md_stop", XS_Sys__Guestfs_md_stop, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::mkdir", XS_Sys__Guestfs_mkdir, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::mkdir_mode", XS_Sys__Guestfs_mkdir_mode, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::mkdir_p", XS_Sys__Guestfs_mkdir_p, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::mkdtemp", XS_Sys__Guestfs_mkdtemp, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::mke2fs", XS_Sys__Guestfs_mke2fs, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::mke2fs_J", XS_Sys__Guestfs_mke2fs_J, file, "$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::mke2fs_JL", XS_Sys__Guestfs_mke2fs_JL, file, "$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::mke2fs_JU", XS_Sys__Guestfs_mke2fs_JU, file, "$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::mke2journal", XS_Sys__Guestfs_mke2journal, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::mke2journal_L", XS_Sys__Guestfs_mke2journal_L, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::mke2journal_U", XS_Sys__Guestfs_mke2journal_U, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::mkfifo", XS_Sys__Guestfs_mkfifo, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::mkfs", XS_Sys__Guestfs_mkfs, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::mkfs_b", XS_Sys__Guestfs_mkfs_b, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::mkfs_btrfs", XS_Sys__Guestfs_mkfs_btrfs, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::mklost_and_found", XS_Sys__Guestfs_mklost_and_found, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::mkmountpoint", XS_Sys__Guestfs_mkmountpoint, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::mknod", XS_Sys__Guestfs_mknod, file, "$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::mknod_b", XS_Sys__Guestfs_mknod_b, file, "$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::mknod_c", XS_Sys__Guestfs_mknod_c, file, "$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::mksquashfs", XS_Sys__Guestfs_mksquashfs, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::mkswap", XS_Sys__Guestfs_mkswap, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::mkswap_L", XS_Sys__Guestfs_mkswap_L, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::mkswap_U", XS_Sys__Guestfs_mkswap_U, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::mkswap_file", XS_Sys__Guestfs_mkswap_file, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::mktemp", XS_Sys__Guestfs_mktemp, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::modprobe", XS_Sys__Guestfs_modprobe, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::mount", XS_Sys__Guestfs_mount, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::mount_9p", XS_Sys__Guestfs_mount_9p, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::mount_local", XS_Sys__Guestfs_mount_local, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::mount_local_run", XS_Sys__Guestfs_mount_local_run, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::mount_loop", XS_Sys__Guestfs_mount_loop, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::mount_options", XS_Sys__Guestfs_mount_options, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::mount_ro", XS_Sys__Guestfs_mount_ro, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::mount_vfs", XS_Sys__Guestfs_mount_vfs, file, "$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::mountable_device", XS_Sys__Guestfs_mountable_device, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::mountable_subvolume", XS_Sys__Guestfs_mountable_subvolume, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::mountpoints", XS_Sys__Guestfs_mountpoints, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::mounts", XS_Sys__Guestfs_mounts, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::mv", XS_Sys__Guestfs_mv, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::nr_devices", XS_Sys__Guestfs_nr_devices, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::ntfs_3g_probe", XS_Sys__Guestfs_ntfs_3g_probe, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::ntfs_chmod", XS_Sys__Guestfs_ntfs_chmod, file, "$$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::ntfscat_i", XS_Sys__Guestfs_ntfscat_i, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::ntfsclone_in", XS_Sys__Guestfs_ntfsclone_in, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::ntfsclone_out", XS_Sys__Guestfs_ntfsclone_out, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::ntfsfix", XS_Sys__Guestfs_ntfsfix, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::ntfsresize", XS_Sys__Guestfs_ntfsresize, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::ntfsresize_size", XS_Sys__Guestfs_ntfsresize_size, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::parse_environment", XS_Sys__Guestfs_parse_environment, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::parse_environment_list", XS_Sys__Guestfs_parse_environment_list, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::part_add", XS_Sys__Guestfs_part_add, file, "$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_del", XS_Sys__Guestfs_part_del, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_disk", XS_Sys__Guestfs_part_disk, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_expand_gpt", XS_Sys__Guestfs_part_expand_gpt, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::part_get_bootable", XS_Sys__Guestfs_part_get_bootable, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_get_disk_guid", XS_Sys__Guestfs_part_get_disk_guid, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::part_get_gpt_attributes", XS_Sys__Guestfs_part_get_gpt_attributes, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_get_gpt_guid", XS_Sys__Guestfs_part_get_gpt_guid, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_get_gpt_type", XS_Sys__Guestfs_part_get_gpt_type, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_get_mbr_id", XS_Sys__Guestfs_part_get_mbr_id, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_get_mbr_part_type", XS_Sys__Guestfs_part_get_mbr_part_type, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_get_name", XS_Sys__Guestfs_part_get_name, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_get_parttype", XS_Sys__Guestfs_part_get_parttype, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::part_init", XS_Sys__Guestfs_part_init, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_list", XS_Sys__Guestfs_part_list, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::part_resize", XS_Sys__Guestfs_part_resize, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_set_bootable", XS_Sys__Guestfs_part_set_bootable, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_set_disk_guid", XS_Sys__Guestfs_part_set_disk_guid, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_set_disk_guid_random", XS_Sys__Guestfs_part_set_disk_guid_random, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::part_set_gpt_attributes", XS_Sys__Guestfs_part_set_gpt_attributes, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_set_gpt_guid", XS_Sys__Guestfs_part_set_gpt_guid, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_set_gpt_type", XS_Sys__Guestfs_part_set_gpt_type, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_set_mbr_id", XS_Sys__Guestfs_part_set_mbr_id, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_set_name", XS_Sys__Guestfs_part_set_name, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::part_to_dev", XS_Sys__Guestfs_part_to_dev, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::part_to_partnum", XS_Sys__Guestfs_part_to_partnum, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::ping_daemon", XS_Sys__Guestfs_ping_daemon, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::pread", XS_Sys__Guestfs_pread, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::pread_device", XS_Sys__Guestfs_pread_device, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::pvchange_uuid", XS_Sys__Guestfs_pvchange_uuid, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::pvchange_uuid_all", XS_Sys__Guestfs_pvchange_uuid_all, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::pvcreate", XS_Sys__Guestfs_pvcreate, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::pvremove", XS_Sys__Guestfs_pvremove, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::pvresize", XS_Sys__Guestfs_pvresize, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::pvresize_size", XS_Sys__Guestfs_pvresize_size, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::pvs", XS_Sys__Guestfs_pvs, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::pvs_full", XS_Sys__Guestfs_pvs_full, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::pvuuid", XS_Sys__Guestfs_pvuuid, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::pwrite", XS_Sys__Guestfs_pwrite, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::pwrite_device", XS_Sys__Guestfs_pwrite_device, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::read_file", XS_Sys__Guestfs_read_file, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::read_lines", XS_Sys__Guestfs_read_lines, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::readdir", XS_Sys__Guestfs_readdir, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::readlink", XS_Sys__Guestfs_readlink, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::readlinklist", XS_Sys__Guestfs_readlinklist, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::realpath", XS_Sys__Guestfs_realpath, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::remount", XS_Sys__Guestfs_remount, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::remove_drive", XS_Sys__Guestfs_remove_drive, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::removexattr", XS_Sys__Guestfs_removexattr, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::rename", XS_Sys__Guestfs_rename, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::resize2fs", XS_Sys__Guestfs_resize2fs, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::resize2fs_M", XS_Sys__Guestfs_resize2fs_M, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::resize2fs_size", XS_Sys__Guestfs_resize2fs_size, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::rm", XS_Sys__Guestfs_rm, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::rm_f", XS_Sys__Guestfs_rm_f, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::rm_rf", XS_Sys__Guestfs_rm_rf, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::rmdir", XS_Sys__Guestfs_rmdir, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::rmmountpoint", XS_Sys__Guestfs_rmmountpoint, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::rsync", XS_Sys__Guestfs_rsync, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::rsync_in", XS_Sys__Guestfs_rsync_in, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::rsync_out", XS_Sys__Guestfs_rsync_out, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::scrub_device", XS_Sys__Guestfs_scrub_device, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::scrub_file", XS_Sys__Guestfs_scrub_file, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::scrub_freespace", XS_Sys__Guestfs_scrub_freespace, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::selinux_relabel", XS_Sys__Guestfs_selinux_relabel, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::set_append", XS_Sys__Guestfs_set_append, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_attach_method", XS_Sys__Guestfs_set_attach_method, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_autosync", XS_Sys__Guestfs_set_autosync, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_backend", XS_Sys__Guestfs_set_backend, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_backend_setting", XS_Sys__Guestfs_set_backend_setting, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::set_backend_settings", XS_Sys__Guestfs_set_backend_settings, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_cachedir", XS_Sys__Guestfs_set_cachedir, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_direct", XS_Sys__Guestfs_set_direct, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_e2attrs", XS_Sys__Guestfs_set_e2attrs, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::set_e2generation", XS_Sys__Guestfs_set_e2generation, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::set_e2label", XS_Sys__Guestfs_set_e2label, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::set_e2uuid", XS_Sys__Guestfs_set_e2uuid, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::set_hv", XS_Sys__Guestfs_set_hv, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_identifier", XS_Sys__Guestfs_set_identifier, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_label", XS_Sys__Guestfs_set_label, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::set_libvirt_requested_credential", XS_Sys__Guestfs_set_libvirt_requested_credential, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::set_libvirt_supported_credentials", XS_Sys__Guestfs_set_libvirt_supported_credentials, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_memsize", XS_Sys__Guestfs_set_memsize, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_network", XS_Sys__Guestfs_set_network, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_path", XS_Sys__Guestfs_set_path, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_pgroup", XS_Sys__Guestfs_set_pgroup, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_program", XS_Sys__Guestfs_set_program, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_qemu", XS_Sys__Guestfs_set_qemu, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_recovery_proc", XS_Sys__Guestfs_set_recovery_proc, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_selinux", XS_Sys__Guestfs_set_selinux, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_smp", XS_Sys__Guestfs_set_smp, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_tmpdir", XS_Sys__Guestfs_set_tmpdir, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_trace", XS_Sys__Guestfs_set_trace, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_uuid", XS_Sys__Guestfs_set_uuid, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::set_uuid_random", XS_Sys__Guestfs_set_uuid_random, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::set_verbose", XS_Sys__Guestfs_set_verbose, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::setcon", XS_Sys__Guestfs_setcon, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::setfiles", XS_Sys__Guestfs_setfiles, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::setxattr", XS_Sys__Guestfs_setxattr, file, "$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::sfdisk", XS_Sys__Guestfs_sfdisk, file, "$$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::sfdiskM", XS_Sys__Guestfs_sfdiskM, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::sfdisk_N", XS_Sys__Guestfs_sfdisk_N, file, "$$$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::sfdisk_disk_geometry", XS_Sys__Guestfs_sfdisk_disk_geometry, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::sfdisk_kernel_geometry", XS_Sys__Guestfs_sfdisk_kernel_geometry, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::sfdisk_l", XS_Sys__Guestfs_sfdisk_l, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::sh", XS_Sys__Guestfs_sh, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::sh_lines", XS_Sys__Guestfs_sh_lines, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::sh_out", XS_Sys__Guestfs_sh_out, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::shutdown", XS_Sys__Guestfs_shutdown, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::sleep", XS_Sys__Guestfs_sleep, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::stat", XS_Sys__Guestfs_stat, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::statns", XS_Sys__Guestfs_statns, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::statvfs", XS_Sys__Guestfs_statvfs, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::strings", XS_Sys__Guestfs_strings, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::strings_e", XS_Sys__Guestfs_strings_e, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::swapoff_device", XS_Sys__Guestfs_swapoff_device, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::swapoff_file", XS_Sys__Guestfs_swapoff_file, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::swapoff_label", XS_Sys__Guestfs_swapoff_label, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::swapoff_uuid", XS_Sys__Guestfs_swapoff_uuid, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::swapon_device", XS_Sys__Guestfs_swapon_device, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::swapon_file", XS_Sys__Guestfs_swapon_file, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::swapon_label", XS_Sys__Guestfs_swapon_label, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::swapon_uuid", XS_Sys__Guestfs_swapon_uuid, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::sync", XS_Sys__Guestfs_sync, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::syslinux", XS_Sys__Guestfs_syslinux, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::tail", XS_Sys__Guestfs_tail, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::tail_n", XS_Sys__Guestfs_tail_n, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::tar_in", XS_Sys__Guestfs_tar_in, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::tar_out", XS_Sys__Guestfs_tar_out, file, "$$$;@");
        (void)newXSproto_portable("Sys::Guestfs::tgz_in", XS_Sys__Guestfs_tgz_in, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::tgz_out", XS_Sys__Guestfs_tgz_out, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::touch", XS_Sys__Guestfs_touch, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::truncate", XS_Sys__Guestfs_truncate, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::truncate_size", XS_Sys__Guestfs_truncate_size, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::tune2fs", XS_Sys__Guestfs_tune2fs, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::tune2fs_l", XS_Sys__Guestfs_tune2fs_l, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::txz_in", XS_Sys__Guestfs_txz_in, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::txz_out", XS_Sys__Guestfs_txz_out, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::umask", XS_Sys__Guestfs_umask, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::umount", XS_Sys__Guestfs_umount, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::umount_all", XS_Sys__Guestfs_umount_all, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::umount_local", XS_Sys__Guestfs_umount_local, file, "$;@");
        (void)newXSproto_portable("Sys::Guestfs::upload", XS_Sys__Guestfs_upload, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::upload_offset", XS_Sys__Guestfs_upload_offset, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::user_cancel", XS_Sys__Guestfs_user_cancel, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::utimens", XS_Sys__Guestfs_utimens, file, "$$$$$$");
        (void)newXSproto_portable("Sys::Guestfs::utsname", XS_Sys__Guestfs_utsname, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::version", XS_Sys__Guestfs_version, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::vfs_label", XS_Sys__Guestfs_vfs_label, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::vfs_minimum_size", XS_Sys__Guestfs_vfs_minimum_size, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::vfs_type", XS_Sys__Guestfs_vfs_type, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::vfs_uuid", XS_Sys__Guestfs_vfs_uuid, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::vg_activate", XS_Sys__Guestfs_vg_activate, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::vg_activate_all", XS_Sys__Guestfs_vg_activate_all, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::vgchange_uuid", XS_Sys__Guestfs_vgchange_uuid, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::vgchange_uuid_all", XS_Sys__Guestfs_vgchange_uuid_all, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::vgcreate", XS_Sys__Guestfs_vgcreate, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::vglvuuids", XS_Sys__Guestfs_vglvuuids, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::vgmeta", XS_Sys__Guestfs_vgmeta, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::vgpvuuids", XS_Sys__Guestfs_vgpvuuids, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::vgremove", XS_Sys__Guestfs_vgremove, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::vgrename", XS_Sys__Guestfs_vgrename, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::vgs", XS_Sys__Guestfs_vgs, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::vgs_full", XS_Sys__Guestfs_vgs_full, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::vgscan", XS_Sys__Guestfs_vgscan, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::vguuid", XS_Sys__Guestfs_vguuid, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::wait_ready", XS_Sys__Guestfs_wait_ready, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::wc_c", XS_Sys__Guestfs_wc_c, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::wc_l", XS_Sys__Guestfs_wc_l, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::wc_w", XS_Sys__Guestfs_wc_w, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::wipefs", XS_Sys__Guestfs_wipefs, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::write", XS_Sys__Guestfs_write, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::write_append", XS_Sys__Guestfs_write_append, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::write_file", XS_Sys__Guestfs_write_file, file, "$$$$");
        (void)newXSproto_portable("Sys::Guestfs::xfs_admin", XS_Sys__Guestfs_xfs_admin, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::xfs_growfs", XS_Sys__Guestfs_xfs_growfs, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::xfs_info", XS_Sys__Guestfs_xfs_info, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::xfs_info2", XS_Sys__Guestfs_xfs_info2, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::xfs_repair", XS_Sys__Guestfs_xfs_repair, file, "$$;@");
        (void)newXSproto_portable("Sys::Guestfs::yara_destroy", XS_Sys__Guestfs_yara_destroy, file, "$");
        (void)newXSproto_portable("Sys::Guestfs::yara_load", XS_Sys__Guestfs_yara_load, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::yara_scan", XS_Sys__Guestfs_yara_scan, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::zegrep", XS_Sys__Guestfs_zegrep, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::zegrepi", XS_Sys__Guestfs_zegrepi, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::zero", XS_Sys__Guestfs_zero, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::zero_device", XS_Sys__Guestfs_zero_device, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::zero_free_space", XS_Sys__Guestfs_zero_free_space, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::zerofree", XS_Sys__Guestfs_zerofree, file, "$$");
        (void)newXSproto_portable("Sys::Guestfs::zfgrep", XS_Sys__Guestfs_zfgrep, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::zfgrepi", XS_Sys__Guestfs_zfgrepi, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::zfile", XS_Sys__Guestfs_zfile, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::zgrep", XS_Sys__Guestfs_zgrep, file, "$$$");
        (void)newXSproto_portable("Sys::Guestfs::zgrepi", XS_Sys__Guestfs_zgrepi, file, "$$$");
#if PERL_VERSION_LE(5, 21, 5)
#  if PERL_VERSION_GE(5, 9, 0)
    if (PL_unitcheckav)
        call_list(PL_scopestack_ix, PL_unitcheckav);
#  endif
    XSRETURN_YES;
#else
    Perl_xs_boot_epilog(aTHX_ ax);
#endif
}

#ifdef __cplusplus
}
#endif
