/* vm-creator.c generated by valac 0.16.0.2-f2187, the Vala compiler
 * generated from vm-creator.vala, do not modify */

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

#include <glib.h>
#include <glib-object.h>
#include <clutter/clutter.h>
#include <gtk/gtk.h>
#include <clutter-gtk/clutter-gtk.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <libvirt-gobject/libvirt-gobject.h>
#include <libvirt-gconfig/libvirt-gconfig.h>
#include <float.h>
#include <math.h>
#include <osinfo/osinfo.h>
#include <config.h>
#include <gobject/gvaluecollector.h>


#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;
typedef struct _BoxesVMCreatorPrivate BoxesVMCreatorPrivate;

#define BOXES_TYPE_UI (boxes_ui_get_type ())
#define BOXES_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_UI, BoxesUI))
#define BOXES_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_UI, BoxesUIClass))
#define BOXES_IS_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_UI))
#define BOXES_IS_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_UI))
#define BOXES_UI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_UI, BoxesUIClass))

typedef struct _BoxesUI BoxesUI;
typedef struct _BoxesUIClass BoxesUIClass;

#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;

#define BOXES_TYPE_VM_CONFIGURATOR (boxes_vm_configurator_get_type ())
#define BOXES_VM_CONFIGURATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_VM_CONFIGURATOR, BoxesVMConfigurator))
#define BOXES_VM_CONFIGURATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_VM_CONFIGURATOR, BoxesVMConfiguratorClass))
#define BOXES_IS_VM_CONFIGURATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_VM_CONFIGURATOR))
#define BOXES_IS_VM_CONFIGURATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_VM_CONFIGURATOR))
#define BOXES_VM_CONFIGURATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_VM_CONFIGURATOR, BoxesVMConfiguratorClass))

typedef struct _BoxesVMConfigurator BoxesVMConfigurator;
typedef struct _BoxesVMConfiguratorClass BoxesVMConfiguratorClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _boxes_vm_configurator_unref0(var) ((var == NULL) ? NULL : (var = (boxes_vm_configurator_unref (var), NULL)))
typedef struct _BoxesUIPrivate BoxesUIPrivate;

#define BOXES_TYPE_UI_STATE (boxes_ui_state_get_type ())
typedef struct _BoxesAppPrivate BoxesAppPrivate;

#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_TOPBAR (boxes_topbar_get_type ())
#define BOXES_TOPBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TOPBAR, BoxesTopbar))
#define BOXES_TOPBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TOPBAR, BoxesTopbarClass))
#define BOXES_IS_TOPBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TOPBAR))
#define BOXES_IS_TOPBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TOPBAR))
#define BOXES_TOPBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TOPBAR, BoxesTopbarClass))

typedef struct _BoxesTopbar BoxesTopbar;
typedef struct _BoxesTopbarClass BoxesTopbarClass;

#define BOXES_TYPE_NOTIFICATIONBAR (boxes_notificationbar_get_type ())
#define BOXES_NOTIFICATIONBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbar))
#define BOXES_NOTIFICATIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbarClass))
#define BOXES_IS_NOTIFICATIONBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_NOTIFICATIONBAR))
#define BOXES_IS_NOTIFICATIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_NOTIFICATIONBAR))
#define BOXES_NOTIFICATIONBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_NOTIFICATIONBAR, BoxesNotificationbarClass))

typedef struct _BoxesNotificationbar BoxesNotificationbar;
typedef struct _BoxesNotificationbarClass BoxesNotificationbarClass;

#define BOXES_TYPE_SIDEBAR (boxes_sidebar_get_type ())
#define BOXES_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SIDEBAR, BoxesSidebar))
#define BOXES_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SIDEBAR, BoxesSidebarClass))
#define BOXES_IS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SIDEBAR))
#define BOXES_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SIDEBAR))
#define BOXES_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SIDEBAR, BoxesSidebarClass))

typedef struct _BoxesSidebar BoxesSidebar;
typedef struct _BoxesSidebarClass BoxesSidebarClass;

#define BOXES_TYPE_SELECTIONBAR (boxes_selectionbar_get_type ())
#define BOXES_SELECTIONBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SELECTIONBAR, BoxesSelectionbar))
#define BOXES_SELECTIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SELECTIONBAR, BoxesSelectionbarClass))
#define BOXES_IS_SELECTIONBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SELECTIONBAR))
#define BOXES_IS_SELECTIONBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SELECTIONBAR))
#define BOXES_SELECTIONBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SELECTIONBAR, BoxesSelectionbarClass))

typedef struct _BoxesSelectionbar BoxesSelectionbar;
typedef struct _BoxesSelectionbarClass BoxesSelectionbarClass;

#define BOXES_TYPE_WIZARD (boxes_wizard_get_type ())
#define BOXES_WIZARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_WIZARD, BoxesWizard))
#define BOXES_WIZARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_WIZARD, BoxesWizardClass))
#define BOXES_IS_WIZARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_WIZARD))
#define BOXES_IS_WIZARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_WIZARD))
#define BOXES_WIZARD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_WIZARD, BoxesWizardClass))

typedef struct _BoxesWizard BoxesWizard;
typedef struct _BoxesWizardClass BoxesWizardClass;

#define BOXES_TYPE_PROPERTIES (boxes_properties_get_type ())
#define BOXES_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_PROPERTIES, BoxesProperties))
#define BOXES_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_PROPERTIES, BoxesPropertiesClass))
#define BOXES_IS_PROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_PROPERTIES))
#define BOXES_IS_PROPERTIES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_PROPERTIES))
#define BOXES_PROPERTIES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_PROPERTIES, BoxesPropertiesClass))

typedef struct _BoxesProperties BoxesProperties;
typedef struct _BoxesPropertiesClass BoxesPropertiesClass;

#define BOXES_TYPE_DISPLAY_PAGE (boxes_display_page_get_type ())
#define BOXES_DISPLAY_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPage))
#define BOXES_DISPLAY_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPageClass))
#define BOXES_IS_DISPLAY_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DISPLAY_PAGE))
#define BOXES_IS_DISPLAY_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DISPLAY_PAGE))
#define BOXES_DISPLAY_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DISPLAY_PAGE, BoxesDisplayPageClass))

typedef struct _BoxesDisplayPage BoxesDisplayPage;
typedef struct _BoxesDisplayPageClass BoxesDisplayPageClass;

#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_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 _Block31Data Block31Data;
#define _boxes_vm_creator_unref0(var) ((var == NULL) ? NULL : (var = (boxes_vm_creator_unref (var), NULL)))
typedef struct _BoxesCollectionItemPrivate BoxesCollectionItemPrivate;

#define BOXES_TYPE_IPROPERTIES_PROVIDER (boxes_iproperties_provider_get_type ())
#define BOXES_IPROPERTIES_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER, BoxesIPropertiesProvider))
#define BOXES_IS_IPROPERTIES_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER))
#define BOXES_IPROPERTIES_PROVIDER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BOXES_TYPE_IPROPERTIES_PROVIDER, BoxesIPropertiesProviderIface))

typedef struct _BoxesIPropertiesProvider BoxesIPropertiesProvider;
typedef struct _BoxesIPropertiesProviderIface BoxesIPropertiesProviderIface;

#define BOXES_TYPE_PROPERTIES_PAGE (boxes_properties_page_get_type ())

#define BOXES_TYPE_PAIR (boxes_pair_get_type ())
#define BOXES_PAIR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_PAIR, BoxesPair))
#define BOXES_PAIR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_PAIR, BoxesPairClass))
#define BOXES_IS_PAIR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_PAIR))
#define BOXES_IS_PAIR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_PAIR))
#define BOXES_PAIR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_PAIR, BoxesPairClass))

typedef struct _BoxesPair BoxesPair;
typedef struct _BoxesPairClass BoxesPairClass;
typedef struct _BoxesMachinePrivate BoxesMachinePrivate;

#define BOXES_TYPE_MACHINE_ACTOR (boxes_machine_actor_get_type ())
#define BOXES_MACHINE_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MACHINE_ACTOR, BoxesMachineActor))
#define BOXES_MACHINE_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MACHINE_ACTOR, BoxesMachineActorClass))
#define BOXES_IS_MACHINE_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MACHINE_ACTOR))
#define BOXES_IS_MACHINE_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MACHINE_ACTOR))
#define BOXES_MACHINE_ACTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MACHINE_ACTOR, BoxesMachineActorClass))

typedef struct _BoxesMachineActor BoxesMachineActor;
typedef struct _BoxesMachineActorClass BoxesMachineActorClass;

#define BOXES_TYPE_COLLECTION_SOURCE (boxes_collection_source_get_type ())
#define BOXES_COLLECTION_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_SOURCE, BoxesCollectionSource))
#define BOXES_COLLECTION_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_SOURCE, BoxesCollectionSourceClass))
#define BOXES_IS_COLLECTION_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_SOURCE))
#define BOXES_IS_COLLECTION_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_SOURCE))
#define BOXES_COLLECTION_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_SOURCE, BoxesCollectionSourceClass))

typedef struct _BoxesCollectionSource BoxesCollectionSource;
typedef struct _BoxesCollectionSourceClass BoxesCollectionSourceClass;

#define BOXES_TYPE_DISPLAY_CONFIG (boxes_display_config_get_type ())
#define BOXES_DISPLAY_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DISPLAY_CONFIG, BoxesDisplayConfig))
#define BOXES_DISPLAY_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DISPLAY_CONFIG, BoxesDisplayConfigClass))
#define BOXES_IS_DISPLAY_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DISPLAY_CONFIG))
#define BOXES_IS_DISPLAY_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DISPLAY_CONFIG))
#define BOXES_DISPLAY_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DISPLAY_CONFIG, BoxesDisplayConfigClass))

typedef struct _BoxesDisplayConfig BoxesDisplayConfig;
typedef struct _BoxesDisplayConfigClass BoxesDisplayConfigClass;
typedef struct _BoxesLibvirtMachinePrivate BoxesLibvirtMachinePrivate;
#define __vala_GVirDomainInfo_free0(var) ((var == NULL) ? NULL : (var = (_vala_GVirDomainInfo_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

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

typedef struct _BoxesInstallerMedia BoxesInstallerMedia;
typedef struct _BoxesInstallerMediaClass BoxesInstallerMediaClass;
typedef struct _Block32Data Block32Data;

#define BOXES_TYPE_UNATTENDED_INSTALLER (boxes_unattended_installer_get_type ())
#define BOXES_UNATTENDED_INSTALLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_UNATTENDED_INSTALLER, BoxesUnattendedInstaller))
#define BOXES_UNATTENDED_INSTALLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_UNATTENDED_INSTALLER, BoxesUnattendedInstallerClass))
#define BOXES_IS_UNATTENDED_INSTALLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_UNATTENDED_INSTALLER))
#define BOXES_IS_UNATTENDED_INSTALLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_UNATTENDED_INSTALLER))
#define BOXES_UNATTENDED_INSTALLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_UNATTENDED_INSTALLER, BoxesUnattendedInstallerClass))

typedef struct _BoxesUnattendedInstaller BoxesUnattendedInstaller;
typedef struct _BoxesUnattendedInstallerClass BoxesUnattendedInstallerClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
typedef struct _BoxesInstallerMediaPrivate BoxesInstallerMediaPrivate;
typedef struct _Block33Data Block33Data;
typedef struct _BoxesVmCreatorCreateAndLaunchVmData BoxesVmCreatorCreateAndLaunchVmData;
#define __vala_GVirStorageVolInfo_free0(var) ((var == NULL) ? NULL : (var = (_vala_GVirStorageVolInfo_free (var), NULL)))
typedef struct _BoxesVmCreatorCreateDomainNameFromMediaData BoxesVmCreatorCreateDomainNameFromMediaData;
typedef struct _BoxesVmCreatorCreateTargetVolumeData BoxesVmCreatorCreateTargetVolumeData;
typedef struct _BoxesVmCreatorGetStoragePoolData BoxesVmCreatorGetStoragePoolData;
typedef struct _BoxesParamSpecVMCreator BoxesParamSpecVMCreator;

struct _BoxesVMCreator {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BoxesVMCreatorPrivate * priv;
};

struct _BoxesVMCreatorClass {
	GTypeClass parent_class;
	void (*finalize) (BoxesVMCreator *self);
};

struct _BoxesVMCreatorPrivate {
	BoxesApp* app;
	BoxesVMConfigurator* configurator;
	gulong stopped_id;
};

typedef enum  {
	BOXES_UI_STATE_NONE,
	BOXES_UI_STATE_COLLECTION,
	BOXES_UI_STATE_CREDS,
	BOXES_UI_STATE_DISPLAY,
	BOXES_UI_STATE_SETTINGS,
	BOXES_UI_STATE_WIZARD,
	BOXES_UI_STATE_PROPERTIES
} BoxesUIState;

struct _BoxesUI {
	GObject parent_instance;
	BoxesUIPrivate * priv;
	BoxesUIState previous_ui_state;
};

struct _BoxesUIClass {
	GObjectClass parent_class;
	void (*ui_state_changed) (BoxesUI* self);
	ClutterActor* (*get_actor) (BoxesUI* self);
};

struct _BoxesApp {
	BoxesUI parent_instance;
	BoxesAppPrivate * priv;
	GtkApplicationWindow* window;
	GtkNotebook* notebook;
	GtkClutterEmbed* embed;
	ClutterStage* stage;
	ClutterState* state;
	ClutterBox* box;
	BoxesCollectionItem* current_item;
	BoxesTopbar* topbar;
	BoxesNotificationbar* notificationbar;
	BoxesSidebar* sidebar;
	BoxesSelectionbar* selectionbar;
	guint duration;
	GSettings* settings;
	BoxesWizard* wizard;
	BoxesProperties* properties;
	BoxesDisplayPage* display_page;
	BoxesCollection* collection;
	GSimpleAction* action_properties;
	GSimpleAction* action_fullscreen;
};

struct _BoxesAppClass {
	BoxesUIClass parent_class;
};

struct _Block31Data {
	int _ref_count_;
	BoxesVMCreator * self;
	BoxesLibvirtMachine* machine;
};

struct _BoxesCollectionItem {
	BoxesUI parent_instance;
	BoxesCollectionItemPrivate * priv;
};

struct _BoxesCollectionItemClass {
	BoxesUIClass parent_class;
};

typedef enum  {
	BOXES_PROPERTIES_PAGE_LOGIN,
	BOXES_PROPERTIES_PAGE_SYSTEM,
	BOXES_PROPERTIES_PAGE_DISPLAY,
	BOXES_PROPERTIES_PAGE_DEVICES,
	BOXES_PROPERTIES_PAGE_LAST
} BoxesPropertiesPage;

struct _BoxesIPropertiesProviderIface {
	GTypeInterface parent_iface;
	GList* (*get_properties) (BoxesIPropertiesProvider* self, BoxesPropertiesPage page);
};

struct _BoxesMachine {
	BoxesCollectionItem parent_instance;
	BoxesMachinePrivate * priv;
	BoxesApp* app;
	BoxesMachineActor* machine_actor;
	BoxesCollectionSource* source;
	BoxesDisplayConfig* config;
	gboolean deleted;
};

struct _BoxesMachineClass {
	BoxesCollectionItemClass parent_class;
	gchar* (*get_screenshot_filename) (BoxesMachine* self, const gchar* ext);
	void (*take_screenshot) (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gboolean (*take_screenshot_finish) (BoxesMachine* self, GAsyncResult* _res_, GError** error);
	GList* (*get_properties) (BoxesMachine* self, BoxesPropertiesPage page);
	gchar* (*get_screenshot_prefix) (BoxesMachine* self);
	void (*connect_display) (BoxesMachine* self);
	void (*disconnect_display) (BoxesMachine* self);
	void (*delete) (BoxesMachine* self, gboolean by_user);
};

struct _BoxesLibvirtMachine {
	BoxesMachine parent_instance;
	BoxesLibvirtMachinePrivate * priv;
	GVirDomain* domain;
	GVirConfigDomain* domain_config;
	GVirConnection* connection;
	gdouble* cpu_stats;
	gint cpu_stats_length1;
	gint _cpu_stats_size_;
	gdouble* io_stats;
	gint io_stats_length1;
	gint _io_stats_size_;
	gdouble* net_stats;
	gint net_stats_length1;
	gint _net_stats_size_;
};

struct _BoxesLibvirtMachineClass {
	BoxesMachineClass parent_class;
};

struct _Block32Data {
	int _ref_count_;
	BoxesVMCreator * self;
	BoxesLibvirtMachine* machine;
	gpointer _async_data_;
};

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

struct _Block33Data {
	int _ref_count_;
	Block32Data * _data32_;
	gulong signal_id;
};

struct _BoxesVmCreatorCreateAndLaunchVmData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesVMCreator* self;
	BoxesInstallerMedia* install_media;
	GCancellable* cancellable;
	Block32Data* _data32_;
	BoxesInstallerMedia* _tmp0_;
	gchar* _tmp1_;
	gchar* name;
	gboolean fullscreen;
	BoxesInstallerMedia* _tmp2_;
	BoxesInstallerMedia* _tmp3_;
	BoxesUnattendedInstaller* _tmp4_;
	BoxesUnattendedInstaller* unattended;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* hostname;
	BoxesUnattendedInstaller* _tmp7_;
	const gchar* _tmp8_;
	GCancellable* _tmp9_;
	BoxesUnattendedInstaller* _tmp10_;
	gboolean _tmp11_;
	gboolean _tmp12_;
	const gchar* _tmp13_;
	BoxesInstallerMedia* _tmp14_;
	OsinfoResources* _tmp15_;
	gint64 _tmp16_;
	gint64 _tmp17_;
	GVirStorageVol* _tmp18_;
	GVirStorageVol* volume;
	GVirStorageVol* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	BoxesVMConfigurator* _tmp22_;
	BoxesInstallerMedia* _tmp23_;
	const gchar* _tmp24_;
	GVirConfigDomain* _tmp25_;
	GVirConfigDomain* config;
	GVirConnection* _tmp26_;
	GVirConnection* _tmp27_;
	GVirConfigDomain* _tmp28_;
	GVirDomain* _tmp29_;
	GVirDomain* domain;
	GVirDomain* _tmp30_;
	BoxesApp* _tmp31_;
	BoxesApp* _tmp32_;
	BoxesCollectionSource* _tmp33_;
	BoxesCollectionSource* _tmp34_;
	BoxesApp* _tmp35_;
	GVirConnection* _tmp36_;
	GVirConnection* _tmp37_;
	GVirDomain* _tmp38_;
	BoxesLibvirtMachine* _tmp39_;
	gboolean _tmp40_;
	BoxesLibvirtMachine* _tmp41_;
	gboolean _tmp42_;
	gboolean _tmp43_;
	Block33Data* _data33_;
	BoxesApp* _tmp44_;
	gulong _tmp45_;
	GError * _inner_error_;
};

struct _BoxesVmCreatorCreateDomainNameFromMediaData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesVMCreator* self;
	BoxesInstallerMedia* install_media;
	gchar* result;
	BoxesInstallerMedia* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* base_name;
	gchar* _tmp3_;
	gchar* name;
	GVirStoragePool* _tmp4_;
	GVirStoragePool* pool;
	gint i;
	gboolean _tmp5_;
	gboolean _tmp6_;
	gint _tmp7_;
	gboolean _tmp8_;
	GVirConnection* _tmp9_;
	GVirConnection* _tmp10_;
	const gchar* _tmp11_;
	GVirDomain* _tmp12_;
	GVirDomain* _tmp13_;
	gboolean _tmp14_;
	const gchar* _tmp15_;
	GVirStorageVol* _tmp16_;
	GVirStorageVol* _tmp17_;
	gboolean _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gint _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	GError * _inner_error_;
};

struct _BoxesVmCreatorCreateTargetVolumeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesVMCreator* self;
	gchar* name;
	gint64 storage;
	GVirStorageVol* result;
	GVirStoragePool* _tmp0_;
	GVirStoragePool* pool;
	BoxesVMConfigurator* _tmp1_;
	const gchar* _tmp2_;
	gint64 _tmp3_;
	GVirConfigStorageVol* _tmp4_;
	GVirConfigStorageVol* config;
	GVirStoragePool* _tmp5_;
	GVirConfigStorageVol* _tmp6_;
	GVirStorageVol* _tmp7_;
	GVirStorageVol* volume;
	GError * _inner_error_;
};

struct _BoxesVmCreatorGetStoragePoolData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesVMCreator* self;
	GVirStoragePool* result;
	GVirConnection* _tmp0_;
	GVirConnection* _tmp1_;
	GVirStoragePool* _tmp2_;
	GVirStoragePool* pool;
	GVirStoragePool* _tmp3_;
	BoxesVMConfigurator* _tmp4_;
	GVirConfigStoragePool* _tmp5_;
	GVirConfigStoragePool* config;
	GVirConnection* _tmp6_;
	GVirConnection* _tmp7_;
	GVirConfigStoragePool* _tmp8_;
	GVirStoragePool* _tmp9_;
	GVirStoragePool* _tmp10_;
	GVirStoragePool* _tmp11_;
	GVirStoragePool* _tmp12_;
	GVirStoragePool* _tmp13_;
	GError * _inner_error_;
};

struct _BoxesParamSpecVMCreator {
	GParamSpec parent_instance;
};


static gpointer boxes_vm_creator_parent_class = NULL;

gpointer boxes_vm_creator_ref (gpointer instance);
void boxes_vm_creator_unref (gpointer instance);
GParamSpec* boxes_param_spec_vm_creator (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void boxes_value_set_vm_creator (GValue* value, gpointer v_object);
void boxes_value_take_vm_creator (GValue* value, gpointer v_object);
gpointer boxes_value_get_vm_creator (const GValue* value);
GType boxes_vm_creator_get_type (void) G_GNUC_CONST;
GType boxes_ui_get_type (void) G_GNUC_CONST;
GType boxes_app_get_type (void) G_GNUC_CONST;
gpointer boxes_vm_configurator_ref (gpointer instance);
void boxes_vm_configurator_unref (gpointer instance);
GParamSpec* boxes_param_spec_vm_configurator (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void boxes_value_set_vm_configurator (GValue* value, gpointer v_object);
void boxes_value_take_vm_configurator (GValue* value, gpointer v_object);
gpointer boxes_value_get_vm_configurator (const GValue* value);
GType boxes_vm_configurator_get_type (void) G_GNUC_CONST;
#define BOXES_VM_CREATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_VM_CREATOR, BoxesVMCreatorPrivate))
enum  {
	BOXES_VM_CREATOR_DUMMY_PROPERTY
};
BoxesVMCreator* boxes_vm_creator_new (BoxesApp* app);
BoxesVMCreator* boxes_vm_creator_construct (GType object_type, BoxesApp* app);
BoxesVMConfigurator* boxes_vm_configurator_new (void);
BoxesVMConfigurator* boxes_vm_configurator_construct (GType object_type);
GType boxes_ui_state_get_type (void) G_GNUC_CONST;
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GType boxes_topbar_get_type (void) G_GNUC_CONST;
GType boxes_notificationbar_get_type (void) G_GNUC_CONST;
GType boxes_sidebar_get_type (void) G_GNUC_CONST;
GType boxes_selectionbar_get_type (void) G_GNUC_CONST;
GType boxes_wizard_get_type (void) G_GNUC_CONST;
GType boxes_properties_get_type (void) G_GNUC_CONST;
GType boxes_display_page_get_type (void) G_GNUC_CONST;
GType boxes_collection_get_type (void) G_GNUC_CONST;
static void boxes_vm_creator_on_item_added (BoxesVMCreator* self, BoxesCollection* collection, BoxesCollectionItem* item);
static void _boxes_vm_creator_on_item_added_boxes_collection_item_added (BoxesCollection* _sender, BoxesCollectionItem* item, gpointer self);
GType boxes_machine_get_type (void) G_GNUC_CONST;
GType boxes_libvirt_machine_get_type (void) G_GNUC_CONST;
static Block31Data* block31_data_ref (Block31Data* _data31_);
static void block31_data_unref (void * _userdata_);
GType boxes_properties_page_get_type (void) G_GNUC_CONST;
gpointer boxes_pair_ref (gpointer instance);
void boxes_pair_unref (gpointer instance);
GParamSpec* boxes_param_spec_pair (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void boxes_value_set_pair (GValue* value, gpointer v_object);
void boxes_value_take_pair (GValue* value, gpointer v_object);
gpointer boxes_value_get_pair (const GValue* value);
GType boxes_pair_get_type (void) G_GNUC_CONST;
GType boxes_iproperties_provider_get_type (void) G_GNUC_CONST;
GType boxes_machine_actor_get_type (void) G_GNUC_CONST;
GType boxes_collection_source_get_type (void) G_GNUC_CONST;
GType boxes_display_config_get_type (void) G_GNUC_CONST;
static GVirConnection* boxes_vm_creator_get_connection (BoxesVMCreator* self);
gboolean boxes_vm_configurator_is_install_config (BoxesVMConfigurator* self, GVirConfigDomain* domain);
gboolean boxes_vm_configurator_is_live_config (BoxesVMConfigurator* self, GVirConfigDomain* domain);
const gchar* boxes_collection_item_get_name (BoxesCollectionItem* self);
static void _vala_GVirDomainInfo_free (GVirDomainInfo* self);
static void boxes_vm_creator_on_domain_stopped (BoxesVMCreator* self, BoxesLibvirtMachine* machine);
static void ____lambda84_ (Block31Data* _data31_);
static void _____lambda84__gvir_domain_stopped (GVirDomain* _sender, gpointer self);
static void boxes_vm_creator_create_and_launch_vm_data_free (gpointer _data);
GType boxes_installer_media_get_type (void) G_GNUC_CONST;
void boxes_vm_creator_create_and_launch_vm (BoxesVMCreator* self, BoxesInstallerMedia* install_media, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_vm_creator_create_and_launch_vm_finish (BoxesVMCreator* self, GAsyncResult* _res_, GError** error);
static gboolean boxes_vm_creator_create_and_launch_vm_co (BoxesVmCreatorCreateAndLaunchVmData* _data_);
static Block32Data* block32_data_ref (Block32Data* _data32_);
static void block32_data_unref (void * _userdata_);
static void boxes_vm_creator_create_domain_name_from_media (BoxesVMCreator* self, BoxesInstallerMedia* install_media, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gchar* boxes_vm_creator_create_domain_name_from_media_finish (BoxesVMCreator* self, GAsyncResult* _res_, GError** error);
static void boxes_vm_creator_create_and_launch_vm_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
GType boxes_unattended_installer_get_type (void) G_GNUC_CONST;
void boxes_unattended_installer_setup (BoxesUnattendedInstaller* self, const gchar* hostname, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_unattended_installer_setup_finish (BoxesUnattendedInstaller* self, GAsyncResult* _res_, GError** error);
gboolean boxes_unattended_installer_get_express_install (BoxesUnattendedInstaller* self);
static void boxes_vm_creator_create_target_volume (BoxesVMCreator* self, const gchar* name, gint64 storage, GAsyncReadyCallback _callback_, gpointer _user_data_);
static GVirStorageVol* boxes_vm_creator_create_target_volume_finish (BoxesVMCreator* self, GAsyncResult* _res_, GError** error);
GVirConfigDomain* boxes_vm_configurator_create_domain_config (BoxesVMConfigurator* self, BoxesInstallerMedia* install_media, const gchar* name, const gchar* target_path);
BoxesLibvirtMachine* boxes_app_add_domain (BoxesApp* self, BoxesCollectionSource* source, GVirConnection* connection, GVirDomain* domain);
BoxesCollectionSource* boxes_app_get_default_source (BoxesApp* self);
GVirConnection* boxes_app_get_default_connection (BoxesApp* self);
static Block33Data* block33_data_ref (Block33Data* _data33_);
static void block33_data_unref (void * _userdata_);
static void ___lambda85_ (Block33Data* _data33_);
BoxesUIState boxes_ui_get_ui_state (BoxesUI* self);
gboolean boxes_app_select_item (BoxesApp* self, BoxesCollectionItem* item);
void boxes_app_set_fullscreen (BoxesApp* self, gboolean value);
static void ____lambda85__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
GVirStorageVol* boxes_get_storage_volume (GVirConnection* connection, GVirDomain* domain, GVirStoragePool** pool);
static gboolean boxes_vm_creator_guest_installed_os (BoxesVMCreator* self, GVirStorageVol* volume);
static void boxes_vm_creator_post_install_setup (BoxesVMCreator* self, GVirDomain* domain);
void boxes_vm_configurator_post_install_setup (BoxesVMConfigurator* self, GVirConfigDomain* domain);
static void _vala_GVirStorageVolInfo_free (GVirStorageVolInfo* self);
static void boxes_vm_creator_create_domain_name_from_media_data_free (gpointer _data);
static gboolean boxes_vm_creator_create_domain_name_from_media_co (BoxesVmCreatorCreateDomainNameFromMediaData* _data_);
static void boxes_vm_creator_get_storage_pool (BoxesVMCreator* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static GVirStoragePool* boxes_vm_creator_get_storage_pool_finish (BoxesVMCreator* self, GAsyncResult* _res_, GError** error);
static void boxes_vm_creator_create_domain_name_from_media_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_vm_creator_create_target_volume_data_free (gpointer _data);
static gboolean boxes_vm_creator_create_target_volume_co (BoxesVmCreatorCreateTargetVolumeData* _data_);
static void boxes_vm_creator_create_target_volume_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
GVirConfigStorageVol* boxes_vm_configurator_create_volume_config (BoxesVMConfigurator* self, const gchar* name, gint64 storage, GError** error);
static void boxes_vm_creator_get_storage_pool_data_free (gpointer _data);
static gboolean boxes_vm_creator_get_storage_pool_co (BoxesVmCreatorGetStoragePoolData* _data_);
GVirConfigStoragePool* boxes_vm_configurator_get_pool_config (BoxesVMConfigurator* self, GError** error);
static void boxes_vm_creator_get_storage_pool_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_vm_creator_finalize (BoxesVMCreator* obj);


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


static void _boxes_vm_creator_on_item_added_boxes_collection_item_added (BoxesCollection* _sender, BoxesCollectionItem* item, gpointer self) {
	boxes_vm_creator_on_item_added (self, _sender, item);
}


BoxesVMCreator* boxes_vm_creator_construct (GType object_type, BoxesApp* app) {
	BoxesVMCreator* self = NULL;
	BoxesVMConfigurator* _tmp0_;
	BoxesApp* _tmp1_;
	BoxesApp* _tmp2_;
	BoxesApp* _tmp3_;
	BoxesCollection* _tmp4_;
	g_return_val_if_fail (app != NULL, NULL);
	self = (BoxesVMCreator*) g_type_create_instance (object_type);
	_tmp0_ = boxes_vm_configurator_new ();
	_boxes_vm_configurator_unref0 (self->priv->configurator);
	self->priv->configurator = _tmp0_;
	_tmp1_ = app;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (self->priv->app);
	self->priv->app = _tmp2_;
	_tmp3_ = app;
	_tmp4_ = _tmp3_->collection;
	g_signal_connect (_tmp4_, "item-added", (GCallback) _boxes_vm_creator_on_item_added_boxes_collection_item_added, self);
	return self;
}


BoxesVMCreator* boxes_vm_creator_new (BoxesApp* app) {
	return boxes_vm_creator_construct (BOXES_TYPE_VM_CREATOR, app);
}


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_)) {
		BoxesVMCreator * self;
		self = _data31_->self;
		_g_object_unref0 (_data31_->machine);
		_boxes_vm_creator_unref0 (self);
		g_slice_free (Block31Data, _data31_);
	}
}


static void _vala_GVirDomainInfo_free (GVirDomainInfo* self) {
	g_boxed_free (gvir_domain_info_get_type (), self);
}


static void ____lambda84_ (Block31Data* _data31_) {
	BoxesVMCreator * self;
	BoxesLibvirtMachine* _tmp0_;
	self = _data31_->self;
	_tmp0_ = _data31_->machine;
	boxes_vm_creator_on_domain_stopped (self, _tmp0_);
}


static void _____lambda84__gvir_domain_stopped (GVirDomain* _sender, gpointer self) {
	____lambda84_ (self);
}


static void boxes_vm_creator_on_item_added (BoxesVMCreator* self, BoxesCollection* collection, BoxesCollectionItem* item) {
	Block31Data* _data31_;
	BoxesCollectionItem* _tmp0_;
	BoxesCollectionItem* _tmp1_;
	BoxesLibvirtMachine* _tmp2_;
	BoxesLibvirtMachine* _tmp3_;
	GVirConnection* _tmp4_;
	GVirConnection* _tmp5_;
	GVirConnection* _tmp6_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (collection != NULL);
	g_return_if_fail (item != NULL);
	_data31_ = g_slice_new0 (Block31Data);
	_data31_->_ref_count_ = 1;
	_data31_->self = boxes_vm_creator_ref (self);
	_tmp0_ = item;
	if (!BOXES_IS_LIBVIRT_MACHINE (_tmp0_)) {
		block31_data_unref (_data31_);
		_data31_ = NULL;
		return;
	}
	_tmp1_ = item;
	_tmp2_ = _g_object_ref0 (BOXES_IS_LIBVIRT_MACHINE (_tmp1_) ? ((BoxesLibvirtMachine*) _tmp1_) : NULL);
	_data31_->machine = _tmp2_;
	_tmp3_ = _data31_->machine;
	_tmp4_ = _tmp3_->connection;
	_tmp5_ = boxes_vm_creator_get_connection (self);
	_tmp6_ = _tmp5_;
	if (_tmp4_ != _tmp6_) {
		block31_data_unref (_data31_);
		_data31_ = NULL;
		return;
	}
	{
		BoxesLibvirtMachine* _tmp7_;
		GVirDomain* _tmp8_;
		GVirConfigDomain* _tmp9_ = NULL;
		GVirConfigDomain* config;
		gboolean _tmp10_ = FALSE;
		BoxesVMConfigurator* _tmp11_;
		GVirConfigDomain* _tmp12_;
		gboolean _tmp13_ = FALSE;
		gboolean _tmp17_;
		BoxesLibvirtMachine* _tmp21_;
		GVirDomain* _tmp22_;
		GVirDomainInfo* _tmp23_ = NULL;
		GVirDomainInfo* _tmp24_;
		GVirDomainInfo* _tmp25_;
		GVirDomainState _tmp26_;
		GVirDomainState _tmp27_;
		GVirDomainState state;
		gboolean _tmp28_ = FALSE;
		gboolean _tmp29_ = FALSE;
		GVirDomainState _tmp30_;
		gboolean _tmp32_;
		gboolean _tmp34_;
		_tmp7_ = _data31_->machine;
		_tmp8_ = _tmp7_->domain;
		_tmp9_ = gvir_domain_get_config (_tmp8_, (guint) 0, &_inner_error_);
		config = _tmp9_;
		if (_inner_error_ != NULL) {
			goto __catch61_g_error;
		}
		_tmp11_ = self->priv->configurator;
		_tmp12_ = config;
		_tmp13_ = boxes_vm_configurator_is_install_config (_tmp11_, _tmp12_);
		if (!_tmp13_) {
			BoxesVMConfigurator* _tmp14_;
			GVirConfigDomain* _tmp15_;
			gboolean _tmp16_ = FALSE;
			_tmp14_ = self->priv->configurator;
			_tmp15_ = config;
			_tmp16_ = boxes_vm_configurator_is_live_config (_tmp14_, _tmp15_);
			_tmp10_ = !_tmp16_;
		} else {
			_tmp10_ = FALSE;
		}
		_tmp17_ = _tmp10_;
		if (_tmp17_) {
			BoxesLibvirtMachine* _tmp18_;
			const gchar* _tmp19_;
			const gchar* _tmp20_;
			_tmp18_ = _data31_->machine;
			_tmp19_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _tmp18_);
			_tmp20_ = _tmp19_;
			g_debug ("vm-creator.vala:30: '%s' does not need post-installation setup", _tmp20_);
			_g_object_unref0 (config);
			block31_data_unref (_data31_);
			_data31_ = NULL;
			return;
		}
		_tmp21_ = _data31_->machine;
		_tmp22_ = _tmp21_->domain;
		_tmp23_ = gvir_domain_get_info (_tmp22_, &_inner_error_);
		_tmp24_ = _tmp23_;
		if (_inner_error_ != NULL) {
			_g_object_unref0 (config);
			goto __catch61_g_error;
		}
		_tmp25_ = _tmp24_;
		_tmp26_ = _tmp25_->state;
		_tmp27_ = _tmp26_;
		__vala_GVirDomainInfo_free0 (_tmp25_);
		state = _tmp27_;
		_tmp30_ = state;
		if (_tmp30_ == GVIR_DOMAIN_STATE_SHUTOFF) {
			_tmp29_ = TRUE;
		} else {
			GVirDomainState _tmp31_;
			_tmp31_ = state;
			_tmp29_ = _tmp31_ == GVIR_DOMAIN_STATE_CRASHED;
		}
		_tmp32_ = _tmp29_;
		if (_tmp32_) {
			_tmp28_ = TRUE;
		} else {
			GVirDomainState _tmp33_;
			_tmp33_ = state;
			_tmp28_ = _tmp33_ == GVIR_DOMAIN_STATE_NONE;
		}
		_tmp34_ = _tmp28_;
		if (_tmp34_) {
			BoxesLibvirtMachine* _tmp35_;
			_tmp35_ = _data31_->machine;
			boxes_vm_creator_on_domain_stopped (self, _tmp35_);
		} else {
			BoxesLibvirtMachine* _tmp36_;
			GVirDomain* _tmp37_;
			gulong _tmp38_ = 0UL;
			_tmp36_ = _data31_->machine;
			_tmp37_ = _tmp36_->domain;
			_tmp38_ = g_signal_connect_data (_tmp37_, "stopped", (GCallback) _____lambda84__gvir_domain_stopped, block31_data_ref (_data31_), (GClosureNotify) block31_data_unref, 0);
			self->priv->stopped_id = _tmp38_;
		}
		_g_object_unref0 (config);
	}
	goto __finally61;
	__catch61_g_error:
	{
		GError* _error_ = NULL;
		BoxesLibvirtMachine* _tmp39_;
		GVirDomain* _tmp40_;
		const gchar* _tmp41_ = NULL;
		GError* _tmp42_;
		const gchar* _tmp43_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp39_ = _data31_->machine;
		_tmp40_ = _tmp39_->domain;
		_tmp41_ = gvir_domain_get_name (_tmp40_);
		_tmp42_ = _error_;
		_tmp43_ = _tmp42_->message;
		g_warning ("vm-creator.vala:41: Failed to get information on domain '%s': %s", _tmp41_, _tmp43_);
		_g_error_free0 (_error_);
	}
	__finally61:
	if (_inner_error_ != NULL) {
		block31_data_unref (_data31_);
		_data31_ = NULL;
		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);
		g_clear_error (&_inner_error_);
		return;
	}
	block31_data_unref (_data31_);
	_data31_ = NULL;
}


static void boxes_vm_creator_create_and_launch_vm_data_free (gpointer _data) {
	BoxesVmCreatorCreateAndLaunchVmData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->install_media);
	_g_object_unref0 (_data_->cancellable);
	_boxes_vm_creator_unref0 (_data_->self);
	g_slice_free (BoxesVmCreatorCreateAndLaunchVmData, _data_);
}


static gpointer _boxes_vm_creator_ref0 (gpointer self) {
	return self ? boxes_vm_creator_ref (self) : NULL;
}


void boxes_vm_creator_create_and_launch_vm (BoxesVMCreator* self, BoxesInstallerMedia* install_media, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesVmCreatorCreateAndLaunchVmData* _data_;
	BoxesVMCreator* _tmp0_;
	BoxesInstallerMedia* _tmp1_;
	BoxesInstallerMedia* _tmp2_;
	GCancellable* _tmp3_;
	GCancellable* _tmp4_;
	_data_ = g_slice_new0 (BoxesVmCreatorCreateAndLaunchVmData);
	_data_->_async_result = g_simple_async_result_new (g_object_newv (G_TYPE_OBJECT, 0, NULL), _callback_, _user_data_, boxes_vm_creator_create_and_launch_vm);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_vm_creator_create_and_launch_vm_data_free);
	_tmp0_ = _boxes_vm_creator_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = install_media;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->install_media = _tmp2_;
	_tmp3_ = cancellable;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->cancellable = _tmp4_;
	boxes_vm_creator_create_and_launch_vm_co (_data_);
}


void boxes_vm_creator_create_and_launch_vm_finish (BoxesVMCreator* self, GAsyncResult* _res_, GError** error) {
	BoxesVmCreatorCreateAndLaunchVmData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


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_)) {
		BoxesVMCreator * self;
		self = _data32_->self;
		_g_object_unref0 (_data32_->machine);
		_boxes_vm_creator_unref0 (self);
		g_slice_free (Block32Data, _data32_);
	}
}


static void boxes_vm_creator_create_and_launch_vm_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesVmCreatorCreateAndLaunchVmData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_vm_creator_create_and_launch_vm_co (_data_);
}


static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	{
		const gchar* _tmp0_;
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_;
		GRegex* _tmp3_;
		GRegex* _tmp4_;
		GRegex* regex;
		GRegex* _tmp5_;
		const gchar* _tmp6_;
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_;
		_tmp0_ = old;
		_tmp1_ = g_regex_escape_string (_tmp0_, -1);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp2_);
		regex = _tmp4_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch62_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_tmp5_ = regex;
		_tmp6_ = replacement;
		_tmp7_ = g_regex_replace_literal (_tmp5_, self, (gssize) (-1), 0, _tmp6_, 0, &_inner_error_);
		_tmp8_ = _tmp7_;
		if (_inner_error_ != NULL) {
			_g_regex_unref0 (regex);
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch62_g_regex_error;
			}
			_g_regex_unref0 (regex);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		result = _tmp8_;
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally62;
	__catch62_g_regex_error:
	{
		GError* e = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	__finally62:
	if (_inner_error_ != NULL) {
		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);
		g_clear_error (&_inner_error_);
		return NULL;
	}
}


static Block33Data* block33_data_ref (Block33Data* _data33_) {
	g_atomic_int_inc (&_data33_->_ref_count_);
	return _data33_;
}


static void block33_data_unref (void * _userdata_) {
	Block33Data* _data33_;
	_data33_ = (Block33Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
		BoxesVMCreator * self;
		self = _data33_->_data32_->self;
		block32_data_unref (_data33_->_data32_);
		_data33_->_data32_ = NULL;
		g_slice_free (Block33Data, _data33_);
	}
}


static void ___lambda85_ (Block33Data* _data33_) {
	Block32Data* _data32_;
	BoxesVMCreator * self;
	BoxesApp* _tmp0_;
	BoxesUIState _tmp1_;
	BoxesUIState _tmp2_;
	BoxesApp* _tmp3_;
	BoxesLibvirtMachine* _tmp4_;
	BoxesApp* _tmp5_;
	BoxesApp* _tmp6_;
	gulong _tmp7_;
	_data32_ = _data33_->_data32_;
	self = _data32_->self;
	_tmp0_ = self->priv->app;
	_tmp1_ = boxes_ui_get_ui_state ((BoxesUI*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != BOXES_UI_STATE_COLLECTION) {
		return;
	}
	_tmp3_ = self->priv->app;
	_tmp4_ = _data32_->machine;
	boxes_app_select_item (_tmp3_, (BoxesCollectionItem*) _tmp4_);
	_tmp5_ = self->priv->app;
	boxes_app_set_fullscreen (_tmp5_, TRUE);
	_tmp6_ = self->priv->app;
	_tmp7_ = _data33_->signal_id;
	g_signal_handler_disconnect ((GObject*) _tmp6_, _tmp7_);
	return;
}


static void ____lambda85__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	___lambda85_ (self);
}


static gboolean boxes_vm_creator_create_and_launch_vm_co (BoxesVmCreatorCreateAndLaunchVmData* _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_->_data32_ = g_slice_new0 (Block32Data);
	_data_->_data32_->_ref_count_ = 1;
	_data_->_data32_->self = boxes_vm_creator_ref (_data_->self);
	_data_->_data32_->_async_data_ = _data_;
	_data_->_tmp0_ = _data_->install_media;
	_data_->_state_ = 1;
	boxes_vm_creator_create_domain_name_from_media (_data_->self, _data_->_tmp0_, boxes_vm_creator_create_and_launch_vm_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = boxes_vm_creator_create_domain_name_from_media_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	_data_->name = _data_->_tmp1_;
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		block32_data_unref (_data_->_data32_);
		_data_->_data32_ = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->fullscreen = TRUE;
	_data_->_tmp2_ = _data_->install_media;
	if (BOXES_IS_UNATTENDED_INSTALLER (_data_->_tmp2_)) {
		_data_->_tmp3_ = _data_->install_media;
		_data_->_tmp4_ = _g_object_ref0 (BOXES_IS_UNATTENDED_INSTALLER (_data_->_tmp3_) ? ((BoxesUnattendedInstaller*) _data_->_tmp3_) : NULL);
		_data_->unattended = _data_->_tmp4_;
		_data_->_tmp5_ = _data_->name;
		_data_->_tmp6_ = NULL;
		_data_->_tmp6_ = string_replace (_data_->_tmp5_, " ", "-");
		_data_->hostname = _data_->_tmp6_;
		_data_->_tmp7_ = _data_->unattended;
		_data_->_tmp8_ = _data_->hostname;
		_data_->_tmp9_ = _data_->cancellable;
		_data_->_state_ = 2;
		boxes_unattended_installer_setup (_data_->_tmp7_, _data_->_tmp8_, _data_->_tmp9_, boxes_vm_creator_create_and_launch_vm_ready, _data_);
		return FALSE;
		_state_2:
		boxes_unattended_installer_setup_finish (_data_->_tmp7_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_free0 (_data_->hostname);
			_g_object_unref0 (_data_->unattended);
			_g_free0 (_data_->name);
			block32_data_unref (_data_->_data32_);
			_data_->_data32_ = NULL;
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp10_ = _data_->unattended;
		_data_->_tmp11_ = boxes_unattended_installer_get_express_install (_data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->fullscreen = !_data_->_tmp12_;
		_g_free0 (_data_->hostname);
		_g_object_unref0 (_data_->unattended);
	}
	_data_->_tmp13_ = _data_->name;
	_data_->_tmp14_ = _data_->install_media;
	_data_->_tmp15_ = _data_->_tmp14_->resources;
	_data_->_tmp16_ = osinfo_resources_get_storage (_data_->_tmp15_);
	_data_->_tmp17_ = _data_->_tmp16_;
	_data_->_state_ = 3;
	boxes_vm_creator_create_target_volume (_data_->self, _data_->_tmp13_, _data_->_tmp17_, boxes_vm_creator_create_and_launch_vm_ready, _data_);
	return FALSE;
	_state_3:
	_data_->_tmp18_ = NULL;
	_data_->_tmp18_ = boxes_vm_creator_create_target_volume_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	_data_->volume = _data_->_tmp18_;
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		_g_free0 (_data_->name);
		block32_data_unref (_data_->_data32_);
		_data_->_data32_ = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp19_ = _data_->volume;
	_data_->_tmp20_ = NULL;
	_data_->_tmp20_ = gvir_storage_vol_get_path (_data_->_tmp19_, &_data_->_inner_error_);
	_data_->_tmp21_ = _data_->_tmp20_;
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		_g_object_unref0 (_data_->volume);
		_g_free0 (_data_->name);
		block32_data_unref (_data_->_data32_);
		_data_->_data32_ = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp22_ = _data_->self->priv->configurator;
	_data_->_tmp23_ = _data_->install_media;
	_data_->_tmp24_ = _data_->name;
	_data_->_tmp25_ = NULL;
	_data_->_tmp25_ = boxes_vm_configurator_create_domain_config (_data_->_tmp22_, _data_->_tmp23_, _data_->_tmp24_, _data_->_tmp21_);
	_data_->config = _data_->_tmp25_;
	_data_->_tmp26_ = boxes_vm_creator_get_connection (_data_->self);
	_data_->_tmp27_ = _data_->_tmp26_;
	_data_->_tmp28_ = _data_->config;
	_data_->_tmp29_ = NULL;
	_data_->_tmp29_ = gvir_connection_create_domain (_data_->_tmp27_, _data_->_tmp28_, &_data_->_inner_error_);
	_data_->domain = _data_->_tmp29_;
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		_g_object_unref0 (_data_->config);
		_g_object_unref0 (_data_->volume);
		_g_free0 (_data_->name);
		block32_data_unref (_data_->_data32_);
		_data_->_data32_ = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp30_ = _data_->domain;
	gvir_domain_start (_data_->_tmp30_, (guint) 0, &_data_->_inner_error_);
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		_g_object_unref0 (_data_->domain);
		_g_object_unref0 (_data_->config);
		_g_object_unref0 (_data_->volume);
		_g_free0 (_data_->name);
		block32_data_unref (_data_->_data32_);
		_data_->_data32_ = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp31_ = _data_->self->priv->app;
	_data_->_tmp32_ = _data_->self->priv->app;
	_data_->_tmp33_ = boxes_app_get_default_source (_data_->_tmp32_);
	_data_->_tmp34_ = _data_->_tmp33_;
	_data_->_tmp35_ = _data_->self->priv->app;
	_data_->_tmp36_ = boxes_app_get_default_connection (_data_->_tmp35_);
	_data_->_tmp37_ = _data_->_tmp36_;
	_data_->_tmp38_ = _data_->domain;
	_data_->_tmp39_ = NULL;
	_data_->_tmp39_ = boxes_app_add_domain (_data_->_tmp31_, _data_->_tmp34_, _data_->_tmp37_, _data_->_tmp38_);
	_data_->_data32_->machine = _data_->_tmp39_;
	_data_->_tmp41_ = _data_->_data32_->machine;
	if (_data_->_tmp41_ != NULL) {
		_data_->_tmp42_ = _data_->fullscreen;
		_data_->_tmp40_ = _data_->_tmp42_;
	} else {
		_data_->_tmp40_ = FALSE;
	}
	_data_->_tmp43_ = _data_->_tmp40_;
	if (_data_->_tmp43_) {
		_data_->_data33_ = g_slice_new0 (Block33Data);
		_data_->_data33_->_ref_count_ = 1;
		_data_->_data33_->_data32_ = block32_data_ref (_data_->_data32_);
		_data_->_data33_->signal_id = (gulong) 0;
		_data_->_tmp44_ = _data_->self->priv->app;
		_data_->_tmp45_ = 0UL;
		_data_->_tmp45_ = g_signal_connect_data ((GObject*) _data_->_tmp44_, "notify::ui-state", (GCallback) ____lambda85__g_object_notify, block33_data_ref (_data_->_data33_), (GClosureNotify) block33_data_unref, 0);
		_data_->_data33_->signal_id = _data_->_tmp45_;
		block33_data_unref (_data_->_data33_);
		_data_->_data33_ = NULL;
	}
	_g_object_unref0 (_data_->domain);
	_g_object_unref0 (_data_->config);
	_g_object_unref0 (_data_->volume);
	_g_free0 (_data_->name);
	block32_data_unref (_data_->_data32_);
	_data_->_data32_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void boxes_vm_creator_on_domain_stopped (BoxesVMCreator* self, BoxesLibvirtMachine* machine) {
	BoxesLibvirtMachine* _tmp0_;
	GVirDomain* _tmp1_;
	GVirDomain* _tmp2_;
	GVirDomain* domain;
	BoxesLibvirtMachine* _tmp3_;
	gboolean _tmp4_;
	GVirDomain* _tmp8_;
	gboolean _tmp9_ = FALSE;
	GVirConnection* _tmp13_;
	GVirConnection* _tmp14_;
	GVirDomain* _tmp15_;
	GVirStorageVol* _tmp16_ = NULL;
	GVirStorageVol* volume;
	GVirStorageVol* _tmp17_;
	gboolean _tmp18_ = FALSE;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (machine != NULL);
	_tmp0_ = machine;
	_tmp1_ = _tmp0_->domain;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	domain = _tmp2_;
	_tmp3_ = machine;
	_tmp4_ = ((BoxesMachine*) _tmp3_)->deleted;
	if (_tmp4_) {
		BoxesLibvirtMachine* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		_tmp5_ = machine;
		_tmp6_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _tmp5_);
		_tmp7_ = _tmp6_;
		g_debug ("vm-creator.vala:84: '%s' was deleted, no need for post-installation se" \
"tup on it", _tmp7_);
		_g_object_unref0 (domain);
		return;
	}
	_tmp8_ = domain;
	_tmp9_ = gvir_domain_get_saved (_tmp8_);
	if (_tmp9_) {
		BoxesLibvirtMachine* _tmp10_;
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		_tmp10_ = machine;
		_tmp11_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _tmp10_);
		_tmp12_ = _tmp11_;
		g_debug ("vm-creator.vala:89: '%s' has saved state, no need for post-installatio" \
"n setup on it", _tmp12_);
		_g_object_unref0 (domain);
		return;
	}
	_tmp13_ = boxes_vm_creator_get_connection (self);
	_tmp14_ = _tmp13_;
	_tmp15_ = domain;
	_tmp16_ = boxes_get_storage_volume (_tmp14_, _tmp15_, NULL);
	volume = _tmp16_;
	_tmp17_ = volume;
	_tmp18_ = boxes_vm_creator_guest_installed_os (self, _tmp17_);
	if (_tmp18_) {
		GVirDomain* _tmp19_;
		GVirDomain* _tmp20_;
		gulong _tmp21_;
		_tmp19_ = domain;
		boxes_vm_creator_post_install_setup (self, _tmp19_);
		_tmp20_ = domain;
		_tmp21_ = self->priv->stopped_id;
		g_signal_handler_disconnect ((GObject*) _tmp20_, _tmp21_);
	} else {
		{
			GVirDomain* _tmp22_;
			GVirConfigDomain* _tmp23_ = NULL;
			GVirConfigDomain* config;
			BoxesVMConfigurator* _tmp24_;
			GVirConfigDomain* _tmp25_;
			gboolean _tmp26_ = FALSE;
			GVirDomain* _tmp27_;
			gulong _tmp28_;
			GVirDomain* _tmp29_;
			GVirStorageVol* _tmp30_;
			_tmp22_ = domain;
			_tmp23_ = gvir_domain_get_config (_tmp22_, (guint) 0, &_inner_error_);
			config = _tmp23_;
			if (_inner_error_ != NULL) {
				goto __catch63_g_error;
			}
			_tmp24_ = self->priv->configurator;
			_tmp25_ = config;
			_tmp26_ = boxes_vm_configurator_is_live_config (_tmp24_, _tmp25_);
			if (!_tmp26_) {
				_g_object_unref0 (config);
				_g_object_unref0 (volume);
				_g_object_unref0 (domain);
				return;
			}
			_tmp27_ = domain;
			_tmp28_ = self->priv->stopped_id;
			g_signal_handler_disconnect ((GObject*) _tmp27_, _tmp28_);
			_tmp29_ = domain;
			gvir_domain_delete (_tmp29_, (guint) 0, &_inner_error_);
			if (_inner_error_ != NULL) {
				_g_object_unref0 (config);
				goto __catch63_g_error;
			}
			_tmp30_ = volume;
			gvir_storage_vol_delete (_tmp30_, (guint) 0, &_inner_error_);
			if (_inner_error_ != NULL) {
				_g_object_unref0 (config);
				goto __catch63_g_error;
			}
			_g_object_unref0 (config);
		}
		goto __finally63;
		__catch63_g_error:
		{
			GError* _error_ = NULL;
			GVirDomain* _tmp31_;
			const gchar* _tmp32_ = NULL;
			GError* _tmp33_;
			const gchar* _tmp34_;
			_error_ = _inner_error_;
			_inner_error_ = NULL;
			_tmp31_ = domain;
			_tmp32_ = gvir_domain_get_name (_tmp31_);
			_tmp33_ = _error_;
			_tmp34_ = _tmp33_->message;
			g_warning ("vm-creator.vala:112: Failed to delete domain '%s' or its volume: %s", _tmp32_, _tmp34_);
			_g_error_free0 (_error_);
		}
		__finally63:
		if (_inner_error_ != NULL) {
			_g_object_unref0 (volume);
			_g_object_unref0 (domain);
			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);
			g_clear_error (&_inner_error_);
			return;
		}
	}
	_g_object_unref0 (volume);
	_g_object_unref0 (domain);
}


static void boxes_vm_creator_post_install_setup (BoxesVMCreator* self, GVirDomain* domain) {
	GVirDomain* _tmp0_;
	const gchar* _tmp1_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (domain != NULL);
	_tmp0_ = domain;
	_tmp1_ = gvir_domain_get_name (_tmp0_);
	g_debug ("vm-creator.vala:118: Performing post-installation setup on '%s'", _tmp1_);
	{
		GVirDomain* _tmp2_;
		GVirConfigDomain* _tmp3_ = NULL;
		GVirConfigDomain* config;
		BoxesVMConfigurator* _tmp4_;
		GVirConfigDomain* _tmp5_;
		GVirDomain* _tmp6_;
		GVirConfigDomain* _tmp7_;
		GVirDomain* _tmp8_;
		_tmp2_ = domain;
		_tmp3_ = gvir_domain_get_config (_tmp2_, (guint) 0, &_inner_error_);
		config = _tmp3_;
		if (_inner_error_ != NULL) {
			goto __catch64_g_error;
		}
		_tmp4_ = self->priv->configurator;
		_tmp5_ = config;
		boxes_vm_configurator_post_install_setup (_tmp4_, _tmp5_);
		_tmp6_ = domain;
		_tmp7_ = config;
		gvir_domain_set_config (_tmp6_, _tmp7_, &_inner_error_);
		if (_inner_error_ != NULL) {
			_g_object_unref0 (config);
			goto __catch64_g_error;
		}
		_tmp8_ = domain;
		gvir_domain_start (_tmp8_, (guint) 0, &_inner_error_);
		if (_inner_error_ != NULL) {
			_g_object_unref0 (config);
			goto __catch64_g_error;
		}
		_g_object_unref0 (config);
	}
	goto __finally64;
	__catch64_g_error:
	{
		GError* _error_ = NULL;
		GVirDomain* _tmp9_;
		const gchar* _tmp10_ = NULL;
		GError* _tmp11_;
		const gchar* _tmp12_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp9_ = domain;
		_tmp10_ = gvir_domain_get_uuid (_tmp9_);
		_tmp11_ = _error_;
		_tmp12_ = _tmp11_->message;
		g_warning ("vm-creator.vala:126: Post-install setup failed for domain '%s': %s", _tmp10_, _tmp12_);
		_g_error_free0 (_error_);
	}
	__finally64:
	if (_inner_error_ != NULL) {
		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);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void _vala_GVirStorageVolInfo_free (GVirStorageVolInfo* self) {
	g_boxed_free (gvir_storage_vol_info_get_type (), self);
}


static gboolean boxes_vm_creator_guest_installed_os (BoxesVMCreator* self, GVirStorageVol* volume) {
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (volume != NULL, FALSE);
	{
		GVirStorageVol* _tmp0_;
		GVirStorageVolInfo* _tmp1_ = NULL;
		GVirStorageVolInfo* info;
		guint64 _tmp2_;
		_tmp0_ = volume;
		_tmp1_ = gvir_storage_vol_get_info (_tmp0_, &_inner_error_);
		info = _tmp1_;
		if (_inner_error_ != NULL) {
			goto __catch65_g_error;
		}
		_tmp2_ = info->allocation;
		result = _tmp2_ >= ((guint64) OSINFO_MEBIBYTES);
		__vala_GVirStorageVolInfo_free0 (info);
		return result;
	}
	goto __finally65;
	__catch65_g_error:
	{
		GError* _error_ = NULL;
		GVirStorageVol* _tmp3_;
		const gchar* _tmp4_ = NULL;
		GError* _tmp5_;
		const gchar* _tmp6_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = volume;
		_tmp4_ = gvir_storage_vol_get_name (_tmp3_);
		_tmp5_ = _error_;
		_tmp6_ = _tmp5_->message;
		g_warning ("vm-creator.vala:137: Failed to get information from volume '%s': %s", _tmp4_, _tmp6_);
		result = FALSE;
		_g_error_free0 (_error_);
		return result;
	}
	__finally65:
	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);
	g_clear_error (&_inner_error_);
	return FALSE;
}


static void boxes_vm_creator_create_domain_name_from_media_data_free (gpointer _data) {
	BoxesVmCreatorCreateDomainNameFromMediaData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->install_media);
	_g_free0 (_data_->result);
	_boxes_vm_creator_unref0 (_data_->self);
	g_slice_free (BoxesVmCreatorCreateDomainNameFromMediaData, _data_);
}


static void boxes_vm_creator_create_domain_name_from_media (BoxesVMCreator* self, BoxesInstallerMedia* install_media, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesVmCreatorCreateDomainNameFromMediaData* _data_;
	BoxesVMCreator* _tmp0_;
	BoxesInstallerMedia* _tmp1_;
	BoxesInstallerMedia* _tmp2_;
	_data_ = g_slice_new0 (BoxesVmCreatorCreateDomainNameFromMediaData);
	_data_->_async_result = g_simple_async_result_new (g_object_newv (G_TYPE_OBJECT, 0, NULL), _callback_, _user_data_, boxes_vm_creator_create_domain_name_from_media);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_vm_creator_create_domain_name_from_media_data_free);
	_tmp0_ = _boxes_vm_creator_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = install_media;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->install_media = _tmp2_;
	boxes_vm_creator_create_domain_name_from_media_co (_data_);
}


static gchar* boxes_vm_creator_create_domain_name_from_media_finish (BoxesVMCreator* self, GAsyncResult* _res_, GError** error) {
	gchar* result;
	BoxesVmCreatorCreateDomainNameFromMediaData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void boxes_vm_creator_create_domain_name_from_media_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesVmCreatorCreateDomainNameFromMediaData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_vm_creator_create_domain_name_from_media_co (_data_);
}


static gboolean boxes_vm_creator_create_domain_name_from_media_co (BoxesVmCreatorCreateDomainNameFromMediaData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->install_media;
	_data_->_tmp1_ = _data_->_tmp0_->label;
	_data_->_tmp2_ = g_strdup (_data_->_tmp1_);
	_data_->base_name = _data_->_tmp2_;
	_data_->_tmp3_ = g_strdup (_data_->base_name);
	_data_->name = _data_->_tmp3_;
	_data_->_state_ = 1;
	boxes_vm_creator_get_storage_pool (_data_->self, boxes_vm_creator_create_domain_name_from_media_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = boxes_vm_creator_get_storage_pool_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	_data_->pool = _data_->_tmp4_;
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		_g_free0 (_data_->name);
		_g_free0 (_data_->base_name);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->i = 2;
		{
			_data_->_tmp5_ = TRUE;
			while (TRUE) {
				_data_->_tmp6_ = _data_->_tmp5_;
				if (!_data_->_tmp6_) {
					_data_->_tmp7_ = _data_->i;
					_data_->i = _data_->_tmp7_ + 1;
				}
				_data_->_tmp5_ = FALSE;
				_data_->_tmp9_ = boxes_vm_creator_get_connection (_data_->self);
				_data_->_tmp10_ = _data_->_tmp9_;
				_data_->_tmp11_ = _data_->name;
				_data_->_tmp12_ = NULL;
				_data_->_tmp12_ = gvir_connection_find_domain_by_name (_data_->_tmp10_, _data_->_tmp11_);
				_data_->_tmp13_ = _data_->_tmp12_;
				_data_->_tmp14_ = _data_->_tmp13_ != NULL;
				_g_object_unref0 (_data_->_tmp13_);
				if (_data_->_tmp14_) {
					_data_->_tmp8_ = TRUE;
				} else {
					_data_->_tmp15_ = _data_->name;
					_data_->_tmp16_ = NULL;
					_data_->_tmp16_ = gvir_storage_pool_get_volume (_data_->pool, _data_->_tmp15_);
					_data_->_tmp17_ = _data_->_tmp16_;
					_data_->_tmp8_ = _data_->_tmp17_ != NULL;
					_g_object_unref0 (_data_->_tmp17_);
				}
				_data_->_tmp18_ = _data_->_tmp8_;
				if (!_data_->_tmp18_) {
					break;
				}
				_data_->_tmp19_ = g_strconcat (_data_->base_name, " ", NULL);
				_data_->_tmp20_ = _data_->_tmp19_;
				_data_->_tmp21_ = _data_->i;
				_data_->_tmp22_ = NULL;
				_data_->_tmp22_ = g_strdup_printf ("%i", _data_->_tmp21_);
				_data_->_tmp23_ = _data_->_tmp22_;
				_data_->_tmp24_ = g_strconcat (_data_->_tmp20_, _data_->_tmp23_, NULL);
				_g_free0 (_data_->name);
				_data_->name = _data_->_tmp24_;
				_g_free0 (_data_->_tmp23_);
				_g_free0 (_data_->_tmp20_);
			}
		}
	}
	_data_->result = _data_->name;
	_g_object_unref0 (_data_->pool);
	_g_free0 (_data_->base_name);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_object_unref0 (_data_->pool);
	_g_free0 (_data_->name);
	_g_free0 (_data_->base_name);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void boxes_vm_creator_create_target_volume_data_free (gpointer _data) {
	BoxesVmCreatorCreateTargetVolumeData* _data_;
	_data_ = _data;
	_g_free0 (_data_->name);
	_g_object_unref0 (_data_->result);
	_boxes_vm_creator_unref0 (_data_->self);
	g_slice_free (BoxesVmCreatorCreateTargetVolumeData, _data_);
}


static void boxes_vm_creator_create_target_volume (BoxesVMCreator* self, const gchar* name, gint64 storage, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesVmCreatorCreateTargetVolumeData* _data_;
	BoxesVMCreator* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gint64 _tmp3_;
	_data_ = g_slice_new0 (BoxesVmCreatorCreateTargetVolumeData);
	_data_->_async_result = g_simple_async_result_new (g_object_newv (G_TYPE_OBJECT, 0, NULL), _callback_, _user_data_, boxes_vm_creator_create_target_volume);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_vm_creator_create_target_volume_data_free);
	_tmp0_ = _boxes_vm_creator_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = name;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->name = _tmp2_;
	_tmp3_ = storage;
	_data_->storage = _tmp3_;
	boxes_vm_creator_create_target_volume_co (_data_);
}


static GVirStorageVol* boxes_vm_creator_create_target_volume_finish (BoxesVMCreator* self, GAsyncResult* _res_, GError** error) {
	GVirStorageVol* result;
	BoxesVmCreatorCreateTargetVolumeData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void boxes_vm_creator_create_target_volume_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesVmCreatorCreateTargetVolumeData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_vm_creator_create_target_volume_co (_data_);
}


static gboolean boxes_vm_creator_create_target_volume_co (BoxesVmCreatorCreateTargetVolumeData* _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_vm_creator_get_storage_pool (_data_->self, boxes_vm_creator_create_target_volume_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp0_ = NULL;
	_data_->_tmp0_ = boxes_vm_creator_get_storage_pool_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	_data_->pool = _data_->_tmp0_;
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp1_ = _data_->self->priv->configurator;
	_data_->_tmp2_ = _data_->name;
	_data_->_tmp3_ = _data_->storage;
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = boxes_vm_configurator_create_volume_config (_data_->_tmp1_, _data_->_tmp2_, _data_->_tmp3_, &_data_->_inner_error_);
	_data_->config = _data_->_tmp4_;
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		_g_object_unref0 (_data_->pool);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp5_ = _data_->pool;
	_data_->_tmp6_ = _data_->config;
	_data_->_tmp7_ = NULL;
	_data_->_tmp7_ = gvir_storage_pool_create_volume (_data_->_tmp5_, _data_->_tmp6_, &_data_->_inner_error_);
	_data_->volume = _data_->_tmp7_;
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		_g_object_unref0 (_data_->config);
		_g_object_unref0 (_data_->pool);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->result = _data_->volume;
	_g_object_unref0 (_data_->config);
	_g_object_unref0 (_data_->pool);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_object_unref0 (_data_->volume);
	_g_object_unref0 (_data_->config);
	_g_object_unref0 (_data_->pool);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void boxes_vm_creator_get_storage_pool_data_free (gpointer _data) {
	BoxesVmCreatorGetStoragePoolData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->result);
	_boxes_vm_creator_unref0 (_data_->self);
	g_slice_free (BoxesVmCreatorGetStoragePoolData, _data_);
}


static void boxes_vm_creator_get_storage_pool (BoxesVMCreator* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesVmCreatorGetStoragePoolData* _data_;
	BoxesVMCreator* _tmp0_;
	_data_ = g_slice_new0 (BoxesVmCreatorGetStoragePoolData);
	_data_->_async_result = g_simple_async_result_new (g_object_newv (G_TYPE_OBJECT, 0, NULL), _callback_, _user_data_, boxes_vm_creator_get_storage_pool);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_vm_creator_get_storage_pool_data_free);
	_tmp0_ = _boxes_vm_creator_ref0 (self);
	_data_->self = _tmp0_;
	boxes_vm_creator_get_storage_pool_co (_data_);
}


static GVirStoragePool* boxes_vm_creator_get_storage_pool_finish (BoxesVMCreator* self, GAsyncResult* _res_, GError** error) {
	GVirStoragePool* result;
	BoxesVmCreatorGetStoragePoolData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void boxes_vm_creator_get_storage_pool_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesVmCreatorGetStoragePoolData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_vm_creator_get_storage_pool_co (_data_);
}


static gboolean boxes_vm_creator_get_storage_pool_co (BoxesVmCreatorGetStoragePoolData* _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_->_tmp0_ = boxes_vm_creator_get_connection (_data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	_data_->_tmp2_ = NULL;
	_data_->_tmp2_ = gvir_connection_find_storage_pool_by_name (_data_->_tmp1_, PACKAGE_TARNAME);
	_data_->pool = _data_->_tmp2_;
	_data_->_tmp3_ = _data_->pool;
	if (_data_->_tmp3_ == NULL) {
		_data_->_tmp4_ = _data_->self->priv->configurator;
		_data_->_tmp5_ = NULL;
		_data_->_tmp5_ = boxes_vm_configurator_get_pool_config (_data_->_tmp4_, &_data_->_inner_error_);
		_data_->config = _data_->_tmp5_;
		if (_data_->_inner_error_ != NULL) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->pool);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp6_ = boxes_vm_creator_get_connection (_data_->self);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = _data_->config;
		_data_->_tmp9_ = NULL;
		_data_->_tmp9_ = gvir_connection_create_storage_pool (_data_->_tmp7_, _data_->_tmp8_, (guint) 0, &_data_->_inner_error_);
		_data_->_tmp10_ = _data_->_tmp9_;
		if (_data_->_inner_error_ != NULL) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->config);
			_g_object_unref0 (_data_->pool);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_object_unref0 (_data_->pool);
		_data_->pool = _data_->_tmp10_;
		_data_->_tmp11_ = _data_->pool;
		_data_->_state_ = 1;
		gvir_storage_pool_build_async (_data_->_tmp11_, (guint) 0, NULL, boxes_vm_creator_get_storage_pool_ready, _data_);
		return FALSE;
		_state_1:
		gvir_storage_pool_build_finish (_data_->_tmp11_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->config);
			_g_object_unref0 (_data_->pool);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp12_ = _data_->pool;
		_data_->_state_ = 2;
		gvir_storage_pool_start_async (_data_->_tmp12_, (guint) 0, NULL, boxes_vm_creator_get_storage_pool_ready, _data_);
		return FALSE;
		_state_2:
		gvir_storage_pool_start_finish (_data_->_tmp12_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->config);
			_g_object_unref0 (_data_->pool);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp13_ = _data_->pool;
		_data_->_state_ = 3;
		gvir_storage_pool_refresh_async (_data_->_tmp13_, NULL, boxes_vm_creator_get_storage_pool_ready, _data_);
		return FALSE;
		_state_3:
		gvir_storage_pool_refresh_finish (_data_->_tmp13_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			_g_object_unref0 (_data_->config);
			_g_object_unref0 (_data_->pool);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_object_unref0 (_data_->config);
	}
	_data_->result = _data_->pool;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_g_object_unref0 (_data_->pool);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static GVirConnection* boxes_vm_creator_get_connection (BoxesVMCreator* self) {
	GVirConnection* result;
	BoxesApp* _tmp0_;
	GVirConnection* _tmp1_;
	GVirConnection* _tmp2_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->app;
	_tmp1_ = boxes_app_get_default_connection (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}


static void boxes_value_vm_creator_init (GValue* value) {
	value->data[0].v_pointer = NULL;
}


static void boxes_value_vm_creator_free_value (GValue* value) {
	if (value->data[0].v_pointer) {
		boxes_vm_creator_unref (value->data[0].v_pointer);
	}
}


static void boxes_value_vm_creator_copy_value (const GValue* src_value, GValue* dest_value) {
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = boxes_vm_creator_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}


static gpointer boxes_value_vm_creator_peek_pointer (const GValue* value) {
	return value->data[0].v_pointer;
}


static gchar* boxes_value_vm_creator_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		BoxesVMCreator* object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = boxes_vm_creator_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* boxes_value_vm_creator_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	BoxesVMCreator** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = boxes_vm_creator_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* boxes_param_spec_vm_creator (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	BoxesParamSpecVMCreator* spec;
	g_return_val_if_fail (g_type_is_a (object_type, BOXES_TYPE_VM_CREATOR), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}


gpointer boxes_value_get_vm_creator (const GValue* value) {
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BOXES_TYPE_VM_CREATOR), NULL);
	return value->data[0].v_pointer;
}


void boxes_value_set_vm_creator (GValue* value, gpointer v_object) {
	BoxesVMCreator* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BOXES_TYPE_VM_CREATOR));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, BOXES_TYPE_VM_CREATOR));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		boxes_vm_creator_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		boxes_vm_creator_unref (old);
	}
}


void boxes_value_take_vm_creator (GValue* value, gpointer v_object) {
	BoxesVMCreator* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BOXES_TYPE_VM_CREATOR));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, BOXES_TYPE_VM_CREATOR));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		boxes_vm_creator_unref (old);
	}
}


static void boxes_vm_creator_class_init (BoxesVMCreatorClass * klass) {
	boxes_vm_creator_parent_class = g_type_class_peek_parent (klass);
	BOXES_VM_CREATOR_CLASS (klass)->finalize = boxes_vm_creator_finalize;
	g_type_class_add_private (klass, sizeof (BoxesVMCreatorPrivate));
}


static void boxes_vm_creator_instance_init (BoxesVMCreator * self) {
	self->priv = BOXES_VM_CREATOR_GET_PRIVATE (self);
	self->ref_count = 1;
}


static void boxes_vm_creator_finalize (BoxesVMCreator* obj) {
	BoxesVMCreator * self;
	self = BOXES_VM_CREATOR (obj);
	_g_object_unref0 (self->priv->app);
	_boxes_vm_configurator_unref0 (self->priv->configurator);
}


GType boxes_vm_creator_get_type (void) {
	static volatile gsize boxes_vm_creator_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_vm_creator_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { boxes_value_vm_creator_init, boxes_value_vm_creator_free_value, boxes_value_vm_creator_copy_value, boxes_value_vm_creator_peek_pointer, "p", boxes_value_vm_creator_collect_value, "p", boxes_value_vm_creator_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (BoxesVMCreatorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_vm_creator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesVMCreator), 0, (GInstanceInitFunc) boxes_vm_creator_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType boxes_vm_creator_type_id;
		boxes_vm_creator_type_id = g_type_register_fundamental (g_type_fundamental_next (), "BoxesVMCreator", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&boxes_vm_creator_type_id__volatile, boxes_vm_creator_type_id);
	}
	return boxes_vm_creator_type_id__volatile;
}


gpointer boxes_vm_creator_ref (gpointer instance) {
	BoxesVMCreator* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void boxes_vm_creator_unref (gpointer instance) {
	BoxesVMCreator* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		BOXES_VM_CREATOR_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}



