/* installed-media.c generated by valac 0.39.5, 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_0_PROPERTY,
	BOXES_INSTALLED_MEDIA_NEED_USER_INPUT_FOR_VM_CREATION_PROPERTY,
	BOXES_INSTALLED_MEDIA_READY_TO_CREATE_PROPERTY,
	BOXES_INSTALLED_MEDIA_LIVE_PROPERTY,
	BOXES_INSTALLED_MEDIA_ARCHITECTURE_PROPERTY,
	BOXES_INSTALLED_MEDIA_NUM_PROPERTIES
};
static GParamSpec* boxes_installed_media_properties[BOXES_INSTALLED_MEDIA_NUM_PROPERTIES];
#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;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	GType object_type;
	BoxesInstalledMedia* self;
	gchar* path;
	BoxesMediaManager* media_manager;
	gboolean _tmp0_;
	OsinfoOs* _tmp1_;
	BoxesOSDatabase* _tmp2_;
	BoxesOSDatabase* _tmp3_;
	OsinfoOs* _tmp4_;
	OsinfoOs* _tmp5_;
	GError* _error_;
	GError* _vala1__error_;
	GError* _tmp6_;
	GError* _tmp7_;
	OsinfoOs* _tmp8_;
	BoxesOSDatabase* _tmp9_;
	BoxesOSDatabase* _tmp10_;
	OsinfoOs* _tmp11_;
	OsinfoOs* _tmp12_;
	OsinfoResources* _tmp13_;
	OsinfoOs* _tmp14_;
	BoxesOSDatabase* _tmp15_;
	BoxesOSDatabase* _tmp16_;
	OsinfoOs* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	OsinfoResources* _tmp21_;
	OsinfoResources* _tmp22_;
	OsinfoResources* _tmp23_;
	GError * _inner_error_;
};

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

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

struct _BoxesInstalledMediaDecompressData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GAsyncReadyCallback _callback_;
	gboolean _task_complete_;
	BoxesInstalledMedia* self;
	gboolean result;
	const gchar* _tmp0_;
	GFile* compressed;
	const gchar* _tmp1_;
	GFile* _tmp2_;
	GFileInputStream* input_stream;
	GFile* _tmp3_;
	GFileInputStream* _tmp4_;
	gchar* decompressed_path;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	GFile* decompressed;
	const gchar* _tmp12_;
	GFile* _tmp13_;
	GOutputStream* output_stream;
	GFile* _tmp14_;
	GFileOutputStream* _tmp15_;
	GZlibDecompressor* decompressor;
	GZlibDecompressor* _tmp16_;
	GOutputStream* _tmp17_;
	GZlibDecompressor* _tmp18_;
	GConverterOutputStream* _tmp19_;
	const gchar* _tmp20_;
	guint8* buffer;
	guint8* _tmp21_;
	gint buffer_length1;
	gint _buffer_size_;
	gssize length;
	GFileInputStream* _tmp22_;
	guint8* _tmp23_;
	gint _tmp23__length1;
	gssize _tmp24_;
	gssize written;
	gssize i;
	gboolean _tmp25_;
	gssize _tmp26_;
	gssize _tmp27_;
	gssize _tmp28_;
	GOutputStream* _tmp29_;
	guint8* _tmp30_;
	gint _tmp30__length1;
	gssize _tmp31_;
	gssize _tmp32_;
	gssize _tmp33_;
	gssize _tmp34_;
	const gchar* _tmp35_;
	const gchar* _tmp36_;
	gchar* _tmp37_;
	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);
static void boxes_installed_media_construct_guess_os_async_ready_wrapper (GObject *source_object,
                                                                   GAsyncResult *res,
                                                                   void *user_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);
static void boxes_installed_media_copy_async_ready_wrapper (GObject *source_object,
                                                     GAsyncResult *res,
                                                     void *user_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 void boxes_installed_media_guess_os_from_filename_async_ready_wrapper (GObject *source_object,
                                                                       GAsyncResult *res,
                                                                       void *user_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 void boxes_installed_media_decompress_async_ready_wrapper (GObject *source_object,
                                                           GAsyncResult *res,
                                                           void *user_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 492 "installed-media.c"
	}
#line 14 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return *re;
#line 496 "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 505 "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 _tmp3_;
	gchar* _tmp5_;
	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"
	if (known_qcow2) {
#line 41 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp0_ = TRUE;
#line 531 "installed-media.c"
	} else {
#line 41 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp0_ = g_str_has_prefix (path, "/dev/");
#line 535 "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 541 "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 554 "installed-media.c"
				const gchar* extension = NULL;
#line 44 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				extension = extension_collection[extension_it];
#line 558 "installed-media.c"
				{
					const gchar* _tmp1_;
					gboolean _tmp2_;
#line 45 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_tmp1_ = extension;
#line 45 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					supported = g_str_has_suffix (path, _tmp1_);
#line 46 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_tmp2_ = supported;
#line 46 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					if (_tmp2_) {
#line 47 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
						break;
#line 572 "installed-media.c"
					}
				}
			}
		}
	}
#line 50 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp3_ = supported;
#line 50 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (!_tmp3_) {
#line 582 "installed-media.c"
		GError* _tmp4_;
#line 51 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp4_ = 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_ = _tmp4_;
#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 594 "installed-media.c"
	}
#line 53 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp5_ = g_strdup (path);
#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 = _tmp5_;
#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 608 "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 619 "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 636 "installed-media.c"
}


static void
boxes_installed_media_construct_guess_os_async_ready_wrapper (GObject *source_object,
                                                              GAsyncResult *res,
                                                              void *user_data)
{
	BoxesInstalledMediaNewGuessOsData* _task_data_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_task_data_->_callback_ != NULL) {
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 652 "installed-media.c"
	}
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_task_data_->_task_complete_ = TRUE;
#line 656 "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 665 "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_;
	gchar* _tmp0_;
	BoxesMediaManager* _tmp1_;
#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_->_callback_ = _callback_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_async_result = g_task_new (NULL, NULL, boxes_installed_media_construct_guess_os_async_ready_wrapper, _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 689 "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_ = g_strdup (path);
#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 = _tmp0_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp1_ = _g_object_ref0 (media_manager);
#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 = _tmp1_;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_construct_guess_os_co (_data_);
#line 709 "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 725 "installed-media.c"
	}
#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 733 "installed-media.c"
}


static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gboolean result = FALSE;
	gchar* _tmp0_;
#line 1417 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, FALSE);
#line 1417 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (needle != NULL, FALSE);
#line 1418 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
#line 1418 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	result = _tmp0_ != NULL;
#line 1418 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	return result;
#line 753 "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 773 "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 782 "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 793 "installed-media.c"
		goto _state_0;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 1:
#line 797 "installed-media.c"
		goto _state_1;
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 2:
#line 801 "installed-media.c"
		goto _state_2;
		default:
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_assert_not_reached ();
#line 806 "installed-media.c"
	}
	_state_0:
#line 60 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->self = (BoxesInstalledMedia*) boxes_installed_media_construct (_data_->object_type, _data_->path, 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 819 "installed-media.c"
	}
#line 62 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (string_contains (_data_->path, "gnome-continuous")) {
#line 62 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp0_ = TRUE;
#line 825 "installed-media.c"
	} else {
#line 62 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp0_ = string_contains (_data_->path, "gnome-ostree");
#line 829 "installed-media.c"
	}
#line 62 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp0_) {
#line 833 "installed-media.c"
		{
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp2_ = boxes_media_manager_get_os_db (_data_->media_manager);
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp3_ = _data_->_tmp2_;
#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_->_tmp3_, "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 845 "installed-media.c"
			_state_1:
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp4_ = boxes_os_database_get_os_by_id_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp1_ = _data_->_tmp4_;
#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 855 "installed-media.c"
					goto __catch9_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 860 "installed-media.c"
					goto __catch9_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 869 "installed-media.c"
			}
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp5_ = _data_->_tmp1_;
#line 64 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp1_ = 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_->_tmp5_;
#line 63 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->_tmp1_);
#line 881 "installed-media.c"
		}
		goto __finally9;
		__catch9_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 894 "installed-media.c"
		}
		goto __finally9;
		__catch9_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_->_tmp6_ = _data_->_vala1__error_;
#line 68 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp7_ = _g_error_copy0 (_data_->_tmp6_);
#line 68 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_inner_error_ = _data_->_tmp7_;
#line 68 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_error_free0 (_data_->_vala1__error_);
#line 911 "installed-media.c"
			goto __finally9;
		}
		__finally9:
#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 923 "installed-media.c"
		}
	}
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_ = boxes_media_manager_get_os_db (_data_->media_manager);
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp10_ = _data_->_tmp9_;
#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_->_tmp10_, boxes_installed_media_new_guess_os_ready, _data_);
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 936 "installed-media.c"
	_state_2:
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp11_ = 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_->_tmp8_ = _data_->_tmp11_;
#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 950 "installed-media.c"
	}
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp12_ = _data_->_tmp8_;
#line 72 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp8_ = 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_->_tmp12_;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp14_ = ((BoxesInstallerMedia*) _data_->self)->os;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp14_ != NULL) {
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp15_ = boxes_media_manager_get_os_db (_data_->media_manager);
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp16_ = _data_->_tmp15_;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp17_ = ((BoxesInstallerMedia*) _data_->self)->os;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp18_ = boxes_installer_media_get_architecture ((BoxesInstallerMedia*) _data_->self);
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp19_ = _data_->_tmp18_;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp20_ = _data_->_tmp19_;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp21_ = boxes_os_database_get_resources_for_os (_data_->_tmp16_, _data_->_tmp17_, _data_->_tmp20_);
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->_tmp13_);
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp13_ = _data_->_tmp21_;
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_free0 (_data_->_tmp20_);
#line 984 "installed-media.c"
	} else {
#line 74 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp22_ = boxes_os_database_get_default_resources ();
#line 74 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->_tmp13_);
#line 74 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp13_ = _data_->_tmp22_;
#line 992 "installed-media.c"
	}
#line 73 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp23_ = _g_object_ref0 (_data_->_tmp13_);
#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_->_tmp23_;
#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_->_tmp13_);
#line 59 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->_tmp8_);
#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 1014 "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 1021 "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 1033 "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 1043 "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 1058 "installed-media.c"
}


static void
boxes_installed_media_copy_async_ready_wrapper (GObject *source_object,
                                                GAsyncResult *res,
                                                void *user_data)
{
	BoxesInstalledMediaCopyData* _task_data_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_task_data_->_callback_ != NULL) {
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 1074 "installed-media.c"
	}
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_task_data_->_task_complete_ = TRUE;
#line 1078 "installed-media.c"
}


void
boxes_installed_media_copy (BoxesInstalledMedia* self,
                            const gchar* destination_path,
                            GAsyncReadyCallback _callback_,
                            gpointer _user_data_)
{
	BoxesInstalledMediaCopyData* _data_;
	BoxesInstalledMedia* _tmp0_;
	gchar* _tmp1_;
#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_->_callback_ = _callback_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, boxes_installed_media_copy_async_ready_wrapper, _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 1101 "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_ = g_strdup (destination_path);
#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 = _tmp1_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_copy_co (_data_);
#line 1117 "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 1133 "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 1154 "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 1165 "installed-media.c"
		goto _state_0;
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 1:
#line 1169 "installed-media.c"
		goto _state_1;
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 2:
#line 1173 "installed-media.c"
		goto _state_2;
		default:
#line 80 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_assert_not_reached ();
#line 1178 "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 1187 "installed-media.c"
	_state_1:
#line 81 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->decompressed = boxes_installed_media_decompress_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
#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 1199 "installed-media.c"
	}
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp0_ = g_strdup ("qemu-img");
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp1_ = g_strdup ("convert");
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp2_ = g_strdup ("-O");
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp3_ = g_strdup ("qcow2");
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp4_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp5_ = g_strdup (_data_->_tmp4_);
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp6_ = g_strdup (_data_->destination_path);
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp7_ = g_new0 (gchar*, 6 + 1);
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp7_[0] = _data_->_tmp0_;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp7_[1] = _data_->_tmp1_;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp7_[2] = _data_->_tmp2_;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp7_[3] = _data_->_tmp3_;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp7_[4] = _data_->_tmp5_;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp7_[5] = _data_->_tmp6_;
#line 83 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->argv = _data_->_tmp7_;
#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_->_tmp8_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 85 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->converting = !g_str_has_suffix (_data_->_tmp8_, ".qcow2");
#line 90 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp10_ = _data_->converting;
#line 90 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp10_) {
#line 90 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp9_ = " while converting it to 'qcow2' format";
#line 1245 "installed-media.c"
	} else {
#line 90 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp9_ = "";
#line 1249 "installed-media.c"
	}
#line 87 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp11_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 87 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_debug ("installed-media.vala:87: Copying '%s' to '%s'%s.", _data_->_tmp11_, _data_->destination_path, _data_->_tmp9_);
#line 91 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp12_ = _data_->argv;
#line 91 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp12__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_->_tmp12_, _data_->_tmp12__length1, NULL, boxes_installed_media_copy_ready, _data_);
#line 91 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 1265 "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 1279 "installed-media.c"
	}
#line 92 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp13_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 92 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_debug ("installed-media.vala:92: Finished copying '%s' to '%s'", _data_->_tmp13_, _data_->destination_path);
#line 94 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp14_ = _data_->decompressed;
#line 94 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp14_) {
#line 96 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp15_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 96 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp16_ = g_file_new_for_path (_data_->_tmp15_);
#line 96 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->file = _data_->_tmp16_;
#line 97 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp17_ = _data_->file;
#line 97 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		boxes_delete_file (_data_->_tmp17_, &_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 1311 "installed-media.c"
		}
#line 94 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->file);
#line 1315 "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 1327 "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 1334 "installed-media.c"
}


static void
boxes_installed_media_real_setup_domain_config (BoxesInstallerMedia* base,
                                                GVirConfigDomain* domain)
{
	BoxesInstalledMedia * self;
	GVirConfigDomainDiskType _tmp0_ = 0;
	gboolean _tmp1_;
#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 1355 "installed-media.c"
	} else {
#line 102 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp0_ = GVIR_CONFIG_DOMAIN_DISK_BLOCK;
#line 1359 "installed-media.c"
	}
#line 102 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installer_media_add_cd_config ((BoxesInstallerMedia*) self, domain, _tmp0_, NULL, "hdc", FALSE);
#line 1363 "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 1372 "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 1381 "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 1407 "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 1425 "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 1442 "installed-media.c"
}


static void
boxes_installed_media_guess_os_from_filename_async_ready_wrapper (GObject *source_object,
                                                                  GAsyncResult *res,
                                                                  void *user_data)
{
	BoxesInstalledMediaGuessOsFromFilenameData* _task_data_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_task_data_->_callback_ != NULL) {
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 1458 "installed-media.c"
	}
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_task_data_->_task_complete_ = TRUE;
#line 1462 "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_;
#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_->_callback_ = _callback_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, boxes_installed_media_guess_os_from_filename_async_ready_wrapper, _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 1485 "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_ = _g_object_ref0 (os_db);
#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 = _tmp1_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_guess_os_from_filename_co (_data_);
#line 1501 "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 1518 "installed-media.c"
	}
#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 1526 "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 1546 "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 1555 "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 1564 "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 1575 "installed-media.c"
		goto _state_0;
#line 118 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 1:
#line 1579 "installed-media.c"
		goto _state_1;
#line 118 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 2:
#line 1583 "installed-media.c"
		goto _state_2;
		default:
#line 118 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_assert_not_reached ();
#line 1588 "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"
	if (!string_contains (_data_->_tmp1_, "gnome-continuous")) {
#line 119 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp2_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 119 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp0_ = !string_contains (_data_->_tmp2_, "gnome-ostree");
#line 1599 "installed-media.c"
	} else {
#line 119 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp0_ = FALSE;
#line 1603 "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 1617 "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 1624 "installed-media.c"
	}
#line 122 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp3_ = boxes_installed_media_get_date_from_filename (_data_->self);
#line 122 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->date = _data_->_tmp3_;
#line 123 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp4_ = _data_->date;
#line 123 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp4_ == NULL) {
#line 1634 "installed-media.c"
		{
#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_->os_db, "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 1642 "installed-media.c"
			_state_1:
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp6_ = boxes_os_database_get_os_by_id_finish (_data_->os_db, _data_->_res_, &_data_->_inner_error_);
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp5_ = _data_->_tmp6_;
#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 1652 "installed-media.c"
					goto __catch10_boxes_os_database_error_unknown_os_id;
				}
				goto __finally10;
			}
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp7_ = _data_->_tmp5_;
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp5_ = NULL;
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->result = _data_->_tmp7_;
#line 127 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->_tmp5_);
#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 1675 "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 1682 "installed-media.c"
		}
		goto __finally10;
		__catch10_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 1707 "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 1714 "installed-media.c"
		}
		__finally10:
#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 1727 "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 1739 "installed-media.c"
		}
	}
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp8_ = _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_->os_db, "gnome", _data_->_tmp8_, boxes_installed_media_guess_os_from_filename_ready, _data_);
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 1750 "installed-media.c"
	_state_2:
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_ = boxes_os_database_list_os_by_distro_finish (_data_->os_db, _data_->_res_, &_data_->_inner_error_);
#line 135 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->os_list = _data_->_tmp9_;
#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 1768 "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 1780 "installed-media.c"
		}
	}
#line 136 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp10_ = _data_->os_list;
#line 136 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (g_list_length (_data_->_tmp10_) > ((guint) 0)) {
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp11_ = _data_->os_list;
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp12_ = _data_->_tmp11_->data;
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp13_ = _g_object_ref0 ((OsinfoOs*) _data_->_tmp12_);
#line 137 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->result = _data_->_tmp13_;
#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 1807 "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 1814 "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 1830 "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 1837 "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 1843 "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_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp6_ = FALSE;
	gchar* _tmp8_;
#line 1369 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1370 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp0_ = strlen (self);
#line 1370 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp1_ = _tmp0_;
#line 1370 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	string_length = (glong) _tmp1_;
#line 1371 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	if (start < ((glong) 0)) {
#line 1869 "installed-media.c"
		glong _tmp2_;
#line 1372 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp2_ = string_length;
#line 1372 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		start = _tmp2_ + start;
#line 1875 "installed-media.c"
	}
#line 1374 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	if (end < ((glong) 0)) {
#line 1879 "installed-media.c"
		glong _tmp3_;
#line 1375 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp3_ = string_length;
#line 1375 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		end = _tmp3_ + end;
#line 1885 "installed-media.c"
	}
#line 1377 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	if (start >= ((glong) 0)) {
#line 1889 "installed-media.c"
		glong _tmp5_;
#line 1377 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp5_ = string_length;
#line 1377 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp4_ = start <= _tmp5_;
#line 1895 "installed-media.c"
	} else {
#line 1377 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp4_ = FALSE;
#line 1899 "installed-media.c"
	}
#line 1377 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp4_, NULL);
#line 1378 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	if (end >= ((glong) 0)) {
#line 1905 "installed-media.c"
		glong _tmp7_;
#line 1378 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp7_ = string_length;
#line 1378 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp6_ = end <= _tmp7_;
#line 1911 "installed-media.c"
	} else {
#line 1378 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp6_ = FALSE;
#line 1915 "installed-media.c"
	}
#line 1378 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (_tmp6_, NULL);
#line 1379 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (start <= end, NULL);
#line 1380 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	_tmp8_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
#line 1380 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	result = _tmp8_;
#line 1380 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	return result;
#line 1927 "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 1941 "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 1950 "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_;
	gchar* date_str = NULL;
	GMatchInfo* _tmp4_;
	gchar* _tmp5_;
	GDate date = {0};
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	GDate* _tmp15_;
#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"
	if (!g_match_info_matches (_tmp3_)) {
#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 1999 "installed-media.c"
	}
#line 149 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp4_ = match_info;
#line 149 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp5_ = g_match_info_fetch (_tmp4_, 0);
#line 149 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	date_str = _tmp5_;
#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"
	_tmp6_ = date_str;
#line 151 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp7_ = string_slice (_tmp6_, (glong) 0, (glong) 4);
#line 151 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp8_ = _tmp7_;
#line 151 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_date_set_year (&date, (GDateYear) atoi (_tmp8_));
#line 151 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_tmp8_);
#line 152 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp9_ = date_str;
#line 152 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp10_ = string_slice (_tmp9_, (glong) 4, (glong) 6);
#line 152 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp11_ = _tmp10_;
#line 152 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_date_set_month (&date, (GDateMonth) atoi (_tmp11_));
#line 152 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_tmp11_);
#line 153 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp12_ = date_str;
#line 153 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp13_ = string_slice (_tmp12_, (glong) 6, (glong) 8);
#line 153 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp14_ = _tmp13_;
#line 153 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	g_date_set_day (&date, (GDateDay) atoi (_tmp14_));
#line 153 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_tmp14_);
#line 155 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_tmp15_ = __g_date_dup0 (&date);
#line 155 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	result = _tmp15_;
#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 2049 "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 2062 "installed-media.c"
}


static void
boxes_installed_media_decompress_async_ready_wrapper (GObject *source_object,
                                                      GAsyncResult *res,
                                                      void *user_data)
{
	BoxesInstalledMediaDecompressData* _task_data_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_task_data_ = g_task_get_task_data (G_TASK (res));
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_task_data_->_callback_ != NULL) {
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_task_data_->_callback_ (source_object, res, user_data);
#line 2078 "installed-media.c"
	}
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_task_data_->_task_complete_ = TRUE;
#line 2082 "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_->_callback_ = _callback_;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, boxes_installed_media_decompress_async_ready_wrapper, _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 2103 "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 2113 "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 2128 "installed-media.c"
		gboolean _tmp0_ = FALSE;
#line 5 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return _tmp0_;
#line 2132 "installed-media.c"
	}
#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 2138 "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 2158 "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 1421 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1421 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (old != NULL, NULL);
#line 1421 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	g_return_val_if_fail (replacement != NULL, NULL);
#line 1422 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	if ((*((gchar*) self)) == '\0') {
#line 1422 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp1_ = TRUE;
#line 2181 "installed-media.c"
	} else {
#line 1422 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp1_ = (*((gchar*) old)) == '\0';
#line 2185 "installed-media.c"
	}
#line 1422 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	if (_tmp1_) {
#line 1422 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp0_ = TRUE;
#line 2191 "installed-media.c"
	} else {
#line 1422 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
#line 2195 "installed-media.c"
	}
#line 1422 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	if (_tmp0_) {
#line 2199 "installed-media.c"
		gchar* _tmp2_;
#line 1423 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp2_ = g_strdup (self);
#line 1423 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		result = _tmp2_;
#line 1423 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		return result;
#line 2207 "installed-media.c"
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
#line 1426 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp3_ = g_regex_escape_string (old, -1);
#line 1426 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp4_ = _tmp3_;
#line 1426 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error_);
#line 1426 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp6_ = _tmp5_;
#line 1426 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_g_free0 (_tmp4_);
#line 1426 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		regex = _tmp6_;
#line 1426 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1426 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
			if (_inner_error_->domain == G_REGEX_ERROR) {
#line 2235 "installed-media.c"
				goto __catch11_g_regex_error;
			}
#line 1426 "/home/fborges/jhbuild/install/share/vala-0.40/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 1426 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
			g_clear_error (&_inner_error_);
#line 1426 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
			return NULL;
#line 2244 "installed-media.c"
		}
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp8_ = regex;
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error_);
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp7_ = _tmp9_;
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
			if (_inner_error_->domain == G_REGEX_ERROR) {
#line 2258 "installed-media.c"
				goto __catch11_g_regex_error;
			}
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/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 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
			g_clear_error (&_inner_error_);
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
			return NULL;
#line 2269 "installed-media.c"
		}
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp10_ = _tmp7_;
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_tmp7_ = NULL;
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		result = _tmp10_;
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_g_free0 (_tmp7_);
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_g_regex_unref0 (regex);
#line 1427 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		return result;
#line 2283 "installed-media.c"
	}
	goto __finally11;
	__catch11_g_regex_error:
	{
		GError* e = NULL;
#line 1425 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		e = _inner_error_;
#line 1425 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_inner_error_ = NULL;
#line 1429 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		g_assert_not_reached ();
#line 1425 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		_g_error_free0 (e);
#line 2297 "installed-media.c"
	}
	__finally11:
#line 1425 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 1425 "/home/fborges/jhbuild/install/share/vala-0.40/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 1425 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		g_clear_error (&_inner_error_);
#line 1425 "/home/fborges/jhbuild/install/share/vala-0.40/vapi/glib-2.0.vapi"
		return NULL;
#line 2308 "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 2320 "installed-media.c"
		goto _state_0;
#line 158 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 1:
#line 2324 "installed-media.c"
		goto _state_1;
#line 158 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 2:
#line 2328 "installed-media.c"
		goto _state_2;
#line 158 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		case 3:
#line 2332 "installed-media.c"
		goto _state_3;
		default:
#line 158 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		g_assert_not_reached ();
#line 2337 "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"
	if (!g_str_has_suffix (_data_->_tmp0_, ".gz")) {
#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 2354 "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 2361 "installed-media.c"
	}
#line 162 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp1_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 162 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp2_ = g_file_new_for_path (_data_->_tmp1_);
#line 162 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->compressed = _data_->_tmp2_;
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp3_ = _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_->_tmp3_, G_PRIORITY_DEFAULT, NULL, boxes_installed_media_decompress_ready, _data_);
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 2377 "installed-media.c"
	_state_1:
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp4_ = g_file_read_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
#line 163 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->input_stream = _data_->_tmp4_;
#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 2393 "installed-media.c"
	}
#line 165 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp5_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 165 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp6_ = g_path_get_basename (_data_->_tmp5_);
#line 165 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp7_ = _data_->_tmp6_;
#line 165 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp8_ = string_replace (_data_->_tmp7_, ".gz", "");
#line 165 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_ = _data_->_tmp8_;
#line 165 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->_tmp7_);
#line 165 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->decompressed_path = _data_->_tmp9_;
#line 166 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp10_ = _data_->decompressed_path;
#line 166 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp11_ = boxes_get_user_pkgcache (_data_->_tmp10_);
#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_->_tmp11_;
#line 167 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp12_ = _data_->decompressed_path;
#line 167 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp13_ = g_file_new_for_path (_data_->_tmp12_);
#line 167 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->decompressed = _data_->_tmp13_;
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp14_ = _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_->_tmp14_, 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 2431 "installed-media.c"
	_state_2:
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp15_ = g_file_replace_finish (_data_->_tmp14_, _data_->_res_, &_data_->_inner_error_);
#line 168 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->output_stream = (GOutputStream*) _data_->_tmp15_;
#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 2453 "installed-media.c"
	}
#line 171 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp16_ = g_zlib_decompressor_new (G_ZLIB_COMPRESSOR_FORMAT_GZIP);
#line 171 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->decompressor = _data_->_tmp16_;
#line 172 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp17_ = _data_->output_stream;
#line 172 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp18_ = _data_->decompressor;
#line 172 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp19_ = (GConverterOutputStream*) g_converter_output_stream_new (_data_->_tmp17_, (GConverter*) _data_->_tmp18_);
#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_->_tmp19_;
#line 174 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp20_ = ((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_->_tmp20_);
#line 175 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp21_ = g_new0 (guint8, 1048576);
#line 175 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->buffer = _data_->_tmp21_;
#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_->_tmp22_ = _data_->input_stream;
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp23_ = _data_->buffer;
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp23__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_->_tmp22_, _data_->_tmp23_, (gsize) _data_->_tmp23__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 2495 "installed-media.c"
		_state_3:
#line 177 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->length = g_input_stream_read_finish ((GInputStream*) _data_->_tmp22_, _data_->_res_, &_data_->_inner_error_);
#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 2521 "installed-media.c"
		}
#line 178 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_data_->_tmp24_ = _data_->length;
#line 178 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		if (_data_->_tmp24_ <= ((gssize) 0)) {
#line 179 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			break;
#line 2529 "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 2535 "installed-media.c"
		{
#line 182 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			_data_->_tmp25_ = 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_->_tmp25_) {
#line 185 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_data_->_tmp26_ = _data_->i;
#line 185 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_data_->_tmp27_ = _data_->length;
#line 185 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					if (!(_data_->_tmp26_ < _data_->_tmp27_)) {
#line 185 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
						break;
#line 2551 "installed-media.c"
					}
				}
#line 182 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp25_ = FALSE;
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp29_ = _data_->output_stream;
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp30_ = _data_->buffer;
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp30__length1 = _data_->buffer_length1;
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp31_ = _data_->i;
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp32_ = _data_->length;
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp28_ = g_output_stream_write (_data_->_tmp29_, _data_->_tmp30_ + ((gint) _data_->_tmp31_), (gsize) (((gint) _data_->_tmp32_) - ((gint) _data_->_tmp31_)), NULL, &_data_->_inner_error_);
#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 2590 "installed-media.c"
				}
#line 183 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->written = _data_->_tmp28_;
#line 184 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp33_ = _data_->i;
#line 184 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->_tmp34_ = _data_->written;
#line 184 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_data_->i = _data_->_tmp33_ + _data_->_tmp34_;
#line 2600 "installed-media.c"
			}
		}
	}
#line 187 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp35_ = ((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_->_tmp35_);
#line 189 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp36_ = _data_->decompressed_path;
#line 189 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	_data_->_tmp37_ = g_strdup (_data_->_tmp36_);
#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_->_tmp37_;
#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 2640 "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 2647 "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 2662 "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 2677 "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 2692 "installed-media.c"
}


static gchar*
boxes_installed_media_real_get_architecture (BoxesInstallerMedia* base)
{
	gchar* result;
	BoxesInstalledMedia* self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_;
#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"
	if (string_contains (_tmp1_, "amd64")) {
#line 23 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp0_ = TRUE;
#line 2711 "installed-media.c"
	} else {
		const gchar* _tmp2_;
#line 23 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp2_ = ((BoxesInstallerMedia*) self)->device_file;
#line 23 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp0_ = string_contains (_tmp2_, "x86_64");
#line 2718 "installed-media.c"
	}
#line 23 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
	if (_tmp0_) {
#line 2722 "installed-media.c"
		gchar* _tmp3_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp3_ = g_strdup ("x86_64");
#line 24 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		result = _tmp3_;
#line 24 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		return result;
#line 2730 "installed-media.c"
	} else {
		gchar** arch_list = NULL;
		gchar* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		gchar* _tmp7_;
		gchar** _tmp8_;
		gint arch_list_length1;
		gint _arch_list_size_;
		gchar** _tmp9_;
		gint _tmp9__length1;
		const gchar* _tmp13_;
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp4_ = g_strdup ("i686");
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp5_ = g_strdup ("i586");
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp6_ = g_strdup ("i486");
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp7_ = g_strdup ("i386");
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp8_ = g_new0 (gchar*, 4 + 1);
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp8_[0] = _tmp4_;
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp8_[1] = _tmp5_;
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp8_[2] = _tmp6_;
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp8_[3] = _tmp7_;
#line 26 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		arch_list = _tmp8_;
#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"
		_tmp9_ = arch_list;
#line 27 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp9__length1 = arch_list_length1;
#line 2771 "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 = _tmp9_;
#line 27 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			arch_collection_length1 = _tmp9__length1;
#line 27 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
			for (arch_it = 0; arch_it < _tmp9__length1; arch_it = arch_it + 1) {
#line 2783 "installed-media.c"
				gchar* _tmp10_;
				gchar* arch = NULL;
#line 27 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				_tmp10_ = g_strdup (arch_collection[arch_it]);
#line 27 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
				arch = _tmp10_;
#line 2790 "installed-media.c"
				{
					const gchar* _tmp11_;
					const gchar* _tmp12_;
#line 28 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_tmp11_ = ((BoxesInstallerMedia*) self)->device_file;
#line 28 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_tmp12_ = arch;
#line 28 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					if (string_contains (_tmp11_, _tmp12_)) {
#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 2806 "installed-media.c"
					}
#line 27 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
					_g_free0 (arch);
#line 2810 "installed-media.c"
				}
			}
		}
#line 32 "/home/fborges/checkout/gnome-boxes/src/installed-media.vala"
		_tmp13_ = ((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'.", _tmp13_);
#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 2824 "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_PROPERTY, boxes_installed_media_properties[BOXES_INSTALLED_MEDIA_NEED_USER_INPUT_FOR_VM_CREATION_PROPERTY] = 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_PROPERTY, boxes_installed_media_properties[BOXES_INSTALLED_MEDIA_READY_TO_CREATE_PROPERTY] = 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_PROPERTY, boxes_installed_media_properties[BOXES_INSTALLED_MEDIA_LIVE_PROPERTY] = 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_PROPERTY, boxes_installed_media_properties[BOXES_INSTALLED_MEDIA_ARCHITECTURE_PROPERTY] = 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 2865 "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 2883 "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_PROPERTY:
#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_PROPERTY:
#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_PROPERTY:
#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_PROPERTY:
#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 2935 "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 2941 "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);
}



