/* installed-media.c generated by valac 0.21.1.35-83443, 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;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _BoxesInstalledMediaConvertToNativeFormatData BoxesInstalledMediaConvertToNativeFormatData;
#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_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (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_);
	void (*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_, GError** error);
	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_vbox) (BoxesInstallerMedia* self, GtkBox* setup_vbox);
	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;
};

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

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


static gpointer boxes_installed_media_parent_class = 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;
enum  {
	BOXES_INSTALLED_MEDIA_DUMMY_PROPERTY,
	BOXES_INSTALLED_MEDIA_NEED_USER_INPUT_FOR_VM_CREATION,
	BOXES_INSTALLED_MEDIA_READY_TO_CREATE,
	BOXES_INSTALLED_MEDIA_LIVE,
	BOXES_INSTALLED_MEDIA_FORMAT,
	BOXES_INSTALLED_MEDIA_ARCHITECTURE
};
BoxesInstalledMedia* boxes_installed_media_new (const gchar* path, GError** error);
BoxesInstalledMedia* boxes_installed_media_construct (GType object_type, const gchar* path, GError** error);
BoxesInstallerMedia* boxes_installer_media_new (void);
BoxesInstallerMedia* boxes_installer_media_construct (GType object_type);
OsinfoResources* boxes_os_database_get_default_resources (void);
void boxes_installer_media_label_setup (BoxesInstallerMedia* self, const gchar* label);
static void boxes_installed_media_convert_to_native_format_data_free (gpointer _data);
void boxes_installed_media_convert_to_native_format (BoxesInstalledMedia* self, const gchar* destination_path, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_installed_media_convert_to_native_format_finish (BoxesInstalledMedia* self, GAsyncResult* _res_, GError** error);
static gboolean boxes_installed_media_convert_to_native_format_co (BoxesInstalledMediaConvertToNativeFormatData* _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_convert_to_native_format_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_installed_media_real_setup_domain_config (BoxesInstallerMedia* base, GVirConfigDomain* domain);
static GList* boxes_installed_media_real_get_vm_properties (BoxesInstallerMedia* base);
static void _boxes_pair_unref0_ (gpointer var);
static 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_decompress_data_free (gpointer _data);
static gboolean boxes_installed_media_decompress_co (BoxesInstalledMediaDecompressData* _data_);
static void boxes_installed_media_decompress_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
const gchar* boxes_installed_media_get_format (BoxesInstalledMedia* self);
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);
gchar* boxes_installer_media_get_architecture (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);

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"};

BoxesInstalledMedia* boxes_installed_media_construct (GType object_type, const gchar* path, GError** error) {
	BoxesInstalledMedia * self = NULL;
	gboolean supported = FALSE;
	gboolean _tmp4_ = FALSE;
	const gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	OsinfoResources* _tmp9_ = NULL;
	GError * _inner_error_ = NULL;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_return_val_if_fail (path != NULL, NULL);
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) boxes_installer_media_construct (object_type);
#line 40 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	supported = FALSE;
#line 288 "installed-media.c"
	{
		const gchar** extension_collection = NULL;
		gint extension_collection_length1 = 0;
		gint _extension_collection_size_ = 0;
		gint extension_it = 0;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		extension_collection = BOXES_INSTALLED_MEDIA_supported_extensions;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		extension_collection_length1 = G_N_ELEMENTS (BOXES_INSTALLED_MEDIA_supported_extensions);
#line 41 "/extra-data/checkout/gnome/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 300 "installed-media.c"
			const gchar* extension = NULL;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			extension = extension_collection[extension_it];
#line 304 "installed-media.c"
			{
				const gchar* _tmp0_ = NULL;
				const gchar* _tmp1_ = NULL;
				gboolean _tmp2_ = FALSE;
				gboolean _tmp3_ = FALSE;
#line 42 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_tmp0_ = path;
#line 42 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_tmp1_ = extension;
#line 42 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_tmp2_ = g_str_has_suffix (_tmp0_, _tmp1_);
#line 42 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				supported = _tmp2_;
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_tmp3_ = supported;
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				if (_tmp3_) {
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					break;
#line 324 "installed-media.c"
				}
			}
		}
	}
#line 47 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp4_ = supported;
#line 47 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (!_tmp4_) {
#line 333 "installed-media.c"
		const gchar* _tmp5_ = NULL;
		GError* _tmp6_ = NULL;
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp5_ = _ ("Unsupported disk image format.");
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp6_ = g_error_new_literal (BOXES_ERROR, BOXES_ERROR_INVALID, _tmp5_);
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_inner_error_ = _tmp6_;
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_propagate_error (error, _inner_error_);
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (self);
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		return NULL;
#line 348 "installed-media.c"
	}
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp7_ = path;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp8_ = g_strdup (_tmp7_);
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_free0 (((BoxesInstallerMedia*) self)->device_file);
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	((BoxesInstallerMedia*) self)->device_file = _tmp8_;
#line 51 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	((BoxesInstallerMedia*) self)->from_image = TRUE;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp9_ = boxes_os_database_get_default_resources ();
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (((BoxesInstallerMedia*) self)->resources);
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	((BoxesInstallerMedia*) self)->resources = _tmp9_;
#line 54 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	boxes_installer_media_label_setup ((BoxesInstallerMedia*) self, NULL);
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return self;
#line 370 "installed-media.c"
}


BoxesInstalledMedia* boxes_installed_media_new (const gchar* path, GError** error) {
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return boxes_installed_media_construct (BOXES_TYPE_INSTALLED_MEDIA, path, error);
#line 377 "installed-media.c"
}


static void boxes_installed_media_convert_to_native_format_data_free (gpointer _data) {
	BoxesInstalledMediaConvertToNativeFormatData* _data_;
	_data_ = _data;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->destination_path);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->self);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_slice_free (BoxesInstalledMediaConvertToNativeFormatData, _data_);
#line 390 "installed-media.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return self ? g_object_ref (self) : NULL;
#line 397 "installed-media.c"
}


void boxes_installed_media_convert_to_native_format (BoxesInstalledMedia* self, const gchar* destination_path, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesInstalledMediaConvertToNativeFormatData* _data_;
	BoxesInstalledMedia* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_ = g_slice_new0 (BoxesInstalledMediaConvertToNativeFormatData);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_installed_media_convert_to_native_format);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_installed_media_convert_to_native_format_data_free);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->self = _tmp0_;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp1_ = destination_path;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->destination_path);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->destination_path = _tmp2_;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_convert_to_native_format_co (_data_);
#line 426 "installed-media.c"
}


void boxes_installed_media_convert_to_native_format_finish (BoxesInstalledMedia* self, GAsyncResult* _res_, GError** error) {
	BoxesInstalledMediaConvertToNativeFormatData* _data_;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		return;
#line 436 "installed-media.c"
	}
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 440 "installed-media.c"
}


static void boxes_installed_media_convert_to_native_format_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesInstalledMediaConvertToNativeFormatData* _data_;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_ = _user_data_;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_source_object_ = source_object;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_res_ = _res_;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_convert_to_native_format_co (_data_);
#line 454 "installed-media.c"
}


static gboolean boxes_installed_media_convert_to_native_format_co (BoxesInstalledMediaConvertToNativeFormatData* _data_) {
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	switch (_data_->_state_) {
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		case 0:
#line 463 "installed-media.c"
		goto _state_0;
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		case 1:
#line 467 "installed-media.c"
		goto _state_1;
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		case 2:
#line 471 "installed-media.c"
		goto _state_2;
		default:
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_assert_not_reached ();
#line 476 "installed-media.c"
	}
	_state_0:
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_state_ = 1;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_decompress (_data_->self, boxes_installed_media_convert_to_native_format_ready, _data_);
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 485 "installed-media.c"
	_state_1:
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp0_ = FALSE;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp0_ = boxes_installed_media_decompress_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->decompressed = _data_->_tmp0_;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (_data_->_inner_error_ != NULL) {
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_error_free (_data_->_inner_error_);
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		if (_data_->_state_ == 0) {
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 503 "installed-media.c"
		} else {
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 507 "installed-media.c"
		}
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 513 "installed-media.c"
	}
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp1_ = NULL;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp1_ = g_strdup ("qemu-img");
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp2_ = NULL;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp2_ = g_strdup ("convert");
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp3_ = NULL;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp3_ = g_strdup ("-O");
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp4_ = NULL;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp4_ = g_strdup ("qcow2");
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp5_ = NULL;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp5_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp6_ = NULL;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp6_ = g_strdup (_data_->_tmp5_);
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp7_ = NULL;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp7_ = _data_->destination_path;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp8_ = NULL;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp8_ = g_strdup (_data_->_tmp7_);
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_ = NULL;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_ = g_new0 (gchar*, 6 + 1);
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_[0] = _data_->_tmp1_;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_[1] = _data_->_tmp2_;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_[2] = _data_->_tmp3_;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_[3] = _data_->_tmp4_;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_[4] = _data_->_tmp6_;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_[5] = _data_->_tmp8_;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->argv_length1 = 0;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_argv_size_ = 0;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->argv = _data_->_tmp9_;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->argv_length1 = 6;
#line 60 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_argv_size_ = _data_->argv_length1;
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp10_ = NULL;
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp10_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp11_ = FALSE;
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp11_ = g_str_has_suffix (_data_->_tmp10_, ".qcow2");
#line 62 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->converting = !_data_->_tmp11_;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp13_ = FALSE;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp13_ = _data_->converting;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp13_) {
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp12_ = " while converting it to 'qcow2' format";
#line 591 "installed-media.c"
	} else {
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp12_ = "";
#line 595 "installed-media.c"
	}
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp14_ = NULL;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp14_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp15_ = NULL;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp15_ = _data_->destination_path;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp16_ = NULL;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp16_ = _data_->_tmp12_;
#line 64 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_debug ("installed-media.vala:64: Copying '%s' to '%s'%s.", _data_->_tmp14_, _data_->_tmp15_, _data_->_tmp16_);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp17_ = NULL;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp17__length1 = 0;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp17_ = _data_->argv;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp17__length1 = _data_->argv_length1;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_state_ = 2;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	boxes_exec (_data_->_tmp17_, _data_->_tmp17__length1, NULL, boxes_installed_media_convert_to_native_format_ready, _data_);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 625 "installed-media.c"
	_state_2:
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	boxes_exec_finish (_data_->_res_, NULL, NULL, &_data_->_inner_error_);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (_data_->_inner_error_ != NULL) {
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_error_free (_data_->_inner_error_);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		if (_data_->_state_ == 0) {
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 641 "installed-media.c"
		} else {
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 645 "installed-media.c"
		}
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 651 "installed-media.c"
	}
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp18_ = NULL;
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp18_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp19_ = NULL;
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp19_ = _data_->destination_path;
#line 69 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_debug ("installed-media.vala:69: Finished copying '%s' to '%s'", _data_->_tmp18_, _data_->_tmp19_);
#line 71 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp20_ = FALSE;
#line 71 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp20_ = _data_->decompressed;
#line 71 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (_data_->_tmp20_) {
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp21_ = NULL;
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp21_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp22_ = NULL;
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp22_ = g_file_new_for_path (_data_->_tmp21_);
#line 73 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->file = _data_->_tmp22_;
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp23_ = NULL;
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp23_ = _data_->file;
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		boxes_delete_file (_data_->_tmp23_, &_data_->_inner_error_);
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		if (_data_->_inner_error_ != NULL) {
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_error_free (_data_->_inner_error_);
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->file);
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			if (_data_->_state_ == 0) {
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 699 "installed-media.c"
			} else {
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				g_simple_async_result_complete (_data_->_async_result);
#line 703 "installed-media.c"
			}
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_object_unref (_data_->_async_result);
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			return FALSE;
#line 709 "installed-media.c"
		}
#line 71 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->file);
#line 713 "installed-media.c"
	}
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->argv = (_vala_array_free (_data_->argv, _data_->argv_length1, (GDestroyNotify) g_free), NULL);
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (_data_->_state_ == 0) {
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 721 "installed-media.c"
	} else {
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 725 "installed-media.c"
	}
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_object_unref (_data_->_async_result);
#line 57 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 731 "installed-media.c"
}


static void boxes_installed_media_real_setup_domain_config (BoxesInstallerMedia* base, GVirConfigDomain* domain) {
	BoxesInstalledMedia * self;
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) base;
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_return_if_fail (domain != NULL);
#line 741 "installed-media.c"
}


static void _boxes_pair_unref0_ (gpointer var) {
#line 80 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	(var == NULL) ? NULL : (var = (boxes_pair_unref (var), NULL));
#line 748 "installed-media.c"
}


static void _g_list_free__boxes_pair_unref0_ (GList* self) {
#line 80 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_list_foreach (self, (GFunc) _boxes_pair_unref0_, NULL);
#line 80 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_list_free (self);
#line 757 "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_ = NULL;
	const gchar* _tmp1_ = NULL;
	BoxesPair* _tmp2_ = NULL;
#line 80 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) base;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	properties = NULL;
#line 83 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp0_ = _ ("System");
#line 83 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp1_ = ((BoxesInstallerMedia*) self)->label;
#line 83 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp2_ = boxes_pair_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, _tmp0_, _tmp1_);
#line 83 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	properties = g_list_append (properties, _tmp2_);
#line 85 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	result = properties;
#line 85 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return result;
#line 784 "installed-media.c"
}


static BoxesVMCreator* boxes_installed_media_real_get_vm_creator (BoxesInstallerMedia* base) {
	BoxesInstalledMedia * self;
	BoxesVMCreator* result = NULL;
	BoxesVMImporter* _tmp0_ = NULL;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) base;
#line 90 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp0_ = boxes_vm_importer_new (self);
#line 90 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	result = (BoxesVMCreator*) _tmp0_;
#line 90 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return result;
#line 800 "installed-media.c"
}


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


static void boxes_installed_media_decompress (BoxesInstalledMedia* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesInstalledMediaDecompressData* _data_;
	BoxesInstalledMedia* _tmp0_ = NULL;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_ = g_slice_new0 (BoxesInstalledMediaDecompressData);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_installed_media_decompress);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_installed_media_decompress_data_free);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->self = _tmp0_;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_decompress_co (_data_);
#line 830 "installed-media.c"
}


static gboolean boxes_installed_media_decompress_finish (BoxesInstalledMedia* self, GAsyncResult* _res_, GError** error) {
	gboolean result;
	BoxesInstalledMediaDecompressData* _data_;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 841 "installed-media.c"
	}
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	result = _data_->result;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return result;
#line 849 "installed-media.c"
}


static void boxes_installed_media_decompress_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesInstalledMediaDecompressData* _data_;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_ = _user_data_;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_source_object_ = source_object;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_res_ = _res_;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_decompress_co (_data_);
#line 863 "installed-media.c"
}


static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
#line 1242 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1242 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
	g_return_val_if_fail (old != NULL, NULL);
#line 1242 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
	g_return_val_if_fail (replacement != NULL, NULL);
#line 876 "installed-media.c"
	{
		GRegex* regex = NULL;
		const gchar* _tmp0_ = NULL;
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_ = NULL;
		GRegex* _tmp3_ = NULL;
		GRegex* _tmp4_ = NULL;
		gchar* _tmp5_ = NULL;
		GRegex* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
#line 1244 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		_tmp0_ = old;
#line 1244 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		_tmp1_ = g_regex_escape_string (_tmp0_, -1);
#line 1244 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		_tmp2_ = _tmp1_;
#line 1244 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		_tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_);
#line 1244 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		_tmp4_ = _tmp3_;
#line 1244 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		_g_free0 (_tmp2_);
#line 1244 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		regex = _tmp4_;
#line 1244 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		if (_inner_error_ != NULL) {
#line 1244 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
			if (_inner_error_->domain == G_REGEX_ERROR) {
#line 906 "installed-media.c"
				goto __catch9_g_regex_error;
			}
#line 1244 "/home/zeenix/jhbuild/share/vala-0.22/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 1244 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
			g_clear_error (&_inner_error_);
#line 1244 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
			return NULL;
#line 915 "installed-media.c"
		}
#line 1245 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		_tmp6_ = regex;
#line 1245 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		_tmp7_ = replacement;
#line 1245 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		_tmp8_ = g_regex_replace_literal (_tmp6_, self, (gssize) (-1), 0, _tmp7_, 0, &_inner_error_);
#line 1245 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		_tmp5_ = _tmp8_;
#line 1245 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		if (_inner_error_ != NULL) {
#line 1245 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1245 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
			if (_inner_error_->domain == G_REGEX_ERROR) {
#line 931 "installed-media.c"
				goto __catch9_g_regex_error;
			}
#line 1245 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
			_g_regex_unref0 (regex);
#line 1245 "/home/zeenix/jhbuild/share/vala-0.22/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 1245 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
			g_clear_error (&_inner_error_);
#line 1245 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
			return NULL;
#line 942 "installed-media.c"
		}
#line 1245 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		result = _tmp5_;
#line 1245 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		_g_regex_unref0 (regex);
#line 1245 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		return result;
#line 950 "installed-media.c"
	}
	goto __finally9;
	__catch9_g_regex_error:
	{
		GError* e = NULL;
#line 1243 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		e = _inner_error_;
#line 1243 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		_inner_error_ = NULL;
#line 1247 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		g_assert_not_reached ();
#line 1243 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		_g_error_free0 (e);
#line 964 "installed-media.c"
	}
	__finally9:
#line 1243 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
	if (_inner_error_ != NULL) {
#line 1243 "/home/zeenix/jhbuild/share/vala-0.22/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 1243 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		g_clear_error (&_inner_error_);
#line 1243 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
		return NULL;
#line 975 "installed-media.c"
	}
}


static gboolean boxes_installed_media_decompress_co (BoxesInstalledMediaDecompressData* _data_) {
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	switch (_data_->_state_) {
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		case 0:
#line 985 "installed-media.c"
		goto _state_0;
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		case 1:
#line 989 "installed-media.c"
		goto _state_1;
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		case 2:
#line 993 "installed-media.c"
		goto _state_2;
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		case 3:
#line 997 "installed-media.c"
		goto _state_3;
		default:
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_assert_not_reached ();
#line 1002 "installed-media.c"
	}
	_state_0:
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp0_ = NULL;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp0_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp1_ = FALSE;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp1_ = g_str_has_suffix (_data_->_tmp0_, ".gz");
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (!_data_->_tmp1_) {
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->result = FALSE;
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		if (_data_->_state_ == 0) {
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1021 "installed-media.c"
		} else {
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1025 "installed-media.c"
		}
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 1031 "installed-media.c"
	}
#line 97 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp2_ = NULL;
#line 97 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp2_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 97 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp3_ = NULL;
#line 97 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp3_ = g_file_new_for_path (_data_->_tmp2_);
#line 97 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->compressed = _data_->_tmp3_;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp4_ = NULL;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp4_ = _data_->compressed;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_state_ = 1;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_file_read_async (_data_->_tmp4_, G_PRIORITY_DEFAULT, NULL, boxes_installed_media_decompress_ready, _data_);
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 1053 "installed-media.c"
	_state_1:
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp5_ = NULL;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp5_ = g_file_read_finish (_data_->_tmp4_, _data_->_res_, &_data_->_inner_error_);
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->input_stream = _data_->_tmp5_;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (_data_->_inner_error_ != NULL) {
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_error_free (_data_->_inner_error_);
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->compressed);
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		if (_data_->_state_ == 0) {
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1073 "installed-media.c"
		} else {
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1077 "installed-media.c"
		}
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 1083 "installed-media.c"
	}
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp6_ = NULL;
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp6_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp7_ = NULL;
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp7_ = g_path_get_basename (_data_->_tmp6_);
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp8_ = NULL;
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp8_ = _data_->_tmp7_;
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_ = NULL;
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp9_ = string_replace (_data_->_tmp8_, ".gz", "");
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp10_ = NULL;
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp10_ = _data_->_tmp9_;
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->_tmp8_);
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->decompressed_path = _data_->_tmp10_;
#line 101 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp11_ = NULL;
#line 101 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp11_ = _data_->decompressed_path;
#line 101 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp12_ = NULL;
#line 101 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp12_ = boxes_get_user_pkgcache (_data_->_tmp11_);
#line 101 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->decompressed_path);
#line 101 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->decompressed_path = _data_->_tmp12_;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp13_ = NULL;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp13_ = _data_->decompressed_path;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp14_ = NULL;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp14_ = g_file_new_for_path (_data_->_tmp13_);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->decompressed = _data_->_tmp14_;
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp15_ = NULL;
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp15_ = _data_->decompressed;
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_state_ = 2;
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_file_replace_async (_data_->_tmp15_, NULL, FALSE, G_FILE_CREATE_REPLACE_DESTINATION, G_PRIORITY_DEFAULT, NULL, boxes_installed_media_decompress_ready, _data_);
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 1141 "installed-media.c"
	_state_2:
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp16_ = NULL;
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp16_ = g_file_replace_finish (_data_->_tmp15_, _data_->_res_, &_data_->_inner_error_);
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->output_stream = (GOutputStream*) _data_->_tmp16_;
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (_data_->_inner_error_ != NULL) {
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_error_free (_data_->_inner_error_);
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->decompressed);
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_g_free0 (_data_->decompressed_path);
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->input_stream);
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_g_object_unref0 (_data_->compressed);
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		if (_data_->_state_ == 0) {
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1167 "installed-media.c"
		} else {
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 1171 "installed-media.c"
		}
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_object_unref (_data_->_async_result);
#line 103 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 1177 "installed-media.c"
	}
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp17_ = NULL;
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp17_ = g_zlib_decompressor_new (G_ZLIB_COMPRESSOR_FORMAT_GZIP);
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->decompressor = _data_->_tmp17_;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp18_ = NULL;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp18_ = _data_->output_stream;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp19_ = NULL;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp19_ = _data_->decompressor;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp20_ = NULL;
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp20_ = (GConverterOutputStream*) g_converter_output_stream_new (_data_->_tmp18_, (GConverter*) _data_->_tmp19_);
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->output_stream);
#line 107 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->output_stream = (GOutputStream*) _data_->_tmp20_;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp21_ = NULL;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp21_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_debug ("installed-media.vala:109: Decompressing '%s'..", _data_->_tmp21_);
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp22_ = NULL;
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp22_ = g_new0 (guint8, 1048576);
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->buffer_length1 = 0;
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_buffer_size_ = 0;
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->buffer = _data_->_tmp22_;
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->buffer_length1 = 1048576;
#line 110 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_buffer_size_ = _data_->buffer_length1;
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	while (TRUE) {
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp23_ = NULL;
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp23_ = _data_->input_stream;
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp24_ = NULL;
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp24__length1 = 0;
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp24_ = _data_->buffer;
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp24__length1 = _data_->buffer_length1;
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_state_ = 3;
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_input_stream_read_async ((GInputStream*) _data_->_tmp23_, _data_->_tmp24_, (gsize) _data_->_tmp24__length1, G_PRIORITY_DEFAULT, NULL, boxes_installed_media_decompress_ready, _data_);
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		return FALSE;
#line 1241 "installed-media.c"
		_state_3:
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp25_ = 0L;
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp25_ = g_input_stream_read_finish ((GInputStream*) _data_->_tmp23_, _data_->_res_, &_data_->_inner_error_);
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->length = _data_->_tmp25_;
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		if (_data_->_inner_error_ != NULL) {
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_error_free (_data_->_inner_error_);
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			_data_->buffer = (g_free (_data_->buffer), NULL);
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->decompressor);
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->output_stream);
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->decompressed);
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			_g_free0 (_data_->decompressed_path);
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->input_stream);
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			_g_object_unref0 (_data_->compressed);
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			if (_data_->_state_ == 0) {
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1273 "installed-media.c"
			} else {
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				g_simple_async_result_complete (_data_->_async_result);
#line 1277 "installed-media.c"
			}
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			g_object_unref (_data_->_async_result);
#line 112 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			return FALSE;
#line 1283 "installed-media.c"
		}
#line 113 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp26_ = 0L;
#line 113 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->_tmp26_ = _data_->length;
#line 113 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		if (_data_->_tmp26_ <= ((gssize) 0)) {
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			break;
#line 1293 "installed-media.c"
		}
#line 116 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->written = (gssize) 0;
#line 116 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_data_->i = (gssize) 0;
#line 1299 "installed-media.c"
		{
#line 117 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			_data_->_tmp27_ = TRUE;
#line 117 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			while (TRUE) {
#line 117 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp28_ = FALSE;
#line 117 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp28_ = _data_->_tmp27_;
#line 117 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				if (!_data_->_tmp28_) {
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_data_->_tmp29_ = 0L;
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_data_->_tmp29_ = _data_->i;
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_data_->_tmp30_ = 0L;
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_data_->_tmp30_ = _data_->length;
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					if (!(_data_->_tmp29_ < _data_->_tmp30_)) {
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
						break;
#line 1323 "installed-media.c"
					}
				}
#line 117 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp27_ = FALSE;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp32_ = NULL;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp32_ = _data_->output_stream;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp33_ = NULL;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp33__length1 = 0;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp33_ = _data_->buffer;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp33__length1 = _data_->buffer_length1;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp34_ = 0L;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp34_ = _data_->i;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp35_ = 0L;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp35_ = _data_->length;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp36_ = 0L;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp36_ = g_output_stream_write (_data_->_tmp32_, _data_->_tmp33_ + ((gint) _data_->_tmp34_), (gsize) (((gint) _data_->_tmp35_) - ((gint) _data_->_tmp34_)), NULL, &_data_->_inner_error_);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp31_ = _data_->_tmp36_;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				if (_data_->_inner_error_ != NULL) {
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					g_error_free (_data_->_inner_error_);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_data_->buffer = (g_free (_data_->buffer), NULL);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_g_object_unref0 (_data_->decompressor);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_g_object_unref0 (_data_->output_stream);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_g_object_unref0 (_data_->decompressed);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_g_free0 (_data_->decompressed_path);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_g_object_unref0 (_data_->input_stream);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_g_object_unref0 (_data_->compressed);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					if (_data_->_state_ == 0) {
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
						g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1378 "installed-media.c"
					} else {
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
						g_simple_async_result_complete (_data_->_async_result);
#line 1382 "installed-media.c"
					}
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					g_object_unref (_data_->_async_result);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					return FALSE;
#line 1388 "installed-media.c"
				}
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->written = _data_->_tmp31_;
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp37_ = 0L;
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp37_ = _data_->i;
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp38_ = 0L;
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->_tmp38_ = _data_->written;
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_data_->i = _data_->_tmp37_ + _data_->_tmp38_;
#line 1402 "installed-media.c"
			}
		}
	}
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp39_ = NULL;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp39_ = ((BoxesInstallerMedia*) _data_->self)->device_file;
#line 122 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_debug ("installed-media.vala:122: Decompressed '%s'.", _data_->_tmp39_);
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp40_ = NULL;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp40_ = _data_->decompressed_path;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp41_ = NULL;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->_tmp41_ = g_strdup (_data_->_tmp40_);
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_free0 (((BoxesInstallerMedia*) _data_->self)->device_file);
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	((BoxesInstallerMedia*) _data_->self)->device_file = _data_->_tmp41_;
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->result = TRUE;
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->buffer = (g_free (_data_->buffer), NULL);
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->decompressor);
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->output_stream);
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->decompressed);
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->decompressed_path);
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->input_stream);
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->compressed);
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (_data_->_state_ == 0) {
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1444 "installed-media.c"
	} else {
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1448 "installed-media.c"
	}
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_object_unref (_data_->_async_result);
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_data_->buffer = (g_free (_data_->buffer), NULL);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->decompressor);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->output_stream);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->decompressed);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_free0 (_data_->decompressed_path);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->input_stream);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_g_object_unref0 (_data_->compressed);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (_data_->_state_ == 0) {
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1472 "installed-media.c"
	} else {
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1476 "installed-media.c"
	}
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_object_unref (_data_->_async_result);
#line 93 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return FALSE;
#line 1482 "installed-media.c"
}


static gboolean boxes_installed_media_real_get_need_user_input_for_vm_creation (BoxesInstallerMedia* base) {
	gboolean result;
	BoxesInstalledMedia* self;
#line 15 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) base;
#line 15 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	result = FALSE;
#line 15 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return result;
#line 1495 "installed-media.c"
}


static gboolean boxes_installed_media_real_get_ready_to_create (BoxesInstallerMedia* base) {
	gboolean result;
	BoxesInstalledMedia* self;
#line 16 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) base;
#line 16 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	result = TRUE;
#line 16 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return result;
#line 1508 "installed-media.c"
}


static gboolean boxes_installed_media_real_get_live (BoxesInstallerMedia* base) {
	gboolean result;
	BoxesInstalledMedia* self;
#line 17 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) base;
#line 17 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	result = FALSE;
#line 17 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return result;
#line 1521 "installed-media.c"
}


const gchar* boxes_installed_media_get_format (BoxesInstalledMedia* self) {
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	const gchar* _tmp3_ = NULL;
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp1_ = ((BoxesInstallerMedia*) self)->device_file;
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp2_ = g_str_has_suffix (_tmp1_, ".qcow2");
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (_tmp2_) {
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp0_ = "qcow2";
#line 1541 "installed-media.c"
	} else {
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp0_ = "raw";
#line 1545 "installed-media.c"
	}
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp3_ = _tmp0_;
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	result = _tmp3_;
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	return result;
#line 1553 "installed-media.c"
}


static gboolean string_contains (const gchar* self, const gchar* needle) {
	gboolean result = FALSE;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
#line 1238 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, FALSE);
#line 1238 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
	g_return_val_if_fail (needle != NULL, FALSE);
#line 1239 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
	_tmp0_ = needle;
#line 1239 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
	_tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_);
#line 1239 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
	result = _tmp1_ != NULL;
#line 1239 "/home/zeenix/jhbuild/share/vala-0.22/vapi/glib-2.0.vapi"
	return result;
#line 1573 "installed-media.c"
}


static gchar* boxes_installed_media_real_get_architecture (BoxesInstallerMedia* base) {
	gchar* result;
	BoxesInstalledMedia* self;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp5_ = FALSE;
#line 22 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	self = (BoxesInstalledMedia*) base;
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp1_ = ((BoxesInstallerMedia*) self)->device_file;
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp2_ = string_contains (_tmp1_, "amd64");
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (_tmp2_) {
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp0_ = TRUE;
#line 1594 "installed-media.c"
	} else {
		const gchar* _tmp3_ = NULL;
		gboolean _tmp4_ = FALSE;
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp3_ = ((BoxesInstallerMedia*) self)->device_file;
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp4_ = string_contains (_tmp3_, "x86_64");
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp0_ = _tmp4_;
#line 1604 "installed-media.c"
	}
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	_tmp5_ = _tmp0_;
#line 24 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	if (_tmp5_) {
#line 1610 "installed-media.c"
		gchar* _tmp6_ = NULL;
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp6_ = g_strdup ("x86_64");
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		result = _tmp6_;
#line 25 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		return result;
#line 1618 "installed-media.c"
	} else {
		gchar** arch_list = NULL;
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_ = NULL;
		gchar* _tmp9_ = NULL;
		gchar* _tmp10_ = NULL;
		gchar** _tmp11_ = NULL;
		gint arch_list_length1 = 0;
		gint _arch_list_size_ = 0;
		gchar** _tmp12_ = NULL;
		gint _tmp12__length1 = 0;
		const gchar* _tmp17_ = NULL;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp7_ = g_strdup ("i686");
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp8_ = g_strdup ("i586");
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp9_ = g_strdup ("i486");
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp10_ = g_strdup ("i386");
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp11_ = g_new0 (gchar*, 4 + 1);
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp11_[0] = _tmp7_;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp11_[1] = _tmp8_;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp11_[2] = _tmp9_;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp11_[3] = _tmp10_;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		arch_list = _tmp11_;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		arch_list_length1 = 4;
#line 27 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_arch_list_size_ = arch_list_length1;
#line 28 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp12_ = arch_list;
#line 28 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp12__length1 = arch_list_length1;
#line 1659 "installed-media.c"
		{
			gchar** arch_collection = NULL;
			gint arch_collection_length1 = 0;
			gint _arch_collection_size_ = 0;
			gint arch_it = 0;
#line 28 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			arch_collection = _tmp12_;
#line 28 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			arch_collection_length1 = _tmp12__length1;
#line 28 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
			for (arch_it = 0; arch_it < _tmp12__length1; arch_it = arch_it + 1) {
#line 1671 "installed-media.c"
				gchar* _tmp13_ = NULL;
				gchar* arch = NULL;
#line 28 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				_tmp13_ = g_strdup (arch_collection[arch_it]);
#line 28 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
				arch = _tmp13_;
#line 1678 "installed-media.c"
				{
					const gchar* _tmp14_ = NULL;
					const gchar* _tmp15_ = NULL;
					gboolean _tmp16_ = FALSE;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_tmp14_ = ((BoxesInstallerMedia*) self)->device_file;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_tmp15_ = arch;
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_tmp16_ = string_contains (_tmp14_, _tmp15_);
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					if (_tmp16_) {
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
						result = arch;
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
						arch_list = (_vala_array_free (arch_list, arch_list_length1, (GDestroyNotify) g_free), NULL);
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
						return result;
#line 1697 "installed-media.c"
					}
#line 28 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
					_g_free0 (arch);
#line 1701 "installed-media.c"
				}
			}
		}
#line 33 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		_tmp17_ = ((BoxesInstallerMedia*) self)->device_file;
#line 33 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_debug ("installed-media.vala:33: Failed to guess architecture for media '%s'.", _tmp17_);
#line 34 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		result = NULL;
#line 34 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		arch_list = (_vala_array_free (arch_list, arch_list_length1, (GDestroyNotify) g_free), NULL);
#line 34 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		return result;
#line 1715 "installed-media.c"
	}
}


static void boxes_installed_media_class_init (BoxesInstalledMediaClass * klass) {
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	boxes_installed_media_parent_class = g_type_class_peek_parent (klass);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	BOXES_INSTALLER_MEDIA_CLASS (klass)->setup_domain_config = boxes_installed_media_real_setup_domain_config;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	BOXES_INSTALLER_MEDIA_CLASS (klass)->get_vm_properties = boxes_installed_media_real_get_vm_properties;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	BOXES_INSTALLER_MEDIA_CLASS (klass)->get_vm_creator = boxes_installed_media_real_get_vm_creator;
#line 5 "/extra-data/checkout/gnome/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 "/extra-data/checkout/gnome/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 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	BOXES_INSTALLER_MEDIA_CLASS (klass)->get_live = boxes_installed_media_real_get_live;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	BOXES_INSTALLER_MEDIA_CLASS (klass)->get_architecture = boxes_installed_media_real_get_architecture;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_installed_media_get_property;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_INSTALLED_MEDIA_NEED_USER_INPUT_FOR_VM_CREATION, g_param_spec_boolean ("need-user-input-for-vm-creation", "need-user-input-for-vm-creation", "need-user-input-for-vm-creation", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_INSTALLED_MEDIA_READY_TO_CREATE, g_param_spec_boolean ("ready-to-create", "ready-to-create", "ready-to-create", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_INSTALLED_MEDIA_LIVE, g_param_spec_boolean ("live", "live", "live", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_INSTALLED_MEDIA_FORMAT, g_param_spec_string ("format", "format", "format", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_INSTALLED_MEDIA_ARCHITECTURE, g_param_spec_string ("architecture", "architecture", "architecture", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
#line 1749 "installed-media.c"
}


static void boxes_installed_media_instance_init (BoxesInstalledMedia * self) {
}


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 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
	switch (property_id) {
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		case BOXES_INSTALLED_MEDIA_NEED_USER_INPUT_FOR_VM_CREATION:
#line 5 "/extra-data/checkout/gnome/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 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		break;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		case BOXES_INSTALLED_MEDIA_READY_TO_CREATE:
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_value_set_boolean (value, boxes_installer_media_get_ready_to_create ((BoxesInstallerMedia*) self));
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		break;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		case BOXES_INSTALLED_MEDIA_LIVE:
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_value_set_boolean (value, boxes_installer_media_get_live ((BoxesInstallerMedia*) self));
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		break;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		case BOXES_INSTALLED_MEDIA_FORMAT:
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_value_set_string (value, boxes_installed_media_get_format (self));
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		break;
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		case BOXES_INSTALLED_MEDIA_ARCHITECTURE:
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		g_value_take_string (value, boxes_installer_media_get_architecture ((BoxesInstallerMedia*) self));
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		break;
#line 1804 "installed-media.c"
		default:
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
#line 5 "/extra-data/checkout/gnome/gnome-boxes/src/installed-media.vala"
		break;
#line 1810 "installed-media.c"
	}
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/collection-view.vala"
	if ((array != NULL) && (destroy_func != NULL)) {
#line 1818 "installed-media.c"
		int i;
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/collection-view.vala"
		for (i = 0; i < array_length; i = i + 1) {
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/collection-view.vala"
			if (((gpointer*) array)[i] != NULL) {
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/collection-view.vala"
				destroy_func (((gpointer*) array)[i]);
#line 1826 "installed-media.c"
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/collection-view.vala"
	_vala_array_destroy (array, array_length, destroy_func);
#line 10 "/extra-data/checkout/gnome/gnome-boxes/src/collection-view.vala"
	g_free (array);
#line 1838 "installed-media.c"
}



