/* os-database.c generated by valac 0.18.0.29-efcd0, the Vala compiler
 * generated from os-database.vala, do not modify */

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

#include <glib.h>
#include <glib-object.h>
#include <osinfo/osinfo.h>
#include <gio/gio.h>
#include <libcommon.h>
#include <stdlib.h>
#include <string.h>


#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;
typedef struct _BoxesOSDatabasePrivate BoxesOSDatabasePrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block32Data Block32Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _BoxesOsDatabaseLoadData BoxesOsDatabaseLoadData;
typedef struct _BoxesOsDatabaseGuessOsFromInstallMediaData BoxesOsDatabaseGuessOsFromInstallMediaData;
typedef struct _BoxesOsDatabaseGetOsByIdData BoxesOsDatabaseGetOsByIdData;
typedef struct _Block33Data Block33Data;
typedef struct _Block34Data Block34Data;
typedef struct _BoxesOsDatabaseEnsureDbLoadedData BoxesOsDatabaseEnsureDbLoadedData;

typedef enum  {
	BOXES_OS_DATABASE_ERROR_NON_BOOTABLE,
	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 _BoxesOSDatabase {
	GObject parent_instance;
	BoxesOSDatabasePrivate * priv;
};

struct _BoxesOSDatabaseClass {
	GObjectClass parent_class;
};

struct _BoxesOSDatabasePrivate {
	OsinfoDb* db;
	gboolean db_loading;
};

struct _Block32Data {
	int _ref_count_;
	BoxesOSDatabase * self;
	OsinfoLoader* loader;
	gpointer _async_data_;
};

struct _BoxesOsDatabaseLoadData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesOSDatabase* self;
	Block32Data* _data32_;
	OsinfoLoader* _tmp0_;
	GError* e;
	GError* _tmp1_;
	const gchar* _tmp2_;
	GError* _vala1_e;
	GError* _tmp3_;
	const gchar* _tmp4_;
	OsinfoDb* _tmp5_;
	OsinfoDb* _tmp6_;
	GError * _inner_error_;
};

struct _BoxesOsDatabaseGuessOsFromInstallMediaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesOSDatabase* self;
	gchar* media_path;
	OsinfoMedia* os_media;
	GCancellable* cancellable;
	OsinfoOs* result;
	gboolean _tmp0_;
	const gchar* _tmp1_;
	GCancellable* _tmp2_;
	OsinfoMedia* _tmp3_;
	OsinfoMedia* media;
	OsinfoDb* _tmp4_;
	OsinfoMedia* _tmp5_;
	OsinfoMedia* _tmp6_;
	OsinfoOs* _tmp7_;
	OsinfoMedia* _tmp8_;
	OsinfoOs* _tmp9_;
	GError * _inner_error_;
};

struct _BoxesOsDatabaseGetOsByIdData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesOSDatabase* self;
	gchar* id;
	OsinfoOs* result;
	gboolean _tmp0_;
	const gchar* _tmp1_;
	GError* _tmp2_;
	OsinfoDb* _tmp3_;
	const gchar* _tmp4_;
	OsinfoOs* _tmp5_;
	OsinfoOs* _tmp6_;
	OsinfoOs* os;
	OsinfoOs* _tmp7_;
	const gchar* _tmp8_;
	GError* _tmp9_;
	GError * _inner_error_;
};

struct _Block33Data {
	int _ref_count_;
	BoxesOSDatabase * self;
	gpointer _async_data_;
};

struct _Block34Data {
	int _ref_count_;
	Block33Data * _data33_;
	gulong db_loaded_id;
};

struct _BoxesOsDatabaseEnsureDbLoadedData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesOSDatabase* self;
	gboolean result;
	Block33Data* _data33_;
	OsinfoDb* _tmp0_;
	gboolean _tmp1_;
	Block34Data* _data34_;
	gulong _tmp2_;
	OsinfoDb* _tmp3_;
};


static gpointer boxes_os_database_parent_class = NULL;

GQuark boxes_os_database_error_quark (void);
GType boxes_os_database_get_type (void) G_GNUC_CONST;
#define BOXES_OS_DATABASE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_OS_DATABASE, BoxesOSDatabasePrivate))
enum  {
	BOXES_OS_DATABASE_DUMMY_PROPERTY
};
#define BOXES_OS_DATABASE_DEFAULT_VCPUS 1
#define BOXES_OS_DATABASE_DEFAULT_RAM (500 * ((gint64) OSINFO_MEBIBYTES))
#define BOXES_OS_DATABASE_DEFAULT_STORAGE (20 * ((gint64) OSINFO_GIBIBYTES))
static OsinfoResources* boxes_os_database_get_default_resources (void);
static void boxes_os_database_load_data_free (gpointer _data);
void boxes_os_database_load (BoxesOSDatabase* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_os_database_load_finish (BoxesOSDatabase* self, GAsyncResult* _res_);
static gboolean boxes_os_database_load_co (BoxesOsDatabaseLoadData* _data_);
static Block32Data* block32_data_ref (Block32Data* _data32_);
static void block32_data_unref (void * _userdata_);
static void ___lambda48_ (Block32Data* _data32_, GError** error);
static void ____lambda48__boxes_run_in_thread_func (gpointer self, GError** error);
static void boxes_os_database_load_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void ___lambda49_ (Block32Data* _data32_, GError** error);
static void ____lambda49__boxes_run_in_thread_func (gpointer self, GError** error);
static void boxes_os_database_guess_os_from_install_media_data_free (gpointer _data);
void boxes_os_database_guess_os_from_install_media (BoxesOSDatabase* self, const gchar* media_path, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
OsinfoOs* boxes_os_database_guess_os_from_install_media_finish (BoxesOSDatabase* self, GAsyncResult* _res_, OsinfoMedia** os_media, GError** error);
static gboolean boxes_os_database_guess_os_from_install_media_co (BoxesOsDatabaseGuessOsFromInstallMediaData* _data_);
static void boxes_os_database_ensure_db_loaded (BoxesOSDatabase* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean boxes_os_database_ensure_db_loaded_finish (BoxesOSDatabase* self, GAsyncResult* _res_);
static void boxes_os_database_guess_os_from_install_media_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_os_database_get_os_by_id_data_free (gpointer _data);
void boxes_os_database_get_os_by_id (BoxesOSDatabase* self, const gchar* id, GAsyncReadyCallback _callback_, gpointer _user_data_);
OsinfoOs* boxes_os_database_get_os_by_id_finish (BoxesOSDatabase* self, GAsyncResult* _res_, GError** error);
static gboolean boxes_os_database_get_os_by_id_co (BoxesOsDatabaseGetOsByIdData* _data_);
static void boxes_os_database_get_os_by_id_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
OsinfoMedia* boxes_os_database_get_media_by_id (BoxesOSDatabase* self, OsinfoOs* os, const gchar* id, GError** error);
OsinfoResources* boxes_os_database_get_resources_for_os (BoxesOSDatabase* self, OsinfoOs* os, const gchar* architecture);
static void _vala_array_add6 (gchar*** array, int* length, int* size, gchar* value);
static void _vala_array_add7 (gchar*** array, int* length, int* size, gchar* value);
static gchar** _vala_array_dup4 (gchar** self, int length);
static OsinfoResources* boxes_os_database_get_prefered_resources (BoxesOSDatabase* self, OsinfoResourcesList* list, gchar** prefs, int prefs_length1);
static OsinfoResources* boxes_os_database_get_resources_from_os_resources (BoxesOSDatabase* self, OsinfoResources* minimum, OsinfoResources* recommended);
static void boxes_os_database_ensure_db_loaded_data_free (gpointer _data);
static gboolean boxes_os_database_ensure_db_loaded_co (BoxesOsDatabaseEnsureDbLoadedData* _data_);
static Block33Data* block33_data_ref (Block33Data* _data33_);
static void block33_data_unref (void * _userdata_);
static Block34Data* block34_data_ref (Block34Data* _data34_);
static void block34_data_unref (void * _userdata_);
static void ___lambda50_ (Block34Data* _data34_);
static void ____lambda50__boxes_os_database_db_loaded (BoxesOSDatabase* _sender, gpointer self);
BoxesOSDatabase* boxes_os_database_new (void);
BoxesOSDatabase* boxes_os_database_construct (GType object_type);
static void boxes_os_database_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


GQuark boxes_os_database_error_quark (void) {
#line 534 "/extra-data/checkout/gnome/gnome-boxes/src/libvirt-machine.vala"
	return g_quark_from_static_string ("boxes_os_database_error-quark");
#line 217 "os-database.c"
}


static OsinfoResources* boxes_os_database_get_default_resources (void) {
	OsinfoResources* result = NULL;
	OsinfoResources* _tmp0_;
	OsinfoResources* resources;
#line 26 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = osinfo_resources_new ("whatever", "x86_64");
#line 26 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	resources = _tmp0_;
#line 28 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	osinfo_resources_set_n_cpus (resources, BOXES_OS_DATABASE_DEFAULT_VCPUS);
#line 29 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	osinfo_resources_set_ram (resources, BOXES_OS_DATABASE_DEFAULT_RAM);
#line 30 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	osinfo_resources_set_storage (resources, BOXES_OS_DATABASE_DEFAULT_STORAGE);
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = resources;
#line 32 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 239 "os-database.c"
}


static void boxes_os_database_load_data_free (gpointer _data) {
	BoxesOsDatabaseLoadData* _data_;
	_data_ = _data;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseLoadData, _data_);
#line 250 "os-database.c"
}


static gpointer _g_object_ref0 (gpointer self) {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return self ? g_object_ref (self) : NULL;
#line 257 "os-database.c"
}


void boxes_os_database_load (BoxesOSDatabase* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesOsDatabaseLoadData* _data_;
	BoxesOSDatabase* _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseLoadData);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_os_database_load);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_os_database_load_data_free);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_load_co (_data_);
#line 276 "os-database.c"
}


void boxes_os_database_load_finish (BoxesOSDatabase* self, GAsyncResult* _res_) {
	BoxesOsDatabaseLoadData* _data_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 284 "os-database.c"
}


static Block32Data* block32_data_ref (Block32Data* _data32_) {
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_atomic_int_inc (&_data32_->_ref_count_);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return _data32_;
#line 293 "os-database.c"
}


static void block32_data_unref (void * _userdata_) {
	Block32Data* _data32_;
	_data32_ = (Block32Data*) _userdata_;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (g_atomic_int_dec_and_test (&_data32_->_ref_count_)) {
#line 302 "os-database.c"
		BoxesOSDatabase * self;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		self = _data32_->self;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (_data32_->loader);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (self);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_slice_free (Block32Data, _data32_);
#line 312 "os-database.c"
	}
}


static void ___lambda48_ (Block32Data* _data32_, GError** error) {
	BoxesOSDatabase * self;
	GError * _inner_error_ = NULL;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	self = _data32_->self;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	osinfo_loader_process_default_path (_data32_->loader, &_inner_error_);
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_inner_error_ != NULL) {
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_propagate_error (error, _inner_error_);
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return;
#line 330 "os-database.c"
	}
}


static void ____lambda48__boxes_run_in_thread_func (gpointer self, GError** error) {
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	___lambda48_ (self, error);
#line 338 "os-database.c"
}


static void boxes_os_database_load_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesOsDatabaseLoadData* _data_;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = _user_data_;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_source_object_ = source_object;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_res_ = _res_;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_load_co (_data_);
#line 352 "os-database.c"
}


static void ___lambda49_ (Block32Data* _data32_, GError** error) {
	BoxesOSDatabase * self;
	gchar* _tmp0_ = NULL;
	gchar* _tmp1_;
	GError * _inner_error_ = NULL;
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	self = _data32_->self;
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = boxes_get_logos_db ();
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp1_ = _tmp0_;
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	osinfo_loader_process_path (_data32_->loader, _tmp1_, &_inner_error_);
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_free0 (_tmp1_);
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_inner_error_ != NULL) {
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_propagate_error (error, _inner_error_);
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return;
#line 377 "os-database.c"
	}
}


static void ____lambda49__boxes_run_in_thread_func (gpointer self, GError** error) {
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	___lambda49_ (self, error);
#line 385 "os-database.c"
}


static gboolean boxes_os_database_load_co (BoxesOsDatabaseLoadData* _data_) {
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 0:
#line 394 "os-database.c"
		goto _state_0;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 1:
#line 398 "os-database.c"
		goto _state_1;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 2:
#line 402 "os-database.c"
		goto _state_2;
		default:
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 407 "os-database.c"
	}
	_state_0:
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data32_ = g_slice_new0 (Block32Data);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data32_->_ref_count_ = 1;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data32_->self = g_object_ref (_data_->self);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data32_->_async_data_ = _data_;
#line 36 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self->priv->db_loading = TRUE;
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = osinfo_loader_new ();
#line 37 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data32_->loader = _data_->_tmp0_;
#line 424 "os-database.c"
	{
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_state_ = 1;
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		boxes_run_in_thread (____lambda48__boxes_run_in_thread_func, block32_data_ref (_data_->_data32_), block32_data_unref, NULL, boxes_os_database_load_ready, _data_);
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 432 "os-database.c"
		_state_1:
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		boxes_run_in_thread_finish (_data_->_res_, &_data_->_inner_error_);
#line 39 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_ != NULL) {
#line 438 "os-database.c"
			goto __catch51_g_error;
		}
	}
	goto __finally51;
	__catch51_g_error:
	{
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->e = _data_->_inner_error_;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = NULL;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp1_ = _data_->e;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = _data_->_tmp1_->message;
#line 41 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_warning ("os-database.vala:41: Error loading default libosinfo database: %s", _data_->_tmp2_);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_error_free0 (_data_->e);
#line 457 "os-database.c"
	}
	__finally51:
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_inner_error_ != NULL) {
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		block32_data_unref (_data_->_data32_);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data32_ = NULL;
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.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 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_clear_error (&_data_->_inner_error_);
#line 38 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 472 "os-database.c"
	}
	{
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_state_ = 2;
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		boxes_run_in_thread (____lambda49__boxes_run_in_thread_func, block32_data_ref (_data_->_data32_), block32_data_unref, NULL, boxes_os_database_load_ready, _data_);
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 481 "os-database.c"
		_state_2:
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		boxes_run_in_thread_finish (_data_->_res_, &_data_->_inner_error_);
#line 44 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_ != NULL) {
#line 487 "os-database.c"
			goto __catch52_g_error;
		}
	}
	goto __finally52;
	__catch52_g_error:
	{
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_vala1_e = _data_->_inner_error_;
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = NULL;
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp3_ = _data_->_vala1_e;
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp4_ = _data_->_tmp3_->message;
#line 46 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_warning ("os-database.vala:46: Error loading GNOME Boxes libosinfo database: %s", _data_->_tmp4_);
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_error_free0 (_data_->_vala1_e);
#line 506 "os-database.c"
	}
	__finally52:
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_inner_error_ != NULL) {
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		block32_data_unref (_data_->_data32_);
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data32_ = NULL;
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.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 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_clear_error (&_data_->_inner_error_);
#line 43 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 521 "os-database.c"
	}
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = NULL;
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = osinfo_loader_get_db (_data_->_data32_->loader);
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = _g_object_ref0 (_data_->_tmp5_);
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self->priv->db);
#line 48 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self->priv->db = _data_->_tmp6_;
#line 49 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self->priv->db_loading = FALSE;
#line 50 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_signal_emit_by_name (_data_->self, "db-loaded");
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	block32_data_unref (_data_->_data32_);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data32_ = NULL;
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 545 "os-database.c"
	} else {
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 549 "os-database.c"
	}
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 35 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 555 "os-database.c"
}


static void boxes_os_database_guess_os_from_install_media_data_free (gpointer _data) {
	BoxesOsDatabaseGuessOsFromInstallMediaData* _data_;
	_data_ = _data;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->media_path);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->cancellable);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->result);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseGuessOsFromInstallMediaData, _data_);
#line 572 "os-database.c"
}


void boxes_os_database_guess_os_from_install_media (BoxesOSDatabase* self, const gchar* media_path, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesOsDatabaseGuessOsFromInstallMediaData* _data_;
	BoxesOSDatabase* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	GCancellable* _tmp3_;
	GCancellable* _tmp4_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseGuessOsFromInstallMediaData);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_os_database_guess_os_from_install_media);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_os_database_guess_os_from_install_media_data_free);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp1_ = media_path;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->media_path);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->media_path = _tmp2_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp3_ = cancellable;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp4_ = _g_object_ref0 (_tmp3_);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->cancellable);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->cancellable = _tmp4_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_guess_os_from_install_media_co (_data_);
#line 611 "os-database.c"
}


OsinfoOs* boxes_os_database_guess_os_from_install_media_finish (BoxesOSDatabase* self, GAsyncResult* _res_, OsinfoMedia** os_media, GError** error) {
	OsinfoOs* result;
	BoxesOsDatabaseGuessOsFromInstallMediaData* _data_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return NULL;
#line 622 "os-database.c"
	}
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (os_media) {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		*os_media = _data_->os_media;
#line 630 "os-database.c"
	} else {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (_data_->os_media);
#line 634 "os-database.c"
	}
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->os_media = NULL;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 644 "os-database.c"
}


static void boxes_os_database_guess_os_from_install_media_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesOsDatabaseGuessOsFromInstallMediaData* _data_;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = _user_data_;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_source_object_ = source_object;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_res_ = _res_;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_guess_os_from_install_media_co (_data_);
#line 658 "os-database.c"
}


static gboolean boxes_os_database_guess_os_from_install_media_co (BoxesOsDatabaseGuessOsFromInstallMediaData* _data_) {
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 0:
#line 667 "os-database.c"
		goto _state_0;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 1:
#line 671 "os-database.c"
		goto _state_1;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 2:
#line 675 "os-database.c"
		goto _state_2;
		default:
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 680 "os-database.c"
	}
	_state_0:
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->os_media);
#line 56 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->os_media = NULL;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 1;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded (_data_->self, boxes_os_database_guess_os_from_install_media_ready, _data_);
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 693 "os-database.c"
	_state_1:
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = FALSE;
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = boxes_os_database_ensure_db_loaded_finish (_data_->self, _data_->_res_);
#line 58 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (!_data_->_tmp0_) {
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->result = NULL;
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 707 "os-database.c"
		} else {
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 711 "os-database.c"
		}
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 59 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 717 "os-database.c"
	}
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = _data_->media_path;
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp2_ = _data_->cancellable;
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 2;
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	osinfo_media_create_from_location_async (_data_->_tmp1_, G_PRIORITY_DEFAULT, _data_->_tmp2_, boxes_os_database_guess_os_from_install_media_ready, _data_);
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 729 "os-database.c"
	_state_2:
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = NULL;
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = osinfo_media_create_from_location_finish (_data_->_res_, &_data_->_inner_error_);
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->media = _data_->_tmp3_;
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_inner_error_ != NULL) {
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_error_free (_data_->_inner_error_);
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 747 "os-database.c"
		} else {
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 751 "os-database.c"
		}
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 61 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 757 "os-database.c"
	}
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = _data_->self->priv->db;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = _data_->media;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = NULL;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp7_ = NULL;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp7_ = osinfo_db_guess_os_from_media (_data_->_tmp4_, _data_->_tmp5_, &_data_->_tmp6_);
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->os_media);
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp8_ = _g_object_ref0 (_data_->_tmp6_);
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->os_media = _data_->_tmp8_;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp9_ = _g_object_ref0 (_data_->_tmp7_);
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->_tmp9_;
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->media);
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 785 "os-database.c"
	} else {
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 789 "os-database.c"
	}
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 63 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->media);
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 801 "os-database.c"
	} else {
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 805 "os-database.c"
	}
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 53 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 811 "os-database.c"
}


static void boxes_os_database_get_os_by_id_data_free (gpointer _data) {
	BoxesOsDatabaseGetOsByIdData* _data_;
	_data_ = _data;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->id);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->result);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseGetOsByIdData, _data_);
#line 826 "os-database.c"
}


void boxes_os_database_get_os_by_id (BoxesOSDatabase* self, const gchar* id, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesOsDatabaseGetOsByIdData* _data_;
	BoxesOSDatabase* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseGetOsByIdData);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_os_database_get_os_by_id);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_os_database_get_os_by_id_data_free);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp1_ = id;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_free0 (_data_->id);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->id = _tmp2_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_get_os_by_id_co (_data_);
#line 855 "os-database.c"
}


OsinfoOs* boxes_os_database_get_os_by_id_finish (BoxesOSDatabase* self, GAsyncResult* _res_, GError** error) {
	OsinfoOs* result;
	BoxesOsDatabaseGetOsByIdData* _data_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return NULL;
#line 866 "os-database.c"
	}
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->result = NULL;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 876 "os-database.c"
}


static void boxes_os_database_get_os_by_id_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesOsDatabaseGetOsByIdData* _data_;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = _user_data_;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_source_object_ = source_object;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_res_ = _res_;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_get_os_by_id_co (_data_);
#line 890 "os-database.c"
}


static gboolean boxes_os_database_get_os_by_id_co (BoxesOsDatabaseGetOsByIdData* _data_) {
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 0:
#line 899 "os-database.c"
		goto _state_0;
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 1:
#line 903 "os-database.c"
		goto _state_1;
		default:
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 908 "os-database.c"
	}
	_state_0:
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_state_ = 1;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded (_data_->self, boxes_os_database_get_os_by_id_ready, _data_);
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 917 "os-database.c"
	_state_1:
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = FALSE;
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = boxes_os_database_ensure_db_loaded_finish (_data_->self, _data_->_res_);
#line 67 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (!_data_->_tmp0_) {
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp1_ = _data_->id;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = g_error_new (BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_UNKNOWN_OS_ID, "Unknown OS ID '%s'", _data_->_tmp1_);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = _data_->_tmp2_;
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_error_free (_data_->_inner_error_);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			if (_data_->_state_ == 0) {
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 941 "os-database.c"
			} else {
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				g_simple_async_result_complete (_data_->_async_result);
#line 945 "os-database.c"
			}
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 951 "os-database.c"
		} else {
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.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 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_clear_error (&_data_->_inner_error_);
#line 68 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 959 "os-database.c"
		}
	}
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = _data_->self->priv->db;
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp4_ = _data_->id;
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = NULL;
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp5_ = osinfo_db_get_os (_data_->_tmp3_, _data_->_tmp4_);
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp6_ = _g_object_ref0 (_data_->_tmp5_);
#line 70 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->os = _data_->_tmp6_;
#line 71 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp7_ = _data_->os;
#line 71 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp7_ == NULL) {
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp8_ = _data_->id;
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp9_ = g_error_new (BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_UNKNOWN_OS_ID, "Unknown OS ID '%s'", _data_->_tmp8_);
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_inner_error_ = _data_->_tmp9_;
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_error_free (_data_->_inner_error_);
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (_data_->os);
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			if (_data_->_state_ == 0) {
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 996 "os-database.c"
			} else {
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				g_simple_async_result_complete (_data_->_async_result);
#line 1000 "os-database.c"
			}
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_object_unref (_data_->_async_result);
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1006 "os-database.c"
		} else {
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (_data_->os);
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.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 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_clear_error (&_data_->_inner_error_);
#line 72 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			return FALSE;
#line 1016 "os-database.c"
		}
	}
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->os;
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1025 "os-database.c"
	} else {
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1029 "os-database.c"
	}
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 74 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->os);
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 1041 "os-database.c"
	} else {
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 1045 "os-database.c"
	}
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 66 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 1051 "os-database.c"
}


OsinfoMedia* boxes_os_database_get_media_by_id (BoxesOSDatabase* self, OsinfoOs* os, const gchar* id, GError** error) {
	OsinfoMedia* result = NULL;
	OsinfoOs* _tmp0_;
	OsinfoMediaList* _tmp1_ = NULL;
	OsinfoMediaList* medias;
	OsinfoMediaList* _tmp2_;
	const gchar* _tmp3_;
	OsinfoEntity* _tmp4_ = NULL;
	OsinfoMedia* _tmp5_;
	OsinfoMedia* media;
	OsinfoMedia* _tmp6_;
	GError * _inner_error_ = NULL;
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (os != NULL, NULL);
#line 77 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (id != NULL, NULL);
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = os;
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp1_ = osinfo_os_get_media_list (_tmp0_);
#line 78 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	medias = _tmp1_;
#line 80 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = medias;
#line 80 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp3_ = id;
#line 80 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp4_ = osinfo_list_find_by_id ((OsinfoList*) _tmp2_, _tmp3_);
#line 80 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, osinfo_media_get_type ()) ? ((OsinfoMedia*) _tmp4_) : NULL);
#line 80 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	media = _tmp5_;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_ = media;
#line 81 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp6_ == NULL) {
#line 1093 "os-database.c"
		const gchar* _tmp7_;
		GError* _tmp8_;
#line 82 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp7_ = id;
#line 82 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp8_ = g_error_new (BOXES_OS_DATABASE_ERROR, BOXES_OS_DATABASE_ERROR_UNKNOWN_MEDIA_ID, "Unknown media ID '%s'", _tmp7_);
#line 82 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_inner_error_ = _tmp8_;
#line 82 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_inner_error_->domain == BOXES_OS_DATABASE_ERROR) {
#line 82 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_propagate_error (error, _inner_error_);
#line 82 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (media);
#line 82 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (medias);
#line 82 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			return NULL;
#line 1112 "os-database.c"
		} else {
#line 82 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (media);
#line 82 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_g_object_unref0 (medias);
#line 82 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
#line 82 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_clear_error (&_inner_error_);
#line 82 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			return NULL;
#line 1124 "os-database.c"
		}
	}
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = media;
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (medias);
#line 84 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 1133 "os-database.c"
}


static void _vala_array_add6 (gchar*** array, int* length, int* size, gchar* value) {
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if ((*length) == (*size)) {
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 1144 "os-database.c"
	}
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	(*array)[(*length)++] = value;
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	(*array)[*length] = NULL;
#line 1150 "os-database.c"
}


static void _vala_array_add7 (gchar*** array, int* length, int* size, gchar* value) {
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if ((*length) == (*size)) {
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		*size = (*size) ? (2 * (*size)) : 4;
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		*array = g_renew (gchar*, *array, (*size) + 1);
#line 1161 "os-database.c"
	}
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	(*array)[(*length)++] = value;
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	(*array)[*length] = NULL;
#line 1167 "os-database.c"
}


static gchar** _vala_array_dup4 (gchar** self, int length) {
	gchar** result;
	int i;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = g_new0 (gchar*, length + 1);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	for (i = 0; i < length; i++) {
#line 1178 "os-database.c"
		gchar* _tmp0_;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp0_ = g_strdup (self[i]);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		result[i] = _tmp0_;
#line 1184 "os-database.c"
	}
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 1188 "os-database.c"
}


OsinfoResources* boxes_os_database_get_resources_for_os (BoxesOSDatabase* self, OsinfoOs* os, const gchar* architecture) {
	OsinfoResources* result = NULL;
	OsinfoOs* _tmp0_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar** _tmp6_ = NULL;
	gchar** architectures;
	gint architectures_length1;
	gint _architectures_size_;
	gchar** prefs = NULL;
	gint prefs_length1 = 0;
	gint _prefs_size_ = 0;
	const gchar* _tmp7_;
	OsinfoOs* _tmp21_;
	OsinfoResourcesList* _tmp22_ = NULL;
	OsinfoResourcesList* list;
	OsinfoResourcesList* _tmp23_;
	gchar** _tmp24_;
	gint _tmp24__length1;
	OsinfoResources* _tmp25_ = NULL;
	OsinfoResources* recommended;
	OsinfoOs* _tmp26_;
	OsinfoResourcesList* _tmp27_ = NULL;
	OsinfoResourcesList* _tmp28_;
	gchar** _tmp29_;
	gint _tmp29__length1;
	OsinfoResources* _tmp30_ = NULL;
	OsinfoResources* minimum;
	OsinfoResources* _tmp31_;
	OsinfoResources* _tmp32_;
	OsinfoResources* _tmp33_ = NULL;
#line 87 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = os;
#line 88 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp0_ == NULL) {
#line 1231 "os-database.c"
		OsinfoResources* _tmp1_ = NULL;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp1_ = boxes_os_database_get_default_resources ();
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		result = _tmp1_;
#line 89 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return result;
#line 1239 "os-database.c"
	}
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = g_strdup ("x86_64");
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp3_ = g_strdup ("i686");
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp4_ = g_strdup ("i386");
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp5_ = g_strdup (OSINFO_ARCHITECTURE_ALL);
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_ = g_new0 (gchar*, 4 + 1);
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_[0] = _tmp2_;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_[1] = _tmp3_;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_[2] = _tmp4_;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_[3] = _tmp5_;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	architectures = _tmp6_;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	architectures_length1 = 4;
#line 92 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_architectures_size_ = architectures_length1;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp7_ = architecture;
#line 94 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp7_ != NULL) {
#line 1269 "os-database.c"
		gchar** _tmp8_ = NULL;
		gchar** _tmp9_;
		gint _tmp9__length1;
		const gchar* _tmp10_;
		gchar* _tmp11_;
		gchar** _tmp12_;
		gint _tmp12__length1;
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp8_ = g_new0 (gchar*, 0 + 1);
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		prefs = _tmp8_;
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		prefs_length1 = 0;
#line 95 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_prefs_size_ = prefs_length1;
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp9_ = prefs;
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp9__length1 = prefs_length1;
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp10_ = architecture;
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp11_ = g_strdup (_tmp10_);
#line 96 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_vala_array_add6 (&prefs, &prefs_length1, &_prefs_size_, _tmp11_);
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp12_ = architectures;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp12__length1 = architectures_length1;
#line 1301 "os-database.c"
		{
			gchar** arch_collection = NULL;
			gint arch_collection_length1 = 0;
			gint _arch_collection_size_ = 0;
			gint arch_it = 0;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			arch_collection = _tmp12_;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			arch_collection_length1 = _tmp12__length1;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			for (arch_it = 0; arch_it < _tmp12__length1; arch_it = arch_it + 1) {
#line 1313 "os-database.c"
				gchar* _tmp13_;
				gchar* arch = NULL;
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				_tmp13_ = g_strdup (arch_collection[arch_it]);
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
				arch = _tmp13_;
#line 1320 "os-database.c"
				{
					const gchar* _tmp14_;
					const gchar* _tmp15_;
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
					_tmp14_ = arch;
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
					_tmp15_ = architecture;
#line 99 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
					if (g_strcmp0 (_tmp14_, _tmp15_) != 0) {
#line 1330 "os-database.c"
						gchar** _tmp16_;
						gint _tmp16__length1;
						const gchar* _tmp17_;
						gchar* _tmp18_;
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
						_tmp16_ = prefs;
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
						_tmp16__length1 = prefs_length1;
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
						_tmp17_ = arch;
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
						_tmp18_ = g_strdup (_tmp17_);
#line 100 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
						_vala_array_add7 (&prefs, &prefs_length1, &_prefs_size_, _tmp18_);
#line 1345 "os-database.c"
					}
#line 98 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
					_g_free0 (arch);
#line 1349 "os-database.c"
				}
			}
		}
	} else {
		gchar** _tmp19_;
		gint _tmp19__length1;
		gchar** _tmp20_;
		gint _tmp20__length1;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp19_ = architectures;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp19__length1 = architectures_length1;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp20_ = (_tmp19_ != NULL) ? _vala_array_dup4 (_tmp19_, _tmp19__length1) : ((gpointer) _tmp19_);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp20__length1 = _tmp19__length1;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		prefs = _tmp20_;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		prefs_length1 = _tmp20__length1;
#line 102 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_prefs_size_ = prefs_length1;
#line 1374 "os-database.c"
	}
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp21_ = os;
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp22_ = osinfo_os_get_recommended_resources (_tmp21_);
#line 105 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	list = _tmp22_;
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp23_ = list;
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp24_ = prefs;
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp24__length1 = prefs_length1;
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp25_ = boxes_os_database_get_prefered_resources (self, _tmp23_, _tmp24_, _tmp24__length1);
#line 106 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	recommended = _tmp25_;
#line 108 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp26_ = os;
#line 108 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp27_ = osinfo_os_get_minimum_resources (_tmp26_);
#line 108 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (list);
#line 108 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	list = _tmp27_;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp28_ = list;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp29_ = prefs;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp29__length1 = prefs_length1;
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp30_ = boxes_os_database_get_prefered_resources (self, _tmp28_, _tmp29_, _tmp29__length1);
#line 109 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	minimum = _tmp30_;
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp31_ = minimum;
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp32_ = recommended;
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp33_ = boxes_os_database_get_resources_from_os_resources (self, _tmp31_, _tmp32_);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = _tmp33_;
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (minimum);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (recommended);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (list);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	prefs = (_vala_array_free (prefs, prefs_length1, (GDestroyNotify) g_free), NULL);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	architectures = (_vala_array_free (architectures, architectures_length1, (GDestroyNotify) g_free), NULL);
#line 111 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 1430 "os-database.c"
}


static OsinfoResources* boxes_os_database_get_resources_from_os_resources (BoxesOSDatabase* self, OsinfoResources* minimum, OsinfoResources* recommended) {
	OsinfoResources* result = NULL;
	OsinfoResources* _tmp0_ = NULL;
	OsinfoResources* resources;
	gboolean _tmp1_ = FALSE;
	OsinfoResources* _tmp2_;
	gboolean _tmp6_;
	gboolean _tmp25_ = FALSE;
	OsinfoResources* _tmp26_;
	gboolean _tmp30_;
	gboolean _tmp49_ = FALSE;
	OsinfoResources* _tmp50_;
	gboolean _tmp54_;
#line 114 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 115 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = boxes_os_database_get_default_resources ();
#line 115 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	resources = _tmp0_;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = recommended;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp2_ != NULL) {
#line 1457 "os-database.c"
		OsinfoResources* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp3_ = recommended;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp4_ = osinfo_resources_get_n_cpus (_tmp3_);
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp5_ = _tmp4_;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp1_ = _tmp5_ > 0;
#line 1469 "os-database.c"
	} else {
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp1_ = FALSE;
#line 1473 "os-database.c"
	}
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_ = _tmp1_;
#line 118 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp6_) {
#line 1479 "os-database.c"
		OsinfoResources* _tmp7_;
		OsinfoResources* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp7_ = resources;
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp8_ = recommended;
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp9_ = osinfo_resources_get_n_cpus (_tmp8_);
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp10_ = _tmp9_;
#line 119 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		osinfo_resources_set_n_cpus (_tmp7_, _tmp10_);
#line 1494 "os-database.c"
	} else {
		gboolean _tmp11_ = FALSE;
		OsinfoResources* _tmp12_;
		gboolean _tmp16_;
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp12_ = minimum;
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_tmp12_ != NULL) {
#line 1503 "os-database.c"
			OsinfoResources* _tmp13_;
			gint _tmp14_;
			gint _tmp15_;
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp13_ = minimum;
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp14_ = osinfo_resources_get_n_cpus (_tmp13_);
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp15_ = _tmp14_;
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp11_ = _tmp15_ > 0;
#line 1515 "os-database.c"
		} else {
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp11_ = FALSE;
#line 1519 "os-database.c"
		}
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp16_ = _tmp11_;
#line 120 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_tmp16_) {
#line 1525 "os-database.c"
			OsinfoResources* _tmp17_;
			OsinfoResources* _tmp18_;
			gint _tmp19_;
			gint _tmp20_;
			OsinfoResources* _tmp21_;
			gint _tmp22_;
			gint _tmp23_;
			gint _tmp24_ = 0;
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp17_ = resources;
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp18_ = minimum;
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp19_ = osinfo_resources_get_n_cpus (_tmp18_);
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp20_ = _tmp19_;
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp21_ = resources;
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp22_ = osinfo_resources_get_n_cpus (_tmp21_);
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp23_ = _tmp22_;
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp24_ = MAX (_tmp20_, _tmp23_);
#line 121 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			osinfo_resources_set_n_cpus (_tmp17_, _tmp24_);
#line 1552 "os-database.c"
		}
	}
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp26_ = recommended;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp26_ != NULL) {
#line 1559 "os-database.c"
		OsinfoResources* _tmp27_;
		gint64 _tmp28_;
		gint64 _tmp29_;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp27_ = recommended;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp28_ = osinfo_resources_get_ram (_tmp27_);
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp29_ = _tmp28_;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp25_ = _tmp29_ > ((gint64) 0);
#line 1571 "os-database.c"
	} else {
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp25_ = FALSE;
#line 1575 "os-database.c"
	}
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp30_ = _tmp25_;
#line 124 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp30_) {
#line 1581 "os-database.c"
		OsinfoResources* _tmp31_;
		OsinfoResources* _tmp32_;
		gint64 _tmp33_;
		gint64 _tmp34_;
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp31_ = resources;
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp32_ = recommended;
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp33_ = osinfo_resources_get_ram (_tmp32_);
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp34_ = _tmp33_;
#line 125 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		osinfo_resources_set_ram (_tmp31_, _tmp34_);
#line 1596 "os-database.c"
	} else {
		gboolean _tmp35_ = FALSE;
		OsinfoResources* _tmp36_;
		gboolean _tmp40_;
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp36_ = minimum;
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_tmp36_ != NULL) {
#line 1605 "os-database.c"
			OsinfoResources* _tmp37_;
			gint64 _tmp38_;
			gint64 _tmp39_;
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp37_ = minimum;
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp38_ = osinfo_resources_get_ram (_tmp37_);
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp39_ = _tmp38_;
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp35_ = _tmp39_ > ((gint64) 0);
#line 1617 "os-database.c"
		} else {
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp35_ = FALSE;
#line 1621 "os-database.c"
		}
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp40_ = _tmp35_;
#line 126 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_tmp40_) {
#line 1627 "os-database.c"
			OsinfoResources* _tmp41_;
			OsinfoResources* _tmp42_;
			gint64 _tmp43_;
			gint64 _tmp44_;
			OsinfoResources* _tmp45_;
			gint64 _tmp46_;
			gint64 _tmp47_;
			gint64 _tmp48_ = 0LL;
#line 127 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp41_ = resources;
#line 127 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp42_ = minimum;
#line 127 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp43_ = osinfo_resources_get_ram (_tmp42_);
#line 127 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp44_ = _tmp43_;
#line 127 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp45_ = resources;
#line 127 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp46_ = osinfo_resources_get_ram (_tmp45_);
#line 127 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp47_ = _tmp46_;
#line 127 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp48_ = MAX (_tmp44_, _tmp47_);
#line 127 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			osinfo_resources_set_ram (_tmp41_, _tmp48_);
#line 1654 "os-database.c"
		}
	}
#line 130 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp50_ = recommended;
#line 130 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp50_ != NULL) {
#line 1661 "os-database.c"
		OsinfoResources* _tmp51_;
		gint64 _tmp52_;
		gint64 _tmp53_;
#line 130 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp51_ = recommended;
#line 130 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp52_ = osinfo_resources_get_storage (_tmp51_);
#line 130 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp53_ = _tmp52_;
#line 130 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp49_ = _tmp53_ > ((gint64) 0);
#line 1673 "os-database.c"
	} else {
#line 130 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp49_ = FALSE;
#line 1677 "os-database.c"
	}
#line 130 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp54_ = _tmp49_;
#line 130 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp54_) {
#line 1683 "os-database.c"
		OsinfoResources* _tmp55_;
		OsinfoResources* _tmp56_;
		gint64 _tmp57_;
		gint64 _tmp58_;
#line 131 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp55_ = resources;
#line 131 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp56_ = recommended;
#line 131 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp57_ = osinfo_resources_get_storage (_tmp56_);
#line 131 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp58_ = _tmp57_;
#line 131 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		osinfo_resources_set_storage (_tmp55_, _tmp58_);
#line 1698 "os-database.c"
	} else {
		gboolean _tmp59_ = FALSE;
		OsinfoResources* _tmp60_;
		gboolean _tmp64_;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp60_ = minimum;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_tmp60_ != NULL) {
#line 1707 "os-database.c"
			OsinfoResources* _tmp61_;
			gint64 _tmp62_;
			gint64 _tmp63_;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp61_ = minimum;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp62_ = osinfo_resources_get_storage (_tmp61_);
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp63_ = _tmp62_;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp59_ = _tmp63_ > ((gint64) 0);
#line 1719 "os-database.c"
		} else {
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp59_ = FALSE;
#line 1723 "os-database.c"
		}
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp64_ = _tmp59_;
#line 132 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_tmp64_) {
#line 1729 "os-database.c"
			OsinfoResources* _tmp65_;
			OsinfoResources* _tmp66_;
			gint64 _tmp67_;
			gint64 _tmp68_;
			OsinfoResources* _tmp69_;
			gint64 _tmp70_;
			gint64 _tmp71_;
			gint64 _tmp72_ = 0LL;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp65_ = resources;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp66_ = minimum;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp67_ = osinfo_resources_get_storage (_tmp66_);
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp68_ = _tmp67_;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp69_ = resources;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp70_ = osinfo_resources_get_storage (_tmp69_);
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp71_ = _tmp70_;
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			_tmp72_ = MAX (_tmp68_ * 2, _tmp71_);
#line 133 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			osinfo_resources_set_storage (_tmp65_, _tmp72_);
#line 1756 "os-database.c"
		}
	}
#line 135 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = resources;
#line 135 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 1763 "os-database.c"
}


static OsinfoResources* boxes_os_database_get_prefered_resources (BoxesOSDatabase* self, OsinfoResourcesList* list, gchar** prefs, int prefs_length1) {
	OsinfoResources* result = NULL;
	gchar** _tmp0_;
	gint _tmp0__length1;
	OsinfoFilter* _tmp1_;
	OsinfoFilter* filter;
	OsinfoFilter* _tmp2_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	const gchar* _tmp4_;
	OsinfoResourcesList* _tmp5_;
	OsinfoFilter* _tmp6_;
	OsinfoResourcesList* _tmp7_ = NULL;
	OsinfoResourcesList* filtered;
	OsinfoResourcesList* _tmp8_;
	gint _tmp9_ = 0;
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (self != NULL, NULL);
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_return_val_if_fail (list != NULL, NULL);
#line 139 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = prefs;
#line 139 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0__length1 = prefs_length1;
#line 139 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp0__length1 <= 0) {
#line 140 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		result = NULL;
#line 140 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return result;
#line 1797 "os-database.c"
	}
#line 142 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp1_ = osinfo_filter_new ();
#line 142 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	filter = _tmp1_;
#line 143 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp2_ = filter;
#line 143 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp3_ = prefs;
#line 143 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp3__length1 = prefs_length1;
#line 143 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp4_ = _tmp3_[0];
#line 143 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	osinfo_filter_add_constraint (_tmp2_, OSINFO_RESOURCES_PROP_ARCHITECTURE, _tmp4_);
#line 144 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp5_ = list;
#line 144 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp6_ = filter;
#line 144 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp7_ = osinfo_resourceslist_new_filtered (_tmp5_, _tmp6_);
#line 144 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	filtered = _tmp7_;
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp8_ = filtered;
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp9_ = osinfo_list_get_length ((OsinfoList*) _tmp8_);
#line 145 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_tmp9_ <= 0) {
#line 1827 "os-database.c"
		OsinfoResourcesList* _tmp10_;
		gchar** _tmp11_;
		gint _tmp11__length1;
		gchar** _tmp12_;
		gint _tmp12__length1;
		OsinfoResources* _tmp13_ = NULL;
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp10_ = list;
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp11_ = prefs;
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp11__length1 = prefs_length1;
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp12_ = prefs;
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp12__length1 = prefs_length1;
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp13_ = boxes_os_database_get_prefered_resources (self, _tmp10_, _tmp11_ + 1, _tmp12__length1 - 1);
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		result = _tmp13_;
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (filtered);
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (filter);
#line 146 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return result;
#line 1854 "os-database.c"
	} else {
		OsinfoResourcesList* _tmp14_;
		OsinfoEntity* _tmp15_ = NULL;
		OsinfoResources* _tmp16_;
#line 150 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp14_ = filtered;
#line 150 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp15_ = osinfo_list_get_nth ((OsinfoList*) _tmp14_, 0);
#line 150 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, osinfo_resources_get_type ()) ? ((OsinfoResources*) _tmp15_) : NULL);
#line 150 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		result = _tmp16_;
#line 150 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (filtered);
#line 150 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (filter);
#line 150 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return result;
#line 1873 "os-database.c"
	}
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (filtered);
#line 138 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (filter);
#line 1879 "os-database.c"
}


static void boxes_os_database_ensure_db_loaded_data_free (gpointer _data) {
	BoxesOsDatabaseEnsureDbLoadedData* _data_;
	_data_ = _data;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (_data_->self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_slice_free (BoxesOsDatabaseEnsureDbLoadedData, _data_);
#line 1890 "os-database.c"
}


static void boxes_os_database_ensure_db_loaded (BoxesOSDatabase* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesOsDatabaseEnsureDbLoadedData* _data_;
	BoxesOSDatabase* _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_slice_new0 (BoxesOsDatabaseEnsureDbLoadedData);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_os_database_ensure_db_loaded);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_os_database_ensure_db_loaded_data_free);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = _g_object_ref0 (self);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->self = _tmp0_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded_co (_data_);
#line 1909 "os-database.c"
}


static gboolean boxes_os_database_ensure_db_loaded_finish (BoxesOSDatabase* self, GAsyncResult* _res_) {
	gboolean result;
	BoxesOsDatabaseEnsureDbLoadedData* _data_;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	result = _data_->result;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return result;
#line 1922 "os-database.c"
}


static Block33Data* block33_data_ref (Block33Data* _data33_) {
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_atomic_int_inc (&_data33_->_ref_count_);
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return _data33_;
#line 1931 "os-database.c"
}


static void block33_data_unref (void * _userdata_) {
	Block33Data* _data33_;
	_data33_ = (Block33Data*) _userdata_;
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
#line 1940 "os-database.c"
		BoxesOSDatabase * self;
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		self = _data33_->self;
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_g_object_unref0 (self);
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_slice_free (Block33Data, _data33_);
#line 1948 "os-database.c"
	}
}


static Block34Data* block34_data_ref (Block34Data* _data34_) {
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_atomic_int_inc (&_data34_->_ref_count_);
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return _data34_;
#line 1958 "os-database.c"
}


static void block34_data_unref (void * _userdata_) {
	Block34Data* _data34_;
	_data34_ = (Block34Data*) _userdata_;
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (g_atomic_int_dec_and_test (&_data34_->_ref_count_)) {
#line 1967 "os-database.c"
		BoxesOSDatabase * self;
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		self = _data34_->_data33_->self;
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		block33_data_unref (_data34_->_data33_);
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data34_->_data33_ = NULL;
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_slice_free (Block34Data, _data34_);
#line 1977 "os-database.c"
	}
}


static void ___lambda50_ (Block34Data* _data34_) {
	Block33Data* _data33_;
	BoxesOSDatabase * self;
	gulong _tmp0_;
#line 160 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data33_ = _data34_->_data33_;
#line 160 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	self = _data33_->self;
#line 161 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_ensure_db_loaded_co (_data33_->_async_data_);
#line 162 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_tmp0_ = _data34_->db_loaded_id;
#line 162 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_signal_handler_disconnect ((GObject*) self, _tmp0_);
#line 1996 "os-database.c"
}


static void ____lambda50__boxes_os_database_db_loaded (BoxesOSDatabase* _sender, gpointer self) {
#line 160 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	___lambda50_ (self);
#line 2003 "os-database.c"
}


static gboolean boxes_os_database_ensure_db_loaded_co (BoxesOsDatabaseEnsureDbLoadedData* _data_) {
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	switch (_data_->_state_) {
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 0:
#line 2012 "os-database.c"
		goto _state_0;
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		case 1:
#line 2016 "os-database.c"
		goto _state_1;
		default:
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_assert_not_reached ();
#line 2021 "os-database.c"
	}
	_state_0:
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data33_ = g_slice_new0 (Block33Data);
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data33_->_ref_count_ = 1;
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data33_->self = g_object_ref (_data_->self);
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data33_->_async_data_ = _data_;
#line 154 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp0_ = _data_->self->priv->db;
#line 154 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp0_ != NULL) {
#line 155 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->result = TRUE;
#line 155 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		block33_data_unref (_data_->_data33_);
#line 155 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data33_ = NULL;
#line 155 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		if (_data_->_state_ == 0) {
#line 155 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 2046 "os-database.c"
		} else {
#line 155 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
			g_simple_async_result_complete (_data_->_async_result);
#line 2050 "os-database.c"
		}
#line 155 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_object_unref (_data_->_async_result);
#line 155 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 2056 "os-database.c"
	}
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp1_ = _data_->self->priv->db_loading;
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_tmp1_) {
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data34_ = g_slice_new0 (Block34Data);
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data34_->_ref_count_ = 1;
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data34_->_data33_ = block33_data_ref (_data_->_data33_);
#line 158 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data34_->db_loaded_id = (gulong) 0;
#line 160 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = 0UL;
#line 160 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_tmp2_ = g_signal_connect_data (_data_->self, "db-loaded", (GCallback) ____lambda50__boxes_os_database_db_loaded, block34_data_ref (_data_->_data34_), (GClosureNotify) block34_data_unref, 0);
#line 160 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data34_->db_loaded_id = _data_->_tmp2_;
#line 165 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_state_ = 1;
#line 165 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		return FALSE;
#line 2080 "os-database.c"
		_state_1:
		;
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		block34_data_unref (_data_->_data34_);
#line 157 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		_data_->_data34_ = NULL;
#line 2087 "os-database.c"
	}
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_tmp3_ = _data_->self->priv->db;
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->result = _data_->_tmp3_ != NULL;
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	block33_data_unref (_data_->_data33_);
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data33_ = NULL;
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 2101 "os-database.c"
	} else {
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 2105 "os-database.c"
	}
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 168 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	block33_data_unref (_data_->_data33_);
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_data_->_data33_ = NULL;
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	if (_data_->_state_ == 0) {
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete_in_idle (_data_->_async_result);
#line 2119 "os-database.c"
	} else {
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
		g_simple_async_result_complete (_data_->_async_result);
#line 2123 "os-database.c"
	}
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_object_unref (_data_->_async_result);
#line 153 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return FALSE;
#line 2129 "os-database.c"
}


BoxesOSDatabase* boxes_os_database_construct (GType object_type) {
	BoxesOSDatabase * self = NULL;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	self = (BoxesOSDatabase*) g_object_new (object_type, NULL);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return self;
#line 2139 "os-database.c"
}


BoxesOSDatabase* boxes_os_database_new (void) {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	return boxes_os_database_construct (BOXES_TYPE_OS_DATABASE);
#line 2146 "os-database.c"
}


static void boxes_os_database_class_init (BoxesOSDatabaseClass * klass) {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	boxes_os_database_parent_class = g_type_class_peek_parent (klass);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_type_class_add_private (klass, sizeof (BoxesOSDatabasePrivate));
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	G_OBJECT_CLASS (klass)->finalize = boxes_os_database_finalize;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	g_signal_new ("db_loaded", BOXES_TYPE_OS_DATABASE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
#line 2159 "os-database.c"
}


static void boxes_os_database_instance_init (BoxesOSDatabase * self) {
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	self->priv = BOXES_OS_DATABASE_GET_PRIVATE (self);
#line 2166 "os-database.c"
}


static void boxes_os_database_finalize (GObject* obj) {
	BoxesOSDatabase * self;
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_OS_DATABASE, BoxesOSDatabase);
#line 19 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	_g_object_unref0 (self->priv->db);
#line 11 "/extra-data/checkout/gnome/gnome-boxes/src/os-database.vala"
	G_OBJECT_CLASS (boxes_os_database_parent_class)->finalize (obj);
#line 2178 "os-database.c"
}


GType boxes_os_database_get_type (void) {
	static volatile gsize boxes_os_database_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_os_database_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesOSDatabaseClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_os_database_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesOSDatabase), 0, (GInstanceInitFunc) boxes_os_database_instance_init, NULL };
		GType boxes_os_database_type_id;
		boxes_os_database_type_id = g_type_register_static (G_TYPE_OBJECT, "BoxesOSDatabase", &g_define_type_info, 0);
		g_once_init_leave (&boxes_os_database_type_id__volatile, boxes_os_database_type_id);
	}
	return boxes_os_database_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
#line 534 "/extra-data/checkout/gnome/gnome-boxes/src/libvirt-machine.vala"
	if ((array != NULL) && (destroy_func != NULL)) {
#line 2197 "os-database.c"
		int i;
#line 534 "/extra-data/checkout/gnome/gnome-boxes/src/libvirt-machine.vala"
		for (i = 0; i < array_length; i = i + 1) {
#line 534 "/extra-data/checkout/gnome/gnome-boxes/src/libvirt-machine.vala"
			if (((gpointer*) array)[i] != NULL) {
#line 534 "/extra-data/checkout/gnome/gnome-boxes/src/libvirt-machine.vala"
				destroy_func (((gpointer*) array)[i]);
#line 2205 "os-database.c"
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
#line 534 "/extra-data/checkout/gnome/gnome-boxes/src/libvirt-machine.vala"
	_vala_array_destroy (array, array_length, destroy_func);
#line 534 "/extra-data/checkout/gnome/gnome-boxes/src/libvirt-machine.vala"
	g_free (array);
#line 2217 "os-database.c"
}



