/* libvirt-broker.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from libvirt-broker.vala, do not modify */

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

#include <glib-object.h>
#include <gio/gio.h>
#include "common.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <libvirt-gobject/libvirt-gobject.h>
#include <gtk/gtk.h>
#include <libvirt-gconfig/libvirt-gconfig.h>
#include <osinfo/osinfo.h>

#define BOXES_APP_DEFAULT_SOURCE_NAME "QEMU Session"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define BOXES_TYPE_BROKER (boxes_broker_get_type ())
#define BOXES_BROKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_BROKER, BoxesBroker))
#define BOXES_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_BROKER, BoxesBrokerClass))
#define BOXES_IS_BROKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_BROKER))
#define BOXES_IS_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_BROKER))
#define BOXES_BROKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_BROKER, BoxesBrokerClass))

typedef struct _BoxesBroker BoxesBroker;
typedef struct _BoxesBrokerClass BoxesBrokerClass;
typedef struct _BoxesBrokerPrivate BoxesBrokerPrivate;

#define BOXES_TYPE_LIBVIRT_BROKER (boxes_libvirt_broker_get_type ())
#define BOXES_LIBVIRT_BROKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_BROKER, BoxesLibvirtBroker))
#define BOXES_LIBVIRT_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_BROKER, BoxesLibvirtBrokerClass))
#define BOXES_IS_LIBVIRT_BROKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_BROKER))
#define BOXES_IS_LIBVIRT_BROKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_BROKER))
#define BOXES_LIBVIRT_BROKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_BROKER, BoxesLibvirtBrokerClass))

typedef struct _BoxesLibvirtBroker BoxesLibvirtBroker;
typedef struct _BoxesLibvirtBrokerClass BoxesLibvirtBrokerClass;
typedef struct _BoxesLibvirtBrokerPrivate BoxesLibvirtBrokerPrivate;
enum  {
	BOXES_LIBVIRT_BROKER_0_PROPERTY,
	BOXES_LIBVIRT_BROKER_NUM_PROPERTIES
};
static GParamSpec* boxes_libvirt_broker_properties[BOXES_LIBVIRT_BROKER_NUM_PROPERTIES];
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define BOXES_TYPE_COLLECTION_ITEM (boxes_collection_item_get_type ())
#define BOXES_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItem))
#define BOXES_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))
#define BOXES_IS_COLLECTION_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_IS_COLLECTION_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_ITEM))
#define BOXES_COLLECTION_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_ITEM, BoxesCollectionItemClass))

typedef struct _BoxesCollectionItem BoxesCollectionItem;
typedef struct _BoxesCollectionItemClass BoxesCollectionItemClass;

#define BOXES_TYPE_MACHINE (boxes_machine_get_type ())
#define BOXES_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MACHINE, BoxesMachine))
#define BOXES_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MACHINE, BoxesMachineClass))
#define BOXES_IS_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MACHINE))
#define BOXES_IS_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MACHINE))
#define BOXES_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MACHINE, BoxesMachineClass))

typedef struct _BoxesMachine BoxesMachine;
typedef struct _BoxesMachineClass BoxesMachineClass;

#define BOXES_TYPE_LIBVIRT_MACHINE (boxes_libvirt_machine_get_type ())
#define BOXES_LIBVIRT_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachine))
#define BOXES_LIBVIRT_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachineClass))
#define BOXES_IS_LIBVIRT_MACHINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_MACHINE))
#define BOXES_IS_LIBVIRT_MACHINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_MACHINE))
#define BOXES_LIBVIRT_MACHINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachineClass))

typedef struct _BoxesLibvirtMachine BoxesLibvirtMachine;
typedef struct _BoxesLibvirtMachineClass BoxesLibvirtMachineClass;
typedef struct _Block29Data Block29Data;
typedef struct _Block30Data Block30Data;

#define BOXES_TYPE_APP (boxes_app_get_type ())
#define BOXES_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP, BoxesApp))
#define BOXES_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP, BoxesAppClass))
#define BOXES_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP))
#define BOXES_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP))
#define BOXES_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP, BoxesAppClass))

typedef struct _BoxesApp BoxesApp;
typedef struct _BoxesAppClass BoxesAppClass;
typedef struct _BoxesAppPrivate BoxesAppPrivate;

#define BOXES_TYPE_COLLECTION (boxes_collection_get_type ())
#define BOXES_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION, BoxesCollection))
#define BOXES_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION, BoxesCollectionClass))
#define BOXES_IS_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION))
#define BOXES_IS_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION))
#define BOXES_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION, BoxesCollectionClass))

typedef struct _BoxesCollection BoxesCollection;
typedef struct _BoxesCollectionClass BoxesCollectionClass;

#define BOXES_TYPE_SHARED_FOLDERS_MANAGER (boxes_shared_folders_manager_get_type ())
#define BOXES_SHARED_FOLDERS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SHARED_FOLDERS_MANAGER, BoxesSharedFoldersManager))
#define BOXES_SHARED_FOLDERS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SHARED_FOLDERS_MANAGER, BoxesSharedFoldersManagerClass))
#define BOXES_IS_SHARED_FOLDERS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SHARED_FOLDERS_MANAGER))
#define BOXES_IS_SHARED_FOLDERS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SHARED_FOLDERS_MANAGER))
#define BOXES_SHARED_FOLDERS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SHARED_FOLDERS_MANAGER, BoxesSharedFoldersManagerClass))

typedef struct _BoxesSharedFoldersManager BoxesSharedFoldersManager;
typedef struct _BoxesSharedFoldersManagerClass BoxesSharedFoldersManagerClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _BoxesLibvirtBrokerAddDomainData BoxesLibvirtBrokerAddDomainData;
typedef struct _BoxesLibvirtBrokerTryAddNewDomainData BoxesLibvirtBrokerTryAddNewDomainData;

#define BOXES_TYPE_VM_CREATOR (boxes_vm_creator_get_type ())
#define BOXES_VM_CREATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_VM_CREATOR, BoxesVMCreator))
#define BOXES_VM_CREATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_VM_CREATOR, BoxesVMCreatorClass))
#define BOXES_IS_VM_CREATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_VM_CREATOR))
#define BOXES_IS_VM_CREATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_VM_CREATOR))
#define BOXES_VM_CREATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_VM_CREATOR, BoxesVMCreatorClass))

typedef struct _BoxesVMCreator BoxesVMCreator;
typedef struct _BoxesVMCreatorClass BoxesVMCreatorClass;

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

typedef struct _BoxesVMImporter BoxesVMImporter;
typedef struct _BoxesVMImporterClass BoxesVMImporterClass;

#define BOXES_TYPE_LIBVIRT_VM_IMPORTER (boxes_libvirt_vm_importer_get_type ())
#define BOXES_LIBVIRT_VM_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_VM_IMPORTER, BoxesLibvirtVMImporter))
#define BOXES_LIBVIRT_VM_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_VM_IMPORTER, BoxesLibvirtVMImporterClass))
#define BOXES_IS_LIBVIRT_VM_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_VM_IMPORTER))
#define BOXES_IS_LIBVIRT_VM_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_VM_IMPORTER))
#define BOXES_LIBVIRT_VM_IMPORTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_VM_IMPORTER, BoxesLibvirtVMImporterClass))

typedef struct _BoxesLibvirtVMImporter BoxesLibvirtVMImporter;
typedef struct _BoxesLibvirtVMImporterClass BoxesLibvirtVMImporterClass;

#define BOXES_TYPE_LIBVIRT_VM_CLONER (boxes_libvirt_vm_cloner_get_type ())
#define BOXES_LIBVIRT_VM_CLONER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_VM_CLONER, BoxesLibvirtVMCloner))
#define BOXES_LIBVIRT_VM_CLONER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_VM_CLONER, BoxesLibvirtVMClonerClass))
#define BOXES_IS_LIBVIRT_VM_CLONER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_VM_CLONER))
#define BOXES_IS_LIBVIRT_VM_CLONER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_VM_CLONER))
#define BOXES_LIBVIRT_VM_CLONER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_VM_CLONER, BoxesLibvirtVMClonerClass))

typedef struct _BoxesLibvirtVMCloner BoxesLibvirtVMCloner;
typedef struct _BoxesLibvirtVMClonerClass BoxesLibvirtVMClonerClass;
typedef struct _BoxesLibvirtBrokerTryAddExistingDomainData BoxesLibvirtBrokerTryAddExistingDomainData;
typedef struct _Block31Data Block31Data;
typedef struct _Block32Data Block32Data;

#define BOXES_TYPE_INSTALLER_MEDIA (boxes_installer_media_get_type ())
#define BOXES_INSTALLER_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_INSTALLER_MEDIA, BoxesInstallerMedia))
#define BOXES_INSTALLER_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_INSTALLER_MEDIA, BoxesInstallerMediaClass))
#define BOXES_IS_INSTALLER_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_INSTALLER_MEDIA))
#define BOXES_IS_INSTALLER_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_INSTALLER_MEDIA))
#define BOXES_INSTALLER_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_INSTALLER_MEDIA, BoxesInstallerMediaClass))

typedef struct _BoxesInstallerMedia BoxesInstallerMedia;
typedef struct _BoxesInstallerMediaClass BoxesInstallerMediaClass;

#define BOXES_TYPE_INSTALLED_MEDIA (boxes_installed_media_get_type ())
#define BOXES_INSTALLED_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_INSTALLED_MEDIA, BoxesInstalledMedia))
#define BOXES_INSTALLED_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_INSTALLED_MEDIA, BoxesInstalledMediaClass))
#define BOXES_IS_INSTALLED_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_INSTALLED_MEDIA))
#define BOXES_IS_INSTALLED_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_INSTALLED_MEDIA))
#define BOXES_INSTALLED_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_INSTALLED_MEDIA, BoxesInstalledMediaClass))

typedef struct _BoxesInstalledMedia BoxesInstalledMedia;
typedef struct _BoxesInstalledMediaClass BoxesInstalledMediaClass;
typedef struct _BoxesInstallerMediaPrivate BoxesInstallerMediaPrivate;
typedef struct _BoxesLibvirtBrokerAddSourceData BoxesLibvirtBrokerAddSourceData;

struct _BoxesBroker {
	GObject parent_instance;
	BoxesBrokerPrivate * priv;
};

struct _BoxesBrokerClass {
	GObjectClass parent_class;
	void (*add_source) (BoxesBroker* self, BoxesCollectionSource* source, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*add_source_finish) (BoxesBroker* self, GAsyncResult* _res_, GError** error);
};

struct _BoxesLibvirtBroker {
	BoxesBroker parent_instance;
	BoxesLibvirtBrokerPrivate * priv;
};

struct _BoxesLibvirtBrokerClass {
	BoxesBrokerClass parent_class;
};

struct _BoxesLibvirtBrokerPrivate {
	GHashTable* connections;
	GList* pending_domains;
};

struct _Block29Data {
	int _ref_count_;
	BoxesLibvirtBroker* self;
	GVirDomain* domain;
	gpointer _async_data_;
};

struct _Block30Data {
	int _ref_count_;
	Block29Data * _data29_;
	GSourceFunc callback;
	gpointer callback_target;
	GDestroyNotify callback_target_destroy_notify;
	gulong id;
};

struct _BoxesApp {
	GtkApplication parent_instance;
	BoxesAppPrivate * priv;
	BoxesCollection* collection;
	BoxesAsyncLauncher* async_launcher;
	BoxesSharedFoldersManager* shared_folders_manager;
};

struct _BoxesAppClass {
	GtkApplicationClass parent_class;
};

struct _BoxesLibvirtBrokerAddDomainData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesLibvirtBroker* self;
	BoxesCollectionSource* source;
	GVirConnection* connection;
	GVirDomain* domain;
	BoxesLibvirtMachine* result;
	Block29Data* _data29_;
	GList* _tmp0_;
	GList* _tmp1_;
	Block30Data* _data30_;
	BoxesApp* _tmp2_;
	BoxesCollection* _tmp3_;
	gulong _tmp4_;
	BoxesLibvirtMachine* machine;
	gconstpointer _tmp5_;
	BoxesLibvirtMachine* _tmp6_;
	BoxesLibvirtMachine* _tmp7_;
	GVirDomain* _tmp8_;
	BoxesLibvirtMachine* _tmp9_;
	BoxesLibvirtMachine* _tmp10_;
	BoxesLibvirtMachine* _tmp11_;
	BoxesLibvirtMachine* _tmp12_;
	BoxesLibvirtMachine* _tmp13_;
	BoxesApp* _tmp14_;
	BoxesCollection* _tmp15_;
	BoxesLibvirtMachine* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gboolean _tmp20_;
	GVirConfigDomain* config;
	BoxesLibvirtMachine* _tmp21_;
	GVirDomain* _tmp22_;
	GVirDomain* _tmp23_;
	GVirConfigDomain* _tmp24_;
	GVirConfigDomain* _tmp25_;
	BoxesLibvirtMachine* _tmp26_;
	GVirDomain* _tmp27_;
	GVirDomain* _tmp28_;
	GVirConfigDomain* _tmp29_;
	BoxesLibvirtMachine* _tmp30_;
	BoxesLibvirtMachine* _tmp31_;
	gboolean _tmp32_;
	gboolean _tmp33_;
	BoxesLibvirtMachine* _tmp34_;
	BoxesLibvirtMachine* _tmp35_;
	gboolean _tmp36_;
	gboolean _tmp37_;
	GError* e;
	const gchar* _tmp38_;
	GError* _tmp39_;
	const gchar* _tmp40_;
	GError* _inner_error0_;
};

struct _BoxesLibvirtBrokerTryAddNewDomainData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesLibvirtBroker* self;
	BoxesCollectionSource* source;
	GVirConnection* connection;
	GVirDomain* domain;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	BoxesLibvirtMachine* _tmp2_;
	BoxesLibvirtMachine* _tmp3_;
	GError* _error_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	GError* _tmp7_;
	const gchar* _tmp8_;
	GError* _inner_error0_;
};

struct _BoxesLibvirtBrokerTryAddExistingDomainData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesLibvirtBroker* self;
	BoxesCollectionSource* source;
	GVirConnection* connection;
	GVirDomain* domain;
	BoxesLibvirtMachine* result;
	BoxesLibvirtMachine* machine;
	BoxesLibvirtMachine* _tmp0_;
	GVirConfigDomain* config;
	GVirConfigDomain* _tmp1_;
	GVirConfigDomain* _tmp2_;
	GVirConfigDomain* _tmp3_;
	GVirConfigDomain* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	BoxesVMImporter* _tmp7_;
	BoxesVMImporter* _tmp8_;
	GVirConfigDomain* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	BoxesLibvirtVMImporter* _tmp12_;
	BoxesLibvirtVMImporter* _tmp13_;
	GVirConfigDomain* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	BoxesLibvirtVMCloner* _tmp17_;
	BoxesLibvirtVMCloner* _tmp18_;
	GError* _error_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	GError* _tmp22_;
	const gchar* _tmp23_;
	GError* _inner_error0_;
};

struct _Block31Data {
	int _ref_count_;
	BoxesLibvirtBroker* self;
	BoxesCollectionSource* source;
	gpointer _async_data_;
};

struct _Block32Data {
	int _ref_count_;
	Block31Data * _data31_;
	BoxesLibvirtMachine* clone;
	BoxesLibvirtMachine* cloned;
	gulong under_construct_id;
};

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

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

struct _BoxesLibvirtBrokerAddSourceData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesLibvirtBroker* self;
	BoxesCollectionSource* source;
	Block31Data* _data31_;
	GHashTable* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gconstpointer _tmp4_;
	gboolean _tmp5_;
	GVirConnection* connection;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	GVirConnection* _tmp9_;
	GVirConnection* _tmp10_;
	GVirConnection* _tmp11_;
	GVirConnection* _tmp12_;
	GVirConnection* _tmp13_;
	GVirConnection* _tmp14_;
	GVirStoragePool* _tmp15_;
	GVirStoragePool* _tmp16_;
	GHashTable* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	GVirConnection* _tmp20_;
	GVirConnection* _tmp21_;
	GList* clones;
	GVirConnection* _tmp22_;
	GList* _tmp23_;
	GList* domain_collection;
	GList* domain_it;
	GVirDomain* _tmp24_;
	GVirDomain* domain;
	BoxesLibvirtMachine* machine;
	GVirConnection* _tmp25_;
	GVirDomain* _tmp26_;
	BoxesLibvirtMachine* _tmp27_;
	BoxesLibvirtMachine* _tmp28_;
	GVirConfigDomain* _tmp29_;
	GVirConfigDomain* _tmp30_;
	BoxesLibvirtMachine* _tmp31_;
	BoxesLibvirtMachine* _tmp32_;
	GList* _tmp33_;
	GList* clone_collection;
	GList* clone_it;
	BoxesLibvirtMachine* _tmp34_;
	BoxesLibvirtMachine* clone;
	Block32Data* _data32_;
	BoxesVMImporter* vm_importer;
	BoxesLibvirtMachine* _tmp35_;
	BoxesVMCreator* _tmp36_;
	BoxesVMCreator* _tmp37_;
	BoxesVMImporter* _tmp38_;
	BoxesVMImporter* _tmp39_;
	BoxesLibvirtMachine* _tmp40_;
	const gchar* _tmp41_;
	const gchar* _tmp42_;
	gchar* disk_path;
	BoxesVMImporter* _tmp43_;
	BoxesInstalledMedia* _tmp44_;
	BoxesInstalledMedia* _tmp45_;
	const gchar* _tmp46_;
	gchar* _tmp47_;
	gint i;
	gboolean _tmp48_;
	gint _tmp49_;
	BoxesApp* _tmp50_;
	BoxesCollection* _tmp51_;
	guint _tmp52_;
	guint _tmp53_;
	BoxesCollectionItem* item;
	BoxesApp* _tmp54_;
	BoxesCollection* _tmp55_;
	BoxesCollectionItem* _tmp56_;
	BoxesCollectionItem* _tmp57_;
	BoxesLibvirtMachine* _vala1_machine;
	BoxesCollectionItem* _tmp58_;
	BoxesLibvirtMachine* _tmp59_;
	GVirStorageVol* volume;
	BoxesLibvirtMachine* _tmp60_;
	GVirStorageVol* _tmp61_;
	GVirStorageVol* _tmp62_;
	GVirStorageVol* _tmp63_;
	gboolean _tmp64_;
	GVirStorageVol* _tmp65_;
	const gchar* _tmp66_;
	GVirStorageVol* _tmp67_;
	const gchar* _tmp68_;
	const gchar* _tmp69_;
	BoxesLibvirtMachine* _tmp70_;
	BoxesLibvirtMachine* _tmp71_;
	BoxesLibvirtMachine* _tmp72_;
	BoxesLibvirtMachine* _tmp73_;
	const gchar* _tmp74_;
	const gchar* _tmp75_;
	BoxesLibvirtMachine* _tmp76_;
	BoxesLibvirtMachine* _tmp77_;
	gulong _tmp78_;
	GVirConnection* _tmp79_;
	GVirConnection* _tmp80_;
	GError* _inner_error0_;
};

static gint BoxesLibvirtBroker_private_offset;
static gpointer boxes_libvirt_broker_parent_class = NULL;
static BoxesLibvirtBroker* boxes_libvirt_broker_broker;
static BoxesLibvirtBroker* boxes_libvirt_broker_broker = NULL;
VALA_EXTERN BoxesApp* boxes_app_app;

VALA_EXTERN GType boxes_broker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesBroker, g_object_unref)
VALA_EXTERN GType boxes_libvirt_broker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesLibvirtBroker, g_object_unref)
VALA_EXTERN void boxes_broker_add_source (BoxesBroker* self,
                              BoxesCollectionSource* source,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_);
VALA_EXTERN void boxes_broker_add_source_finish (BoxesBroker* self,
                                     GAsyncResult* _res_,
                                     GError** error);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
VALA_EXTERN BoxesLibvirtBroker* boxes_libvirt_broker_get_default (void);
static BoxesLibvirtBroker* boxes_libvirt_broker_new (void);
static BoxesLibvirtBroker* boxes_libvirt_broker_construct (GType object_type);
VALA_EXTERN BoxesBroker* boxes_broker_construct (GType object_type);
static void _g_free0_ (gpointer var);
VALA_EXTERN GVirConnection* boxes_libvirt_broker_get_connection (BoxesLibvirtBroker* self,
                                                     const gchar* name);
static void boxes_libvirt_broker_add_domain_data_free (gpointer _data);
VALA_EXTERN GType boxes_collection_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesCollectionItem, g_object_unref)
VALA_EXTERN GType boxes_machine_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesMachine, g_object_unref)
VALA_EXTERN GType boxes_libvirt_machine_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesLibvirtMachine, g_object_unref)
VALA_EXTERN void boxes_libvirt_broker_add_domain (BoxesLibvirtBroker* self,
                                      BoxesCollectionSource* source,
                                      GVirConnection* connection,
                                      GVirDomain* domain,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN BoxesLibvirtMachine* boxes_libvirt_broker_add_domain_finish (BoxesLibvirtBroker* self,
                                                             GAsyncResult* _res_,
                                                             GError** error);
static gboolean boxes_libvirt_broker_add_domain_co (BoxesLibvirtBrokerAddDomainData* _data_);
static Block29Data* block29_data_ref (Block29Data* _data29_);
static void block29_data_unref (void * _userdata_);
static Block30Data* block30_data_ref (Block30Data* _data30_);
static void block30_data_unref (void * _userdata_);
static gboolean _boxes_libvirt_broker_add_domain_co_gsource_func (gpointer self);
VALA_EXTERN GType boxes_app_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesApp, g_object_unref)
VALA_EXTERN GType boxes_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesCollection, g_object_unref)
VALA_EXTERN GType boxes_shared_folders_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesSharedFoldersManager, g_object_unref)
static void ___lambda39_ (Block30Data* _data30_,
                   BoxesCollectionItem* item);
VALA_EXTERN GVirDomain* boxes_libvirt_machine_get_domain (BoxesLibvirtMachine* self);
static void ____lambda39__boxes_collection_item_added (BoxesCollection* _sender,
                                                BoxesCollectionItem* item,
                                                gpointer self);
VALA_EXTERN void boxes_libvirt_machine_new (BoxesCollectionSource* source,
                                GVirConnection* connection,
                                GVirDomain* domain,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN BoxesLibvirtMachine* boxes_libvirt_machine_new_finish (GAsyncResult* _res_,
                                                       GError** error);
VALA_EXTERN void boxes_libvirt_machine_construct (GType object_type,
                                      BoxesCollectionSource* source,
                                      GVirConnection* connection,
                                      GVirDomain* domain,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN BoxesLibvirtMachine* boxes_libvirt_machine_construct_finish (GAsyncResult* _res_,
                                                             GError** error);
static void boxes_libvirt_broker_add_domain_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
VALA_EXTERN void boxes_collection_add_item (BoxesCollection* self,
                                BoxesCollectionItem* item);
VALA_EXTERN void boxes_vm_configurator_update_existing_domain (GVirConfigDomain* domain,
                                                   GVirConnection* connection,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
VALA_EXTERN void boxes_vm_configurator_update_existing_domain_finish (GAsyncResult* _res_);
VALA_EXTERN gboolean boxes_libvirt_machine_get_acceleration_3d (BoxesLibvirtMachine* self);
VALA_EXTERN void boxes_libvirt_machine_set_acceleration_3d (BoxesLibvirtMachine* self,
                                                gboolean value);
VALA_EXTERN gboolean boxes_libvirt_machine_get_run_in_bg (BoxesLibvirtMachine* self);
VALA_EXTERN void boxes_libvirt_machine_set_run_in_bg (BoxesLibvirtMachine* self,
                                          gboolean value);
static void boxes_libvirt_broker_try_add_new_domain_data_free (gpointer _data);
static void boxes_libvirt_broker_try_add_new_domain (BoxesLibvirtBroker* self,
                                              BoxesCollectionSource* source,
                                              GVirConnection* connection,
                                              GVirDomain* domain,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_);
static void boxes_libvirt_broker_try_add_new_domain_finish (BoxesLibvirtBroker* self,
                                                     GAsyncResult* _res_);
static gboolean boxes_libvirt_broker_try_add_new_domain_co (BoxesLibvirtBrokerTryAddNewDomainData* _data_);
static void boxes_libvirt_broker_try_add_new_domain_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_);
static void boxes_libvirt_broker_try_add_existing_domain_data_free (gpointer _data);
static void boxes_libvirt_broker_try_add_existing_domain (BoxesLibvirtBroker* self,
                                                   BoxesCollectionSource* source,
                                                   GVirConnection* connection,
                                                   GVirDomain* domain,
                                                   GAsyncReadyCallback _callback_,
                                                   gpointer _user_data_);
static BoxesLibvirtMachine* boxes_libvirt_broker_try_add_existing_domain_finish (BoxesLibvirtBroker* self,
                                                                          GAsyncResult* _res_);
static gboolean boxes_libvirt_broker_try_add_existing_domain_co (BoxesLibvirtBrokerTryAddExistingDomainData* _data_);
static void boxes_libvirt_broker_try_add_existing_domain_ready (GObject* source_object,
                                                         GAsyncResult* _res_,
                                                         gpointer _user_data_);
VALA_EXTERN GVirConfigDomain* boxes_libvirt_machine_get_domain_config (BoxesLibvirtMachine* self);
VALA_EXTERN gboolean boxes_vm_configurator_is_import_config (GVirConfigDomain* domain);
VALA_EXTERN const gchar* boxes_collection_item_get_name (BoxesCollectionItem* self);
VALA_EXTERN BoxesVMImporter* boxes_vm_importer_new_for_import_completion (BoxesLibvirtMachine* machine);
VALA_EXTERN BoxesVMImporter* boxes_vm_importer_construct_for_import_completion (GType object_type,
                                                                    BoxesLibvirtMachine* machine);
VALA_EXTERN GType boxes_vm_creator_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesVMCreator, g_object_unref)
VALA_EXTERN GType boxes_vm_importer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesVMImporter, g_object_unref)
VALA_EXTERN gboolean boxes_vm_configurator_is_libvirt_system_import_config (GVirConfigDomain* domain);
VALA_EXTERN BoxesLibvirtVMImporter* boxes_libvirt_vm_importer_new_for_import_completion (BoxesLibvirtMachine* machine);
VALA_EXTERN BoxesLibvirtVMImporter* boxes_libvirt_vm_importer_construct_for_import_completion (GType object_type,
                                                                                   BoxesLibvirtMachine* machine);
VALA_EXTERN GType boxes_libvirt_vm_importer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesLibvirtVMImporter, g_object_unref)
VALA_EXTERN gboolean boxes_vm_configurator_is_libvirt_cloning_config (GVirConfigDomain* domain);
VALA_EXTERN BoxesLibvirtVMCloner* boxes_libvirt_vm_cloner_new_for_cloning_completion (BoxesLibvirtMachine* machine);
VALA_EXTERN BoxesLibvirtVMCloner* boxes_libvirt_vm_cloner_construct_for_cloning_completion (GType object_type,
                                                                                BoxesLibvirtMachine* machine);
VALA_EXTERN GType boxes_libvirt_vm_cloner_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesLibvirtVMCloner, g_object_unref)
static void boxes_libvirt_broker_real_add_source_data_free (gpointer _data);
static void boxes_libvirt_broker_real_add_source (BoxesBroker* base,
                                           BoxesCollectionSource* source,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
static gboolean boxes_libvirt_broker_real_add_source_co (BoxesLibvirtBrokerAddSourceData* _data_);
static Block31Data* block31_data_ref (Block31Data* _data31_);
static void block31_data_unref (void * _userdata_);
static void boxes_libvirt_broker_add_source_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
VALA_EXTERN void boxes_ensure_storage_pool (GVirConnection* connection,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN GVirStoragePool* boxes_ensure_storage_pool_finish (GAsyncResult* _res_,
                                                   GError** error);
static Block32Data* block32_data_ref (Block32Data* _data32_);
static void block32_data_unref (void * _userdata_);
VALA_EXTERN BoxesVMCreator* boxes_libvirt_machine_get_vm_creator (BoxesLibvirtMachine* self);
VALA_EXTERN GType boxes_installer_media_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesInstallerMedia, g_object_unref)
VALA_EXTERN GType boxes_installed_media_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesInstalledMedia, g_object_unref)
VALA_EXTERN BoxesInstalledMedia* boxes_vm_importer_get_source_media (BoxesVMImporter* self);
VALA_EXTERN guint boxes_collection_get_length (BoxesCollection* self);
VALA_EXTERN BoxesCollectionItem* boxes_collection_get_item (BoxesCollection* self,
                                                gint position);
VALA_EXTERN GVirStorageVol* boxes_libvirt_machine_get_storage_volume (BoxesLibvirtMachine* self);
VALA_EXTERN void boxes_machine_set_can_delete (BoxesMachine* self,
                                   gboolean value);
static void ____lambda44_ (Block32Data* _data32_);
VALA_EXTERN gboolean boxes_machine_get_under_construction (BoxesMachine* self);
static void _____lambda44__g_object_notify (GObject* _sender,
                                     GParamSpec* pspec,
                                     gpointer self);
static void __lambda45_ (BoxesLibvirtBroker* self,
                  GVirConnection* connection,
                  GVirDomain* domain);
VALA_EXTERN void boxes_app_delete_machine (BoxesApp* self,
                               BoxesMachine* machine,
                               gboolean by_user);
static void ___lambda45__gvir_connection_domain_removed (GVirConnection* _sender,
                                                  GVirDomain* dom,
                                                  gpointer self);
static void __lambda46_ (Block31Data* _data31_,
                  GVirConnection* connection,
                  GVirDomain* domain);
static void ___lambda46__gvir_connection_domain_added (GVirConnection* _sender,
                                                GVirDomain* dom,
                                                gpointer self);
static void boxes_libvirt_broker_finalize (GObject * obj);
static GType boxes_libvirt_broker_get_type_once (void);

static inline gpointer
boxes_libvirt_broker_get_instance_private (BoxesLibvirtBroker* self)
{
	return G_STRUCT_MEMBER_P (self, BoxesLibvirtBroker_private_offset);
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

BoxesLibvirtBroker*
boxes_libvirt_broker_get_default (void)
{
	BoxesLibvirtBroker* _tmp0_;
	BoxesLibvirtBroker* _tmp2_;
	BoxesLibvirtBroker* _tmp3_;
	BoxesLibvirtBroker* result;
	_tmp0_ = boxes_libvirt_broker_broker;
	if (_tmp0_ == NULL) {
		BoxesLibvirtBroker* _tmp1_;
		_tmp1_ = boxes_libvirt_broker_new ();
		_g_object_unref0 (boxes_libvirt_broker_broker);
		boxes_libvirt_broker_broker = _tmp1_;
	}
	_tmp2_ = boxes_libvirt_broker_broker;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	result = _tmp3_;
	return result;
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

static BoxesLibvirtBroker*
boxes_libvirt_broker_construct (GType object_type)
{
	BoxesLibvirtBroker * self = NULL;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	self = (BoxesLibvirtBroker*) boxes_broker_construct (object_type);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_object_unref0_);
	_g_hash_table_unref0 (self->priv->connections);
	self->priv->connections = _tmp2_;
	(self->priv->pending_domains == NULL) ? NULL : (self->priv->pending_domains = (_g_list_free__g_object_unref0_ (self->priv->pending_domains), NULL));
	self->priv->pending_domains = NULL;
	return self;
}

static BoxesLibvirtBroker*
boxes_libvirt_broker_new (void)
{
	return boxes_libvirt_broker_construct (BOXES_TYPE_LIBVIRT_BROKER);
}

GVirConnection*
boxes_libvirt_broker_get_connection (BoxesLibvirtBroker* self,
                                     const gchar* name)
{
	GHashTable* _tmp0_;
	gconstpointer _tmp1_;
	GVirConnection* _tmp2_;
	GVirConnection* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = self->priv->connections;
	_tmp1_ = g_hash_table_lookup (_tmp0_, name);
	_tmp2_ = _g_object_ref0 ((GVirConnection*) _tmp1_);
	result = _tmp2_;
	return result;
}

static void
boxes_libvirt_broker_add_domain_data_free (gpointer _data)
{
	BoxesLibvirtBrokerAddDomainData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->source);
	_g_object_unref0 (_data_->connection);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesLibvirtBrokerAddDomainData, _data_);
}

void
boxes_libvirt_broker_add_domain (BoxesLibvirtBroker* self,
                                 BoxesCollectionSource* source,
                                 GVirConnection* connection,
                                 GVirDomain* domain,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	BoxesLibvirtBrokerAddDomainData* _data_;
	BoxesLibvirtBroker* _tmp0_;
	BoxesCollectionSource* _tmp1_;
	GVirConnection* _tmp2_;
	GVirDomain* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	g_return_if_fail (connection != NULL);
	g_return_if_fail (domain != NULL);
	_data_ = g_slice_new0 (BoxesLibvirtBrokerAddDomainData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_broker_add_domain_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (source);
	_g_object_unref0 (_data_->source);
	_data_->source = _tmp1_;
	_tmp2_ = _g_object_ref0 (connection);
	_g_object_unref0 (_data_->connection);
	_data_->connection = _tmp2_;
	_tmp3_ = _g_object_ref0 (domain);
	_g_object_unref0 (_data_->domain);
	_data_->domain = _tmp3_;
	boxes_libvirt_broker_add_domain_co (_data_);
}

BoxesLibvirtMachine*
boxes_libvirt_broker_add_domain_finish (BoxesLibvirtBroker* self,
                                        GAsyncResult* _res_,
                                        GError** error)
{
	BoxesLibvirtMachine* result;
	BoxesLibvirtBrokerAddDomainData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static Block29Data*
block29_data_ref (Block29Data* _data29_)
{
	g_atomic_int_inc (&_data29_->_ref_count_);
	return _data29_;
}

static void
block29_data_unref (void * _userdata_)
{
	Block29Data* _data29_;
	_data29_ = (Block29Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data29_->_ref_count_)) {
		BoxesLibvirtBroker* self;
		self = _data29_->self;
		_g_object_unref0 (_data29_->domain);
		_g_object_unref0 (self);
		g_slice_free (Block29Data, _data29_);
	}
}

static Block30Data*
block30_data_ref (Block30Data* _data30_)
{
	g_atomic_int_inc (&_data30_->_ref_count_);
	return _data30_;
}

static void
block30_data_unref (void * _userdata_)
{
	Block30Data* _data30_;
	_data30_ = (Block30Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data30_->_ref_count_)) {
		BoxesLibvirtBroker* self;
		self = _data30_->_data29_->self;
		(_data30_->callback_target_destroy_notify == NULL) ? NULL : (_data30_->callback_target_destroy_notify (_data30_->callback_target), NULL);
		_data30_->callback = NULL;
		_data30_->callback_target = NULL;
		_data30_->callback_target_destroy_notify = NULL;
		block29_data_unref (_data30_->_data29_);
		_data30_->_data29_ = NULL;
		g_slice_free (Block30Data, _data30_);
	}
}

static gboolean
_boxes_libvirt_broker_add_domain_co_gsource_func (gpointer self)
{
	gboolean result;
	result = boxes_libvirt_broker_add_domain_co (self);
	return result;
}

static void
___lambda39_ (Block30Data* _data30_,
              BoxesCollectionItem* item)
{
	Block29Data* _data29_;
	BoxesLibvirtBroker* self;
	BoxesLibvirtMachine* libvirt_machine = NULL;
	BoxesLibvirtMachine* _tmp0_;
	BoxesLibvirtMachine* _tmp1_;
	GVirDomain* _tmp2_;
	GVirDomain* _tmp3_;
	BoxesApp* _tmp4_;
	BoxesCollection* _tmp5_;
	GSourceFunc _tmp6_;
	gpointer _tmp6__target;
	_data29_ = _data30_->_data29_;
	self = _data29_->self;
	g_return_if_fail (item != NULL);
	if (!BOXES_IS_LIBVIRT_MACHINE (item)) {
		return;
	}
	_tmp0_ = _g_object_ref0 (BOXES_IS_LIBVIRT_MACHINE (item) ? ((BoxesLibvirtMachine*) item) : NULL);
	libvirt_machine = _tmp0_;
	_tmp1_ = libvirt_machine;
	_tmp2_ = boxes_libvirt_machine_get_domain (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_ != _data29_->domain) {
		_g_object_unref0 (libvirt_machine);
		return;
	}
	_tmp4_ = boxes_app_app;
	_tmp5_ = _tmp4_->collection;
	g_signal_handler_disconnect ((GObject*) _tmp5_, _data30_->id);
	_tmp6_ = _data30_->callback;
	_tmp6__target = _data30_->callback_target;
	_tmp6_ (_tmp6__target);
	_g_object_unref0 (libvirt_machine);
}

static void
____lambda39__boxes_collection_item_added (BoxesCollection* _sender,
                                           BoxesCollectionItem* item,
                                           gpointer self)
{
	___lambda39_ (self, item);
}

static void
boxes_libvirt_broker_add_domain_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	BoxesLibvirtBrokerAddDomainData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_broker_add_domain_co (_data_);
}

static GList*
vala_g_list_remove_full (GList* self,
                         gconstpointer data,
                         GFreeFunc func)
{
	GList* l = NULL;
	GList* result;
	l = self;
	while (TRUE) {
		GList* _tmp0_;
		GList* _tmp1_;
		gconstpointer _tmp2_;
		_tmp0_ = l;
		if (!(_tmp0_ != NULL)) {
			break;
		}
		_tmp1_ = l;
		_tmp2_ = ((GList*) _tmp1_)->data;
		if (_tmp2_ != data) {
			GList* _tmp3_;
			GList* _tmp4_;
			_tmp3_ = l;
			_tmp4_ = ((GList*) _tmp3_)->next;
			l = _tmp4_;
		} else {
			GList* _tmp5_;
			gconstpointer _tmp6_;
			GList* _tmp7_;
			_tmp5_ = l;
			_tmp6_ = ((GList*) _tmp5_)->data;
			func (_tmp6_);
			_tmp7_ = l;
			self = g_list_delete_link (self, (GList*) _tmp7_);
			break;
		}
	}
	result = self;
	return result;
}

static gboolean
boxes_libvirt_broker_add_domain_co (BoxesLibvirtBrokerAddDomainData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data29_ = g_slice_new0 (Block29Data);
	_data_->_data29_->_ref_count_ = 1;
	_data_->_data29_->self = g_object_ref (_data_->self);
	_g_object_unref0 (_data_->_data29_->domain);
	_data_->_data29_->domain = _data_->domain;
	_data_->_data29_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->pending_domains;
	_data_->_tmp1_ = g_list_find (_data_->_tmp0_, _data_->_data29_->domain);
	if (_data_->_tmp1_ != NULL) {
		_data_->_data30_ = g_slice_new0 (Block30Data);
		_data_->_data30_->_ref_count_ = 1;
		_data_->_data30_->_data29_ = block29_data_ref (_data_->_data29_);
		_data_->_data30_->callback = _boxes_libvirt_broker_add_domain_co_gsource_func;
		_data_->_data30_->callback_target = _data_;
		_data_->_data30_->callback_target_destroy_notify = NULL;
		_data_->_data30_->id = (gulong) 0;
		_data_->_tmp2_ = boxes_app_app;
		_data_->_tmp3_ = _data_->_tmp2_->collection;
		_data_->_tmp4_ = g_signal_connect_data (_data_->_tmp3_, "item-added", (GCallback) ____lambda39__boxes_collection_item_added, block30_data_ref (_data_->_data30_), (GClosureNotify) block30_data_unref, 0);
		_data_->_data30_->id = _data_->_tmp4_;
		_data_->_state_ = 1;
		return FALSE;
		_state_1:
		;
		block30_data_unref (_data_->_data30_);
		_data_->_data30_ = NULL;
	}
	_data_->_tmp5_ = g_object_get_data ((GObject*) _data_->_data29_->domain, "machine");
	_data_->_tmp6_ = _g_object_ref0 ((BoxesLibvirtMachine*) _data_->_tmp5_);
	_data_->machine = _data_->_tmp6_;
	_data_->_tmp7_ = _data_->machine;
	if (_data_->_tmp7_ != NULL) {
		_data_->result = _data_->machine;
		block29_data_unref (_data_->_data29_);
		_data_->_data29_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp8_ = _g_object_ref0 (_data_->_data29_->domain);
	_data_->self->priv->pending_domains = g_list_append (_data_->self->priv->pending_domains, _data_->_tmp8_);
	_data_->_state_ = 2;
	boxes_libvirt_machine_new (_data_->source, _data_->connection, _data_->_data29_->domain, boxes_libvirt_broker_add_domain_ready, _data_);
	return FALSE;
	_state_2:
	_data_->_tmp10_ = boxes_libvirt_machine_new_finish (_data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp9_ = _data_->_tmp10_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->machine);
		block29_data_unref (_data_->_data29_);
		_data_->_data29_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp11_ = _data_->_tmp9_;
	_data_->_tmp9_ = NULL;
	_g_object_unref0 (_data_->machine);
	_data_->machine = _data_->_tmp11_;
	_data_->self->priv->pending_domains = vala_g_list_remove_full (_data_->self->priv->pending_domains, _data_->_data29_->domain, _g_object_unref0_);
	_data_->_tmp12_ = _data_->machine;
	_data_->_tmp13_ = _g_object_ref0 (_data_->_tmp12_);
	g_object_set_data_full ((GObject*) _data_->_data29_->domain, "machine", _data_->_tmp13_, g_object_unref);
	_data_->_tmp14_ = boxes_app_app;
	_data_->_tmp15_ = _data_->_tmp14_->collection;
	_data_->_tmp16_ = _data_->machine;
	boxes_collection_add_item (_data_->_tmp15_, (BoxesCollectionItem*) _data_->_tmp16_);
	_data_->_tmp17_ = boxes_collection_source_get_name (_data_->source);
	_data_->_tmp18_ = _data_->_tmp17_;
	_data_->_tmp19_ = _data_->_tmp18_;
	_data_->_tmp20_ = g_strcmp0 (_data_->_tmp19_, BOXES_APP_DEFAULT_SOURCE_NAME) != 0;
	_g_free0 (_data_->_tmp19_);
	if (_data_->_tmp20_) {
		_data_->result = _data_->machine;
		_g_object_unref0 (_data_->_tmp9_);
		block29_data_unref (_data_->_data29_);
		_data_->_data29_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_tmp21_ = _data_->machine;
		_data_->_tmp22_ = boxes_libvirt_machine_get_domain (_data_->_tmp21_);
		_data_->_tmp23_ = _data_->_tmp22_;
		_data_->_tmp24_ = gvir_domain_get_config (_data_->_tmp23_, (guint) 0, &_data_->_inner_error0_);
		_data_->config = _data_->_tmp24_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp25_ = _data_->config;
		_data_->_state_ = 3;
		boxes_vm_configurator_update_existing_domain (_data_->_tmp25_, _data_->connection, boxes_libvirt_broker_add_domain_ready, _data_);
		return FALSE;
		_state_3:
		boxes_vm_configurator_update_existing_domain_finish (_data_->_res_);
		_data_->_tmp26_ = _data_->machine;
		_data_->_tmp27_ = boxes_libvirt_machine_get_domain (_data_->_tmp26_);
		_data_->_tmp28_ = _data_->_tmp27_;
		_data_->_tmp29_ = _data_->config;
		gvir_domain_set_config (_data_->_tmp28_, _data_->_tmp29_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->config);
			goto __catch0_g_error;
		}
		_data_->_tmp30_ = _data_->machine;
		_data_->_tmp31_ = _data_->machine;
		_data_->_tmp32_ = boxes_libvirt_machine_get_acceleration_3d (_data_->_tmp31_);
		_data_->_tmp33_ = _data_->_tmp32_;
		boxes_libvirt_machine_set_acceleration_3d (_data_->_tmp30_, !(!_data_->_tmp33_));
		_data_->_tmp34_ = _data_->machine;
		_data_->_tmp35_ = _data_->machine;
		_data_->_tmp36_ = boxes_libvirt_machine_get_run_in_bg (_data_->_tmp35_);
		_data_->_tmp37_ = _data_->_tmp36_;
		boxes_libvirt_machine_set_run_in_bg (_data_->_tmp34_, !(!_data_->_tmp37_));
		_g_object_unref0 (_data_->config);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp38_ = gvir_domain_get_name (_data_->_data29_->domain);
		_data_->_tmp39_ = _data_->e;
		_data_->_tmp40_ = _data_->_tmp39_->message;
		g_warning ("libvirt-broker.vala:74: Failed to update domain '%s': %s", _data_->_tmp38_, _data_->_tmp40_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->_tmp9_);
		_g_object_unref0 (_data_->machine);
		block29_data_unref (_data_->_data29_);
		_data_->_data29_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = _data_->machine;
	_g_object_unref0 (_data_->_tmp9_);
	block29_data_unref (_data_->_data29_);
	_data_->_data29_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
boxes_libvirt_broker_try_add_new_domain_data_free (gpointer _data)
{
	BoxesLibvirtBrokerTryAddNewDomainData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->source);
	_g_object_unref0 (_data_->connection);
	_g_object_unref0 (_data_->domain);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesLibvirtBrokerTryAddNewDomainData, _data_);
}

static void
boxes_libvirt_broker_try_add_new_domain (BoxesLibvirtBroker* self,
                                         BoxesCollectionSource* source,
                                         GVirConnection* connection,
                                         GVirDomain* domain,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_)
{
	BoxesLibvirtBrokerTryAddNewDomainData* _data_;
	BoxesLibvirtBroker* _tmp0_;
	BoxesCollectionSource* _tmp1_;
	GVirConnection* _tmp2_;
	GVirDomain* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	g_return_if_fail (connection != NULL);
	g_return_if_fail (domain != NULL);
	_data_ = g_slice_new0 (BoxesLibvirtBrokerTryAddNewDomainData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_broker_try_add_new_domain_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (source);
	_g_object_unref0 (_data_->source);
	_data_->source = _tmp1_;
	_tmp2_ = _g_object_ref0 (connection);
	_g_object_unref0 (_data_->connection);
	_data_->connection = _tmp2_;
	_tmp3_ = _g_object_ref0 (domain);
	_g_object_unref0 (_data_->domain);
	_data_->domain = _tmp3_;
	boxes_libvirt_broker_try_add_new_domain_co (_data_);
}

static void
boxes_libvirt_broker_try_add_new_domain_finish (BoxesLibvirtBroker* self,
                                                GAsyncResult* _res_)
{
	BoxesLibvirtBrokerTryAddNewDomainData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
boxes_libvirt_broker_try_add_new_domain_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_)
{
	BoxesLibvirtBrokerTryAddNewDomainData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_broker_try_add_new_domain_co (_data_);
}

static gboolean
boxes_libvirt_broker_try_add_new_domain_co (BoxesLibvirtBrokerTryAddNewDomainData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gvir_domain_get_name (_data_->domain);
	if (g_str_has_prefix (_data_->_tmp0_, "guestfs-")) {
		_data_->_tmp1_ = gvir_domain_get_name (_data_->domain);
		g_debug ("libvirt-broker.vala:83: Ignoring guestfs domain '%s'", _data_->_tmp1_);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_state_ = 1;
		boxes_libvirt_broker_add_domain (_data_->self, _data_->source, _data_->connection, _data_->domain, boxes_libvirt_broker_try_add_new_domain_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp2_ = boxes_libvirt_broker_add_domain_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp3_ = _data_->_tmp2_;
		_g_object_unref0 (_data_->_tmp3_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp4_ = boxes_collection_source_get_name (_data_->source);
		_data_->_tmp5_ = _data_->_tmp4_;
		_data_->_tmp6_ = _data_->_tmp5_;
		_data_->_tmp7_ = _data_->_error_;
		_data_->_tmp8_ = _data_->_tmp7_->message;
		g_warning ("libvirt-broker.vala:91: Failed to create source '%s': %s", _data_->_tmp6_, _data_->_tmp8_);
		_g_free0 (_data_->_tmp6_);
		_g_error_free0 (_data_->_error_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
boxes_libvirt_broker_try_add_existing_domain_data_free (gpointer _data)
{
	BoxesLibvirtBrokerTryAddExistingDomainData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->source);
	_g_object_unref0 (_data_->connection);
	_g_object_unref0 (_data_->domain);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesLibvirtBrokerTryAddExistingDomainData, _data_);
}

static void
boxes_libvirt_broker_try_add_existing_domain (BoxesLibvirtBroker* self,
                                              BoxesCollectionSource* source,
                                              GVirConnection* connection,
                                              GVirDomain* domain,
                                              GAsyncReadyCallback _callback_,
                                              gpointer _user_data_)
{
	BoxesLibvirtBrokerTryAddExistingDomainData* _data_;
	BoxesLibvirtBroker* _tmp0_;
	BoxesCollectionSource* _tmp1_;
	GVirConnection* _tmp2_;
	GVirDomain* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	g_return_if_fail (connection != NULL);
	g_return_if_fail (domain != NULL);
	_data_ = g_slice_new0 (BoxesLibvirtBrokerTryAddExistingDomainData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_broker_try_add_existing_domain_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (source);
	_g_object_unref0 (_data_->source);
	_data_->source = _tmp1_;
	_tmp2_ = _g_object_ref0 (connection);
	_g_object_unref0 (_data_->connection);
	_data_->connection = _tmp2_;
	_tmp3_ = _g_object_ref0 (domain);
	_g_object_unref0 (_data_->domain);
	_data_->domain = _tmp3_;
	boxes_libvirt_broker_try_add_existing_domain_co (_data_);
}

static BoxesLibvirtMachine*
boxes_libvirt_broker_try_add_existing_domain_finish (BoxesLibvirtBroker* self,
                                                     GAsyncResult* _res_)
{
	BoxesLibvirtMachine* result;
	BoxesLibvirtBrokerTryAddExistingDomainData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
boxes_libvirt_broker_try_add_existing_domain_ready (GObject* source_object,
                                                    GAsyncResult* _res_,
                                                    gpointer _user_data_)
{
	BoxesLibvirtBrokerTryAddExistingDomainData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_broker_try_add_existing_domain_co (_data_);
}

static gboolean
boxes_libvirt_broker_try_add_existing_domain_co (BoxesLibvirtBrokerTryAddExistingDomainData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_state_ = 1;
		boxes_libvirt_broker_add_domain (_data_->self, _data_->source, _data_->connection, _data_->domain, boxes_libvirt_broker_try_add_existing_domain_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp0_ = boxes_libvirt_broker_add_domain_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
		_data_->machine = _data_->_tmp0_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp1_ = boxes_libvirt_machine_get_domain_config (_data_->machine);
		_data_->_tmp2_ = _data_->_tmp1_;
		_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
		_data_->config = _data_->_tmp3_;
		_data_->_tmp4_ = _data_->config;
		if (boxes_vm_configurator_is_import_config (_data_->_tmp4_)) {
			_data_->_tmp5_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->machine);
			_data_->_tmp6_ = _data_->_tmp5_;
			g_debug ("libvirt-broker.vala:104: Continuing import of '%s', ..", _data_->_tmp6_);
			_data_->_tmp7_ = boxes_vm_importer_new_for_import_completion (_data_->machine);
			_data_->_tmp8_ = _data_->_tmp7_;
			_g_object_unref0 (_data_->_tmp8_);
		} else {
			_data_->_tmp9_ = _data_->config;
			if (boxes_vm_configurator_is_libvirt_system_import_config (_data_->_tmp9_)) {
				_data_->_tmp10_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->machine);
				_data_->_tmp11_ = _data_->_tmp10_;
				g_debug ("libvirt-broker.vala:107: Continuing import of '%s', ..", _data_->_tmp11_);
				_data_->_tmp12_ = boxes_libvirt_vm_importer_new_for_import_completion (_data_->machine);
				_data_->_tmp13_ = _data_->_tmp12_;
				_g_object_unref0 (_data_->_tmp13_);
			} else {
				_data_->_tmp14_ = _data_->config;
				if (boxes_vm_configurator_is_libvirt_cloning_config (_data_->_tmp14_)) {
					_data_->_tmp15_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->machine);
					_data_->_tmp16_ = _data_->_tmp15_;
					g_debug ("libvirt-broker.vala:110: Continuing cloning of '%s', ..", _data_->_tmp16_);
					_data_->_tmp17_ = boxes_libvirt_vm_cloner_new_for_cloning_completion (_data_->machine);
					_data_->_tmp18_ = _data_->_tmp17_;
					_g_object_unref0 (_data_->_tmp18_);
				}
			}
		}
		_data_->result = _data_->machine;
		_g_object_unref0 (_data_->config);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp19_ = boxes_collection_source_get_name (_data_->source);
		_data_->_tmp20_ = _data_->_tmp19_;
		_data_->_tmp21_ = _data_->_tmp20_;
		_data_->_tmp22_ = _data_->_error_;
		_data_->_tmp23_ = _data_->_tmp22_->message;
		g_warning ("libvirt-broker.vala:116: Failed to create source '%s': %s", _data_->_tmp21_, _data_->_tmp23_);
		_g_free0 (_data_->_tmp21_);
		_data_->result = NULL;
		_g_error_free0 (_data_->_error_);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
	g_clear_error (&_data_->_inner_error0_);
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
boxes_libvirt_broker_real_add_source_data_free (gpointer _data)
{
	BoxesLibvirtBrokerAddSourceData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesLibvirtBrokerAddSourceData, _data_);
}

static void
boxes_libvirt_broker_real_add_source (BoxesBroker* base,
                                      BoxesCollectionSource* source,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	BoxesLibvirtBroker * self;
	BoxesLibvirtBrokerAddSourceData* _data_;
	BoxesLibvirtBroker* _tmp0_;
	BoxesCollectionSource* _tmp1_;
	g_return_if_fail (source != NULL);
	self = (BoxesLibvirtBroker*) base;
	_data_ = g_slice_new0 (BoxesLibvirtBrokerAddSourceData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_broker_real_add_source_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (source);
	_g_object_unref0 (_data_->source);
	_data_->source = _tmp1_;
	boxes_libvirt_broker_real_add_source_co (_data_);
}

static void
boxes_libvirt_broker_add_source_finish (BoxesBroker* base,
                                        GAsyncResult* _res_,
                                        GError** error)
{
	BoxesLibvirtBrokerAddSourceData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static Block31Data*
block31_data_ref (Block31Data* _data31_)
{
	g_atomic_int_inc (&_data31_->_ref_count_);
	return _data31_;
}

static void
block31_data_unref (void * _userdata_)
{
	Block31Data* _data31_;
	_data31_ = (Block31Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data31_->_ref_count_)) {
		BoxesLibvirtBroker* self;
		self = _data31_->self;
		_g_object_unref0 (_data31_->source);
		_g_object_unref0 (self);
		g_slice_free (Block31Data, _data31_);
	}
}

static void
boxes_libvirt_broker_add_source_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	BoxesLibvirtBrokerAddSourceData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_broker_real_add_source_co (_data_);
}

static Block32Data*
block32_data_ref (Block32Data* _data32_)
{
	g_atomic_int_inc (&_data32_->_ref_count_);
	return _data32_;
}

static void
block32_data_unref (void * _userdata_)
{
	Block32Data* _data32_;
	_data32_ = (Block32Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data32_->_ref_count_)) {
		BoxesLibvirtBroker* self;
		self = _data32_->_data31_->self;
		_g_object_unref0 (_data32_->cloned);
		_g_object_unref0 (_data32_->clone);
		block31_data_unref (_data32_->_data31_);
		_data32_->_data31_ = NULL;
		g_slice_free (Block32Data, _data32_);
	}
}

static void
____lambda44_ (Block32Data* _data32_)
{
	Block31Data* _data31_;
	BoxesLibvirtBroker* self;
	BoxesLibvirtMachine* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_data31_ = _data32_->_data31_;
	self = _data31_->self;
	_tmp0_ = _data32_->clone;
	_tmp1_ = boxes_machine_get_under_construction ((BoxesMachine*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		BoxesLibvirtMachine* _tmp3_;
		BoxesLibvirtMachine* _tmp4_;
		_tmp3_ = _data32_->cloned;
		boxes_machine_set_can_delete ((BoxesMachine*) _tmp3_, TRUE);
		_tmp4_ = _data32_->clone;
		g_signal_handler_disconnect ((GObject*) _tmp4_, _data32_->under_construct_id);
	}
}

static void
_____lambda44__g_object_notify (GObject* _sender,
                                GParamSpec* pspec,
                                gpointer self)
{
	____lambda44_ (self);
}

static void
__lambda45_ (BoxesLibvirtBroker* self,
             GVirConnection* connection,
             GVirDomain* domain)
{
	BoxesLibvirtMachine* machine = NULL;
	gconstpointer _tmp0_;
	BoxesLibvirtMachine* _tmp1_;
	BoxesLibvirtMachine* _tmp2_;
	BoxesApp* _tmp3_;
	BoxesLibvirtMachine* _tmp4_;
	g_return_if_fail (connection != NULL);
	g_return_if_fail (domain != NULL);
	_tmp0_ = g_object_get_data ((GObject*) domain, "machine");
	_tmp1_ = _g_object_ref0 ((BoxesLibvirtMachine*) _tmp0_);
	machine = _tmp1_;
	_tmp2_ = machine;
	if (_tmp2_ == NULL) {
		_g_object_unref0 (machine);
		return;
	}
	_tmp3_ = boxes_app_app;
	_tmp4_ = machine;
	boxes_app_delete_machine (_tmp3_, (BoxesMachine*) _tmp4_, FALSE);
	_g_object_unref0 (machine);
}

static void
___lambda45__gvir_connection_domain_removed (GVirConnection* _sender,
                                             GVirDomain* dom,
                                             gpointer self)
{
	__lambda45_ ((BoxesLibvirtBroker*) self, _sender, dom);
}

static void
__lambda46_ (Block31Data* _data31_,
             GVirConnection* connection,
             GVirDomain* domain)
{
	BoxesLibvirtBroker* self;
	const gchar* _tmp0_;
	self = _data31_->self;
	g_return_if_fail (connection != NULL);
	g_return_if_fail (domain != NULL);
	_tmp0_ = gvir_domain_get_name (domain);
	g_debug ("libvirt-broker.vala:194: New domain '%s'", _tmp0_);
	boxes_libvirt_broker_try_add_new_domain (self, _data31_->source, connection, domain, NULL, NULL);
}

static void
___lambda46__gvir_connection_domain_added (GVirConnection* _sender,
                                           GVirDomain* dom,
                                           gpointer self)
{
	__lambda46_ (self, _sender, dom);
}

static gboolean
boxes_libvirt_broker_real_add_source_co (BoxesLibvirtBrokerAddSourceData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		case 6:
		goto _state_6;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data31_ = g_slice_new0 (Block31Data);
	_data_->_data31_->_ref_count_ = 1;
	_data_->_data31_->self = g_object_ref (_data_->self);
	_g_object_unref0 (_data_->_data31_->source);
	_data_->_data31_->source = _data_->source;
	_data_->_data31_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->self->priv->connections;
	_data_->_tmp1_ = boxes_collection_source_get_name (_data_->_data31_->source);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _data_->_tmp2_;
	_data_->_tmp4_ = g_hash_table_lookup (_data_->_tmp0_, _data_->_tmp3_);
	_data_->_tmp5_ = ((GVirConnection*) _data_->_tmp4_) != NULL;
	_g_free0 (_data_->_tmp3_);
	if (_data_->_tmp5_) {
		block31_data_unref (_data_->_data31_);
		_data_->_data31_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = boxes_collection_source_get_uri (_data_->_data31_->source);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_tmp8_ = _data_->_tmp7_;
	_data_->_tmp9_ = gvir_connection_new (_data_->_tmp8_);
	_data_->_tmp10_ = _data_->_tmp9_;
	_g_free0 (_data_->_tmp8_);
	_data_->connection = _data_->_tmp10_;
	_data_->_tmp11_ = _data_->connection;
	_data_->_state_ = 1;
	gvir_connection_open_async (_data_->_tmp11_, NULL, boxes_libvirt_broker_add_source_ready, _data_);
	return FALSE;
	_state_1:
	gvir_connection_open_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->connection);
		block31_data_unref (_data_->_data31_);
		_data_->_data31_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp12_ = _data_->connection;
	_data_->_state_ = 2;
	gvir_connection_fetch_domains_async (_data_->_tmp12_, NULL, boxes_libvirt_broker_add_source_ready, _data_);
	return FALSE;
	_state_2:
	gvir_connection_fetch_domains_finish (_data_->_tmp12_, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->connection);
		block31_data_unref (_data_->_data31_);
		_data_->_data31_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp13_ = _data_->connection;
	_data_->_state_ = 3;
	gvir_connection_fetch_storage_pools_async (_data_->_tmp13_, NULL, boxes_libvirt_broker_add_source_ready, _data_);
	return FALSE;
	_state_3:
	gvir_connection_fetch_storage_pools_finish (_data_->_tmp13_, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->connection);
		block31_data_unref (_data_->_data31_);
		_data_->_data31_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp14_ = _data_->connection;
	_data_->_state_ = 4;
	boxes_ensure_storage_pool (_data_->_tmp14_, boxes_libvirt_broker_add_source_ready, _data_);
	return FALSE;
	_state_4:
	_data_->_tmp15_ = boxes_ensure_storage_pool_finish (_data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp16_ = _data_->_tmp15_;
	_g_object_unref0 (_data_->_tmp16_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_object_unref0 (_data_->connection);
		block31_data_unref (_data_->_data31_);
		_data_->_data31_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp17_ = _data_->self->priv->connections;
	_data_->_tmp18_ = boxes_collection_source_get_name (_data_->_data31_->source);
	_data_->_tmp19_ = _data_->_tmp18_;
	_data_->_tmp20_ = _data_->connection;
	_data_->_tmp21_ = _g_object_ref0 (_data_->_tmp20_);
	g_hash_table_insert (_data_->_tmp17_, _data_->_tmp19_, _data_->_tmp21_);
	_data_->clones = NULL;
	_data_->_tmp22_ = _data_->connection;
	_data_->_tmp23_ = gvir_connection_get_domains (_data_->_tmp22_);
	{
		_data_->domain_collection = _data_->_tmp23_;
		for (_data_->domain_it = _data_->domain_collection; _data_->domain_it != NULL; _data_->domain_it = _data_->domain_it->next) {
			_data_->_tmp24_ = _g_object_ref0 ((GVirDomain*) _data_->domain_it->data);
			_data_->domain = _data_->_tmp24_;
			{
				_data_->_tmp25_ = _data_->connection;
				_data_->_tmp26_ = _data_->domain;
				_data_->_state_ = 5;
				boxes_libvirt_broker_try_add_existing_domain (_data_->self, _data_->_data31_->source, _data_->_tmp25_, _data_->_tmp26_, boxes_libvirt_broker_add_source_ready, _data_);
				return FALSE;
				_state_5:
				_data_->_tmp27_ = boxes_libvirt_broker_try_add_existing_domain_finish (_data_->self, _data_->_res_);
				_data_->machine = _data_->_tmp27_;
				_data_->_tmp28_ = _data_->machine;
				_data_->_tmp29_ = boxes_libvirt_machine_get_domain_config (_data_->_tmp28_);
				_data_->_tmp30_ = _data_->_tmp29_;
				if (boxes_vm_configurator_is_libvirt_cloning_config (_data_->_tmp30_)) {
					_data_->_tmp31_ = _data_->machine;
					_data_->_tmp32_ = _g_object_ref0 (_data_->_tmp31_);
					_data_->clones = g_list_append (_data_->clones, _data_->_tmp32_);
				}
				_g_object_unref0 (_data_->machine);
				_g_object_unref0 (_data_->domain);
			}
		}
		(_data_->domain_collection == NULL) ? NULL : (_data_->domain_collection = (_g_list_free__g_object_unref0_ (_data_->domain_collection), NULL));
	}
	_data_->_tmp33_ = _data_->clones;
	{
		_data_->clone_collection = _data_->_tmp33_;
		for (_data_->clone_it = _data_->clone_collection; _data_->clone_it != NULL; _data_->clone_it = _data_->clone_it->next) {
			_data_->_tmp34_ = _g_object_ref0 ((BoxesLibvirtMachine*) _data_->clone_it->data);
			_data_->clone = _data_->_tmp34_;
			{
				_data_->_data32_ = g_slice_new0 (Block32Data);
				_data_->_data32_->_ref_count_ = 1;
				_data_->_data32_->_data31_ = block31_data_ref (_data_->_data31_);
				_data_->_data32_->clone = _data_->clone;
				_data_->_tmp35_ = _data_->_data32_->clone;
				_data_->_tmp36_ = boxes_libvirt_machine_get_vm_creator (_data_->_tmp35_);
				_data_->_tmp37_ = _data_->_tmp36_;
				_data_->_tmp38_ = _g_object_ref0 (BOXES_IS_VM_IMPORTER (_data_->_tmp37_) ? ((BoxesVMImporter*) _data_->_tmp37_) : NULL);
				_data_->vm_importer = _data_->_tmp38_;
				_data_->_tmp39_ = _data_->vm_importer;
				if (_data_->_tmp39_ == NULL) {
					_data_->_tmp40_ = _data_->_data32_->clone;
					_data_->_tmp41_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->_tmp40_);
					_data_->_tmp42_ = _data_->_tmp41_;
					g_warning ("libvirt-broker.vala:147: Failed to find creater of clone '%s'", _data_->_tmp42_);
					_g_object_unref0 (_data_->vm_importer);
					block32_data_unref (_data_->_data32_);
					_data_->_data32_ = NULL;
					continue;
				}
				_data_->_tmp43_ = _data_->vm_importer;
				_data_->_tmp44_ = boxes_vm_importer_get_source_media (_data_->_tmp43_);
				_data_->_tmp45_ = _data_->_tmp44_;
				_data_->_tmp46_ = ((BoxesInstallerMedia*) _data_->_tmp45_)->device_file;
				_data_->_tmp47_ = g_strdup (_data_->_tmp46_);
				_data_->disk_path = _data_->_tmp47_;
				_data_->_data32_->cloned = NULL;
				{
					_data_->i = 0;
					{
						_data_->_tmp48_ = TRUE;
						while (TRUE) {
							if (!_data_->_tmp48_) {
								_data_->_tmp49_ = _data_->i;
								_data_->i = _data_->_tmp49_ + 1;
							}
							_data_->_tmp48_ = FALSE;
							_data_->_tmp50_ = boxes_app_app;
							_data_->_tmp51_ = _data_->_tmp50_->collection;
							_data_->_tmp52_ = boxes_collection_get_length (_data_->_tmp51_);
							_data_->_tmp53_ = _data_->_tmp52_;
							if (!(((guint) _data_->i) < _data_->_tmp53_)) {
								break;
							}
							_data_->_tmp54_ = boxes_app_app;
							_data_->_tmp55_ = _data_->_tmp54_->collection;
							_data_->_tmp56_ = boxes_collection_get_item (_data_->_tmp55_, _data_->i);
							_data_->item = _data_->_tmp56_;
							_data_->_tmp57_ = _data_->item;
							if (!BOXES_IS_LIBVIRT_MACHINE (_data_->_tmp57_)) {
								_g_object_unref0 (_data_->item);
								continue;
							}
							_data_->_tmp58_ = _data_->item;
							_data_->_tmp59_ = _g_object_ref0 (BOXES_IS_LIBVIRT_MACHINE (_data_->_tmp58_) ? ((BoxesLibvirtMachine*) _data_->_tmp58_) : NULL);
							_data_->_vala1_machine = _data_->_tmp59_;
							_data_->_tmp60_ = _data_->_vala1_machine;
							_data_->_tmp61_ = boxes_libvirt_machine_get_storage_volume (_data_->_tmp60_);
							_data_->_tmp62_ = _data_->_tmp61_;
							_data_->_tmp63_ = _g_object_ref0 (_data_->_tmp62_);
							_data_->volume = _data_->_tmp63_;
							_data_->_tmp65_ = _data_->volume;
							if (_data_->_tmp65_ != NULL) {
								_data_->_tmp67_ = _data_->volume;
								_data_->_tmp68_ = gvir_storage_vol_get_path (_data_->_tmp67_, &_data_->_inner_error0_);
								_data_->_tmp66_ = _data_->_tmp68_;
								if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
									g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
									_g_object_unref0 (_data_->volume);
									_g_object_unref0 (_data_->_vala1_machine);
									_g_object_unref0 (_data_->item);
									_g_free0 (_data_->disk_path);
									_g_object_unref0 (_data_->vm_importer);
									block32_data_unref (_data_->_data32_);
									_data_->_data32_ = NULL;
									(_data_->clones == NULL) ? NULL : (_data_->clones = (_g_list_free__g_object_unref0_ (_data_->clones), NULL));
									_g_object_unref0 (_data_->connection);
									block31_data_unref (_data_->_data31_);
									_data_->_data31_ = NULL;
									g_object_unref (_data_->_async_result);
									return FALSE;
								}
								_data_->_tmp69_ = _data_->disk_path;
								_data_->_tmp64_ = g_strcmp0 (_data_->_tmp66_, _data_->_tmp69_) == 0;
							} else {
								_data_->_tmp64_ = FALSE;
							}
							if (_data_->_tmp64_) {
								_data_->_tmp70_ = _data_->_vala1_machine;
								_data_->_tmp71_ = _g_object_ref0 (_data_->_tmp70_);
								_g_object_unref0 (_data_->_data32_->cloned);
								_data_->_data32_->cloned = _data_->_tmp71_;
								_g_object_unref0 (_data_->volume);
								_g_object_unref0 (_data_->_vala1_machine);
								_g_object_unref0 (_data_->item);
								break;
							}
							_g_object_unref0 (_data_->volume);
							_g_object_unref0 (_data_->_vala1_machine);
							_g_object_unref0 (_data_->item);
						}
					}
				}
				_data_->_tmp72_ = _data_->_data32_->cloned;
				if (_data_->_tmp72_ == NULL) {
					_data_->_tmp73_ = _data_->_data32_->clone;
					_data_->_tmp74_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->_tmp73_);
					_data_->_tmp75_ = _data_->_tmp74_;
					g_warning ("libvirt-broker.vala:170: Failed to find source machine of clone %s", _data_->_tmp75_);
					_g_free0 (_data_->disk_path);
					_g_object_unref0 (_data_->vm_importer);
					block32_data_unref (_data_->_data32_);
					_data_->_data32_ = NULL;
					continue;
				}
				_data_->_tmp76_ = _data_->_data32_->cloned;
				boxes_machine_set_can_delete ((BoxesMachine*) _data_->_tmp76_, FALSE);
				_data_->_data32_->under_construct_id = (gulong) 0;
				_data_->_tmp77_ = _data_->_data32_->clone;
				_data_->_tmp78_ = g_signal_connect_data ((GObject*) _data_->_tmp77_, "notify::under-construction", (GCallback) _____lambda44__g_object_notify, block32_data_ref (_data_->_data32_), (GClosureNotify) block32_data_unref, 0);
				_data_->_data32_->under_construct_id = _data_->_tmp78_;
				_g_free0 (_data_->disk_path);
				_g_object_unref0 (_data_->vm_importer);
				block32_data_unref (_data_->_data32_);
				_data_->_data32_ = NULL;
			}
		}
	}
	_data_->_tmp79_ = _data_->connection;
	g_signal_connect_object (_data_->_tmp79_, "domain-removed", (GCallback) ___lambda45__gvir_connection_domain_removed, _data_->self, 0);
	_data_->_tmp80_ = _data_->connection;
	g_signal_connect_data (_data_->_tmp80_, "domain-added", (GCallback) ___lambda46__gvir_connection_domain_added, block31_data_ref (_data_->_data31_), (GClosureNotify) block31_data_unref, 0);
	_data_->_state_ = 6;
	BOXES_BROKER_CLASS (boxes_libvirt_broker_parent_class)->add_source (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, BOXES_TYPE_BROKER, BoxesBroker), _data_->_data31_->source, boxes_libvirt_broker_add_source_ready, _data_);
	return FALSE;
	_state_6:
	BOXES_BROKER_CLASS (boxes_libvirt_broker_parent_class)->add_source_finish (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, BOXES_TYPE_BROKER, BoxesBroker), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		(_data_->clones == NULL) ? NULL : (_data_->clones = (_g_list_free__g_object_unref0_ (_data_->clones), NULL));
		_g_object_unref0 (_data_->connection);
		block31_data_unref (_data_->_data31_);
		_data_->_data31_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	(_data_->clones == NULL) ? NULL : (_data_->clones = (_g_list_free__g_object_unref0_ (_data_->clones), NULL));
	_g_object_unref0 (_data_->connection);
	block31_data_unref (_data_->_data31_);
	_data_->_data31_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
boxes_libvirt_broker_class_init (BoxesLibvirtBrokerClass * klass,
                                 gpointer klass_data)
{
	boxes_libvirt_broker_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BoxesLibvirtBroker_private_offset);
	((BoxesBrokerClass *) klass)->add_source = (void (*) (BoxesBroker*, BoxesCollectionSource*, GAsyncReadyCallback, gpointer)) boxes_libvirt_broker_real_add_source;
	((BoxesBrokerClass *) klass)->add_source_finish = (void (*) (BoxesBroker*, GAsyncResult*, GError**)) boxes_libvirt_broker_add_source_finish;
	G_OBJECT_CLASS (klass)->finalize = boxes_libvirt_broker_finalize;
}

static void
boxes_libvirt_broker_instance_init (BoxesLibvirtBroker * self,
                                    gpointer klass)
{
	self->priv = boxes_libvirt_broker_get_instance_private (self);
}

static void
boxes_libvirt_broker_finalize (GObject * obj)
{
	BoxesLibvirtBroker * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_LIBVIRT_BROKER, BoxesLibvirtBroker);
	_g_hash_table_unref0 (self->priv->connections);
	(self->priv->pending_domains == NULL) ? NULL : (self->priv->pending_domains = (_g_list_free__g_object_unref0_ (self->priv->pending_domains), NULL));
	G_OBJECT_CLASS (boxes_libvirt_broker_parent_class)->finalize (obj);
}

static GType
boxes_libvirt_broker_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (BoxesLibvirtBrokerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_libvirt_broker_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesLibvirtBroker), 0, (GInstanceInitFunc) boxes_libvirt_broker_instance_init, NULL };
	GType boxes_libvirt_broker_type_id;
	boxes_libvirt_broker_type_id = g_type_register_static (BOXES_TYPE_BROKER, "BoxesLibvirtBroker", &g_define_type_info, 0);
	BoxesLibvirtBroker_private_offset = g_type_add_instance_private (boxes_libvirt_broker_type_id, sizeof (BoxesLibvirtBrokerPrivate));
	return boxes_libvirt_broker_type_id;
}

GType
boxes_libvirt_broker_get_type (void)
{
	static volatile gsize boxes_libvirt_broker_type_id__once = 0;
	if (g_once_init_enter (&boxes_libvirt_broker_type_id__once)) {
		GType boxes_libvirt_broker_type_id;
		boxes_libvirt_broker_type_id = boxes_libvirt_broker_get_type_once ();
		g_once_init_leave (&boxes_libvirt_broker_type_id__once, boxes_libvirt_broker_type_id);
	}
	return boxes_libvirt_broker_type_id__once;
}

