/* libvirt-system-importer.c generated by valac 0.39.5, 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_0_PROPERTY,
	BOXES_LIBVIRT_SYSTEM_IMPORTER_WIZARD_MENU_LABEL_PROPERTY,
	BOXES_LIBVIRT_SYSTEM_IMPORTER_WIZARD_REVIEW_LABEL_PROPERTY,
	BOXES_LIBVIRT_SYSTEM_IMPORTER_NUM_PROPERTIES
};
static GParamSpec* boxes_libvirt_system_importer_properties[BOXES_LIBVIRT_SYSTEM_IMPORTER_NUM_PROPERTIES];
#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;
	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_;
	GVirDomain* _tmp14_;
	GVirDomain* _tmp15_;
	gchar** _tmp16_;
	gint _tmp16__length1;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	GVirConfigDomain** _tmp19_;
	gint _tmp19__length1;
	GVirConfigDomain* _tmp20_;
	GVirConfigDomain* _tmp21_;
	GVirDomain* _tmp22_;
	const gchar* _tmp23_;
	GError* _error_;
	GError* _tmp24_;
	const gchar* _tmp25_;
	GList* _tmp26_;
	GList* _tmp27_;
	GError* _tmp28_;
	GError * _inner_error_;
};

struct _BoxesLibvirtSystemImporterImportData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	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;
	BoxesLibvirtSystemImporter* self;
	GVirConfigDomain* config;
	gchar* disk_path;
	GCancellable* cancellable;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	BoxesLibvirtMedia* media;
	BoxesLibvirtMedia* _tmp2_;
	BoxesVMCreator* vm_importer;
	BoxesLibvirtMedia* _tmp3_;
	BoxesVMCreator* _tmp4_;
	BoxesLibvirtMachine* machine;
	BoxesVMCreator* _tmp5_;
	BoxesLibvirtMachine* _tmp6_;
	BoxesVMCreator* _tmp7_;
	BoxesLibvirtMachine* _tmp8_;
	GError* _error_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	GError* _tmp11_;
	const gchar* _tmp12_;
	GError * _inner_error_;
};

struct _BoxesLibvirtSystemImporterEnsureDisksReadableData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	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** disk_path_collection;
	gint disk_path_collection_length1;
	gint _disk_path_collection_size_;
	gint disk_path_it;
	gchar* _tmp7_;
	gchar* disk_path;
	GFile* file;
	const gchar* _tmp8_;
	GFile* _tmp9_;
	GFileInfo* info;
	GFile* _tmp10_;
	GFileInfo* _tmp11_;
	GFileInfo* _tmp12_;
	const gchar* _tmp13_;
	gchar** _tmp14_;
	gint _tmp14__length1;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar** _tmp17_;
	gint _tmp17__length1;
	gchar** _tmp18_;
	gint _tmp18__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_add18 (gchar** * array,
                        int* length,
                        int* size,
                        gchar* value);
static void _vala_array_add19 (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_add20 (gchar** * array,
                        int* length,
                        int* size,
                        gchar* value);
static void _vala_array_add21 (gchar** * array,
                        int* length,
                        int* size,
                        gchar* value);
static void _vala_array_add22 (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_add23 (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 447 "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 456 "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 465 "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 478 "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"
	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 498 "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 514 "libvirt-system-importer.c"
	}
#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 522 "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"
	boxes_libvirt_system_importer_construct_co (_data_);
#line 540 "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 549 "libvirt-system-importer.c"
}


static void
_vala_array_add18 (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 565 "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 571 "libvirt-system-importer.c"
}


static void
_vala_array_add19 (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 587 "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 593 "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 604 "libvirt-system-importer.c"
		goto _state_0;
#line 44 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case 1:
#line 608 "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 613 "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 624 "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 638 "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 656 "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 666 "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 695 "libvirt-system-importer.c"
						goto __catch131_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"
					if (g_file_query_exists (_data_->_tmp13_, NULL)) {
#line 58 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp14_ = _data_->domain;
#line 58 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp15_ = _g_object_ref0 (_data_->_tmp14_);
#line 58 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->self->priv->domains = g_list_append (_data_->self->priv->domains, _data_->_tmp15_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp16_ = _data_->self->priv->disk_paths;
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp16__length1 = _data_->self->priv->disk_paths_length1;
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp17_ = _data_->disk_path;
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp18_ = g_strdup (_data_->_tmp17_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_vala_array_add18 (&_data_->self->priv->disk_paths, &_data_->self->priv->disk_paths_length1, &_data_->self->priv->_disk_paths_size_, _data_->_tmp18_);
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp19_ = _data_->self->priv->configs;
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp19__length1 = _data_->self->priv->configs_length1;
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp20_ = _data_->config;
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp21_ = _g_object_ref0 (_data_->_tmp20_);
#line 60 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_vala_array_add19 (&_data_->self->priv->configs, &_data_->self->priv->configs_length1, &_data_->self->priv->_configs_size_, _data_->_tmp21_);
#line 734 "libvirt-system-importer.c"
					} else {
#line 62 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp22_ = _data_->domain;
#line 62 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
						_data_->_tmp23_ = gvir_domain_get_name (_data_->_tmp22_);
#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_->_tmp23_);
#line 742 "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 750 "libvirt-system-importer.c"
				}
				goto __finally131;
				__catch131_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_->_tmp24_ = _data_->_error_;
#line 65 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp25_ = _data_->_tmp24_->message;
#line 65 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					g_warning ("libvirt-system-importer.vala:65: %s", _data_->_tmp25_);
#line 50 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_g_error_free0 (_data_->_error_);
#line 767 "libvirt-system-importer.c"
				}
				__finally131:
#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 784 "libvirt-system-importer.c"
				}
#line 49 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_g_object_unref0 (_data_->domain);
#line 788 "libvirt-system-importer.c"
			}
		}
	}
#line 69 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp26_ = _data_->self->priv->domains;
#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.", g_list_length (_data_->_tmp26_));
#line 70 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp27_ = _data_->self->priv->domains;
#line 70 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (g_list_length (_data_->_tmp27_) == ((guint) 0)) {
#line 71 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp28_ = 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_->_tmp28_;
#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 814 "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 (g_task_get_completed (_data_->_async_result) != 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 828 "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 835 "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 845 "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 855 "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 868 "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"
	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 891 "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 902 "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"
	boxes_libvirt_system_importer_import_co (_data_);
#line 920 "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 931 "libvirt-system-importer.c"
		goto _state_0;
#line 74 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case 1:
#line 935 "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 940 "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 954 "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 960 "libvirt-system-importer.c"
			goto __catch132_g_error;
		}
	}
	goto __finally132;
	__catch132_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 (g_task_get_completed (_data_->_async_result) != 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 987 "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 994 "libvirt-system-importer.c"
	}
	__finally132:
#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 1007 "libvirt-system-importer.c"
	}
	{
#line 83 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->i = 0;
#line 1012 "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 1024 "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 1038 "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 1058 "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 (g_task_get_completed (_data_->_async_result) != 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 1070 "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 1077 "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;
	const gchar* _tmp0_;
	GVirConfigDomain* _tmp1_ = NULL;
	GVirConfigDomain* _tmp2_;
	GVirConfigDomain* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_ = NULL;
	GVirConfigDomain* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	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_ = gvir_domain_get_name (domain);
#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.", _tmp0_);
#line 91 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp2_ = gvir_domain_get_config (domain, (guint) GVIR_DOMAIN_XML_INACTIVE, &_inner_error_);
#line 91 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp1_ = _tmp2_;
#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 1118 "libvirt-system-importer.c"
	}
#line 91 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp3_ = _tmp1_;
#line 91 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp1_ = 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 = _tmp3_;
#line 92 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp4_ = gvir_domain_get_name (domain);
#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.", _tmp4_);
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp6_ = _vala_config;
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp7_ = boxes_libvirt_system_importer_get_disk_path (self, _tmp6_, &_inner_error_);
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp5_ = _tmp7_;
#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 (_tmp1_);
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return;
#line 1146 "libvirt-system-importer.c"
	}
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp8_ = _tmp5_;
#line 93 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp5_ = 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 = _tmp8_;
#line 87 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_free0 (_tmp5_);
#line 87 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_g_object_unref0 (_tmp1_);
#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 1164 "libvirt-system-importer.c"
	} else {
#line 87 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_g_object_unref0 (_vala_config);
#line 1168 "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 1174 "libvirt-system-importer.c"
	} else {
#line 87 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_g_free0 (_vala_disk_path);
#line 1178 "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 1198 "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_;
	gchar* _tmp2_;
	GCancellable* _tmp3_;
#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"
	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_ = _g_object_ref0 (config);
#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 = _tmp1_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp2_ = g_strdup (disk_path);
#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 = _tmp2_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp3_ = _g_object_ref0 (cancellable);
#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 = _tmp3_;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_libvirt_system_importer_import_domain_co (_data_);
#line 1245 "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 1260 "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"
	boxes_libvirt_system_importer_import_domain_co (_data_);
#line 1279 "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 1290 "libvirt-system-importer.c"
		goto _state_0;
#line 96 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case 1:
#line 1294 "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 1299 "libvirt-system-importer.c"
	}
	_state_0:
#line 99 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp0_ = gvir_config_domain_get_name (_data_->config);
#line 99 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp1_ = _data_->_tmp0_;
#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_->_tmp1_);
#line 1308 "libvirt-system-importer.c"
	{
#line 102 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp2_ = boxes_libvirt_media_new (_data_->disk_path, _data_->config, FALSE, &_data_->_inner_error_);
#line 102 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->media = _data_->_tmp2_;
#line 102 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 1316 "libvirt-system-importer.c"
			goto __catch133_g_error;
		}
#line 103 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp3_ = _data_->media;
#line 103 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp4_ = boxes_installer_media_get_vm_creator ((BoxesInstallerMedia*) _data_->_tmp3_);
#line 103 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->vm_importer = _data_->_tmp4_;
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp5_ = _data_->vm_importer;
#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_->_tmp5_, _data_->cancellable, boxes_libvirt_system_importer_import_domain_ready, _data_);
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return FALSE;
#line 1333 "libvirt-system-importer.c"
		_state_1:
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp6_ = boxes_vm_creator_create_vm_finish (_data_->_tmp5_, _data_->_res_, &_data_->_inner_error_);
#line 104 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->machine = _data_->_tmp6_;
#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 1345 "libvirt-system-importer.c"
			goto __catch133_g_error;
		}
#line 105 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp7_ = _data_->vm_importer;
#line 105 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp8_ = _data_->machine;
#line 105 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		boxes_vm_creator_launch_vm (_data_->_tmp7_, _data_->_tmp8_, (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 1362 "libvirt-system-importer.c"
			goto __catch133_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 1371 "libvirt-system-importer.c"
	}
	goto __finally133;
	__catch133_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_->_tmp9_ = gvir_config_domain_get_name (_data_->config);
#line 107 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp10_ = _data_->_tmp9_;
#line 107 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp11_ = _data_->_error_;
#line 107 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->_tmp12_ = _data_->_tmp11_->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_->_tmp10_, _data_->_tmp12_);
#line 101 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_g_error_free0 (_data_->_error_);
#line 1392 "libvirt-system-importer.c"
	}
	__finally133:
#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 1405 "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 (g_task_get_completed (_data_->_async_result) != 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 1415 "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 1422 "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;
	GList* _tmp0_;
	GList* _tmp1_;
	const gchar* _tmp10_;
	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_ = gvir_config_domain_get_devices (config);
#line 114 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	devices = _tmp0_;
#line 115 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp1_ = devices;
#line 1450 "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 = _tmp1_;
#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 1458 "libvirt-system-importer.c"
			GVirConfigDomainDevice* _tmp2_;
			GVirConfigDomainDevice* device = NULL;
#line 115 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_tmp2_ = _g_object_ref0 ((GVirConfigDomainDevice*) device_it->data);
#line 115 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			device = _tmp2_;
#line 1465 "libvirt-system-importer.c"
			{
				GVirConfigDomainDevice* _tmp3_;
				GVirConfigDomainDisk* disk = NULL;
				GVirConfigDomainDevice* _tmp4_;
				GVirConfigDomainDisk* _tmp5_;
				GVirConfigDomainDisk* _tmp6_;
#line 116 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_tmp3_ = device;
#line 116 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				if (!G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, 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 1480 "libvirt-system-importer.c"
				}
#line 119 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_tmp4_ = device;
#line 119 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, gvir_config_domain_disk_get_type ()) ? ((GVirConfigDomainDisk*) _tmp4_) : NULL);
#line 119 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				disk = _tmp5_;
#line 120 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_tmp6_ = disk;
#line 120 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				if (gvir_config_domain_disk_get_guest_device_type (_tmp6_) == GVIR_CONFIG_DOMAIN_DISK_GUEST_DEVICE_DISK) {
#line 1492 "libvirt-system-importer.c"
					GVirConfigDomainDisk* _tmp7_;
					const gchar* _tmp8_;
					gchar* _tmp9_;
#line 121 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_tmp7_ = disk;
#line 121 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_tmp8_ = gvir_config_domain_disk_get_source (_tmp7_);
#line 121 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_tmp9_ = g_strdup (_tmp8_);
#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 = _tmp9_;
#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 1512 "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 1518 "libvirt-system-importer.c"
			}
		}
	}
#line 127 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp10_ = disk_path;
#line 127 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_tmp10_ == NULL) {
#line 1526 "libvirt-system-importer.c"
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		GError* _tmp13_;
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp11_ = gvir_config_domain_get_name (config);
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp12_ = _tmp11_;
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp13_ = 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”"), _tmp12_);
#line 128 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_inner_error_ = _tmp13_;
#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 1548 "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 1560 "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 1569 "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 1582 "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_;
#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"
	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"
	_data_->disk_paths = disk_paths;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->disk_paths_length1 = disk_paths_length1;
#line 9 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	boxes_libvirt_system_importer_ensure_disks_readable_co (_data_);
#line 1611 "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 1627 "libvirt-system-importer.c"
	}
}


static void
_vala_array_add20 (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 1644 "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 1650 "libvirt-system-importer.c"
}


static void
_vala_array_add21 (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 1666 "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 1672 "libvirt-system-importer.c"
}


static void
_vala_array_add22 (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 1688 "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 1694 "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"
	boxes_libvirt_system_importer_ensure_disks_readable_co (_data_);
#line 1712 "libvirt-system-importer.c"
}


static void
_vala_array_add23 (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 1728 "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 1734 "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 1745 "libvirt-system-importer.c"
		goto _state_0;
#line 134 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case 1:
#line 1749 "libvirt-system-importer.c"
		goto _state_1;
#line 134 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		case 2:
#line 1753 "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 1758 "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_add20 (&_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_add21 (&_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_add22 (&_data_->argv, &_data_->argv_length1, &_data_->_argv_size_, _data_->_tmp6_);
#line 1793 "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_->disk_paths;
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_data_->disk_path_collection_length1 = _data_->disk_paths_length1;
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		for (_data_->disk_path_it = 0; _data_->disk_path_it < _data_->disk_paths_length1; _data_->disk_path_it = _data_->disk_path_it + 1) {
#line 141 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
			_data_->_tmp7_ = 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_->_tmp7_;
#line 1809 "libvirt-system-importer.c"
			{
#line 142 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp8_ = _data_->disk_path;
#line 142 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp9_ = g_file_new_for_path (_data_->_tmp8_);
#line 142 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->file = _data_->_tmp9_;
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp10_ = _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_->_tmp10_, 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 1825 "libvirt-system-importer.c"
				_state_1:
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp11_ = g_file_query_info_finish (_data_->_tmp10_, _data_->_res_, &_data_->_inner_error_);
#line 143 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->info = _data_->_tmp11_;
#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 1845 "libvirt-system-importer.c"
				}
#line 147 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				_data_->_tmp12_ = _data_->info;
#line 147 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
				if (!g_file_info_get_attribute_boolean (_data_->_tmp12_, G_FILE_ATTRIBUTE_ACCESS_CAN_READ)) {
#line 148 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp13_ = _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_->_tmp13_);
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp14_ = _data_->argv;
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp14__length1 = _data_->argv_length1;
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp15_ = _data_->disk_path;
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_data_->_tmp16_ = g_strdup (_data_->_tmp15_);
#line 149 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
					_vala_array_add23 (&_data_->argv, &_data_->argv_length1, &_data_->_argv_size_, _data_->_tmp16_);
#line 1865 "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 1873 "libvirt-system-importer.c"
			}
		}
	}
#line 153 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp17_ = _data_->argv;
#line 153 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp17__length1 = _data_->argv_length1;
#line 153 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_data_->_tmp17__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 (g_task_get_completed (_data_->_async_result) != 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 1893 "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 1900 "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_->_tmp18_ = _data_->argv;
#line 157 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_data_->_tmp18__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_->_tmp18_, _data_->_tmp18__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 1914 "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 1928 "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 (g_task_get_completed (_data_->_async_result) != 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 1942 "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 1949 "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_;
#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"
	num_domains = g_list_length (_tmp0_);
#line 20 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp1_ = num_domains;
#line 20 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_tmp1_ == ((guint) 1)) {
#line 1970 "libvirt-system-importer.c"
		GList* _tmp2_;
		gconstpointer _tmp3_;
		const gchar* _tmp4_;
		gchar* _tmp5_;
#line 21 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp2_ = self->priv->domains;
#line 21 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp3_ = _tmp2_->data;
#line 21 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp4_ = gvir_domain_get_name ((GVirDomain*) _tmp3_);
#line 21 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp5_ = g_strdup_printf (_ ("_Import “%s” from system broker"), _tmp4_);
#line 21 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		result = _tmp5_;
#line 21 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return result;
#line 1987 "libvirt-system-importer.c"
	} else {
		guint _tmp6_;
		guint _tmp7_;
		gchar* _tmp8_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp6_ = num_domains;
#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_ = g_strdup_printf (ngettext ("_Import %u box from system broker", "_Import %u boxes from system broker", (gulong) _tmp6_), _tmp7_);
#line 24 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		result = _tmp8_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return result;
#line 2002 "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_;
#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"
	num_domains = g_list_length (_tmp0_);
#line 34 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	_tmp1_ = num_domains;
#line 34 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
	if (_tmp1_ == ((guint) 1)) {
#line 2024 "libvirt-system-importer.c"
		GList* _tmp2_;
		gconstpointer _tmp3_;
		const gchar* _tmp4_;
		gchar* _tmp5_;
#line 35 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp2_ = self->priv->domains;
#line 35 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp3_ = _tmp2_->data;
#line 35 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp4_ = gvir_domain_get_name ((GVirDomain*) _tmp3_);
#line 35 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp5_ = g_strdup_printf (_ ("Will import “%s” from system broker"), _tmp4_);
#line 35 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		result = _tmp5_;
#line 35 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return result;
#line 2041 "libvirt-system-importer.c"
	} else {
		guint _tmp6_;
		guint _tmp7_;
		gchar* _tmp8_;
#line 38 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		_tmp6_ = num_domains;
#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_ = g_strdup_printf (ngettext ("Will import %u box from system broker", "Will import %u boxes from system broker", (gulong) _tmp6_), _tmp7_);
#line 38 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		result = _tmp8_;
#line 38 "/home/fborges/checkout/gnome-boxes/src/libvirt-system-importer.vala"
		return result;
#line 2056 "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_PROPERTY, boxes_libvirt_system_importer_properties[BOXES_LIBVIRT_SYSTEM_IMPORTER_WIZARD_MENU_LABEL_PROPERTY] = 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_PROPERTY, boxes_libvirt_system_importer_properties[BOXES_LIBVIRT_SYSTEM_IMPORTER_WIZARD_REVIEW_LABEL_PROPERTY] = 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 2076 "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 2085 "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 2105 "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_PROPERTY:
#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_PROPERTY:
#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 2145 "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 2151 "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 2163 "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 2171 "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 2187 "libvirt-system-importer.c"
}



