/* libvirt-system-importer.c generated by valac 0.36.1.38-6532, the Vala compiler
 * generated from libvirt-system-importer.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <glib.h>
#include <glib-object.h>
#include <libvirt-gobject/libvirt-gobject.h>
#include <stdlib.h>
#include <string.h>
#include <libvirt-gconfig/libvirt-gconfig.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <libcommon.h>


#define BOXES_TYPE_LIBVIRT_SYSTEM_IMPORTER (boxes_libvirt_system_importer_get_type ())
#define BOXES_LIBVIRT_SYSTEM_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_SYSTEM_IMPORTER, BoxesLibvirtSystemImporter))
#define BOXES_LIBVIRT_SYSTEM_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_SYSTEM_IMPORTER, BoxesLibvirtSystemImporterClass))
#define BOXES_IS_LIBVIRT_SYSTEM_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_SYSTEM_IMPORTER))
#define BOXES_IS_LIBVIRT_SYSTEM_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_SYSTEM_IMPORTER))
#define BOXES_LIBVIRT_SYSTEM_IMPORTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_SYSTEM_IMPORTER, BoxesLibvirtSystemImporterClass))

typedef struct _BoxesLibvirtSystemImporter BoxesLibvirtSystemImporter;
typedef struct _BoxesLibvirtSystemImporterClass BoxesLibvirtSystemImporterClass;
typedef struct _BoxesLibvirtSystemImporterPrivate BoxesLibvirtSystemImporterPrivate;
enum  {
	BOXES_LIBVIRT_SYSTEM_IMPORTER_DUMMY_PROPERTY,
	BOXES_LIBVIRT_SYSTEM_IMPORTER_WIZARD_MENU_LABEL,
	BOXES_LIBVIRT_SYSTEM_IMPORTER_WIZARD_REVIEW_LABEL,
	BOXES_LIBVIRT_SYSTEM_IMPORTER_LAST_PROPERTY
};
static GParamSpec* boxes_libvirt_system_importer_properties[BOXES_LIBVIRT_SYSTEM_IMPORTER_LAST_PROPERTY];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _BoxesLibvirtSystemImporterNewData BoxesLibvirtSystemImporterNewData;
typedef struct _BoxesLibvirtSystemImporterImportData BoxesLibvirtSystemImporterImportData;

#define BOXES_TYPE_INSTALLER_MEDIA (boxes_installer_media_get_type ())
#define BOXES_INSTALLER_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_INSTALLER_MEDIA, BoxesInstallerMedia))
#define BOXES_INSTALLER_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_INSTALLER_MEDIA, BoxesInstallerMediaClass))
#define BOXES_IS_INSTALLER_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_INSTALLER_MEDIA))
#define BOXES_IS_INSTALLER_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_INSTALLER_MEDIA))
#define BOXES_INSTALLER_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_INSTALLER_MEDIA, BoxesInstallerMediaClass))

typedef struct _BoxesInstallerMedia BoxesInstallerMedia;
typedef struct _BoxesInstallerMediaClass BoxesInstallerMediaClass;

#define BOXES_TYPE_INSTALLED_MEDIA (boxes_installed_media_get_type ())
#define BOXES_INSTALLED_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_INSTALLED_MEDIA, BoxesInstalledMedia))
#define BOXES_INSTALLED_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_INSTALLED_MEDIA, BoxesInstalledMediaClass))
#define BOXES_IS_INSTALLED_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_INSTALLED_MEDIA))
#define BOXES_IS_INSTALLED_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_INSTALLED_MEDIA))
#define BOXES_INSTALLED_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_INSTALLED_MEDIA, BoxesInstalledMediaClass))

typedef struct _BoxesInstalledMedia BoxesInstalledMedia;
typedef struct _BoxesInstalledMediaClass BoxesInstalledMediaClass;

#define BOXES_TYPE_LIBVIRT_MEDIA (boxes_libvirt_media_get_type ())
#define BOXES_LIBVIRT_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_MEDIA, BoxesLibvirtMedia))
#define BOXES_LIBVIRT_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_MEDIA, BoxesLibvirtMediaClass))
#define BOXES_IS_LIBVIRT_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_MEDIA))
#define BOXES_IS_LIBVIRT_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_MEDIA))
#define BOXES_LIBVIRT_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_MEDIA, BoxesLibvirtMediaClass))

typedef struct _BoxesLibvirtMedia BoxesLibvirtMedia;
typedef struct _BoxesLibvirtMediaClass BoxesLibvirtMediaClass;

#define BOXES_TYPE_VM_CREATOR (boxes_vm_creator_get_type ())
#define BOXES_VM_CREATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_VM_CREATOR, BoxesVMCreator))
#define BOXES_VM_CREATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_VM_CREATOR, BoxesVMCreatorClass))
#define BOXES_IS_VM_CREATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_VM_CREATOR))
#define BOXES_IS_VM_CREATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_VM_CREATOR))
#define BOXES_VM_CREATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_VM_CREATOR, BoxesVMCreatorClass))

typedef struct _BoxesVMCreator BoxesVMCreator;
typedef struct _BoxesVMCreatorClass BoxesVMCreatorClass;

#define BOXES_TYPE_COLLECTION_ITEM (boxes_collection_item_get_type ())
#define BOXES_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItem))
#define BOXES_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))
#define BOXES_IS_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_IS_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_COLLECTION_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))

typedef struct _BoxesCollectionItem BoxesCollectionItem;
typedef struct _BoxesCollectionItemClass BoxesCollectionItemClass;

#define BOXES_TYPE_MACHINE (boxes_machine_get_type ())
#define BOXES_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MACHINE, BoxesMachine))
#define BOXES_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MACHINE, BoxesMachineClass))
#define BOXES_IS_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MACHINE))
#define BOXES_IS_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MACHINE))
#define BOXES_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MACHINE, BoxesMachineClass))

typedef struct _BoxesMachine BoxesMachine;
typedef struct _BoxesMachineClass BoxesMachineClass;

#define BOXES_TYPE_LIBVIRT_MACHINE (boxes_libvirt_machine_get_type ())
#define BOXES_LIBVIRT_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachine))
#define BOXES_LIBVIRT_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachineClass))
#define BOXES_IS_LIBVIRT_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_MACHINE))
#define BOXES_IS_LIBVIRT_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_MACHINE))
#define BOXES_LIBVIRT_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachineClass))

typedef struct _BoxesLibvirtMachine BoxesLibvirtMachine;
typedef struct _BoxesLibvirtMachineClass BoxesLibvirtMachineClass;
#define _boxes_vm_creator_unref0(var) ((var == NULL) ? NULL : (var = (boxes_vm_creator_unref (var), NULL)))
typedef struct _BoxesLibvirtSystemImporterImportDomainData BoxesLibvirtSystemImporterImportDomainData;
typedef struct _BoxesLibvirtSystemImporterEnsureDisksReadableData BoxesLibvirtSystemImporterEnsureDisksReadableData;

typedef enum  {
	BOXES_LIBVIRT_SYSTEM_IMPORTER_ERROR_NO_IMPORTS,
	BOXES_LIBVIRT_SYSTEM_IMPORTER_ERROR_NO_SUITABLE_DISK
} BoxesLibvirtSystemImporterError;
#define BOXES_LIBVIRT_SYSTEM_IMPORTER_ERROR boxes_libvirt_system_importer_error_quark ()
struct _BoxesLibvirtSystemImporter {
	GObject parent_instance;
	BoxesLibvirtSystemImporterPrivate * priv;
};

struct _BoxesLibvirtSystemImporterClass {
	GObjectClass parent_class;
};

struct _BoxesLibvirtSystemImporterPrivate {
	GVirConnection* connection;
	GList* domains;
	gchar** disk_paths;
	gint disk_paths_length1;
	gint _disk_paths_size_;
	GVirConfigDomain** configs;
	gint configs_length1;
	gint _configs_size_;
};

struct _BoxesLibvirtSystemImporterNewData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gboolean _task_complete_;
	GType object_type;
	BoxesLibvirtSystemImporter* self;
	GVirConnection* _tmp0_;
	GVirConnection* _tmp1_;
	GVirConnection* _tmp2_;
	GList* domains;
	GVirConnection* _tmp3_;
	GList* _tmp4_;
	GList* _tmp5_;
	GList* domain_collection;
	GList* domain_it;
	GVirDomain* _tmp6_;
	GVirDomain* domain;
	gchar* disk_path;
	GVirConfigDomain* config;
	GVirConfigDomain* _tmp7_;
	GVirDomain* _tmp8_;
	GVirConfigDomain* _tmp9_;
	gchar* _tmp10_;
	GFile* file;
	const gchar* _tmp11_;
	GFile* _tmp12_;
	GFile* _tmp13_;
	gboolean _tmp14_;
	GVirDomain* _tmp15_;
	GVirDomain* _tmp16_;
	gchar** _tmp17_;
	gint _tmp17__length1;
	const gchar* _tmp18_;
	gchar* _tmp19_;
	GVirConfigDomain** _tmp20_;
	gint _tmp20__length1;
	GVirConfigDomain* _tmp21_;
	GVirConfigDomain* _tmp22_;
	GVirDomain* _tmp23_;
	const gchar* _tmp24_;
	GError* _error_;
	GError* _tmp25_;
	const gchar* _tmp26_;
	GList* _tmp27_;
	guint _tmp28_;
	GList* _tmp29_;
	guint _tmp30_;
	GError* _tmp31_;
	GError * _inner_error_;
};

struct _BoxesLibvirtSystemImporterImportData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gboolean _task_complete_;
	BoxesLibvirtSystemImporter* self;
	gchar** _tmp0_;
	gint _tmp0__length1;
	GError* _error_;
	GError* _tmp1_;
	const gchar* _tmp2_;
	gint i;
	gboolean _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	GVirConfigDomain** _tmp6_;
	gint _tmp6__length1;
	GVirConfigDomain** _tmp7_;
	gint _tmp7__length1;
	gint _tmp8_;
	GVirConfigDomain* _tmp9_;
	gchar** _tmp10_;
	gint _tmp10__length1;
	gint _tmp11_;
	const gchar* _tmp12_;
	GError * _inner_error_;
};

struct _BoxesLibvirtSystemImporterImportDomainData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gboolean _task_complete_;
	BoxesLibvirtSystemImporter* self;
	GVirConfigDomain* config;
	gchar* disk_path;
	GCancellable* cancellable;
	GVirConfigDomain* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	BoxesLibvirtMedia* media;
	const gchar* _tmp3_;
	GVirConfigDomain* _tmp4_;
	BoxesLibvirtMedia* _tmp5_;
	BoxesVMCreator* vm_importer;
	BoxesLibvirtMedia* _tmp6_;
	BoxesVMCreator* _tmp7_;
	BoxesLibvirtMachine* machine;
	BoxesVMCreator* _tmp8_;
	GCancellable* _tmp9_;
	BoxesLibvirtMachine* _tmp10_;
	BoxesVMCreator* _tmp11_;
	BoxesLibvirtMachine* _tmp12_;
	GError* _error_;
	GVirConfigDomain* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	GError* _tmp16_;
	const gchar* _tmp17_;
	GError * _inner_error_;
};

struct _BoxesLibvirtSystemImporterEnsureDisksReadableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gboolean _task_complete_;
	BoxesLibvirtSystemImporter* self;
	gchar** disk_paths;
	gint disk_paths_length1;
	gchar** argv;
	gchar** _tmp0_;
	gint argv_length1;
	gint _argv_size_;
	gchar** _tmp1_;
	gint _tmp1__length1;
	gchar* _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gchar* _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gchar* _tmp6_;
	gchar** _tmp7_;
	gint _tmp7__length1;
	gchar** disk_path_collection;
	gint disk_path_collection_length1;
	gint _disk_path_collection_size_;
	gint disk_path_it;
	gchar* _tmp8_;
	gchar* disk_path;
	GFile* file;
	const gchar* _tmp9_;
	GFile* _tmp10_;
	GFileInfo* info;
	GFile* _tmp11_;
	GFileInfo* _tmp12_;
	GFileInfo* _tmp13_;
	gboolean _tmp14_;
	const gchar* _tmp15_;
	gchar** _tmp16_;
	gint _tmp16__length1;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	gchar** _tmp19_;
	gint _tmp19__length1;
	gchar** _tmp20_;
	gint _tmp20__length1;
	GError * _inner_error_;
};


static gpointer boxes_libvirt_system_importer_parent_class = NULL;
extern GVirConnection* boxes_system_virt_connection;

GQuark boxes_libvirt_system_importer_error_quark (void);
GType boxes_libvirt_system_importer_get_type (void) G_GNUC_CONST;
#define BOXES_LIBVIRT_SYSTEM_IMPORTER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_LIBVIRT_SYSTEM_IMPORTER, BoxesLibvirtSystemImporterPrivate))
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void boxes_libvirt_system_importer_construct_data_free (gpointer _data);
void boxes_libvirt_system_importer_new (GAsyncReadyCallback _callback_, gpointer _user_data_);
BoxesLibvirtSystemImporter* boxes_libvirt_system_importer_new_finish (GAsyncResult* _res_, GError** error);
void boxes_libvirt_system_importer_construct (GType object_type, GAsyncReadyCallback _callback_, gpointer _user_data_);
BoxesLibvirtSystemImporter* boxes_libvirt_system_importer_construct_finish (GAsyncResult* _res_, GError** error);
static gboolean boxes_libvirt_system_importer_construct_co (BoxesLibvirtSystemImporterNewData* _data_);
void boxes_get_system_virt_connection (GAsyncReadyCallback _callback_, gpointer _user_data_);
GVirConnection* boxes_get_system_virt_connection_finish (GAsyncResult* _res_, GError** error);
static void boxes_libvirt_system_importer_new_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_libvirt_system_importer_get_domain_info (BoxesLibvirtSystemImporter* self, GVirDomain* domain, GVirConfigDomain* * config, gchar* * disk_path, GError** error);
static void _vala_array_add15 (gchar** * array, int* length, int* size, gchar* value);
static void _vala_array_add16 (GVirConfigDomain** * array, int* length, int* size, GVirConfigDomain* value);
static void boxes_libvirt_system_importer_import_data_free (gpointer _data);
void boxes_libvirt_system_importer_import (BoxesLibvirtSystemImporter* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_libvirt_system_importer_import_finish (BoxesLibvirtSystemImporter* self, GAsyncResult* _res_);
static gboolean boxes_libvirt_system_importer_import_co (BoxesLibvirtSystemImporterImportData* _data_);
static void boxes_libvirt_system_importer_ensure_disks_readable (BoxesLibvirtSystemImporter* self, gchar** disk_paths, int disk_paths_length1, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void boxes_libvirt_system_importer_ensure_disks_readable_finish (BoxesLibvirtSystemImporter* self, GAsyncResult* _res_, GError** error);
static void boxes_libvirt_system_importer_import_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_libvirt_system_importer_import_domain (BoxesLibvirtSystemImporter* self, GVirConfigDomain* config, const gchar* disk_path, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void boxes_libvirt_system_importer_import_domain_finish (BoxesLibvirtSystemImporter* self, GAsyncResult* _res_);
static gchar* boxes_libvirt_system_importer_get_disk_path (BoxesLibvirtSystemImporter* self, GVirConfigDomain* config, GError** error);
static void boxes_libvirt_system_importer_import_domain_data_free (gpointer _data);
static gboolean boxes_libvirt_system_importer_import_domain_co (BoxesLibvirtSystemImporterImportDomainData* _data_);
GType boxes_installer_media_get_type (void) G_GNUC_CONST;
GType boxes_installed_media_get_type (void) G_GNUC_CONST;
GType boxes_libvirt_media_get_type (void) G_GNUC_CONST;
BoxesLibvirtMedia* boxes_libvirt_media_new (const gchar* path, GVirConfigDomain* domain_config, gboolean known_qcow2, GError** error);
BoxesLibvirtMedia* boxes_libvirt_media_construct (GType object_type, const gchar* path, GVirConfigDomain* domain_config, gboolean known_qcow2, GError** error);
gpointer boxes_vm_creator_ref (gpointer instance);
void boxes_vm_creator_unref (gpointer instance);
GParamSpec* boxes_param_spec_vm_creator (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void boxes_value_set_vm_creator (GValue* value, gpointer v_object);
void boxes_value_take_vm_creator (GValue* value, gpointer v_object);
gpointer boxes_value_get_vm_creator (const GValue* value);
GType boxes_vm_creator_get_type (void) G_GNUC_CONST;
BoxesVMCreator* boxes_installer_media_get_vm_creator (BoxesInstallerMedia* self);
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GType boxes_machine_get_type (void) G_GNUC_CONST;
GType boxes_libvirt_machine_get_type (void) G_GNUC_CONST;
void boxes_vm_creator_create_vm (BoxesVMCreator* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
BoxesLibvirtMachine* boxes_vm_creator_create_vm_finish (BoxesVMCreator* self, GAsyncResult* _res_, GError** error);
static void boxes_libvirt_system_importer_import_domain_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void boxes_vm_creator_launch_vm (BoxesVMCreator* self, BoxesLibvirtMachine* machine, gint64 access_last_time, GError** error);
static void boxes_libvirt_system_importer_ensure_disks_readable_data_free (gpointer _data);
static gboolean boxes_libvirt_system_importer_ensure_disks_readable_co (BoxesLibvirtSystemImporterEnsureDisksReadableData* _data_);
static void _vala_array_add17 (gchar** * array, int* length, int* size, gchar* value);
static void _vala_array_add18 (gchar** * array, int* length, int* size, gchar* value);
static void _vala_array_add19 (gchar** * array, int* length, int* size, gchar* value);
static void boxes_libvirt_system_importer_ensure_disks_readable_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void _vala_array_add20 (gchar** * array, int* length, int* size, gchar* value);
gchar* boxes_libvirt_system_importer_get_wizard_menu_label (BoxesLibvirtSystemImporter* self);
gchar* boxes_libvirt_system_importer_get_wizard_review_label (BoxesLibvirtSystemImporter* self);
static void boxes_libvirt_system_importer_finalize (GObject * obj);
static void _vala_boxes_libvirt_system_importer_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


GQuark boxes_libvirt_system_importer_error_quark (void) {
#line 535 "/home/fborges/checkout/gnome-boxes/src/libvirt-machine.vala"
	return g_quark_from_static_string ("boxes_libvirt_system_importer_error-quark");
#line 378 "libvirt-system-importer.c"
}


static void _g_object_unref0_ (gpointer var) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
#line 385 "libvirt-system-importer.c"
}


static inline void _g_list_free__g_object_unref0_ (GList* self) {
#line 12 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
#line 392 "libvirt-system-importer.c"
}


static void boxes_libvirt_system_importer_construct_data_free (gpointer _data) {
	BoxesLibvirtSystemImporterNewData* _data_;
	_data_ = _data;
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_object_unref0 (_data_->self);
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_slice_free (BoxesLibvirtSystemImporterNewData, _data_);
#line 403 "libvirt-system-importer.c"
}


void boxes_libvirt_system_importer_construct (GType object_type, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesLibvirtSystemImporterNewData* _data_;
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_ = g_slice_new0 (BoxesLibvirtSystemImporterNewData);
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_callback_ == NULL) {
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_task_complete_ = TRUE;
#line 417 "libvirt-system-importer.c"
	}
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_system_importer_construct_data_free);
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->object_type = object_type;
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_libvirt_system_importer_construct_co (_data_);
#line 425 "libvirt-system-importer.c"
}


BoxesLibvirtSystemImporter* boxes_libvirt_system_importer_construct_finish (GAsyncResult* _res_, GError** error) {
	BoxesLibvirtSystemImporter* result;
	BoxesLibvirtSystemImporterNewData* _data_;
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (NULL == _data_) {
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return;
#line 438 "libvirt-system-importer.c"
	}
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_task_complete_ = TRUE;
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	result = _data_->self;
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->self = NULL;
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	return result;
#line 448 "libvirt-system-importer.c"
}


static void boxes_libvirt_system_importer_new_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesLibvirtSystemImporterNewData* _data_;
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_ = _user_data_;
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_source_object_ = source_object;
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_res_ = _res_;
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_task_complete_ = TRUE;
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_libvirt_system_importer_construct_co (_data_);
#line 464 "libvirt-system-importer.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 49 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	return self ? g_object_ref (self) : NULL;
#line 471 "libvirt-system-importer.c"
}


static void _vala_array_add15 (gchar** * array, int* length, int* size, gchar* value) {
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if ((*length) == (*size)) {
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 482 "libvirt-system-importer.c"
	}
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	(*array)[(*length)++] = value;
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	(*array)[*length] = NULL;
#line 488 "libvirt-system-importer.c"
}


static void _vala_array_add16 (GVirConfigDomain** * array, int* length, int* size, GVirConfigDomain* value) {
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if ((*length) == (*size)) {
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		*array = g_renew (GVirConfigDomain*, *array, (*size) + 1);
#line 499 "libvirt-system-importer.c"
	}
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	(*array)[(*length)++] = value;
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	(*array)[*length] = NULL;
#line 505 "libvirt-system-importer.c"
}


static gboolean boxes_libvirt_system_importer_construct_co (BoxesLibvirtSystemImporterNewData* _data_) {
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	switch (_data_->_state_) {
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case 0:
#line 514 "libvirt-system-importer.c"
		goto _state_0;
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case 1:
#line 518 "libvirt-system-importer.c"
		goto _state_1;
		default:
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_assert_not_reached ();
#line 523 "libvirt-system-importer.c"
	}
	_state_0:
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->self = (BoxesLibvirtSystemImporter*) g_object_new (_data_->object_type, NULL);
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_state_ = 1;
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_get_system_virt_connection (boxes_libvirt_system_importer_new_ready, _data_);
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	return FALSE;
#line 534 "libvirt-system-importer.c"
	_state_1:
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp1_ = boxes_get_system_virt_connection_finish (_data_->_res_, &_data_->_inner_error_);
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp0_ = _data_->_tmp1_;
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_object_unref (_data_->_async_result);
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return FALSE;
#line 548 "libvirt-system-importer.c"
	}
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp2_ = _data_->_tmp0_;
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp0_ = NULL;
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_object_unref0 (_data_->self->priv->connection);
#line 45 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->self->priv->connection = _data_->_tmp2_;
#line 47 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp3_ = boxes_system_virt_connection;
#line 47 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp4_ = gvir_connection_get_domains (_data_->_tmp3_);
#line 47 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->domains = _data_->_tmp4_;
#line 49 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp5_ = _data_->domains;
#line 566 "libvirt-system-importer.c"
	{
#line 49 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->domain_collection = _data_->_tmp5_;
#line 49 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		for (_data_->domain_it = _data_->domain_collection; _data_->domain_it != NULL; _data_->domain_it = _data_->domain_it->next) {
#line 49 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_data_->_tmp6_ = _g_object_ref0 ((GVirDomain*) _data_->domain_it->data);
#line 49 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_data_->domain = _data_->_tmp6_;
#line 576 "libvirt-system-importer.c"
			{
				{
#line 52 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp7_ = gvir_config_domain_new ();
#line 52 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->config = _data_->_tmp7_;
#line 54 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp8_ = _data_->domain;
#line 54 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp9_ = NULL;
#line 54 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp10_ = NULL;
#line 54 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					boxes_libvirt_system_importer_get_domain_info (_data_->self, _data_->_tmp8_, &_data_->_tmp9_, &_data_->_tmp10_, &_data_->_inner_error_);
#line 54 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_object_unref0 (_data_->config);
#line 54 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->config = _data_->_tmp9_;
#line 54 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_free0 (_data_->disk_path);
#line 54 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->disk_path = _data_->_tmp10_;
#line 54 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 54 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_g_object_unref0 (_data_->config);
#line 54 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_g_free0 (_data_->disk_path);
#line 605 "libvirt-system-importer.c"
						goto __catch127_g_error;
					}
#line 56 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp11_ = _data_->disk_path;
#line 56 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp12_ = g_file_new_for_path (_data_->_tmp11_);
#line 56 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->file = _data_->_tmp12_;
#line 57 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp13_ = _data_->file;
#line 57 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp14_ = g_file_query_exists (_data_->_tmp13_, NULL);
#line 57 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					if (_data_->_tmp14_) {
#line 58 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp15_ = _data_->domain;
#line 58 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp16_ = _g_object_ref0 (_data_->_tmp15_);
#line 58 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->self->priv->domains = g_list_append (_data_->self->priv->domains, _data_->_tmp16_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp17_ = _data_->self->priv->disk_paths;
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp17__length1 = _data_->self->priv->disk_paths_length1;
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp18_ = _data_->disk_path;
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp19_ = g_strdup (_data_->_tmp18_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_vala_array_add15 (&_data_->self->priv->disk_paths, &_data_->self->priv->disk_paths_length1, &_data_->self->priv->_disk_paths_size_, _data_->_tmp19_);
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp20_ = _data_->self->priv->configs;
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp20__length1 = _data_->self->priv->configs_length1;
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp21_ = _data_->config;
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp22_ = _g_object_ref0 (_data_->_tmp21_);
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_vala_array_add16 (&_data_->self->priv->configs, &_data_->self->priv->configs_length1, &_data_->self->priv->_configs_size_, _data_->_tmp22_);
#line 646 "libvirt-system-importer.c"
					} else {
#line 62 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp23_ = _data_->domain;
#line 62 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp24_ = gvir_domain_get_name (_data_->_tmp23_);
#line 62 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						g_debug ("libvirt-system-importer.vala:62: Could not find a valid disk image for" \
" %s", _data_->_tmp24_);
#line 654 "libvirt-system-importer.c"
					}
#line 50 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_object_unref0 (_data_->file);
#line 50 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_object_unref0 (_data_->config);
#line 50 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_free0 (_data_->disk_path);
#line 662 "libvirt-system-importer.c"
				}
				goto __finally127;
				__catch127_g_error:
				{
#line 50 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_error_ = _data_->_inner_error_;
#line 50 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_inner_error_ = NULL;
#line 65 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp25_ = _data_->_error_;
#line 65 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp26_ = _data_->_tmp25_->message;
#line 65 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					g_warning ("libvirt-system-importer.vala:65: %s", _data_->_tmp26_);
#line 50 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_error_free0 (_data_->_error_);
#line 679 "libvirt-system-importer.c"
				}
				__finally127:
#line 50 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 50 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 50 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_object_unref0 (_data_->domain);
#line 50 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					__g_list_free__g_object_unref0_0 (_data_->domains);
#line 50 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_object_unref0 (_data_->_tmp0_);
#line 50 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					g_object_unref (_data_->_async_result);
#line 50 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					return FALSE;
#line 696 "libvirt-system-importer.c"
				}
#line 49 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_g_object_unref0 (_data_->domain);
#line 700 "libvirt-system-importer.c"
			}
		}
	}
#line 69 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp27_ = _data_->self->priv->domains;
#line 69 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp28_ = g_list_length (_data_->_tmp27_);
#line 69 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_debug ("libvirt-system-importer.vala:69: Fetched %u domains from system libvir" \
"t.", _data_->_tmp28_);
#line 70 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp29_ = _data_->self->priv->domains;
#line 70 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp30_ = g_list_length (_data_->_tmp29_);
#line 70 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_data_->_tmp30_ == ((guint) 0)) {
#line 71 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp31_ = g_error_new_literal (BOXES_LIBVIRT_SYSTEM_IMPORTER_ERROR, BOXES_LIBVIRT_SYSTEM_IMPORTER_ERROR_NO_IMPORTS, _ ("No boxes to import"));
#line 71 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_inner_error_ = _data_->_tmp31_;
#line 71 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 71 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		__g_list_free__g_object_unref0_0 (_data_->domains);
#line 71 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_g_object_unref0 (_data_->_tmp0_);
#line 71 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_object_unref (_data_->_async_result);
#line 71 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return FALSE;
#line 730 "libvirt-system-importer.c"
	}
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	__g_list_free__g_object_unref0_0 (_data_->domains);
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_object_unref0 (_data_->_tmp0_);
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_data_->_state_ != 0) {
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 744 "libvirt-system-importer.c"
		}
	}
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_object_unref (_data_->_async_result);
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	return FALSE;
#line 751 "libvirt-system-importer.c"
}


void boxes_libvirt_system_importer_new (GAsyncReadyCallback _callback_, gpointer _user_data_) {
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_libvirt_system_importer_construct (BOXES_TYPE_LIBVIRT_SYSTEM_IMPORTER, _callback_, _user_data_);
#line 758 "libvirt-system-importer.c"
}


BoxesLibvirtSystemImporter* boxes_libvirt_system_importer_new_finish (GAsyncResult* _res_, GError** error) {
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	return boxes_libvirt_system_importer_construct_finish (_res_, error);
#line 765 "libvirt-system-importer.c"
}


static void boxes_libvirt_system_importer_import_data_free (gpointer _data) {
	BoxesLibvirtSystemImporterImportData* _data_;
	_data_ = _data;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_object_unref0 (_data_->self);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_slice_free (BoxesLibvirtSystemImporterImportData, _data_);
#line 776 "libvirt-system-importer.c"
}


void boxes_libvirt_system_importer_import (BoxesLibvirtSystemImporter* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesLibvirtSystemImporterImportData* _data_;
	BoxesLibvirtSystemImporter* _tmp0_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_ = g_slice_new0 (BoxesLibvirtSystemImporterImportData);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_callback_ == NULL) {
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_task_complete_ = TRUE;
#line 791 "libvirt-system-importer.c"
	}
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_system_importer_import_data_free);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->self = _tmp0_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_libvirt_system_importer_import_co (_data_);
#line 801 "libvirt-system-importer.c"
}


void boxes_libvirt_system_importer_import_finish (BoxesLibvirtSystemImporter* self, GAsyncResult* _res_) {
	BoxesLibvirtSystemImporterImportData* _data_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_task_complete_ = TRUE;
#line 811 "libvirt-system-importer.c"
}


static void boxes_libvirt_system_importer_import_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesLibvirtSystemImporterImportData* _data_;
#line 76 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_ = _user_data_;
#line 76 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_source_object_ = source_object;
#line 76 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_res_ = _res_;
#line 76 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_task_complete_ = TRUE;
#line 76 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_libvirt_system_importer_import_co (_data_);
#line 827 "libvirt-system-importer.c"
}


static gboolean boxes_libvirt_system_importer_import_co (BoxesLibvirtSystemImporterImportData* _data_) {
#line 74 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	switch (_data_->_state_) {
#line 74 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case 0:
#line 836 "libvirt-system-importer.c"
		goto _state_0;
#line 74 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case 1:
#line 840 "libvirt-system-importer.c"
		goto _state_1;
		default:
#line 74 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_assert_not_reached ();
#line 845 "libvirt-system-importer.c"
	}
	_state_0:
	{
#line 76 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp0_ = _data_->self->priv->disk_paths;
#line 76 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp0__length1 = _data_->self->priv->disk_paths_length1;
#line 76 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_state_ = 1;
#line 76 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		boxes_libvirt_system_importer_ensure_disks_readable (_data_->self, _data_->_tmp0_, _data_->_tmp0__length1, boxes_libvirt_system_importer_import_ready, _data_);
#line 76 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return FALSE;
#line 859 "libvirt-system-importer.c"
		_state_1:
#line 76 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		boxes_libvirt_system_importer_ensure_disks_readable_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
#line 76 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 865 "libvirt-system-importer.c"
			goto __catch128_g_error;
		}
	}
	goto __finally128;
	__catch128_g_error:
	{
#line 75 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_error_ = _data_->_inner_error_;
#line 75 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_inner_error_ = NULL;
#line 78 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp1_ = _data_->_error_;
#line 78 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp2_ = _data_->_tmp1_->message;
#line 78 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_warning ("libvirt-system-importer.vala:78: Failed to make all libvirt system dis" \
"ks readable: %s", _data_->_tmp2_);
#line 80 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_g_error_free0 (_data_->_error_);
#line 80 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 80 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		if (_data_->_state_ != 0) {
#line 80 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 80 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 892 "libvirt-system-importer.c"
			}
		}
#line 80 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_object_unref (_data_->_async_result);
#line 80 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return FALSE;
#line 899 "libvirt-system-importer.c"
	}
	__finally128:
#line 75 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 75 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 75 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_clear_error (&_data_->_inner_error_);
#line 75 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_object_unref (_data_->_async_result);
#line 75 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return FALSE;
#line 912 "libvirt-system-importer.c"
	}
	{
#line 83 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->i = 0;
#line 917 "libvirt-system-importer.c"
		{
#line 83 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_data_->_tmp3_ = TRUE;
#line 83 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			while (TRUE) {
#line 83 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				if (!_data_->_tmp3_) {
#line 83 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp4_ = _data_->i;
#line 83 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->i = _data_->_tmp4_ + 1;
#line 929 "libvirt-system-importer.c"
				}
#line 83 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp3_ = FALSE;
#line 83 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp5_ = _data_->i;
#line 83 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp6_ = _data_->self->priv->configs;
#line 83 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp6__length1 = _data_->self->priv->configs_length1;
#line 83 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				if (!(_data_->_tmp5_ < _data_->_tmp6__length1)) {
#line 83 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					break;
#line 943 "libvirt-system-importer.c"
				}
#line 84 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp7_ = _data_->self->priv->configs;
#line 84 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp7__length1 = _data_->self->priv->configs_length1;
#line 84 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp8_ = _data_->i;
#line 84 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp9_ = _data_->_tmp7_[_data_->_tmp8_];
#line 84 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp10_ = _data_->self->priv->disk_paths;
#line 84 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp10__length1 = _data_->self->priv->disk_paths_length1;
#line 84 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp11_ = _data_->i;
#line 84 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp12_ = _data_->_tmp10_[_data_->_tmp11_];
#line 84 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				boxes_libvirt_system_importer_import_domain (_data_->self, _data_->_tmp9_, _data_->_tmp12_, NULL, NULL, NULL);
#line 963 "libvirt-system-importer.c"
			}
		}
	}
#line 74 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 74 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_data_->_state_ != 0) {
#line 74 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 74 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 975 "libvirt-system-importer.c"
		}
	}
#line 74 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_object_unref (_data_->_async_result);
#line 74 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	return FALSE;
#line 982 "libvirt-system-importer.c"
}


static void boxes_libvirt_system_importer_get_domain_info (BoxesLibvirtSystemImporter* self, GVirDomain* domain, GVirConfigDomain* * config, gchar* * disk_path, GError** error) {
	GVirConfigDomain* _vala_config = NULL;
	gchar* _vala_disk_path = NULL;
	GVirDomain* _tmp0_;
	const gchar* _tmp1_;
	GVirConfigDomain* _tmp2_ = NULL;
	GVirDomain* _tmp3_;
	GVirConfigDomain* _tmp4_;
	GVirConfigDomain* _tmp5_;
	GVirDomain* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_ = NULL;
	GVirConfigDomain* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	GError * _inner_error_ = NULL;
#line 87 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_return_if_fail (self != NULL);
#line 87 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_return_if_fail (domain != NULL);
#line 90 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp0_ = domain;
#line 90 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp1_ = gvir_domain_get_name (_tmp0_);
#line 90 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_debug ("libvirt-system-importer.vala:90: Fetching config for '%s' from system " \
"libvirt.", _tmp1_);
#line 91 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp3_ = domain;
#line 91 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp4_ = gvir_domain_get_config (_tmp3_, (guint) GVIR_DOMAIN_XML_INACTIVE, &_inner_error_);
#line 91 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp2_ = _tmp4_;
#line 91 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 91 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_propagate_error (error, _inner_error_);
#line 91 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return;
#line 1024 "libvirt-system-importer.c"
	}
#line 91 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp5_ = _tmp2_;
#line 91 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp2_ = NULL;
#line 91 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_object_unref0 (_vala_config);
#line 91 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_vala_config = _tmp5_;
#line 92 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp6_ = domain;
#line 92 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp7_ = gvir_domain_get_name (_tmp6_);
#line 92 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_debug ("libvirt-system-importer.vala:92: Finding a suitable disk to import for" \
" '%s' from system libvirt.", _tmp7_);
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp9_ = _vala_config;
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp10_ = boxes_libvirt_system_importer_get_disk_path (self, _tmp9_, &_inner_error_);
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp8_ = _tmp10_;
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_propagate_error (error, _inner_error_);
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_g_object_unref0 (_tmp2_);
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return;
#line 1054 "libvirt-system-importer.c"
	}
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp11_ = _tmp8_;
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp8_ = NULL;
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_free0 (_vala_disk_path);
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_vala_disk_path = _tmp11_;
#line 87 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_free0 (_tmp8_);
#line 87 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_object_unref0 (_tmp2_);
#line 87 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (config) {
#line 87 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		*config = _vala_config;
#line 1072 "libvirt-system-importer.c"
	} else {
#line 87 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_g_object_unref0 (_vala_config);
#line 1076 "libvirt-system-importer.c"
	}
#line 87 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (disk_path) {
#line 87 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		*disk_path = _vala_disk_path;
#line 1082 "libvirt-system-importer.c"
	} else {
#line 87 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_g_free0 (_vala_disk_path);
#line 1086 "libvirt-system-importer.c"
	}
}


static void boxes_libvirt_system_importer_import_domain_data_free (gpointer _data) {
	BoxesLibvirtSystemImporterImportDomainData* _data_;
	_data_ = _data;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_object_unref0 (_data_->config);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_free0 (_data_->disk_path);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_object_unref0 (_data_->cancellable);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_object_unref0 (_data_->self);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_slice_free (BoxesLibvirtSystemImporterImportDomainData, _data_);
#line 1104 "libvirt-system-importer.c"
}


static void boxes_libvirt_system_importer_import_domain (BoxesLibvirtSystemImporter* self, GVirConfigDomain* config, const gchar* disk_path, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesLibvirtSystemImporterImportDomainData* _data_;
	BoxesLibvirtSystemImporter* _tmp0_;
	GVirConfigDomain* _tmp1_;
	GVirConfigDomain* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_;
	GCancellable* _tmp5_;
	GCancellable* _tmp6_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_ = g_slice_new0 (BoxesLibvirtSystemImporterImportDomainData);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_callback_ == NULL) {
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_task_complete_ = TRUE;
#line 1125 "libvirt-system-importer.c"
	}
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_system_importer_import_domain_data_free);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->self = _tmp0_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp1_ = config;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_object_unref0 (_data_->config);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->config = _tmp2_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp3_ = disk_path;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp4_ = g_strdup (_tmp3_);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_free0 (_data_->disk_path);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->disk_path = _tmp4_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp5_ = cancellable;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp6_ = _g_object_ref0 (_tmp5_);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_object_unref0 (_data_->cancellable);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->cancellable = _tmp6_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_libvirt_system_importer_import_domain_co (_data_);
#line 1159 "libvirt-system-importer.c"
}


static void boxes_libvirt_system_importer_import_domain_finish (BoxesLibvirtSystemImporter* self, GAsyncResult* _res_) {
	BoxesLibvirtSystemImporterImportDomainData* _data_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (NULL == _data_) {
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return;
#line 1171 "libvirt-system-importer.c"
	}
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_task_complete_ = TRUE;
#line 1175 "libvirt-system-importer.c"
}


static void boxes_libvirt_system_importer_import_domain_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesLibvirtSystemImporterImportDomainData* _data_;
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_ = _user_data_;
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_source_object_ = source_object;
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_res_ = _res_;
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_task_complete_ = TRUE;
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_libvirt_system_importer_import_domain_co (_data_);
#line 1191 "libvirt-system-importer.c"
}


static gboolean boxes_libvirt_system_importer_import_domain_co (BoxesLibvirtSystemImporterImportDomainData* _data_) {
#line 96 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	switch (_data_->_state_) {
#line 96 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case 0:
#line 1200 "libvirt-system-importer.c"
		goto _state_0;
#line 96 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case 1:
#line 1204 "libvirt-system-importer.c"
		goto _state_1;
		default:
#line 96 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_assert_not_reached ();
#line 1209 "libvirt-system-importer.c"
	}
	_state_0:
#line 99 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp0_ = _data_->config;
#line 99 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp1_ = gvir_config_domain_get_name (_data_->_tmp0_);
#line 99 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp2_ = _data_->_tmp1_;
#line 99 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_debug ("libvirt-system-importer.vala:99: Importing '%s' from system libvirt..", _data_->_tmp2_);
#line 1220 "libvirt-system-importer.c"
	{
#line 102 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp3_ = _data_->disk_path;
#line 102 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp4_ = _data_->config;
#line 102 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp5_ = boxes_libvirt_media_new (_data_->_tmp3_, _data_->_tmp4_, FALSE, &_data_->_inner_error_);
#line 102 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->media = _data_->_tmp5_;
#line 102 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 1232 "libvirt-system-importer.c"
			goto __catch129_g_error;
		}
#line 103 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp6_ = _data_->media;
#line 103 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp7_ = boxes_installer_media_get_vm_creator ((BoxesInstallerMedia*) _data_->_tmp6_);
#line 103 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->vm_importer = _data_->_tmp7_;
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp8_ = _data_->vm_importer;
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp9_ = _data_->cancellable;
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_state_ = 1;
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		boxes_vm_creator_create_vm (_data_->_tmp8_, _data_->_tmp9_, boxes_libvirt_system_importer_import_domain_ready, _data_);
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return FALSE;
#line 1251 "libvirt-system-importer.c"
		_state_1:
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp10_ = boxes_vm_creator_create_vm_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error_);
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->machine = _data_->_tmp10_;
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_boxes_vm_creator_unref0 (_data_->vm_importer);
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_g_object_unref0 (_data_->media);
#line 1263 "libvirt-system-importer.c"
			goto __catch129_g_error;
		}
#line 105 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp11_ = _data_->vm_importer;
#line 105 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp12_ = _data_->machine;
#line 105 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		boxes_vm_creator_launch_vm (_data_->_tmp11_, _data_->_tmp12_, (gint64) -1, &_data_->_inner_error_);
#line 105 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 105 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_g_object_unref0 (_data_->machine);
#line 105 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_boxes_vm_creator_unref0 (_data_->vm_importer);
#line 105 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_g_object_unref0 (_data_->media);
#line 1280 "libvirt-system-importer.c"
			goto __catch129_g_error;
		}
#line 101 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_g_object_unref0 (_data_->machine);
#line 101 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_boxes_vm_creator_unref0 (_data_->vm_importer);
#line 101 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_g_object_unref0 (_data_->media);
#line 1289 "libvirt-system-importer.c"
	}
	goto __finally129;
	__catch129_g_error:
	{
#line 101 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_error_ = _data_->_inner_error_;
#line 101 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_inner_error_ = NULL;
#line 107 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp13_ = _data_->config;
#line 107 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp14_ = gvir_config_domain_get_name (_data_->_tmp13_);
#line 107 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp15_ = _data_->_tmp14_;
#line 107 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp16_ = _data_->_error_;
#line 107 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp17_ = _data_->_tmp16_->message;
#line 107 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_warning ("libvirt-system-importer.vala:107: Failed to import '%s': %s", _data_->_tmp15_, _data_->_tmp17_);
#line 101 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_g_error_free0 (_data_->_error_);
#line 1312 "libvirt-system-importer.c"
	}
	__finally129:
#line 101 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 101 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 101 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_clear_error (&_data_->_inner_error_);
#line 101 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_object_unref (_data_->_async_result);
#line 101 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return FALSE;
#line 1325 "libvirt-system-importer.c"
	}
#line 96 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 96 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_data_->_state_ != 0) {
#line 96 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 96 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1335 "libvirt-system-importer.c"
		}
	}
#line 96 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_object_unref (_data_->_async_result);
#line 96 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	return FALSE;
#line 1342 "libvirt-system-importer.c"
}


static gchar* boxes_libvirt_system_importer_get_disk_path (BoxesLibvirtSystemImporter* self, GVirConfigDomain* config, GError** error) {
	gchar* result = NULL;
	gchar* disk_path = NULL;
	GList* devices = NULL;
	GVirConfigDomain* _tmp0_;
	GList* _tmp1_;
	GList* _tmp2_;
	const gchar* _tmp12_;
	GError * _inner_error_ = NULL;
#line 111 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 111 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_return_val_if_fail (config != NULL, NULL);
#line 112 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	disk_path = NULL;
#line 114 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp0_ = config;
#line 114 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp1_ = gvir_config_domain_get_devices (_tmp0_);
#line 114 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	devices = _tmp1_;
#line 115 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp2_ = devices;
#line 1369 "libvirt-system-importer.c"
	{
		GList* device_collection = NULL;
		GList* device_it = NULL;
#line 115 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		device_collection = _tmp2_;
#line 115 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		for (device_it = device_collection; device_it != NULL; device_it = device_it->next) {
#line 1377 "libvirt-system-importer.c"
			GVirConfigDomainDevice* _tmp3_;
			GVirConfigDomainDevice* device = NULL;
#line 115 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_tmp3_ = _g_object_ref0 ((GVirConfigDomainDevice*) device_it->data);
#line 115 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			device = _tmp3_;
#line 1384 "libvirt-system-importer.c"
			{
				GVirConfigDomainDevice* _tmp4_;
				GVirConfigDomainDisk* disk = NULL;
				GVirConfigDomainDevice* _tmp5_;
				GVirConfigDomainDisk* _tmp6_;
				GVirConfigDomainDisk* _tmp7_;
				GVirConfigDomainDiskGuestDeviceType _tmp8_;
#line 116 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_tmp4_ = device;
#line 116 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, gvir_config_domain_disk_get_type ())) {
#line 117 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_object_unref0 (device);
#line 117 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					continue;
#line 1400 "libvirt-system-importer.c"
				}
#line 119 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_tmp5_ = device;
#line 119 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, gvir_config_domain_disk_get_type ()) ? ((GVirConfigDomainDisk*) _tmp5_) : NULL);
#line 119 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				disk = _tmp6_;
#line 120 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_tmp7_ = disk;
#line 120 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_tmp8_ = gvir_config_domain_disk_get_guest_device_type (_tmp7_);
#line 120 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				if (_tmp8_ == GVIR_CONFIG_DOMAIN_DISK_GUEST_DEVICE_DISK) {
#line 1414 "libvirt-system-importer.c"
					GVirConfigDomainDisk* _tmp9_;
					const gchar* _tmp10_;
					gchar* _tmp11_;
#line 121 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_tmp9_ = disk;
#line 121 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_tmp10_ = gvir_config_domain_disk_get_source (_tmp9_);
#line 121 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_tmp11_ = g_strdup (_tmp10_);
#line 121 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_free0 (disk_path);
#line 121 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					disk_path = _tmp11_;
#line 123 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_object_unref0 (disk);
#line 123 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_object_unref0 (device);
#line 123 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					break;
#line 1434 "libvirt-system-importer.c"
				}
#line 115 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_g_object_unref0 (disk);
#line 115 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_g_object_unref0 (device);
#line 1440 "libvirt-system-importer.c"
			}
		}
	}
#line 127 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp12_ = disk_path;
#line 127 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_tmp12_ == NULL) {
#line 1448 "libvirt-system-importer.c"
		GVirConfigDomain* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		GError* _tmp16_;
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp13_ = config;
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp14_ = gvir_config_domain_get_name (_tmp13_);
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp15_ = _tmp14_;
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp16_ = g_error_new (BOXES_LIBVIRT_SYSTEM_IMPORTER_ERROR, BOXES_LIBVIRT_SYSTEM_IMPORTER_ERROR_NO_SUITABLE_DISK, _ ("Failed to find suitable disk to import for box “%s”"), _tmp15_);
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_inner_error_ = _tmp16_;
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		if (_inner_error_->domain == BOXES_LIBVIRT_SYSTEM_IMPORTER_ERROR) {
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			g_propagate_error (error, _inner_error_);
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			__g_list_free__g_object_unref0_0 (devices);
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_g_free0 (disk_path);
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			return NULL;
#line 1473 "libvirt-system-importer.c"
		} else {
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			__g_list_free__g_object_unref0_0 (devices);
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_g_free0 (disk_path);
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			g_clear_error (&_inner_error_);
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			return NULL;
#line 1485 "libvirt-system-importer.c"
		}
	}
#line 131 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	result = disk_path;
#line 131 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	__g_list_free__g_object_unref0_0 (devices);
#line 131 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	return result;
#line 1494 "libvirt-system-importer.c"
}


static void boxes_libvirt_system_importer_ensure_disks_readable_data_free (gpointer _data) {
	BoxesLibvirtSystemImporterEnsureDisksReadableData* _data_;
	_data_ = _data;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_object_unref0 (_data_->self);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_slice_free (BoxesLibvirtSystemImporterEnsureDisksReadableData, _data_);
#line 1505 "libvirt-system-importer.c"
}


static void boxes_libvirt_system_importer_ensure_disks_readable (BoxesLibvirtSystemImporter* self, gchar** disk_paths, int disk_paths_length1, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesLibvirtSystemImporterEnsureDisksReadableData* _data_;
	BoxesLibvirtSystemImporter* _tmp0_;
	gchar** _tmp1_;
	gint _tmp1__length1;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_ = g_slice_new0 (BoxesLibvirtSystemImporterEnsureDisksReadableData);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_callback_ == NULL) {
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_task_complete_ = TRUE;
#line 1522 "libvirt-system-importer.c"
	}
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_system_importer_ensure_disks_readable_data_free);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->self = _tmp0_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp1_ = disk_paths;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp1__length1 = disk_paths_length1;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->disk_paths = _tmp1_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->disk_paths_length1 = _tmp1__length1;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_libvirt_system_importer_ensure_disks_readable_co (_data_);
#line 1540 "libvirt-system-importer.c"
}


static void boxes_libvirt_system_importer_ensure_disks_readable_finish (BoxesLibvirtSystemImporter* self, GAsyncResult* _res_, GError** error) {
	BoxesLibvirtSystemImporterEnsureDisksReadableData* _data_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (NULL == _data_) {
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return;
#line 1552 "libvirt-system-importer.c"
	}
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_task_complete_ = TRUE;
#line 1556 "libvirt-system-importer.c"
}


static void _vala_array_add17 (gchar** * array, int* length, int* size, gchar* value) {
#line 137 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if ((*length) == (*size)) {
#line 137 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 137 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 1567 "libvirt-system-importer.c"
	}
#line 137 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	(*array)[(*length)++] = value;
#line 137 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	(*array)[*length] = NULL;
#line 1573 "libvirt-system-importer.c"
}


static void _vala_array_add18 (gchar** * array, int* length, int* size, gchar* value) {
#line 138 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if ((*length) == (*size)) {
#line 138 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 138 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 1584 "libvirt-system-importer.c"
	}
#line 138 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	(*array)[(*length)++] = value;
#line 138 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	(*array)[*length] = NULL;
#line 1590 "libvirt-system-importer.c"
}


static void _vala_array_add19 (gchar** * array, int* length, int* size, gchar* value) {
#line 139 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if ((*length) == (*size)) {
#line 139 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 139 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 1601 "libvirt-system-importer.c"
	}
#line 139 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	(*array)[(*length)++] = value;
#line 139 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	(*array)[*length] = NULL;
#line 1607 "libvirt-system-importer.c"
}


static void boxes_libvirt_system_importer_ensure_disks_readable_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesLibvirtSystemImporterEnsureDisksReadableData* _data_;
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_ = _user_data_;
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_source_object_ = source_object;
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_res_ = _res_;
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_task_complete_ = TRUE;
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_libvirt_system_importer_ensure_disks_readable_co (_data_);
#line 1623 "libvirt-system-importer.c"
}


static void _vala_array_add20 (gchar** * array, int* length, int* size, gchar* value) {
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if ((*length) == (*size)) {
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 1634 "libvirt-system-importer.c"
	}
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	(*array)[(*length)++] = value;
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	(*array)[*length] = NULL;
#line 1640 "libvirt-system-importer.c"
}


static gboolean boxes_libvirt_system_importer_ensure_disks_readable_co (BoxesLibvirtSystemImporterEnsureDisksReadableData* _data_) {
#line 134 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	switch (_data_->_state_) {
#line 134 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case 0:
#line 1649 "libvirt-system-importer.c"
		goto _state_0;
#line 134 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case 1:
#line 1653 "libvirt-system-importer.c"
		goto _state_1;
#line 134 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case 2:
#line 1657 "libvirt-system-importer.c"
		goto _state_2;
		default:
#line 134 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_assert_not_reached ();
#line 1662 "libvirt-system-importer.c"
	}
	_state_0:
#line 135 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp0_ = g_new0 (gchar*, 0 + 1);
#line 135 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->argv = _data_->_tmp0_;
#line 135 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->argv_length1 = 0;
#line 135 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_argv_size_ = _data_->argv_length1;
#line 137 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp1_ = _data_->argv;
#line 137 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp1__length1 = _data_->argv_length1;
#line 137 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp2_ = g_strdup ("pkexec");
#line 137 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_vala_array_add17 (&_data_->argv, &_data_->argv_length1, &_data_->_argv_size_, _data_->_tmp2_);
#line 138 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp3_ = _data_->argv;
#line 138 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp3__length1 = _data_->argv_length1;
#line 138 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp4_ = g_strdup ("chmod");
#line 138 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_vala_array_add18 (&_data_->argv, &_data_->argv_length1, &_data_->_argv_size_, _data_->_tmp4_);
#line 139 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp5_ = _data_->argv;
#line 139 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp5__length1 = _data_->argv_length1;
#line 139 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp6_ = g_strdup ("a+r");
#line 139 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_vala_array_add19 (&_data_->argv, &_data_->argv_length1, &_data_->_argv_size_, _data_->_tmp6_);
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp7_ = _data_->disk_paths;
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp7__length1 = _data_->disk_paths_length1;
#line 1701 "libvirt-system-importer.c"
	{
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->disk_path_collection_length1 = 0;
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_disk_path_collection_size_ = 0;
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->disk_path_collection = _data_->_tmp7_;
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->disk_path_collection_length1 = _data_->_tmp7__length1;
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		for (_data_->disk_path_it = 0; _data_->disk_path_it < _data_->_tmp7__length1; _data_->disk_path_it = _data_->disk_path_it + 1) {
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_data_->_tmp8_ = g_strdup (_data_->disk_path_collection[_data_->disk_path_it]);
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_data_->disk_path = _data_->_tmp8_;
#line 1717 "libvirt-system-importer.c"
			{
#line 142 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp9_ = _data_->disk_path;
#line 142 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp10_ = g_file_new_for_path (_data_->_tmp9_);
#line 142 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->file = _data_->_tmp10_;
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp11_ = _data_->file;
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_state_ = 1;
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				g_file_query_info_async (_data_->_tmp11_, G_FILE_ATTRIBUTE_ACCESS_CAN_READ, G_FILE_QUERY_INFO_NONE, G_PRIORITY_DEFAULT, NULL, boxes_libvirt_system_importer_ensure_disks_readable_ready, _data_);
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				return FALSE;
#line 1733 "libvirt-system-importer.c"
				_state_1:
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp12_ = g_file_query_info_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error_);
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->info = _data_->_tmp12_;
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_object_unref0 (_data_->file);
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_free0 (_data_->disk_path);
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					g_object_unref (_data_->_async_result);
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					return FALSE;
#line 1753 "libvirt-system-importer.c"
				}
#line 147 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp13_ = _data_->info;
#line 147 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp14_ = g_file_info_get_attribute_boolean (_data_->_tmp13_, G_FILE_ATTRIBUTE_ACCESS_CAN_READ);
#line 147 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				if (!_data_->_tmp14_) {
#line 148 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp15_ = _data_->disk_path;
#line 148 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					g_debug ("libvirt-system-importer.vala:148: '%s' not readable, gotta make it rea" \
"dable..", _data_->_tmp15_);
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp16_ = _data_->argv;
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp16__length1 = _data_->argv_length1;
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp17_ = _data_->disk_path;
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp18_ = g_strdup (_data_->_tmp17_);
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_vala_array_add20 (&_data_->argv, &_data_->argv_length1, &_data_->_argv_size_, _data_->_tmp18_);
#line 1775 "libvirt-system-importer.c"
				}
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_g_object_unref0 (_data_->info);
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_g_object_unref0 (_data_->file);
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_g_free0 (_data_->disk_path);
#line 1783 "libvirt-system-importer.c"
			}
		}
	}
#line 153 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp19_ = _data_->argv;
#line 153 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp19__length1 = _data_->argv_length1;
#line 153 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_data_->_tmp19__length1 == 3) {
#line 154 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 154 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 154 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		if (_data_->_state_ != 0) {
#line 154 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 154 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1803 "libvirt-system-importer.c"
			}
		}
#line 154 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_object_unref (_data_->_async_result);
#line 154 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return FALSE;
#line 1810 "libvirt-system-importer.c"
	}
#line 156 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_debug ("libvirt-system-importer.vala:156: Making all libvirt system disks read" \
"able..");
#line 157 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp20_ = _data_->argv;
#line 157 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp20__length1 = _data_->argv_length1;
#line 157 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_state_ = 2;
#line 157 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_exec (_data_->_tmp20_, _data_->_tmp20__length1, NULL, boxes_libvirt_system_importer_ensure_disks_readable_ready, _data_);
#line 157 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	return FALSE;
#line 1824 "libvirt-system-importer.c"
	_state_2:
#line 157 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_exec_finish (_data_->_res_, NULL, NULL, &_data_->_inner_error_);
#line 157 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 157 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 157 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 157 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_object_unref (_data_->_async_result);
#line 157 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return FALSE;
#line 1838 "libvirt-system-importer.c"
	}
#line 158 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_debug ("libvirt-system-importer.vala:158: Made all libvirt system disks readab" \
"le.");
#line 134 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 134 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 134 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_data_->_state_ != 0) {
#line 134 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 134 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1852 "libvirt-system-importer.c"
		}
	}
#line 134 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_object_unref (_data_->_async_result);
#line 134 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	return FALSE;
#line 1859 "libvirt-system-importer.c"
}


gchar* boxes_libvirt_system_importer_get_wizard_menu_label (BoxesLibvirtSystemImporter* self) {
	gchar* result;
	guint num_domains = 0U;
	GList* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
#line 17 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 18 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp0_ = self->priv->domains;
#line 18 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp1_ = g_list_length (_tmp0_);
#line 18 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	num_domains = _tmp1_;
#line 20 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp2_ = num_domains;
#line 20 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_tmp2_ == ((guint) 1)) {
#line 1881 "libvirt-system-importer.c"
		GList* _tmp3_;
		gconstpointer _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
#line 21 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp3_ = self->priv->domains;
#line 21 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp4_ = _tmp3_->data;
#line 21 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp5_ = gvir_domain_get_name ((GVirDomain*) _tmp4_);
#line 21 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp6_ = g_strdup_printf (_ ("_Import “%s” from system broker"), _tmp5_);
#line 21 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		result = _tmp6_;
#line 21 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return result;
#line 1898 "libvirt-system-importer.c"
	} else {
		guint _tmp7_;
		guint _tmp8_;
		gchar* _tmp9_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp7_ = num_domains;
#line 24 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp8_ = num_domains;
#line 24 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp9_ = g_strdup_printf (ngettext ("_Import %u box from system broker", "_Import %u boxes from system broker", (gulong) _tmp7_), _tmp8_);
#line 24 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		result = _tmp9_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return result;
#line 1913 "libvirt-system-importer.c"
	}
}


gchar* boxes_libvirt_system_importer_get_wizard_review_label (BoxesLibvirtSystemImporter* self) {
	gchar* result;
	guint num_domains = 0U;
	GList* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
#line 31 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 32 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp0_ = self->priv->domains;
#line 32 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp1_ = g_list_length (_tmp0_);
#line 32 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	num_domains = _tmp1_;
#line 34 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp2_ = num_domains;
#line 34 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_tmp2_ == ((guint) 1)) {
#line 1936 "libvirt-system-importer.c"
		GList* _tmp3_;
		gconstpointer _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
#line 35 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp3_ = self->priv->domains;
#line 35 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp4_ = _tmp3_->data;
#line 35 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp5_ = gvir_domain_get_name ((GVirDomain*) _tmp4_);
#line 35 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp6_ = g_strdup_printf (_ ("Will import “%s” from system broker"), _tmp5_);
#line 35 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		result = _tmp6_;
#line 35 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return result;
#line 1953 "libvirt-system-importer.c"
	} else {
		guint _tmp7_;
		guint _tmp8_;
		gchar* _tmp9_;
#line 38 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp7_ = num_domains;
#line 38 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp8_ = num_domains;
#line 38 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp9_ = g_strdup_printf (ngettext ("Will import %u box from system broker", "Will import %u boxes from system broker", (gulong) _tmp7_), _tmp8_);
#line 38 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		result = _tmp9_;
#line 38 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return result;
#line 1968 "libvirt-system-importer.c"
	}
}


static void boxes_libvirt_system_importer_class_init (BoxesLibvirtSystemImporterClass * klass) {
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_libvirt_system_importer_parent_class = g_type_class_peek_parent (klass);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_type_class_add_private (klass, sizeof (BoxesLibvirtSystemImporterPrivate));
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_libvirt_system_importer_get_property;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_libvirt_system_importer_finalize;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_SYSTEM_IMPORTER_WIZARD_MENU_LABEL, boxes_libvirt_system_importer_properties[BOXES_LIBVIRT_SYSTEM_IMPORTER_WIZARD_MENU_LABEL] = g_param_spec_string ("wizard-menu-label", "wizard-menu-label", "wizard-menu-label", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_SYSTEM_IMPORTER_WIZARD_REVIEW_LABEL, boxes_libvirt_system_importer_properties[BOXES_LIBVIRT_SYSTEM_IMPORTER_WIZARD_REVIEW_LABEL] = g_param_spec_string ("wizard-review-label", "wizard-review-label", "wizard-review-label", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 1986 "libvirt-system-importer.c"
}


static void boxes_libvirt_system_importer_instance_init (BoxesLibvirtSystemImporter * self) {
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	self->priv = BOXES_LIBVIRT_SYSTEM_IMPORTER_GET_PRIVATE (self);
#line 1993 "libvirt-system-importer.c"
}


static void boxes_libvirt_system_importer_finalize (GObject * obj) {
	BoxesLibvirtSystemImporter * self;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_LIBVIRT_SYSTEM_IMPORTER, BoxesLibvirtSystemImporter);
#line 10 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_object_unref0 (self->priv->connection);
#line 12 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	__g_list_free__g_object_unref0_0 (self->priv->domains);
#line 13 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	self->priv->disk_paths = (_vala_array_free (self->priv->disk_paths, self->priv->disk_paths_length1, (GDestroyNotify) g_free), NULL);
#line 14 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	self->priv->configs = (_vala_array_free (self->priv->configs, self->priv->configs_length1, (GDestroyNotify) g_object_unref), NULL);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	G_OBJECT_CLASS (boxes_libvirt_system_importer_parent_class)->finalize (obj);
#line 2011 "libvirt-system-importer.c"
}


GType boxes_libvirt_system_importer_get_type (void) {
	static volatile gsize boxes_libvirt_system_importer_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_libvirt_system_importer_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesLibvirtSystemImporterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_libvirt_system_importer_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesLibvirtSystemImporter), 0, (GInstanceInitFunc) boxes_libvirt_system_importer_instance_init, NULL };
		GType boxes_libvirt_system_importer_type_id;
		boxes_libvirt_system_importer_type_id = g_type_register_static (G_TYPE_OBJECT, "BoxesLibvirtSystemImporter", &g_define_type_info, 0);
		g_once_init_leave (&boxes_libvirt_system_importer_type_id__volatile, boxes_libvirt_system_importer_type_id);
	}
	return boxes_libvirt_system_importer_type_id__volatile;
}


static void _vala_boxes_libvirt_system_importer_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesLibvirtSystemImporter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_LIBVIRT_SYSTEM_IMPORTER, BoxesLibvirtSystemImporter);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	switch (property_id) {
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case BOXES_LIBVIRT_SYSTEM_IMPORTER_WIZARD_MENU_LABEL:
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_value_take_string (value, boxes_libvirt_system_importer_get_wizard_menu_label (self));
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		break;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case BOXES_LIBVIRT_SYSTEM_IMPORTER_WIZARD_REVIEW_LABEL:
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		g_value_take_string (value, boxes_libvirt_system_importer_get_wizard_review_label (self));
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		break;
#line 2044 "libvirt-system-importer.c"
		default:
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		break;
#line 2050 "libvirt-system-importer.c"
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
#line 535 "/home/fborges/checkout/gnome-boxes/src/libvirt-machine.vala"
	if ((array != NULL) && (destroy_func != NULL)) {
#line 2058 "libvirt-system-importer.c"
		int i;
#line 535 "/home/fborges/checkout/gnome-boxes/src/libvirt-machine.vala"
		for (i = 0; i < array_length; i = i + 1) {
#line 535 "/home/fborges/checkout/gnome-boxes/src/libvirt-machine.vala"
			if (((gpointer*) array)[i] != NULL) {
#line 535 "/home/fborges/checkout/gnome-boxes/src/libvirt-machine.vala"
				destroy_func (((gpointer*) array)[i]);
#line 2066 "libvirt-system-importer.c"
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
#line 535 "/home/fborges/checkout/gnome-boxes/src/libvirt-machine.vala"
	_vala_array_destroy (array, array_length, destroy_func);
#line 535 "/home/fborges/checkout/gnome-boxes/src/libvirt-machine.vala"
	g_free (array);
#line 2078 "libvirt-system-importer.c"
}



