/* installed-media.c generated by valac 0.36.1.38-6532, the Vala compiler
 * generated from installed-media.vala, do not modify */

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

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


#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;
typedef struct _BoxesInstallerMediaPrivate BoxesInstallerMediaPrivate;

#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_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;
typedef struct _BoxesInstalledMediaPrivate BoxesInstalledMediaPrivate;
enum  {
	BOXES_INSTALLED_MEDIA_DUMMY_PROPERTY,
	BOXES_INSTALLED_MEDIA_NEED_USER_INPUT_FOR_VM_CREATION,
	BOXES_INSTALLED_MEDIA_READY_TO_CREATE,
	BOXES_INSTALLED_MEDIA_LIVE,
	BOXES_INSTALLED_MEDIA_ARCHITECTURE,
	BOXES_INSTALLED_MEDIA_LAST_PROPERTY
};
static GParamSpec* boxes_installed_media_properties[BOXES_INSTALLED_MEDIA_LAST_PROPERTY];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define BOXES_TYPE_MEDIA_MANAGER (boxes_media_manager_get_type ())
#define BOXES_MEDIA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MEDIA_MANAGER, BoxesMediaManager))
#define BOXES_MEDIA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MEDIA_MANAGER, BoxesMediaManagerClass))
#define BOXES_IS_MEDIA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MEDIA_MANAGER))
#define BOXES_IS_MEDIA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MEDIA_MANAGER))
#define BOXES_MEDIA_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MEDIA_MANAGER, BoxesMediaManagerClass))

typedef struct _BoxesMediaManager BoxesMediaManager;
typedef struct _BoxesMediaManagerClass BoxesMediaManagerClass;

#define BOXES_TYPE_OS_DATABASE (boxes_os_database_get_type ())
#define BOXES_OS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_OS_DATABASE, BoxesOSDatabase))
#define BOXES_OS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_OS_DATABASE, BoxesOSDatabaseClass))
#define BOXES_IS_OS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_OS_DATABASE))
#define BOXES_IS_OS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_OS_DATABASE))
#define BOXES_OS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_OS_DATABASE, BoxesOSDatabaseClass))

typedef struct _BoxesOSDatabase BoxesOSDatabase;
typedef struct _BoxesOSDatabaseClass BoxesOSDatabaseClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _BoxesInstalledMediaNewGuessOsData BoxesInstalledMediaNewGuessOsData;
typedef struct _BoxesInstalledMediaCopyData BoxesInstalledMediaCopyData;
#define __g_list_free__boxes_pair_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__boxes_pair_unref0_ (var), NULL)))

#define BOXES_TYPE_VM_IMPORTER (boxes_vm_importer_get_type ())
#define BOXES_VM_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_VM_IMPORTER, BoxesVMImporter))
#define BOXES_VM_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_VM_IMPORTER, BoxesVMImporterClass))
#define BOXES_IS_VM_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_VM_IMPORTER))
#define BOXES_IS_VM_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_VM_IMPORTER))
#define BOXES_VM_IMPORTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_VM_IMPORTER, BoxesVMImporterClass))

typedef struct _BoxesVMImporter BoxesVMImporter;
typedef struct _BoxesVMImporterClass BoxesVMImporterClass;
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
typedef struct _BoxesInstalledMediaGuessOsFromFilenameData BoxesInstalledMediaGuessOsFromFilenameData;
#define _g_match_info_unref0(var) ((var == NULL) ? NULL : (var = (g_match_info_unref (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _BoxesInstalledMediaDecompressData BoxesInstalledMediaDecompressData;

struct _BoxesInstallerMedia {
	GObject parent_instance;
	BoxesInstallerMediaPrivate * priv;
	OsinfoOs* os;
	OsinfoResources* resources;
	OsinfoMedia* os_media;
	gchar* label;
	gchar* device_file;
	gchar* mount_point;
	gboolean from_image;
};

struct _BoxesInstallerMediaClass {
	GObjectClass parent_class;
	void (*set_direct_boot_params) (BoxesInstallerMedia* self, GVirConfigDomainOs* os);
	void (*prepare) (BoxesInstallerMedia* self, BoxesActivityProgress* progress, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*prepare_finish) (BoxesInstallerMedia* self, GAsyncResult* _res_);
	void (*prepare_for_installation) (BoxesInstallerMedia* self, const gchar* vm_name, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*prepare_for_installation_finish) (BoxesInstallerMedia* self, GAsyncResult* _res_);
	void (*prepare_to_continue_installation) (BoxesInstallerMedia* self, const gchar* vm_name);
	void (*clean_up) (BoxesInstallerMedia* self);
	void (*clean_up_preparation_cache) (BoxesInstallerMedia* self);
	void (*setup_domain_config) (BoxesInstallerMedia* self, GVirConfigDomain* domain);
	void (*setup_post_install_domain_config) (BoxesInstallerMedia* self, GVirConfigDomain* domain);
	void (*populate_setup_box) (BoxesInstallerMedia* self, GtkBox* setup_box);
	GList* (*get_vm_properties) (BoxesInstallerMedia* self);
	BoxesVMCreator* (*get_vm_creator) (BoxesInstallerMedia* self);
	OsinfoDeviceList* (*get_supported_devices) (BoxesInstallerMedia* self);
	guint64 (*get_installed_size) (BoxesInstallerMedia* self);
	gboolean (*get_need_user_input_for_vm_creation) (BoxesInstallerMedia* self);
	gboolean (*get_ready_to_create) (BoxesInstallerMedia* self);
	gboolean (*get_live) (BoxesInstallerMedia* self);
	gchar* (*get_architecture) (BoxesInstallerMedia* self);
};

struct _BoxesInstalledMedia {
	BoxesInstallerMedia parent_instance;
	BoxesInstalledMediaPrivate * priv;
};

struct _BoxesInstalledMediaClass {
	BoxesInstallerMediaClass parent_class;
};

typedef enum  {
	BOXES_OS_DATABASE_ERROR_NON_BOOTABLE,
	BOXES_OS_DATABASE_ERROR_DB_LOADING_FAILED,
	BOXES_OS_DATABASE_ERROR_UNKNOWN_OS_ID,
	BOXES_OS_DATABASE_ERROR_UNKNOWN_MEDIA_ID
} BoxesOSDatabaseError;
#define BOXES_OS_DATABASE_ERROR boxes_os_database_error_quark ()
struct _BoxesInstalledMediaNewGuessOsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gboolean _task_complete_;
	GType object_type;
	BoxesInstalledMedia* self;
	gchar* path;
	BoxesMediaManager* media_manager;
	const gchar* _tmp0_;
	gboolean _tmp1_;
	const gchar* _tmp2_;
	gboolean _tmp3_;
	const gchar* _tmp4_;
	gboolean _tmp5_;
	OsinfoOs* _tmp6_;
	BoxesMediaManager* _tmp7_;
	BoxesOSDatabase* _tmp8_;
	BoxesOSDatabase* _tmp9_;
	OsinfoOs* _tmp10_;
	OsinfoOs* _tmp11_;
	GError* _error_;
	GError* _vala1__error_;
	GError* _tmp12_;
	GError* _tmp13_;
	OsinfoOs* _tmp14_;
	BoxesMediaManager* _tmp15_;
	BoxesOSDatabase* _tmp16_;
	BoxesOSDatabase* _tmp17_;
	OsinfoOs* _tmp18_;
	OsinfoOs* _tmp19_;
	OsinfoResources* _tmp20_;
	OsinfoOs* _tmp21_;
	BoxesMediaManager* _tmp22_;
	BoxesOSDatabase* _tmp23_;
	BoxesOSDatabase* _tmp24_;
	OsinfoOs* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	OsinfoResources* _tmp29_;
	OsinfoResources* _tmp30_;
	OsinfoResources* _tmp31_;
	GError * _inner_error_;
};

struct _BoxesInstalledMediaCopyData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gboolean _task_complete_;
	BoxesInstalledMedia* self;
	gchar* destination_path;
	gboolean decompressed;
	gboolean _tmp0_;
	gchar** argv;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar** _tmp9_;
	gint argv_length1;
	gint _argv_size_;
	gboolean converting;
	const gchar* _tmp10_;
	gboolean _tmp11_;
	const gchar* _tmp12_;
	gboolean _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	gchar** _tmp16_;
	gint _tmp16__length1;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	gboolean _tmp19_;
	GFile* file;
	const gchar* _tmp20_;
	GFile* _tmp21_;
	GFile* _tmp22_;
	GError * _inner_error_;
};

struct _BoxesInstalledMediaGuessOsFromFilenameData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gboolean _task_complete_;
	BoxesInstalledMedia* self;
	BoxesOSDatabase* os_db;
	OsinfoOs* result;
	gboolean _tmp0_;
	const gchar* _tmp1_;
	gboolean _tmp2_;
	const gchar* _tmp3_;
	gboolean _tmp4_;
	GDate* date;
	GDate* _tmp5_;
	GDate* _tmp6_;
	OsinfoOs* _tmp7_;
	BoxesOSDatabase* _tmp8_;
	OsinfoOs* _tmp9_;
	OsinfoOs* _tmp10_;
	GError* _error_;
	GList* os_list;
	BoxesOSDatabase* _tmp11_;
	GDate* _tmp12_;
	GList* _tmp13_;
	GList* _tmp14_;
	guint _tmp15_;
	GList* _tmp16_;
	gconstpointer _tmp17_;
	OsinfoOs* _tmp18_;
	GError * _inner_error_;
};

struct _BoxesInstalledMediaDecompressData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	gboolean _task_complete_;
	BoxesInstalledMedia* self;
	gboolean result;
	const gchar* _tmp0_;
	gboolean _tmp1_;
	GFile* compressed;
	const gchar* _tmp2_;
	GFile* _tmp3_;
	GFileInputStream* input_stream;
	GFile* _tmp4_;
	GFileInputStream* _tmp5_;
	gchar* decompressed_path;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	GFile* decompressed;
	const gchar* _tmp13_;
	GFile* _tmp14_;
	GOutputStream* output_stream;
	GFile* _tmp15_;
	GFileOutputStream* _tmp16_;
	GZlibDecompressor* decompressor;
	GZlibDecompressor* _tmp17_;
	GOutputStream* _tmp18_;
	GZlibDecompressor* _tmp19_;
	GConverterOutputStream* _tmp20_;
	const gchar* _tmp21_;
	guint8* buffer;
	guint8* _tmp22_;
	gint buffer_length1;
	gint _buffer_size_;
	gssize length;
	GFileInputStream* _tmp23_;
	guint8* _tmp24_;
	gint _tmp24__length1;
	gssize _tmp25_;
	gssize _tmp26_;
	gssize written;
	gssize i;
	gboolean _tmp27_;
	gssize _tmp28_;
	gssize _tmp29_;
	gssize _tmp30_;
	GOutputStream* _tmp31_;
	guint8* _tmp32_;
	gint _tmp32__length1;
	gssize _tmp33_;
	gssize _tmp34_;
	gssize _tmp35_;
	gssize _tmp36_;
	gssize _tmp37_;
	const gchar* _tmp38_;
	const gchar* _tmp39_;
	gchar* _tmp40_;
	GError * _inner_error_;
};


static gpointer boxes_installed_media_parent_class = NULL;
static GRegex* boxes_installed_media_date_regex;
static GRegex* boxes_installed_media_date_regex = NULL;

GType boxes_installer_media_get_type (void) G_GNUC_CONST;
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;
GType boxes_installed_media_get_type (void) G_GNUC_CONST;
BoxesInstalledMedia* boxes_installed_media_new (const gchar* path, gboolean known_qcow2, GError** error);
BoxesInstalledMedia* boxes_installed_media_construct (GType object_type, const gchar* path, gboolean known_qcow2, GError** error);
BoxesInstallerMedia* boxes_installer_media_new (void);
BoxesInstallerMedia* boxes_installer_media_construct (GType object_type);
void boxes_installer_media_label_setup (BoxesInstallerMedia* self, const gchar* label);
static void boxes_installed_media_construct_guess_os_data_free (gpointer _data);
GType boxes_media_manager_get_type (void) G_GNUC_CONST;
void boxes_installed_media_new_guess_os (const gchar* path, BoxesMediaManager* media_manager, GAsyncReadyCallback _callback_, gpointer _user_data_);
BoxesInstalledMedia* boxes_installed_media_new_guess_os_finish (GAsyncResult* _res_, GError** error);
void boxes_installed_media_construct_guess_os (GType object_type, const gchar* path, BoxesMediaManager* media_manager, GAsyncReadyCallback _callback_, gpointer _user_data_);
BoxesInstalledMedia* boxes_installed_media_construct_guess_os_finish (GAsyncResult* _res_, GError** error);
static gboolean boxes_installed_media_construct_guess_os_co (BoxesInstalledMediaNewGuessOsData* _data_);
GType boxes_os_database_get_type (void) G_GNUC_CONST;
BoxesOSDatabase* boxes_media_manager_get_os_db (BoxesMediaManager* self);
void boxes_os_database_get_os_by_id (BoxesOSDatabase* self, const gchar* id, GAsyncReadyCallback _callback_, gpointer _user_data_);
GQuark boxes_os_database_error_quark (void);
OsinfoOs* boxes_os_database_get_os_by_id_finish (BoxesOSDatabase* self, GAsyncResult* _res_, GError** error);
static void boxes_installed_media_new_guess_os_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_installed_media_guess_os_from_filename (BoxesInstalledMedia* self, BoxesOSDatabase* os_db, GAsyncReadyCallback _callback_, gpointer _user_data_);
static OsinfoOs* boxes_installed_media_guess_os_from_filename_finish (BoxesInstalledMedia* self, GAsyncResult* _res_, GError** error);
OsinfoResources* boxes_os_database_get_resources_for_os (BoxesOSDatabase* self, OsinfoOs* os, const gchar* architecture);
gchar* boxes_installer_media_get_architecture (BoxesInstallerMedia* self);
OsinfoResources* boxes_os_database_get_default_resources (void);
static void boxes_installed_media_copy_data_free (gpointer _data);
void boxes_installed_media_copy (BoxesInstalledMedia* self, const gchar* destination_path, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_installed_media_copy_finish (BoxesInstalledMedia* self, GAsyncResult* _res_, GError** error);
static gboolean boxes_installed_media_copy_co (BoxesInstalledMediaCopyData* _data_);
static void boxes_installed_media_decompress (BoxesInstalledMedia* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean boxes_installed_media_decompress_finish (BoxesInstalledMedia* self, GAsyncResult* _res_, GError** error);
static void boxes_installed_media_copy_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_installed_media_real_setup_domain_config (BoxesInstallerMedia* base, GVirConfigDomain* domain);
void boxes_installer_media_add_cd_config (BoxesInstallerMedia* self, GVirConfigDomain* domain, GVirConfigDomainDiskType type, const gchar* iso_path, const gchar* device_name, gboolean mandatory);
static GList* boxes_installed_media_real_get_vm_properties (BoxesInstallerMedia* base);
static void _boxes_pair_unref0_ (gpointer var);
static inline void _g_list_free__boxes_pair_unref0_ (GList* self);
static BoxesVMCreator* boxes_installed_media_real_get_vm_creator (BoxesInstallerMedia* base);
BoxesVMImporter* boxes_vm_importer_new (BoxesInstalledMedia* source_media);
BoxesVMImporter* boxes_vm_importer_construct (GType object_type, BoxesInstalledMedia* source_media);
GType boxes_vm_importer_get_type (void) G_GNUC_CONST;
static void boxes_installed_media_guess_os_from_filename_data_free (gpointer _data);
static gboolean boxes_installed_media_guess_os_from_filename_co (BoxesInstalledMediaGuessOsFromFilenameData* _data_);
static GDate* boxes_installed_media_get_date_from_filename (BoxesInstalledMedia* self);
static void boxes_installed_media_guess_os_from_filename_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void boxes_os_database_list_os_by_distro (BoxesOSDatabase* self, const gchar* distro, GDate* after, GAsyncReadyCallback _callback_, gpointer _user_data_);
GList* boxes_os_database_list_os_by_distro_finish (BoxesOSDatabase* self, GAsyncResult* _res_, GError** error);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static GDate* _g_date_dup (GDate* self);
static void boxes_installed_media_decompress_data_free (gpointer _data);
static gboolean boxes_installed_media_decompress_co (BoxesInstalledMediaDecompressData* _data_);
static void boxes_installed_media_decompress_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_installed_media_finalize (GObject * obj);
gboolean boxes_installer_media_get_need_user_input_for_vm_creation (BoxesInstallerMedia* self);
gboolean boxes_installer_media_get_ready_to_create (BoxesInstallerMedia* self);
gboolean boxes_installer_media_get_live (BoxesInstallerMedia* self);
static void _vala_boxes_installed_media_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);

static GRegex* _tmp_regex_0 = NULL;
const gchar* BOXES_INSTALLED_MEDIA_supported_extensions[16] = {".qcow2", ".qcow2.gz", ".qcow", ".qcow.gz", ".img", ".img.gz", ".cow", ".cow.gz", ".vdi", ".vdi.gz", ".vmdk", ".vmdk.gz", ".vpc", ".vpc.gz", ".cloop", ".cloop.gz"};

static inline GRegex* _thread_safe_regex_init (GRegex** re, const gchar * pattern, GRegexMatchFlags match_options) {
#line 14 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (g_once_init_enter ((volatile gsize*) re)) {
#line 14 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		GRegex* val = g_regex_new (pattern, match_options, 0, NULL);
#line 14 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_once_init_leave ((volatile gsize*) re, (gsize) val);
#line 423 "installed-media.c"
	}
#line 14 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return *re;
#line 427 "installed-media.c"
}


static gpointer _g_regex_ref0 (gpointer self) {
#line 14 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return self ? g_regex_ref (self) : NULL;
#line 434 "installed-media.c"
}


BoxesInstalledMedia* boxes_installed_media_construct (GType object_type, const gchar* path, gboolean known_qcow2, GError** error) {
	BoxesInstalledMedia * self = NULL;
	gboolean supported = FALSE;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp8_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	GError * _inner_error_ = NULL;
#line 38 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_return_val_if_fail (path != NULL, NULL);
#line 38 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) boxes_installer_media_construct (object_type);
#line 39 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	supported = FALSE;
#line 41 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp1_ = known_qcow2;
#line 41 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_tmp1_) {
#line 41 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp0_ = TRUE;
#line 459 "installed-media.c"
	} else {
		const gchar* _tmp2_;
		gboolean _tmp3_;
#line 41 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp2_ = path;
#line 41 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp3_ = g_str_has_prefix (_tmp2_, "/dev/");
#line 41 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp0_ = _tmp3_;
#line 469 "installed-media.c"
	}
#line 41 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_tmp0_) {
#line 42 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		supported = TRUE;
#line 475 "installed-media.c"
	} else {
		{
			const gchar** extension_collection = NULL;
			gint extension_collection_length1 = 0;
			gint _extension_collection_size_ = 0;
			gint extension_it = 0;
#line 44 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			extension_collection = BOXES_INSTALLED_MEDIA_supported_extensions;
#line 44 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			extension_collection_length1 = G_N_ELEMENTS (BOXES_INSTALLED_MEDIA_supported_extensions);
#line 44 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			for (extension_it = 0; extension_it < G_N_ELEMENTS (BOXES_INSTALLED_MEDIA_supported_extensions); extension_it = extension_it + 1) {
#line 488 "installed-media.c"
				const gchar* extension = NULL;
#line 44 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				extension = extension_collection[extension_it];
#line 492 "installed-media.c"
				{
					const gchar* _tmp4_;
					const gchar* _tmp5_;
					gboolean _tmp6_;
					gboolean _tmp7_;
#line 45 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_tmp4_ = path;
#line 45 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_tmp5_ = extension;
#line 45 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_tmp6_ = g_str_has_suffix (_tmp4_, _tmp5_);
#line 45 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					supported = _tmp6_;
#line 46 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_tmp7_ = supported;
#line 46 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					if (_tmp7_) {
#line 47 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
						break;
#line 512 "installed-media.c"
					}
				}
			}
		}
	}
#line 50 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp8_ = supported;
#line 50 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (!_tmp8_) {
#line 522 "installed-media.c"
		GError* _tmp9_;
#line 51 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp9_ = g_error_new_literal (G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, _ ("Unsupported disk image format."));
#line 51 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_inner_error_ = _tmp9_;
#line 51 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_propagate_error (error, _inner_error_);
#line 51 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (self);
#line 51 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return NULL;
#line 534 "installed-media.c"
	}
#line 53 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp10_ = path;
#line 53 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp11_ = g_strdup (_tmp10_);
#line 53 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (((BoxesInstallerMedia*) self)->device_file);
#line 53 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	((BoxesInstallerMedia*) self)->device_file = _tmp11_;
#line 54 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	((BoxesInstallerMedia*) self)->from_image = TRUE;
#line 56 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installer_media_label_setup ((BoxesInstallerMedia*) self, NULL);
#line 38 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return self;
#line 550 "installed-media.c"
}


BoxesInstalledMedia* boxes_installed_media_new (const gchar* path, gboolean known_qcow2, GError** error) {
#line 38 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return boxes_installed_media_construct (BOXES_TYPE_INSTALLED_MEDIA, path, known_qcow2, error);
#line 557 "installed-media.c"
}


static void boxes_installed_media_construct_guess_os_data_free (gpointer _data) {
	BoxesInstalledMediaNewGuessOsData* _data_;
	_data_ = _data;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->path);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->media_manager);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->self);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_slice_free (BoxesInstalledMediaNewGuessOsData, _data_);
#line 572 "installed-media.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return self ? g_object_ref (self) : NULL;
#line 579 "installed-media.c"
}


void boxes_installed_media_construct_guess_os (GType object_type, const gchar* path, BoxesMediaManager* media_manager, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesInstalledMediaNewGuessOsData* _data_;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	BoxesMediaManager* _tmp2_;
	BoxesMediaManager* _tmp3_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_ = g_slice_new0 (BoxesInstalledMediaNewGuessOsData);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_callback_ == NULL) {
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_task_complete_ = TRUE;
#line 597 "installed-media.c"
	}
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_installed_media_construct_guess_os_data_free);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->object_type = object_type;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp0_ = path;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->path);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->path = _tmp1_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp2_ = media_manager;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp3_ = _g_object_ref0 (_tmp2_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->media_manager);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->media_manager = _tmp3_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_construct_guess_os_co (_data_);
#line 621 "installed-media.c"
}


BoxesInstalledMedia* boxes_installed_media_construct_guess_os_finish (GAsyncResult* _res_, GError** error) {
	BoxesInstalledMedia* result;
	BoxesInstalledMediaNewGuessOsData* _data_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (NULL == _data_) {
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return;
#line 634 "installed-media.c"
	}
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_task_complete_ = TRUE;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	result = _data_->self;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->self = NULL;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return result;
#line 644 "installed-media.c"
}


static gboolean string_contains (const gchar* self, const gchar* needle) {
	gboolean result = FALSE;
	const gchar* _tmp0_;
	gchar* _tmp1_;
#line 1403 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, FALSE);
#line 1403 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (needle != NULL, FALSE);
#line 1404 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp0_ = needle;
#line 1404 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_);
#line 1404 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	result = _tmp1_ != NULL;
#line 1404 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	return result;
#line 664 "installed-media.c"
}


static void boxes_installed_media_new_guess_os_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesInstalledMediaNewGuessOsData* _data_;
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_ = _user_data_;
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_source_object_ = source_object;
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_res_ = _res_;
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_task_complete_ = TRUE;
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_construct_guess_os_co (_data_);
#line 680 "installed-media.c"
}


static gpointer _g_error_copy0 (gpointer self) {
#line 68 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return self ? g_error_copy (self) : NULL;
#line 687 "installed-media.c"
}


static gboolean boxes_installed_media_construct_guess_os_co (BoxesInstalledMediaNewGuessOsData* _data_) {
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	switch (_data_->_state_) {
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 0:
#line 696 "installed-media.c"
		goto _state_0;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 1:
#line 700 "installed-media.c"
		goto _state_1;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 2:
#line 704 "installed-media.c"
		goto _state_2;
		default:
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_assert_not_reached ();
#line 709 "installed-media.c"
	}
	_state_0:
#line 60 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp0_ = _data_->path;
#line 60 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->self = (BoxesInstalledMedia*) boxes_installed_media_construct (_data_->object_type, _data_->_tmp0_, FALSE, &_data_->_inner_error_);
#line 60 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 60 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 60 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 60 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 724 "installed-media.c"
	}
#line 62 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp2_ = _data_->path;
#line 62 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp3_ = string_contains (_data_->_tmp2_, "gnome-continuous");
#line 62 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp3_) {
#line 62 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp1_ = TRUE;
#line 734 "installed-media.c"
	} else {
#line 62 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp4_ = _data_->path;
#line 62 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp5_ = string_contains (_data_->_tmp4_, "gnome-ostree");
#line 62 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp1_ = _data_->_tmp5_;
#line 742 "installed-media.c"
	}
#line 62 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp1_) {
#line 746 "installed-media.c"
		{
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp7_ = _data_->media_manager;
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp8_ = boxes_media_manager_get_os_db (_data_->_tmp7_);
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp9_ = _data_->_tmp8_;
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_state_ = 1;
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			boxes_os_database_get_os_by_id (_data_->_tmp9_, "http://gnome.org/continuous/3.10", boxes_installed_media_new_guess_os_ready, _data_);
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			return FALSE;
#line 760 "installed-media.c"
			_state_1:
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp10_ = boxes_os_database_get_os_by_id_finish (_data_->_tmp9_, _data_->_res_, &_data_->_inner_error_);
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp6_ = _data_->_tmp10_;
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				if (g_error_matches (_data_->_inner_error_, BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_UNKNOWN_OS_ID)) {
#line 770 "installed-media.c"
					goto __catch10_boxes_os_database_error_unknown_os_id;
				}
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				if (_data_->_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 775 "installed-media.c"
					goto __catch10_boxes_os_database_error;
				}
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				g_clear_error (&_data_->_inner_error_);
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				return NULL;
#line 784 "installed-media.c"
			}
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp11_ = _data_->_tmp6_;
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp6_ = NULL;
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (((BoxesInstallerMedia*) _data_->self)->os);
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			((BoxesInstallerMedia*) _data_->self)->os = _data_->_tmp11_;
#line 63 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->_tmp6_);
#line 796 "installed-media.c"
		}
		goto __finally10;
		__catch10_boxes_os_database_error_unknown_os_id:
		{
#line 63 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_error_ = _data_->_inner_error_;
#line 63 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_inner_error_ = NULL;
#line 66 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_debug ("installed-media.vala:66: gnome-continuous definition not found in libo" \
"sinfo db");
#line 63 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_error_free0 (_data_->_error_);
#line 809 "installed-media.c"
		}
		goto __finally10;
		__catch10_boxes_os_database_error:
		{
#line 63 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_vala1__error_ = _data_->_inner_error_;
#line 63 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_inner_error_ = NULL;
#line 68 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp12_ = _data_->_vala1__error_;
#line 68 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp13_ = _g_error_copy0 (_data_->_tmp12_);
#line 68 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_inner_error_ = _data_->_tmp13_;
#line 68 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_error_free0 (_data_->_vala1__error_);
#line 826 "installed-media.c"
			goto __finally10;
		}
		__finally10:
#line 63 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 63 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 63 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_object_unref (_data_->_async_result);
#line 63 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			return FALSE;
#line 838 "installed-media.c"
		}
	}
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp15_ = _data_->media_manager;
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp16_ = boxes_media_manager_get_os_db (_data_->_tmp15_);
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp17_ = _data_->_tmp16_;
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_state_ = 2;
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_guess_os_from_filename (_data_->self, _data_->_tmp17_, boxes_installed_media_new_guess_os_ready, _data_);
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 853 "installed-media.c"
	_state_2:
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp18_ = boxes_installed_media_guess_os_from_filename_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp14_ = _data_->_tmp18_;
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 867 "installed-media.c"
	}
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp19_ = _data_->_tmp14_;
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp14_ = NULL;
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (((BoxesInstallerMedia*) _data_->self)->os);
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	((BoxesInstallerMedia*) _data_->self)->os = _data_->_tmp19_;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp21_ = ((BoxesInstallerMedia*) _data_->self)->os;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp21_ != NULL) {
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp22_ = _data_->media_manager;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp23_ = boxes_media_manager_get_os_db (_data_->_tmp22_);
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp24_ = _data_->_tmp23_;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp25_ = ((BoxesInstallerMedia*) _data_->self)->os;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp26_ = boxes_installer_media_get_architecture ((BoxesInstallerMedia*) _data_->self);
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp27_ = _data_->_tmp26_;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp28_ = _data_->_tmp27_;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp29_ = boxes_os_database_get_resources_for_os (_data_->_tmp24_, _data_->_tmp25_, _data_->_tmp28_);
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->_tmp20_);
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp20_ = _data_->_tmp29_;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_free0 (_data_->_tmp28_);
#line 903 "installed-media.c"
	} else {
#line 74 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp30_ = boxes_os_database_get_default_resources ();
#line 74 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->_tmp20_);
#line 74 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp20_ = _data_->_tmp30_;
#line 911 "installed-media.c"
	}
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp31_ = _g_object_ref0 (_data_->_tmp20_);
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (((BoxesInstallerMedia*) _data_->self)->resources);
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	((BoxesInstallerMedia*) _data_->self)->resources = _data_->_tmp31_;
#line 76 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installer_media_label_setup ((BoxesInstallerMedia*) _data_->self, NULL);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->_tmp20_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->_tmp14_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_state_ != 0) {
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 933 "installed-media.c"
		}
	}
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_object_unref (_data_->_async_result);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 940 "installed-media.c"
}


void boxes_installed_media_new_guess_os (const gchar* path, BoxesMediaManager* media_manager, GAsyncReadyCallback _callback_, gpointer _user_data_) {
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_construct_guess_os (BOXES_TYPE_INSTALLED_MEDIA, path, media_manager, _callback_, _user_data_);
#line 947 "installed-media.c"
}


BoxesInstalledMedia* boxes_installed_media_new_guess_os_finish (GAsyncResult* _res_, GError** error) {
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return boxes_installed_media_construct_guess_os_finish (_res_, error);
#line 954 "installed-media.c"
}


static void boxes_installed_media_copy_data_free (gpointer _data) {
	BoxesInstalledMediaCopyData* _data_;
	_data_ = _data;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->destination_path);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->self);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_slice_free (BoxesInstalledMediaCopyData, _data_);
#line 967 "installed-media.c"
}


void boxes_installed_media_copy (BoxesInstalledMedia* self, const gchar* destination_path, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesInstalledMediaCopyData* _data_;
	BoxesInstalledMedia* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_ = g_slice_new0 (BoxesInstalledMediaCopyData);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_callback_ == NULL) {
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_task_complete_ = TRUE;
#line 984 "installed-media.c"
	}
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_installed_media_copy_data_free);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->self = _tmp0_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp1_ = destination_path;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->destination_path);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->destination_path = _tmp2_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_copy_co (_data_);
#line 1002 "installed-media.c"
}


void boxes_installed_media_copy_finish (BoxesInstalledMedia* self, GAsyncResult* _res_, GError** error) {
	BoxesInstalledMediaCopyData* _data_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (NULL == _data_) {
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return;
#line 1014 "installed-media.c"
	}
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_task_complete_ = TRUE;
#line 1018 "installed-media.c"
}


static void boxes_installed_media_copy_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesInstalledMediaCopyData* _data_;
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_ = _user_data_;
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_source_object_ = source_object;
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_res_ = _res_;
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_task_complete_ = TRUE;
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_copy_co (_data_);
#line 1034 "installed-media.c"
}


static gboolean boxes_installed_media_copy_co (BoxesInstalledMediaCopyData* _data_) {
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	switch (_data_->_state_) {
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 0:
#line 1043 "installed-media.c"
		goto _state_0;
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 1:
#line 1047 "installed-media.c"
		goto _state_1;
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 2:
#line 1051 "installed-media.c"
		goto _state_2;
		default:
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_assert_not_reached ();
#line 1056 "installed-media.c"
	}
	_state_0:
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_state_ = 1;
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_decompress (_data_->self, boxes_installed_media_copy_ready, _data_);
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 1065 "installed-media.c"
	_state_1:
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp0_ = boxes_installed_media_decompress_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->decompressed = _data_->_tmp0_;
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 1079 "installed-media.c"
	}
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp1_ = g_strdup ("qemu-img");
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp2_ = g_strdup ("convert");
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp3_ = g_strdup ("-O");
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp4_ = g_strdup ("qcow2");
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp5_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp6_ = g_strdup (_data_->_tmp5_);
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp7_ = _data_->destination_path;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp8_ = g_strdup (_data_->_tmp7_);
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_ = g_new0 (gchar*, 6 + 1);
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_[0] = _data_->_tmp1_;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_[1] = _data_->_tmp2_;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_[2] = _data_->_tmp3_;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_[3] = _data_->_tmp4_;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_[4] = _data_->_tmp6_;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_[5] = _data_->_tmp8_;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->argv = _data_->_tmp9_;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->argv_length1 = 6;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_argv_size_ = _data_->argv_length1;
#line 85 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp10_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 85 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp11_ = g_str_has_suffix (_data_->_tmp10_, ".qcow2");
#line 85 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->converting = !_data_->_tmp11_;
#line 90 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp13_ = _data_->converting;
#line 90 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp13_) {
#line 90 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp12_ = " while converting it to 'qcow2' format";
#line 1129 "installed-media.c"
	} else {
#line 90 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp12_ = "";
#line 1133 "installed-media.c"
	}
#line 87 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp14_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 87 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp15_ = _data_->destination_path;
#line 87 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_debug ("installed-media.vala:87: Copying '%s' to '%s'%s.", _data_->_tmp14_, _data_->_tmp15_, _data_->_tmp12_);
#line 91 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp16_ = _data_->argv;
#line 91 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp16__length1 = _data_->argv_length1;
#line 91 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_state_ = 2;
#line 91 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_exec (_data_->_tmp16_, _data_->_tmp16__length1, NULL, boxes_installed_media_copy_ready, _data_);
#line 91 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 1151 "installed-media.c"
	_state_2:
#line 91 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_exec_finish (_data_->_res_, NULL, NULL, &_data_->_inner_error_);
#line 91 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 91 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 91 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 91 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 91 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 1165 "installed-media.c"
	}
#line 92 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp17_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 92 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp18_ = _data_->destination_path;
#line 92 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_debug ("installed-media.vala:92: Finished copying '%s' to '%s'", _data_->_tmp17_, _data_->_tmp18_);
#line 94 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp19_ = _data_->decompressed;
#line 94 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp19_) {
#line 96 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp20_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 96 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp21_ = g_file_new_for_path (_data_->_tmp20_);
#line 96 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->file = _data_->_tmp21_;
#line 97 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp22_ = _data_->file;
#line 97 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		boxes_delete_file (_data_->_tmp22_, &_data_->_inner_error_);
#line 97 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 97 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 97 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->file);
#line 97 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 97 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_object_unref (_data_->_async_result);
#line 97 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			return FALSE;
#line 1199 "installed-media.c"
		}
#line 94 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->file);
#line 1203 "installed-media.c"
	}
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_state_ != 0) {
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1215 "installed-media.c"
		}
	}
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_object_unref (_data_->_async_result);
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 1222 "installed-media.c"
}


static void boxes_installed_media_real_setup_domain_config (BoxesInstallerMedia* base, GVirConfigDomain* domain) {
	BoxesInstalledMedia * self;
	GVirConfigDomainDiskType _tmp0_ = 0;
	gboolean _tmp1_;
	GVirConfigDomain* _tmp2_;
#line 101 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) base;
#line 101 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_return_if_fail (domain != NULL);
#line 102 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp1_ = ((BoxesInstallerMedia*) self)->from_image;
#line 102 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_tmp1_) {
#line 102 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp0_ = GVIR_CONFIG_DOMAIN_DISK_FILE;
#line 1241 "installed-media.c"
	} else {
#line 102 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp0_ = GVIR_CONFIG_DOMAIN_DISK_BLOCK;
#line 1245 "installed-media.c"
	}
#line 102 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp2_ = domain;
#line 102 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installer_media_add_cd_config ((BoxesInstallerMedia*) self, _tmp2_, _tmp0_, NULL, "hdc", FALSE);
#line 1251 "installed-media.c"
}


static void _boxes_pair_unref0_ (gpointer var) {
#line 105 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	(var == NULL) ? NULL : (var = (boxes_pair_unref (var), NULL));
#line 1258 "installed-media.c"
}


static inline void _g_list_free__boxes_pair_unref0_ (GList* self) {
#line 105 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_list_free_full (self, (GDestroyNotify) _boxes_pair_unref0_);
#line 1265 "installed-media.c"
}


static GList* boxes_installed_media_real_get_vm_properties (BoxesInstallerMedia* base) {
	BoxesInstalledMedia * self;
	GList* result = NULL;
	GList* properties = NULL;
	const gchar* _tmp0_;
	BoxesPair* _tmp1_;
#line 105 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) base;
#line 106 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	properties = NULL;
#line 108 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp0_ = ((BoxesInstallerMedia*) self)->label;
#line 108 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp1_ = boxes_pair_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _ ("System"), _tmp0_);
#line 108 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	properties = g_list_append (properties, _tmp1_);
#line 110 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	result = properties;
#line 110 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return result;
#line 1289 "installed-media.c"
}


static BoxesVMCreator* boxes_installed_media_real_get_vm_creator (BoxesInstallerMedia* base) {
	BoxesInstalledMedia * self;
	BoxesVMCreator* result = NULL;
	BoxesVMImporter* _tmp0_;
#line 114 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) base;
#line 115 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp0_ = boxes_vm_importer_new (self);
#line 115 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	result = (BoxesVMCreator*) _tmp0_;
#line 115 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return result;
#line 1305 "installed-media.c"
}


static void boxes_installed_media_guess_os_from_filename_data_free (gpointer _data) {
	BoxesInstalledMediaGuessOsFromFilenameData* _data_;
	_data_ = _data;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->os_db);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->result);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->self);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_slice_free (BoxesInstalledMediaGuessOsFromFilenameData, _data_);
#line 1320 "installed-media.c"
}


static void boxes_installed_media_guess_os_from_filename (BoxesInstalledMedia* self, BoxesOSDatabase* os_db, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesInstalledMediaGuessOsFromFilenameData* _data_;
	BoxesInstalledMedia* _tmp0_;
	BoxesOSDatabase* _tmp1_;
	BoxesOSDatabase* _tmp2_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_ = g_slice_new0 (BoxesInstalledMediaGuessOsFromFilenameData);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_callback_ == NULL) {
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_task_complete_ = TRUE;
#line 1337 "installed-media.c"
	}
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_installed_media_guess_os_from_filename_data_free);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->self = _tmp0_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp1_ = os_db;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp2_ = _g_object_ref0 (_tmp1_);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->os_db);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->os_db = _tmp2_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_guess_os_from_filename_co (_data_);
#line 1355 "installed-media.c"
}


static OsinfoOs* boxes_installed_media_guess_os_from_filename_finish (BoxesInstalledMedia* self, GAsyncResult* _res_, GError** error) {
	OsinfoOs* result;
	BoxesInstalledMediaGuessOsFromFilenameData* _data_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (NULL == _data_) {
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return NULL;
#line 1368 "installed-media.c"
	}
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_task_complete_ = TRUE;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	result = _data_->result;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->result = NULL;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return result;
#line 1378 "installed-media.c"
}


static void boxes_installed_media_guess_os_from_filename_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesInstalledMediaGuessOsFromFilenameData* _data_;
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_ = _user_data_;
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_source_object_ = source_object;
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_res_ = _res_;
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_task_complete_ = TRUE;
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_guess_os_from_filename_co (_data_);
#line 1394 "installed-media.c"
}


static void _g_object_unref0_ (gpointer var) {
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
#line 1401 "installed-media.c"
}


static inline void _g_list_free__g_object_unref0_ (GList* self) {
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
#line 1408 "installed-media.c"
}


static gboolean boxes_installed_media_guess_os_from_filename_co (BoxesInstalledMediaGuessOsFromFilenameData* _data_) {
#line 118 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	switch (_data_->_state_) {
#line 118 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 0:
#line 1417 "installed-media.c"
		goto _state_0;
#line 118 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 1:
#line 1421 "installed-media.c"
		goto _state_1;
#line 118 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 2:
#line 1425 "installed-media.c"
		goto _state_2;
		default:
#line 118 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_assert_not_reached ();
#line 1430 "installed-media.c"
	}
	_state_0:
#line 119 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp1_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 119 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp2_ = string_contains (_data_->_tmp1_, "gnome-continuous");
#line 119 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (!_data_->_tmp2_) {
#line 119 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp3_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 119 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp4_ = string_contains (_data_->_tmp3_, "gnome-ostree");
#line 119 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp0_ = !_data_->_tmp4_;
#line 1445 "installed-media.c"
	} else {
#line 119 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp0_ = FALSE;
#line 1449 "installed-media.c"
	}
#line 119 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp0_) {
#line 120 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->result = NULL;
#line 120 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 120 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		if (_data_->_state_ != 0) {
#line 120 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 120 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1463 "installed-media.c"
			}
		}
#line 120 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 120 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 1470 "installed-media.c"
	}
#line 122 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp5_ = boxes_installed_media_get_date_from_filename (_data_->self);
#line 122 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->date = _data_->_tmp5_;
#line 123 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp6_ = _data_->date;
#line 123 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp6_ == NULL) {
#line 1480 "installed-media.c"
		{
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp8_ = _data_->os_db;
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_state_ = 1;
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			boxes_os_database_get_os_by_id (_data_->_tmp8_, "http://gnome.org/continuous/3.10", boxes_installed_media_guess_os_from_filename_ready, _data_);
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			return FALSE;
#line 1490 "installed-media.c"
			_state_1:
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp9_ = boxes_os_database_get_os_by_id_finish (_data_->_tmp8_, _data_->_res_, &_data_->_inner_error_);
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp7_ = _data_->_tmp9_;
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				if (g_error_matches (_data_->_inner_error_, BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_UNKNOWN_OS_ID)) {
#line 1500 "installed-media.c"
					goto __catch11_boxes_os_database_error_unknown_os_id;
				}
				goto __finally11;
			}
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp10_ = _data_->_tmp7_;
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp7_ = NULL;
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->result = _data_->_tmp10_;
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->_tmp7_);
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_free0 (_data_->date);
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			if (_data_->_state_ != 0) {
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				while (_data_->_task_complete_ != TRUE) {
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1523 "installed-media.c"
				}
			}
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_object_unref (_data_->_async_result);
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			return FALSE;
#line 1530 "installed-media.c"
		}
		goto __finally11;
		__catch11_boxes_os_database_error_unknown_os_id:
		{
#line 124 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_error_ = _data_->_inner_error_;
#line 124 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_inner_error_ = NULL;
#line 129 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_debug ("installed-media.vala:129: gnome-continuous definition not found in lib" \
"osinfo db");
#line 131 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->result = NULL;
#line 131 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_error_free0 (_data_->_error_);
#line 131 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_free0 (_data_->date);
#line 131 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 131 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			if (_data_->_state_ != 0) {
#line 131 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				while (_data_->_task_complete_ != TRUE) {
#line 131 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1555 "installed-media.c"
				}
			}
#line 131 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_object_unref (_data_->_async_result);
#line 131 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			return FALSE;
#line 1562 "installed-media.c"
		}
		__finally11:
#line 124 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		if (_data_->_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 124 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 124 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_free0 (_data_->date);
#line 124 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_object_unref (_data_->_async_result);
#line 124 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			return FALSE;
#line 1575 "installed-media.c"
		} else {
#line 124 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_free0 (_data_->date);
#line 124 "/home/fborges/checkout/gnome-boxes/src/installed-media.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 124 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_clear_error (&_data_->_inner_error_);
#line 124 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_object_unref (_data_->_async_result);
#line 124 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			return FALSE;
#line 1587 "installed-media.c"
		}
	}
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp11_ = _data_->os_db;
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp12_ = _data_->date;
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_state_ = 2;
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_os_database_list_os_by_distro (_data_->_tmp11_, "gnome", _data_->_tmp12_, boxes_installed_media_guess_os_from_filename_ready, _data_);
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 1600 "installed-media.c"
	_state_2:
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp13_ = boxes_os_database_list_os_by_distro_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error_);
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->os_list = _data_->_tmp13_;
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		if (_data_->_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_free0 (_data_->date);
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_object_unref (_data_->_async_result);
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			return FALSE;
#line 1618 "installed-media.c"
		} else {
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_free0 (_data_->date);
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.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 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_clear_error (&_data_->_inner_error_);
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_object_unref (_data_->_async_result);
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			return FALSE;
#line 1630 "installed-media.c"
		}
	}
#line 136 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp14_ = _data_->os_list;
#line 136 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp15_ = g_list_length (_data_->_tmp14_);
#line 136 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp15_ > ((guint) 0)) {
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp16_ = _data_->os_list;
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp17_ = _data_->_tmp16_->data;
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp18_ = _g_object_ref0 ((OsinfoOs*) _data_->_tmp17_);
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->result = _data_->_tmp18_;
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		__g_list_free__g_object_unref0_0 (_data_->os_list);
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_free0 (_data_->date);
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		if (_data_->_state_ != 0) {
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1659 "installed-media.c"
			}
		}
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 1666 "installed-media.c"
	} else {
#line 139 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->result = NULL;
#line 139 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		__g_list_free__g_object_unref0_0 (_data_->os_list);
#line 139 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_free0 (_data_->date);
#line 139 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 139 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		if (_data_->_state_ != 0) {
#line 139 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 139 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 1682 "installed-media.c"
			}
		}
#line 139 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 139 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 1689 "installed-media.c"
	}
#line 118 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	__g_list_free__g_object_unref0_0 (_data_->os_list);
#line 118 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->date);
#line 1695 "installed-media.c"
}


static gchar* string_slice (const gchar* self, glong start, glong end) {
	gchar* result = NULL;
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	glong _tmp2_;
	glong _tmp5_;
	gboolean _tmp8_ = FALSE;
	glong _tmp9_;
	gboolean _tmp12_ = FALSE;
	glong _tmp13_;
	glong _tmp16_;
	glong _tmp17_;
	glong _tmp18_;
	glong _tmp19_;
	glong _tmp20_;
	gchar* _tmp21_;
#line 1355 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1356 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp0_ = strlen (self);
#line 1356 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp1_ = _tmp0_;
#line 1356 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	string_length = (glong) _tmp1_;
#line 1357 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp2_ = start;
#line 1357 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp2_ < ((glong) 0)) {
#line 1728 "installed-media.c"
		glong _tmp3_;
		glong _tmp4_;
#line 1358 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp3_ = string_length;
#line 1358 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp4_ = start;
#line 1358 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		start = _tmp3_ + _tmp4_;
#line 1737 "installed-media.c"
	}
#line 1360 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp5_ = end;
#line 1360 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp5_ < ((glong) 0)) {
#line 1743 "installed-media.c"
		glong _tmp6_;
		glong _tmp7_;
#line 1361 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp6_ = string_length;
#line 1361 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp7_ = end;
#line 1361 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		end = _tmp6_ + _tmp7_;
#line 1752 "installed-media.c"
	}
#line 1363 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp9_ = start;
#line 1363 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp9_ >= ((glong) 0)) {
#line 1758 "installed-media.c"
		glong _tmp10_;
		glong _tmp11_;
#line 1363 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp10_ = start;
#line 1363 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp11_ = string_length;
#line 1363 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp8_ = _tmp10_ <= _tmp11_;
#line 1767 "installed-media.c"
	} else {
#line 1363 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp8_ = FALSE;
#line 1771 "installed-media.c"
	}
#line 1363 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp8_, NULL);
#line 1364 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp13_ = end;
#line 1364 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp13_ >= ((glong) 0)) {
#line 1779 "installed-media.c"
		glong _tmp14_;
		glong _tmp15_;
#line 1364 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp14_ = end;
#line 1364 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp15_ = string_length;
#line 1364 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp12_ = _tmp14_ <= _tmp15_;
#line 1788 "installed-media.c"
	} else {
#line 1364 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp12_ = FALSE;
#line 1792 "installed-media.c"
	}
#line 1364 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp12_, NULL);
#line 1365 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp16_ = start;
#line 1365 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp17_ = end;
#line 1365 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp16_ <= _tmp17_, NULL);
#line 1366 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp18_ = start;
#line 1366 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp19_ = end;
#line 1366 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp20_ = start;
#line 1366 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	_tmp21_ = g_strndup (((gchar*) self) + _tmp18_, (gsize) (_tmp19_ - _tmp20_));
#line 1366 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	result = _tmp21_;
#line 1366 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	return result;
#line 1814 "installed-media.c"
}


static GDate* _g_date_dup (GDate* self) {
	GDate* dup;
#line 155 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	dup = g_new0 (GDate, 1);
#line 155 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	memcpy (dup, self, sizeof (GDate));
#line 155 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return dup;
#line 1826 "installed-media.c"
}


static gpointer __g_date_dup0 (gpointer self) {
#line 155 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return self ? _g_date_dup (self) : NULL;
#line 1833 "installed-media.c"
}


static GDate* boxes_installed_media_get_date_from_filename (BoxesInstalledMedia* self) {
	GDate* result = NULL;
	GMatchInfo* match_info = NULL;
	GRegex* _tmp0_;
	const gchar* _tmp1_;
	GMatchInfo* _tmp2_ = NULL;
	GMatchInfo* _tmp3_;
	gboolean _tmp4_;
	gchar* date_str = NULL;
	GMatchInfo* _tmp5_;
	gchar* _tmp6_;
	GDate date = {0};
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gint _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gint _tmp14_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gint _tmp18_;
	GDate* _tmp19_;
#line 142 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 145 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp0_ = boxes_installed_media_date_regex;
#line 145 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp1_ = ((BoxesInstallerMedia*) self)->device_file;
#line 145 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_regex_match (_tmp0_, _tmp1_, 0, &_tmp2_);
#line 145 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_match_info_unref0 (match_info);
#line 145 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	match_info = _tmp2_;
#line 146 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp3_ = match_info;
#line 146 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp4_ = g_match_info_matches (_tmp3_);
#line 146 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (!_tmp4_) {
#line 147 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		result = NULL;
#line 147 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_match_info_unref0 (match_info);
#line 147 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return result;
#line 1886 "installed-media.c"
	}
#line 149 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp5_ = match_info;
#line 149 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp6_ = g_match_info_fetch (_tmp5_, 0);
#line 149 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	date_str = _tmp6_;
#line 150 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	memset (&date, 0, sizeof (GDate));
#line 151 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp7_ = date_str;
#line 151 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp8_ = string_slice (_tmp7_, (glong) 0, (glong) 4);
#line 151 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp9_ = _tmp8_;
#line 151 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp10_ = atoi (_tmp9_);
#line 151 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_date_set_year (&date, (GDateYear) _tmp10_);
#line 151 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_tmp9_);
#line 152 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp11_ = date_str;
#line 152 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp12_ = string_slice (_tmp11_, (glong) 4, (glong) 6);
#line 152 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp13_ = _tmp12_;
#line 152 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp14_ = atoi (_tmp13_);
#line 152 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_date_set_month (&date, (GDateMonth) _tmp14_);
#line 152 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_tmp13_);
#line 153 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp15_ = date_str;
#line 153 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp16_ = string_slice (_tmp15_, (glong) 6, (glong) 8);
#line 153 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp17_ = _tmp16_;
#line 153 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp18_ = atoi (_tmp17_);
#line 153 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_date_set_day (&date, (GDateDay) _tmp18_);
#line 153 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_tmp17_);
#line 155 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp19_ = __g_date_dup0 (&date);
#line 155 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	result = _tmp19_;
#line 155 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (date_str);
#line 155 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_match_info_unref0 (match_info);
#line 155 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return result;
#line 1942 "installed-media.c"
}


static void boxes_installed_media_decompress_data_free (gpointer _data) {
	BoxesInstalledMediaDecompressData* _data_;
	_data_ = _data;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->self);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_slice_free (BoxesInstalledMediaDecompressData, _data_);
#line 1953 "installed-media.c"
}


static void boxes_installed_media_decompress (BoxesInstalledMedia* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesInstalledMediaDecompressData* _data_;
	BoxesInstalledMedia* _tmp0_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_ = g_slice_new0 (BoxesInstalledMediaDecompressData);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_callback_ == NULL) {
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_task_complete_ = TRUE;
#line 1968 "installed-media.c"
	}
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_installed_media_decompress_data_free);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->self = _tmp0_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_decompress_co (_data_);
#line 1978 "installed-media.c"
}


static gboolean boxes_installed_media_decompress_finish (BoxesInstalledMedia* self, GAsyncResult* _res_, GError** error) {
	gboolean result;
	BoxesInstalledMediaDecompressData* _data_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (NULL == _data_) {
#line 1989 "installed-media.c"
		gboolean _tmp0_ = FALSE;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return _tmp0_;
#line 1993 "installed-media.c"
	}
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_task_complete_ = TRUE;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	result = _data_->result;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return result;
#line 2001 "installed-media.c"
}


static void boxes_installed_media_decompress_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesInstalledMediaDecompressData* _data_;
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_ = _user_data_;
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_source_object_ = source_object;
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_res_ = _res_;
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_task_complete_ = TRUE;
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_decompress_co (_data_);
#line 2017 "installed-media.c"
}


static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
	gchar* result = NULL;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError * _inner_error_ = NULL;
#line 1407 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1407 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (old != NULL, NULL);
#line 1407 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	g_return_val_if_fail (replacement != NULL, NULL);
#line 1408 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	if ((*((gchar*) self)) == '\0') {
#line 1408 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp1_ = TRUE;
#line 2036 "installed-media.c"
	} else {
		const gchar* _tmp2_;
#line 1408 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp2_ = old;
#line 1408 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp1_ = (*((gchar*) _tmp2_)) == '\0';
#line 2043 "installed-media.c"
	}
#line 1408 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp1_) {
#line 1408 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp0_ = TRUE;
#line 2049 "installed-media.c"
	} else {
		const gchar* _tmp3_;
		const gchar* _tmp4_;
#line 1408 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp3_ = old;
#line 1408 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp4_ = replacement;
#line 1408 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp0_ = g_strcmp0 (_tmp3_, _tmp4_) == 0;
#line 2059 "installed-media.c"
	}
#line 1408 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	if (_tmp0_) {
#line 2063 "installed-media.c"
		gchar* _tmp5_;
#line 1409 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp5_ = g_strdup (self);
#line 1409 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		result = _tmp5_;
#line 1409 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		return result;
#line 2071 "installed-media.c"
	}
	{
		GRegex* regex = NULL;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		GRegex* _tmp9_;
		GRegex* _tmp10_;
		gchar* _tmp11_ = NULL;
		GRegex* _tmp12_;
		const gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
#line 1412 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp6_ = old;
#line 1412 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp7_ = g_regex_escape_string (_tmp6_, -1);
#line 1412 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp8_ = _tmp7_;
#line 1412 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp9_ = g_regex_new (_tmp8_, 0, 0, &_inner_error_);
#line 1412 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp10_ = _tmp9_;
#line 1412 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_g_free0 (_tmp8_);
#line 1412 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		regex = _tmp10_;
#line 1412 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1412 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
			if (_inner_error_->domain == G_REGEX_ERROR) {
#line 2103 "installed-media.c"
				goto __catch12_g_regex_error;
			}
#line 1412 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1412 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
			g_clear_error (&_inner_error_);
#line 1412 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
			return NULL;
#line 2112 "installed-media.c"
		}
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp12_ = regex;
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp13_ = replacement;
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp14_ = g_regex_replace_literal (_tmp12_, self, (gssize) -1, 0, _tmp13_, 0, &_inner_error_);
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp11_ = _tmp14_;
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
			if (_inner_error_->domain == G_REGEX_ERROR) {
#line 2128 "installed-media.c"
				goto __catch12_g_regex_error;
			}
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
			g_clear_error (&_inner_error_);
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
			return NULL;
#line 2139 "installed-media.c"
		}
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp15_ = _tmp11_;
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_tmp11_ = NULL;
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		result = _tmp15_;
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_g_free0 (_tmp11_);
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_g_regex_unref0 (regex);
#line 1413 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		return result;
#line 2153 "installed-media.c"
	}
	goto __finally12;
	__catch12_g_regex_error:
	{
		GError* e = NULL;
#line 1411 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		e = _inner_error_;
#line 1411 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_inner_error_ = NULL;
#line 1415 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		g_assert_not_reached ();
#line 1411 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		_g_error_free0 (e);
#line 2167 "installed-media.c"
	}
	__finally12:
#line 1411 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1411 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		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 1411 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		g_clear_error (&_inner_error_);
#line 1411 "/home/fborges/jhbuild/install/share/vala-0.38/vapi/glib-2.0.vapi"
		return NULL;
#line 2178 "installed-media.c"
	}
}


static gboolean boxes_installed_media_decompress_co (BoxesInstalledMediaDecompressData* _data_) {
#line 158 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	switch (_data_->_state_) {
#line 158 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 0:
#line 2188 "installed-media.c"
		goto _state_0;
#line 158 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 1:
#line 2192 "installed-media.c"
		goto _state_1;
#line 158 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 2:
#line 2196 "installed-media.c"
		goto _state_2;
#line 158 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 3:
#line 2200 "installed-media.c"
		goto _state_3;
		default:
#line 158 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_assert_not_reached ();
#line 2205 "installed-media.c"
	}
	_state_0:
#line 159 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp0_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 159 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp1_ = g_str_has_suffix (_data_->_tmp0_, ".gz");
#line 159 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (!_data_->_tmp1_) {
#line 160 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->result = FALSE;
#line 160 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 160 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		if (_data_->_state_ != 0) {
#line 160 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			while (_data_->_task_complete_ != TRUE) {
#line 160 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 2224 "installed-media.c"
			}
		}
#line 160 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 160 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 2231 "installed-media.c"
	}
#line 162 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp2_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 162 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp3_ = g_file_new_for_path (_data_->_tmp2_);
#line 162 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->compressed = _data_->_tmp3_;
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp4_ = _data_->compressed;
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_state_ = 1;
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_file_read_async (_data_->_tmp4_, G_PRIORITY_DEFAULT, NULL, boxes_installed_media_decompress_ready, _data_);
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 2247 "installed-media.c"
	_state_1:
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp5_ = g_file_read_finish (_data_->_tmp4_, _data_->_res_, &_data_->_inner_error_);
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->input_stream = _data_->_tmp5_;
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->compressed);
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 2263 "installed-media.c"
	}
#line 165 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp6_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 165 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp7_ = g_path_get_basename (_data_->_tmp6_);
#line 165 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp8_ = _data_->_tmp7_;
#line 165 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_ = string_replace (_data_->_tmp8_, ".gz", "");
#line 165 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp10_ = _data_->_tmp9_;
#line 165 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->_tmp8_);
#line 165 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->decompressed_path = _data_->_tmp10_;
#line 166 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp11_ = _data_->decompressed_path;
#line 166 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp12_ = boxes_get_user_pkgcache (_data_->_tmp11_);
#line 166 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->decompressed_path);
#line 166 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->decompressed_path = _data_->_tmp12_;
#line 167 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp13_ = _data_->decompressed_path;
#line 167 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp14_ = g_file_new_for_path (_data_->_tmp13_);
#line 167 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->decompressed = _data_->_tmp14_;
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp15_ = _data_->decompressed;
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_state_ = 2;
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_file_replace_async (_data_->_tmp15_, NULL, FALSE, G_FILE_CREATE_REPLACE_DESTINATION, G_PRIORITY_DEFAULT, NULL, boxes_installed_media_decompress_ready, _data_);
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 2301 "installed-media.c"
	_state_2:
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp16_ = g_file_replace_finish (_data_->_tmp15_, _data_->_res_, &_data_->_inner_error_);
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->output_stream = (GOutputStream*) _data_->_tmp16_;
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->decompressed);
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_free0 (_data_->decompressed_path);
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->input_stream);
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->compressed);
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 2323 "installed-media.c"
	}
#line 171 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp17_ = g_zlib_decompressor_new (G_ZLIB_COMPRESSOR_FORMAT_GZIP);
#line 171 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->decompressor = _data_->_tmp17_;
#line 172 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp18_ = _data_->output_stream;
#line 172 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp19_ = _data_->decompressor;
#line 172 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp20_ = (GConverterOutputStream*) g_converter_output_stream_new (_data_->_tmp18_, (GConverter*) _data_->_tmp19_);
#line 172 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->output_stream);
#line 172 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->output_stream = (GOutputStream*) _data_->_tmp20_;
#line 174 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp21_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 174 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_debug ("installed-media.vala:174: Decompressing '%s'..", _data_->_tmp21_);
#line 175 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp22_ = g_new0 (guint8, 1048576);
#line 175 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->buffer = _data_->_tmp22_;
#line 175 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->buffer_length1 = 1048576;
#line 175 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_buffer_size_ = _data_->buffer_length1;
#line 176 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	while (TRUE) {
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp23_ = _data_->input_stream;
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp24_ = _data_->buffer;
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp24__length1 = _data_->buffer_length1;
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_state_ = 3;
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_input_stream_read_async ((GInputStream*) _data_->_tmp23_, _data_->_tmp24_, (gsize) _data_->_tmp24__length1, G_PRIORITY_DEFAULT, NULL, boxes_installed_media_decompress_ready, _data_);
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 2365 "installed-media.c"
		_state_3:
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp25_ = g_input_stream_read_finish ((GInputStream*) _data_->_tmp23_, _data_->_res_, &_data_->_inner_error_);
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->length = _data_->_tmp25_;
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->buffer = (g_free (_data_->buffer), NULL);
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->decompressor);
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->output_stream);
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->decompressed);
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_free0 (_data_->decompressed_path);
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->input_stream);
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->compressed);
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_object_unref (_data_->_async_result);
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			return FALSE;
#line 2393 "installed-media.c"
		}
#line 178 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp26_ = _data_->length;
#line 178 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		if (_data_->_tmp26_ <= ((gssize) 0)) {
#line 179 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			break;
#line 2401 "installed-media.c"
		}
#line 181 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->written = (gssize) 0;
#line 181 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->i = (gssize) 0;
#line 2407 "installed-media.c"
		{
#line 182 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp27_ = TRUE;
#line 182 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			while (TRUE) {
#line 182 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				if (!_data_->_tmp27_) {
#line 185 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_data_->_tmp28_ = _data_->i;
#line 185 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_data_->_tmp29_ = _data_->length;
#line 185 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					if (!(_data_->_tmp28_ < _data_->_tmp29_)) {
#line 185 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
						break;
#line 2423 "installed-media.c"
					}
				}
#line 182 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp27_ = FALSE;
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp31_ = _data_->output_stream;
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp32_ = _data_->buffer;
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp32__length1 = _data_->buffer_length1;
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp33_ = _data_->i;
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp34_ = _data_->length;
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp35_ = g_output_stream_write (_data_->_tmp31_, _data_->_tmp32_ + ((gint) _data_->_tmp33_), (gsize) (((gint) _data_->_tmp34_) - ((gint) _data_->_tmp33_)), NULL, &_data_->_inner_error_);
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp30_ = _data_->_tmp35_;
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				if (G_UNLIKELY (_data_->_inner_error_ != NULL)) {
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_data_->buffer = (g_free (_data_->buffer), NULL);
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_g_object_unref0 (_data_->decompressor);
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_g_object_unref0 (_data_->output_stream);
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_g_object_unref0 (_data_->decompressed);
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_g_free0 (_data_->decompressed_path);
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_g_object_unref0 (_data_->input_stream);
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_g_object_unref0 (_data_->compressed);
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					g_object_unref (_data_->_async_result);
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					return FALSE;
#line 2464 "installed-media.c"
				}
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->written = _data_->_tmp30_;
#line 184 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp36_ = _data_->i;
#line 184 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp37_ = _data_->written;
#line 184 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->i = _data_->_tmp36_ + _data_->_tmp37_;
#line 2474 "installed-media.c"
			}
		}
	}
#line 187 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp38_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 187 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_debug ("installed-media.vala:187: Decompressed '%s'.", _data_->_tmp38_);
#line 189 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp39_ = _data_->decompressed_path;
#line 189 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp40_ = g_strdup (_data_->_tmp39_);
#line 189 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (((BoxesInstallerMedia*) _data_->self)->device_file);
#line 189 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	((BoxesInstallerMedia*) _data_->self)->device_file = _data_->_tmp40_;
#line 191 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->result = TRUE;
#line 191 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->buffer = (g_free (_data_->buffer), NULL);
#line 191 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->decompressor);
#line 191 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->output_stream);
#line 191 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->decompressed);
#line 191 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->decompressed_path);
#line 191 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->input_stream);
#line 191 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->compressed);
#line 191 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 191 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_state_ != 0) {
#line 191 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		while (_data_->_task_complete_ != TRUE) {
#line 191 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 2514 "installed-media.c"
		}
	}
#line 191 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_object_unref (_data_->_async_result);
#line 191 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 2521 "installed-media.c"
}


static gboolean boxes_installed_media_real_get_need_user_input_for_vm_creation (BoxesInstallerMedia* base) {
	gboolean result;
	BoxesInstalledMedia* self;
#line 16 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) base;
#line 16 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	result = FALSE;
#line 16 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return result;
#line 2534 "installed-media.c"
}


static gboolean boxes_installed_media_real_get_ready_to_create (BoxesInstallerMedia* base) {
	gboolean result;
	BoxesInstalledMedia* self;
#line 17 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) base;
#line 17 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	result = TRUE;
#line 17 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return result;
#line 2547 "installed-media.c"
}


static gboolean boxes_installed_media_real_get_live (BoxesInstallerMedia* base) {
	gboolean result;
	BoxesInstalledMedia* self;
#line 18 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) base;
#line 18 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	result = FALSE;
#line 18 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return result;
#line 2560 "installed-media.c"
}


static gchar* boxes_installed_media_real_get_architecture (BoxesInstallerMedia* base) {
	gchar* result;
	BoxesInstalledMedia* self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
	gboolean _tmp2_;
#line 21 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) base;
#line 23 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp1_ = ((BoxesInstallerMedia*) self)->device_file;
#line 23 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp2_ = string_contains (_tmp1_, "amd64");
#line 23 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_tmp2_) {
#line 23 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp0_ = TRUE;
#line 2580 "installed-media.c"
	} else {
		const gchar* _tmp3_;
		gboolean _tmp4_;
#line 23 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp3_ = ((BoxesInstallerMedia*) self)->device_file;
#line 23 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp4_ = string_contains (_tmp3_, "x86_64");
#line 23 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp0_ = _tmp4_;
#line 2590 "installed-media.c"
	}
#line 23 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_tmp0_) {
#line 2594 "installed-media.c"
		gchar* _tmp5_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp5_ = g_strdup ("x86_64");
#line 24 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		result = _tmp5_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return result;
#line 2602 "installed-media.c"
	} else {
		gchar** arch_list = NULL;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		gchar* _tmp9_;
		gchar** _tmp10_;
		gint arch_list_length1;
		gint _arch_list_size_;
		gchar** _tmp11_;
		gint _tmp11__length1;
		const gchar* _tmp16_;
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp6_ = g_strdup ("i686");
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp7_ = g_strdup ("i586");
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp8_ = g_strdup ("i486");
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp9_ = g_strdup ("i386");
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp10_ = g_new0 (gchar*, 4 + 1);
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp10_[0] = _tmp6_;
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp10_[1] = _tmp7_;
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp10_[2] = _tmp8_;
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp10_[3] = _tmp9_;
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		arch_list = _tmp10_;
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		arch_list_length1 = 4;
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_arch_list_size_ = arch_list_length1;
#line 27 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp11_ = arch_list;
#line 27 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp11__length1 = arch_list_length1;
#line 2643 "installed-media.c"
		{
			gchar** arch_collection = NULL;
			gint arch_collection_length1 = 0;
			gint _arch_collection_size_ = 0;
			gint arch_it = 0;
#line 27 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			arch_collection = _tmp11_;
#line 27 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			arch_collection_length1 = _tmp11__length1;
#line 27 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			for (arch_it = 0; arch_it < _tmp11__length1; arch_it = arch_it + 1) {
#line 2655 "installed-media.c"
				gchar* _tmp12_;
				gchar* arch = NULL;
#line 27 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_tmp12_ = g_strdup (arch_collection[arch_it]);
#line 27 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				arch = _tmp12_;
#line 2662 "installed-media.c"
				{
					const gchar* _tmp13_;
					const gchar* _tmp14_;
					gboolean _tmp15_;
#line 28 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_tmp13_ = ((BoxesInstallerMedia*) self)->device_file;
#line 28 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_tmp14_ = arch;
#line 28 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_tmp15_ = string_contains (_tmp13_, _tmp14_);
#line 28 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					if (_tmp15_) {
#line 29 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
						result = arch;
#line 29 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
						arch_list = (_vala_array_free (arch_list, arch_list_length1, (GDestroyNotify) g_free), NULL);
#line 29 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
						return result;
#line 2681 "installed-media.c"
					}
#line 27 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_g_free0 (arch);
#line 2685 "installed-media.c"
				}
			}
		}
#line 32 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp16_ = ((BoxesInstallerMedia*) self)->device_file;
#line 32 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_debug ("installed-media.vala:32: Failed to guess architecture for media '%s'.", _tmp16_);
#line 33 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		result = NULL;
#line 33 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		arch_list = (_vala_array_free (arch_list, arch_list_length1, (GDestroyNotify) g_free), NULL);
#line 33 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return result;
#line 2699 "installed-media.c"
	}
}


static void boxes_installed_media_class_init (BoxesInstalledMediaClass * klass) {
	GRegex* _tmp0_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_parent_class = g_type_class_peek_parent (klass);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	((BoxesInstallerMediaClass *) klass)->setup_domain_config = (void (*) (BoxesInstallerMedia *, GVirConfigDomain*)) boxes_installed_media_real_setup_domain_config;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	((BoxesInstallerMediaClass *) klass)->get_vm_properties = (GList* (*) (BoxesInstallerMedia *)) boxes_installed_media_real_get_vm_properties;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	((BoxesInstallerMediaClass *) klass)->get_vm_creator = (BoxesVMCreator* (*) (BoxesInstallerMedia *)) boxes_installed_media_real_get_vm_creator;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	BOXES_INSTALLER_MEDIA_CLASS (klass)->get_need_user_input_for_vm_creation = boxes_installed_media_real_get_need_user_input_for_vm_creation;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	BOXES_INSTALLER_MEDIA_CLASS (klass)->get_ready_to_create = boxes_installed_media_real_get_ready_to_create;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	BOXES_INSTALLER_MEDIA_CLASS (klass)->get_live = boxes_installed_media_real_get_live;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	BOXES_INSTALLER_MEDIA_CLASS (klass)->get_architecture = boxes_installed_media_real_get_architecture;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_installed_media_get_property;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_installed_media_finalize;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_INSTALLED_MEDIA_NEED_USER_INPUT_FOR_VM_CREATION, boxes_installed_media_properties[BOXES_INSTALLED_MEDIA_NEED_USER_INPUT_FOR_VM_CREATION] = g_param_spec_boolean ("need-user-input-for-vm-creation", "need-user-input-for-vm-creation", "need-user-input-for-vm-creation", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_INSTALLED_MEDIA_READY_TO_CREATE, boxes_installed_media_properties[BOXES_INSTALLED_MEDIA_READY_TO_CREATE] = g_param_spec_boolean ("ready-to-create", "ready-to-create", "ready-to-create", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_INSTALLED_MEDIA_LIVE, boxes_installed_media_properties[BOXES_INSTALLED_MEDIA_LIVE] = g_param_spec_boolean ("live", "live", "live", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_INSTALLED_MEDIA_ARCHITECTURE, boxes_installed_media_properties[BOXES_INSTALLED_MEDIA_ARCHITECTURE] = g_param_spec_string ("architecture", "architecture", "architecture", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 14 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp0_ = _g_regex_ref0 (_thread_safe_regex_init (&_tmp_regex_0, "20[0-9]{6,6}", 0));
#line 14 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_date_regex = _tmp0_;
#line 2738 "installed-media.c"
}


static void boxes_installed_media_instance_init (BoxesInstalledMedia * self) {
}


static void boxes_installed_media_finalize (GObject * obj) {
	BoxesInstalledMedia * self;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_INSTALLED_MEDIA, BoxesInstalledMedia);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	G_OBJECT_CLASS (boxes_installed_media_parent_class)->finalize (obj);
#line 2752 "installed-media.c"
}


GType boxes_installed_media_get_type (void) {
	static volatile gsize boxes_installed_media_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_installed_media_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesInstalledMediaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_installed_media_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesInstalledMedia), 0, (GInstanceInitFunc) boxes_installed_media_instance_init, NULL };
		GType boxes_installed_media_type_id;
		boxes_installed_media_type_id = g_type_register_static (BOXES_TYPE_INSTALLER_MEDIA, "BoxesInstalledMedia", &g_define_type_info, 0);
		g_once_init_leave (&boxes_installed_media_type_id__volatile, boxes_installed_media_type_id);
	}
	return boxes_installed_media_type_id__volatile;
}


static void _vala_boxes_installed_media_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesInstalledMedia * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_INSTALLED_MEDIA, BoxesInstalledMedia);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	switch (property_id) {
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case BOXES_INSTALLED_MEDIA_NEED_USER_INPUT_FOR_VM_CREATION:
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_value_set_boolean (value, boxes_installer_media_get_need_user_input_for_vm_creation ((BoxesInstallerMedia*) self));
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		break;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case BOXES_INSTALLED_MEDIA_READY_TO_CREATE:
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_value_set_boolean (value, boxes_installer_media_get_ready_to_create ((BoxesInstallerMedia*) self));
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		break;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case BOXES_INSTALLED_MEDIA_LIVE:
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_value_set_boolean (value, boxes_installer_media_get_live ((BoxesInstallerMedia*) self));
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		break;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case BOXES_INSTALLED_MEDIA_ARCHITECTURE:
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_value_take_string (value, boxes_installer_media_get_architecture ((BoxesInstallerMedia*) self));
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		break;
#line 2797 "installed-media.c"
		default:
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		break;
#line 2803 "installed-media.c"
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



