/* libvirt-machine.c generated by valac 0.17.7, the Vala compiler
 * generated from libvirt-machine.vala, do not modify */

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

#include <glib.h>
#include <glib-object.h>
#include <clutter/clutter.h>
#include <gio/gio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <libcommon.h>
#include <libvirt-gobject/libvirt-gobject.h>
#include <libvirt-gconfig/libvirt-gconfig.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <clutter-gtk/clutter-gtk.h>
#include <osinfo/osinfo.h>


#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;
typedef struct _BoxesUIPrivate BoxesUIPrivate;

#define BOXES_TYPE_UI_STATE (boxes_ui_state_get_type ())

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

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

typedef struct _BoxesIPropertiesProvider BoxesIPropertiesProvider;
typedef struct _BoxesIPropertiesProviderIface BoxesIPropertiesProviderIface;

#define BOXES_TYPE_PROPERTIES_PAGE (boxes_properties_page_get_type ())

#define BOXES_TYPE_PROPERTY (boxes_property_get_type ())
#define BOXES_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_PROPERTY, BoxesProperty))
#define BOXES_PROPERTY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_PROPERTY, BoxesPropertyClass))
#define BOXES_IS_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_PROPERTY))
#define BOXES_IS_PROPERTY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_PROPERTY))
#define BOXES_PROPERTY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_PROPERTY, BoxesPropertyClass))

typedef struct _BoxesProperty BoxesProperty;
typedef struct _BoxesPropertyClass BoxesPropertyClass;

#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;
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_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 _BoxesLibvirtMachinePrivate BoxesLibvirtMachinePrivate;

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

typedef struct _BoxesVMCreator BoxesVMCreator;
typedef struct _BoxesVMCreatorClass BoxesVMCreatorClass;

#define BOXES_LIBVIRT_MACHINE_TYPE_MACHINE_STAT (boxes_libvirt_machine_machine_stat_get_type ())
typedef struct _BoxesLibvirtMachineMachineStat BoxesLibvirtMachineMachineStat;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _boxes_vm_creator_unref0(var) ((var == NULL) ? NULL : (var = (boxes_vm_creator_unref (var), NULL)))

#define BOXES_TYPE_DISPLAY (boxes_display_get_type ())
#define BOXES_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_DISPLAY, BoxesDisplay))
#define BOXES_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_DISPLAY, BoxesDisplayClass))
#define BOXES_IS_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_DISPLAY))
#define BOXES_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_DISPLAY))
#define BOXES_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_DISPLAY, BoxesDisplayClass))

typedef struct _BoxesDisplay BoxesDisplay;
typedef struct _BoxesDisplayClass BoxesDisplayClass;
typedef struct _BoxesLibvirtMachineConnectDisplayData BoxesLibvirtMachineConnectDisplayData;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block13Data Block13Data;
#define _g_free0(var) (var = (g_free (var), NULL))
#define __vala_GVirDomainInfo_free0(var) ((var == NULL) ? NULL : (var = (_vala_GVirDomainInfo_free (var), NULL)))

#define BOXES_MACHINE_TYPE_MACHINE_STATE (boxes_machine_machine_state_get_type ())
typedef struct _Block14Data Block14Data;
typedef struct _Block15Data Block15Data;
#define __vala_GVirDomainDiskStats_free0(var) ((var == NULL) ? NULL : (var = (_vala_GVirDomainDiskStats_free (var), NULL)))
typedef struct _BoxesLibvirtMachineUpdateIoStatData BoxesLibvirtMachineUpdateIoStatData;
typedef struct _Block16Data Block16Data;
typedef struct _Block17Data Block17Data;
#define __vala_GVirDomainInterfaceStats_free0(var) ((var == NULL) ? NULL : (var = (_vala_GVirDomainInterfaceStats_free (var), NULL)))
typedef struct _BoxesLibvirtMachineUpdateNetStatData BoxesLibvirtMachineUpdateNetStatData;
typedef struct _BoxesLibvirtMachineUpdateStatsData BoxesLibvirtMachineUpdateStatsData;
typedef struct _Block18Data Block18Data;
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))

#define BOXES_TYPE_SPICE_DISPLAY (boxes_spice_display_get_type ())
#define BOXES_SPICE_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SPICE_DISPLAY, BoxesSpiceDisplay))
#define BOXES_SPICE_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SPICE_DISPLAY, BoxesSpiceDisplayClass))
#define BOXES_IS_SPICE_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SPICE_DISPLAY))
#define BOXES_IS_SPICE_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SPICE_DISPLAY))
#define BOXES_SPICE_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SPICE_DISPLAY, BoxesSpiceDisplayClass))

typedef struct _BoxesSpiceDisplay BoxesSpiceDisplay;
typedef struct _BoxesSpiceDisplayClass BoxesSpiceDisplayClass;

#define BOXES_TYPE_VNC_DISPLAY (boxes_vnc_display_get_type ())
#define BOXES_VNC_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_VNC_DISPLAY, BoxesVncDisplay))
#define BOXES_VNC_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_VNC_DISPLAY, BoxesVncDisplayClass))
#define BOXES_IS_VNC_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_VNC_DISPLAY))
#define BOXES_IS_VNC_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_VNC_DISPLAY))
#define BOXES_VNC_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_VNC_DISPLAY, BoxesVncDisplayClass))

typedef struct _BoxesVncDisplay BoxesVncDisplay;
typedef struct _BoxesVncDisplayClass BoxesVncDisplayClass;
typedef struct _Block19Data Block19Data;
typedef struct _BoxesLibvirtMachineTakeScreenshotData BoxesLibvirtMachineTakeScreenshotData;
typedef struct _Block20Data Block20Data;
typedef struct _BoxesLibvirtMachineSuspendData BoxesLibvirtMachineSuspendData;

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

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

#define BOXES_TYPE_SEARCHBAR (boxes_searchbar_get_type ())
#define BOXES_SEARCHBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_SEARCHBAR, BoxesSearchbar))
#define BOXES_SEARCHBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_SEARCHBAR, BoxesSearchbarClass))
#define BOXES_IS_SEARCHBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_SEARCHBAR))
#define BOXES_IS_SEARCHBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_SEARCHBAR))
#define BOXES_SEARCHBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_SEARCHBAR, BoxesSearchbarClass))

typedef struct _BoxesSearchbar BoxesSearchbar;
typedef struct _BoxesSearchbarClass BoxesSearchbarClass;

#define BOXES_TYPE_TOPBAR (boxes_topbar_get_type ())
#define BOXES_TOPBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TOPBAR, BoxesTopbar))
#define BOXES_TOPBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TOPBAR, BoxesTopbarClass))
#define BOXES_IS_TOPBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TOPBAR))
#define BOXES_IS_TOPBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TOPBAR))
#define BOXES_TOPBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TOPBAR, BoxesTopbarClass))

typedef struct _BoxesTopbar BoxesTopbar;
typedef struct _BoxesTopbarClass BoxesTopbarClass;

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

typedef struct _BoxesNotificationbar BoxesNotificationbar;
typedef struct _BoxesNotificationbarClass BoxesNotificationbarClass;

#define BOXES_TYPE_REVEALER (boxes_revealer_get_type ())
#define BOXES_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_REVEALER, BoxesRevealer))
#define BOXES_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_REVEALER, BoxesRevealerClass))
#define BOXES_IS_REVEALER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_REVEALER))
#define BOXES_IS_REVEALER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_REVEALER))
#define BOXES_REVEALER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_REVEALER, BoxesRevealerClass))

typedef struct _BoxesRevealer BoxesRevealer;
typedef struct _BoxesRevealerClass BoxesRevealerClass;

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

typedef struct _BoxesSidebar BoxesSidebar;
typedef struct _BoxesSidebarClass BoxesSidebarClass;

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

typedef struct _BoxesSelectionbar BoxesSelectionbar;
typedef struct _BoxesSelectionbarClass BoxesSelectionbarClass;

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

typedef struct _BoxesWizard BoxesWizard;
typedef struct _BoxesWizardClass BoxesWizardClass;

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

typedef struct _BoxesProperties BoxesProperties;
typedef struct _BoxesPropertiesClass BoxesPropertiesClass;

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

typedef struct _BoxesDisplayPage BoxesDisplayPage;
typedef struct _BoxesDisplayPageClass BoxesDisplayPageClass;

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

typedef struct _BoxesCollection BoxesCollection;
typedef struct _BoxesCollectionClass BoxesCollectionClass;

#define BOXES_TYPE_COLLECTION_FILTER (boxes_collection_filter_get_type ())
#define BOXES_COLLECTION_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_FILTER, BoxesCollectionFilter))
#define BOXES_COLLECTION_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_FILTER, BoxesCollectionFilterClass))
#define BOXES_IS_COLLECTION_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_FILTER))
#define BOXES_IS_COLLECTION_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_FILTER))
#define BOXES_COLLECTION_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_FILTER, BoxesCollectionFilterClass))

typedef struct _BoxesCollectionFilter BoxesCollectionFilter;
typedef struct _BoxesCollectionFilterClass BoxesCollectionFilterClass;

#define BOXES_TYPE_COLLECTION_VIEW (boxes_collection_view_get_type ())
#define BOXES_COLLECTION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_COLLECTION_VIEW, BoxesCollectionView))
#define BOXES_COLLECTION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_COLLECTION_VIEW, BoxesCollectionViewClass))
#define BOXES_IS_COLLECTION_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_COLLECTION_VIEW))
#define BOXES_IS_COLLECTION_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_COLLECTION_VIEW))
#define BOXES_COLLECTION_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_COLLECTION_VIEW, BoxesCollectionViewClass))

typedef struct _BoxesCollectionView BoxesCollectionView;
typedef struct _BoxesCollectionViewClass BoxesCollectionViewClass;
typedef struct _Block21Data Block21Data;
#define __vala_GVirNodeInfo_free0(var) ((var == NULL) ? NULL : (var = (_vala_GVirNodeInfo_free (var), NULL)))
typedef struct _Block22Data Block22Data;
typedef struct _BoxesLibvirtMachineStartData BoxesLibvirtMachineStartData;
typedef struct _Block23Data Block23Data;
#define __vala_GVirStorageVolInfo_free0(var) ((var == NULL) ? NULL : (var = (_vala_GVirStorageVolInfo_free (var), NULL)))
#define __vala_GVirStoragePoolInfo_free0(var) ((var == NULL) ? NULL : (var = (_vala_GVirStoragePoolInfo_free (var), NULL)))
typedef struct _Block24Data Block24Data;

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 _BoxesCollectionItem {
	BoxesUI parent_instance;
	BoxesCollectionItemPrivate * priv;
};

struct _BoxesCollectionItemClass {
	BoxesUIClass parent_class;
};

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

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

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

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

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

struct _BoxesLibvirtMachineClass {
	BoxesMachineClass parent_class;
};

struct _BoxesLibvirtMachineMachineStat {
	gint64 timestamp;
	gdouble cpu_time;
	gdouble cpu_time_abs;
	gdouble cpu_guest_percent;
	gdouble memory_percent;
	GVirDomainDiskStats* disk;
	gdouble disk_read;
	gdouble disk_write;
	GVirDomainInterfaceStats* net;
	gdouble net_read;
	gdouble net_write;
};

struct _BoxesLibvirtMachinePrivate {
	guint stats_update_timeout;
	GCancellable* stats_cancellable;
	BoxesLibvirtMachineMachineStat* stats;
	gint stats_length1;
	gint _stats_size_;
};

struct _BoxesLibvirtMachineConnectDisplayData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesLibvirtMachine* self;
	BoxesDisplay* _tmp0_;
	BoxesDisplay* _tmp1_;
	GError * _inner_error_;
};

struct _Block13Data {
	int _ref_count_;
	BoxesLibvirtMachine * self;
	GVirDomain* domain;
};

typedef enum  {
	BOXES_MACHINE_MACHINE_STATE_UNKNOWN,
	BOXES_MACHINE_MACHINE_STATE_STOPPED,
	BOXES_MACHINE_MACHINE_STATE_RUNNING,
	BOXES_MACHINE_MACHINE_STATE_PAUSED,
	BOXES_MACHINE_MACHINE_STATE_SAVED
} BoxesMachineMachineState;

struct _Block14Data {
	int _ref_count_;
	BoxesLibvirtMachine * self;
	BoxesLibvirtMachineMachineStat* stat;
	gpointer _async_data_;
};

struct _Block15Data {
	int _ref_count_;
	Block14Data * _data14_;
	GVirDomainDisk* disk;
};

struct _BoxesLibvirtMachineUpdateIoStatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesLibvirtMachine* self;
	GVirDomainInfo* info;
	BoxesLibvirtMachineMachineStat* stat;
	Block14Data* _data14_;
	BoxesLibvirtMachineMachineStat* _tmp0_;
	GVirDomainInfo* _tmp1_;
	GVirDomainState _tmp2_;
	Block15Data* _data15_;
	GVirDomainDisk* _tmp3_;
	GVirDomainDisk* _tmp4_;
	BoxesLibvirtMachineMachineStat* _tmp5_;
	gint _tmp5__length1;
	BoxesLibvirtMachineMachineStat _tmp6_;
	BoxesLibvirtMachineMachineStat _tmp7_;
	BoxesLibvirtMachineMachineStat prev;
	BoxesLibvirtMachineMachineStat _tmp8_;
	GVirDomainDiskStats* _tmp9_;
	BoxesLibvirtMachineMachineStat* _tmp10_;
	BoxesLibvirtMachineMachineStat* _tmp11_;
	GVirDomainDiskStats* _tmp12_;
	gint64 _tmp13_;
	BoxesLibvirtMachineMachineStat _tmp14_;
	GVirDomainDiskStats* _tmp15_;
	gint64 _tmp16_;
	BoxesLibvirtMachineMachineStat* _tmp17_;
	BoxesLibvirtMachineMachineStat* _tmp18_;
	GVirDomainDiskStats* _tmp19_;
	gint64 _tmp20_;
	BoxesLibvirtMachineMachineStat _tmp21_;
	GVirDomainDiskStats* _tmp22_;
	gint64 _tmp23_;
	GError* err;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	GError* _tmp26_;
	const gchar* _tmp27_;
	GError * _inner_error_;
};

struct _Block16Data {
	int _ref_count_;
	BoxesLibvirtMachine * self;
	BoxesLibvirtMachineMachineStat* stat;
	gpointer _async_data_;
};

struct _Block17Data {
	int _ref_count_;
	Block16Data * _data16_;
	GVirDomainInterface* net;
};

struct _BoxesLibvirtMachineUpdateNetStatData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesLibvirtMachine* self;
	GVirDomainInfo* info;
	BoxesLibvirtMachineMachineStat* stat;
	Block16Data* _data16_;
	BoxesLibvirtMachineMachineStat* _tmp0_;
	GVirDomainInfo* _tmp1_;
	GVirDomainState _tmp2_;
	Block17Data* _data17_;
	GVirDomainInterface* _tmp3_;
	GVirDomainInterface* _tmp4_;
	BoxesLibvirtMachineMachineStat* _tmp5_;
	gint _tmp5__length1;
	BoxesLibvirtMachineMachineStat _tmp6_;
	BoxesLibvirtMachineMachineStat _tmp7_;
	BoxesLibvirtMachineMachineStat prev;
	BoxesLibvirtMachineMachineStat _tmp8_;
	GVirDomainInterfaceStats* _tmp9_;
	BoxesLibvirtMachineMachineStat* _tmp10_;
	BoxesLibvirtMachineMachineStat* _tmp11_;
	GVirDomainInterfaceStats* _tmp12_;
	gint64 _tmp13_;
	BoxesLibvirtMachineMachineStat _tmp14_;
	GVirDomainInterfaceStats* _tmp15_;
	gint64 _tmp16_;
	BoxesLibvirtMachineMachineStat* _tmp17_;
	BoxesLibvirtMachineMachineStat* _tmp18_;
	GVirDomainInterfaceStats* _tmp19_;
	gint64 _tmp20_;
	BoxesLibvirtMachineMachineStat _tmp21_;
	GVirDomainInterfaceStats* _tmp22_;
	gint64 _tmp23_;
	GError* err;
	const gchar* _tmp24_;
	const gchar* _tmp25_;
	GError* _tmp26_;
	const gchar* _tmp27_;
	GError * _inner_error_;
};

struct _BoxesLibvirtMachineUpdateStatsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesLibvirtMachine* self;
	gint64 _tmp0_;
	gint64 now;
	gint64 _tmp1_;
	BoxesLibvirtMachineMachineStat _tmp2_;
	BoxesLibvirtMachineMachineStat stat;
	GVirDomain* _tmp3_;
	GCancellable* _tmp4_;
	GVirDomainInfo* _tmp5_;
	GVirDomainInfo* info;
	GVirDomainInfo* _tmp6_;
	GVirDomainInfo* _tmp7_;
	GVirDomainInfo* _tmp8_;
	GVirDomainInfo* _tmp9_;
	BoxesLibvirtMachineMachineStat* _tmp10_;
	gint _tmp10__length1;
	BoxesLibvirtMachineMachineStat* _tmp11_;
	gint _tmp11__length1;
	BoxesLibvirtMachineMachineStat* _tmp12_;
	gint _tmp12__length1;
	BoxesLibvirtMachineMachineStat _tmp13_;
	BoxesLibvirtMachineMachineStat _tmp14_;
	GError* err;
	GError* _vala1_err;
	GError* _tmp15_;
	const gchar* _tmp16_;
	gdouble* _tmp17_;
	gdouble* _tmp18_;
	gdouble* _tmp19_;
	BoxesLibvirtMachineMachineStat* _tmp20_;
	gint _tmp20__length1;
	BoxesLibvirtMachineMachineStat* stat_collection;
	gint stat_collection_length1;
	gint _stat_collection_size_;
	gint stat_it;
	BoxesLibvirtMachineMachineStat _tmp21_;
	BoxesLibvirtMachineMachineStat _vala1_stat;
	gdouble* _tmp22_;
	gint _tmp22__length1;
	BoxesLibvirtMachineMachineStat _tmp23_;
	gdouble _tmp24_;
	gdouble* _tmp25_;
	gint _tmp25__length1;
	BoxesLibvirtMachineMachineStat _tmp26_;
	gdouble _tmp27_;
	BoxesLibvirtMachineMachineStat _tmp28_;
	gdouble _tmp29_;
	gdouble* _tmp30_;
	gint _tmp30__length1;
	BoxesLibvirtMachineMachineStat _tmp31_;
	gdouble _tmp32_;
	BoxesLibvirtMachineMachineStat _tmp33_;
	gdouble _tmp34_;
	GError * _inner_error_;
};

struct _Block18Data {
	int _ref_count_;
	BoxesLibvirtMachine * self;
	gboolean stats_updating;
};

typedef void (*PropertyStringChanged) (BoxesProperty* property, const gchar* value, void* user_data, GError** error);
struct _Block19Data {
	int _ref_count_;
	BoxesLibvirtMachine * self;
	GVirStream* stream;
	gpointer _async_data_;
};

struct _BoxesLibvirtMachineTakeScreenshotData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesLibvirtMachine* self;
	GdkPixbuf* result;
	Block19Data* _data19_;
	GVirDomainState state;
	GVirDomain* _tmp0_;
	GVirDomainInfo* _tmp1_;
	GVirDomainInfo* _tmp2_;
	GVirDomainInfo* _tmp3_;
	GVirDomainState _tmp4_;
	GError* _error_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	gboolean _tmp7_;
	GVirDomainState _tmp8_;
	GVirDomainState _tmp9_;
	gboolean _tmp10_;
	GVirConnection* _tmp11_;
	GVirStream* _tmp12_;
	GdkPixbufLoader* _tmp13_;
	GdkPixbufLoader* loader;
	GVirStream* _tmp14_;
	GInputStream* _tmp15_;
	GInputStream* _tmp16_;
	GInputStream* input_stream;
	guint8* _tmp17_;
	guint8* buffer;
	gint buffer_length1;
	gint _buffer_size_;
	gssize length;
	gboolean _tmp18_;
	gboolean _tmp19_;
	gssize _tmp20_;
	GInputStream* _tmp21_;
	guint8* _tmp22_;
	gint _tmp22__length1;
	gssize _tmp23_;
	gssize _tmp24_;
	GdkPixbufLoader* _tmp25_;
	guint8* _tmp26_;
	gint _tmp26__length1;
	gssize _tmp27_;
	GdkPixbufLoader* _tmp28_;
	GdkPixbufLoader* _tmp29_;
	GdkPixbuf* _tmp30_;
	GdkPixbuf* _tmp31_;
	GError * _inner_error_;
};

struct _Block20Data {
	int _ref_count_;
	BoxesLibvirtMachine * self;
	GVirDomain* domain;
};

struct _BoxesLibvirtMachineSuspendData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesLibvirtMachine* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GVirDomain* _tmp3_;
	gboolean _tmp4_;
	GVirDomain* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	GError * _inner_error_;
};

struct _BoxesApp {
	BoxesUI parent_instance;
	BoxesAppPrivate * priv;
	GtkApplicationWindow* window;
	GtkNotebook* notebook;
	GtkClutterEmbed* embed;
	ClutterStage* stage;
	ClutterBinLayout* stage_bin;
	ClutterActor* overlay_bin_actor;
	ClutterBinLayout* overlay_bin;
	BoxesCollectionItem* current_item;
	BoxesSearchbar* searchbar;
	BoxesTopbar* topbar;
	BoxesNotificationbar* notificationbar;
	BoxesRevealer* sidebar_revealer;
	BoxesRevealer* searchbar_revealer;
	BoxesSidebar* sidebar;
	BoxesSelectionbar* selectionbar;
	guint duration;
	GSettings* settings;
	BoxesWizard* wizard;
	BoxesProperties* properties;
	BoxesDisplayPage* display_page;
	BoxesCollection* collection;
	BoxesCollectionFilter* filter;
	GSimpleAction* action_properties;
	GSimpleAction* action_fullscreen;
	GSimpleAction* action_shutdown;
	BoxesCollectionView* view;
};

struct _BoxesAppClass {
	BoxesUIClass parent_class;
};

struct _Block21Data {
	int _ref_count_;
	BoxesLibvirtMachine * self;
	BoxesProperty* property;
};

typedef void (*PropertySizeChanged) (BoxesProperty* property, guint64 value, void* user_data, GError** error);
struct _Block22Data {
	int _ref_count_;
	BoxesLibvirtMachine * self;
	BoxesProperty* property;
	guint64 value;
};

struct _BoxesLibvirtMachineStartData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	BoxesLibvirtMachine* self;
	BoxesMachineMachineState _tmp0_;
	BoxesMachineMachineState _tmp1_;
	BoxesMachineMachineState _tmp2_;
	BoxesMachineMachineState _tmp3_;
	GVirDomain* _tmp4_;
	GVirDomain* _tmp5_;
	gboolean _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	GVirDomain* _tmp17_;
	GError * _inner_error_;
};

struct _Block23Data {
	int _ref_count_;
	BoxesLibvirtMachine * self;
	gulong state_id;
};

typedef void (*BoxesNotificationbarOKFunc) (void* user_data);
typedef void (*BoxesNotificationbarCancelFunc) (void* user_data);
struct _Block24Data {
	int _ref_count_;
	BoxesLibvirtMachine * self;
	guint64 value;
};


static gpointer boxes_libvirt_machine_parent_class = NULL;
extern BoxesApp* boxes_app_app;

GType boxes_ui_get_type (void) G_GNUC_CONST;
GType boxes_ui_state_get_type (void) G_GNUC_CONST;
GType boxes_collection_item_get_type (void) G_GNUC_CONST;
GType boxes_properties_page_get_type (void) G_GNUC_CONST;
GType boxes_property_get_type (void) G_GNUC_CONST;
GType boxes_iproperties_provider_get_type (void) G_GNUC_CONST;
GType boxes_machine_get_type (void) G_GNUC_CONST;
GType boxes_machine_actor_get_type (void) G_GNUC_CONST;
GType boxes_libvirt_machine_get_type (void) G_GNUC_CONST;
gpointer boxes_vm_creator_ref (gpointer instance);
void boxes_vm_creator_unref (gpointer instance);
GParamSpec* boxes_param_spec_vm_creator (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void boxes_value_set_vm_creator (GValue* value, gpointer v_object);
void boxes_value_take_vm_creator (GValue* value, gpointer v_object);
gpointer boxes_value_get_vm_creator (const GValue* value);
GType boxes_vm_creator_get_type (void) G_GNUC_CONST;
static GType boxes_libvirt_machine_machine_stat_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static BoxesLibvirtMachineMachineStat* boxes_libvirt_machine_machine_stat_dup (const BoxesLibvirtMachineMachineStat* self);
static void boxes_libvirt_machine_machine_stat_free (BoxesLibvirtMachineMachineStat* self);
static void boxes_libvirt_machine_machine_stat_copy (const BoxesLibvirtMachineMachineStat* self, BoxesLibvirtMachineMachineStat* dest);
static void boxes_libvirt_machine_machine_stat_destroy (BoxesLibvirtMachineMachineStat* self);
#define BOXES_LIBVIRT_MACHINE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachinePrivate))
enum  {
	BOXES_LIBVIRT_MACHINE_DUMMY_PROPERTY,
	BOXES_LIBVIRT_MACHINE_SAVE_ON_QUIT
};
static void _vala_BoxesLibvirtMachineMachineStat_array_free (BoxesLibvirtMachineMachineStat* array, gint array_length);
#define BOXES_LIBVIRT_MACHINE_STATS_SIZE 20
static void boxes_libvirt_machine_real_disconnect_display (BoxesMachine* base);
void boxes_machine_disconnect_display (BoxesMachine* self);
static void boxes_libvirt_machine_real_connect_display_data_free (gpointer _data);
static void boxes_libvirt_machine_real_connect_display (BoxesMachine* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean boxes_libvirt_machine_real_connect_display_co (BoxesLibvirtMachineConnectDisplayData* _data_);
static void boxes_libvirt_machine_start (BoxesLibvirtMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void boxes_libvirt_machine_start_finish (BoxesLibvirtMachine* self, GAsyncResult* _res_, GError** error);
static void boxes_libvirt_machine_connect_display_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_libvirt_machine_update_display (BoxesLibvirtMachine* self, GError** error);
GType boxes_display_get_type (void) G_GNUC_CONST;
BoxesDisplay* boxes_machine_get_display (BoxesMachine* self);
void boxes_display_connect_it (BoxesDisplay* self, GError** error);
static void boxes_libvirt_machine_update_domain_config (BoxesLibvirtMachine* self);
GVirStorageVol* boxes_get_storage_volume (GVirConnection* connection, GVirDomain* domain);
static void boxes_libvirt_machine_reconnect_display (BoxesLibvirtMachine* self);
void boxes_machine_connect_display (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_machine_connect_display_finish (BoxesMachine* self, GAsyncResult* _res_, GError** error);
BoxesLibvirtMachine* boxes_libvirt_machine_new (BoxesCollectionSource* source, GVirConnection* connection, GVirDomain* domain, GError** error);
BoxesLibvirtMachine* boxes_libvirt_machine_construct (GType object_type, BoxesCollectionSource* source, GVirConnection* connection, GVirDomain* domain, GError** error);
static Block13Data* block13_data_ref (Block13Data* _data13_);
static void block13_data_unref (void * _userdata_);
BoxesMachine* boxes_machine_construct (GType object_type, BoxesCollectionSource* source, const gchar* name);
void boxes_machine_create_display_config (BoxesMachine* self, const gchar* uuid);
static void _vala_GVirDomainInfo_free (GVirDomainInfo* self);
GType boxes_machine_machine_state_get_type (void) G_GNUC_CONST;
void boxes_machine_set_state (BoxesMachine* self, BoxesMachineMachineState value);
static void __lambda70_ (BoxesLibvirtMachine* self);
static void ___lambda70__gvir_domain_started (GVirDomain* _sender, gpointer self);
static void __lambda71_ (BoxesLibvirtMachine* self);
static void ___lambda71__gvir_domain_suspended (GVirDomain* _sender, gpointer self);
static void __lambda72_ (BoxesLibvirtMachine* self);
static void ___lambda72__gvir_domain_resumed (GVirDomain* _sender, gpointer self);
static void __lambda73_ (Block13Data* _data13_);
static void ___lambda73__gvir_domain_stopped (GVirDomain* _sender, gpointer self);
static void __lambda74_ (BoxesLibvirtMachine* self);
BoxesMachineMachineState boxes_machine_get_state (BoxesMachine* self);
static void ___lambda74__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void _boxes_libvirt_machine_update_domain_config_gvir_domain_updated (GVirDomain* _sender, gpointer self);
void boxes_machine_load_screenshot (BoxesMachine* self);
void boxes_machine_set_screenshot_enable (BoxesMachine* self, gboolean enable);
static void boxes_libvirt_machine_set_stats_enable (BoxesLibvirtMachine* self, gboolean enable);
static void boxes_libvirt_machine_update_cpu_stat (BoxesLibvirtMachine* self, GVirDomainInfo* info, BoxesLibvirtMachineMachineStat* stat);
static void boxes_libvirt_machine_update_mem_stat (BoxesLibvirtMachine* self, GVirDomainInfo* info, BoxesLibvirtMachineMachineStat* stat);
static void boxes_libvirt_machine_update_io_stat_data_free (gpointer _data);
static GVirDomainInfo* _vala_GVirDomainInfo_copy (GVirDomainInfo* self);
static void boxes_libvirt_machine_update_io_stat (BoxesLibvirtMachine* self, GVirDomainInfo* info, BoxesLibvirtMachineMachineStat* stat, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void boxes_libvirt_machine_update_io_stat_finish (BoxesLibvirtMachine* self, GAsyncResult* _res_);
static gboolean boxes_libvirt_machine_update_io_stat_co (BoxesLibvirtMachineUpdateIoStatData* _data_);
static Block14Data* block14_data_ref (Block14Data* _data14_);
static void block14_data_unref (void * _userdata_);
static Block15Data* block15_data_ref (Block15Data* _data15_);
static void block15_data_unref (void * _userdata_);
static GVirDomainDisk* boxes_libvirt_machine_get_domain_disk (BoxesLibvirtMachine* self, GError** error);
static void ___lambda76_ (Block15Data* _data15_, GError** error);
static void _vala_GVirDomainDiskStats_free (GVirDomainDiskStats* self);
static void ____lambda76__boxes_run_in_thread_func (gpointer self, GError** error);
static void boxes_libvirt_machine_update_io_stat_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
const gchar* boxes_collection_item_get_name (BoxesCollectionItem* self);
static void boxes_libvirt_machine_update_net_stat_data_free (gpointer _data);
static void boxes_libvirt_machine_update_net_stat (BoxesLibvirtMachine* self, GVirDomainInfo* info, BoxesLibvirtMachineMachineStat* stat, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void boxes_libvirt_machine_update_net_stat_finish (BoxesLibvirtMachine* self, GAsyncResult* _res_);
static gboolean boxes_libvirt_machine_update_net_stat_co (BoxesLibvirtMachineUpdateNetStatData* _data_);
static Block16Data* block16_data_ref (Block16Data* _data16_);
static void block16_data_unref (void * _userdata_);
static Block17Data* block17_data_ref (Block17Data* _data17_);
static void block17_data_unref (void * _userdata_);
static GVirDomainInterface* boxes_libvirt_machine_get_domain_network_interface (BoxesLibvirtMachine* self, GError** error);
static void ___lambda77_ (Block17Data* _data17_, GError** error);
static void _vala_GVirDomainInterfaceStats_free (GVirDomainInterfaceStats* self);
static void ____lambda77__boxes_run_in_thread_func (gpointer self, GError** error);
static void boxes_libvirt_machine_update_net_stat_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void boxes_libvirt_machine_update_stats_data_free (gpointer _data);
static void boxes_libvirt_machine_update_stats (BoxesLibvirtMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
static void boxes_libvirt_machine_update_stats_finish (BoxesLibvirtMachine* self, GAsyncResult* _res_);
static gboolean boxes_libvirt_machine_update_stats_co (BoxesLibvirtMachineUpdateStatsData* _data_);
static void boxes_libvirt_machine_update_stats_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static BoxesLibvirtMachineMachineStat* _vala_array_dup2 (BoxesLibvirtMachineMachineStat* self, int length);
static void _vala_array_add2 (BoxesLibvirtMachineMachineStat** array, int* length, int* size, const BoxesLibvirtMachineMachineStat* value);
static void _vala_array_add3 (gdouble** array, int* length, int* size, gdouble value);
static void _vala_array_add4 (gdouble** array, int* length, int* size, gdouble value);
static void _vala_array_add5 (gdouble** array, int* length, int* size, gdouble value);
static Block18Data* block18_data_ref (Block18Data* _data18_);
static void block18_data_unref (void * _userdata_);
static gboolean ___lambda75_ (Block18Data* _data18_);
static void __lambda78_ (Block18Data* _data18_);
static void ___lambda78__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static gboolean ____lambda75__gsource_func (gpointer self);
void boxes_libvirt_machine_try_change_name (BoxesLibvirtMachine* self, const gchar* name, GError** error);
void boxes_collection_item_set_name (BoxesCollectionItem* self, const gchar* value);
static GList* boxes_libvirt_machine_real_get_properties (BoxesMachine* base, BoxesPropertiesPage page);
static void _g_object_unref0_ (gpointer var);
static void _g_list_free__g_object_unref0_ (GList* self);
BoxesProperty* boxes_iproperties_provider_add_string_property (BoxesIPropertiesProvider* self, GList** list, const gchar* name, const gchar* value, PropertyStringChanged changed, void* changed_target);
static void ___lambda79_ (BoxesLibvirtMachine* self, BoxesProperty* property, const gchar* name, GError** error);
static void ____lambda79__property_string_changed (BoxesProperty* property, const gchar* value, gpointer self, GError** error);
gchar* boxes_display_get_uri (BoxesDisplay* self);
static void boxes_libvirt_machine_add_ram_property (BoxesLibvirtMachine* self, GList** list);
static void boxes_libvirt_machine_add_storage_property (BoxesLibvirtMachine* self, GList** list);
const gchar* boxes_display_get_protocol (BoxesDisplay* self);
GList* boxes_display_get_properties (BoxesDisplay* self, BoxesPropertiesPage page);
static BoxesDisplay* boxes_libvirt_machine_create_display (BoxesLibvirtMachine* self, GError** error);
void boxes_machine_set_display (BoxesMachine* self, BoxesDisplay* value);
gchar* boxes_extract_xpath (const gchar* xmldoc, const gchar* xpath, gboolean required, GError** error);
BoxesSpiceDisplay* boxes_spice_display_new (BoxesDisplayConfig* config, const gchar* host, gint port);
BoxesSpiceDisplay* boxes_spice_display_construct (GType object_type, BoxesDisplayConfig* config, const gchar* host, gint port);
GType boxes_spice_display_get_type (void) G_GNUC_CONST;
BoxesVncDisplay* boxes_vnc_display_new (BoxesDisplayConfig* config, const gchar* host, gint port);
BoxesVncDisplay* boxes_vnc_display_construct (GType object_type, BoxesDisplayConfig* config, const gchar* host, gint port);
GType boxes_vnc_display_get_type (void) G_GNUC_CONST;
static void boxes_libvirt_machine_real_take_screenshot_data_free (gpointer _data);
static void boxes_libvirt_machine_real_take_screenshot (BoxesMachine* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean boxes_libvirt_machine_real_take_screenshot_co (BoxesLibvirtMachineTakeScreenshotData* _data_);
static Block19Data* block19_data_ref (Block19Data* _data19_);
static void block19_data_unref (void * _userdata_);
static void boxes_libvirt_machine_take_screenshot_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static void __lambda86_ (Block19Data* _data19_, GError** error);
static void ___lambda86__boxes_run_in_thread_func (gpointer self, GError** error);
static void boxes_libvirt_machine_real_delete (BoxesMachine* base, gboolean by_user);
void boxes_machine_delete (BoxesMachine* self, gboolean by_user);
static Block20Data* block20_data_ref (Block20Data* _data20_);
static void block20_data_unref (void * _userdata_);
static void ___lambda87_ (Block20Data* _data20_, GError** error);
static void ____lambda87__boxes_run_in_thread_func (gpointer self, GError** error);
static void boxes_libvirt_machine_suspend_data_free (gpointer _data);
void boxes_libvirt_machine_suspend (BoxesLibvirtMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void boxes_libvirt_machine_suspend_finish (BoxesLibvirtMachine* self, GAsyncResult* _res_, GError** error);
static gboolean boxes_libvirt_machine_suspend_co (BoxesLibvirtMachineSuspendData* _data_);
gboolean boxes_libvirt_machine_get_save_on_quit (BoxesLibvirtMachine* self);
static void boxes_libvirt_machine_suspend_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void boxes_libvirt_machine_force_shutdown (BoxesLibvirtMachine* self, gboolean confirm);
GType boxes_app_get_type (void) G_GNUC_CONST;
GType boxes_searchbar_get_type (void) G_GNUC_CONST;
GType boxes_topbar_get_type (void) G_GNUC_CONST;
GType boxes_notificationbar_get_type (void) G_GNUC_CONST;
GType boxes_revealer_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_collection_filter_get_type (void) G_GNUC_CONST;
GType boxes_collection_view_get_type (void) G_GNUC_CONST;
static void boxes_libvirt_machine_update_ram_property (BoxesLibvirtMachine* self, BoxesProperty* property);
void boxes_property_set_reboot_required (BoxesProperty* self, gboolean value);
static Block21Data* block21_data_ref (Block21Data* _data21_);
static void block21_data_unref (void * _userdata_);
static void _vala_GVirNodeInfo_free (GVirNodeInfo* self);
BoxesProperty* boxes_iproperties_provider_add_size_property (BoxesIPropertiesProvider* self, GList** list, const gchar* name, guint64 size, guint64 min, guint64 max, guint64 step, PropertySizeChanged changed, void* changed_target);
static void boxes_libvirt_machine_on_ram_changed (BoxesLibvirtMachine* self, BoxesProperty* property, guint64 value);
static void _boxes_libvirt_machine_on_ram_changed_property_size_changed (BoxesProperty* property, guint64 value, gpointer self);
static void ___lambda84_ (Block21Data* _data21_);
static void ____lambda84__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static Block22Data* block22_data_ref (Block22Data* _data22_);
static void block22_data_unref (void * _userdata_);
static gboolean __lambda80_ (Block22Data* _data22_);
static void boxes_libvirt_machine_notify_reboot_required (BoxesLibvirtMachine* self);
static gboolean ___lambda80__gsource_func (gpointer self);
void boxes_property_set_deferred_change (BoxesProperty* self, GSourceFunc value, gpointer value_target, GDestroyNotify value_target_destroy_notify);
static void boxes_libvirt_machine_start_data_free (gpointer _data);
static gboolean boxes_libvirt_machine_start_co (BoxesLibvirtMachineStartData* _data_);
static void boxes_libvirt_machine_start_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
void boxes_machine_set_status (BoxesMachine* self, const gchar* value);
static void __lambda81_ (BoxesLibvirtMachine* self);
static Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
static void __lambda82_ (Block23Data* _data23_);
static void ___lambda83_ (BoxesLibvirtMachine* self, GObject* obj, GAsyncResult* res);
static void ____lambda83__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
static void ___lambda82__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
static void ___lambda81__boxes_notificationbar_ok_func (gpointer self);
void boxes_notificationbar_display_for_action (BoxesNotificationbar* self, const gchar* message, const gchar* action_label, BoxesNotificationbarOKFunc action_func, void* action_func_target, GDestroyNotify action_func_target_destroy_notify, BoxesNotificationbarCancelFunc ignore_func, void* ignore_func_target, GDestroyNotify ignore_func_target_destroy_notify);
GVirStoragePool* boxes_get_storage_pool (GVirConnection* connection);
static void _vala_GVirStorageVolInfo_free (GVirStorageVolInfo* self);
static void boxes_libvirt_machine_on_storage_changed (BoxesLibvirtMachine* self, BoxesProperty* property, guint64 value);
static void _boxes_libvirt_machine_on_storage_changed_property_size_changed (BoxesProperty* property, guint64 value, gpointer self);
static void _vala_GVirStoragePoolInfo_free (GVirStoragePoolInfo* self);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
static gboolean __lambda85_ (Block24Data* _data24_);
gboolean boxes_machine_is_running (BoxesMachine* self);
static gboolean ___lambda85__gsource_func (gpointer self);
void boxes_libvirt_machine_set_save_on_quit (BoxesLibvirtMachine* self, gboolean value);
static GObject * boxes_libvirt_machine_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
static GVirDomainDiskStats* _vala_GVirDomainDiskStats_copy (GVirDomainDiskStats* self);
static GVirDomainInterfaceStats* _vala_GVirDomainInterfaceStats_copy (GVirDomainInterfaceStats* self);
static void boxes_libvirt_machine_finalize (GObject* obj);
static void _vala_boxes_libvirt_machine_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_boxes_libvirt_machine_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


static void _vala_BoxesLibvirtMachineMachineStat_array_free (BoxesLibvirtMachineMachineStat* array, gint array_length) {
	if (array != NULL) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			boxes_libvirt_machine_machine_stat_destroy (&array[i]);
		}
	}
	g_free (array);
}


static void boxes_libvirt_machine_real_disconnect_display (BoxesMachine* base) {
	BoxesLibvirtMachine * self;
	self = (BoxesLibvirtMachine*) base;
	((BoxesMachine*) self)->stay_on_display = FALSE;
	BOXES_MACHINE_CLASS (boxes_libvirt_machine_parent_class)->disconnect_display (G_TYPE_CHECK_INSTANCE_CAST (self, BOXES_TYPE_MACHINE, BoxesMachine));
}


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


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


static void boxes_libvirt_machine_real_connect_display (BoxesMachine* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesLibvirtMachine * self;
	BoxesLibvirtMachineConnectDisplayData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	self = (BoxesLibvirtMachine*) base;
	_data_ = g_slice_new0 (BoxesLibvirtMachineConnectDisplayData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_libvirt_machine_real_connect_display);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_libvirt_machine_real_connect_display_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	boxes_libvirt_machine_real_connect_display_co (_data_);
}


static void boxes_libvirt_machine_real_connect_display_finish (BoxesMachine* base, GAsyncResult* _res_, GError** error) {
	BoxesLibvirtMachineConnectDisplayData* _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_libvirt_machine_connect_display_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesLibvirtMachineConnectDisplayData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_machine_real_connect_display_co (_data_);
}


static gboolean boxes_libvirt_machine_real_connect_display_co (BoxesLibvirtMachineConnectDisplayData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_state_ = 1;
	boxes_libvirt_machine_start (_data_->self, boxes_libvirt_machine_connect_display_ready, _data_);
	return FALSE;
	_state_1:
	boxes_libvirt_machine_start_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;
	}
	boxes_libvirt_machine_update_display (_data_->self, &_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_->_tmp0_ = boxes_machine_get_display ((BoxesMachine*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	boxes_display_connect_it (_data_->_tmp1_, &_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 void boxes_libvirt_machine_update_domain_config (BoxesLibvirtMachine* self) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	{
		GVirDomain* _tmp0_;
		GVirConfigDomain* _tmp1_ = NULL;
		GVirConfigDomain* _tmp2_;
		GVirConnection* _tmp3_;
		GVirDomain* _tmp4_;
		GVirStorageVol* _tmp5_ = NULL;
		_tmp0_ = self->domain;
		_tmp1_ = gvir_domain_get_config (_tmp0_, (guint) GVIR_DOMAIN_XML_NONE, &_inner_error_);
		_tmp2_ = _tmp1_;
		if (_inner_error_ != NULL) {
			goto __catch13_g_error;
		}
		_g_object_unref0 (self->domain_config);
		self->domain_config = _tmp2_;
		_tmp3_ = self->connection;
		_tmp4_ = self->domain;
		_tmp5_ = boxes_get_storage_volume (_tmp3_, _tmp4_);
		_g_object_unref0 (self->storage_volume);
		self->storage_volume = _tmp5_;
	}
	goto __finally13;
	__catch13_g_error:
	{
		GError* _error_ = NULL;
		GVirDomain* _tmp6_;
		const gchar* _tmp7_ = NULL;
		GError* _tmp8_;
		const gchar* _tmp9_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp6_ = self->domain;
		_tmp7_ = gvir_domain_get_name (_tmp6_);
		_tmp8_ = _error_;
		_tmp9_ = _tmp8_->message;
		g_critical ("libvirt-machine.vala:59: Failed to fetch configuration for domain '%s'" \
": %s", _tmp7_, _tmp9_);
		_g_error_free0 (_error_);
	}
	__finally13:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void boxes_libvirt_machine_reconnect_display (BoxesLibvirtMachine* self) {
	BoxesDisplay* _tmp0_;
	BoxesDisplay* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_machine_get_display ((BoxesMachine*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		return;
	}
	boxes_machine_disconnect_display ((BoxesMachine*) self);
	boxes_machine_connect_display ((BoxesMachine*) self, NULL, NULL);
}


static Block13Data* block13_data_ref (Block13Data* _data13_) {
	g_atomic_int_inc (&_data13_->_ref_count_);
	return _data13_;
}


static void block13_data_unref (void * _userdata_) {
	Block13Data* _data13_;
	_data13_ = (Block13Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data13_->_ref_count_)) {
		BoxesLibvirtMachine * self;
		self = _data13_->self;
		_g_object_unref0 (_data13_->domain);
		_g_object_unref0 (self);
		g_slice_free (Block13Data, _data13_);
	}
}


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


static void __lambda70_ (BoxesLibvirtMachine* self) {
	boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_RUNNING);
}


static void ___lambda70__gvir_domain_started (GVirDomain* _sender, gpointer self) {
	__lambda70_ (self);
}


static void __lambda71_ (BoxesLibvirtMachine* self) {
	boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_PAUSED);
}


static void ___lambda71__gvir_domain_suspended (GVirDomain* _sender, gpointer self) {
	__lambda71_ (self);
}


static void __lambda72_ (BoxesLibvirtMachine* self) {
	boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_RUNNING);
}


static void ___lambda72__gvir_domain_resumed (GVirDomain* _sender, gpointer self) {
	__lambda72_ (self);
}


static void __lambda73_ (Block13Data* _data13_) {
	BoxesLibvirtMachine * self;
	GVirDomain* _tmp0_;
	GSignalInvocationHint* _tmp1_ = NULL;
	GQuark _tmp2_;
	GQuark _tmp3_ = 0U;
	self = _data13_->self;
	_tmp0_ = _data13_->domain;
	_tmp1_ = g_signal_get_invocation_hint (_tmp0_);
	_tmp2_ = (*_tmp1_).detail;
	_tmp3_ = g_quark_from_string ("saved");
	if (_tmp2_ == _tmp3_) {
		boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_SAVED);
	} else {
		boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_STOPPED);
	}
}


static void ___lambda73__gvir_domain_stopped (GVirDomain* _sender, gpointer self) {
	__lambda73_ (self);
}


static void __lambda74_ (BoxesLibvirtMachine* self) {
	BoxesMachineMachineState _tmp0_;
	BoxesMachineMachineState _tmp1_;
	_tmp0_ = boxes_machine_get_state ((BoxesMachine*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == BOXES_MACHINE_MACHINE_STATE_RUNNING) {
		boxes_libvirt_machine_reconnect_display (self);
	}
}


static void ___lambda74__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda74_ (self);
}


static void _boxes_libvirt_machine_update_domain_config_gvir_domain_updated (GVirDomain* _sender, gpointer self) {
	boxes_libvirt_machine_update_domain_config (self);
}


BoxesLibvirtMachine* boxes_libvirt_machine_construct (GType object_type, BoxesCollectionSource* source, GVirConnection* connection, GVirDomain* domain, GError** error) {
	BoxesLibvirtMachine * self = NULL;
	Block13Data* _data13_;
	GVirDomain* _tmp0_;
	GVirDomain* _tmp1_;
	GVirDomain* _tmp2_;
	GVirConfigDomain* _tmp3_ = NULL;
	GVirConfigDomain* config;
	GVirConfigDomain* _tmp4_;
	const gchar* _tmp5_ = NULL;
	gchar* _tmp6_;
	gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	gchar* item_name;
	BoxesCollectionSource* _tmp14_;
	const gchar* _tmp15_;
	GVirDomain* _tmp16_;
	const gchar* _tmp17_ = NULL;
	gchar* _tmp18_;
	gchar* _tmp19_;
	GVirDomain* _tmp20_;
	const gchar* _tmp21_ = NULL;
	GVirConnection* _tmp22_;
	GVirConnection* _tmp23_;
	GVirDomain* _tmp24_;
	GVirDomain* _tmp25_;
	GVirDomain* _tmp35_;
	GVirDomain* _tmp36_;
	GVirDomain* _tmp37_;
	GVirDomain* _tmp38_;
	GVirDomain* _tmp39_;
	BoxesMachineMachineState _tmp40_;
	BoxesMachineMachineState _tmp41_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (source != NULL, NULL);
	g_return_val_if_fail (connection != NULL, NULL);
	g_return_val_if_fail (domain != NULL, NULL);
	_data13_ = g_slice_new0 (Block13Data);
	_data13_->_ref_count_ = 1;
	_tmp0_ = domain;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data13_->domain);
	_data13_->domain = _tmp1_;
	_tmp2_ = _data13_->domain;
	_tmp3_ = gvir_domain_get_config (_tmp2_, (guint) GVIR_DOMAIN_XML_INACTIVE, &_inner_error_);
	config = _tmp3_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		block13_data_unref (_data13_);
		_data13_ = NULL;
		_g_object_unref0 (self);
		return NULL;
	}
	_tmp4_ = config;
	_tmp5_ = gvir_config_domain_get_title (_tmp4_);
	_tmp6_ = g_strdup (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_;
	if (_tmp8_ == NULL) {
		GVirDomain* _tmp9_;
		const gchar* _tmp10_ = NULL;
		gchar* _tmp11_;
		_tmp9_ = _data13_->domain;
		_tmp10_ = gvir_domain_get_name (_tmp9_);
		_tmp11_ = g_strdup (_tmp10_);
		_g_free0 (_tmp7_);
		_tmp7_ = _tmp11_;
	}
	_tmp12_ = _tmp7_;
	_tmp13_ = g_strdup (_tmp12_);
	item_name = _tmp13_;
	_tmp14_ = source;
	_tmp15_ = item_name;
	self = (BoxesLibvirtMachine*) boxes_machine_construct (object_type, _tmp14_, _tmp15_);
	_data13_->self = g_object_ref (self);
	_tmp16_ = _data13_->domain;
	_tmp17_ = gvir_domain_get_name (_tmp16_);
	_tmp18_ = g_strconcat ("new libvirt machine: ", _tmp17_, NULL);
	_tmp19_ = _tmp18_;
	g_debug ("libvirt-machine.vala:79: %s", _tmp19_);
	_g_free0 (_tmp19_);
	_tmp20_ = _data13_->domain;
	_tmp21_ = gvir_domain_get_uuid (_tmp20_);
	boxes_machine_create_display_config ((BoxesMachine*) self, _tmp21_);
	_tmp22_ = connection;
	_tmp23_ = _g_object_ref0 (_tmp22_);
	_g_object_unref0 (self->connection);
	self->connection = _tmp23_;
	_tmp24_ = _data13_->domain;
	_tmp25_ = _g_object_ref0 (_tmp24_);
	_g_object_unref0 (self->domain);
	self->domain = _tmp25_;
	{
		GVirDomain* _tmp26_;
		GVirDomainInfo* _tmp27_ = NULL;
		GVirDomainInfo* _tmp28_;
		GVirDomainInfo* _tmp29_;
		GVirDomainState _tmp30_;
		GVirDomainState _tmp31_;
		GVirDomainState s;
		GVirDomainState _tmp32_;
		_tmp26_ = _data13_->domain;
		_tmp27_ = gvir_domain_get_info (_tmp26_, &_inner_error_);
		_tmp28_ = _tmp27_;
		if (_inner_error_ != NULL) {
			goto __catch14_g_error;
		}
		_tmp29_ = _tmp28_;
		_tmp30_ = _tmp29_->state;
		_tmp31_ = _tmp30_;
		__vala_GVirDomainInfo_free0 (_tmp29_);
		s = _tmp31_;
		_tmp32_ = s;
		switch (_tmp32_) {
			case GVIR_DOMAIN_STATE_RUNNING:
			case GVIR_DOMAIN_STATE_BLOCKED:
			{
				boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_RUNNING);
				break;
			}
			case GVIR_DOMAIN_STATE_PAUSED:
			{
				boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_PAUSED);
				break;
			}
			case GVIR_DOMAIN_STATE_SHUTDOWN:
			case GVIR_DOMAIN_STATE_SHUTOFF:
			{
				GVirDomain* _tmp33_;
				gboolean _tmp34_ = FALSE;
				_tmp33_ = _data13_->domain;
				_tmp34_ = gvir_domain_get_saved (_tmp33_);
				if (_tmp34_) {
					boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_SAVED);
				} else {
					boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_STOPPED);
				}
				break;
			}
			case GVIR_DOMAIN_STATE_CRASHED:
			{
				boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_STOPPED);
				break;
			}
			default:
			case GVIR_DOMAIN_STATE_NONE:
			{
				boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_UNKNOWN);
				break;
			}
		}
	}
	goto __finally14;
	__catch14_g_error:
	{
		GError* _error_ = NULL;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_UNKNOWN);
		_g_error_free0 (_error_);
	}
	__finally14:
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		_g_free0 (item_name);
		_g_free0 (_tmp7_);
		_g_object_unref0 (config);
		block13_data_unref (_data13_);
		_data13_ = NULL;
		_g_object_unref0 (self);
		return NULL;
	}
	_tmp35_ = _data13_->domain;
	g_signal_connect_object (_tmp35_, "started", (GCallback) ___lambda70__gvir_domain_started, self, 0);
	_tmp36_ = _data13_->domain;
	g_signal_connect_object (_tmp36_, "suspended", (GCallback) ___lambda71__gvir_domain_suspended, self, 0);
	_tmp37_ = _data13_->domain;
	g_signal_connect_object (_tmp37_, "resumed", (GCallback) ___lambda72__gvir_domain_resumed, self, 0);
	_tmp38_ = _data13_->domain;
	g_signal_connect_data (_tmp38_, "stopped", (GCallback) ___lambda73__gvir_domain_stopped, block13_data_ref (_data13_), (GClosureNotify) block13_data_unref, 0);
	g_signal_connect_object ((GObject*) self, "notify::state", (GCallback) ___lambda74__g_object_notify, self, 0);
	boxes_libvirt_machine_update_domain_config (self);
	_tmp39_ = _data13_->domain;
	g_signal_connect_object (_tmp39_, "updated", (GCallback) _boxes_libvirt_machine_update_domain_config_gvir_domain_updated, self, 0);
	_tmp40_ = boxes_machine_get_state ((BoxesMachine*) self);
	_tmp41_ = _tmp40_;
	if (_tmp41_ != BOXES_MACHINE_MACHINE_STATE_STOPPED) {
		boxes_machine_load_screenshot ((BoxesMachine*) self);
	}
	boxes_machine_set_screenshot_enable ((BoxesMachine*) self, TRUE);
	boxes_libvirt_machine_set_stats_enable (self, TRUE);
	_g_free0 (item_name);
	_g_free0 (_tmp7_);
	_g_object_unref0 (config);
	block13_data_unref (_data13_);
	_data13_ = NULL;
	return self;
}


BoxesLibvirtMachine* boxes_libvirt_machine_new (BoxesCollectionSource* source, GVirConnection* connection, GVirDomain* domain, GError** error) {
	return boxes_libvirt_machine_construct (BOXES_TYPE_LIBVIRT_MACHINE, source, connection, domain, error);
}


static void boxes_libvirt_machine_update_cpu_stat (BoxesLibvirtMachine* self, GVirDomainInfo* info, BoxesLibvirtMachineMachineStat* stat) {
	BoxesLibvirtMachineMachineStat* _tmp0_;
	gint _tmp0__length1;
	BoxesLibvirtMachineMachineStat _tmp1_;
	BoxesLibvirtMachineMachineStat _tmp2_ = {0};
	BoxesLibvirtMachineMachineStat prev;
	gboolean _tmp3_ = FALSE;
	GVirDomainInfo* _tmp4_;
	GVirDomainState _tmp5_;
	gboolean _tmp8_;
	GVirDomainInfo* _tmp9_;
	guint64 _tmp10_;
	BoxesLibvirtMachineMachineStat _tmp11_;
	gdouble _tmp12_;
	GVirDomainInfo* _tmp13_;
	guint64 _tmp14_;
	BoxesLibvirtMachineMachineStat _tmp15_;
	gint64 _tmp16_;
	BoxesLibvirtMachineMachineStat _tmp17_;
	gint64 _tmp18_;
	gint64 dt;
	BoxesLibvirtMachineMachineStat _tmp19_;
	gdouble _tmp20_;
	gint64 _tmp21_;
	gdouble percent;
	gdouble _tmp22_;
	GVirDomainInfo* _tmp23_;
	guint16 _tmp24_;
	gdouble _tmp25_;
	gdouble _tmp26_ = 0.0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (info != NULL);
	g_return_if_fail (stat != NULL);
	_tmp0_ = self->priv->stats;
	_tmp0__length1 = self->priv->stats_length1;
	_tmp1_ = _tmp0_[BOXES_LIBVIRT_MACHINE_STATS_SIZE - 1];
	boxes_libvirt_machine_machine_stat_copy (&_tmp1_, &_tmp2_);
	prev = _tmp2_;
	_tmp4_ = info;
	_tmp5_ = _tmp4_->state;
	if (_tmp5_ == GVIR_DOMAIN_STATE_CRASHED) {
		_tmp3_ = TRUE;
	} else {
		GVirDomainInfo* _tmp6_;
		GVirDomainState _tmp7_;
		_tmp6_ = info;
		_tmp7_ = _tmp6_->state;
		_tmp3_ = _tmp7_ == GVIR_DOMAIN_STATE_SHUTOFF;
	}
	_tmp8_ = _tmp3_;
	if (_tmp8_) {
		boxes_libvirt_machine_machine_stat_destroy (&prev);
		return;
	}
	_tmp9_ = info;
	_tmp10_ = _tmp9_->cpuTime;
	_tmp11_ = prev;
	_tmp12_ = _tmp11_.cpu_time_abs;
	(*stat).cpu_time = _tmp10_ - _tmp12_;
	_tmp13_ = info;
	_tmp14_ = _tmp13_->cpuTime;
	(*stat).cpu_time_abs = (gdouble) _tmp14_;
	_tmp15_ = *stat;
	_tmp16_ = _tmp15_.timestamp;
	_tmp17_ = prev;
	_tmp18_ = _tmp17_.timestamp;
	dt = (_tmp16_ - _tmp18_) * 10;
	_tmp19_ = *stat;
	_tmp20_ = _tmp19_.cpu_time;
	_tmp21_ = dt;
	percent = _tmp20_ / _tmp21_;
	_tmp22_ = percent;
	_tmp23_ = info;
	_tmp24_ = _tmp23_->nrVirtCpu;
	percent = _tmp22_ / _tmp24_;
	_tmp25_ = percent;
	_tmp26_ = CLAMP (_tmp25_, (gdouble) 0, (gdouble) 100);
	(*stat).cpu_guest_percent = _tmp26_;
	boxes_libvirt_machine_machine_stat_destroy (&prev);
}


static void boxes_libvirt_machine_update_mem_stat (BoxesLibvirtMachine* self, GVirDomainInfo* info, BoxesLibvirtMachineMachineStat* stat) {
	GVirDomainInfo* _tmp0_;
	GVirDomainState _tmp1_;
	GVirDomainInfo* _tmp2_;
	guint64 _tmp3_;
	GVirDomainInfo* _tmp4_;
	guint64 _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (info != NULL);
	g_return_if_fail (stat != NULL);
	_tmp0_ = info;
	_tmp1_ = _tmp0_->state;
	if (_tmp1_ != GVIR_DOMAIN_STATE_RUNNING) {
		return;
	}
	_tmp2_ = info;
	_tmp3_ = _tmp2_->memory;
	_tmp4_ = info;
	_tmp5_ = _tmp4_->maxMem;
	(*stat).memory_percent = (_tmp3_ * 100.0) / _tmp5_;
}


static void boxes_libvirt_machine_update_io_stat_data_free (gpointer _data) {
	BoxesLibvirtMachineUpdateIoStatData* _data_;
	_data_ = _data;
	__vala_GVirDomainInfo_free0 (_data_->info);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesLibvirtMachineUpdateIoStatData, _data_);
}


static GVirDomainInfo* _vala_GVirDomainInfo_copy (GVirDomainInfo* self) {
	return g_boxed_copy (gvir_domain_info_get_type (), self);
}


static gpointer __vala_GVirDomainInfo_copy0 (gpointer self) {
	return self ? _vala_GVirDomainInfo_copy (self) : NULL;
}


static void boxes_libvirt_machine_update_io_stat (BoxesLibvirtMachine* self, GVirDomainInfo* info, BoxesLibvirtMachineMachineStat* stat, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesLibvirtMachineUpdateIoStatData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	GVirDomainInfo* _tmp1_;
	GVirDomainInfo* _tmp2_;
	BoxesLibvirtMachineMachineStat* _tmp3_;
	_data_ = g_slice_new0 (BoxesLibvirtMachineUpdateIoStatData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_libvirt_machine_update_io_stat);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_libvirt_machine_update_io_stat_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = info;
	_tmp2_ = __vala_GVirDomainInfo_copy0 (_tmp1_);
	__vala_GVirDomainInfo_free0 (_data_->info);
	_data_->info = _tmp2_;
	_tmp3_ = stat;
	_data_->stat = _tmp3_;
	boxes_libvirt_machine_update_io_stat_co (_data_);
}


static void boxes_libvirt_machine_update_io_stat_finish (BoxesLibvirtMachine* self, GAsyncResult* _res_) {
	BoxesLibvirtMachineUpdateIoStatData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static Block14Data* block14_data_ref (Block14Data* _data14_) {
	g_atomic_int_inc (&_data14_->_ref_count_);
	return _data14_;
}


static void block14_data_unref (void * _userdata_) {
	Block14Data* _data14_;
	_data14_ = (Block14Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data14_->_ref_count_)) {
		BoxesLibvirtMachine * self;
		self = _data14_->self;
		_g_object_unref0 (self);
		g_slice_free (Block14Data, _data14_);
	}
}


static Block15Data* block15_data_ref (Block15Data* _data15_) {
	g_atomic_int_inc (&_data15_->_ref_count_);
	return _data15_;
}


static void block15_data_unref (void * _userdata_) {
	Block15Data* _data15_;
	_data15_ = (Block15Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data15_->_ref_count_)) {
		BoxesLibvirtMachine * self;
		self = _data15_->_data14_->self;
		_g_object_unref0 (_data15_->disk);
		block14_data_unref (_data15_->_data14_);
		_data15_->_data14_ = NULL;
		g_slice_free (Block15Data, _data15_);
	}
}


static void _vala_GVirDomainDiskStats_free (GVirDomainDiskStats* self) {
	g_boxed_free (gvir_domain_disk_stats_get_type (), self);
}


static void ___lambda76_ (Block15Data* _data15_, GError** error) {
	Block14Data* _data14_;
	BoxesLibvirtMachine * self;
	GVirDomainDisk* _tmp0_;
	GVirDomainDiskStats* _tmp1_ = NULL;
	GVirDomainDiskStats* _tmp2_;
	BoxesLibvirtMachineMachineStat* _tmp3_;
	GError * _inner_error_ = NULL;
	_data14_ = _data15_->_data14_;
	self = _data14_->self;
	_tmp0_ = _data15_->disk;
	_tmp1_ = gvir_domain_disk_get_stats (_tmp0_, &_inner_error_);
	_tmp2_ = _tmp1_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return;
	}
	_tmp3_ = _data14_->stat;
	__vala_GVirDomainDiskStats_free0 ((*_tmp3_).disk);
	(*_tmp3_).disk = _tmp2_;
}


static void ____lambda76__boxes_run_in_thread_func (gpointer self, GError** error) {
	___lambda76_ (self, error);
}


static void boxes_libvirt_machine_update_io_stat_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesLibvirtMachineUpdateIoStatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_machine_update_io_stat_co (_data_);
}


static gboolean boxes_libvirt_machine_update_io_stat_co (BoxesLibvirtMachineUpdateIoStatData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data14_ = g_slice_new0 (Block14Data);
	_data_->_data14_->_ref_count_ = 1;
	_data_->_data14_->self = g_object_ref (_data_->self);
	_data_->_tmp0_ = _data_->stat;
	_data_->_data14_->stat = _data_->_tmp0_;
	_data_->_data14_->_async_data_ = _data_;
	_data_->_tmp1_ = _data_->info;
	_data_->_tmp2_ = _data_->_tmp1_->state;
	if (_data_->_tmp2_ != GVIR_DOMAIN_STATE_RUNNING) {
		block14_data_unref (_data_->_data14_);
		_data_->_data14_ = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_data15_ = g_slice_new0 (Block15Data);
		_data_->_data15_->_ref_count_ = 1;
		_data_->_data15_->_data14_ = block14_data_ref (_data_->_data14_);
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = boxes_libvirt_machine_get_domain_disk (_data_->self, &_data_->_inner_error_);
		_data_->_data15_->disk = _data_->_tmp3_;
		if (_data_->_inner_error_ != NULL) {
			block15_data_unref (_data_->_data15_);
			_data_->_data15_ = NULL;
			goto __catch15_g_error;
		}
		_data_->_tmp4_ = _data_->_data15_->disk;
		if (_data_->_tmp4_ == NULL) {
			block15_data_unref (_data_->_data15_);
			_data_->_data15_ = NULL;
			block14_data_unref (_data_->_data14_);
			_data_->_data14_ = NULL;
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_state_ = 1;
		boxes_run_in_thread (____lambda76__boxes_run_in_thread_func, block15_data_ref (_data_->_data15_), block15_data_unref, NULL, boxes_libvirt_machine_update_io_stat_ready, _data_);
		return FALSE;
		_state_1:
		boxes_run_in_thread_finish (_data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			block15_data_unref (_data_->_data15_);
			_data_->_data15_ = NULL;
			goto __catch15_g_error;
		}
		_data_->_tmp5_ = _data_->self->priv->stats;
		_data_->_tmp5__length1 = _data_->self->priv->stats_length1;
		_data_->_tmp6_ = _data_->_tmp5_[BOXES_LIBVIRT_MACHINE_STATS_SIZE - 1];
		memset (&_data_->_tmp7_, 0, sizeof (BoxesLibvirtMachineMachineStat));
		boxes_libvirt_machine_machine_stat_copy (&_data_->_tmp6_, &_data_->_tmp7_);
		_data_->prev = _data_->_tmp7_;
		_data_->_tmp8_ = _data_->prev;
		_data_->_tmp9_ = _data_->_tmp8_.disk;
		if (_data_->_tmp9_ != NULL) {
			_data_->_tmp10_ = _data_->_data14_->stat;
			_data_->_tmp11_ = _data_->_data14_->stat;
			_data_->_tmp12_ = (*_data_->_tmp11_).disk;
			_data_->_tmp13_ = _data_->_tmp12_->rd_bytes;
			_data_->_tmp14_ = _data_->prev;
			_data_->_tmp15_ = _data_->_tmp14_.disk;
			_data_->_tmp16_ = _data_->_tmp15_->rd_bytes;
			(*_data_->_tmp10_).disk_read = (gdouble) (_data_->_tmp13_ - _data_->_tmp16_);
			_data_->_tmp17_ = _data_->_data14_->stat;
			_data_->_tmp18_ = _data_->_data14_->stat;
			_data_->_tmp19_ = (*_data_->_tmp18_).disk;
			_data_->_tmp20_ = _data_->_tmp19_->wr_bytes;
			_data_->_tmp21_ = _data_->prev;
			_data_->_tmp22_ = _data_->_tmp21_.disk;
			_data_->_tmp23_ = _data_->_tmp22_->wr_bytes;
			(*_data_->_tmp17_).disk_write = (gdouble) (_data_->_tmp20_ - _data_->_tmp23_);
		}
		boxes_libvirt_machine_machine_stat_destroy (&_data_->prev);
		block15_data_unref (_data_->_data15_);
		_data_->_data15_ = NULL;
	}
	goto __finally15;
	__catch15_g_error:
	{
		_data_->err = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp24_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->self);
		_data_->_tmp25_ = _data_->_tmp24_;
		_data_->_tmp26_ = _data_->err;
		_data_->_tmp27_ = _data_->_tmp26_->message;
		g_warning ("libvirt-machine.vala:177: Failed to fetch I/O statistics for %s: %s", _data_->_tmp25_, _data_->_tmp27_);
		_g_error_free0 (_data_->err);
	}
	__finally15:
	if (_data_->_inner_error_ != NULL) {
		block14_data_unref (_data_->_data14_);
		_data_->_data14_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	block14_data_unref (_data_->_data14_);
	_data_->_data14_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void boxes_libvirt_machine_update_net_stat_data_free (gpointer _data) {
	BoxesLibvirtMachineUpdateNetStatData* _data_;
	_data_ = _data;
	__vala_GVirDomainInfo_free0 (_data_->info);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesLibvirtMachineUpdateNetStatData, _data_);
}


static void boxes_libvirt_machine_update_net_stat (BoxesLibvirtMachine* self, GVirDomainInfo* info, BoxesLibvirtMachineMachineStat* stat, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesLibvirtMachineUpdateNetStatData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	GVirDomainInfo* _tmp1_;
	GVirDomainInfo* _tmp2_;
	BoxesLibvirtMachineMachineStat* _tmp3_;
	_data_ = g_slice_new0 (BoxesLibvirtMachineUpdateNetStatData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_libvirt_machine_update_net_stat);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_libvirt_machine_update_net_stat_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = info;
	_tmp2_ = __vala_GVirDomainInfo_copy0 (_tmp1_);
	__vala_GVirDomainInfo_free0 (_data_->info);
	_data_->info = _tmp2_;
	_tmp3_ = stat;
	_data_->stat = _tmp3_;
	boxes_libvirt_machine_update_net_stat_co (_data_);
}


static void boxes_libvirt_machine_update_net_stat_finish (BoxesLibvirtMachine* self, GAsyncResult* _res_) {
	BoxesLibvirtMachineUpdateNetStatData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static Block16Data* block16_data_ref (Block16Data* _data16_) {
	g_atomic_int_inc (&_data16_->_ref_count_);
	return _data16_;
}


static void block16_data_unref (void * _userdata_) {
	Block16Data* _data16_;
	_data16_ = (Block16Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data16_->_ref_count_)) {
		BoxesLibvirtMachine * self;
		self = _data16_->self;
		_g_object_unref0 (self);
		g_slice_free (Block16Data, _data16_);
	}
}


static Block17Data* block17_data_ref (Block17Data* _data17_) {
	g_atomic_int_inc (&_data17_->_ref_count_);
	return _data17_;
}


static void block17_data_unref (void * _userdata_) {
	Block17Data* _data17_;
	_data17_ = (Block17Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data17_->_ref_count_)) {
		BoxesLibvirtMachine * self;
		self = _data17_->_data16_->self;
		_g_object_unref0 (_data17_->net);
		block16_data_unref (_data17_->_data16_);
		_data17_->_data16_ = NULL;
		g_slice_free (Block17Data, _data17_);
	}
}


static void _vala_GVirDomainInterfaceStats_free (GVirDomainInterfaceStats* self) {
	g_boxed_free (gvir_domain_interface_stats_get_type (), self);
}


static void ___lambda77_ (Block17Data* _data17_, GError** error) {
	Block16Data* _data16_;
	BoxesLibvirtMachine * self;
	GVirDomainInterface* _tmp0_;
	GVirDomainInterfaceStats* _tmp1_ = NULL;
	GVirDomainInterfaceStats* _tmp2_;
	BoxesLibvirtMachineMachineStat* _tmp3_;
	GError * _inner_error_ = NULL;
	_data16_ = _data17_->_data16_;
	self = _data16_->self;
	_tmp0_ = _data17_->net;
	_tmp1_ = gvir_domain_interface_get_stats (_tmp0_, &_inner_error_);
	_tmp2_ = _tmp1_;
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return;
	}
	_tmp3_ = _data16_->stat;
	__vala_GVirDomainInterfaceStats_free0 ((*_tmp3_).net);
	(*_tmp3_).net = _tmp2_;
}


static void ____lambda77__boxes_run_in_thread_func (gpointer self, GError** error) {
	___lambda77_ (self, error);
}


static void boxes_libvirt_machine_update_net_stat_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesLibvirtMachineUpdateNetStatData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_machine_update_net_stat_co (_data_);
}


static gboolean boxes_libvirt_machine_update_net_stat_co (BoxesLibvirtMachineUpdateNetStatData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data16_ = g_slice_new0 (Block16Data);
	_data_->_data16_->_ref_count_ = 1;
	_data_->_data16_->self = g_object_ref (_data_->self);
	_data_->_tmp0_ = _data_->stat;
	_data_->_data16_->stat = _data_->_tmp0_;
	_data_->_data16_->_async_data_ = _data_;
	_data_->_tmp1_ = _data_->info;
	_data_->_tmp2_ = _data_->_tmp1_->state;
	if (_data_->_tmp2_ != GVIR_DOMAIN_STATE_RUNNING) {
		block16_data_unref (_data_->_data16_);
		_data_->_data16_ = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	{
		_data_->_data17_ = g_slice_new0 (Block17Data);
		_data_->_data17_->_ref_count_ = 1;
		_data_->_data17_->_data16_ = block16_data_ref (_data_->_data16_);
		_data_->_tmp3_ = NULL;
		_data_->_tmp3_ = boxes_libvirt_machine_get_domain_network_interface (_data_->self, &_data_->_inner_error_);
		_data_->_data17_->net = _data_->_tmp3_;
		if (_data_->_inner_error_ != NULL) {
			block17_data_unref (_data_->_data17_);
			_data_->_data17_ = NULL;
			goto __catch16_g_error;
		}
		_data_->_tmp4_ = _data_->_data17_->net;
		if (_data_->_tmp4_ == NULL) {
			block17_data_unref (_data_->_data17_);
			_data_->_data17_ = NULL;
			block16_data_unref (_data_->_data16_);
			_data_->_data16_ = NULL;
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_state_ = 1;
		boxes_run_in_thread (____lambda77__boxes_run_in_thread_func, block17_data_ref (_data_->_data17_), block17_data_unref, NULL, boxes_libvirt_machine_update_net_stat_ready, _data_);
		return FALSE;
		_state_1:
		boxes_run_in_thread_finish (_data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			block17_data_unref (_data_->_data17_);
			_data_->_data17_ = NULL;
			goto __catch16_g_error;
		}
		_data_->_tmp5_ = _data_->self->priv->stats;
		_data_->_tmp5__length1 = _data_->self->priv->stats_length1;
		_data_->_tmp6_ = _data_->_tmp5_[BOXES_LIBVIRT_MACHINE_STATS_SIZE - 1];
		memset (&_data_->_tmp7_, 0, sizeof (BoxesLibvirtMachineMachineStat));
		boxes_libvirt_machine_machine_stat_copy (&_data_->_tmp6_, &_data_->_tmp7_);
		_data_->prev = _data_->_tmp7_;
		_data_->_tmp8_ = _data_->prev;
		_data_->_tmp9_ = _data_->_tmp8_.net;
		if (_data_->_tmp9_ != NULL) {
			_data_->_tmp10_ = _data_->_data16_->stat;
			_data_->_tmp11_ = _data_->_data16_->stat;
			_data_->_tmp12_ = (*_data_->_tmp11_).net;
			_data_->_tmp13_ = _data_->_tmp12_->rx_bytes;
			_data_->_tmp14_ = _data_->prev;
			_data_->_tmp15_ = _data_->_tmp14_.net;
			_data_->_tmp16_ = _data_->_tmp15_->rx_bytes;
			(*_data_->_tmp10_).net_read = (gdouble) (_data_->_tmp13_ - _data_->_tmp16_);
			_data_->_tmp17_ = _data_->_data16_->stat;
			_data_->_tmp18_ = _data_->_data16_->stat;
			_data_->_tmp19_ = (*_data_->_tmp18_).net;
			_data_->_tmp20_ = _data_->_tmp19_->tx_bytes;
			_data_->_tmp21_ = _data_->prev;
			_data_->_tmp22_ = _data_->_tmp21_.net;
			_data_->_tmp23_ = _data_->_tmp22_->tx_bytes;
			(*_data_->_tmp17_).net_write = (gdouble) (_data_->_tmp20_ - _data_->_tmp23_);
		}
		boxes_libvirt_machine_machine_stat_destroy (&_data_->prev);
		block17_data_unref (_data_->_data17_);
		_data_->_data17_ = NULL;
	}
	goto __finally16;
	__catch16_g_error:
	{
		_data_->err = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp24_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->self);
		_data_->_tmp25_ = _data_->_tmp24_;
		_data_->_tmp26_ = _data_->err;
		_data_->_tmp27_ = _data_->_tmp26_->message;
		g_warning ("libvirt-machine.vala:199: Failed to fetch network statistics for %s: %" \
"s", _data_->_tmp25_, _data_->_tmp27_);
		_g_error_free0 (_data_->err);
	}
	__finally16:
	if (_data_->_inner_error_ != NULL) {
		block16_data_unref (_data_->_data16_);
		_data_->_data16_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	block16_data_unref (_data_->_data16_);
	_data_->_data16_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


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


static void boxes_libvirt_machine_update_stats (BoxesLibvirtMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesLibvirtMachineUpdateStatsData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	_data_ = g_slice_new0 (BoxesLibvirtMachineUpdateStatsData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_libvirt_machine_update_stats);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_libvirt_machine_update_stats_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	boxes_libvirt_machine_update_stats_co (_data_);
}


static void boxes_libvirt_machine_update_stats_finish (BoxesLibvirtMachine* self, GAsyncResult* _res_) {
	BoxesLibvirtMachineUpdateStatsData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static void boxes_libvirt_machine_update_stats_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesLibvirtMachineUpdateStatsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_machine_update_stats_co (_data_);
}


static BoxesLibvirtMachineMachineStat* _vala_array_dup2 (BoxesLibvirtMachineMachineStat* self, int length) {
	BoxesLibvirtMachineMachineStat* result;
	int i;
	result = g_new0 (BoxesLibvirtMachineMachineStat, length);
	for (i = 0; i < length; i++) {
		BoxesLibvirtMachineMachineStat _tmp0_ = {0};
		boxes_libvirt_machine_machine_stat_copy (&self[i], &_tmp0_);
		result[i] = _tmp0_;
	}
	return result;
}


static void _vala_array_add2 (BoxesLibvirtMachineMachineStat** array, int* length, int* size, const BoxesLibvirtMachineMachineStat* value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (BoxesLibvirtMachineMachineStat, *array, *size);
	}
	(*array)[(*length)++] = *value;
}


static void _vala_array_add3 (gdouble** array, int* length, int* size, gdouble value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gdouble, *array, *size);
	}
	(*array)[(*length)++] = value;
}


static void _vala_array_add4 (gdouble** array, int* length, int* size, gdouble value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gdouble, *array, *size);
	}
	(*array)[(*length)++] = value;
}


static void _vala_array_add5 (gdouble** array, int* length, int* size, gdouble value) {
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gdouble, *array, *size);
	}
	(*array)[(*length)++] = value;
}


static gboolean boxes_libvirt_machine_update_stats_co (BoxesLibvirtMachineUpdateStatsData* _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_ = 0LL;
		_data_->_tmp0_ = g_get_monotonic_time ();
		_data_->now = _data_->_tmp0_;
		_data_->_tmp1_ = _data_->now;
		memset (&_data_->_tmp2_, 0, sizeof (BoxesLibvirtMachineMachineStat));
		memset (&_data_->_tmp2_, 0, sizeof (BoxesLibvirtMachineMachineStat));
		_data_->_tmp2_.timestamp = _data_->_tmp1_;
		_data_->stat = _data_->_tmp2_;
		_data_->_tmp3_ = _data_->self->domain;
		_data_->_tmp4_ = _data_->self->priv->stats_cancellable;
		_data_->_state_ = 1;
		gvir_domain_get_info_async (_data_->_tmp3_, _data_->_tmp4_, boxes_libvirt_machine_update_stats_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp5_ = NULL;
		_data_->_tmp5_ = gvir_domain_get_info_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
		_data_->info = _data_->_tmp5_;
		if (_data_->_inner_error_ != NULL) {
			boxes_libvirt_machine_machine_stat_destroy (&_data_->stat);
			if (g_error_matches (_data_->_inner_error_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
				goto __catch17_g_io_error_cancelled;
			}
			goto __catch17_g_error;
		}
		_data_->_tmp6_ = _data_->info;
		boxes_libvirt_machine_update_cpu_stat (_data_->self, _data_->_tmp6_, &_data_->stat);
		_data_->_tmp7_ = _data_->info;
		boxes_libvirt_machine_update_mem_stat (_data_->self, _data_->_tmp7_, &_data_->stat);
		_data_->_tmp8_ = _data_->info;
		_data_->_state_ = 2;
		boxes_libvirt_machine_update_io_stat (_data_->self, _data_->_tmp8_, &_data_->stat, boxes_libvirt_machine_update_stats_ready, _data_);
		return FALSE;
		_state_2:
		boxes_libvirt_machine_update_io_stat_finish (_data_->self, _data_->_res_);
		_data_->_tmp9_ = _data_->info;
		_data_->_state_ = 3;
		boxes_libvirt_machine_update_net_stat (_data_->self, _data_->_tmp9_, &_data_->stat, boxes_libvirt_machine_update_stats_ready, _data_);
		return FALSE;
		_state_3:
		boxes_libvirt_machine_update_net_stat_finish (_data_->self, _data_->_res_);
		_data_->_tmp10_ = _data_->self->priv->stats;
		_data_->_tmp10__length1 = _data_->self->priv->stats_length1;
		_data_->_tmp11_ = ((_data_->_tmp10_ + 1) != NULL) ? _vala_array_dup2 (_data_->_tmp10_ + 1, BOXES_LIBVIRT_MACHINE_STATS_SIZE - 1) : ((gpointer) (_data_->_tmp10_ + 1));
		_data_->_tmp11__length1 = BOXES_LIBVIRT_MACHINE_STATS_SIZE - 1;
		_data_->self->priv->stats = (_vala_BoxesLibvirtMachineMachineStat_array_free (_data_->self->priv->stats, _data_->self->priv->stats_length1), NULL);
		_data_->self->priv->stats = _data_->_tmp11_;
		_data_->self->priv->stats_length1 = _data_->_tmp11__length1;
		_data_->self->priv->_stats_size_ = _data_->self->priv->stats_length1;
		_data_->_tmp12_ = _data_->self->priv->stats;
		_data_->_tmp12__length1 = _data_->self->priv->stats_length1;
		_data_->_tmp13_ = _data_->stat;
		memset (&_data_->_tmp14_, 0, sizeof (BoxesLibvirtMachineMachineStat));
		boxes_libvirt_machine_machine_stat_copy (&_data_->_tmp13_, &_data_->_tmp14_);
		_vala_array_add2 (&_data_->self->priv->stats, &_data_->self->priv->stats_length1, &_data_->self->priv->_stats_size_, &_data_->_tmp14_);
		__vala_GVirDomainInfo_free0 (_data_->info);
		boxes_libvirt_machine_machine_stat_destroy (&_data_->stat);
	}
	goto __finally17;
	__catch17_g_io_error_cancelled:
	{
		_data_->err = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_g_error_free0 (_data_->err);
		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;
	}
	goto __finally17;
	__catch17_g_error:
	{
		_data_->_vala1_err = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp15_ = _data_->_vala1_err;
		_data_->_tmp16_ = _data_->_tmp15_->message;
		g_warning ("libvirt-machine.vala:225: %s", _data_->_tmp16_);
		_g_error_free0 (_data_->_vala1_err);
	}
	__finally17:
	if (_data_->_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	_data_->_tmp17_ = NULL;
	_data_->_tmp17_ = g_new0 (gdouble, 0);
	_data_->self->cpu_stats = (g_free (_data_->self->cpu_stats), NULL);
	_data_->self->cpu_stats = _data_->_tmp17_;
	_data_->self->cpu_stats_length1 = 0;
	_data_->self->_cpu_stats_size_ = _data_->self->cpu_stats_length1;
	_data_->_tmp18_ = NULL;
	_data_->_tmp18_ = g_new0 (gdouble, 0);
	_data_->self->io_stats = (g_free (_data_->self->io_stats), NULL);
	_data_->self->io_stats = _data_->_tmp18_;
	_data_->self->io_stats_length1 = 0;
	_data_->self->_io_stats_size_ = _data_->self->io_stats_length1;
	_data_->_tmp19_ = NULL;
	_data_->_tmp19_ = g_new0 (gdouble, 0);
	_data_->self->net_stats = (g_free (_data_->self->net_stats), NULL);
	_data_->self->net_stats = _data_->_tmp19_;
	_data_->self->net_stats_length1 = 0;
	_data_->self->_net_stats_size_ = _data_->self->net_stats_length1;
	_data_->_tmp20_ = _data_->self->priv->stats;
	_data_->_tmp20__length1 = _data_->self->priv->stats_length1;
	{
		_data_->stat_collection_length1 = 0;
		_data_->_stat_collection_size_ = 0;
		_data_->stat_collection = _data_->_tmp20_;
		_data_->stat_collection_length1 = _data_->_tmp20__length1;
		for (_data_->stat_it = 0; _data_->stat_it < _data_->_tmp20__length1; _data_->stat_it = _data_->stat_it + 1) {
			memset (&_data_->_tmp21_, 0, sizeof (BoxesLibvirtMachineMachineStat));
			boxes_libvirt_machine_machine_stat_copy (&_data_->stat_collection[_data_->stat_it], &_data_->_tmp21_);
			_data_->_vala1_stat = _data_->_tmp21_;
			{
				_data_->_tmp22_ = _data_->self->cpu_stats;
				_data_->_tmp22__length1 = _data_->self->cpu_stats_length1;
				_data_->_tmp23_ = _data_->_vala1_stat;
				_data_->_tmp24_ = _data_->_tmp23_.cpu_guest_percent;
				_vala_array_add3 (&_data_->self->cpu_stats, &_data_->self->cpu_stats_length1, &_data_->self->_cpu_stats_size_, _data_->_tmp24_);
				_data_->_tmp25_ = _data_->self->net_stats;
				_data_->_tmp25__length1 = _data_->self->net_stats_length1;
				_data_->_tmp26_ = _data_->_vala1_stat;
				_data_->_tmp27_ = _data_->_tmp26_.net_read;
				_data_->_tmp28_ = _data_->_vala1_stat;
				_data_->_tmp29_ = _data_->_tmp28_.net_write;
				_vala_array_add4 (&_data_->self->net_stats, &_data_->self->net_stats_length1, &_data_->self->_net_stats_size_, _data_->_tmp27_ + _data_->_tmp29_);
				_data_->_tmp30_ = _data_->self->io_stats;
				_data_->_tmp30__length1 = _data_->self->io_stats_length1;
				_data_->_tmp31_ = _data_->_vala1_stat;
				_data_->_tmp32_ = _data_->_tmp31_.disk_read;
				_data_->_tmp33_ = _data_->_vala1_stat;
				_data_->_tmp34_ = _data_->_tmp33_.disk_write;
				_vala_array_add5 (&_data_->self->io_stats, &_data_->self->io_stats_length1, &_data_->self->_io_stats_size_, _data_->_tmp32_ + _data_->_tmp34_);
				boxes_libvirt_machine_machine_stat_destroy (&_data_->_vala1_stat);
			}
		}
	}
	g_signal_emit_by_name (_data_->self, "stats-updated");
	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 Block18Data* block18_data_ref (Block18Data* _data18_) {
	g_atomic_int_inc (&_data18_->_ref_count_);
	return _data18_;
}


static void block18_data_unref (void * _userdata_) {
	Block18Data* _data18_;
	_data18_ = (Block18Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data18_->_ref_count_)) {
		BoxesLibvirtMachine * self;
		self = _data18_->self;
		_g_object_unref0 (self);
		g_slice_free (Block18Data, _data18_);
	}
}


static void __lambda78_ (Block18Data* _data18_) {
	BoxesLibvirtMachine * self;
	self = _data18_->self;
	_data18_->stats_updating = FALSE;
}


static void ___lambda78__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	__lambda78_ (self);
	block18_data_unref (self);
}


static gboolean ___lambda75_ (Block18Data* _data18_) {
	BoxesLibvirtMachine * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	self = _data18_->self;
	_tmp0_ = _data18_->stats_updating;
	if (_tmp0_) {
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		_tmp1_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
		_tmp2_ = _tmp1_;
		g_warning ("libvirt-machine.vala:251: Fetching of stats for '%s' is taking too lon" \
"g. Probably a libvirt bug.", _tmp2_);
		result = TRUE;
		return result;
	}
	_data18_->stats_updating = TRUE;
	boxes_libvirt_machine_update_stats (self, ___lambda78__gasync_ready_callback, block18_data_ref (_data18_));
	result = TRUE;
	return result;
}


static gboolean ____lambda75__gsource_func (gpointer self) {
	gboolean result;
	result = ___lambda75_ (self);
	return result;
}


static void boxes_libvirt_machine_set_stats_enable (BoxesLibvirtMachine* self, gboolean enable) {
	gboolean _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = enable;
	if (_tmp0_) {
		Block18Data* _data18_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		guint _tmp5_;
		GCancellable* _tmp6_;
		guint _tmp7_ = 0U;
		_data18_ = g_slice_new0 (Block18Data);
		_data18_->_ref_count_ = 1;
		_data18_->self = g_object_ref (self);
		_tmp1_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_strconcat ("enable statistics for ", _tmp2_, NULL);
		_tmp4_ = _tmp3_;
		g_debug ("libvirt-machine.vala:243: %s", _tmp4_);
		_g_free0 (_tmp4_);
		_tmp5_ = self->priv->stats_update_timeout;
		if (_tmp5_ != ((guint) 0)) {
			block18_data_unref (_data18_);
			_data18_ = NULL;
			return;
		}
		_tmp6_ = self->priv->stats_cancellable;
		g_cancellable_reset (_tmp6_);
		_data18_->stats_updating = FALSE;
		_tmp7_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 1, ____lambda75__gsource_func, block18_data_ref (_data18_), block18_data_unref);
		self->priv->stats_update_timeout = _tmp7_;
		block18_data_unref (_data18_);
		_data18_ = NULL;
	} else {
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		guint _tmp12_;
		_tmp8_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
		_tmp9_ = _tmp8_;
		_tmp10_ = g_strconcat ("disable statistics for ", _tmp9_, NULL);
		_tmp11_ = _tmp10_;
		g_debug ("libvirt-machine.vala:262: %s", _tmp11_);
		_g_free0 (_tmp11_);
		_tmp12_ = self->priv->stats_update_timeout;
		if (_tmp12_ != ((guint) 0)) {
			GCancellable* _tmp13_;
			guint _tmp14_;
			_tmp13_ = self->priv->stats_cancellable;
			g_cancellable_cancel (_tmp13_);
			_tmp14_ = self->priv->stats_update_timeout;
			g_source_remove (_tmp14_);
		}
		self->priv->stats_update_timeout = (guint) 0;
	}
}


void boxes_libvirt_machine_try_change_name (BoxesLibvirtMachine* self, const gchar* name, GError** error) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	{
		GVirDomain* _tmp0_;
		GVirConfigDomain* _tmp1_ = NULL;
		GVirConfigDomain* config;
		GVirConfigDomain* _tmp2_;
		const gchar* _tmp3_;
		GVirDomain* _tmp4_;
		GVirConfigDomain* _tmp5_;
		const gchar* _tmp6_;
		_tmp0_ = self->domain;
		_tmp1_ = gvir_domain_get_config (_tmp0_, (guint) GVIR_DOMAIN_XML_INACTIVE, &_inner_error_);
		config = _tmp1_;
		if (_inner_error_ != NULL) {
			goto __catch18_g_error;
		}
		_tmp2_ = config;
		_tmp3_ = name;
		gvir_config_domain_set_title (_tmp2_, _tmp3_);
		_tmp4_ = self->domain;
		_tmp5_ = config;
		gvir_domain_set_config (_tmp4_, _tmp5_, &_inner_error_);
		if (_inner_error_ != NULL) {
			_g_object_unref0 (config);
			goto __catch18_g_error;
		}
		_tmp6_ = name;
		boxes_collection_item_set_name ((BoxesCollectionItem*) self, _tmp6_);
		_g_object_unref0 (config);
	}
	goto __finally18;
	__catch18_g_error:
	{
		GError* _error_ = NULL;
		GVirDomain* _tmp7_;
		const gchar* _tmp8_ = NULL;
		const gchar* _tmp9_;
		GError* _tmp10_;
		const gchar* _tmp11_;
		GError* _tmp12_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp7_ = self->domain;
		_tmp8_ = gvir_domain_get_name (_tmp7_);
		_tmp9_ = name;
		_tmp10_ = _error_;
		_tmp11_ = _tmp10_->message;
		g_warning ("libvirt-machine.vala:281: Failed to change title of box '%s' to '%s': " \
"%s", _tmp8_, _tmp9_, _tmp11_);
		_tmp12_ = g_error_new_literal (BOXES_ERROR, BOXES_ERROR_INVALID, "Invalid libvirt title");
		_inner_error_ = _tmp12_;
		_g_error_free0 (_error_);
		goto __finally18;
	}
	__finally18:
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == BOXES_ERROR) {
			g_propagate_error (error, _inner_error_);
			return;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
	}
}


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


static void _g_list_free__g_object_unref0_ (GList* self) {
	g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
	g_list_free (self);
}


static void ___lambda79_ (BoxesLibvirtMachine* self, BoxesProperty* property, const gchar* name, GError** error) {
	const gchar* _tmp0_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (property != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = name;
	boxes_libvirt_machine_try_change_name (self, _tmp0_, &_inner_error_);
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == BOXES_ERROR) {
			g_propagate_error (error, _inner_error_);
			return;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
	}
}


static void ____lambda79__property_string_changed (BoxesProperty* property, const gchar* value, gpointer self, GError** error) {
	___lambda79_ (self, property, value, error);
}


static GList* boxes_libvirt_machine_real_get_properties (BoxesMachine* base, BoxesPropertiesPage page) {
	BoxesLibvirtMachine * self;
	GList* result = NULL;
	GList* list;
	BoxesDisplay* _tmp0_;
	BoxesDisplay* _tmp1_;
	BoxesPropertiesPage _tmp4_;
	BoxesDisplay* _tmp36_;
	BoxesDisplay* _tmp37_;
	GError * _inner_error_ = NULL;
	self = (BoxesLibvirtMachine*) base;
	list = NULL;
	_tmp0_ = boxes_machine_get_display ((BoxesMachine*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		{
			boxes_libvirt_machine_update_display (self, &_inner_error_);
			if (_inner_error_ != NULL) {
				goto __catch19_g_error;
			}
		}
		goto __finally19;
		__catch19_g_error:
		{
			GError* e = NULL;
			GError* _tmp2_;
			const gchar* _tmp3_;
			e = _inner_error_;
			_inner_error_ = NULL;
			_tmp2_ = e;
			_tmp3_ = _tmp2_->message;
			g_warning ("libvirt-machine.vala:295: %s", _tmp3_);
			_g_error_free0 (e);
		}
		__finally19:
		if (_inner_error_ != NULL) {
			__g_list_free__g_object_unref0_0 (list);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	_tmp4_ = page;
	switch (_tmp4_) {
		case BOXES_PROPERTIES_PAGE_LOGIN:
		{
			const gchar* _tmp5_ = NULL;
			const gchar* _tmp6_;
			const gchar* _tmp7_;
			BoxesProperty* _tmp8_ = NULL;
			BoxesProperty* _tmp9_;
			const gchar* _tmp10_ = NULL;
			BoxesCollectionSource* _tmp11_;
			gchar* _tmp12_;
			gchar* _tmp13_;
			gchar* _tmp14_;
			BoxesProperty* _tmp15_ = NULL;
			BoxesProperty* _tmp16_;
			BoxesDisplay* _tmp17_;
			BoxesDisplay* _tmp18_;
			_tmp5_ = _ ("Name");
			_tmp6_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
			_tmp7_ = _tmp6_;
			_tmp8_ = boxes_iproperties_provider_add_string_property ((BoxesIPropertiesProvider*) self, &list, _tmp5_, _tmp7_, ____lambda79__property_string_changed, self);
			_tmp9_ = _tmp8_;
			_g_object_unref0 (_tmp9_);
			_tmp10_ = _ ("Virtualizer");
			_tmp11_ = ((BoxesMachine*) self)->source;
			_tmp12_ = boxes_collection_source_get_uri (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = _tmp13_;
			_tmp15_ = boxes_iproperties_provider_add_string_property ((BoxesIPropertiesProvider*) self, &list, _tmp10_, _tmp14_, NULL, NULL);
			_tmp16_ = _tmp15_;
			_g_object_unref0 (_tmp16_);
			_g_free0 (_tmp14_);
			_tmp17_ = boxes_machine_get_display ((BoxesMachine*) self);
			_tmp18_ = _tmp17_;
			if (_tmp18_ != NULL) {
				const gchar* _tmp19_ = NULL;
				BoxesDisplay* _tmp20_;
				BoxesDisplay* _tmp21_;
				gchar* _tmp22_;
				gchar* _tmp23_;
				gchar* _tmp24_;
				BoxesProperty* _tmp25_ = NULL;
				BoxesProperty* _tmp26_;
				_tmp19_ = _ ("URI");
				_tmp20_ = boxes_machine_get_display ((BoxesMachine*) self);
				_tmp21_ = _tmp20_;
				_tmp22_ = boxes_display_get_uri (_tmp21_);
				_tmp23_ = _tmp22_;
				_tmp24_ = _tmp23_;
				_tmp25_ = boxes_iproperties_provider_add_string_property ((BoxesIPropertiesProvider*) self, &list, _tmp19_, _tmp24_, NULL, NULL);
				_tmp26_ = _tmp25_;
				_g_object_unref0 (_tmp26_);
				_g_free0 (_tmp24_);
			}
			break;
		}
		case BOXES_PROPERTIES_PAGE_SYSTEM:
		{
			boxes_libvirt_machine_add_ram_property (self, &list);
			boxes_libvirt_machine_add_storage_property (self, &list);
			break;
		}
		case BOXES_PROPERTIES_PAGE_DISPLAY:
		{
			BoxesDisplay* _tmp27_;
			BoxesDisplay* _tmp28_;
			_tmp27_ = boxes_machine_get_display ((BoxesMachine*) self);
			_tmp28_ = _tmp27_;
			if (_tmp28_ != NULL) {
				const gchar* _tmp29_ = NULL;
				BoxesDisplay* _tmp30_;
				BoxesDisplay* _tmp31_;
				const gchar* _tmp32_;
				const gchar* _tmp33_;
				BoxesProperty* _tmp34_ = NULL;
				BoxesProperty* _tmp35_;
				_tmp29_ = _ ("Protocol");
				_tmp30_ = boxes_machine_get_display ((BoxesMachine*) self);
				_tmp31_ = _tmp30_;
				_tmp32_ = boxes_display_get_protocol (_tmp31_);
				_tmp33_ = _tmp32_;
				_tmp34_ = boxes_iproperties_provider_add_string_property ((BoxesIPropertiesProvider*) self, &list, _tmp29_, _tmp33_, NULL, NULL);
				_tmp35_ = _tmp34_;
				_g_object_unref0 (_tmp35_);
			}
			break;
		}
		default:
		break;
	}
	_tmp36_ = boxes_machine_get_display ((BoxesMachine*) self);
	_tmp37_ = _tmp36_;
	if (_tmp37_ != NULL) {
		BoxesDisplay* _tmp38_;
		BoxesDisplay* _tmp39_;
		BoxesPropertiesPage _tmp40_;
		GList* _tmp41_ = NULL;
		_tmp38_ = boxes_machine_get_display ((BoxesMachine*) self);
		_tmp39_ = _tmp38_;
		_tmp40_ = page;
		_tmp41_ = boxes_display_get_properties (_tmp39_, _tmp40_);
		list = g_list_concat (list, _tmp41_);
	}
	result = list;
	return result;
}


static void boxes_libvirt_machine_update_display (BoxesLibvirtMachine* self, GError** error) {
	BoxesDisplay* _tmp0_;
	BoxesDisplay* _tmp1_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	boxes_libvirt_machine_update_domain_config (self);
	_tmp0_ = boxes_machine_get_display ((BoxesMachine*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		BoxesDisplay* _tmp2_ = NULL;
		BoxesDisplay* _tmp3_;
		BoxesDisplay* _tmp4_;
		_tmp2_ = boxes_libvirt_machine_create_display (self, &_inner_error_);
		_tmp3_ = _tmp2_;
		if (_inner_error_ != NULL) {
			g_propagate_error (error, _inner_error_);
			return;
		}
		_tmp4_ = _tmp3_;
		boxes_machine_set_display ((BoxesMachine*) self, _tmp4_);
		_g_object_unref0 (_tmp4_);
	}
}


static const gchar* string_to_string (const gchar* self) {
	const gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}


static BoxesDisplay* boxes_libvirt_machine_create_display (BoxesLibvirtMachine* self, GError** error) {
	BoxesDisplay* result = NULL;
	gchar* type = NULL;
	gchar* port = NULL;
	gchar* socket = NULL;
	gchar* host = NULL;
	GVirConfigDomain* _tmp0_;
	gchar* _tmp1_ = NULL;
	gchar* xmldoc;
	const gchar* _tmp2_;
	gchar* _tmp3_ = NULL;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_ = NULL;
	gchar* _tmp8_ = NULL;
	gchar* _tmp9_;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_;
	gchar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_ = NULL;
	gchar* _tmp16_ = NULL;
	gchar* _tmp17_;
	gchar* _tmp18_ = NULL;
	gchar* _tmp19_;
	gchar* _tmp20_;
	const gchar* _tmp21_;
	const gchar* _tmp22_;
	const gchar* _tmp23_ = NULL;
	gchar* _tmp24_ = NULL;
	gchar* _tmp25_;
	gchar* _tmp26_ = NULL;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gboolean _tmp29_ = FALSE;
	const gchar* _tmp30_;
	gboolean _tmp32_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	GQuark _tmp37_ = 0U;
	static GQuark _tmp36_label0 = 0;
	static GQuark _tmp36_label1 = 0;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->domain_config;
	_tmp1_ = gvir_config_object_to_xml ((GVirConfigObject*) _tmp0_);
	xmldoc = _tmp1_;
	_tmp2_ = xmldoc;
	_tmp3_ = boxes_extract_xpath (_tmp2_, "string(/domain/devices/graphics/@type)", TRUE, &_inner_error_);
	_tmp4_ = _tmp3_;
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == BOXES_ERROR) {
			g_propagate_error (error, _inner_error_);
			_g_free0 (xmldoc);
			_g_free0 (host);
			_g_free0 (socket);
			_g_free0 (port);
			_g_free0 (type);
			return NULL;
		} else {
			_g_free0 (xmldoc);
			_g_free0 (host);
			_g_free0 (socket);
			_g_free0 (port);
			_g_free0 (type);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	_g_free0 (type);
	type = _tmp4_;
	_tmp5_ = xmldoc;
	_tmp6_ = type;
	_tmp7_ = string_to_string (_tmp6_);
	_tmp8_ = g_strconcat ("string(/domain/devices/graphics[@type='", _tmp7_, "']/@port)", NULL);
	_tmp9_ = _tmp8_;
	_tmp10_ = boxes_extract_xpath (_tmp5_, _tmp9_, FALSE, &_inner_error_);
	_tmp11_ = _tmp10_;
	_g_free0 (_tmp9_);
	_tmp12_ = _tmp11_;
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == BOXES_ERROR) {
			g_propagate_error (error, _inner_error_);
			_g_free0 (xmldoc);
			_g_free0 (host);
			_g_free0 (socket);
			_g_free0 (port);
			_g_free0 (type);
			return NULL;
		} else {
			_g_free0 (xmldoc);
			_g_free0 (host);
			_g_free0 (socket);
			_g_free0 (port);
			_g_free0 (type);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	_g_free0 (port);
	port = _tmp12_;
	_tmp13_ = xmldoc;
	_tmp14_ = type;
	_tmp15_ = string_to_string (_tmp14_);
	_tmp16_ = g_strconcat ("string(/domain/devices/graphics[@type='", _tmp15_, "']/@socket)", NULL);
	_tmp17_ = _tmp16_;
	_tmp18_ = boxes_extract_xpath (_tmp13_, _tmp17_, FALSE, &_inner_error_);
	_tmp19_ = _tmp18_;
	_g_free0 (_tmp17_);
	_tmp20_ = _tmp19_;
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == BOXES_ERROR) {
			g_propagate_error (error, _inner_error_);
			_g_free0 (xmldoc);
			_g_free0 (host);
			_g_free0 (socket);
			_g_free0 (port);
			_g_free0 (type);
			return NULL;
		} else {
			_g_free0 (xmldoc);
			_g_free0 (host);
			_g_free0 (socket);
			_g_free0 (port);
			_g_free0 (type);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	_g_free0 (socket);
	socket = _tmp20_;
	_tmp21_ = xmldoc;
	_tmp22_ = type;
	_tmp23_ = string_to_string (_tmp22_);
	_tmp24_ = g_strconcat ("string(/domain/devices/graphics[@type='", _tmp23_, "']/@listen)", NULL);
	_tmp25_ = _tmp24_;
	_tmp26_ = boxes_extract_xpath (_tmp21_, _tmp25_, FALSE, &_inner_error_);
	_tmp27_ = _tmp26_;
	_g_free0 (_tmp25_);
	_tmp28_ = _tmp27_;
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == BOXES_ERROR) {
			g_propagate_error (error, _inner_error_);
			_g_free0 (xmldoc);
			_g_free0 (host);
			_g_free0 (socket);
			_g_free0 (port);
			_g_free0 (type);
			return NULL;
		} else {
			_g_free0 (xmldoc);
			_g_free0 (host);
			_g_free0 (socket);
			_g_free0 (port);
			_g_free0 (type);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	_g_free0 (host);
	host = _tmp28_;
	_tmp30_ = host;
	if (_tmp30_ == NULL) {
		_tmp29_ = TRUE;
	} else {
		const gchar* _tmp31_;
		_tmp31_ = host;
		_tmp29_ = g_strcmp0 (_tmp31_, "") == 0;
	}
	_tmp32_ = _tmp29_;
	if (_tmp32_) {
		gchar* _tmp33_;
		_tmp33_ = g_strdup ("localhost");
		_g_free0 (host);
		host = _tmp33_;
	}
	_tmp34_ = type;
	_tmp35_ = _tmp34_;
	_tmp37_ = (NULL == _tmp35_) ? 0 : g_quark_from_string (_tmp35_);
	if (_tmp37_ == ((0 != _tmp36_label0) ? _tmp36_label0 : (_tmp36_label0 = g_quark_from_static_string ("spice")))) {
		switch (0) {
			default:
			{
				BoxesDisplayConfig* _tmp38_;
				const gchar* _tmp39_;
				const gchar* _tmp40_;
				gint _tmp41_ = 0;
				BoxesSpiceDisplay* _tmp42_;
				_tmp38_ = ((BoxesMachine*) self)->config;
				_tmp39_ = host;
				_tmp40_ = port;
				_tmp41_ = atoi (_tmp40_);
				_tmp42_ = boxes_spice_display_new (_tmp38_, _tmp39_, _tmp41_);
				result = (BoxesDisplay*) _tmp42_;
				_g_free0 (xmldoc);
				_g_free0 (host);
				_g_free0 (socket);
				_g_free0 (port);
				_g_free0 (type);
				return result;
			}
		}
	} else if (_tmp37_ == ((0 != _tmp36_label1) ? _tmp36_label1 : (_tmp36_label1 = g_quark_from_static_string ("vnc")))) {
		switch (0) {
			default:
			{
				BoxesDisplayConfig* _tmp43_;
				const gchar* _tmp44_;
				const gchar* _tmp45_;
				gint _tmp46_ = 0;
				BoxesVncDisplay* _tmp47_;
				_tmp43_ = ((BoxesMachine*) self)->config;
				_tmp44_ = host;
				_tmp45_ = port;
				_tmp46_ = atoi (_tmp45_);
				_tmp47_ = boxes_vnc_display_new (_tmp43_, _tmp44_, _tmp46_);
				result = (BoxesDisplay*) _tmp47_;
				_g_free0 (xmldoc);
				_g_free0 (host);
				_g_free0 (socket);
				_g_free0 (port);
				_g_free0 (type);
				return result;
			}
		}
	} else {
		switch (0) {
			default:
			{
				const gchar* _tmp48_;
				gchar* _tmp49_;
				gchar* _tmp50_;
				GError* _tmp51_;
				GError* _tmp52_;
				_tmp48_ = type;
				_tmp49_ = g_strconcat ("unsupported display of type ", _tmp48_, NULL);
				_tmp50_ = _tmp49_;
				_tmp51_ = g_error_new_literal (BOXES_ERROR, BOXES_ERROR_INVALID, _tmp50_);
				_tmp52_ = _tmp51_;
				_g_free0 (_tmp50_);
				_inner_error_ = _tmp52_;
				if (_inner_error_->domain == BOXES_ERROR) {
					g_propagate_error (error, _inner_error_);
					_g_free0 (xmldoc);
					_g_free0 (host);
					_g_free0 (socket);
					_g_free0 (port);
					_g_free0 (type);
					return NULL;
				} else {
					_g_free0 (xmldoc);
					_g_free0 (host);
					_g_free0 (socket);
					_g_free0 (port);
					_g_free0 (type);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
					g_clear_error (&_inner_error_);
					return NULL;
				}
			}
		}
	}
	_g_free0 (xmldoc);
	_g_free0 (host);
	_g_free0 (socket);
	_g_free0 (port);
	_g_free0 (type);
}


static void boxes_libvirt_machine_real_take_screenshot_data_free (gpointer _data) {
	BoxesLibvirtMachineTakeScreenshotData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesLibvirtMachineTakeScreenshotData, _data_);
}


static void boxes_libvirt_machine_real_take_screenshot (BoxesMachine* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesLibvirtMachine * self;
	BoxesLibvirtMachineTakeScreenshotData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	self = (BoxesLibvirtMachine*) base;
	_data_ = g_slice_new0 (BoxesLibvirtMachineTakeScreenshotData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_libvirt_machine_real_take_screenshot);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_libvirt_machine_real_take_screenshot_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	boxes_libvirt_machine_real_take_screenshot_co (_data_);
}


static GdkPixbuf* boxes_libvirt_machine_real_take_screenshot_finish (BoxesMachine* base, GAsyncResult* _res_, GError** error) {
	GdkPixbuf* result;
	BoxesLibvirtMachineTakeScreenshotData* _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 Block19Data* block19_data_ref (Block19Data* _data19_) {
	g_atomic_int_inc (&_data19_->_ref_count_);
	return _data19_;
}


static void block19_data_unref (void * _userdata_) {
	Block19Data* _data19_;
	_data19_ = (Block19Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
		BoxesLibvirtMachine * self;
		self = _data19_->self;
		_g_object_unref0 (_data19_->stream);
		_g_object_unref0 (self);
		g_slice_free (Block19Data, _data19_);
	}
}


static void boxes_libvirt_machine_take_screenshot_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesLibvirtMachineTakeScreenshotData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_machine_real_take_screenshot_co (_data_);
}


static void __lambda86_ (Block19Data* _data19_, GError** error) {
	BoxesLibvirtMachine * self;
	GVirDomain* _tmp0_;
	GVirStream* _tmp1_;
	gchar* _tmp2_ = NULL;
	gchar* _tmp3_;
	GError * _inner_error_ = NULL;
	self = _data19_->self;
	_tmp0_ = self->domain;
	_tmp1_ = _data19_->stream;
	_tmp2_ = gvir_domain_screenshot (_tmp0_, _tmp1_, (guint) 0, (guint) 0, &_inner_error_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp3_);
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return;
	}
}


static void ___lambda86__boxes_run_in_thread_func (gpointer self, GError** error) {
	__lambda86_ (self, error);
}


static gboolean boxes_libvirt_machine_real_take_screenshot_co (BoxesLibvirtMachineTakeScreenshotData* _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_->_data19_ = g_slice_new0 (Block19Data);
	_data_->_data19_->_ref_count_ = 1;
	_data_->_data19_->self = g_object_ref (_data_->self);
	_data_->_data19_->_async_data_ = _data_;
	_data_->state = GVIR_DOMAIN_STATE_NONE;
	{
		_data_->_tmp0_ = _data_->self->domain;
		_data_->_state_ = 1;
		gvir_domain_get_info_async (_data_->_tmp0_, NULL, boxes_libvirt_machine_take_screenshot_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp1_ = NULL;
		_data_->_tmp1_ = gvir_domain_get_info_finish (_data_->_tmp0_, _data_->_res_, &_data_->_inner_error_);
		_data_->_tmp2_ = _data_->_tmp1_;
		if (_data_->_inner_error_ != NULL) {
			goto __catch20_g_error;
		}
		_data_->_tmp3_ = _data_->_tmp2_;
		_data_->_tmp4_ = _data_->_tmp3_->state;
		_data_->state = _data_->_tmp4_;
		__vala_GVirDomainInfo_free0 (_data_->_tmp3_);
	}
	goto __finally20;
	__catch20_g_error:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp5_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->self);
		_data_->_tmp6_ = _data_->_tmp5_;
		g_warning ("libvirt-machine.vala:361: Failed to get information on '%s'", _data_->_tmp6_);
		_g_error_free0 (_data_->_error_);
	}
	__finally20:
	if (_data_->_inner_error_ != NULL) {
		g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
		g_error_free (_data_->_inner_error_);
		block19_data_unref (_data_->_data19_);
		_data_->_data19_ = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp8_ = _data_->state;
	if (_data_->_tmp8_ != GVIR_DOMAIN_STATE_RUNNING) {
		_data_->_tmp9_ = _data_->state;
		_data_->_tmp7_ = _data_->_tmp9_ != GVIR_DOMAIN_STATE_PAUSED;
	} else {
		_data_->_tmp7_ = FALSE;
	}
	_data_->_tmp10_ = _data_->_tmp7_;
	if (_data_->_tmp10_) {
		_data_->result = NULL;
		block19_data_unref (_data_->_data19_);
		_data_->_data19_ = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp11_ = _data_->self->connection;
	_data_->_tmp12_ = NULL;
	_data_->_tmp12_ = gvir_connection_get_stream (_data_->_tmp11_, (guint) 0);
	_data_->_data19_->stream = _data_->_tmp12_;
	_data_->_state_ = 2;
	boxes_run_in_thread (___lambda86__boxes_run_in_thread_func, block19_data_ref (_data_->_data19_), block19_data_unref, NULL, boxes_libvirt_machine_take_screenshot_ready, _data_);
	return FALSE;
	_state_2:
	boxes_run_in_thread_finish (_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_);
		block19_data_unref (_data_->_data19_);
		_data_->_data19_ = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp13_ = gdk_pixbuf_loader_new ();
	_data_->loader = _data_->_tmp13_;
	_data_->_tmp14_ = _data_->_data19_->stream;
	_data_->_tmp15_ = NULL;
	_data_->_tmp15_ = g_io_stream_get_input_stream ((GIOStream*) _data_->_tmp14_);
	_data_->_tmp16_ = _g_object_ref0 (_data_->_tmp15_);
	_data_->input_stream = _data_->_tmp16_;
	_data_->_tmp17_ = NULL;
	_data_->_tmp17_ = g_new0 (guint8, 65535);
	_data_->buffer = _data_->_tmp17_;
	_data_->buffer_length1 = 65535;
	_data_->_buffer_size_ = _data_->buffer_length1;
	_data_->length = (gssize) 0;
	{
		_data_->_tmp18_ = TRUE;
		while (TRUE) {
			_data_->_tmp19_ = _data_->_tmp18_;
			if (!_data_->_tmp19_) {
				_data_->_tmp20_ = _data_->length;
				if (!(_data_->_tmp20_ > ((gssize) 0))) {
					break;
				}
			}
			_data_->_tmp18_ = FALSE;
			_data_->_tmp21_ = _data_->input_stream;
			_data_->_tmp22_ = _data_->buffer;
			_data_->_tmp22__length1 = _data_->buffer_length1;
			_data_->_state_ = 3;
			g_input_stream_read_async (_data_->_tmp21_, (void*) _data_->_tmp22_, (gsize) _data_->_tmp22__length1, G_PRIORITY_DEFAULT, NULL, boxes_libvirt_machine_take_screenshot_ready, _data_);
			return FALSE;
			_state_3:
			_data_->_tmp23_ = 0L;
			_data_->_tmp23_ = g_input_stream_read_finish (_data_->_tmp21_, _data_->_res_, &_data_->_inner_error_);
			_data_->_tmp24_ = _data_->_tmp23_;
			if (_data_->_inner_error_ != NULL) {
				g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
				g_error_free (_data_->_inner_error_);
				_data_->buffer = (g_free (_data_->buffer), NULL);
				_g_object_unref0 (_data_->input_stream);
				_g_object_unref0 (_data_->loader);
				block19_data_unref (_data_->_data19_);
				_data_->_data19_ = NULL;
				if (_data_->_state_ == 0) {
					g_simple_async_result_complete_in_idle (_data_->_async_result);
				} else {
					g_simple_async_result_complete (_data_->_async_result);
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_data_->length = _data_->_tmp24_;
			_data_->_tmp25_ = _data_->loader;
			_data_->_tmp26_ = _data_->buffer;
			_data_->_tmp26__length1 = _data_->buffer_length1;
			_data_->_tmp27_ = _data_->length;
			gdk_pixbuf_loader_write (_data_->_tmp25_, _data_->_tmp26_ + 0, (gsize) (_data_->_tmp27_ - 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_);
				_data_->buffer = (g_free (_data_->buffer), NULL);
				_g_object_unref0 (_data_->input_stream);
				_g_object_unref0 (_data_->loader);
				block19_data_unref (_data_->_data19_);
				_data_->_data19_ = NULL;
				if (_data_->_state_ == 0) {
					g_simple_async_result_complete_in_idle (_data_->_async_result);
				} else {
					g_simple_async_result_complete (_data_->_async_result);
				}
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
	}
	_data_->_tmp28_ = _data_->loader;
	gdk_pixbuf_loader_close (_data_->_tmp28_, &_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_);
		_data_->buffer = (g_free (_data_->buffer), NULL);
		_g_object_unref0 (_data_->input_stream);
		_g_object_unref0 (_data_->loader);
		block19_data_unref (_data_->_data19_);
		_data_->_data19_ = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp29_ = _data_->loader;
	_data_->_tmp30_ = NULL;
	_data_->_tmp30_ = gdk_pixbuf_loader_get_pixbuf (_data_->_tmp29_);
	_data_->_tmp31_ = _g_object_ref0 (_data_->_tmp30_);
	_data_->result = _data_->_tmp31_;
	_data_->buffer = (g_free (_data_->buffer), NULL);
	_g_object_unref0 (_data_->input_stream);
	_g_object_unref0 (_data_->loader);
	block19_data_unref (_data_->_data19_);
	_data_->_data19_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
	_data_->buffer = (g_free (_data_->buffer), NULL);
	_g_object_unref0 (_data_->input_stream);
	_g_object_unref0 (_data_->loader);
	block19_data_unref (_data_->_data19_);
	_data_->_data19_ = NULL;
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static Block20Data* block20_data_ref (Block20Data* _data20_) {
	g_atomic_int_inc (&_data20_->_ref_count_);
	return _data20_;
}


static void block20_data_unref (void * _userdata_) {
	Block20Data* _data20_;
	_data20_ = (Block20Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data20_->_ref_count_)) {
		BoxesLibvirtMachine * self;
		self = _data20_->self;
		_g_object_unref0 (_data20_->domain);
		_g_object_unref0 (self);
		g_slice_free (Block20Data, _data20_);
	}
}


static void ___lambda87_ (Block20Data* _data20_, GError** error) {
	BoxesLibvirtMachine * self;
	GVirStorageVol* _tmp6_;
	GError * _inner_error_ = NULL;
	self = _data20_->self;
	{
		GVirDomain* _tmp0_;
		_tmp0_ = _data20_->domain;
		gvir_domain_delete (_tmp0_, (guint) GVIR_DOMAIN_DELETE_SAVED_STATE, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch21_g_error;
		}
	}
	goto __finally21;
	__catch21_g_error:
	{
		GError* err = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		err = _inner_error_;
		_inner_error_ = NULL;
		_tmp1_ = err;
		_tmp2_ = _tmp1_->message;
		g_warning ("libvirt-machine.vala:401: %s", _tmp2_);
		_g_error_free0 (err);
	}
	__finally21:
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return;
	}
	{
		GVirDomain* _tmp3_;
		_tmp3_ = _data20_->domain;
		gvir_domain_stop (_tmp3_, (guint) 0, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch22_g_error;
		}
	}
	goto __finally22;
	__catch22_g_error:
	{
		GError* err = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		err = _inner_error_;
		_inner_error_ = NULL;
		_tmp4_ = err;
		_tmp5_ = _tmp4_->message;
		g_debug ("libvirt-machine.vala:408: %s", _tmp5_);
		_g_error_free0 (err);
	}
	__finally22:
	if (_inner_error_ != NULL) {
		g_propagate_error (error, _inner_error_);
		return;
	}
	_tmp6_ = self->storage_volume;
	if (_tmp6_ != NULL) {
		{
			GVirStorageVol* _tmp7_;
			_tmp7_ = self->storage_volume;
			gvir_storage_vol_delete (_tmp7_, (guint) 0, &_inner_error_);
			if (_inner_error_ != NULL) {
				goto __catch23_g_error;
			}
		}
		goto __finally23;
		__catch23_g_error:
		{
			GError* err = NULL;
			GError* _tmp8_;
			const gchar* _tmp9_;
			err = _inner_error_;
			_inner_error_ = NULL;
			_tmp8_ = err;
			_tmp9_ = _tmp8_->message;
			g_warning ("libvirt-machine.vala:416: %s", _tmp9_);
			_g_error_free0 (err);
		}
		__finally23:
		if (_inner_error_ != NULL) {
			g_propagate_error (error, _inner_error_);
			return;
		}
	}
}


static void ____lambda87__boxes_run_in_thread_func (gpointer self, GError** error) {
	___lambda87_ (self, error);
}


static void boxes_libvirt_machine_real_delete (BoxesMachine* base, gboolean by_user) {
	BoxesLibvirtMachine * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	self = (BoxesLibvirtMachine*) base;
	_tmp0_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strconcat ("delete libvirt machine: ", _tmp1_, NULL);
	_tmp3_ = _tmp2_;
	g_debug ("libvirt-machine.vala:386: %s", _tmp3_);
	_g_free0 (_tmp3_);
	_tmp4_ = by_user;
	BOXES_MACHINE_CLASS (boxes_libvirt_machine_parent_class)->delete (G_TYPE_CHECK_INSTANCE_CAST (self, BOXES_TYPE_MACHINE, BoxesMachine), _tmp4_);
	boxes_libvirt_machine_set_stats_enable (self, FALSE);
	_tmp5_ = by_user;
	if (_tmp5_) {
		Block20Data* _data20_;
		GVirDomain* _tmp6_;
		GVirDomain* _tmp7_;
		_data20_ = g_slice_new0 (Block20Data);
		_data20_->_ref_count_ = 1;
		_data20_->self = g_object_ref (self);
		_tmp6_ = self->domain;
		_tmp7_ = _g_object_ref0 (_tmp6_);
		_data20_->domain = _tmp7_;
		boxes_run_in_thread (____lambda87__boxes_run_in_thread_func, block20_data_ref (_data20_), block20_data_unref, NULL, NULL, NULL);
		block20_data_unref (_data20_);
		_data20_ = NULL;
	}
}


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


void boxes_libvirt_machine_suspend (BoxesLibvirtMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesLibvirtMachineSuspendData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	_data_ = g_slice_new0 (BoxesLibvirtMachineSuspendData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_libvirt_machine_suspend);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_libvirt_machine_suspend_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	boxes_libvirt_machine_suspend_co (_data_);
}


void boxes_libvirt_machine_suspend_finish (BoxesLibvirtMachine* self, GAsyncResult* _res_, GError** error) {
	BoxesLibvirtMachineSuspendData* _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_libvirt_machine_suspend_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesLibvirtMachineSuspendData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_machine_suspend_co (_data_);
}


static gboolean boxes_libvirt_machine_suspend_co (BoxesLibvirtMachineSuspendData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp1_ = boxes_libvirt_machine_get_save_on_quit (_data_->self);
	_data_->_tmp2_ = _data_->_tmp1_;
	if (_data_->_tmp2_) {
		_data_->_tmp3_ = _data_->self->domain;
		_data_->_state_ = 1;
		gvir_domain_save_async (_data_->_tmp3_, (guint) 0, NULL, boxes_libvirt_machine_suspend_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp4_ = FALSE;
		_data_->_tmp4_ = gvir_domain_save_finish (_data_->_tmp3_, _data_->_res_, &_data_->_inner_error_);
		_data_->_tmp0_ = _data_->_tmp4_;
		if (_data_->_inner_error_ != NULL) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			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;
		}
	} else {
		_data_->_tmp5_ = _data_->self->domain;
		_data_->_tmp6_ = FALSE;
		_data_->_tmp6_ = gvir_domain_suspend (_data_->_tmp5_, &_data_->_inner_error_);
		_data_->_tmp0_ = _data_->_tmp6_;
		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_->_tmp7_ = _data_->_tmp0_;
	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;
}


void boxes_libvirt_machine_force_shutdown (BoxesLibvirtMachine* self, gboolean confirm) {
	gboolean _tmp0_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = confirm;
	if (_tmp0_) {
		BoxesApp* _tmp1_;
		GtkApplicationWindow* _tmp2_;
		const gchar* _tmp3_ = NULL;
		GtkMessageDialog* _tmp4_;
		GtkMessageDialog* dialog;
		GtkMessageDialog* _tmp5_;
		gint _tmp6_ = 0;
		gint response;
		GtkMessageDialog* _tmp7_;
		gint _tmp8_;
		_tmp1_ = boxes_app_app;
		_tmp2_ = _tmp1_->window;
		_tmp3_ = _ ("When you force shutdown, the box may lose data.");
		_tmp4_ = (GtkMessageDialog*) gtk_message_dialog_new ((GtkWindow*) _tmp2_, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, _tmp3_);
		g_object_ref_sink (_tmp4_);
		dialog = _tmp4_;
		_tmp5_ = dialog;
		_tmp6_ = gtk_dialog_run ((GtkDialog*) _tmp5_);
		response = _tmp6_;
		_tmp7_ = dialog;
		gtk_widget_destroy ((GtkWidget*) _tmp7_);
		_tmp8_ = response;
		if (_tmp8_ != ((gint) GTK_RESPONSE_OK)) {
			_g_object_unref0 (dialog);
			return;
		}
		_g_object_unref0 (dialog);
	}
	_tmp9_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp10_ = _tmp9_;
	g_debug ("libvirt-machine.vala:440: Force shutdown '%s'..", _tmp10_);
	{
		GVirDomain* _tmp11_;
		_tmp11_ = self->domain;
		gvir_domain_stop (_tmp11_, (guint) 0, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch24_g_error;
		}
	}
	goto __finally24;
	__catch24_g_error:
	{
		GError* _error_ = NULL;
		GVirDomain* _tmp12_;
		const gchar* _tmp13_ = NULL;
		GError* _tmp14_;
		const gchar* _tmp15_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp12_ = self->domain;
		_tmp13_ = gvir_domain_get_name (_tmp12_);
		_tmp14_ = _error_;
		_tmp15_ = _tmp14_->message;
		g_warning ("libvirt-machine.vala:444: Failed to shutdown '%s': %s", _tmp13_, _tmp15_);
		_g_error_free0 (_error_);
	}
	__finally24:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static GVirDomainDisk* boxes_libvirt_machine_get_domain_disk (BoxesLibvirtMachine* self, GError** error) {
	GVirDomainDisk* result = NULL;
	GVirDomainDisk* _tmp0_;
	GVirDomainDisk* disk;
	GVirConfigDomain* _tmp1_;
	GList* _tmp2_ = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (NULL, gvir_domain_disk_get_type ()) ? ((GVirDomainDisk*) NULL) : NULL);
	disk = _tmp0_;
	_tmp1_ = self->domain_config;
	_tmp2_ = gvir_config_domain_get_devices (_tmp1_);
	{
		GList* device_config_collection = NULL;
		GList* device_config_it = NULL;
		device_config_collection = _tmp2_;
		for (device_config_it = device_config_collection; device_config_it != NULL; device_config_it = device_config_it->next) {
			GVirConfigDomainDevice* _tmp3_;
			GVirConfigDomainDevice* device_config = NULL;
			_tmp3_ = _g_object_ref0 ((GVirConfigDomainDevice*) device_config_it->data);
			device_config = _tmp3_;
			{
				GVirConfigDomainDevice* _tmp4_;
				_tmp4_ = device_config;
				if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, gvir_config_domain_disk_get_type ())) {
					GVirConfigDomainDevice* _tmp5_;
					GVirConfigDomainDisk* _tmp6_;
					GVirConfigDomainDisk* disk_config;
					GVirConfigDomainDisk* _tmp7_;
					GVirConfigDomainDiskGuestDeviceType _tmp8_ = 0;
					GVirConfigDomainDiskGuestDeviceType disk_type;
					const gchar* _tmp9_ = NULL;
					GVirStorageVol* _tmp10_;
					const gchar* _tmp13_;
					gchar* _tmp14_;
					gchar* storage_volume_path;
					gboolean _tmp15_ = FALSE;
					GVirConfigDomainDiskGuestDeviceType _tmp16_;
					gboolean _tmp20_;
					_tmp5_ = device_config;
					_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, gvir_config_domain_disk_get_type ()) ? ((GVirConfigDomainDisk*) _tmp5_) : NULL);
					disk_config = _tmp6_;
					_tmp7_ = disk_config;
					_tmp8_ = gvir_config_domain_disk_get_guest_device_type (_tmp7_);
					disk_type = _tmp8_;
					_tmp10_ = self->storage_volume;
					if (_tmp10_ != NULL) {
						GVirStorageVol* _tmp11_;
						const gchar* _tmp12_ = NULL;
						_tmp11_ = self->storage_volume;
						_tmp12_ = gvir_storage_vol_get_path (_tmp11_, &_inner_error_);
						_tmp9_ = _tmp12_;
						if (_inner_error_ != NULL) {
							g_propagate_error (error, _inner_error_);
							_g_object_unref0 (disk_config);
							_g_object_unref0 (device_config);
							__g_list_free__g_object_unref0_0 (device_config_collection);
							_g_object_unref0 (disk);
							return NULL;
						}
					} else {
						_tmp9_ = NULL;
					}
					_tmp13_ = _tmp9_;
					_tmp14_ = g_strdup (_tmp13_);
					storage_volume_path = _tmp14_;
					_tmp16_ = disk_type;
					if (_tmp16_ == GVIR_CONFIG_DOMAIN_DISK_GUEST_DEVICE_DISK) {
						GVirConfigDomainDisk* _tmp17_;
						const gchar* _tmp18_ = NULL;
						const gchar* _tmp19_;
						_tmp17_ = disk_config;
						_tmp18_ = gvir_config_domain_disk_get_source (_tmp17_);
						_tmp19_ = storage_volume_path;
						_tmp15_ = g_strcmp0 (_tmp18_, _tmp19_) == 0;
					} else {
						_tmp15_ = FALSE;
					}
					_tmp20_ = _tmp15_;
					if (_tmp20_) {
						GVirDomain* _tmp21_;
						GVirConfigDomainDevice* _tmp22_;
						GObject* _tmp23_ = NULL;
						GObject* _tmp24_;
						_tmp21_ = self->domain;
						_tmp22_ = device_config;
						_tmp23_ = g_object_new (gvir_domain_disk_get_type (), "domain", _tmp21_, "config", _tmp22_, NULL);
						_tmp24_ = G_IS_INITIALLY_UNOWNED (_tmp23_) ? g_object_ref_sink (_tmp23_) : _tmp23_;
						_g_object_unref0 (disk);
						disk = G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, gvir_domain_disk_get_type ()) ? ((GVirDomainDisk*) _tmp24_) : NULL;
						_g_free0 (storage_volume_path);
						_g_object_unref0 (disk_config);
						_g_object_unref0 (device_config);
						break;
					}
					_g_free0 (storage_volume_path);
					_g_object_unref0 (disk_config);
				}
				_g_object_unref0 (device_config);
			}
		}
		__g_list_free__g_object_unref0_0 (device_config_collection);
	}
	result = disk;
	return result;
}


static GVirDomainInterface* boxes_libvirt_machine_get_domain_network_interface (BoxesLibvirtMachine* self, GError** error) {
	GVirDomainInterface* result = NULL;
	GVirDomainInterface* _tmp0_;
	GVirDomainInterface* net;
	GVirConfigDomain* _tmp1_;
	GList* _tmp2_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (NULL, gvir_domain_interface_get_type ()) ? ((GVirDomainInterface*) NULL) : NULL);
	net = _tmp0_;
	_tmp1_ = self->domain_config;
	_tmp2_ = gvir_config_domain_get_devices (_tmp1_);
	{
		GList* device_config_collection = NULL;
		GList* device_config_it = NULL;
		device_config_collection = _tmp2_;
		for (device_config_it = device_config_collection; device_config_it != NULL; device_config_it = device_config_it->next) {
			GVirConfigDomainDevice* _tmp3_;
			GVirConfigDomainDevice* device_config = NULL;
			_tmp3_ = _g_object_ref0 ((GVirConfigDomainDevice*) device_config_it->data);
			device_config = _tmp3_;
			{
				GVirConfigDomainDevice* _tmp4_;
				_tmp4_ = device_config;
				if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, gvir_config_domain_interface_get_type ())) {
					GVirDomain* _tmp5_;
					GVirConfigDomainDevice* _tmp6_;
					GObject* _tmp7_ = NULL;
					GObject* _tmp8_;
					_tmp5_ = self->domain;
					_tmp6_ = device_config;
					_tmp7_ = g_object_new (gvir_domain_interface_get_type (), "domain", _tmp5_, "config", _tmp6_, NULL);
					_tmp8_ = G_IS_INITIALLY_UNOWNED (_tmp7_) ? g_object_ref_sink (_tmp7_) : _tmp7_;
					_g_object_unref0 (net);
					net = G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, gvir_domain_interface_get_type ()) ? ((GVirDomainInterface*) _tmp8_) : NULL;
					_g_object_unref0 (device_config);
					break;
				}
				_g_object_unref0 (device_config);
			}
		}
		__g_list_free__g_object_unref0_0 (device_config_collection);
	}
	result = net;
	return result;
}


static void boxes_libvirt_machine_update_ram_property (BoxesLibvirtMachine* self, BoxesProperty* property) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (property != NULL);
	{
		GVirDomain* _tmp0_;
		GVirConfigDomain* _tmp1_ = NULL;
		GVirConfigDomain* config;
		GVirConfigDomain* _tmp2_;
		guint64 _tmp3_;
		guint64 _tmp4_;
		guint64 actual;
		guint64 _tmp5_;
		guint64 _tmp6_;
		guint64 pending;
		guint64 _tmp7_;
		guint64 _tmp8_;
		BoxesProperty* _tmp9_;
		guint64 _tmp10_;
		guint64 _tmp11_;
		_tmp0_ = self->domain;
		_tmp1_ = gvir_domain_get_config (_tmp0_, (guint) GVIR_DOMAIN_XML_INACTIVE, &_inner_error_);
		config = _tmp1_;
		if (_inner_error_ != NULL) {
			goto __catch25_g_error;
		}
		_tmp2_ = self->domain_config;
		_tmp3_ = gvir_config_domain_get_memory (_tmp2_);
		_tmp4_ = _tmp3_;
		actual = _tmp4_ / 1024;
		_tmp5_ = gvir_config_domain_get_memory (config);
		_tmp6_ = _tmp5_;
		pending = _tmp6_ / 1024;
		_tmp7_ = actual;
		_tmp8_ = pending;
		g_debug ("libvirt-machine.vala:496: RAM actual: %llu, pending: %llu", _tmp7_, _tmp8_);
		_tmp9_ = property;
		_tmp10_ = actual;
		_tmp11_ = pending;
		boxes_property_set_reboot_required (_tmp9_, (_tmp10_ - _tmp11_) > ((guint64) 1));
		_g_object_unref0 (config);
	}
	goto __finally25;
	__catch25_g_error:
	{
		GError* e = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_g_error_free0 (e);
	}
	__finally25:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static Block21Data* block21_data_ref (Block21Data* _data21_) {
	g_atomic_int_inc (&_data21_->_ref_count_);
	return _data21_;
}


static void block21_data_unref (void * _userdata_) {
	Block21Data* _data21_;
	_data21_ = (Block21Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
		BoxesLibvirtMachine * self;
		self = _data21_->self;
		_g_object_unref0 (_data21_->property);
		_g_object_unref0 (self);
		g_slice_free (Block21Data, _data21_);
	}
}


static void _vala_GVirNodeInfo_free (GVirNodeInfo* self) {
	g_boxed_free (gvir_node_info_get_type (), self);
}


static void _boxes_libvirt_machine_on_ram_changed_property_size_changed (BoxesProperty* property, guint64 value, gpointer self) {
	boxes_libvirt_machine_on_ram_changed (self, property, value);
}


static void ___lambda84_ (Block21Data* _data21_) {
	BoxesLibvirtMachine * self;
	BoxesMachineMachineState _tmp0_;
	BoxesMachineMachineState _tmp1_;
	self = _data21_->self;
	_tmp0_ = boxes_machine_get_state ((BoxesMachine*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == BOXES_MACHINE_MACHINE_STATE_STOPPED) {
		BoxesProperty* _tmp2_;
		_tmp2_ = _data21_->property;
		boxes_property_set_reboot_required (_tmp2_, FALSE);
	}
}


static void ____lambda84__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	___lambda84_ (self);
}


static void boxes_libvirt_machine_add_ram_property (BoxesLibvirtMachine* self, GList** list) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	{
		Block21Data* _data21_;
		GVirConnection* _tmp0_;
		GVirNodeInfo* _tmp1_ = NULL;
		GVirNodeInfo* _tmp2_;
		GVirNodeInfo* _tmp3_;
		gulong _tmp4_;
		gulong _tmp5_;
		gulong max_ram;
		const gchar* _tmp6_ = NULL;
		GVirConfigDomain* _tmp7_;
		guint64 _tmp8_;
		guint64 _tmp9_;
		gulong _tmp10_;
		BoxesProperty* _tmp11_ = NULL;
		BoxesProperty* _tmp12_;
		_data21_ = g_slice_new0 (Block21Data);
		_data21_->_ref_count_ = 1;
		_data21_->self = g_object_ref (self);
		_tmp0_ = self->connection;
		_tmp1_ = gvir_connection_get_node_info (_tmp0_, &_inner_error_);
		_tmp2_ = _tmp1_;
		if (_inner_error_ != NULL) {
			block21_data_unref (_data21_);
			_data21_ = NULL;
			goto __catch26_g_error;
		}
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_->memory;
		_tmp5_ = _tmp4_;
		__vala_GVirNodeInfo_free0 (_tmp3_);
		max_ram = _tmp5_;
		_tmp6_ = _ ("Memory");
		_tmp7_ = self->domain_config;
		_tmp8_ = gvir_config_domain_get_memory (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = max_ram;
		_tmp11_ = boxes_iproperties_provider_add_size_property ((BoxesIPropertiesProvider*) self, list, _tmp6_, _tmp9_, (guint64) (OSINFO_MEBIBYTES / OSINFO_KIBIBYTES), (guint64) _tmp10_, (guint64) (OSINFO_MEBIBYTES / OSINFO_KIBIBYTES), _boxes_libvirt_machine_on_ram_changed_property_size_changed, self);
		_data21_->property = _tmp11_;
		g_signal_connect_data ((GObject*) self, "notify::state", (GCallback) ____lambda84__g_object_notify, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
		_tmp12_ = _data21_->property;
		boxes_libvirt_machine_update_ram_property (self, _tmp12_);
		block21_data_unref (_data21_);
		_data21_ = NULL;
	}
	goto __finally26;
	__catch26_g_error:
	{
		GError* _error_ = NULL;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_g_error_free0 (_error_);
	}
	__finally26:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static Block22Data* block22_data_ref (Block22Data* _data22_) {
	g_atomic_int_inc (&_data22_->_ref_count_);
	return _data22_;
}


static void block22_data_unref (void * _userdata_) {
	Block22Data* _data22_;
	_data22_ = (Block22Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data22_->_ref_count_)) {
		BoxesLibvirtMachine * self;
		self = _data22_->self;
		_g_object_unref0 (_data22_->property);
		_g_object_unref0 (self);
		g_slice_free (Block22Data, _data22_);
	}
}


static gboolean __lambda80_ (Block22Data* _data22_) {
	BoxesLibvirtMachine * self;
	gboolean result = FALSE;
	gboolean _tmp23_ = FALSE;
	BoxesMachineMachineState _tmp24_;
	BoxesMachineMachineState _tmp25_;
	gboolean _tmp28_;
	GError * _inner_error_ = NULL;
	self = _data22_->self;
	{
		GVirDomain* _tmp0_;
		GVirConfigDomain* _tmp1_ = NULL;
		GVirConfigDomain* config;
		GVirConfigDomain* _tmp2_;
		guint64 _tmp3_;
		GVirConfigDomain* _tmp4_;
		GObjectClass* _tmp5_ = NULL;
		GParamSpec* _tmp6_ = NULL;
		GVirDomain* _tmp9_;
		GVirConfigDomain* _tmp10_;
		guint64 _tmp11_;
		gboolean _tmp12_ = FALSE;
		BoxesMachineMachineState _tmp13_;
		BoxesMachineMachineState _tmp14_;
		gboolean _tmp17_;
		_tmp0_ = self->domain;
		_tmp1_ = gvir_domain_get_config (_tmp0_, (guint) GVIR_DOMAIN_XML_INACTIVE, &_inner_error_);
		config = _tmp1_;
		if (_inner_error_ != NULL) {
			goto __catch27_g_error;
		}
		_tmp2_ = config;
		_tmp3_ = _data22_->value;
		gvir_config_domain_set_memory (_tmp2_, _tmp3_);
		_tmp4_ = config;
		_tmp5_ = G_OBJECT_GET_CLASS ((GObject*) _tmp4_);
		_tmp6_ = g_object_class_find_property (_tmp5_, "current-memory");
		if (_tmp6_ != NULL) {
			GVirConfigDomain* _tmp7_;
			guint64 _tmp8_;
			_tmp7_ = config;
			_tmp8_ = _data22_->value;
			g_object_set ((GObject*) _tmp7_, "current-memory", _tmp8_, NULL);
		}
		_tmp9_ = self->domain;
		_tmp10_ = config;
		gvir_domain_set_config (_tmp9_, _tmp10_, &_inner_error_);
		if (_inner_error_ != NULL) {
			_g_object_unref0 (config);
			goto __catch27_g_error;
		}
		_tmp11_ = _data22_->value;
		g_debug ("libvirt-machine.vala:533: RAM changed to %llu", _tmp11_);
		_tmp13_ = boxes_machine_get_state ((BoxesMachine*) self);
		_tmp14_ = _tmp13_;
		if (_tmp14_ == BOXES_MACHINE_MACHINE_STATE_RUNNING) {
			_tmp12_ = TRUE;
		} else {
			BoxesMachineMachineState _tmp15_;
			BoxesMachineMachineState _tmp16_;
			_tmp15_ = boxes_machine_get_state ((BoxesMachine*) self);
			_tmp16_ = _tmp15_;
			_tmp12_ = _tmp16_ == BOXES_MACHINE_MACHINE_STATE_PAUSED;
		}
		_tmp17_ = _tmp12_;
		if (_tmp17_) {
			boxes_libvirt_machine_notify_reboot_required (self);
		}
		_g_object_unref0 (config);
	}
	goto __finally27;
	__catch27_g_error:
	{
		GError* _error_ = NULL;
		GVirDomain* _tmp18_;
		const gchar* _tmp19_ = NULL;
		guint64 _tmp20_;
		GError* _tmp21_;
		const gchar* _tmp22_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp18_ = self->domain;
		_tmp19_ = gvir_domain_get_name (_tmp18_);
		_tmp20_ = _data22_->value;
		_tmp21_ = _error_;
		_tmp22_ = _tmp21_->message;
		g_warning ("libvirt-machine.vala:537: Failed to change RAM of box '%s' to %llu: %s", _tmp19_, _tmp20_, _tmp22_);
		_g_error_free0 (_error_);
	}
	__finally27:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return FALSE;
	}
	_tmp24_ = boxes_machine_get_state ((BoxesMachine*) self);
	_tmp25_ = _tmp24_;
	if (_tmp25_ == BOXES_MACHINE_MACHINE_STATE_RUNNING) {
		_tmp23_ = TRUE;
	} else {
		BoxesMachineMachineState _tmp26_;
		BoxesMachineMachineState _tmp27_;
		_tmp26_ = boxes_machine_get_state ((BoxesMachine*) self);
		_tmp27_ = _tmp26_;
		_tmp23_ = _tmp27_ == BOXES_MACHINE_MACHINE_STATE_PAUSED;
	}
	_tmp28_ = _tmp23_;
	if (_tmp28_) {
		BoxesProperty* _tmp29_;
		_tmp29_ = _data22_->property;
		boxes_libvirt_machine_update_ram_property (self, _tmp29_);
	}
	result = FALSE;
	return result;
}


static gboolean ___lambda80__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda80_ (self);
	return result;
}


static void boxes_libvirt_machine_on_ram_changed (BoxesLibvirtMachine* self, BoxesProperty* property, guint64 value) {
	Block22Data* _data22_;
	BoxesProperty* _tmp0_;
	BoxesProperty* _tmp1_;
	guint64 _tmp2_;
	BoxesProperty* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (property != NULL);
	_data22_ = g_slice_new0 (Block22Data);
	_data22_->_ref_count_ = 1;
	_data22_->self = g_object_ref (self);
	_tmp0_ = property;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data22_->property);
	_data22_->property = _tmp1_;
	_tmp2_ = value;
	_data22_->value = _tmp2_;
	_tmp3_ = _data22_->property;
	boxes_property_set_deferred_change (_tmp3_, ___lambda80__gsource_func, block22_data_ref (_data22_), block22_data_unref);
	block22_data_unref (_data22_);
	_data22_ = NULL;
}


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


static void boxes_libvirt_machine_start (BoxesLibvirtMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	BoxesLibvirtMachineStartData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	_data_ = g_slice_new0 (BoxesLibvirtMachineStartData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, boxes_libvirt_machine_start);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, boxes_libvirt_machine_start_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	boxes_libvirt_machine_start_co (_data_);
}


static void boxes_libvirt_machine_start_finish (BoxesLibvirtMachine* self, GAsyncResult* _res_, GError** error) {
	BoxesLibvirtMachineStartData* _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_libvirt_machine_start_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	BoxesLibvirtMachineStartData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_machine_start_co (_data_);
}


static gboolean boxes_libvirt_machine_start_co (BoxesLibvirtMachineStartData* _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_ = boxes_machine_get_state ((BoxesMachine*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	if (_data_->_tmp1_ == BOXES_MACHINE_MACHINE_STATE_RUNNING) {
		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_ = boxes_machine_get_state ((BoxesMachine*) _data_->self);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_ == BOXES_MACHINE_MACHINE_STATE_PAUSED) {
		_data_->_tmp4_ = _data_->self->domain;
		_data_->_state_ = 1;
		gvir_domain_resume_async (_data_->_tmp4_, NULL, boxes_libvirt_machine_start_ready, _data_);
		return FALSE;
		_state_1:
		gvir_domain_resume_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;
		}
	} else {
		_data_->_tmp5_ = _data_->self->domain;
		_data_->_tmp6_ = FALSE;
		_data_->_tmp6_ = gvir_domain_get_saved (_data_->_tmp5_);
		if (_data_->_tmp6_) {
			_data_->_tmp7_ = NULL;
			_data_->_tmp7_ = _ ("Restoring %s from disk");
			_data_->_tmp8_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->self);
			_data_->_tmp9_ = _data_->_tmp8_;
			_data_->_tmp10_ = NULL;
			_data_->_tmp10_ = g_strdup_printf (_data_->_tmp7_, _data_->_tmp9_);
			_data_->_tmp11_ = _data_->_tmp10_;
			boxes_machine_set_status ((BoxesMachine*) _data_->self, _data_->_tmp11_);
			_g_free0 (_data_->_tmp11_);
		} else {
			_data_->_tmp12_ = NULL;
			_data_->_tmp12_ = _ ("Starting %s");
			_data_->_tmp13_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->self);
			_data_->_tmp14_ = _data_->_tmp13_;
			_data_->_tmp15_ = NULL;
			_data_->_tmp15_ = g_strdup_printf (_data_->_tmp12_, _data_->_tmp14_);
			_data_->_tmp16_ = _data_->_tmp15_;
			boxes_machine_set_status ((BoxesMachine*) _data_->self, _data_->_tmp16_);
			_g_free0 (_data_->_tmp16_);
		}
		_data_->_tmp17_ = _data_->self->domain;
		_data_->_state_ = 2;
		gvir_domain_start_async (_data_->_tmp17_, (guint) 0, NULL, boxes_libvirt_machine_start_ready, _data_);
		return FALSE;
		_state_2:
		gvir_domain_start_finish (_data_->_tmp17_, _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 Block23Data* block23_data_ref (Block23Data* _data23_) {
	g_atomic_int_inc (&_data23_->_ref_count_);
	return _data23_;
}


static void block23_data_unref (void * _userdata_) {
	Block23Data* _data23_;
	_data23_ = (Block23Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
		BoxesLibvirtMachine * self;
		self = _data23_->self;
		_g_object_unref0 (self);
		g_slice_free (Block23Data, _data23_);
	}
}


static void ___lambda83_ (BoxesLibvirtMachine* self, GObject* obj, GAsyncResult* res) {
	GError * _inner_error_ = NULL;
	g_return_if_fail (res != NULL);
	{
		GAsyncResult* _tmp0_;
		_tmp0_ = res;
		boxes_libvirt_machine_start_finish (self, _tmp0_, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch28_g_error;
		}
	}
	goto __finally28;
	__catch28_g_error:
	{
		GError* _error_ = NULL;
		GVirDomain* _tmp1_;
		const gchar* _tmp2_ = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp1_ = self->domain;
		_tmp2_ = gvir_domain_get_name (_tmp1_);
		_tmp3_ = _error_;
		_tmp4_ = _tmp3_->message;
		g_warning ("libvirt-machine.vala:579: Failed to start '%s': %s", _tmp2_, _tmp4_);
		_g_error_free0 (_error_);
	}
	__finally28:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static void ____lambda83__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
	___lambda83_ (self, source_object, res);
	g_object_unref (self);
}


static void __lambda82_ (Block23Data* _data23_) {
	BoxesLibvirtMachine * self;
	BoxesMachineMachineState _tmp0_;
	BoxesMachineMachineState _tmp1_;
	self = _data23_->self;
	_tmp0_ = boxes_machine_get_state ((BoxesMachine*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == BOXES_MACHINE_MACHINE_STATE_STOPPED) {
		gulong _tmp2_;
		boxes_libvirt_machine_start (self, ____lambda83__gasync_ready_callback, g_object_ref (self));
		_tmp2_ = _data23_->state_id;
		g_signal_handler_disconnect ((GObject*) self, _tmp2_);
	}
}


static void ___lambda82__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
	__lambda82_ (self);
}


static void __lambda81_ (BoxesLibvirtMachine* self) {
	Block23Data* _data23_;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gulong _tmp2_ = 0UL;
	GError * _inner_error_ = NULL;
	_data23_ = g_slice_new0 (Block23Data);
	_data23_->_ref_count_ = 1;
	_data23_->self = g_object_ref (self);
	_tmp0_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp1_ = _tmp0_;
	g_debug ("libvirt-machine.vala:570: Rebooting '%s'..", _tmp1_);
	((BoxesMachine*) self)->stay_on_display = TRUE;
	_data23_->state_id = (gulong) 0;
	_tmp2_ = g_signal_connect_data ((GObject*) self, "notify::state", (GCallback) ___lambda82__g_object_notify, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
	_data23_->state_id = _tmp2_;
	{
		GVirDomain* _tmp3_;
		_tmp3_ = self->domain;
		gvir_domain_shutdown (_tmp3_, (guint) 0, &_inner_error_);
		if (_inner_error_ != NULL) {
			goto __catch29_g_error;
		}
	}
	goto __finally29;
	__catch29_g_error:
	{
		GError* _error_ = NULL;
		GVirDomain* _tmp4_;
		const gchar* _tmp5_ = NULL;
		GError* _tmp6_;
		const gchar* _tmp7_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp4_ = self->domain;
		_tmp5_ = gvir_domain_get_name (_tmp4_);
		_tmp6_ = _error_;
		_tmp7_ = _tmp6_->message;
		g_warning ("libvirt-machine.vala:589: Failed to reboot '%s': %s", _tmp5_, _tmp7_);
		_g_error_free0 (_error_);
	}
	__finally29:
	if (_inner_error_ != NULL) {
		block23_data_unref (_data23_);
		_data23_ = NULL;
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	block23_data_unref (_data23_);
	_data23_ = NULL;
}


static void ___lambda81__boxes_notificationbar_ok_func (gpointer self) {
	__lambda81_ (self);
}


static void boxes_libvirt_machine_notify_reboot_required (BoxesLibvirtMachine* self) {
	BoxesNotificationbarOKFunc reboot;
	void* reboot_target;
	GDestroyNotify reboot_target_destroy_notify;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_ = NULL;
	gchar* message;
	BoxesApp* _tmp4_;
	BoxesNotificationbar* _tmp5_;
	BoxesNotificationbarOKFunc _tmp6_;
	void* _tmp6__target;
	GDestroyNotify _tmp6__target_destroy_notify;
	g_return_if_fail (self != NULL);
	reboot = ___lambda81__boxes_notificationbar_ok_func;
	reboot_target = g_object_ref (self);
	reboot_target_destroy_notify = g_object_unref;
	_tmp0_ = _ ("Changes require restart of '%s'. Attempt restart?");
	_tmp1_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup_printf (_tmp0_, _tmp2_);
	message = _tmp3_;
	_tmp4_ = boxes_app_app;
	_tmp5_ = _tmp4_->notificationbar;
	_tmp6_ = reboot;
	_tmp6__target = reboot_target;
	_tmp6__target_destroy_notify = reboot_target_destroy_notify;
	reboot_target_destroy_notify = NULL;
	boxes_notificationbar_display_for_action (_tmp5_, message, GTK_STOCK_YES, _tmp6_, _tmp6__target, _tmp6__target_destroy_notify, NULL, NULL, NULL);
	_g_free0 (message);
	(reboot_target_destroy_notify == NULL) ? NULL : (reboot_target_destroy_notify (reboot_target), NULL);
	reboot = NULL;
	reboot_target = NULL;
	reboot_target_destroy_notify = NULL;
}


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


static void _boxes_libvirt_machine_on_storage_changed_property_size_changed (BoxesProperty* property, guint64 value, gpointer self) {
	boxes_libvirt_machine_on_storage_changed (self, property, value);
}


static void _vala_GVirStoragePoolInfo_free (GVirStoragePoolInfo* self) {
	g_boxed_free (gvir_storage_pool_info_get_type (), self);
}


static void boxes_libvirt_machine_add_storage_property (BoxesLibvirtMachine* self, GList** list) {
	GVirStorageVol* _tmp0_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->storage_volume;
	if (_tmp0_ == NULL) {
		return;
	}
	{
		GVirStorageVol* _tmp1_;
		GVirStorageVolInfo* _tmp2_ = NULL;
		GVirStorageVolInfo* volume_info;
		GVirConnection* _tmp3_;
		GVirStoragePool* _tmp4_ = NULL;
		GVirStoragePool* pool;
		GVirStoragePool* _tmp5_;
		GVirStoragePoolInfo* _tmp6_ = NULL;
		GVirStoragePoolInfo* pool_info;
		GVirStorageVolInfo* _tmp7_;
		guint64 _tmp8_;
		GVirStoragePoolInfo* _tmp9_;
		guint64 _tmp10_;
		guint64 max_storage;
		const gchar* _tmp11_ = NULL;
		GVirStorageVolInfo* _tmp12_;
		guint64 _tmp13_;
		GVirStorageVolInfo* _tmp14_;
		guint64 _tmp15_;
		guint64 _tmp16_;
		BoxesProperty* _tmp17_ = NULL;
		BoxesProperty* _tmp18_;
		_tmp1_ = self->storage_volume;
		_tmp2_ = gvir_storage_vol_get_info (_tmp1_, &_inner_error_);
		volume_info = _tmp2_;
		if (_inner_error_ != NULL) {
			goto __catch30_g_error;
		}
		_tmp3_ = self->connection;
		_tmp4_ = boxes_get_storage_pool (_tmp3_);
		pool = _tmp4_;
		_tmp5_ = pool;
		_tmp6_ = gvir_storage_pool_get_info (_tmp5_, &_inner_error_);
		pool_info = _tmp6_;
		if (_inner_error_ != NULL) {
			_g_object_unref0 (pool);
			__vala_GVirStorageVolInfo_free0 (volume_info);
			goto __catch30_g_error;
		}
		_tmp7_ = volume_info;
		_tmp8_ = _tmp7_->capacity;
		_tmp9_ = pool_info;
		_tmp10_ = _tmp9_->available;
		max_storage = (_tmp8_ + _tmp10_) / OSINFO_KIBIBYTES;
		_tmp11_ = _ ("Maximum Disk Size");
		_tmp12_ = volume_info;
		_tmp13_ = _tmp12_->capacity;
		_tmp14_ = volume_info;
		_tmp15_ = _tmp14_->capacity;
		_tmp16_ = max_storage;
		_tmp17_ = boxes_iproperties_provider_add_size_property ((BoxesIPropertiesProvider*) self, list, _tmp11_, _tmp13_ / OSINFO_KIBIBYTES, _tmp15_ / OSINFO_KIBIBYTES, _tmp16_, (guint64) (OSINFO_GIBIBYTES / OSINFO_KIBIBYTES), _boxes_libvirt_machine_on_storage_changed_property_size_changed, self);
		_tmp18_ = _tmp17_;
		_g_object_unref0 (_tmp18_);
		__vala_GVirStoragePoolInfo_free0 (pool_info);
		_g_object_unref0 (pool);
		__vala_GVirStorageVolInfo_free0 (volume_info);
	}
	goto __finally30;
	__catch30_g_error:
	{
		GError* _error_ = NULL;
		GVirStorageVol* _tmp19_;
		const gchar* _tmp20_ = NULL;
		GError* _tmp21_;
		const gchar* _tmp22_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp19_ = self->storage_volume;
		_tmp20_ = gvir_storage_vol_get_name (_tmp19_);
		_tmp21_ = _error_;
		_tmp22_ = _tmp21_->message;
		g_warning ("libvirt-machine.vala:614: Failed to get information on volume '%s' or " \
"it's parent pool: %s", _tmp20_, _tmp22_);
		_g_error_free0 (_error_);
	}
	__finally30:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
}


static Block24Data* block24_data_ref (Block24Data* _data24_) {
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}


static void block24_data_unref (void * _userdata_) {
	Block24Data* _data24_;
	_data24_ = (Block24Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
		BoxesLibvirtMachine * self;
		self = _data24_->self;
		_g_object_unref0 (self);
		g_slice_free (Block24Data, _data24_);
	}
}


static gboolean __lambda85_ (Block24Data* _data24_) {
	BoxesLibvirtMachine * self;
	gboolean result = FALSE;
	GVirStorageVol* _tmp0_;
	GError * _inner_error_ = NULL;
	self = _data24_->self;
	_tmp0_ = self->storage_volume;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	{
		gboolean _tmp1_ = FALSE;
		guint64 _tmp8_;
		_tmp1_ = boxes_machine_is_running ((BoxesMachine*) self);
		if (_tmp1_) {
			GVirDomainDisk* _tmp2_ = NULL;
			GVirDomainDisk* disk;
			GVirDomainDisk* _tmp3_;
			_tmp2_ = boxes_libvirt_machine_get_domain_disk (self, &_inner_error_);
			disk = _tmp2_;
			if (_inner_error_ != NULL) {
				goto __catch31_g_error;
			}
			_tmp3_ = disk;
			if (_tmp3_ != NULL) {
				GVirDomainDisk* _tmp4_;
				guint64 _tmp5_;
				_tmp4_ = disk;
				_tmp5_ = _data24_->value;
				gvir_domain_disk_resize (_tmp4_, _tmp5_, (guint) 0, &_inner_error_);
				if (_inner_error_ != NULL) {
					_g_object_unref0 (disk);
					goto __catch31_g_error;
				}
			}
			_g_object_unref0 (disk);
		} else {
			GVirStorageVol* _tmp6_;
			guint64 _tmp7_;
			_tmp6_ = self->storage_volume;
			_tmp7_ = _data24_->value;
			gvir_storage_vol_resize (_tmp6_, _tmp7_ * OSINFO_KIBIBYTES, GVIR_STORAGE_VOL_RESIZE_NONE, &_inner_error_);
			if (_inner_error_ != NULL) {
				goto __catch31_g_error;
			}
		}
		_tmp8_ = _data24_->value;
		g_debug ("libvirt-machine.vala:634: Storage changed to %llu", _tmp8_);
	}
	goto __finally31;
	__catch31_g_error:
	{
		GError* _error_ = NULL;
		GVirStorageVol* _tmp9_;
		const gchar* _tmp10_ = NULL;
		guint64 _tmp11_;
		GError* _tmp12_;
		const gchar* _tmp13_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp9_ = self->storage_volume;
		_tmp10_ = gvir_storage_vol_get_name (_tmp9_);
		_tmp11_ = _data24_->value;
		_tmp12_ = _error_;
		_tmp13_ = _tmp12_->message;
		g_warning ("libvirt-machine.vala:636: Failed to change storage capacity of volume " \
"'%s' to %llu: %s", _tmp10_, _tmp11_, _tmp13_);
		_g_error_free0 (_error_);
	}
	__finally31:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return FALSE;
	}
	result = FALSE;
	return result;
}


static gboolean ___lambda85__gsource_func (gpointer self) {
	gboolean result;
	result = __lambda85_ (self);
	return result;
}


static void boxes_libvirt_machine_on_storage_changed (BoxesLibvirtMachine* self, BoxesProperty* property, guint64 value) {
	Block24Data* _data24_;
	guint64 _tmp0_;
	BoxesProperty* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (property != NULL);
	_data24_ = g_slice_new0 (Block24Data);
	_data24_->_ref_count_ = 1;
	_data24_->self = g_object_ref (self);
	_tmp0_ = value;
	_data24_->value = _tmp0_;
	_tmp1_ = property;
	boxes_property_set_deferred_change (_tmp1_, ___lambda85__gsource_func, block24_data_ref (_data24_), block24_data_unref);
	block24_data_unref (_data24_);
	_data24_ = NULL;
}


gboolean boxes_libvirt_machine_get_save_on_quit (BoxesLibvirtMachine* self) {
	gboolean result;
	BoxesCollectionSource* _tmp0_;
	gboolean _tmp1_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = ((BoxesMachine*) self)->source;
	_tmp1_ = boxes_iconfig_get_boolean ((BoxesIConfig*) _tmp0_, "source", "save-on-quit", FALSE);
	result = _tmp1_;
	return result;
}


void boxes_libvirt_machine_set_save_on_quit (BoxesLibvirtMachine* self, gboolean value) {
	BoxesCollectionSource* _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = ((BoxesMachine*) self)->source;
	_tmp1_ = value;
	boxes_iconfig_set_boolean ((BoxesIConfig*) _tmp0_, "source", "save-on-quit", _tmp1_);
	g_object_notify ((GObject *) self, "save-on-quit");
}


static GObject * boxes_libvirt_machine_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
	GObject * obj;
	GObjectClass * parent_class;
	BoxesLibvirtMachine * self;
	BoxesLibvirtMachineMachineStat* _tmp0_ = NULL;
	GCancellable* _tmp1_;
	parent_class = G_OBJECT_CLASS (boxes_libvirt_machine_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachine);
	_tmp0_ = g_new0 (BoxesLibvirtMachineMachineStat, BOXES_LIBVIRT_MACHINE_STATS_SIZE);
	self->priv->stats = (_vala_BoxesLibvirtMachineMachineStat_array_free (self->priv->stats, self->priv->stats_length1), NULL);
	self->priv->stats = _tmp0_;
	self->priv->stats_length1 = BOXES_LIBVIRT_MACHINE_STATS_SIZE;
	self->priv->_stats_size_ = self->priv->stats_length1;
	_tmp1_ = g_cancellable_new ();
	_g_object_unref0 (self->priv->stats_cancellable);
	self->priv->stats_cancellable = _tmp1_;
	return obj;
}


static GVirDomainDiskStats* _vala_GVirDomainDiskStats_copy (GVirDomainDiskStats* self) {
	return g_boxed_copy (gvir_domain_disk_stats_get_type (), self);
}


static gpointer __vala_GVirDomainDiskStats_copy0 (gpointer self) {
	return self ? _vala_GVirDomainDiskStats_copy (self) : NULL;
}


static GVirDomainInterfaceStats* _vala_GVirDomainInterfaceStats_copy (GVirDomainInterfaceStats* self) {
	return g_boxed_copy (gvir_domain_interface_stats_get_type (), self);
}


static gpointer __vala_GVirDomainInterfaceStats_copy0 (gpointer self) {
	return self ? _vala_GVirDomainInterfaceStats_copy (self) : NULL;
}


static void boxes_libvirt_machine_machine_stat_copy (const BoxesLibvirtMachineMachineStat* self, BoxesLibvirtMachineMachineStat* dest) {
	gint64 _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gdouble _tmp3_;
	gdouble _tmp4_;
	GVirDomainDiskStats* _tmp5_;
	GVirDomainDiskStats* _tmp6_;
	gdouble _tmp7_;
	gdouble _tmp8_;
	GVirDomainInterfaceStats* _tmp9_;
	GVirDomainInterfaceStats* _tmp10_;
	gdouble _tmp11_;
	gdouble _tmp12_;
	_tmp0_ = (*self).timestamp;
	(*dest).timestamp = _tmp0_;
	_tmp1_ = (*self).cpu_time;
	(*dest).cpu_time = _tmp1_;
	_tmp2_ = (*self).cpu_time_abs;
	(*dest).cpu_time_abs = _tmp2_;
	_tmp3_ = (*self).cpu_guest_percent;
	(*dest).cpu_guest_percent = _tmp3_;
	_tmp4_ = (*self).memory_percent;
	(*dest).memory_percent = _tmp4_;
	_tmp5_ = (*self).disk;
	_tmp6_ = __vala_GVirDomainDiskStats_copy0 (_tmp5_);
	__vala_GVirDomainDiskStats_free0 ((*dest).disk);
	(*dest).disk = _tmp6_;
	_tmp7_ = (*self).disk_read;
	(*dest).disk_read = _tmp7_;
	_tmp8_ = (*self).disk_write;
	(*dest).disk_write = _tmp8_;
	_tmp9_ = (*self).net;
	_tmp10_ = __vala_GVirDomainInterfaceStats_copy0 (_tmp9_);
	__vala_GVirDomainInterfaceStats_free0 ((*dest).net);
	(*dest).net = _tmp10_;
	_tmp11_ = (*self).net_read;
	(*dest).net_read = _tmp11_;
	_tmp12_ = (*self).net_write;
	(*dest).net_write = _tmp12_;
}


static void boxes_libvirt_machine_machine_stat_destroy (BoxesLibvirtMachineMachineStat* self) {
	__vala_GVirDomainDiskStats_free0 ((*self).disk);
	__vala_GVirDomainInterfaceStats_free0 ((*self).net);
}


static BoxesLibvirtMachineMachineStat* boxes_libvirt_machine_machine_stat_dup (const BoxesLibvirtMachineMachineStat* self) {
	BoxesLibvirtMachineMachineStat* dup;
	dup = g_new0 (BoxesLibvirtMachineMachineStat, 1);
	boxes_libvirt_machine_machine_stat_copy (self, dup);
	return dup;
}


static void boxes_libvirt_machine_machine_stat_free (BoxesLibvirtMachineMachineStat* self) {
	boxes_libvirt_machine_machine_stat_destroy (self);
	g_free (self);
}


static GType boxes_libvirt_machine_machine_stat_get_type (void) {
	static volatile gsize boxes_libvirt_machine_machine_stat_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_libvirt_machine_machine_stat_type_id__volatile)) {
		GType boxes_libvirt_machine_machine_stat_type_id;
		boxes_libvirt_machine_machine_stat_type_id = g_boxed_type_register_static ("BoxesLibvirtMachineMachineStat", (GBoxedCopyFunc) boxes_libvirt_machine_machine_stat_dup, (GBoxedFreeFunc) boxes_libvirt_machine_machine_stat_free);
		g_once_init_leave (&boxes_libvirt_machine_machine_stat_type_id__volatile, boxes_libvirt_machine_machine_stat_type_id);
	}
	return boxes_libvirt_machine_machine_stat_type_id__volatile;
}


static void boxes_libvirt_machine_class_init (BoxesLibvirtMachineClass * klass) {
	boxes_libvirt_machine_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (BoxesLibvirtMachinePrivate));
	BOXES_MACHINE_CLASS (klass)->disconnect_display = boxes_libvirt_machine_real_disconnect_display;
	BOXES_MACHINE_CLASS (klass)->connect_display = boxes_libvirt_machine_real_connect_display;
	BOXES_MACHINE_CLASS (klass)->connect_display_finish = boxes_libvirt_machine_real_connect_display_finish;
	BOXES_MACHINE_CLASS (klass)->get_properties = boxes_libvirt_machine_real_get_properties;
	BOXES_MACHINE_CLASS (klass)->take_screenshot = boxes_libvirt_machine_real_take_screenshot;
	BOXES_MACHINE_CLASS (klass)->take_screenshot_finish = boxes_libvirt_machine_real_take_screenshot_finish;
	BOXES_MACHINE_CLASS (klass)->delete = boxes_libvirt_machine_real_delete;
	G_OBJECT_CLASS (klass)->get_property = _vala_boxes_libvirt_machine_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_boxes_libvirt_machine_set_property;
	G_OBJECT_CLASS (klass)->constructor = boxes_libvirt_machine_constructor;
	G_OBJECT_CLASS (klass)->finalize = boxes_libvirt_machine_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_SAVE_ON_QUIT, g_param_spec_boolean ("save-on-quit", "save-on-quit", "save-on-quit", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_signal_new ("stats_updated", BOXES_TYPE_LIBVIRT_MACHINE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void boxes_libvirt_machine_instance_init (BoxesLibvirtMachine * self) {
	self->priv = BOXES_LIBVIRT_MACHINE_GET_PRIVATE (self);
}


static void boxes_libvirt_machine_finalize (GObject* obj) {
	BoxesLibvirtMachine * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachine);
	_g_object_unref0 (self->domain);
	_g_object_unref0 (self->domain_config);
	_g_object_unref0 (self->connection);
	_g_object_unref0 (self->storage_volume);
	_boxes_vm_creator_unref0 (self->vm_creator);
	_g_object_unref0 (self->priv->stats_cancellable);
	self->priv->stats = (_vala_BoxesLibvirtMachineMachineStat_array_free (self->priv->stats, self->priv->stats_length1), NULL);
	self->cpu_stats = (g_free (self->cpu_stats), NULL);
	self->io_stats = (g_free (self->io_stats), NULL);
	self->net_stats = (g_free (self->net_stats), NULL);
	G_OBJECT_CLASS (boxes_libvirt_machine_parent_class)->finalize (obj);
}


GType boxes_libvirt_machine_get_type (void) {
	static volatile gsize boxes_libvirt_machine_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_libvirt_machine_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (BoxesLibvirtMachineClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_libvirt_machine_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesLibvirtMachine), 0, (GInstanceInitFunc) boxes_libvirt_machine_instance_init, NULL };
		GType boxes_libvirt_machine_type_id;
		boxes_libvirt_machine_type_id = g_type_register_static (BOXES_TYPE_MACHINE, "BoxesLibvirtMachine", &g_define_type_info, 0);
		g_once_init_leave (&boxes_libvirt_machine_type_id__volatile, boxes_libvirt_machine_type_id);
	}
	return boxes_libvirt_machine_type_id__volatile;
}


static void _vala_boxes_libvirt_machine_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	BoxesLibvirtMachine * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachine);
	switch (property_id) {
		case BOXES_LIBVIRT_MACHINE_SAVE_ON_QUIT:
		g_value_set_boolean (value, boxes_libvirt_machine_get_save_on_quit (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_boxes_libvirt_machine_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	BoxesLibvirtMachine * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, BOXES_TYPE_LIBVIRT_MACHINE, BoxesLibvirtMachine);
	switch (property_id) {
		case BOXES_LIBVIRT_MACHINE_SAVE_ON_QUIT:
		boxes_libvirt_machine_set_save_on_quit (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



