/* vm-creator.c generated by valac 0.14.0, 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 <libvirt-gobject/libvirt-gobject.h>
#include <stdlib.h>
#include <string.h>
#include <clutter/clutter.h>
#include <gtk/gtk.h>
#include <clutter-gtk/clutter-gtk.h>
#include <gio/gio.h>
#include <float.h>
#include <math.h>
#include <libvirt-gconfig/libvirt-gconfig.h>
#include <osinfo/osinfo.h>
#include <config.h>
#include <unistd.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 _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#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;
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_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;
typedef struct _BoxesCollectionPrivate BoxesCollectionPrivate;

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

#define BOXES_TYPE_IPROPERTIES (boxes_iproperties_get_type ())
#define BOXES_IPROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_IPROPERTIES, BoxesIProperties))
#define BOXES_IS_IPROPERTIES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_IPROPERTIES))
#define BOXES_IPROPERTIES_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BOXES_TYPE_IPROPERTIES, BoxesIPropertiesIface))

typedef struct _BoxesIProperties BoxesIProperties;
typedef struct _BoxesIPropertiesIface BoxesIPropertiesIface;

#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 _boxes_vm_creator_unref0(var) ((var == NULL) ? NULL : (var = (boxes_vm_creator_unref (var), NULL)))
#define _g_free0(var) (var = (g_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;

#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;
typedef struct _BoxesInstallerMediaPrivate BoxesInstallerMediaPrivate;
typedef struct _BoxesVmCreatorCreateAndLaunchVmData BoxesVmCreatorCreateAndLaunchVmData;
typedef struct _BoxesVmCreatorConnectData BoxesVmCreatorConnectData;
typedef struct _BoxesVmCreatorCreateTargetVolumeData BoxesVmCreatorCreateTargetVolumeData;
typedef struct _BoxesUnattendedInstallerPrivate BoxesUnattendedInstallerPrivate;
typedef struct _BoxesVmCreatorGetStoragePoolData BoxesVmCreatorGetStoragePoolData;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
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 {
	GVirConnection* connection;
	guint16 spice_port;
};

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;
	GtkWindow* window;
	GtkNotebook* notebook;
	GtkClutterEmbed* embed;
	ClutterStage* stage;
	ClutterState* state;
	ClutterBox* box;
	BoxesCollectionItem* current_item;
	BoxesTopbar* topbar;
	BoxesSidebar* sidebar;
	BoxesSelectionbar* selectionbar;
	guint duration;
	GSettings* settings;
	BoxesWizard* wizard;
	BoxesProperties* properties;
	BoxesDisplayPage* display_page;
	BoxesCollection* collection;
};

struct _BoxesAppClass {
	BoxesUIClass parent_class;
};

struct _BoxesCollection {
	GObject parent_instance;
	BoxesCollectionPrivate * priv;
	GPtrArray* items;
};

struct _BoxesCollectionClass {
	GObjectClass parent_class;
};

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

struct _BoxesCollectionItemClass {
	BoxesUIClass parent_class;
};

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

struct _BoxesIPropertiesIface {
	GTypeInterface parent_iface;
	GList* (*get_properties) (BoxesIProperties* self, BoxesPropertiesPage page);
};

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

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);
	gboolean (*is_running) (BoxesMachine* self);
	gchar* (*get_screenshot_prefix) (BoxesMachine* self);
	void (*connect_display) (BoxesMachine* self);
	void (*disconnect_display) (BoxesMachine* self);
	void (*delete) (BoxesMachine* self);
};

struct _BoxesLibvirtMachine {
	BoxesMachine parent_instance;
	BoxesLibvirtMachinePrivate * priv;
	GVirDomain* domain;
	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;
};

typedef enum  {
	BOXES_ERROR_INVALID
} BoxesError;
#define BOXES_ERROR boxes_error_quark ()
struct _BoxesInstallerMedia {
	GObject parent_instance;
	BoxesInstallerMediaPrivate * priv;
	OsinfoOs* os;
	OsinfoMedia* os_media;
	gchar* label;
	gchar* device_file;
	gchar* mount_point;
	gboolean from_image;
};

struct _BoxesInstallerMediaClass {
	GObjectClass parent_class;
};

struct _BoxesVmCreatorCreateAndLaunchVmData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesVMCreator* self;
	BoxesInstallerMedia* install_media;
	OsinfoResources* resources;
	GCancellable* cancellable;
	GVirDomain* result;
	GVirConnection* _tmp0_;
	gboolean _tmp1_;
	GCancellable* _tmp2_;
	BoxesInstallerMedia* _tmp3_;
	BoxesInstallerMedia* _tmp4_;
	GCancellable* _tmp5_;
	gchar* name;
	BoxesInstallerMedia* _tmp6_;
	OsinfoOs* _tmp7_;
	BoxesInstallerMedia* _tmp8_;
	OsinfoOs* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	BoxesInstallerMedia* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	const gchar* _tmp16_;
	OsinfoResources* _tmp17_;
	gint64 _tmp18_;
	gint64 _tmp19_;
	gchar* _tmp20_;
	gchar* target_path;
	BoxesInstallerMedia* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_;
	OsinfoResources* _tmp24_;
	gchar* _tmp25_;
	gchar* xml;
	guint16 _tmp26_;
	const gchar* _tmp27_;
	GVirConfigDomain* _tmp28_;
	GVirConfigDomain* config;
	GVirConnection* _tmp29_;
	GVirConfigDomain* _tmp30_;
	GVirDomain* _tmp31_;
	GVirDomain* domain;
	GVirDomain* _tmp32_;
	GVirDomain* _tmp33_;
	GVirConfigDomain* _tmp34_;
	GVirConfigDomain* _tmp35_;
	GVirConfigDomain* _tmp36_;
	gchar* _tmp37_;
	GRegex* _tmp38_;
	const gchar* _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	GRegex* _tmp42_;
	const gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	const gchar* _tmp46_;
	GVirConfigDomain* _tmp47_;
	GVirConfigDomain* _tmp48_;
	GVirDomain* _tmp49_;
	GVirConfigDomain* _tmp50_;
	GError * _inner_error_;
};

struct _BoxesVmCreatorConnectData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesVMCreator* self;
	GCancellable* cancellable;
	GVirConnection* _tmp0_;
	GCancellable* _tmp1_;
	GVirConnection* _tmp2_;
	GCancellable* _tmp3_;
	GVirConnection* _tmp4_;
	GCancellable* _tmp5_;
	GError * _inner_error_;
};

struct _BoxesVmCreatorCreateTargetVolumeData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesVMCreator* self;
	gchar* name;
	gint64 storage;
	gchar* result;
	GVirStoragePool* _tmp0_;
	GVirStoragePool* pool;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* volume_name;
	gint i;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gint _tmp5_;
	GVirStoragePool* _tmp6_;
	const gchar* _tmp7_;
	GVirStoragePool* _tmp8_;
	GVirStoragePool* _tmp9_;
	gboolean _tmp10_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gint _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gint64 _tmp20_;
	gchar* _tmp21_;
	gchar* storage_str;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	const gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	gchar* _tmp46_;
	gchar* _tmp47_;
	gchar* _tmp48_;
	gchar* _tmp49_;
	gchar* _tmp50_;
	gchar* _tmp51_;
	gchar* _tmp52_;
	gchar* _tmp53_;
	gchar* _tmp54_;
	gchar* _tmp55_;
	gchar* _tmp56_;
	gchar* _tmp57_;
	gchar* _tmp58_;
	gchar* _tmp59_;
	const gchar* _tmp60_;
	gchar* _tmp61_;
	gchar* _tmp62_;
	gchar* _tmp63_;
	gchar* _tmp64_;
	gchar* _tmp65_;
	gchar* _tmp66_;
	gchar* _tmp67_;
	gchar* _tmp68_;
	gchar* _tmp69_;
	gchar* _tmp70_;
	gchar* xml;
	const gchar* _tmp71_;
	GVirConfigStorageVol* _tmp72_;
	GVirConfigStorageVol* config;
	GVirStoragePool* _tmp73_;
	GVirConfigStorageVol* _tmp74_;
	GVirStorageVol* _tmp75_;
	GVirStorageVol* volume;
	GVirStorageVol* _tmp76_;
	const gchar* _tmp77_;
	gchar* _tmp78_;
	GError * _inner_error_;
};

struct _BoxesUnattendedInstaller {
	BoxesInstallerMedia parent_instance;
	BoxesUnattendedInstallerPrivate * priv;
	gchar* kernel_path;
	gchar* initrd_path;
	gchar* _floppy_path;
	gchar* unattended_src_path;
	gchar* unattended_dest_name;
	GtkLabel* setup_label;
	GtkHBox* setup_hbox;
	GtkSwitch* express_toggle;
	GtkEntry* username_entry;
	GtkEntry* password_entry;
};

struct _BoxesUnattendedInstallerClass {
	BoxesInstallerMediaClass parent_class;
	void (*populate_setup_vbox) (BoxesUnattendedInstaller* self, GtkVBox* setup_vbox);
	void (*setup_ui) (BoxesUnattendedInstaller* self);
	void (*clean_up) (BoxesUnattendedInstaller* self, GError** error);
	void (*prepare_direct_boot) (BoxesUnattendedInstaller* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*prepare_direct_boot_finish) (BoxesUnattendedInstaller* self, GAsyncResult* _res_, GError** error);
};

struct _BoxesVmCreatorGetStoragePoolData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesVMCreator* self;
	GVirStoragePool* result;
	GVirConnection* _tmp0_;
	GVirStoragePool* _tmp1_;
	GVirStoragePool* pool;
	GVirStoragePool* _tmp2_;
	gchar* _tmp3_;
	gchar* pool_path;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	const gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	gchar* _tmp46_;
	gchar* _tmp47_;
	gchar* _tmp48_;
	gchar* _tmp49_;
	gchar* _tmp50_;
	gchar* _tmp51_;
	gchar* _tmp52_;
	gchar* xml;
	const gchar* _tmp53_;
	GVirConfigStoragePool* _tmp54_;
	GVirConfigStoragePool* config;
	GVirConnection* _tmp55_;
	GVirConfigStoragePool* _tmp56_;
	GVirStoragePool* _tmp57_;
	GVirStoragePool* _tmp58_;
	GVirStoragePool* _tmp59_;
	GVirStoragePool* _tmp60_;
	GVirStoragePool* _tmp61_;
	GError * _inner_error_;
};

struct _BoxesParamSpecVMCreator {
	GParamSpec parent_instance;
};


static gpointer boxes_vm_creator_parent_class = NULL;
static GRegex* boxes_vm_creator_direct_boot_regex;
static GRegex* boxes_vm_creator_direct_boot_regex = NULL;
static GRegex* boxes_vm_creator_cdrom_boot_regex;
static GRegex* boxes_vm_creator_cdrom_boot_regex = 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;
#define BOXES_VM_CREATOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_VM_CREATOR, BoxesVMCreatorPrivate))
enum  {
	BOXES_VM_CREATOR_DUMMY_PROPERTY
};
GType boxes_ui_get_type (void) G_GNUC_CONST;
GType boxes_app_get_type (void) G_GNUC_CONST;
BoxesVMCreator* boxes_vm_creator_new (BoxesApp* app, const gchar* uri, GError** error);
BoxesVMCreator* boxes_vm_creator_construct (GType object_type, BoxesApp* app, const gchar* uri, GError** error);
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_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;
GType boxes_machine_get_type (void) G_GNUC_CONST;
GType boxes_libvirt_machine_get_type (void) G_GNUC_CONST;
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_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;
GQuark boxes_error_quark (void);
gchar* boxes_extract_xpath (const gchar* xmldoc, const gchar* xpath, gboolean required, GError** error);
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, OsinfoResources* resources, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
GVirDomain* 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 void boxes_vm_creator_connect (BoxesVMCreator* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void boxes_vm_creator_connect_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, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_unattended_installer_setup_finish (BoxesUnattendedInstaller* self, GAsyncResult* _res_, GError** error);
static void boxes_vm_creator_create_target_volume (BoxesVMCreator* self, const gchar* name, gint64 storage, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gchar* boxes_vm_creator_create_target_volume_finish (BoxesVMCreator* self, GAsyncResult* _res_, GError** error);
static gchar* boxes_vm_creator_get_virt_xml (BoxesVMCreator* self, BoxesInstallerMedia* install_media, const gchar* name, const gchar* target_path, OsinfoResources* resources);
static void boxes_vm_creator_connect_data_free (gpointer _data);
static gboolean boxes_vm_creator_connect_co (BoxesVmCreatorConnectData* _data_);
static void boxes_vm_creator_connect_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static gchar* boxes_vm_creator_get_direct_boot_xml (BoxesVMCreator* self, BoxesInstallerMedia* install_media);
static gchar* boxes_vm_creator_get_unattended_dir_floppy_xml (BoxesVMCreator* self, BoxesInstallerMedia* install_media);
static gchar* boxes_vm_creator_get_source_media_xml (BoxesVMCreator* self, BoxesInstallerMedia* install_media);
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_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_target_volume_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static gchar* boxes_vm_creator_get_uid (BoxesVMCreator* self);
static gchar* boxes_vm_creator_get_gid (BoxesVMCreator* self);
const gchar* boxes_unattended_installer_get_floppy_path (BoxesUnattendedInstaller* self);
static void boxes_vm_creator_get_storage_pool_data_free (gpointer _data);
static gboolean boxes_vm_creator_get_storage_pool_co (BoxesVmCreatorGetStoragePoolData* _data_);
gchar* boxes_get_pkgconfig (const gchar* file_name);
void boxes_ensure_directory (const gchar* dir);
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 GRegex* _tmp_regex_0 = NULL;
static GRegex* _tmp_regex_1 = NULL;

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


BoxesVMCreator* boxes_vm_creator_construct (GType object_type, BoxesApp* app, const gchar* uri, GError** error) {
	BoxesVMCreator* self = NULL;
	const gchar* _tmp0_;
	GVirConnection* _tmp1_;
	BoxesApp* _tmp2_;
	BoxesCollection* _tmp3_;
	GPtrArray* _tmp4_;
	gpointer* _tmp5_;
	gint _tmp5__length1;
	guint16 _tmp33_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (app != NULL, NULL);
	g_return_val_if_fail (uri != NULL, NULL);
	self = (BoxesVMCreator*) g_type_create_instance (object_type);
	_tmp0_ = uri;
	_tmp1_ = gvir_connection_new (_tmp0_);
	_g_object_unref0 (self->priv->connection);
	self->priv->connection = _tmp1_;
	self->priv->spice_port = (guint16) 5800;
	_tmp2_ = app;
	_tmp3_ = _tmp2_->collection;
	_tmp4_ = _tmp3_->items;
	_tmp5_ = _tmp4_->pdata;
	_tmp5__length1 = (gint) _tmp4_->len;
	{
		BoxesCollectionItem** item_collection = NULL;
		gint item_collection_length1 = 0;
		gint _item_collection_size_ = 0;
		gint item_it = 0;
		item_collection = _tmp5_;
		item_collection_length1 = _tmp5__length1;
		for (item_it = 0; item_it < _tmp5__length1; item_it = item_it + 1) {
			BoxesCollectionItem* _tmp6_;
			BoxesCollectionItem* item = NULL;
			_tmp6_ = _g_object_ref0 (item_collection[item_it]);
			item = _tmp6_;
			{
				BoxesCollectionItem* _tmp7_;
				_tmp7_ = item;
				if (BOXES_IS_LIBVIRT_MACHINE (_tmp7_)) {
					BoxesCollectionItem* _tmp8_;
					BoxesLibvirtMachine* _tmp9_;
					BoxesLibvirtMachine* machine;
					BoxesLibvirtMachine* _tmp10_;
					GVirDomain* _tmp11_;
					GVirConfigDomain* _tmp12_ = NULL;
					GVirConfigDomain* _tmp13_;
					GVirConfigDomain* _tmp14_;
					gchar* _tmp15_ = NULL;
					gchar* _tmp16_;
					gchar* xmldoc;
					const gchar* _tmp17_;
					gchar* _tmp18_ = NULL;
					gchar* type;
					const gchar* _tmp19_;
					const gchar* _tmp20_;
					gchar* _tmp21_;
					gchar* _tmp22_;
					gchar* _tmp23_;
					gchar* _tmp24_;
					gchar* _tmp25_ = NULL;
					gchar* _tmp26_;
					gchar* port_str;
					const gchar* _tmp27_;
					gint _tmp28_ = 0;
					gint port;
					gint _tmp29_;
					_tmp8_ = item;
					_tmp9_ = _g_object_ref0 (BOXES_IS_LIBVIRT_MACHINE (_tmp8_) ? ((BoxesLibvirtMachine*) _tmp8_) : NULL);
					machine = _tmp9_;
					_tmp10_ = machine;
					_tmp11_ = _tmp10_->domain;
					_tmp12_ = gvir_domain_get_config (_tmp11_, (guint64) 0, &_inner_error_);
					_tmp13_ = _tmp12_;
					if (_inner_error_ != NULL) {
						g_propagate_error (error, _inner_error_);
						_g_object_unref0 (machine);
						_g_object_unref0 (item);
						_boxes_vm_creator_unref0 (self);
						return NULL;
					}
					_tmp14_ = _tmp13_;
					_tmp15_ = gvir_config_object_to_xml ((GVirConfigObject*) _tmp14_);
					_tmp16_ = _tmp15_;
					_g_object_unref0 (_tmp14_);
					xmldoc = _tmp16_;
					_tmp17_ = xmldoc;
					_tmp18_ = boxes_extract_xpath (_tmp17_, "string(/domain/devices/graphics/@type)", TRUE, &_inner_error_);
					type = _tmp18_;
					if (_inner_error_ != NULL) {
						g_propagate_error (error, _inner_error_);
						_g_free0 (xmldoc);
						_g_object_unref0 (machine);
						_g_object_unref0 (item);
						_boxes_vm_creator_unref0 (self);
						return NULL;
					}
					_tmp19_ = xmldoc;
					_tmp20_ = type;
					_tmp21_ = g_strconcat ("string(/domain/devices/graphics[@type='", _tmp20_, NULL);
					_tmp22_ = _tmp21_;
					_tmp23_ = g_strconcat (_tmp22_, "']/@port)", NULL);
					_tmp24_ = _tmp23_;
					_tmp25_ = boxes_extract_xpath (_tmp19_, _tmp24_, FALSE, &_inner_error_);
					_tmp26_ = _tmp25_;
					_g_free0 (_tmp24_);
					_g_free0 (_tmp22_);
					port_str = _tmp26_;
					if (_inner_error_ != NULL) {
						g_propagate_error (error, _inner_error_);
						_g_free0 (type);
						_g_free0 (xmldoc);
						_g_object_unref0 (machine);
						_g_object_unref0 (item);
						_boxes_vm_creator_unref0 (self);
						return NULL;
					}
					_tmp27_ = port_str;
					_tmp28_ = atoi (_tmp27_);
					port = _tmp28_;
					_tmp29_ = port;
					if (_tmp29_ > 0) {
						guint16 _tmp30_;
						gint _tmp31_;
						guint16 _tmp32_ = 0U;
						_tmp30_ = self->priv->spice_port;
						_tmp31_ = port;
						_tmp32_ = MAX (_tmp30_, (guint16) _tmp31_);
						self->priv->spice_port = _tmp32_;
					}
					_g_free0 (port_str);
					_g_free0 (type);
					_g_free0 (xmldoc);
					_g_object_unref0 (machine);
				}
				_g_object_unref0 (item);
			}
		}
	}
	_tmp33_ = self->priv->spice_port;
	self->priv->spice_port = _tmp33_ + 1;
	return self;
}


BoxesVMCreator* boxes_vm_creator_new (BoxesApp* app, const gchar* uri, GError** error) {
	return boxes_vm_creator_construct (BOXES_TYPE_VM_CREATOR, app, uri, error);
}


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_->resources);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->result);
	_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, OsinfoResources* resources, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesVmCreatorCreateAndLaunchVmData* _data_;
	BoxesVMCreator* _tmp0_;
	BoxesInstallerMedia* _tmp1_;
	BoxesInstallerMedia* _tmp2_;
	OsinfoResources* _tmp3_;
	OsinfoResources* _tmp4_;
	GCancellable* _tmp5_;
	GCancellable* _tmp6_;
	_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_ = resources;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->resources = _tmp4_;
	_tmp5_ = cancellable;
	_tmp6_ = _g_object_ref0 (_tmp5_);
	_data_->cancellable = _tmp6_;
	boxes_vm_creator_create_and_launch_vm_co (_data_);
}


GVirDomain* boxes_vm_creator_create_and_launch_vm_finish (BoxesVMCreator* self, GAsyncResult* _res_, GError** error) {
	GVirDomain* result;
	BoxesVmCreatorCreateAndLaunchVmData* _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_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 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_->_tmp0_ = _data_->self->priv->connection;
	_data_->_tmp1_ = FALSE;
	_data_->_tmp1_ = gvir_connection_is_open (_data_->_tmp0_);
	if (!_data_->_tmp1_) {
		_data_->_tmp2_ = _data_->cancellable;
		_data_->_state_ = 1;
		boxes_vm_creator_connect (_data_->self, _data_->_tmp2_, boxes_vm_creator_create_and_launch_vm_ready, _data_);
		return FALSE;
		_state_1:
		boxes_vm_creator_connect_finish (_data_->self, _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_);
			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_->_tmp3_ = _data_->install_media;
	if (BOXES_IS_UNATTENDED_INSTALLER (_data_->_tmp3_)) {
		_data_->_tmp4_ = _data_->install_media;
		_data_->_tmp5_ = _data_->cancellable;
		_data_->_state_ = 2;
		boxes_unattended_installer_setup (BOXES_IS_UNATTENDED_INSTALLER (_data_->_tmp4_) ? ((BoxesUnattendedInstaller*) _data_->_tmp4_) : NULL, _data_->_tmp5_, boxes_vm_creator_create_and_launch_vm_ready, _data_);
		return FALSE;
		_state_2:
		boxes_unattended_installer_setup_finish (BOXES_IS_UNATTENDED_INSTALLER (_data_->_tmp4_) ? ((BoxesUnattendedInstaller*) _data_->_tmp4_) : NULL, _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_);
			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_ = _data_->install_media;
	_data_->_tmp7_ = _data_->_tmp6_->os;
	if (_data_->_tmp7_ != NULL) {
		_data_->_tmp8_ = _data_->install_media;
		_data_->_tmp9_ = _data_->_tmp8_->os;
		_data_->_tmp10_ = osinfo_product_get_name ((OsinfoProduct*) _data_->_tmp9_);
		_data_->_tmp11_ = _data_->_tmp10_;
		_data_->_tmp12_ = g_strdup (_data_->_tmp11_);
		_g_free0 (_data_->name);
		_data_->name = _data_->_tmp12_;
	} else {
		_data_->_tmp13_ = _data_->install_media;
		_data_->_tmp14_ = _data_->_tmp13_->label;
		_data_->_tmp15_ = g_strdup (_data_->_tmp14_);
		_g_free0 (_data_->name);
		_data_->name = _data_->_tmp15_;
	}
	_data_->_tmp16_ = _data_->name;
	_data_->_tmp17_ = _data_->resources;
	_data_->_tmp18_ = osinfo_resources_get_storage (_data_->_tmp17_);
	_data_->_tmp19_ = _data_->_tmp18_;
	_data_->_state_ = 3;
	boxes_vm_creator_create_target_volume (_data_->self, _data_->_tmp16_, _data_->_tmp19_, boxes_vm_creator_create_and_launch_vm_ready, _data_);
	return FALSE;
	_state_3:
	_data_->_tmp20_ = NULL;
	_data_->_tmp20_ = boxes_vm_creator_create_target_volume_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
	_data_->target_path = _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_free0 (_data_->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_->_tmp21_ = _data_->install_media;
	_data_->_tmp22_ = _data_->name;
	_data_->_tmp23_ = _data_->target_path;
	_data_->_tmp24_ = _data_->resources;
	_data_->_tmp25_ = NULL;
	_data_->_tmp25_ = boxes_vm_creator_get_virt_xml (_data_->self, _data_->_tmp21_, _data_->_tmp22_, _data_->_tmp23_, _data_->_tmp24_);
	_data_->xml = _data_->_tmp25_;
	_data_->_tmp26_ = _data_->self->priv->spice_port;
	_data_->self->priv->spice_port = _data_->_tmp26_ + 1;
	_data_->_tmp27_ = _data_->xml;
	_data_->_tmp28_ = gvir_config_domain_new_from_xml (_data_->_tmp27_, &_data_->_inner_error_);
	_data_->config = _data_->_tmp28_;
	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_->xml);
		_g_free0 (_data_->target_path);
		_g_free0 (_data_->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_->_tmp29_ = _data_->self->priv->connection;
	_data_->_tmp30_ = _data_->config;
	_data_->_tmp31_ = NULL;
	_data_->_tmp31_ = gvir_connection_create_domain (_data_->_tmp29_, _data_->_tmp30_, &_data_->_inner_error_);
	_data_->domain = _data_->_tmp31_;
	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_free0 (_data_->xml);
		_g_free0 (_data_->target_path);
		_g_free0 (_data_->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_->_tmp32_ = _data_->domain;
	gvir_domain_start (_data_->_tmp32_, (guint64) 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_free0 (_data_->xml);
		_g_free0 (_data_->target_path);
		_g_free0 (_data_->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_->_tmp33_ = _data_->domain;
	_data_->_tmp34_ = NULL;
	_data_->_tmp34_ = gvir_domain_get_config (_data_->_tmp33_, (guint64) 0, &_data_->_inner_error_);
	_data_->_tmp35_ = _data_->_tmp34_;
	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_free0 (_data_->xml);
		_g_free0 (_data_->target_path);
		_g_free0 (_data_->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_->_tmp36_ = _data_->_tmp35_;
	_data_->_tmp37_ = NULL;
	_data_->_tmp37_ = gvir_config_object_to_xml ((GVirConfigObject*) _data_->_tmp36_);
	_g_free0 (_data_->xml);
	_data_->xml = _data_->_tmp37_;
	_g_object_unref0 (_data_->_tmp36_);
	_data_->_tmp38_ = boxes_vm_creator_direct_boot_regex;
	_data_->_tmp39_ = _data_->xml;
	_data_->_tmp40_ = NULL;
	_data_->_tmp40_ = g_regex_replace (_data_->_tmp38_, _data_->_tmp39_, (gssize) (-1), 0, "", 0, &_data_->_inner_error_);
	_data_->_tmp41_ = _data_->_tmp40_;
	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_free0 (_data_->xml);
		_g_free0 (_data_->target_path);
		_g_free0 (_data_->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_free0 (_data_->xml);
	_data_->xml = _data_->_tmp41_;
	_data_->_tmp42_ = boxes_vm_creator_cdrom_boot_regex;
	_data_->_tmp43_ = _data_->xml;
	_data_->_tmp44_ = NULL;
	_data_->_tmp44_ = g_regex_replace (_data_->_tmp42_, _data_->_tmp43_, (gssize) (-1), 0, "", 0, &_data_->_inner_error_);
	_data_->_tmp45_ = _data_->_tmp44_;
	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_free0 (_data_->xml);
		_g_free0 (_data_->target_path);
		_g_free0 (_data_->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_free0 (_data_->xml);
	_data_->xml = _data_->_tmp45_;
	_data_->_tmp46_ = _data_->xml;
	_data_->_tmp47_ = gvir_config_domain_new_from_xml (_data_->_tmp46_, &_data_->_inner_error_);
	_data_->_tmp48_ = _data_->_tmp47_;
	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_free0 (_data_->xml);
		_g_free0 (_data_->target_path);
		_g_free0 (_data_->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_->config);
	_data_->config = _data_->_tmp48_;
	_data_->_tmp49_ = _data_->domain;
	_data_->_tmp50_ = _data_->config;
	gvir_domain_set_config (_data_->_tmp49_, _data_->_tmp50_, &_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_free0 (_data_->xml);
		_g_free0 (_data_->target_path);
		_g_free0 (_data_->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_->result = _data_->domain;
	_g_object_unref0 (_data_->config);
	_g_free0 (_data_->xml);
	_g_free0 (_data_->target_path);
	_g_free0 (_data_->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_->domain);
	_g_object_unref0 (_data_->config);
	_g_free0 (_data_->xml);
	_g_free0 (_data_->target_path);
	_g_free0 (_data_->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_connect_data_free (gpointer _data) {
	BoxesVmCreatorConnectData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	_boxes_vm_creator_unref0 (_data_->self);
	g_slice_free (BoxesVmCreatorConnectData, _data_);
}


static void boxes_vm_creator_connect (BoxesVMCreator* self, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesVmCreatorConnectData* _data_;
	BoxesVMCreator* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	_data_ = g_slice_new0 (BoxesVmCreatorConnectData);
	_data_->_async_result = g_simple_async_result_new (g_object_newv (G_TYPE_OBJECT, 0, NULL), _callback_, _user_data_, boxes_vm_creator_connect);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_vm_creator_connect_data_free);
	_tmp0_ = _boxes_vm_creator_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = cancellable;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_data_->cancellable = _tmp2_;
	boxes_vm_creator_connect_co (_data_);
}


static void boxes_vm_creator_connect_finish (BoxesVMCreator* self, GAsyncResult* _res_, GError** error) {
	BoxesVmCreatorConnectData* _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 void boxes_vm_creator_connect_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesVmCreatorConnectData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_vm_creator_connect_co (_data_);
}


static gboolean boxes_vm_creator_connect_co (BoxesVmCreatorConnectData* _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_ = _data_->self->priv->connection;
	_data_->_tmp1_ = _data_->cancellable;
	_data_->_state_ = 1;
	gvir_connection_open_async (_data_->_tmp0_, _data_->_tmp1_, boxes_vm_creator_connect_ready, _data_);
	return FALSE;
	_state_1:
	gvir_connection_open_finish (_data_->_tmp0_, _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_);
		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_->_tmp2_ = _data_->self->priv->connection;
	_data_->_tmp3_ = _data_->cancellable;
	_data_->_state_ = 2;
	gvir_connection_fetch_domains_async (_data_->_tmp2_, _data_->_tmp3_, boxes_vm_creator_connect_ready, _data_);
	return FALSE;
	_state_2:
	gvir_connection_fetch_domains_finish (_data_->_tmp2_, _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_);
		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_->_tmp4_ = _data_->self->priv->connection;
	_data_->_tmp5_ = _data_->cancellable;
	_data_->_state_ = 3;
	gvir_connection_fetch_storage_pools_async (_data_->_tmp4_, _data_->_tmp5_, boxes_vm_creator_connect_ready, _data_);
	return FALSE;
	_state_3:
	gvir_connection_fetch_storage_pools_finish (_data_->_tmp4_, _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_);
		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;
	}
	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 gboolean string_contains (const gchar* self, const gchar* needle) {
	gboolean result = FALSE;
	const gchar* _tmp0_;
	gchar* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = needle;
	_tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_);
	result = _tmp1_ != NULL;
	return result;
}


static gchar* boxes_vm_creator_get_virt_xml (BoxesVMCreator* self, BoxesInstallerMedia* install_media, const gchar* name, const gchar* target_path, OsinfoResources* resources) {
	gchar* result = NULL;
	gchar* _tmp0_;
	gchar* clock_offset;
	gboolean _tmp1_ = FALSE;
	BoxesInstallerMedia* _tmp2_;
	OsinfoOs* _tmp3_;
	gboolean _tmp9_;
	const gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* domain_name;
	OsinfoResources* _tmp28_;
	gint64 _tmp29_;
	gint64 _tmp30_;
	gchar* _tmp31_ = NULL;
	gchar* ram;
	const gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	OsinfoResources* _tmp45_;
	gint _tmp46_;
	gint _tmp47_;
	gchar* _tmp48_ = NULL;
	gchar* _tmp49_;
	gchar* _tmp50_;
	gchar* _tmp51_;
	gchar* _tmp52_;
	gchar* _tmp53_;
	gchar* _tmp54_;
	gchar* _tmp55_;
	gchar* _tmp56_;
	gchar* _tmp57_;
	gchar* _tmp58_;
	gchar* _tmp59_;
	gchar* _tmp60_;
	gchar* _tmp61_;
	BoxesInstallerMedia* _tmp62_;
	gchar* _tmp63_ = NULL;
	gchar* _tmp64_;
	gchar* _tmp65_;
	gchar* _tmp66_;
	gchar* _tmp67_;
	gchar* _tmp68_;
	gchar* _tmp69_;
	gchar* _tmp70_;
	gchar* _tmp71_;
	gchar* _tmp72_;
	gchar* _tmp73_;
	gchar* _tmp74_;
	gchar* _tmp75_;
	gchar* _tmp76_;
	const gchar* _tmp77_;
	gchar* _tmp78_;
	gchar* _tmp79_;
	gchar* _tmp80_;
	gchar* _tmp81_;
	gchar* _tmp82_;
	gchar* _tmp83_;
	gchar* _tmp84_;
	gchar* _tmp85_;
	gchar* _tmp86_;
	gchar* _tmp87_;
	gchar* _tmp88_;
	gchar* _tmp89_;
	gchar* _tmp90_;
	gchar* _tmp91_;
	gchar* _tmp92_;
	gchar* _tmp93_;
	gchar* _tmp94_;
	gchar* _tmp95_;
	const gchar* _tmp96_;
	gchar* _tmp97_;
	gchar* _tmp98_;
	gchar* _tmp99_;
	gchar* _tmp100_;
	gchar* _tmp101_;
	gchar* _tmp102_;
	gchar* _tmp103_;
	gchar* _tmp104_;
	BoxesInstallerMedia* _tmp105_;
	gchar* _tmp106_ = NULL;
	gchar* _tmp107_;
	gchar* _tmp108_;
	gchar* _tmp109_;
	BoxesInstallerMedia* _tmp110_;
	gchar* _tmp111_ = NULL;
	gchar* _tmp112_;
	gchar* _tmp113_;
	gchar* _tmp114_;
	gchar* _tmp115_;
	gchar* _tmp116_;
	gchar* _tmp117_;
	gchar* _tmp118_;
	gchar* _tmp119_;
	gchar* _tmp120_;
	gchar* _tmp121_;
	gchar* _tmp122_;
	gchar* _tmp123_;
	gchar* _tmp124_;
	guint16 _tmp125_;
	gchar* _tmp126_ = NULL;
	gchar* _tmp127_;
	gchar* _tmp128_;
	gchar* _tmp129_;
	gchar* _tmp130_;
	gchar* _tmp131_;
	gchar* _tmp132_;
	gchar* _tmp133_;
	gchar* _tmp134_;
	gchar* _tmp135_;
	gchar* _tmp136_;
	gchar* _tmp137_;
	gchar* _tmp138_;
	gchar* _tmp139_;
	gchar* _tmp140_;
	gchar* _tmp141_;
	gchar* _tmp142_;
	gchar* _tmp143_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (install_media != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (target_path != NULL, NULL);
	g_return_val_if_fail (resources != NULL, NULL);
	_tmp0_ = g_strdup ("utc");
	clock_offset = _tmp0_;
	_tmp2_ = install_media;
	_tmp3_ = _tmp2_->os;
	if (_tmp3_ != NULL) {
		BoxesInstallerMedia* _tmp4_;
		OsinfoOs* _tmp5_;
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		gboolean _tmp8_ = FALSE;
		_tmp4_ = install_media;
		_tmp5_ = _tmp4_->os;
		_tmp6_ = osinfo_product_get_short_id ((OsinfoProduct*) _tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = string_contains (_tmp7_, "win");
		_tmp1_ = _tmp8_;
	} else {
		_tmp1_ = FALSE;
	}
	_tmp9_ = _tmp1_;
	if (_tmp9_) {
		gchar* _tmp10_;
		_tmp10_ = g_strdup ("localtime");
		_g_free0 (clock_offset);
		clock_offset = _tmp10_;
	}
	_tmp11_ = name;
	_tmp12_ = g_strdup (_tmp11_);
	domain_name = _tmp12_;
	{
		gint i;
		i = 1;
		{
			gboolean _tmp13_;
			_tmp13_ = TRUE;
			while (TRUE) {
				gboolean _tmp14_;
				GVirConnection* _tmp16_;
				const gchar* _tmp17_;
				GVirDomain* _tmp18_ = NULL;
				GVirDomain* _tmp19_;
				gboolean _tmp20_;
				const gchar* _tmp21_;
				gchar* _tmp22_;
				gchar* _tmp23_;
				gint _tmp24_;
				gchar* _tmp25_ = NULL;
				gchar* _tmp26_;
				gchar* _tmp27_;
				_tmp14_ = _tmp13_;
				if (!_tmp14_) {
					gint _tmp15_;
					_tmp15_ = i;
					i = _tmp15_ + 1;
				}
				_tmp13_ = FALSE;
				_tmp16_ = self->priv->connection;
				_tmp17_ = domain_name;
				_tmp18_ = gvir_connection_find_domain_by_name (_tmp16_, _tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = !(_tmp19_ != NULL);
				_g_object_unref0 (_tmp19_);
				if (_tmp20_) {
					break;
				}
				_tmp21_ = name;
				_tmp22_ = g_strconcat (_tmp21_, "-", NULL);
				_tmp23_ = _tmp22_;
				_tmp24_ = i;
				_tmp25_ = g_strdup_printf ("%i", _tmp24_);
				_tmp26_ = _tmp25_;
				_tmp27_ = g_strconcat (_tmp23_, _tmp26_, NULL);
				_g_free0 (domain_name);
				domain_name = _tmp27_;
				_g_free0 (_tmp26_);
				_g_free0 (_tmp23_);
			}
		}
	}
	_tmp28_ = resources;
	_tmp29_ = osinfo_resources_get_ram (_tmp28_);
	_tmp30_ = _tmp29_;
	_tmp31_ = g_strdup_printf ("%" G_GINT64_FORMAT, _tmp30_ / OSINFO_KIBIBYTES);
	ram = _tmp31_;
	_tmp32_ = domain_name;
	_tmp33_ = g_strconcat ("<domain type='kvm'>\n" "  <name>", _tmp32_, NULL);
	_tmp34_ = _tmp33_;
	_tmp35_ = g_strconcat (_tmp34_, "</name>\n", NULL);
	_tmp36_ = _tmp35_;
	_tmp37_ = g_strconcat (_tmp36_, "  <memory>", NULL);
	_tmp38_ = _tmp37_;
	_tmp39_ = g_strconcat (_tmp38_, ram, NULL);
	_tmp40_ = _tmp39_;
	_tmp41_ = g_strconcat (_tmp40_, "</memory>\n", NULL);
	_tmp42_ = _tmp41_;
	_tmp43_ = g_strconcat (_tmp42_, "  <vcpu>", NULL);
	_tmp44_ = _tmp43_;
	_tmp45_ = resources;
	_tmp46_ = osinfo_resources_get_n_cpus (_tmp45_);
	_tmp47_ = _tmp46_;
	_tmp48_ = g_strdup_printf ("%i", _tmp47_);
	_tmp49_ = _tmp48_;
	_tmp50_ = g_strconcat (_tmp44_, _tmp49_, NULL);
	_tmp51_ = _tmp50_;
	_tmp52_ = g_strconcat (_tmp51_, "</vcpu>\n", NULL);
	_tmp53_ = _tmp52_;
	_tmp54_ = g_strconcat (_tmp53_, "  <os>\n", NULL);
	_tmp55_ = _tmp54_;
	_tmp56_ = g_strconcat (_tmp55_, "    <type arch='x86_64'>hvm</type>\n", NULL);
	_tmp57_ = _tmp56_;
	_tmp58_ = g_strconcat (_tmp57_, "    <boot dev='cdrom'/>\n", NULL);
	_tmp59_ = _tmp58_;
	_tmp60_ = g_strconcat (_tmp59_, "    <boot dev='hd'/>\n", NULL);
	_tmp61_ = _tmp60_;
	_tmp62_ = install_media;
	_tmp63_ = boxes_vm_creator_get_direct_boot_xml (self, _tmp62_);
	_tmp64_ = _tmp63_;
	_tmp65_ = g_strconcat (_tmp61_, _tmp64_, NULL);
	_tmp66_ = _tmp65_;
	_tmp67_ = g_strconcat (_tmp66_, "  </os>\n", NULL);
	_tmp68_ = _tmp67_;
	_tmp69_ = g_strconcat (_tmp68_, "  <features>\n", NULL);
	_tmp70_ = _tmp69_;
	_tmp71_ = g_strconcat (_tmp70_, "    <acpi/><apic/><pae/>\n", NULL);
	_tmp72_ = _tmp71_;
	_tmp73_ = g_strconcat (_tmp72_, "  </features>\n", NULL);
	_tmp74_ = _tmp73_;
	_tmp75_ = g_strconcat (_tmp74_, "  <clock offset='", NULL);
	_tmp76_ = _tmp75_;
	_tmp77_ = clock_offset;
	_tmp78_ = g_strconcat (_tmp76_, _tmp77_, NULL);
	_tmp79_ = _tmp78_;
	_tmp80_ = g_strconcat (_tmp79_, "'/>\n", NULL);
	_tmp81_ = _tmp80_;
	_tmp82_ = g_strconcat (_tmp81_, "  <on_poweroff>destroy</on_poweroff>\n", NULL);
	_tmp83_ = _tmp82_;
	_tmp84_ = g_strconcat (_tmp83_, "  <on_reboot>destroy</on_reboot>\n", NULL);
	_tmp85_ = _tmp84_;
	_tmp86_ = g_strconcat (_tmp85_, "  <on_crash>destroy</on_crash>\n", NULL);
	_tmp87_ = _tmp86_;
	_tmp88_ = g_strconcat (_tmp87_, "  <devices>\n", NULL);
	_tmp89_ = _tmp88_;
	_tmp90_ = g_strconcat (_tmp89_, "    <disk type='file' device='disk'>\n", NULL);
	_tmp91_ = _tmp90_;
	_tmp92_ = g_strconcat (_tmp91_, "      <driver name='qemu' type='qcow2'/>\n", NULL);
	_tmp93_ = _tmp92_;
	_tmp94_ = g_strconcat (_tmp93_, "      <source file='", NULL);
	_tmp95_ = _tmp94_;
	_tmp96_ = target_path;
	_tmp97_ = g_strconcat (_tmp95_, _tmp96_, NULL);
	_tmp98_ = _tmp97_;
	_tmp99_ = g_strconcat (_tmp98_, "'/>\n", NULL);
	_tmp100_ = _tmp99_;
	_tmp101_ = g_strconcat (_tmp100_, "      <target dev='hda' bus='ide'/>\n", NULL);
	_tmp102_ = _tmp101_;
	_tmp103_ = g_strconcat (_tmp102_, "    </disk>\n", NULL);
	_tmp104_ = _tmp103_;
	_tmp105_ = install_media;
	_tmp106_ = boxes_vm_creator_get_unattended_dir_floppy_xml (self, _tmp105_);
	_tmp107_ = _tmp106_;
	_tmp108_ = g_strconcat (_tmp104_, _tmp107_, NULL);
	_tmp109_ = _tmp108_;
	_tmp110_ = install_media;
	_tmp111_ = boxes_vm_creator_get_source_media_xml (self, _tmp110_);
	_tmp112_ = _tmp111_;
	_tmp113_ = g_strconcat (_tmp109_, _tmp112_, NULL);
	_tmp114_ = _tmp113_;
	_tmp115_ = g_strconcat (_tmp114_, "    <interface type='user'>\n", NULL);
	_tmp116_ = _tmp115_;
	_tmp117_ = g_strconcat (_tmp116_, "      <mac address='00:11:22:33:44:55'/>\n", NULL);
	_tmp118_ = _tmp117_;
	_tmp119_ = g_strconcat (_tmp118_, "    </interface>\n", NULL);
	_tmp120_ = _tmp119_;
	_tmp121_ = g_strconcat (_tmp120_, "    <input type='tablet' bus='usb'/>\n", NULL);
	_tmp122_ = _tmp121_;
	_tmp123_ = g_strconcat (_tmp122_, "    <graphics type='spice' port='", NULL);
	_tmp124_ = _tmp123_;
	_tmp125_ = self->priv->spice_port;
	_tmp126_ = g_strdup_printf ("%hu", _tmp125_);
	_tmp127_ = _tmp126_;
	_tmp128_ = g_strconcat (_tmp124_, _tmp127_, NULL);
	_tmp129_ = _tmp128_;
	_tmp130_ = g_strconcat (_tmp129_, "' />\n", NULL);
	_tmp131_ = _tmp130_;
	_tmp132_ = g_strconcat (_tmp131_, "    <console type='pty'/>\n", NULL);
	_tmp133_ = _tmp132_;
	_tmp134_ = g_strconcat (_tmp133_, "    <video>\n", NULL);
	_tmp135_ = _tmp134_;
	_tmp136_ = g_strconcat (_tmp135_, "      <model type='vga'/>\n", NULL);
	_tmp137_ = _tmp136_;
	_tmp138_ = g_strconcat (_tmp137_, "    </video>\n", NULL);
	_tmp139_ = _tmp138_;
	_tmp140_ = g_strconcat (_tmp139_, "  </devices>\n", NULL);
	_tmp141_ = _tmp140_;
	_tmp142_ = g_strconcat (_tmp141_, "</domain>", NULL);
	_tmp143_ = _tmp142_;
	_g_free0 (_tmp141_);
	_g_free0 (_tmp139_);
	_g_free0 (_tmp137_);
	_g_free0 (_tmp135_);
	_g_free0 (_tmp133_);
	_g_free0 (_tmp131_);
	_g_free0 (_tmp129_);
	_g_free0 (_tmp127_);
	_g_free0 (_tmp124_);
	_g_free0 (_tmp122_);
	_g_free0 (_tmp120_);
	_g_free0 (_tmp118_);
	_g_free0 (_tmp116_);
	_g_free0 (_tmp114_);
	_g_free0 (_tmp112_);
	_g_free0 (_tmp109_);
	_g_free0 (_tmp107_);
	_g_free0 (_tmp104_);
	_g_free0 (_tmp102_);
	_g_free0 (_tmp100_);
	_g_free0 (_tmp98_);
	_g_free0 (_tmp95_);
	_g_free0 (_tmp93_);
	_g_free0 (_tmp91_);
	_g_free0 (_tmp89_);
	_g_free0 (_tmp87_);
	_g_free0 (_tmp85_);
	_g_free0 (_tmp83_);
	_g_free0 (_tmp81_);
	_g_free0 (_tmp79_);
	_g_free0 (_tmp76_);
	_g_free0 (_tmp74_);
	_g_free0 (_tmp72_);
	_g_free0 (_tmp70_);
	_g_free0 (_tmp68_);
	_g_free0 (_tmp66_);
	_g_free0 (_tmp64_);
	_g_free0 (_tmp61_);
	_g_free0 (_tmp59_);
	_g_free0 (_tmp57_);
	_g_free0 (_tmp55_);
	_g_free0 (_tmp53_);
	_g_free0 (_tmp51_);
	_g_free0 (_tmp49_);
	_g_free0 (_tmp44_);
	_g_free0 (_tmp42_);
	_g_free0 (_tmp40_);
	_g_free0 (_tmp38_);
	_g_free0 (_tmp36_);
	_g_free0 (_tmp34_);
	result = _tmp143_;
	_g_free0 (ram);
	_g_free0 (domain_name);
	_g_free0 (clock_offset);
	return result;
}


static void boxes_vm_creator_create_target_volume_data_free (gpointer _data) {
	BoxesVmCreatorCreateTargetVolumeData* _data_;
	_data_ = _data;
	_g_free0 (_data_->name);
	_g_free0 (_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_;
	const 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 gchar* boxes_vm_creator_create_target_volume_finish (BoxesVMCreator* self, GAsyncResult* _res_, GError** error) {
	gchar* 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_->name;
	_data_->_tmp2_ = g_strconcat (_data_->_tmp1_, ".qcow2", NULL);
	_data_->volume_name = _data_->_tmp2_;
	{
		_data_->i = 1;
		{
			_data_->_tmp3_ = TRUE;
			while (TRUE) {
				_data_->_tmp4_ = _data_->_tmp3_;
				if (!_data_->_tmp4_) {
					_data_->_tmp5_ = _data_->i;
					_data_->i = _data_->_tmp5_ + 1;
				}
				_data_->_tmp3_ = FALSE;
				_data_->_tmp6_ = _data_->pool;
				_data_->_tmp7_ = _data_->volume_name;
				_data_->_tmp8_ = NULL;
				_data_->_tmp8_ = gvir_storage_pool_get_volume (_data_->_tmp6_, _data_->_tmp7_);
				_data_->_tmp9_ = _data_->_tmp8_;
				_data_->_tmp10_ = !(_data_->_tmp9_ != NULL);
				_g_object_unref0 (_data_->_tmp9_);
				if (_data_->_tmp10_) {
					break;
				}
				_data_->_tmp11_ = _data_->name;
				_data_->_tmp12_ = g_strconcat (_data_->_tmp11_, "-", NULL);
				_data_->_tmp13_ = _data_->_tmp12_;
				_data_->_tmp14_ = _data_->i;
				_data_->_tmp15_ = NULL;
				_data_->_tmp15_ = g_strdup_printf ("%i", _data_->_tmp14_);
				_data_->_tmp16_ = _data_->_tmp15_;
				_data_->_tmp17_ = g_strconcat (_data_->_tmp13_, _data_->_tmp16_, NULL);
				_data_->_tmp18_ = _data_->_tmp17_;
				_data_->_tmp19_ = g_strconcat (_data_->_tmp18_, ".qcow2", NULL);
				_g_free0 (_data_->volume_name);
				_data_->volume_name = _data_->_tmp19_;
				_g_free0 (_data_->_tmp18_);
				_g_free0 (_data_->_tmp16_);
				_g_free0 (_data_->_tmp13_);
			}
		}
	}
	_data_->_tmp20_ = _data_->storage;
	_data_->_tmp21_ = NULL;
	_data_->_tmp21_ = g_strdup_printf ("%" G_GINT64_FORMAT, _data_->_tmp20_ / OSINFO_GIBIBYTES);
	_data_->storage_str = _data_->_tmp21_;
	_data_->_tmp22_ = _data_->volume_name;
	_data_->_tmp23_ = g_strconcat ("<volume>\n" "  <name>", _data_->_tmp22_, NULL);
	_data_->_tmp24_ = _data_->_tmp23_;
	_data_->_tmp25_ = g_strconcat (_data_->_tmp24_, "</name>\n", NULL);
	_data_->_tmp26_ = _data_->_tmp25_;
	_data_->_tmp27_ = g_strconcat (_data_->_tmp26_, "  <capacity unit='G'>", NULL);
	_data_->_tmp28_ = _data_->_tmp27_;
	_data_->_tmp29_ = _data_->storage_str;
	_data_->_tmp30_ = g_strconcat (_data_->_tmp28_, _data_->_tmp29_, NULL);
	_data_->_tmp31_ = _data_->_tmp30_;
	_data_->_tmp32_ = g_strconcat (_data_->_tmp31_, "</capacity>\n", NULL);
	_data_->_tmp33_ = _data_->_tmp32_;
	_data_->_tmp34_ = g_strconcat (_data_->_tmp33_, "  <target>\n", NULL);
	_data_->_tmp35_ = _data_->_tmp34_;
	_data_->_tmp36_ = g_strconcat (_data_->_tmp35_, "    <format type='qcow2'/>\n", NULL);
	_data_->_tmp37_ = _data_->_tmp36_;
	_data_->_tmp38_ = g_strconcat (_data_->_tmp37_, "    <permissions>\n", NULL);
	_data_->_tmp39_ = _data_->_tmp38_;
	_data_->_tmp40_ = g_strconcat (_data_->_tmp39_, "      <owner>", NULL);
	_data_->_tmp41_ = _data_->_tmp40_;
	_data_->_tmp42_ = NULL;
	_data_->_tmp42_ = boxes_vm_creator_get_uid (_data_->self);
	_data_->_tmp43_ = _data_->_tmp42_;
	_data_->_tmp44_ = g_strconcat (_data_->_tmp41_, _data_->_tmp43_, NULL);
	_data_->_tmp45_ = _data_->_tmp44_;
	_data_->_tmp46_ = g_strconcat (_data_->_tmp45_, "</owner>\n", NULL);
	_data_->_tmp47_ = _data_->_tmp46_;
	_data_->_tmp48_ = g_strconcat (_data_->_tmp47_, "      <group>", NULL);
	_data_->_tmp49_ = _data_->_tmp48_;
	_data_->_tmp50_ = NULL;
	_data_->_tmp50_ = boxes_vm_creator_get_gid (_data_->self);
	_data_->_tmp51_ = _data_->_tmp50_;
	_data_->_tmp52_ = g_strconcat (_data_->_tmp49_, _data_->_tmp51_, NULL);
	_data_->_tmp53_ = _data_->_tmp52_;
	_data_->_tmp54_ = g_strconcat (_data_->_tmp53_, "</group>\n", NULL);
	_data_->_tmp55_ = _data_->_tmp54_;
	_data_->_tmp56_ = g_strconcat (_data_->_tmp55_, "      <mode>0744</mode>\n", NULL);
	_data_->_tmp57_ = _data_->_tmp56_;
	_data_->_tmp58_ = g_strconcat (_data_->_tmp57_, "      <label>virt-image-", NULL);
	_data_->_tmp59_ = _data_->_tmp58_;
	_data_->_tmp60_ = _data_->name;
	_data_->_tmp61_ = g_strconcat (_data_->_tmp59_, _data_->_tmp60_, NULL);
	_data_->_tmp62_ = _data_->_tmp61_;
	_data_->_tmp63_ = g_strconcat (_data_->_tmp62_, "</label>\n", NULL);
	_data_->_tmp64_ = _data_->_tmp63_;
	_data_->_tmp65_ = g_strconcat (_data_->_tmp64_, "    </permissions>\n", NULL);
	_data_->_tmp66_ = _data_->_tmp65_;
	_data_->_tmp67_ = g_strconcat (_data_->_tmp66_, "  </target>\n", NULL);
	_data_->_tmp68_ = _data_->_tmp67_;
	_data_->_tmp69_ = g_strconcat (_data_->_tmp68_, "</volume>", NULL);
	_data_->_tmp70_ = _data_->_tmp69_;
	_g_free0 (_data_->_tmp68_);
	_g_free0 (_data_->_tmp66_);
	_g_free0 (_data_->_tmp64_);
	_g_free0 (_data_->_tmp62_);
	_g_free0 (_data_->_tmp59_);
	_g_free0 (_data_->_tmp57_);
	_g_free0 (_data_->_tmp55_);
	_g_free0 (_data_->_tmp53_);
	_g_free0 (_data_->_tmp51_);
	_g_free0 (_data_->_tmp49_);
	_g_free0 (_data_->_tmp47_);
	_g_free0 (_data_->_tmp45_);
	_g_free0 (_data_->_tmp43_);
	_g_free0 (_data_->_tmp41_);
	_g_free0 (_data_->_tmp39_);
	_g_free0 (_data_->_tmp37_);
	_g_free0 (_data_->_tmp35_);
	_g_free0 (_data_->_tmp33_);
	_g_free0 (_data_->_tmp31_);
	_g_free0 (_data_->_tmp28_);
	_g_free0 (_data_->_tmp26_);
	_g_free0 (_data_->_tmp24_);
	_data_->xml = _data_->_tmp70_;
	_data_->_tmp71_ = _data_->xml;
	_data_->_tmp72_ = gvir_config_storage_vol_new_from_xml (_data_->_tmp71_, &_data_->_inner_error_);
	_data_->config = _data_->_tmp72_;
	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_->xml);
		_g_free0 (_data_->storage_str);
		_g_free0 (_data_->volume_name);
		_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_->_tmp73_ = _data_->pool;
	_data_->_tmp74_ = _data_->config;
	_data_->_tmp75_ = NULL;
	_data_->_tmp75_ = gvir_storage_pool_create_volume (_data_->_tmp73_, _data_->_tmp74_, &_data_->_inner_error_);
	_data_->volume = _data_->_tmp75_;
	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_free0 (_data_->xml);
		_g_free0 (_data_->storage_str);
		_g_free0 (_data_->volume_name);
		_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_->_tmp76_ = _data_->volume;
	_data_->_tmp77_ = NULL;
	_data_->_tmp77_ = gvir_storage_vol_get_path (_data_->_tmp76_);
	_data_->_tmp78_ = g_strdup (_data_->_tmp77_);
	_data_->result = _data_->_tmp78_;
	_g_object_unref0 (_data_->volume);
	_g_object_unref0 (_data_->config);
	_g_free0 (_data_->xml);
	_g_free0 (_data_->storage_str);
	_g_free0 (_data_->volume_name);
	_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_free0 (_data_->xml);
	_g_free0 (_data_->storage_str);
	_g_free0 (_data_->volume_name);
	_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 gchar* boxes_vm_creator_get_source_media_xml (BoxesVMCreator* self, BoxesInstallerMedia* install_media) {
	gchar* result = NULL;
	gchar* type = NULL;
	gchar* source_attr = NULL;
	BoxesInstallerMedia* _tmp0_;
	gboolean _tmp1_;
	const gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	const gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	BoxesInstallerMedia* _tmp22_;
	const gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (install_media != NULL, NULL);
	_tmp0_ = install_media;
	_tmp1_ = _tmp0_->from_image;
	if (_tmp1_) {
		gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp2_ = g_strdup ("file");
		_g_free0 (type);
		type = _tmp2_;
		_tmp3_ = g_strdup ("file");
		_g_free0 (source_attr);
		source_attr = _tmp3_;
	} else {
		gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = g_strdup ("block");
		_g_free0 (type);
		type = _tmp4_;
		_tmp5_ = g_strdup ("dev");
		_g_free0 (source_attr);
		source_attr = _tmp5_;
	}
	_tmp6_ = type;
	_tmp7_ = g_strconcat ("    <disk type='", _tmp6_, NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_strconcat (_tmp8_, "'\n", NULL);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_strconcat (_tmp10_, "          device='cdrom'>\n", NULL);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_strconcat (_tmp12_, "      <driver name='qemu' type='raw'/>\n", NULL);
	_tmp14_ = _tmp13_;
	_tmp15_ = g_strconcat (_tmp14_, "      <source ", NULL);
	_tmp16_ = _tmp15_;
	_tmp17_ = source_attr;
	_tmp18_ = g_strconcat (_tmp16_, _tmp17_, NULL);
	_tmp19_ = _tmp18_;
	_tmp20_ = g_strconcat (_tmp19_, "='", NULL);
	_tmp21_ = _tmp20_;
	_tmp22_ = install_media;
	_tmp23_ = _tmp22_->device_file;
	_tmp24_ = g_strconcat (_tmp21_, _tmp23_, NULL);
	_tmp25_ = _tmp24_;
	_tmp26_ = g_strconcat (_tmp25_, "'/>\n", NULL);
	_tmp27_ = _tmp26_;
	_tmp28_ = g_strconcat (_tmp27_, "      <target dev='hdc' bus='ide'/>\n", NULL);
	_tmp29_ = _tmp28_;
	_tmp30_ = g_strconcat (_tmp29_, "      <readonly/>\n", NULL);
	_tmp31_ = _tmp30_;
	_tmp32_ = g_strconcat (_tmp31_, "    </disk>\n", NULL);
	_tmp33_ = _tmp32_;
	_g_free0 (_tmp31_);
	_g_free0 (_tmp29_);
	_g_free0 (_tmp27_);
	_g_free0 (_tmp25_);
	_g_free0 (_tmp21_);
	_g_free0 (_tmp19_);
	_g_free0 (_tmp16_);
	_g_free0 (_tmp14_);
	_g_free0 (_tmp12_);
	_g_free0 (_tmp10_);
	_g_free0 (_tmp8_);
	result = _tmp33_;
	_g_free0 (source_attr);
	_g_free0 (type);
	return result;
}


static gchar* boxes_vm_creator_get_unattended_dir_floppy_xml (BoxesVMCreator* self, BoxesInstallerMedia* install_media) {
	gchar* result = NULL;
	BoxesInstallerMedia* _tmp0_;
	BoxesInstallerMedia* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* floppy_path;
	const gchar* _tmp6_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (install_media != NULL, NULL);
	_tmp0_ = install_media;
	if (!BOXES_IS_UNATTENDED_INSTALLER (_tmp0_)) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("");
		result = _tmp1_;
		return result;
	}
	_tmp2_ = install_media;
	_tmp3_ = boxes_unattended_installer_get_floppy_path (BOXES_IS_UNATTENDED_INSTALLER (_tmp2_) ? ((BoxesUnattendedInstaller*) _tmp2_) : NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strdup (_tmp4_);
	floppy_path = _tmp5_;
	_tmp6_ = floppy_path;
	if (_tmp6_ == NULL) {
		gchar* _tmp7_;
		_tmp7_ = g_strdup ("");
		result = _tmp7_;
		_g_free0 (floppy_path);
		return result;
	}
	_tmp8_ = floppy_path;
	_tmp9_ = g_strconcat ("    <disk type='file' device='floppy'>\n" "      <driver name='qemu' type='raw'/>\n" "      <source file='", _tmp8_, NULL);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_strconcat (_tmp10_, "'/>\n", NULL);
	_tmp12_ = _tmp11_;
	_tmp13_ = g_strconcat (_tmp12_, "      <target dev='fd'/>\n", NULL);
	_tmp14_ = _tmp13_;
	_tmp15_ = g_strconcat (_tmp14_, "    </disk>\n", NULL);
	_tmp16_ = _tmp15_;
	_g_free0 (_tmp14_);
	_g_free0 (_tmp12_);
	_g_free0 (_tmp10_);
	result = _tmp16_;
	_g_free0 (floppy_path);
	return result;
}


static gchar* boxes_vm_creator_get_direct_boot_xml (BoxesVMCreator* self, BoxesInstallerMedia* install_media) {
	gchar* result = NULL;
	BoxesInstallerMedia* _tmp0_;
	BoxesInstallerMedia* _tmp2_;
	BoxesUnattendedInstaller* _tmp3_;
	BoxesUnattendedInstaller* unattended;
	BoxesUnattendedInstaller* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* kernel_path;
	BoxesUnattendedInstaller* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* initrd_path;
	gboolean _tmp10_ = FALSE;
	const gchar* _tmp11_;
	gboolean _tmp13_;
	const gchar* _tmp15_;
	gchar* _tmp16_;
	gchar* _tmp17_;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	const gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (install_media != NULL, NULL);
	_tmp0_ = install_media;
	if (!BOXES_IS_UNATTENDED_INSTALLER (_tmp0_)) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("");
		result = _tmp1_;
		return result;
	}
	_tmp2_ = install_media;
	_tmp3_ = _g_object_ref0 (BOXES_IS_UNATTENDED_INSTALLER (_tmp2_) ? ((BoxesUnattendedInstaller*) _tmp2_) : NULL);
	unattended = _tmp3_;
	_tmp4_ = unattended;
	_tmp5_ = _tmp4_->kernel_path;
	_tmp6_ = g_strdup (_tmp5_);
	kernel_path = _tmp6_;
	_tmp7_ = unattended;
	_tmp8_ = _tmp7_->initrd_path;
	_tmp9_ = g_strdup (_tmp8_);
	initrd_path = _tmp9_;
	_tmp11_ = kernel_path;
	if (_tmp11_ == NULL) {
		_tmp10_ = TRUE;
	} else {
		const gchar* _tmp12_;
		_tmp12_ = initrd_path;
		_tmp10_ = _tmp12_ == NULL;
	}
	_tmp13_ = _tmp10_;
	if (_tmp13_) {
		gchar* _tmp14_;
		_tmp14_ = g_strdup ("");
		result = _tmp14_;
		_g_free0 (initrd_path);
		_g_free0 (kernel_path);
		_g_object_unref0 (unattended);
		return result;
	}
	_tmp15_ = kernel_path;
	_tmp16_ = g_strconcat ("    <kernel>", _tmp15_, NULL);
	_tmp17_ = _tmp16_;
	_tmp18_ = g_strconcat (_tmp17_, "</kernel>\n", NULL);
	_tmp19_ = _tmp18_;
	_tmp20_ = g_strconcat (_tmp19_, "    <initrd>", NULL);
	_tmp21_ = _tmp20_;
	_tmp22_ = initrd_path;
	_tmp23_ = g_strconcat (_tmp21_, _tmp22_, NULL);
	_tmp24_ = _tmp23_;
	_tmp25_ = g_strconcat (_tmp24_, "</initrd>\n", NULL);
	_tmp26_ = _tmp25_;
	_tmp27_ = g_strconcat (_tmp26_, "    <cmdline>ks=floppy</cmdline>\n", NULL);
	_tmp28_ = _tmp27_;
	_g_free0 (_tmp26_);
	_g_free0 (_tmp24_);
	_g_free0 (_tmp21_);
	_g_free0 (_tmp19_);
	_g_free0 (_tmp17_);
	result = _tmp28_;
	_g_free0 (initrd_path);
	_g_free0 (kernel_path);
	_g_object_unref0 (unattended);
	return result;
}


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;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->connection;
	_data_->_tmp1_ = NULL;
	_data_->_tmp1_ = gvir_connection_find_storage_pool_by_name (_data_->_tmp0_, PACKAGE_TARNAME);
	_data_->pool = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->pool;
	if (_data_->_tmp2_ == NULL) {
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = boxes_get_pkgconfig ("images");
		_data_->pool_path = _data_->_tmp3_;
		_data_->_tmp4_ = _data_->pool_path;
		boxes_ensure_directory (_data_->_tmp4_);
		_data_->_tmp5_ = _data_->pool_path;
		_data_->_tmp6_ = g_strconcat ("<pool type='dir'>\n" "<name>" PACKAGE_TARNAME "</name>\n" "  <source>\n" "    <directory path='", _data_->_tmp5_, NULL);
		_data_->_tmp7_ = _data_->_tmp6_;
		_data_->_tmp8_ = g_strconcat (_data_->_tmp7_, "'/>\n", NULL);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = g_strconcat (_data_->_tmp9_, "  </source>\n", NULL);
		_data_->_tmp11_ = _data_->_tmp10_;
		_data_->_tmp12_ = g_strconcat (_data_->_tmp11_, "  <target>\n", NULL);
		_data_->_tmp13_ = _data_->_tmp12_;
		_data_->_tmp14_ = g_strconcat (_data_->_tmp13_, "    <path>", NULL);
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_tmp16_ = _data_->pool_path;
		_data_->_tmp17_ = g_strconcat (_data_->_tmp15_, _data_->_tmp16_, NULL);
		_data_->_tmp18_ = _data_->_tmp17_;
		_data_->_tmp19_ = g_strconcat (_data_->_tmp18_, "</path>\n", NULL);
		_data_->_tmp20_ = _data_->_tmp19_;
		_data_->_tmp21_ = g_strconcat (_data_->_tmp20_, "    <permissions>\n", NULL);
		_data_->_tmp22_ = _data_->_tmp21_;
		_data_->_tmp23_ = g_strconcat (_data_->_tmp22_, "      <owner>", NULL);
		_data_->_tmp24_ = _data_->_tmp23_;
		_data_->_tmp25_ = NULL;
		_data_->_tmp25_ = boxes_vm_creator_get_uid (_data_->self);
		_data_->_tmp26_ = _data_->_tmp25_;
		_data_->_tmp27_ = g_strconcat (_data_->_tmp24_, _data_->_tmp26_, NULL);
		_data_->_tmp28_ = _data_->_tmp27_;
		_data_->_tmp29_ = g_strconcat (_data_->_tmp28_, "</owner>\n", NULL);
		_data_->_tmp30_ = _data_->_tmp29_;
		_data_->_tmp31_ = g_strconcat (_data_->_tmp30_, "      <group>", NULL);
		_data_->_tmp32_ = _data_->_tmp31_;
		_data_->_tmp33_ = NULL;
		_data_->_tmp33_ = boxes_vm_creator_get_gid (_data_->self);
		_data_->_tmp34_ = _data_->_tmp33_;
		_data_->_tmp35_ = g_strconcat (_data_->_tmp32_, _data_->_tmp34_, NULL);
		_data_->_tmp36_ = _data_->_tmp35_;
		_data_->_tmp37_ = g_strconcat (_data_->_tmp36_, "</group>\n", NULL);
		_data_->_tmp38_ = _data_->_tmp37_;
		_data_->_tmp39_ = g_strconcat (_data_->_tmp38_, "      <mode>0744</mode>\n", NULL);
		_data_->_tmp40_ = _data_->_tmp39_;
		_data_->_tmp41_ = g_strconcat (_data_->_tmp40_, "      <label>", NULL);
		_data_->_tmp42_ = _data_->_tmp41_;
		_data_->_tmp43_ = g_strconcat (_data_->_tmp42_, PACKAGE_TARNAME, NULL);
		_data_->_tmp44_ = _data_->_tmp43_;
		_data_->_tmp45_ = g_strconcat (_data_->_tmp44_, "</label>\n", NULL);
		_data_->_tmp46_ = _data_->_tmp45_;
		_data_->_tmp47_ = g_strconcat (_data_->_tmp46_, "    </permissions>\n", NULL);
		_data_->_tmp48_ = _data_->_tmp47_;
		_data_->_tmp49_ = g_strconcat (_data_->_tmp48_, "  </target>\n", NULL);
		_data_->_tmp50_ = _data_->_tmp49_;
		_data_->_tmp51_ = g_strconcat (_data_->_tmp50_, "</pool>", NULL);
		_data_->_tmp52_ = _data_->_tmp51_;
		_g_free0 (_data_->_tmp50_);
		_g_free0 (_data_->_tmp48_);
		_g_free0 (_data_->_tmp46_);
		_g_free0 (_data_->_tmp44_);
		_g_free0 (_data_->_tmp42_);
		_g_free0 (_data_->_tmp40_);
		_g_free0 (_data_->_tmp38_);
		_g_free0 (_data_->_tmp36_);
		_g_free0 (_data_->_tmp34_);
		_g_free0 (_data_->_tmp32_);
		_g_free0 (_data_->_tmp30_);
		_g_free0 (_data_->_tmp28_);
		_g_free0 (_data_->_tmp26_);
		_g_free0 (_data_->_tmp24_);
		_g_free0 (_data_->_tmp22_);
		_g_free0 (_data_->_tmp20_);
		_g_free0 (_data_->_tmp18_);
		_g_free0 (_data_->_tmp15_);
		_g_free0 (_data_->_tmp13_);
		_g_free0 (_data_->_tmp11_);
		_g_free0 (_data_->_tmp9_);
		_g_free0 (_data_->_tmp7_);
		_data_->xml = _data_->_tmp52_;
		_data_->_tmp53_ = _data_->xml;
		_data_->_tmp54_ = gvir_config_storage_pool_new_from_xml (_data_->_tmp53_, &_data_->_inner_error_);
		_data_->config = _data_->_tmp54_;
		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_->xml);
			_g_free0 (_data_->pool_path);
			_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_->_tmp55_ = _data_->self->priv->connection;
		_data_->_tmp56_ = _data_->config;
		_data_->_tmp57_ = NULL;
		_data_->_tmp57_ = gvir_connection_create_storage_pool (_data_->_tmp55_, _data_->_tmp56_, (guint64) 0, &_data_->_inner_error_);
		_data_->_tmp58_ = _data_->_tmp57_;
		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_free0 (_data_->xml);
			_g_free0 (_data_->pool_path);
			_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_->_tmp58_;
		_data_->_tmp59_ = _data_->pool;
		_data_->_state_ = 1;
		gvir_storage_pool_build_async (_data_->_tmp59_, (guint64) 0, NULL, boxes_vm_creator_get_storage_pool_ready, _data_);
		return FALSE;
		_state_1:
		gvir_storage_pool_build_finish (_data_->_tmp59_, _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_free0 (_data_->xml);
			_g_free0 (_data_->pool_path);
			_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_->_tmp60_ = _data_->pool;
		_data_->_state_ = 2;
		gvir_storage_pool_start_async (_data_->_tmp60_, (guint64) 0, NULL, boxes_vm_creator_get_storage_pool_ready, _data_);
		return FALSE;
		_state_2:
		gvir_storage_pool_start_finish (_data_->_tmp60_, _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_free0 (_data_->xml);
			_g_free0 (_data_->pool_path);
			_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);
		_g_free0 (_data_->xml);
		_g_free0 (_data_->pool_path);
	}
	_data_->_tmp61_ = _data_->pool;
	gvir_storage_pool_refresh (_data_->_tmp61_, NULL, &_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_->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_->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 gchar* boxes_vm_creator_get_uid (BoxesVMCreator* self) {
	gchar* result = NULL;
	uid_t _tmp0_ = {0};
	gchar* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = getuid ();
	_tmp1_ = g_strdup_printf ("%u", (guint32) _tmp0_);
	result = _tmp1_;
	return result;
}


static gchar* boxes_vm_creator_get_gid (BoxesVMCreator* self) {
	gchar* result = NULL;
	gid_t _tmp0_ = {0};
	gchar* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = getgid ();
	_tmp1_ = g_strdup_printf ("%u", (guint32) _tmp0_);
	result = _tmp1_;
	return result;
}


static inline GRegex* _thread_safe_regex_init (GRegex** re, const gchar * pattern, GRegexMatchFlags match_options) {
	if (g_once_init_enter ((volatile gsize*) re)) {
		GRegex* val = g_regex_new (pattern, match_options, 0, NULL);
		g_once_init_leave ((volatile gsize*) re, (gsize) val);
	}
	return *re;
}


static gpointer _g_regex_ref0 (gpointer self) {
	return self ? g_regex_ref (self) : NULL;
}


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) {
	GRegex* _tmp0_;
	GRegex* _tmp1_;
	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));
	_tmp0_ = _g_regex_ref0 (_thread_safe_regex_init (&_tmp_regex_0, "<kernel>.*<\\/cmdline>", 0 | G_REGEX_MULTILINE | G_REGEX_DOTALL | G_REGEX_EXTENDED));
	_g_regex_unref0 (boxes_vm_creator_direct_boot_regex);
	boxes_vm_creator_direct_boot_regex = _tmp0_;
	_tmp1_ = _g_regex_ref0 (_thread_safe_regex_init (&_tmp_regex_1, "<boot.*dev=.cdrom.\\/>", 0 | G_REGEX_MULTILINE | G_REGEX_DOTALL | G_REGEX_EXTENDED));
	_g_regex_unref0 (boxes_vm_creator_cdrom_boot_regex);
	boxes_vm_creator_cdrom_boot_regex = _tmp1_;
}


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


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



