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

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

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

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

#define BOXES_TYPE_UI (boxes_ui_get_type ())
#define BOXES_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_UI, BoxesUI))
#define BOXES_IS_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_UI))
#define BOXES_UI_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), BOXES_TYPE_UI, BoxesUIIface))

typedef struct _BoxesUI BoxesUI;
typedef struct _BoxesUIIface BoxesUIIface;
typedef enum  {
	BOXES_UI_STATE_NONE,
	BOXES_UI_STATE_COLLECTION,
	BOXES_UI_STATE_CREDS,
	BOXES_UI_STATE_DISPLAY,
	BOXES_UI_STATE_WIZARD,
	BOXES_UI_STATE_PROPERTIES,
	BOXES_UI_STATE_TROUBLESHOOT
} BoxesUIState;

#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_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;
typedef enum  {
	BOXES_MACHINE_CONNECT_FLAGS_NONE = 0,
	BOXES_MACHINE_CONNECT_FLAGS_IGNORE_SAVED_STATE = 1 << 0
} BoxesMachineConnectFlags;

#define BOXES_MACHINE_TYPE_CONNECT_FLAGS (boxes_machine_connect_flags_get_type ())

#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;
enum  {
	BOXES_LIBVIRT_MACHINE_0_PROPERTY,
	BOXES_LIBVIRT_MACHINE_DOMAIN_PROPERTY,
	BOXES_LIBVIRT_MACHINE_DOMAIN_CONFIG_PROPERTY,
	BOXES_LIBVIRT_MACHINE_CONNECTION_PROPERTY,
	BOXES_LIBVIRT_MACHINE_STORAGE_VOLUME_PROPERTY,
	BOXES_LIBVIRT_MACHINE_VM_CREATOR_PROPERTY,
	BOXES_LIBVIRT_MACHINE_TITLE_PROPERTY,
	BOXES_LIBVIRT_MACHINE_IMPORTING_PROPERTY,
	BOXES_LIBVIRT_MACHINE_SAVE_ON_QUIT_PROPERTY,
	BOXES_LIBVIRT_MACHINE_SUSPEND_AT_EXIT_PROPERTY,
	BOXES_LIBVIRT_MACHINE_CAN_SAVE_PROPERTY,
	BOXES_LIBVIRT_MACHINE_CAN_RESTART_PROPERTY,
	BOXES_LIBVIRT_MACHINE_CAN_CLONE_PROPERTY,
	BOXES_LIBVIRT_MACHINE_SHOULD_AUTOSAVE_PROPERTY,
	BOXES_LIBVIRT_MACHINE_RUN_IN_BG_PROPERTY,
	BOXES_LIBVIRT_MACHINE_RAM_PROPERTY,
	BOXES_LIBVIRT_MACHINE_ACCELERATION_3D_PROPERTY,
	BOXES_LIBVIRT_MACHINE_FIRMWARE_IS_EFI_PROPERTY,
	BOXES_LIBVIRT_MACHINE_IS_LOCAL_PROPERTY,
	BOXES_LIBVIRT_MACHINE_NUM_PROPERTIES
};
static GParamSpec* boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef gint (*BoxesDisplayOpenFDFunc) (gpointer user_data);
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (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 BOXES_TYPE_APP_WINDOW (boxes_app_window_get_type ())
#define BOXES_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindow))
#define BOXES_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))
#define BOXES_IS_APP_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_APP_WINDOW))
#define BOXES_IS_APP_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_APP_WINDOW))
#define BOXES_APP_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_APP_WINDOW, BoxesAppWindowClass))

typedef struct _BoxesAppWindow BoxesAppWindow;
typedef struct _BoxesAppWindowClass BoxesAppWindowClass;
typedef enum  {
	BOXES_MACHINE_MACHINE_STATE_UNKNOWN,
	BOXES_MACHINE_MACHINE_STATE_STOPPED,
	BOXES_MACHINE_MACHINE_STATE_FORCE_STOPPED,
	BOXES_MACHINE_MACHINE_STATE_RUNNING,
	BOXES_MACHINE_MACHINE_STATE_PAUSED,
	BOXES_MACHINE_MACHINE_STATE_SAVED,
	BOXES_MACHINE_MACHINE_STATE_SLEEPING
} BoxesMachineMachineState;

#define BOXES_MACHINE_TYPE_MACHINE_STATE (boxes_machine_machine_state_get_type ())
#define __vala_GVirDomainInfo_free0(var) ((var == NULL) ? NULL : (var = (_vala_GVirDomainInfo_free (var), NULL)))
typedef struct _BoxesLibvirtMachineNewData BoxesLibvirtMachineNewData;

#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;
typedef struct _Block33Data Block33Data;

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

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

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

typedef struct _BoxesCollection BoxesCollection;
typedef struct _BoxesCollectionClass BoxesCollectionClass;

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

typedef struct _BoxesSharedFoldersManager BoxesSharedFoldersManager;
typedef struct _BoxesSharedFoldersManagerClass BoxesSharedFoldersManagerClass;
typedef struct _BoxesLibvirtMachineTakeScreenshotData BoxesLibvirtMachineTakeScreenshotData;
typedef struct _Block34Data Block34Data;
typedef struct _BoxesLibvirtMachineSaveRealData BoxesLibvirtMachineSaveRealData;
typedef struct _BoxesLibvirtMachineSuspendData BoxesLibvirtMachineSuspendData;
typedef struct _BoxesAppWindowPrivate BoxesAppWindowPrivate;

#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_TOAST_OVERLAY (boxes_toast_overlay_get_type ())
#define BOXES_TOAST_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlay))
#define BOXES_TOAST_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlayClass))
#define BOXES_IS_TOAST_OVERLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TOAST_OVERLAY))
#define BOXES_IS_TOAST_OVERLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TOAST_OVERLAY))
#define BOXES_TOAST_OVERLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TOAST_OVERLAY, BoxesToastOverlayClass))

typedef struct _BoxesToastOverlay BoxesToastOverlay;
typedef struct _BoxesToastOverlayClass BoxesToastOverlayClass;

#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_TROUBLESHOOT_VIEW (boxes_troubleshoot_view_get_type ())
#define BOXES_TROUBLESHOOT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootView))
#define BOXES_TROUBLESHOOT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootViewClass))
#define BOXES_IS_TROUBLESHOOT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW))
#define BOXES_IS_TROUBLESHOOT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TROUBLESHOOT_VIEW))
#define BOXES_TROUBLESHOOT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TROUBLESHOOT_VIEW, BoxesTroubleshootViewClass))

typedef struct _BoxesTroubleshootView BoxesTroubleshootView;
typedef struct _BoxesTroubleshootViewClass BoxesTroubleshootViewClass;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
typedef struct _BoxesLibvirtMachineStartData BoxesLibvirtMachineStartData;
typedef struct _Block35Data Block35Data;
typedef void (*BoxesToastOKFunc) (gpointer user_data);

#define BOXES_TYPE_TOAST (boxes_toast_get_type ())
#define BOXES_TOAST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_TOAST, BoxesToast))
#define BOXES_TOAST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_TOAST, BoxesToastClass))
#define BOXES_IS_TOAST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_TOAST))
#define BOXES_IS_TOAST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_TOAST))
#define BOXES_TOAST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_TOAST, BoxesToastClass))

typedef struct _BoxesToast BoxesToast;
typedef struct _BoxesToastClass BoxesToastClass;
typedef struct _BoxesToastPrivate BoxesToastPrivate;
typedef void (*BoxesToastDismissFunc) (gpointer user_data);
typedef struct _Block36Data Block36Data;

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

typedef struct _BoxesInstallerMedia BoxesInstallerMedia;
typedef struct _BoxesInstallerMediaClass BoxesInstallerMediaClass;

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

typedef struct _BoxesInstalledMedia BoxesInstalledMedia;
typedef struct _BoxesInstalledMediaClass BoxesInstalledMediaClass;

#define BOXES_TYPE_LIBVIRT_MEDIA (boxes_libvirt_media_get_type ())
#define BOXES_LIBVIRT_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_MEDIA, BoxesLibvirtMedia))
#define BOXES_LIBVIRT_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_MEDIA, BoxesLibvirtMediaClass))
#define BOXES_IS_LIBVIRT_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_MEDIA))
#define BOXES_IS_LIBVIRT_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_MEDIA))
#define BOXES_LIBVIRT_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_MEDIA, BoxesLibvirtMediaClass))

typedef struct _BoxesLibvirtMedia BoxesLibvirtMedia;
typedef struct _BoxesLibvirtMediaClass BoxesLibvirtMediaClass;

#define BOXES_TYPE_LIBVIRT_CLONED_MEDIA (boxes_libvirt_cloned_media_get_type ())
#define BOXES_LIBVIRT_CLONED_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_LIBVIRT_CLONED_MEDIA, BoxesLibvirtClonedMedia))
#define BOXES_LIBVIRT_CLONED_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_LIBVIRT_CLONED_MEDIA, BoxesLibvirtClonedMediaClass))
#define BOXES_IS_LIBVIRT_CLONED_MEDIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_LIBVIRT_CLONED_MEDIA))
#define BOXES_IS_LIBVIRT_CLONED_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_LIBVIRT_CLONED_MEDIA))
#define BOXES_LIBVIRT_CLONED_MEDIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_LIBVIRT_CLONED_MEDIA, BoxesLibvirtClonedMediaClass))

typedef struct _BoxesLibvirtClonedMedia BoxesLibvirtClonedMedia;
typedef struct _BoxesLibvirtClonedMediaClass BoxesLibvirtClonedMediaClass;
typedef struct _BoxesLibvirtMachineCloneData BoxesLibvirtMachineCloneData;
typedef struct _BoxesLibvirtMachineSupportsAccel3dData BoxesLibvirtMachineSupportsAccel3dData;

#define BOXES_TYPE_OS_DATABASE (boxes_os_database_get_type ())
#define BOXES_OS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_OS_DATABASE, BoxesOSDatabase))
#define BOXES_OS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_OS_DATABASE, BoxesOSDatabaseClass))
#define BOXES_IS_OS_DATABASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_OS_DATABASE))
#define BOXES_IS_OS_DATABASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_OS_DATABASE))
#define BOXES_OS_DATABASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_OS_DATABASE, BoxesOSDatabaseClass))

typedef struct _BoxesOSDatabase BoxesOSDatabase;
typedef struct _BoxesOSDatabaseClass BoxesOSDatabaseClass;

#define BOXES_TYPE_MEDIA_MANAGER (boxes_media_manager_get_type ())
#define BOXES_MEDIA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_MEDIA_MANAGER, BoxesMediaManager))
#define BOXES_MEDIA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_MEDIA_MANAGER, BoxesMediaManagerClass))
#define BOXES_IS_MEDIA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_MEDIA_MANAGER))
#define BOXES_IS_MEDIA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_MEDIA_MANAGER))
#define BOXES_MEDIA_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_MEDIA_MANAGER, BoxesMediaManagerClass))

typedef struct _BoxesMediaManager BoxesMediaManager;
typedef struct _BoxesMediaManagerClass BoxesMediaManagerClass;

#define BOXES_TYPE_OS_DATABASE_ERROR (boxes_os_database_error_get_type ())
typedef struct _BoxesLibvirtMachineGetOsData BoxesLibvirtMachineGetOsData;
typedef struct _BoxesLibvirtMachineCreateSnapshotData BoxesLibvirtMachineCreateSnapshotData;
typedef struct _Block37Data Block37Data;
typedef struct _BoxesLibvirtMachineWaitForSaveData BoxesLibvirtMachineWaitForSaveData;

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

typedef struct _BoxesVMImporter BoxesVMImporter;
typedef struct _BoxesVMImporterClass BoxesVMImporterClass;

struct _BoxesUIIface {
	GTypeInterface parent_iface;
	BoxesUIState (*get_previous_ui_state) (BoxesUI* self);
	void (*set_previous_ui_state) (BoxesUI* self, BoxesUIState value);
	BoxesUIState (*get_ui_state) (BoxesUI* self);
	void (*set_ui_state) (BoxesUI* self, BoxesUIState value);
};

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

struct _BoxesCollectionItemClass {
	GObjectClass parent_class;
	gint (*compare) (BoxesCollectionItem* self, BoxesCollectionItem* other);
};

struct _BoxesMachine {
	BoxesCollectionItem parent_instance;
	BoxesMachinePrivate * priv;
	BoxesCollectionSource* source;
	BoxesBoxConfig* config;
	gboolean stay_on_display;
};

struct _BoxesMachineClass {
	BoxesCollectionItemClass parent_class;
	void (*save_real) (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*save_real_finish) (BoxesMachine* self, GAsyncResult* _res_, GError** error);
	void (*take_screenshot) (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	GdkPixbuf* (*take_screenshot_finish) (BoxesMachine* self, GAsyncResult* _res_, GError** error);
	void (*connect_display) (BoxesMachine* self, BoxesMachineConnectFlags flags, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*connect_display_finish) (BoxesMachine* self, GAsyncResult* _res_, GError** error);
	void (*restart) (BoxesMachine* self);
	void (*clone) (BoxesMachine* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*clone_finish) (BoxesMachine* self, GAsyncResult* _res_);
	void (*disconnect_display) (BoxesMachine* self);
	void (*update_status) (BoxesMachine* self);
	void (*delete) (BoxesMachine* self, gboolean by_user);
	gboolean (*get_suspend_at_exit) (BoxesMachine* self);
	gboolean (*get_can_save) (BoxesMachine* self);
	gboolean (*get_can_restart) (BoxesMachine* self);
	gboolean (*get_can_clone) (BoxesMachine* self);
	gboolean (*get_should_autosave) (BoxesMachine* self);
	gboolean (*get_is_local) (BoxesMachine* self);
};

struct _BoxesLibvirtMachine {
	BoxesMachine parent_instance;
	BoxesLibvirtMachinePrivate * priv;
};

struct _BoxesLibvirtMachineClass {
	BoxesMachineClass parent_class;
};

struct _BoxesLibvirtMachinePrivate {
	GVirDomain* _domain;
	GVirConfigDomain* _domain_config;
	GVirConnection* _connection;
	GVirStorageVol* _storage_volume;
	BoxesVMCreator* _vm_creator;
	gboolean _run_in_bg;
	gboolean _acceleration_3d;
	guint shutdown_timeout;
	gboolean force_stopped;
	gboolean saving;
	GVirConnection* system_virt_connection;
	BoxesBoxConfigSavedProperty* saved_properties;
	gint saved_properties_length1;
	gint _saved_properties_size_;
};

struct _BoxesLibvirtMachineConnectDisplayData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesLibvirtMachine* self;
	BoxesMachineConnectFlags flags;
	GCancellable* _tmp0_;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	GCancellable* _tmp3_;
	GCancellable* _tmp4_;
	GCancellable* _tmp5_;
	GCancellable* _tmp6_;
	GCancellable* _tmp7_;
	GCancellable* _tmp8_;
	GCancellable* _tmp9_;
	GCancellable* _tmp10_;
	GCancellable* _tmp11_;
	gboolean _tmp12_;
	BoxesDisplayOpenFDFunc open_fd;
	gpointer open_fd_target;
	GDestroyNotify open_fd_target_destroy_notify;
	BoxesCollectionSource* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gboolean _tmp17_;
	BoxesDisplay* _tmp18_;
	BoxesDisplay* _tmp19_;
	BoxesDisplayOpenFDFunc _tmp20_;
	gpointer _tmp20__target;
	GDestroyNotify _tmp20__target_destroy_notify;
	BoxesDisplay* _tmp21_;
	BoxesDisplay* _tmp22_;
	GError* _inner_error0_;
};

struct _BoxesLibvirtMachineNewData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GType object_type;
	BoxesLibvirtMachine* self;
	BoxesCollectionSource* source;
	GVirConnection* connection;
	GVirDomain* domain;
	GVirConfigDomain* config;
	GVirConfigDomain* _tmp0_;
	const gchar* _tmp1_;
	GVirConfigDomain* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* item_name;
	gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	GVirDomainInfo* _tmp11_;
	GVirDomainInfo* _tmp12_;
	GVirDomainState s;
	BoxesMachineMachineState _tmp13_;
	BoxesMachineMachineState _tmp14_;
	GVirConnection* _tmp15_;
	GVirConnection* _tmp16_;
	GVirConnection* _tmp17_;
	GError* _error_;
	GError* _tmp18_;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	GValue _tmp21_;
	BoxesBoxConfigSavedProperty _tmp22_;
	gchar* _tmp23_;
	GValue _tmp24_;
	BoxesBoxConfigSavedProperty _tmp25_;
	BoxesBoxConfigSavedProperty* _tmp26_;
	BoxesBoxConfig* _tmp27_;
	BoxesBoxConfigSavedProperty* _tmp28_;
	gint _tmp28__length1;
	GError* _inner_error0_;
};

struct _Block33Data {
	int _ref_count_;
	BoxesLibvirtMachine* self;
	GVirStream* stream;
	gpointer _async_data_;
};

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

struct _BoxesAppClass {
	GtkApplicationClass parent_class;
};

struct _BoxesLibvirtMachineTakeScreenshotData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesLibvirtMachine* self;
	GdkPixbuf* result;
	Block33Data* _data33_;
	GVirDomainState state;
	GVirDomainInfo* _tmp0_;
	GVirDomain* _tmp1_;
	GVirDomainInfo* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	GVirConnection* _tmp7_;
	GVirStream* _tmp8_;
	BoxesApp* _tmp9_;
	BoxesAsyncLauncher* _tmp10_;
	GdkPixbufLoader* loader;
	GdkPixbufLoader* _tmp11_;
	GInputStream* input_stream;
	GVirStream* _tmp12_;
	GInputStream* _tmp13_;
	GInputStream* _tmp14_;
	guint8* buffer;
	guint8* _tmp15_;
	gint buffer_length1;
	gint _buffer_size_;
	gssize length;
	gboolean _tmp16_;
	gssize _tmp17_;
	GInputStream* _tmp18_;
	guint8* _tmp19_;
	gint _tmp19__length1;
	GdkPixbufLoader* _tmp20_;
	guint8* _tmp21_;
	gint _tmp21__length1;
	GdkPixbufLoader* _tmp22_;
	GdkPixbufLoader* _tmp23_;
	GdkPixbuf* _tmp24_;
	GdkPixbuf* _tmp25_;
	GError* _inner_error0_;
};

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

struct _BoxesLibvirtMachineSaveRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesLibvirtMachine* self;
	GVirDomain* _tmp0_;
	GError* _inner_error0_;
};

struct _BoxesLibvirtMachineSuspendData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesLibvirtMachine* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	GVirDomain* _tmp2_;
	GError* _inner_error0_;
};

struct _BoxesAppWindow {
	HdyApplicationWindow parent_instance;
	BoxesAppWindowPrivate * priv;
	BoxesSearchbar* searchbar;
	BoxesTopbar* topbar;
	BoxesToastOverlay* toast_overlay;
	BoxesDisplayPage* display_page;
	HdyStatusPage* empty_boxes;
	BoxesTroubleshootView* troubleshoot_view;
	GtkStack* below_bin;
	GSettings* settings;
};

struct _BoxesAppWindowClass {
	HdyApplicationWindowClass parent_class;
};

struct _BoxesLibvirtMachineStartData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesLibvirtMachine* self;
	BoxesMachineConnectFlags flags;
	GCancellable* cancellable;
	BoxesMachineMachineState _tmp0_;
	BoxesMachineMachineState _tmp1_;
	BoxesMachineMachineState _tmp2_;
	BoxesMachineMachineState _tmp3_;
	GVirDomain* _tmp4_;
	BoxesMachineMachineState _tmp5_;
	BoxesMachineMachineState _tmp6_;
	GVirDomain* _tmp7_;
	gboolean _tmp8_;
	GVirDomain* _tmp9_;
	gboolean restore;
	BoxesAppWindow* _tmp10_;
	BoxesAppWindow* _tmp11_;
	BoxesTopbar* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	gchar* _tmp16_;
	BoxesAppWindow* _tmp17_;
	BoxesAppWindow* _tmp18_;
	BoxesTopbar* _tmp19_;
	const gchar* _tmp20_;
	const gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	GVirDomain* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	GError* _error_;
	GError* _tmp27_;
	const gchar* _tmp28_;
	GError* _tmp29_;
	GError* _tmp30_;
	const gchar* _tmp31_;
	GError* _tmp32_;
	GVirDomain* _tmp33_;
	GError* _vala1__error_;
	const gchar* _tmp34_;
	const gchar* _tmp35_;
	GError* _tmp36_;
	const gchar* _tmp37_;
	GVirDomain* _tmp38_;
	GDateTime* _tmp39_;
	GDateTime* _tmp40_;
	GError* _vala2__error_;
	const gchar* _tmp41_;
	const gchar* _tmp42_;
	GError* _tmp43_;
	const gchar* _tmp44_;
	GError* _inner_error0_;
};

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

struct _BoxesToast {
	GtkBox parent_instance;
	BoxesToastPrivate * priv;
	BoxesToastOKFunc undo_func;
	gpointer undo_func_target;
	GDestroyNotify undo_func_target_destroy_notify;
	BoxesToastDismissFunc dismiss_func;
	gpointer dismiss_func_target;
	GDestroyNotify dismiss_func_target_destroy_notify;
};

struct _BoxesToastClass {
	GtkBoxClass parent_class;
};

struct _Block36Data {
	int _ref_count_;
	BoxesLibvirtMachine* self;
	BoxesLibvirtMachine* clone_machine;
	gulong under_construct_id;
};

struct _BoxesLibvirtMachineCloneData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesLibvirtMachine* self;
	GVirConfigDomain* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* inhibit_reason;
	GVirConfigDomain* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	BoxesApp* _tmp7_;
	const gchar* _tmp8_;
	Block36Data* _data36_;
	gchar* xml;
	GVirConfigDomain* _tmp9_;
	gchar* _tmp10_;
	GVirConfigDomain* config;
	const gchar* _tmp11_;
	GVirConfigDomain* _tmp12_;
	GVirConfigDomain* _tmp13_;
	const gchar* _tmp14_;
	GVirStorageVol* _tmp15_;
	const gchar* _tmp16_;
	BoxesLibvirtClonedMedia* media;
	GVirConfigDomain* _tmp17_;
	BoxesLibvirtClonedMedia* _tmp18_;
	BoxesVMCreator* vm_cloner;
	BoxesLibvirtClonedMedia* _tmp19_;
	BoxesVMCreator* _tmp20_;
	BoxesVMCreator* _tmp21_;
	BoxesLibvirtMachine* _tmp22_;
	BoxesVMCreator* _tmp23_;
	BoxesLibvirtMachine* _tmp24_;
	BoxesBoxConfig* _tmp25_;
	gint64 _tmp26_;
	gint64 _tmp27_;
	BoxesLibvirtMachine* _tmp28_;
	gboolean _tmp29_;
	gboolean _tmp30_;
	BoxesLibvirtMachine* _tmp31_;
	gboolean _tmp32_;
	BoxesLibvirtMachine* _tmp33_;
	gulong _tmp34_;
	GError* _error_;
	GVirConfigDomain* _tmp35_;
	const gchar* _tmp36_;
	const gchar* _tmp37_;
	GError* _tmp38_;
	const gchar* _tmp39_;
	GError* _inner_error0_;
};

struct _BoxesLibvirtMachineSupportsAccel3dData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesLibvirtMachine* self;
	gboolean result;
	OsinfoOs* os;
	OsinfoOs* _tmp0_;
	OsinfoOs* _tmp1_;
	OsinfoDeviceList* devices;
	OsinfoOs* _tmp2_;
	OsinfoDeviceList* _tmp3_;
	OsinfoDeviceList* _tmp4_;
	OsinfoDevice* _tmp5_;
	OsinfoDevice* _tmp6_;
	gboolean _tmp7_;
};

typedef enum  {
	BOXES_OS_DATABASE_ERROR_NON_BOOTABLE,
	BOXES_OS_DATABASE_ERROR_DB_LOADING_FAILED,
	BOXES_OS_DATABASE_ERROR_UNKNOWN_OS_ID,
	BOXES_OS_DATABASE_ERROR_UNKNOWN_MEDIA_ID
} BoxesOSDatabaseError;
#define BOXES_OS_DATABASE_ERROR boxes_os_database_error_quark ()

struct _BoxesLibvirtMachineGetOsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesLibvirtMachine* self;
	OsinfoOs* result;
	gchar* os_id;
	GVirConfigDomain* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	BoxesOSDatabase* os_db;
	BoxesMediaManager* _tmp3_;
	BoxesMediaManager* _tmp4_;
	BoxesOSDatabase* _tmp5_;
	BoxesOSDatabase* _tmp6_;
	BoxesOSDatabase* _tmp7_;
	BoxesOSDatabase* _tmp8_;
	OsinfoOs* _tmp9_;
	BoxesOSDatabase* _tmp10_;
	const gchar* _tmp11_;
	OsinfoOs* _tmp12_;
	OsinfoOs* _tmp13_;
	GError* _error_;
	const gchar* _tmp14_;
	GError* _tmp15_;
	const gchar* _tmp16_;
	GError* _inner_error0_;
};

struct _BoxesLibvirtMachineCreateSnapshotData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesLibvirtMachine* self;
	gchar* description_prefix;
	GVirDomainSnapshot* result;
	GVirConfigDomainSnapshot* config;
	GVirConfigDomainSnapshot* _tmp0_;
	GDateTime* now;
	GDateTime* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	GVirDomainSnapshot* _tmp8_;
	GVirDomain* _tmp9_;
	GVirDomainSnapshot* _tmp10_;
	GVirDomainSnapshot* _tmp11_;
	GError* _inner_error0_;
};

struct _Block37Data {
	int _ref_count_;
	BoxesLibvirtMachine* self;
	gpointer _async_data_;
};

struct _BoxesLibvirtMachineWaitForSaveData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesLibvirtMachine* self;
	Block37Data* _data37_;
	gulong state_notify_id;
	gulong _tmp0_;
	gulong cancelled_id;
	GCancellable* _tmp1_;
	GCancellable* _tmp2_;
	gulong _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	GCancellable* _tmp6_;
	GCancellable* _tmp7_;
};

static gint BoxesLibvirtMachine_private_offset;
static gpointer boxes_libvirt_machine_parent_class = NULL;
VALA_EXTERN BoxesApp* boxes_app_app;

VALA_EXTERN GType boxes_ui_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType boxes_ui_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesUI, g_object_unref)
VALA_EXTERN GType boxes_collection_item_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesCollectionItem, g_object_unref)
VALA_EXTERN GType boxes_machine_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesMachine, g_object_unref)
VALA_EXTERN GType boxes_machine_connect_flags_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType boxes_libvirt_machine_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesLibvirtMachine, g_object_unref)
VALA_EXTERN GType boxes_vm_creator_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesVMCreator, g_object_unref)
VALA_EXTERN void boxes_machine_disconnect_display (BoxesMachine* self);
VALA_EXTERN void boxes_machine_connect_display (BoxesMachine* self,
                                    BoxesMachineConnectFlags flags,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN void boxes_machine_connect_display_finish (BoxesMachine* self,
                                           GAsyncResult* _res_,
                                           GError** error);
VALA_EXTERN void boxes_machine_take_screenshot (BoxesMachine* self,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN GdkPixbuf* boxes_machine_take_screenshot_finish (BoxesMachine* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
VALA_EXTERN void boxes_machine_delete (BoxesMachine* self,
                           gboolean by_user);
VALA_EXTERN void boxes_machine_save_real (BoxesMachine* self,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_);
VALA_EXTERN void boxes_machine_save_real_finish (BoxesMachine* self,
                                     GAsyncResult* _res_,
                                     GError** error);
VALA_EXTERN void boxes_machine_restart (BoxesMachine* self);
VALA_EXTERN void boxes_machine_clone (BoxesMachine* self,
                          GAsyncReadyCallback _callback_,
                          gpointer _user_data_);
VALA_EXTERN void boxes_machine_clone_finish (BoxesMachine* self,
                                 GAsyncResult* _res_);
VALA_EXTERN void boxes_machine_update_status (BoxesMachine* self);
VALA_EXTERN gboolean boxes_machine_get_suspend_at_exit (BoxesMachine* self);
VALA_EXTERN gboolean boxes_machine_get_can_save (BoxesMachine* self);
VALA_EXTERN gboolean boxes_machine_get_can_restart (BoxesMachine* self);
VALA_EXTERN gboolean boxes_machine_get_can_clone (BoxesMachine* self);
VALA_EXTERN gboolean boxes_machine_get_should_autosave (BoxesMachine* self);
VALA_EXTERN gboolean boxes_machine_get_is_local (BoxesMachine* self);
static void _vala_BoxesBoxConfigSavedProperty_array_free (BoxesBoxConfigSavedProperty * array,
                                                   gssize array_length);
static void boxes_libvirt_machine_real_disconnect_display (BoxesMachine* base);
static void boxes_libvirt_machine_real_connect_display_data_free (gpointer _data);
static void boxes_libvirt_machine_real_connect_display (BoxesMachine* base,
                                                 BoxesMachineConnectFlags flags,
                                                 GAsyncReadyCallback _callback_,
                                                 gpointer _user_data_);
static gboolean boxes_libvirt_machine_real_connect_display_co (BoxesLibvirtMachineConnectDisplayData* _data_);
VALA_EXTERN GCancellable* boxes_machine_get_connecting_cancellable (BoxesMachine* self);
static void boxes_libvirt_machine_wait_for_save (BoxesLibvirtMachine* self,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
static void boxes_libvirt_machine_wait_for_save_finish (BoxesLibvirtMachine* self,
                                                 GAsyncResult* _res_);
static void boxes_libvirt_machine_connect_display_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
VALA_EXTERN void boxes_libvirt_machine_start (BoxesLibvirtMachine* self,
                                  BoxesMachineConnectFlags flags,
                                  GCancellable* cancellable,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
VALA_EXTERN void boxes_libvirt_machine_start_finish (BoxesLibvirtMachine* self,
                                         GAsyncResult* _res_,
                                         GError** error);
VALA_EXTERN gboolean boxes_libvirt_machine_update_display (BoxesLibvirtMachine* self,
                                               GError** error);
static gint ____lambda110_ (BoxesLibvirtMachine* self);
VALA_EXTERN GVirDomain* boxes_libvirt_machine_get_domain (BoxesLibvirtMachine* self);
VALA_EXTERN const gchar* boxes_collection_item_get_name (BoxesCollectionItem* self);
static gint _____lambda110__boxes_display_open_fd_func (gpointer self);
VALA_EXTERN GType boxes_display_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesDisplay, g_object_unref)
VALA_EXTERN BoxesDisplay* boxes_machine_get_display (BoxesMachine* self);
VALA_EXTERN void boxes_display_connect_it (BoxesDisplay* self,
                               BoxesDisplayOpenFDFunc open_fd,
                               gpointer open_fd_target,
                               GDestroyNotify open_fd_target_destroy_notify,
                               GError** error);
VALA_EXTERN void boxes_machine_show_display (BoxesMachine* self);
VALA_EXTERN void boxes_display_set_enable_audio (BoxesDisplay* self,
                                     gboolean enable);
VALA_EXTERN void boxes_libvirt_machine_update_domain_config (BoxesLibvirtMachine* self);
VALA_EXTERN void boxes_libvirt_machine_set_domain_config (BoxesLibvirtMachine* self,
                                              GVirConfigDomain* value);
VALA_EXTERN GVirStorageVol* boxes_get_storage_volume (GVirConnection* connection,
                                          GVirDomain* domain);
VALA_EXTERN GVirConnection* boxes_libvirt_machine_get_connection (BoxesLibvirtMachine* self);
VALA_EXTERN void boxes_libvirt_machine_set_storage_volume (BoxesLibvirtMachine* self,
                                               GVirStorageVol* value);
static void boxes_libvirt_machine_reconnect_display (BoxesLibvirtMachine* self);
VALA_EXTERN GType boxes_app_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesAppWindow, g_object_unref)
VALA_EXTERN BoxesAppWindow* boxes_machine_get_window (BoxesMachine* self);
VALA_EXTERN void boxes_machine_set_window (BoxesMachine* self,
                               BoxesAppWindow* value);
static void boxes_libvirt_machine_construct_data_free (gpointer _data);
VALA_EXTERN void boxes_libvirt_machine_new (BoxesCollectionSource* source,
                                GVirConnection* connection,
                                GVirDomain* domain,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN BoxesLibvirtMachine* boxes_libvirt_machine_new_finish (GAsyncResult* _res_,
                                                       GError** error);
VALA_EXTERN void boxes_libvirt_machine_construct (GType object_type,
                                      BoxesCollectionSource* source,
                                      GVirConnection* connection,
                                      GVirDomain* domain,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_);
VALA_EXTERN BoxesLibvirtMachine* boxes_libvirt_machine_construct_finish (GAsyncResult* _res_,
                                                             GError** error);
static gboolean boxes_libvirt_machine_construct_co (BoxesLibvirtMachineNewData* _data_);
VALA_EXTERN BoxesMachine* boxes_machine_construct (GType object_type,
                                       BoxesCollectionSource* source,
                                       const gchar* name,
                                       const gchar* uuid);
VALA_EXTERN void boxes_libvirt_machine_set_connection (BoxesLibvirtMachine* self,
                                           GVirConnection* value);
VALA_EXTERN void boxes_libvirt_machine_set_domain (BoxesLibvirtMachine* self,
                                       GVirDomain* value);
VALA_EXTERN GType boxes_machine_machine_state_get_type (void) G_GNUC_CONST ;
VALA_EXTERN void boxes_machine_set_state (BoxesMachine* self,
                              BoxesMachineMachineState value);
static void _vala_GVirDomainInfo_free (GVirDomainInfo* self);
static void __lambda111_ (BoxesLibvirtMachine* self);
static void ___lambda111__gvir_domain_started (GVirDomain* _sender,
                                        gpointer self);
static void __lambda112_ (BoxesLibvirtMachine* self);
static void ___lambda112__gvir_domain_suspended (GVirDomain* _sender,
                                          gpointer self);
static void __lambda113_ (BoxesLibvirtMachine* self);
static void ___lambda113__gvir_domain_resumed (GVirDomain* _sender,
                                        gpointer self);
static void __lambda114_ (BoxesLibvirtMachine* self);
static void ___lambda114__gvir_domain_stopped (GVirDomain* _sender,
                                        gpointer self);
static void __lambda115_ (BoxesLibvirtMachine* self);
static void ___lambda115__gvir_domain_pmsuspended (GVirDomain* _sender,
                                            gpointer self);
static void __lambda116_ (BoxesLibvirtMachine* self);
VALA_EXTERN BoxesMachineMachineState boxes_machine_get_state (BoxesMachine* self);
static void ___lambda116__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void _boxes_libvirt_machine_update_domain_config_gvir_domain_updated (GVirDomain* _sender,
                                                                      gpointer self);
VALA_EXTERN void boxes_machine_load_screenshot (BoxesMachine* self);
VALA_EXTERN void boxes_machine_set_screenshot_enable (BoxesMachine* self,
                                          gboolean enable);
VALA_EXTERN void boxes_get_system_virt_connection (GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
VALA_EXTERN GVirConnection* boxes_get_system_virt_connection_finish (GAsyncResult* _res_,
                                                         GError** error);
static void boxes_libvirt_machine_new_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_);
VALA_EXTERN gboolean boxes_app_is_running_in_flatpak (void);
static BoxesDisplay* boxes_libvirt_machine_create_display (BoxesLibvirtMachine* self,
                                                    GError** error);
VALA_EXTERN void boxes_machine_set_display (BoxesMachine* self,
                                BoxesDisplay* value);
VALA_EXTERN GVirConfigDomain* boxes_libvirt_machine_get_domain_config (BoxesLibvirtMachine* self);
VALA_EXTERN gchar* boxes_extract_xpath (const gchar* xmldoc,
                            const gchar* xpath,
                            gboolean required,
                            GError** error);
VALA_EXTERN BoxesSpiceDisplay* boxes_spice_display_new (BoxesMachine* machine,
                                            BoxesBoxConfig* config,
                                            const gchar* host,
                                            gint port,
                                            gint tls_port);
VALA_EXTERN BoxesSpiceDisplay* boxes_spice_display_construct (GType object_type,
                                                  BoxesMachine* machine,
                                                  BoxesBoxConfig* config,
                                                  const gchar* host,
                                                  gint port,
                                                  gint tls_port);
VALA_EXTERN GType boxes_spice_display_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesSpiceDisplay, g_object_unref)
VALA_EXTERN BoxesSpiceDisplay* boxes_spice_display_new_priv (BoxesMachine* machine,
                                                 BoxesBoxConfig* config);
VALA_EXTERN BoxesSpiceDisplay* boxes_spice_display_construct_priv (GType object_type,
                                                       BoxesMachine* machine,
                                                       BoxesBoxConfig* config);
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 Block33Data* block33_data_ref (Block33Data* _data33_);
static void block33_data_unref (void * _userdata_);
static void boxes_libvirt_machine_take_screenshot_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
VALA_EXTERN GType boxes_app_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesApp, g_object_unref)
VALA_EXTERN GType boxes_collection_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesCollection, g_object_unref)
VALA_EXTERN GType boxes_shared_folders_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesSharedFoldersManager, g_object_unref)
static void __lambda117_ (Block33Data* _data33_,
                   GError** error);
static void ___lambda117__boxes_async_launcher_run_in_thread_func (gpointer self,
                                                            GError** error);
static void boxes_libvirt_machine_real_delete (BoxesMachine* base,
                                        gboolean by_user);
static Block34Data* block34_data_ref (Block34Data* _data34_);
static void block34_data_unref (void * _userdata_);
static void ___lambda41_ (Block34Data* _data34_,
                   GError** error);
VALA_EXTERN GVirStorageVol* boxes_libvirt_machine_get_storage_volume (BoxesLibvirtMachine* self);
static void ____lambda41__boxes_async_launcher_run_in_thread_func (gpointer self,
                                                            GError** error);
static void boxes_libvirt_machine_real_save_real_data_free (gpointer _data);
static void boxes_libvirt_machine_real_save_real (BoxesMachine* base,
                                           GAsyncReadyCallback _callback_,
                                           gpointer _user_data_);
static gboolean boxes_libvirt_machine_real_save_real_co (BoxesLibvirtMachineSaveRealData* _data_);
static void boxes_libvirt_machine_save_real_ready (GObject* source_object,
                                            GAsyncResult* _res_,
                                            gpointer _user_data_);
static void boxes_libvirt_machine_suspend_data_free (gpointer _data);
VALA_EXTERN void boxes_libvirt_machine_suspend (BoxesLibvirtMachine* self,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);
VALA_EXTERN void boxes_libvirt_machine_suspend_finish (BoxesLibvirtMachine* self,
                                           GAsyncResult* _res_,
                                           GError** error);
static gboolean boxes_libvirt_machine_suspend_co (BoxesLibvirtMachineSuspendData* _data_);
VALA_EXTERN gboolean boxes_libvirt_machine_get_save_on_quit (BoxesLibvirtMachine* self);
VALA_EXTERN void boxes_machine_save (BoxesMachine* self,
                         GAsyncReadyCallback _callback_,
                         gpointer _user_data_);
VALA_EXTERN void boxes_machine_save_finish (BoxesMachine* self,
                                GAsyncResult* _res_,
                                GError** error);
static void boxes_libvirt_machine_suspend_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_);
static void boxes_libvirt_machine_cancel_vm_creation (BoxesLibvirtMachine* self);
VALA_EXTERN void boxes_libvirt_machine_set_vm_creator (BoxesLibvirtMachine* self,
                                           BoxesVMCreator* value);
VALA_EXTERN void boxes_machine_set_status (BoxesMachine* self,
                               const gchar* value);
VALA_EXTERN void boxes_libvirt_machine_force_shutdown (BoxesLibvirtMachine* self);
VALA_EXTERN BoxesVMCreator* boxes_libvirt_machine_get_vm_creator (BoxesLibvirtMachine* self);
VALA_EXTERN void boxes_libvirt_machine_try_shutdown (BoxesLibvirtMachine* self);
VALA_EXTERN GVirDomainDisk* boxes_libvirt_machine_get_domain_disk (BoxesLibvirtMachine* self,
                                                       GError** error);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static GVirDomainStartFlags boxes_libvirt_machine_connect_flags_to_gvir (BoxesLibvirtMachine* self,
                                                                  BoxesMachineConnectFlags flags);
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_);
VALA_EXTERN GType boxes_searchbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesSearchbar, g_object_unref)
VALA_EXTERN GType boxes_topbar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesTopbar, g_object_unref)
VALA_EXTERN GType boxes_toast_overlay_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesToastOverlay, g_object_unref)
VALA_EXTERN GType boxes_display_page_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesDisplayPage, g_object_unref)
VALA_EXTERN GType boxes_troubleshoot_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesTroubleshootView, g_object_unref)
VALA_EXTERN void boxes_topbar_set_status (BoxesTopbar* self,
                              const gchar* value);
static void boxes_libvirt_machine_real_restart (BoxesMachine* base);
static Block35Data* block35_data_ref (Block35Data* _data35_);
static void block35_data_unref (void * _userdata_);
static void ___lambda118_ (BoxesLibvirtMachine* self,
                    GObject* obj,
                    GAsyncResult* res);
static void ____lambda118__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
static void __lambda119_ (Block35Data* _data35_);
static void ___lambda120_ (BoxesLibvirtMachine* self,
                    GObject* obj,
                    GAsyncResult* res);
static void ____lambda120__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
static void ___lambda119__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static gboolean __lambda121_ (BoxesLibvirtMachine* self);
static void __lambda122_ (BoxesLibvirtMachine* self);
static void ___lambda122__boxes_toast_ok_func (gpointer self);
VALA_EXTERN GType boxes_toast_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesToast, g_object_unref)
VALA_EXTERN void boxes_app_window_display_toast (BoxesAppWindow* self,
                                     BoxesToast* toast);
VALA_EXTERN BoxesToast* boxes_toast_new (const gchar* message);
VALA_EXTERN BoxesToast* boxes_toast_construct (GType object_type,
                                   const gchar* message);
VALA_EXTERN void boxes_toast_set_message (BoxesToast* self,
                              const gchar* value);
VALA_EXTERN void boxes_toast_set_action (BoxesToast* self,
                             const gchar* value);
static gboolean ___lambda121__gsource_func (gpointer self);
static void boxes_libvirt_machine_real_clone_data_free (gpointer _data);
static void boxes_libvirt_machine_real_clone (BoxesMachine* base,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);
static gboolean boxes_libvirt_machine_real_clone_co (BoxesLibvirtMachineCloneData* _data_);
VALA_EXTERN void boxes_machine_set_can_delete (BoxesMachine* self,
                                   gboolean value);
VALA_EXTERN void boxes_app_inhibit (BoxesApp* self,
                        GtkWindow* window,
                        GtkApplicationInhibitFlags* flags,
                        const gchar* reason);
static Block36Data* block36_data_ref (Block36Data* _data36_);
static void block36_data_unref (void * _userdata_);
VALA_EXTERN GType boxes_installer_media_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesInstallerMedia, g_object_unref)
VALA_EXTERN GType boxes_installed_media_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesInstalledMedia, g_object_unref)
VALA_EXTERN GType boxes_libvirt_media_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesLibvirtMedia, g_object_unref)
VALA_EXTERN GType boxes_libvirt_cloned_media_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesLibvirtClonedMedia, g_object_unref)
VALA_EXTERN BoxesLibvirtClonedMedia* boxes_libvirt_cloned_media_new (const gchar* path,
                                                         GVirConfigDomain* domain_config,
                                                         GError** error);
VALA_EXTERN BoxesLibvirtClonedMedia* boxes_libvirt_cloned_media_construct (GType object_type,
                                                               const gchar* path,
                                                               GVirConfigDomain* domain_config,
                                                               GError** error);
VALA_EXTERN BoxesVMCreator* boxes_installer_media_get_vm_creator (BoxesInstallerMedia* self);
VALA_EXTERN void boxes_vm_creator_create_vm (BoxesVMCreator* self,
                                 GCancellable* cancellable,
                                 gboolean clone,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_);
VALA_EXTERN BoxesLibvirtMachine* boxes_vm_creator_create_vm_finish (BoxesVMCreator* self,
                                                        GAsyncResult* _res_,
                                                        GError** error);
static void boxes_libvirt_machine_clone_ready (GObject* source_object,
                                        GAsyncResult* _res_,
                                        gpointer _user_data_);
VALA_EXTERN void boxes_vm_creator_launch_vm (BoxesVMCreator* self,
                                 BoxesLibvirtMachine* machine,
                                 gint64 access_last_time,
                                 gboolean clone,
                                 GError** error);
VALA_EXTERN gboolean boxes_libvirt_machine_get_acceleration_3d (BoxesLibvirtMachine* self);
VALA_EXTERN void boxes_libvirt_machine_set_acceleration_3d (BoxesLibvirtMachine* self,
                                                gboolean value);
VALA_EXTERN gboolean boxes_libvirt_machine_get_run_in_bg (BoxesLibvirtMachine* self);
VALA_EXTERN void boxes_libvirt_machine_set_run_in_bg (BoxesLibvirtMachine* self,
                                          gboolean value);
static void ___lambda123_ (Block36Data* _data36_);
VALA_EXTERN gboolean boxes_machine_get_under_construction (BoxesMachine* self);
VALA_EXTERN void boxes_app_uninhibit (BoxesApp* self);
static void ____lambda123__g_object_notify (GObject* _sender,
                                     GParamSpec* pspec,
                                     gpointer self);
static void boxes_libvirt_machine_supports_accel3d_data_free (gpointer _data);
VALA_EXTERN void boxes_libvirt_machine_supports_accel3d (BoxesLibvirtMachine* self,
                                             GAsyncReadyCallback _callback_,
                                             gpointer _user_data_);
VALA_EXTERN gboolean boxes_libvirt_machine_supports_accel3d_finish (BoxesLibvirtMachine* self,
                                                        GAsyncResult* _res_);
static gboolean boxes_libvirt_machine_supports_accel3d_co (BoxesLibvirtMachineSupportsAccel3dData* _data_);
VALA_EXTERN void boxes_libvirt_machine_get_os (BoxesLibvirtMachine* self,
                                   GAsyncReadyCallback _callback_,
                                   gpointer _user_data_);
VALA_EXTERN OsinfoOs* boxes_libvirt_machine_get_os_finish (BoxesLibvirtMachine* self,
                                               GAsyncResult* _res_);
static void boxes_libvirt_machine_supports_accel3d_ready (GObject* source_object,
                                                   GAsyncResult* _res_,
                                                   gpointer _user_data_);
VALA_EXTERN OsinfoDevice* boxes_find_device_by_prop (OsinfoDeviceList* devices,
                                         const gchar* prop_name,
                                         const gchar* prop_value);
static void boxes_libvirt_machine_get_os_data_free (gpointer _data);
static gboolean boxes_libvirt_machine_get_os_co (BoxesLibvirtMachineGetOsData* _data_);
VALA_EXTERN gchar* boxes_vm_configurator_get_os_id (GVirConfigDomain* domain);
VALA_EXTERN GType boxes_os_database_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesOSDatabase, g_object_unref)
VALA_EXTERN GType boxes_media_manager_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesMediaManager, g_object_unref)
VALA_EXTERN BoxesMediaManager* boxes_media_manager_get_default (void);
VALA_EXTERN BoxesOSDatabase* boxes_media_manager_get_os_db (BoxesMediaManager* self);
VALA_EXTERN void boxes_os_database_get_os_by_id (BoxesOSDatabase* self,
                                     const gchar* id,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
VALA_EXTERN GQuark boxes_os_database_error_quark (void);
VALA_EXTERN GType boxes_os_database_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN OsinfoOs* boxes_os_database_get_os_by_id_finish (BoxesOSDatabase* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
static void boxes_libvirt_machine_get_os_ready (GObject* source_object,
                                         GAsyncResult* _res_,
                                         gpointer _user_data_);
VALA_EXTERN gchar* boxes_libvirt_machine_get_ip_address (BoxesLibvirtMachine* self);
VALA_EXTERN gboolean boxes_machine_get_is_on (BoxesMachine* self);
static gchar* boxes_libvirt_machine_get_mac_address (BoxesLibvirtMachine* self);
static void boxes_libvirt_machine_create_snapshot_data_free (gpointer _data);
VALA_EXTERN void boxes_libvirt_machine_create_snapshot (BoxesLibvirtMachine* self,
                                            const gchar* description_prefix,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_);
VALA_EXTERN GVirDomainSnapshot* boxes_libvirt_machine_create_snapshot_finish (BoxesLibvirtMachine* self,
                                                                  GAsyncResult* _res_,
                                                                  GError** error);
static gboolean boxes_libvirt_machine_create_snapshot_co (BoxesLibvirtMachineCreateSnapshotData* _data_);
static void boxes_libvirt_machine_create_snapshot_ready (GObject* source_object,
                                                  GAsyncResult* _res_,
                                                  gpointer _user_data_);
static void boxes_libvirt_machine_wait_for_save_data_free (gpointer _data);
static gboolean boxes_libvirt_machine_wait_for_save_co (BoxesLibvirtMachineWaitForSaveData* _data_);
static Block37Data* block37_data_ref (Block37Data* _data37_);
static void block37_data_unref (void * _userdata_);
static void __lambda107_ (Block37Data* _data37_);
static void ___lambda107__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void __lambda108_ (Block37Data* _data37_);
static gboolean __lambda109_ (Block37Data* _data37_);
static gboolean ___lambda109__gsource_func (gpointer self);
static void ___lambda108__g_cancellable_cancelled (GCancellable* _sender,
                                            gpointer self);
static void boxes_libvirt_machine_real_update_status (BoxesMachine* base);
VALA_EXTERN const gchar* boxes_machine_get_status (BoxesMachine* self);
VALA_EXTERN gboolean boxes_vm_configurator_is_install_config (GVirConfigDomain* domain);
VALA_EXTERN gboolean boxes_vm_configurator_is_libvirt_cloning_config (GVirConfigDomain* domain);
VALA_EXTERN gboolean boxes_vm_configurator_is_import_config (GVirConfigDomain* domain);
VALA_EXTERN gboolean boxes_libvirt_machine_get_importing (BoxesLibvirtMachine* self);
VALA_EXTERN gboolean boxes_vm_configurator_is_live_config (GVirConfigDomain* domain);
VALA_EXTERN void boxes_machine_set_under_construction (BoxesMachine* self,
                                           gboolean value);
VALA_EXTERN const gchar* boxes_libvirt_machine_get_title (BoxesLibvirtMachine* self);
VALA_EXTERN void boxes_libvirt_machine_set_title (BoxesLibvirtMachine* self,
                                      const gchar* value);
VALA_EXTERN void boxes_collection_item_set_name (BoxesCollectionItem* self,
                                     const gchar* value);
VALA_EXTERN GType boxes_vm_importer_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BoxesVMImporter, g_object_unref)
VALA_EXTERN void boxes_libvirt_machine_set_save_on_quit (BoxesLibvirtMachine* self,
                                             gboolean value);
VALA_EXTERN GVirConnection* boxes_app_get_default_connection (BoxesApp* self);
VALA_EXTERN guint64 boxes_libvirt_machine_get_ram (BoxesLibvirtMachine* self);
VALA_EXTERN void boxes_libvirt_machine_set_ram (BoxesLibvirtMachine* self,
                                    guint64 value);
VALA_EXTERN GVirConfigDomainGraphicsSpice* boxes_vm_configurator_create_graphics_device (gboolean accel3d);
VALA_EXTERN gboolean boxes_libvirt_machine_get_firmware_is_efi (BoxesLibvirtMachine* self);
static void boxes_libvirt_machine_finalize (GObject * obj);
static GType boxes_libvirt_machine_get_type_once (void);
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 GRegex* _tmp_regex_0 = NULL;

static inline gpointer
boxes_libvirt_machine_get_instance_private (BoxesLibvirtMachine* self)
{
	return G_STRUCT_MEMBER_P (self, BoxesLibvirtMachine_private_offset);
}

static void
_vala_BoxesBoxConfigSavedProperty_array_free (BoxesBoxConfigSavedProperty * array,
                                              gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			boxes_box_config_saved_property_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,
                                            BoxesMachineConnectFlags flags,
                                            GAsyncReadyCallback _callback_,
                                            gpointer _user_data_)
{
	BoxesLibvirtMachine * self;
	BoxesLibvirtMachineConnectDisplayData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	self = (BoxesLibvirtMachine*) base;
	_data_ = g_slice_new0 (BoxesLibvirtMachineConnectDisplayData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_machine_real_connect_display_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->flags = flags;
	boxes_libvirt_machine_real_connect_display_co (_data_);
}

static void
boxes_libvirt_machine_connect_display_finish (BoxesMachine* base,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	BoxesLibvirtMachineConnectDisplayData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

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 gint
____lambda110_ (BoxesLibvirtMachine* self)
{
	gint _tmp6_ = -1;
	GError* _inner_error0_ = NULL;
	gint result;
	{
		gint _tmp0_ = 0;
		GVirDomain* _tmp1_;
		_tmp1_ = self->priv->_domain;
		_tmp0_ = gvir_domain_open_graphics_fd (_tmp1_, (guint) 0, (guint) 0, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		result = _tmp0_;
		return result;
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		GError* _tmp4_;
		const gchar* _tmp5_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp2_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
		_tmp3_ = _tmp2_;
		_tmp4_ = _error_;
		_tmp5_ = _tmp4_->message;
		g_critical ("libvirt-machine.vala:173: Failed to open graphics for %s: %s", _tmp3_, _tmp5_);
		result = -1;
		_g_error_free0 (_error_);
		return result;
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return _tmp6_;
}

static gint
_____lambda110__boxes_display_open_fd_func (gpointer self)
{
	gint result;
	result = ____lambda110_ ((BoxesLibvirtMachine*) self);
	return result;
}

static gboolean
boxes_libvirt_machine_real_connect_display_co (BoxesLibvirtMachineConnectDisplayData* _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_connecting_cancellable ((BoxesMachine*) _data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	g_cancellable_reset (_data_->_tmp1_);
	_data_->_state_ = 1;
	boxes_libvirt_machine_wait_for_save (_data_->self, boxes_libvirt_machine_connect_display_ready, _data_);
	return FALSE;
	_state_1:
	boxes_libvirt_machine_wait_for_save_finish (_data_->self, _data_->_res_);
	_data_->_tmp2_ = boxes_machine_get_connecting_cancellable ((BoxesMachine*) _data_->self);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (g_cancellable_is_cancelled (_data_->_tmp3_)) {
		_data_->_tmp4_ = boxes_machine_get_connecting_cancellable ((BoxesMachine*) _data_->self);
		_data_->_tmp5_ = _data_->_tmp4_;
		g_cancellable_reset (_data_->_tmp5_);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp6_ = boxes_machine_get_connecting_cancellable ((BoxesMachine*) _data_->self);
	_data_->_tmp7_ = _data_->_tmp6_;
	_data_->_state_ = 2;
	boxes_libvirt_machine_start (_data_->self, _data_->flags, _data_->_tmp7_, boxes_libvirt_machine_connect_display_ready, _data_);
	return FALSE;
	_state_2:
	boxes_libvirt_machine_start_finish (_data_->self, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp8_ = boxes_machine_get_connecting_cancellable ((BoxesMachine*) _data_->self);
	_data_->_tmp9_ = _data_->_tmp8_;
	if (g_cancellable_is_cancelled (_data_->_tmp9_)) {
		_data_->_tmp10_ = boxes_machine_get_connecting_cancellable ((BoxesMachine*) _data_->self);
		_data_->_tmp11_ = _data_->_tmp10_;
		g_cancellable_reset (_data_->_tmp11_);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp12_ = boxes_libvirt_machine_update_display (_data_->self, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_tmp12_) {
		_data_->open_fd = NULL;
		_data_->open_fd_target = NULL;
		_data_->open_fd_target_destroy_notify = NULL;
		_data_->_tmp13_ = ((BoxesMachine*) _data_->self)->source;
		_data_->_tmp14_ = boxes_collection_source_get_uri (_data_->_tmp13_);
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_tmp16_ = _data_->_tmp15_;
		_data_->_tmp17_ = g_str_has_prefix (_data_->_tmp16_, "qemu+unix");
		_g_free0 (_data_->_tmp16_);
		if (_data_->_tmp17_) {
			(_data_->open_fd_target_destroy_notify == NULL) ? NULL : (_data_->open_fd_target_destroy_notify (_data_->open_fd_target), NULL);
			_data_->open_fd = NULL;
			_data_->open_fd_target = NULL;
			_data_->open_fd_target_destroy_notify = NULL;
			_data_->open_fd = _____lambda110__boxes_display_open_fd_func;
			_data_->open_fd_target = g_object_ref (_data_->self);
			_data_->open_fd_target_destroy_notify = g_object_unref;
		}
		_data_->_tmp18_ = boxes_machine_get_display ((BoxesMachine*) _data_->self);
		_data_->_tmp19_ = _data_->_tmp18_;
		_data_->_tmp20_ = _data_->open_fd;
		_data_->_tmp20__target = _data_->open_fd_target;
		_data_->_tmp20__target_destroy_notify = _data_->open_fd_target_destroy_notify;
		_data_->open_fd = NULL;
		_data_->open_fd_target = NULL;
		_data_->open_fd_target_destroy_notify = NULL;
		boxes_display_connect_it (_data_->_tmp19_, _data_->_tmp20_, _data_->_tmp20__target, _data_->_tmp20__target_destroy_notify, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			(_data_->open_fd_target_destroy_notify == NULL) ? NULL : (_data_->open_fd_target_destroy_notify (_data_->open_fd_target), NULL);
			_data_->open_fd = NULL;
			_data_->open_fd_target = NULL;
			_data_->open_fd_target_destroy_notify = NULL;
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		(_data_->open_fd_target_destroy_notify == NULL) ? NULL : (_data_->open_fd_target_destroy_notify (_data_->open_fd_target), NULL);
		_data_->open_fd = NULL;
		_data_->open_fd_target = NULL;
		_data_->open_fd_target_destroy_notify = NULL;
	} else {
		boxes_machine_show_display ((BoxesMachine*) _data_->self);
		_data_->_tmp21_ = boxes_machine_get_display ((BoxesMachine*) _data_->self);
		_data_->_tmp22_ = _data_->_tmp21_;
		boxes_display_set_enable_audio (_data_->_tmp22_, TRUE);
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

void
boxes_libvirt_machine_update_domain_config (BoxesLibvirtMachine* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		GVirConfigDomain* _tmp0_ = NULL;
		GVirDomain* _tmp1_;
		GVirConfigDomain* _tmp2_;
		GVirConnection* _tmp3_;
		GVirDomain* _tmp4_;
		GVirStorageVol* _tmp5_;
		GVirStorageVol* _tmp6_;
		_tmp1_ = self->priv->_domain;
		_tmp2_ = gvir_domain_get_config (_tmp1_, (guint) GVIR_DOMAIN_XML_INACTIVE, &_inner_error0_);
		_tmp0_ = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		boxes_libvirt_machine_set_domain_config (self, _tmp0_);
		_tmp3_ = self->priv->_connection;
		_tmp4_ = self->priv->_domain;
		_tmp5_ = boxes_get_storage_volume (_tmp3_, _tmp4_);
		_tmp6_ = _tmp5_;
		boxes_libvirt_machine_set_storage_volume (self, _tmp6_);
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GVirDomain* _tmp7_;
		const gchar* _tmp8_;
		GError* _tmp9_;
		const gchar* _tmp10_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp7_ = self->priv->_domain;
		_tmp8_ = gvir_domain_get_name (_tmp7_);
		_tmp9_ = _error_;
		_tmp10_ = _tmp9_->message;
		g_critical ("libvirt-machine.vala:200: Failed to fetch configuration for domain '%s" \
"': %s", _tmp8_, _tmp10_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
boxes_libvirt_machine_reconnect_display (BoxesLibvirtMachine* self)
{
	BoxesDisplay* _tmp0_;
	BoxesDisplay* _tmp1_;
	BoxesAppWindow* current_window = NULL;
	BoxesAppWindow* _tmp2_;
	BoxesAppWindow* _tmp3_;
	BoxesAppWindow* _tmp4_;
	BoxesAppWindow* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_machine_get_display ((BoxesMachine*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == NULL) {
		return;
	}
	_tmp2_ = boxes_machine_get_window ((BoxesMachine*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	current_window = _tmp4_;
	boxes_machine_disconnect_display ((BoxesMachine*) self);
	_tmp5_ = current_window;
	boxes_machine_set_window ((BoxesMachine*) self, _tmp5_);
	boxes_machine_connect_display ((BoxesMachine*) self, BOXES_MACHINE_CONNECT_FLAGS_NONE, NULL, NULL);
	_g_object_unref0 (current_window);
}

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

void
boxes_libvirt_machine_construct (GType object_type,
                                 BoxesCollectionSource* source,
                                 GVirConnection* connection,
                                 GVirDomain* domain,
                                 GAsyncReadyCallback _callback_,
                                 gpointer _user_data_)
{
	BoxesLibvirtMachineNewData* _data_;
	BoxesCollectionSource* _tmp0_;
	GVirConnection* _tmp1_;
	GVirDomain* _tmp2_;
	g_return_if_fail (source != NULL);
	g_return_if_fail (connection != NULL);
	g_return_if_fail (domain != NULL);
	_data_ = g_slice_new0 (BoxesLibvirtMachineNewData);
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_machine_construct_data_free);
	_data_->object_type = object_type;
	_tmp0_ = _g_object_ref0 (source);
	_g_object_unref0 (_data_->source);
	_data_->source = _tmp0_;
	_tmp1_ = _g_object_ref0 (connection);
	_g_object_unref0 (_data_->connection);
	_data_->connection = _tmp1_;
	_tmp2_ = _g_object_ref0 (domain);
	_g_object_unref0 (_data_->domain);
	_data_->domain = _tmp2_;
	boxes_libvirt_machine_construct_co (_data_);
}

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

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

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

static void
___lambda111__gvir_domain_started (GVirDomain* _sender,
                                   gpointer self)
{
	__lambda111_ ((BoxesLibvirtMachine*) self);
}

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

static void
___lambda112__gvir_domain_suspended (GVirDomain* _sender,
                                     gpointer self)
{
	__lambda112_ ((BoxesLibvirtMachine*) self);
}

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

static void
___lambda113__gvir_domain_resumed (GVirDomain* _sender,
                                   gpointer self)
{
	__lambda113_ ((BoxesLibvirtMachine*) self);
}

static void
__lambda114_ (BoxesLibvirtMachine* self)
{
	GVirDomain* _tmp0_;
	_tmp0_ = self->priv->_domain;
	if ((*g_signal_get_invocation_hint (_tmp0_)).detail == g_quark_from_string ("saved")) {
		boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_SAVED);
	} else {
		if (self->priv->force_stopped) {
			self->priv->force_stopped = FALSE;
			boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_FORCE_STOPPED);
		} else {
			boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_STOPPED);
		}
	}
}

static void
___lambda114__gvir_domain_stopped (GVirDomain* _sender,
                                   gpointer self)
{
	__lambda114_ ((BoxesLibvirtMachine*) self);
}

static void
__lambda115_ (BoxesLibvirtMachine* self)
{
	boxes_machine_set_state ((BoxesMachine*) self, BOXES_MACHINE_MACHINE_STATE_SLEEPING);
}

static void
___lambda115__gvir_domain_pmsuspended (GVirDomain* _sender,
                                       gpointer self)
{
	__lambda115_ ((BoxesLibvirtMachine*) self);
}

static void
__lambda116_ (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
___lambda116__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda116_ ((BoxesLibvirtMachine*) self);
}

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

static void
boxes_libvirt_machine_new_ready (GObject* source_object,
                                 GAsyncResult* _res_,
                                 gpointer _user_data_)
{
	BoxesLibvirtMachineNewData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_machine_construct_co (_data_);
}

static gboolean
boxes_libvirt_machine_construct_co (BoxesLibvirtMachineNewData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gvir_domain_get_config (_data_->domain, (guint) GVIR_DOMAIN_XML_INACTIVE, &_data_->_inner_error0_);
	_data_->config = _data_->_tmp0_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = _data_->config;
	_data_->_tmp3_ = gvir_config_domain_get_title (_data_->_tmp2_);
	_data_->_tmp1_ = _data_->_tmp3_;
	if (_data_->_tmp1_ == NULL) {
		_data_->_tmp4_ = gvir_domain_get_name (_data_->domain);
		_data_->_tmp1_ = _data_->_tmp4_;
	}
	_data_->_tmp5_ = g_strdup (_data_->_tmp1_);
	_data_->item_name = _data_->_tmp5_;
	_data_->_tmp6_ = _data_->item_name;
	_data_->_tmp7_ = gvir_domain_get_uuid (_data_->domain);
	_data_->self = (BoxesLibvirtMachine*) boxes_machine_construct (_data_->object_type, _data_->source, _data_->_tmp6_, _data_->_tmp7_);
	_data_->_tmp8_ = gvir_domain_get_name (_data_->domain);
	_data_->_tmp9_ = g_strconcat ("new libvirt machine: ", _data_->_tmp8_, NULL);
	_data_->_tmp10_ = _data_->_tmp9_;
	g_debug ("libvirt-machine.vala:222: %s", _data_->_tmp10_);
	_g_free0 (_data_->_tmp10_);
	boxes_libvirt_machine_set_connection (_data_->self, _data_->connection);
	boxes_libvirt_machine_set_domain (_data_->self, _data_->domain);
	{
		_data_->_tmp12_ = gvir_domain_get_info (_data_->domain, &_data_->_inner_error0_);
		_data_->_tmp11_ = _data_->_tmp12_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->s = _data_->_tmp11_->state;
		switch (_data_->s) {
			case GVIR_DOMAIN_STATE_RUNNING:
			case GVIR_DOMAIN_STATE_BLOCKED:
			{
				boxes_machine_set_state ((BoxesMachine*) _data_->self, BOXES_MACHINE_MACHINE_STATE_RUNNING);
				break;
			}
			case GVIR_DOMAIN_STATE_PAUSED:
			{
				boxes_machine_set_state ((BoxesMachine*) _data_->self, BOXES_MACHINE_MACHINE_STATE_PAUSED);
				break;
			}
			case GVIR_DOMAIN_STATE_SHUTDOWN:
			case GVIR_DOMAIN_STATE_SHUTOFF:
			{
				if (gvir_domain_get_saved (_data_->domain)) {
					boxes_machine_set_state ((BoxesMachine*) _data_->self, BOXES_MACHINE_MACHINE_STATE_SAVED);
				} else {
					boxes_machine_set_state ((BoxesMachine*) _data_->self, BOXES_MACHINE_MACHINE_STATE_STOPPED);
				}
				break;
			}
			case GVIR_DOMAIN_STATE_CRASHED:
			{
				boxes_machine_set_state ((BoxesMachine*) _data_->self, BOXES_MACHINE_MACHINE_STATE_STOPPED);
				break;
			}
			case GVIR_DOMAIN_STATE_PMSUSPENDED:
			{
				boxes_machine_set_state ((BoxesMachine*) _data_->self, BOXES_MACHINE_MACHINE_STATE_SLEEPING);
				break;
			}
			default:
			case GVIR_DOMAIN_STATE_NONE:
			{
				boxes_machine_set_state ((BoxesMachine*) _data_->self, BOXES_MACHINE_MACHINE_STATE_UNKNOWN);
				break;
			}
		}
		__vala_GVirDomainInfo_free0 (_data_->_tmp11_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
		boxes_machine_set_state ((BoxesMachine*) _data_->self, BOXES_MACHINE_MACHINE_STATE_UNKNOWN);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_free0 (_data_->item_name);
		_g_object_unref0 (_data_->config);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_signal_connect_object (_data_->domain, "started", (GCallback) ___lambda111__gvir_domain_started, _data_->self, 0);
	g_signal_connect_object (_data_->domain, "suspended", (GCallback) ___lambda112__gvir_domain_suspended, _data_->self, 0);
	g_signal_connect_object (_data_->domain, "resumed", (GCallback) ___lambda113__gvir_domain_resumed, _data_->self, 0);
	g_signal_connect_object (_data_->domain, "stopped", (GCallback) ___lambda114__gvir_domain_stopped, _data_->self, 0);
	g_signal_connect_object (_data_->domain, "pmsuspended", (GCallback) ___lambda115__gvir_domain_pmsuspended, _data_->self, 0);
	g_signal_connect_object ((GObject*) _data_->self, "notify::state", (GCallback) ___lambda116__g_object_notify, _data_->self, 0);
	boxes_libvirt_machine_update_domain_config (_data_->self);
	g_signal_connect_object (_data_->domain, "updated", (GCallback) _boxes_libvirt_machine_update_domain_config_gvir_domain_updated, _data_->self, 0);
	_data_->_tmp13_ = boxes_machine_get_state ((BoxesMachine*) _data_->self);
	_data_->_tmp14_ = _data_->_tmp13_;
	if (_data_->_tmp14_ != BOXES_MACHINE_MACHINE_STATE_STOPPED) {
		boxes_machine_load_screenshot ((BoxesMachine*) _data_->self);
	}
	boxes_machine_set_screenshot_enable ((BoxesMachine*) _data_->self, TRUE);
	{
		_data_->_state_ = 1;
		boxes_get_system_virt_connection (boxes_libvirt_machine_new_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp16_ = boxes_get_system_virt_connection_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp15_ = _data_->_tmp16_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch1_g_error;
		}
		_data_->_tmp17_ = _data_->_tmp15_;
		_data_->_tmp15_ = NULL;
		_g_object_unref0 (_data_->self->priv->system_virt_connection);
		_data_->self->priv->system_virt_connection = _data_->_tmp17_;
		_g_object_unref0 (_data_->_tmp15_);
	}
	goto __finally1;
	__catch1_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		if (!boxes_app_is_running_in_flatpak ()) {
			_data_->_tmp18_ = _data_->_error_;
			_data_->_tmp19_ = _data_->_tmp18_->message;
			g_message ("libvirt-machine.vala:290: Failed to connection to system libvirt: %s", _data_->_tmp19_);
		}
		_g_error_free0 (_data_->_error_);
	}
	__finally1:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_free0 (_data_->item_name);
		_g_object_unref0 (_data_->config);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	boxes_machine_update_status ((BoxesMachine*) _data_->self);
	_data_->_tmp20_ = g_strdup ("run-in-bg");
	memset (&_data_->_tmp21_, 0, sizeof (GValue));
	g_value_init (&_data_->_tmp21_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_data_->_tmp21_, FALSE);
	memset (&_data_->_tmp22_, 0, sizeof (BoxesBoxConfigSavedProperty));
	memset (&_data_->_tmp22_, 0, sizeof (BoxesBoxConfigSavedProperty));
	_g_free0 (_data_->_tmp22_.name);
	_data_->_tmp22_.name = _data_->_tmp20_;
	G_IS_VALUE (&_data_->_tmp22_.default_value) ? (g_value_unset (&_data_->_tmp22_.default_value), NULL) : NULL;
	_data_->_tmp22_.default_value = _data_->_tmp21_;
	_data_->_tmp23_ = g_strdup ("acceleration-3d");
	memset (&_data_->_tmp24_, 0, sizeof (GValue));
	g_value_init (&_data_->_tmp24_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_data_->_tmp24_, FALSE);
	memset (&_data_->_tmp25_, 0, sizeof (BoxesBoxConfigSavedProperty));
	memset (&_data_->_tmp25_, 0, sizeof (BoxesBoxConfigSavedProperty));
	_g_free0 (_data_->_tmp25_.name);
	_data_->_tmp25_.name = _data_->_tmp23_;
	G_IS_VALUE (&_data_->_tmp25_.default_value) ? (g_value_unset (&_data_->_tmp25_.default_value), NULL) : NULL;
	_data_->_tmp25_.default_value = _data_->_tmp24_;
	_data_->_tmp26_ = g_new0 (BoxesBoxConfigSavedProperty, 2);
	_data_->_tmp26_[0] = _data_->_tmp22_;
	_data_->_tmp26_[1] = _data_->_tmp25_;
	_data_->self->priv->saved_properties = (_vala_BoxesBoxConfigSavedProperty_array_free (_data_->self->priv->saved_properties, _data_->self->priv->saved_properties_length1), NULL);
	_data_->self->priv->saved_properties = _data_->_tmp26_;
	_data_->self->priv->saved_properties_length1 = 2;
	_data_->self->priv->_saved_properties_size_ = _data_->self->priv->saved_properties_length1;
	_data_->_tmp27_ = ((BoxesMachine*) _data_->self)->config;
	_data_->_tmp28_ = _data_->self->priv->saved_properties;
	_data_->_tmp28__length1 = _data_->self->priv->saved_properties_length1;
	boxes_box_config_save_properties (_data_->_tmp27_, (GObject*) _data_->self, _data_->_tmp28_, (gint) _data_->_tmp28__length1);
	_g_free0 (_data_->item_name);
	_g_object_unref0 (_data_->config);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

void
boxes_libvirt_machine_new (BoxesCollectionSource* source,
                           GVirConnection* connection,
                           GVirDomain* domain,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_)
{
	boxes_libvirt_machine_construct (BOXES_TYPE_LIBVIRT_MACHINE, source, connection, domain, _callback_, _user_data_);
}

BoxesLibvirtMachine*
boxes_libvirt_machine_new_finish (GAsyncResult* _res_,
                                  GError** error)
{
	return boxes_libvirt_machine_construct_finish (_res_, error);
}

gboolean
boxes_libvirt_machine_update_display (BoxesLibvirtMachine* self,
                                      GError** error)
{
	gboolean created_display = FALSE;
	BoxesDisplay* _tmp0_;
	BoxesDisplay* _tmp1_;
	BoxesDisplay* _tmp2_;
	BoxesDisplay* _tmp3_;
	GError* _inner_error0_ = NULL;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	boxes_libvirt_machine_update_domain_config (self);
	_tmp0_ = boxes_machine_get_display ((BoxesMachine*) self);
	_tmp1_ = _tmp0_;
	created_display = _tmp1_ == NULL;
	_tmp2_ = boxes_machine_get_display ((BoxesMachine*) self);
	_tmp3_ = _tmp2_;
	if (_tmp3_ == NULL) {
		BoxesDisplay* _tmp4_ = NULL;
		BoxesDisplay* _tmp5_;
		_tmp5_ = boxes_libvirt_machine_create_display (self, &_inner_error0_);
		_tmp4_ = _tmp5_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp6_ = FALSE;
			g_propagate_error (error, _inner_error0_);
			return _tmp6_;
		}
		boxes_machine_set_display ((BoxesMachine*) self, _tmp4_);
		_g_object_unref0 (_tmp4_);
	}
	result = created_display;
	return result;
}

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

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

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_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_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_take_screenshot_finish (BoxesMachine* base,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	GdkPixbuf* result;
	BoxesLibvirtMachineTakeScreenshotData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

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

static void
block33_data_unref (void * _userdata_)
{
	Block33Data* _data33_;
	_data33_ = (Block33Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
		BoxesLibvirtMachine* self;
		self = _data33_->self;
		_g_object_unref0 (_data33_->stream);
		_g_object_unref0 (self);
		g_slice_free (Block33Data, _data33_);
	}
}

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
__lambda117_ (Block33Data* _data33_,
              GError** error)
{
	BoxesLibvirtMachine* self;
	GVirDomain* _tmp0_;
	GVirStream* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GError* _inner_error0_ = NULL;
	self = _data33_->self;
	_tmp0_ = self->priv->_domain;
	_tmp1_ = _data33_->stream;
	_tmp2_ = gvir_domain_screenshot (_tmp0_, _tmp1_, (guint) 0, (guint) 0, &_inner_error0_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp3_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
}

static void
___lambda117__boxes_async_launcher_run_in_thread_func (gpointer self,
                                                       GError** error)
{
	__lambda117_ (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_->_data33_ = g_slice_new0 (Block33Data);
	_data_->_data33_->_ref_count_ = 1;
	_data_->_data33_->self = g_object_ref (_data_->self);
	_data_->_data33_->_async_data_ = _data_;
	_data_->state = GVIR_DOMAIN_STATE_NONE;
	{
		_data_->_tmp1_ = _data_->self->priv->_domain;
		_data_->_state_ = 1;
		gvir_domain_get_info_async (_data_->_tmp1_, NULL, boxes_libvirt_machine_take_screenshot_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp2_ = gvir_domain_get_info_finish (_data_->_tmp1_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp0_ = _data_->_tmp2_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->state = _data_->_tmp0_->state;
		__vala_GVirDomainInfo_free0 (_data_->_tmp0_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		g_clear_error (&_data_->_inner_error0_);
		_data_->_tmp3_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->self);
		_data_->_tmp4_ = _data_->_tmp3_;
		g_warning ("libvirt-machine.vala:342: Failed to get information on '%s'", _data_->_tmp4_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		block33_data_unref (_data_->_data33_);
		_data_->_data33_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->state != GVIR_DOMAIN_STATE_RUNNING) {
		_data_->_tmp6_ = _data_->state != GVIR_DOMAIN_STATE_PAUSED;
	} else {
		_data_->_tmp6_ = FALSE;
	}
	if (_data_->_tmp6_) {
		_data_->_tmp5_ = _data_->state != GVIR_DOMAIN_STATE_PMSUSPENDED;
	} else {
		_data_->_tmp5_ = FALSE;
	}
	if (_data_->_tmp5_) {
		_data_->result = NULL;
		block33_data_unref (_data_->_data33_);
		_data_->_data33_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp7_ = _data_->self->priv->_connection;
	_data_->_tmp8_ = gvir_connection_get_stream (_data_->_tmp7_, (guint) 0);
	_data_->_data33_->stream = _data_->_tmp8_;
	_data_->_tmp9_ = boxes_app_app;
	_data_->_tmp10_ = _data_->_tmp9_->async_launcher;
	_data_->_state_ = 2;
	boxes_async_launcher_launch (_data_->_tmp10_, ___lambda117__boxes_async_launcher_run_in_thread_func, block33_data_ref (_data_->_data33_), block33_data_unref, boxes_libvirt_machine_take_screenshot_ready, _data_);
	return FALSE;
	_state_2:
	boxes_async_launcher_launch_finish (_data_->_tmp10_, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		block33_data_unref (_data_->_data33_);
		_data_->_data33_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp11_ = gdk_pixbuf_loader_new ();
	_data_->loader = _data_->_tmp11_;
	_data_->_tmp12_ = _data_->_data33_->stream;
	_data_->_tmp13_ = g_io_stream_get_input_stream ((GIOStream*) _data_->_tmp12_);
	_data_->_tmp14_ = _g_object_ref0 (_data_->_tmp13_);
	_data_->input_stream = _data_->_tmp14_;
	_data_->_tmp15_ = g_new0 (guint8, 65535);
	_data_->buffer = _data_->_tmp15_;
	_data_->buffer_length1 = 65535;
	_data_->_buffer_size_ = _data_->buffer_length1;
	_data_->length = (gssize) 0;
	{
		_data_->_tmp16_ = TRUE;
		while (TRUE) {
			if (!_data_->_tmp16_) {
				if (!(_data_->length > ((gssize) 0))) {
					break;
				}
			}
			_data_->_tmp16_ = FALSE;
			_data_->_tmp18_ = _data_->input_stream;
			_data_->_tmp19_ = _data_->buffer;
			_data_->_tmp19__length1 = _data_->buffer_length1;
			_data_->_state_ = 3;
			g_input_stream_read_async (_data_->_tmp18_, _data_->_tmp19_, (gsize) _data_->_tmp19__length1, G_PRIORITY_DEFAULT, NULL, boxes_libvirt_machine_take_screenshot_ready, _data_);
			return FALSE;
			_state_3:
			_data_->_tmp17_ = g_input_stream_read_finish (_data_->_tmp18_, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_data_->buffer = (g_free (_data_->buffer), NULL);
				_g_object_unref0 (_data_->input_stream);
				_g_object_unref0 (_data_->loader);
				block33_data_unref (_data_->_data33_);
				_data_->_data33_ = NULL;
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			_data_->length = _data_->_tmp17_;
			_data_->_tmp20_ = _data_->loader;
			_data_->_tmp21_ = _data_->buffer;
			_data_->_tmp21__length1 = _data_->buffer_length1;
			gdk_pixbuf_loader_write (_data_->_tmp20_, _data_->_tmp21_ + 0, (gsize) (((gint) _data_->length) - 0), &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				_data_->buffer = (g_free (_data_->buffer), NULL);
				_g_object_unref0 (_data_->input_stream);
				_g_object_unref0 (_data_->loader);
				block33_data_unref (_data_->_data33_);
				_data_->_data33_ = NULL;
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		}
	}
	_data_->_tmp22_ = _data_->loader;
	gdk_pixbuf_loader_close (_data_->_tmp22_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_data_->buffer = (g_free (_data_->buffer), NULL);
		_g_object_unref0 (_data_->input_stream);
		_g_object_unref0 (_data_->loader);
		block33_data_unref (_data_->_data33_);
		_data_->_data33_ = NULL;
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp23_ = _data_->loader;
	_data_->_tmp24_ = gdk_pixbuf_loader_get_pixbuf (_data_->_tmp23_);
	_data_->_tmp25_ = _g_object_ref0 (_data_->_tmp24_);
	_data_->result = _data_->_tmp25_;
	_data_->buffer = (g_free (_data_->buffer), NULL);
	_g_object_unref0 (_data_->input_stream);
	_g_object_unref0 (_data_->loader);
	block33_data_unref (_data_->_data33_);
	_data_->_data33_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static Block34Data*
block34_data_ref (Block34Data* _data34_)
{
	g_atomic_int_inc (&_data34_->_ref_count_);
	return _data34_;
}

static void
block34_data_unref (void * _userdata_)
{
	Block34Data* _data34_;
	_data34_ = (Block34Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data34_->_ref_count_)) {
		BoxesLibvirtMachine* self;
		self = _data34_->self;
		_g_object_unref0 (_data34_->domain);
		_g_object_unref0 (self);
		g_slice_free (Block34Data, _data34_);
	}
}

static void
___lambda41_ (Block34Data* _data34_,
              GError** error)
{
	BoxesLibvirtMachine* self;
	GVirStorageVol* _tmp6_;
	GError* _inner_error0_ = NULL;
	self = _data34_->self;
	{
		GVirDomain* _tmp0_;
		_tmp0_ = _data34_->domain;
		gvir_domain_delete (_tmp0_, (guint) ((GVIR_DOMAIN_DELETE_SAVED_STATE | GVIR_DOMAIN_DELETE_SNAPSHOTS_METADATA) | GVIR_DOMAIN_DELETE_REMOVE_NVRAM), &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp1_;
		const gchar* _tmp2_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp1_ = err;
		_tmp2_ = _tmp1_->message;
		g_warning ("libvirt-machine.vala:387: %s", _tmp2_);
		_g_error_free0 (err);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	{
		GVirDomain* _tmp3_;
		_tmp3_ = _data34_->domain;
		gvir_domain_stop (_tmp3_, (guint) 0, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch1_g_error;
		}
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* err = NULL;
		GError* _tmp4_;
		const gchar* _tmp5_;
		err = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp4_ = err;
		_tmp5_ = _tmp4_->message;
		g_debug ("libvirt-machine.vala:394: %s", _tmp5_);
		_g_error_free0 (err);
	}
	__finally1:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
	_tmp6_ = self->priv->_storage_volume;
	if (_tmp6_ != NULL) {
		{
			GVirStorageVol* _tmp7_;
			_tmp7_ = self->priv->_storage_volume;
			gvir_storage_vol_delete (_tmp7_, (guint) 0, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch2_g_error;
			}
		}
		goto __finally2;
		__catch2_g_error:
		{
			GError* err = NULL;
			GError* _tmp8_;
			const gchar* _tmp9_;
			err = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp8_ = err;
			_tmp9_ = _tmp8_->message;
			g_warning ("libvirt-machine.vala:402: %s", _tmp9_);
			_g_error_free0 (err);
		}
		__finally2:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			return;
		}
	}
}

static void
____lambda41__boxes_async_launcher_run_in_thread_func (gpointer self,
                                                       GError** error)
{
	___lambda41_ (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_;
	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:367: %s", _tmp3_);
	_g_free0 (_tmp3_);
	BOXES_MACHINE_CLASS (boxes_libvirt_machine_parent_class)->delete (G_TYPE_CHECK_INSTANCE_CAST (self, BOXES_TYPE_MACHINE, BoxesMachine), by_user);
	if (self->priv->shutdown_timeout != ((guint) 0)) {
		g_source_remove (self->priv->shutdown_timeout);
		self->priv->shutdown_timeout = (guint) 0;
	}
	if (by_user) {
		Block34Data* _data34_;
		GVirDomain* _tmp4_;
		GVirDomain* _tmp5_;
		BoxesApp* _tmp6_;
		BoxesAsyncLauncher* _tmp7_;
		_data34_ = g_slice_new0 (Block34Data);
		_data34_->_ref_count_ = 1;
		_data34_->self = g_object_ref (self);
		_tmp4_ = self->priv->_domain;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		_data34_->domain = _tmp5_;
		_tmp6_ = boxes_app_app;
		_tmp7_ = _tmp6_->async_launcher;
		boxes_async_launcher_launch (_tmp7_, ____lambda41__boxes_async_launcher_run_in_thread_func, block34_data_ref (_data34_), block34_data_unref, NULL, NULL);
		block34_data_unref (_data34_);
		_data34_ = NULL;
	}
}

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

static void
boxes_libvirt_machine_real_save_real (BoxesMachine* base,
                                      GAsyncReadyCallback _callback_,
                                      gpointer _user_data_)
{
	BoxesLibvirtMachine * self;
	BoxesLibvirtMachineSaveRealData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	self = (BoxesLibvirtMachine*) base;
	_data_ = g_slice_new0 (BoxesLibvirtMachineSaveRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_machine_real_save_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	boxes_libvirt_machine_real_save_real_co (_data_);
}

static void
boxes_libvirt_machine_save_real_finish (BoxesMachine* base,
                                        GAsyncResult* _res_,
                                        GError** error)
{
	BoxesLibvirtMachineSaveRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static void
boxes_libvirt_machine_save_real_ready (GObject* source_object,
                                       GAsyncResult* _res_,
                                       gpointer _user_data_)
{
	BoxesLibvirtMachineSaveRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_machine_real_save_real_co (_data_);
}

static gboolean
boxes_libvirt_machine_real_save_real_co (BoxesLibvirtMachineSaveRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->self->priv->saving = TRUE;
	_data_->_tmp0_ = _data_->self->priv->_domain;
	_data_->_state_ = 1;
	gvir_domain_save_async (_data_->_tmp0_, (guint) 0, NULL, boxes_libvirt_machine_save_real_ready, _data_);
	return FALSE;
	_state_1:
	gvir_domain_save_finish (_data_->_tmp0_, _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->self->priv->saving = FALSE;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
boxes_libvirt_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_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (BoxesLibvirtMachineSuspendData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_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_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

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_->_tmp0_ = boxes_libvirt_machine_get_save_on_quit (_data_->self);
	_data_->_tmp1_ = _data_->_tmp0_;
	if (_data_->_tmp1_) {
		_data_->_state_ = 1;
		boxes_machine_save ((BoxesMachine*) _data_->self, boxes_libvirt_machine_suspend_ready, _data_);
		return FALSE;
		_state_1:
		boxes_machine_save_finish ((BoxesMachine*) _data_->self, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	} else {
		_data_->_tmp2_ = _data_->self->priv->_domain;
		gvir_domain_suspend (_data_->_tmp2_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
boxes_libvirt_machine_cancel_vm_creation (BoxesLibvirtMachine* self)
{
	g_return_if_fail (self != NULL);
	boxes_libvirt_machine_set_vm_creator (self, NULL);
	boxes_machine_set_status ((BoxesMachine*) self, NULL);
}

void
boxes_libvirt_machine_force_shutdown (BoxesLibvirtMachine* self)
{
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp1_ = _tmp0_;
	g_debug ("libvirt-machine.vala:427: Force shutdown '%s'..", _tmp1_);
	{
		BoxesVMCreator* _tmp2_;
		BoxesVMCreator* _tmp3_;
		GVirDomain* _tmp4_;
		self->priv->force_stopped = TRUE;
		_tmp2_ = boxes_libvirt_machine_get_vm_creator (self);
		_tmp3_ = _tmp2_;
		if (_tmp3_ != NULL) {
			boxes_libvirt_machine_cancel_vm_creation (self);
		}
		_tmp4_ = self->priv->_domain;
		gvir_domain_stop (_tmp4_, (guint) 0, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GVirDomain* _tmp5_;
		const gchar* _tmp6_;
		GError* _tmp7_;
		const gchar* _tmp8_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp5_ = self->priv->_domain;
		_tmp6_ = gvir_domain_get_name (_tmp5_);
		_tmp7_ = _error_;
		_tmp8_ = _tmp7_->message;
		g_warning ("libvirt-machine.vala:436: Failed to shutdown '%s': %s", _tmp6_, _tmp8_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

void
boxes_libvirt_machine_try_shutdown (BoxesLibvirtMachine* self)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		GVirDomain* _tmp0_;
		BoxesVMCreator* _tmp1_;
		BoxesVMCreator* _tmp2_;
		_tmp0_ = self->priv->_domain;
		gvir_domain_shutdown (_tmp0_, (guint) 0, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp1_ = boxes_libvirt_machine_get_vm_creator (self);
		_tmp2_ = _tmp1_;
		if (_tmp2_ != NULL) {
			boxes_libvirt_machine_cancel_vm_creation (self);
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GVirDomain* _tmp3_;
		const gchar* _tmp4_;
		GError* _tmp5_;
		const gchar* _tmp6_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = self->priv->_domain;
		_tmp4_ = gvir_domain_get_name (_tmp3_);
		_tmp5_ = _error_;
		_tmp6_ = _tmp5_->message;
		g_warning ("libvirt-machine.vala:447: Failed to reboot '%s': %s", _tmp4_, _tmp6_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

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

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

GVirDomainDisk*
boxes_libvirt_machine_get_domain_disk (BoxesLibvirtMachine* self,
                                       GError** error)
{
	GVirDomainDisk* disk = NULL;
	gpointer _tmp0_;
	GVirDomainDisk* _tmp1_;
	GVirConfigDomain* _tmp2_;
	GList* _tmp3_;
	GVirDomainDisk* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = NULL;
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, gvir_domain_disk_get_type ()) ? ((GVirDomainDisk*) _tmp0_) : NULL);
	disk = _tmp1_;
	_tmp2_ = self->priv->_domain_config;
	_tmp3_ = gvir_config_domain_get_devices (_tmp2_);
	{
		GList* device_config_collection = NULL;
		GList* device_config_it = NULL;
		device_config_collection = _tmp3_;
		for (device_config_it = device_config_collection; device_config_it != NULL; device_config_it = device_config_it->next) {
			GVirConfigDomainDevice* _tmp4_;
			GVirConfigDomainDevice* device_config = NULL;
			_tmp4_ = _g_object_ref0 ((GVirConfigDomainDevice*) device_config_it->data);
			device_config = _tmp4_;
			{
				GVirConfigDomainDevice* _tmp5_;
				_tmp5_ = device_config;
				if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, gvir_config_domain_disk_get_type ())) {
					GVirConfigDomainDisk* disk_config = NULL;
					GVirConfigDomainDevice* _tmp6_;
					GVirConfigDomainDisk* _tmp7_;
					GVirConfigDomainDiskGuestDeviceType disk_type = 0;
					GVirConfigDomainDisk* _tmp8_;
					_tmp6_ = device_config;
					_tmp7_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp6_, gvir_config_domain_disk_get_type ()) ? ((GVirConfigDomainDisk*) _tmp6_) : NULL);
					disk_config = _tmp7_;
					_tmp8_ = disk_config;
					disk_type = gvir_config_domain_disk_get_guest_device_type (_tmp8_);
					if (disk_type == GVIR_CONFIG_DOMAIN_DISK_GUEST_DEVICE_DISK) {
						GVirDomain* _tmp9_;
						GVirConfigDomainDisk* _tmp10_;
						GObject* _tmp11_;
						GObject* _tmp12_;
						GVirDomainDisk* _tmp13_;
						_tmp9_ = self->priv->_domain;
						_tmp10_ = disk_config;
						_tmp11_ = g_object_new (gvir_domain_disk_get_type (), "domain", _tmp9_, "config", _tmp10_, NULL);
						_tmp12_ = G_IS_INITIALLY_UNOWNED (_tmp11_) ? g_object_ref_sink (_tmp11_) : _tmp11_;
						_tmp13_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp12_, gvir_domain_disk_get_type ()) ? ((GVirDomainDisk*) _tmp12_) : NULL;
						if (_tmp13_ == NULL) {
							_g_object_unref0 (_tmp12_);
						}
						_g_object_unref0 (disk);
						disk = _tmp13_;
						_g_object_unref0 (disk_config);
						_g_object_unref0 (device_config);
						break;
					}
					_g_object_unref0 (disk_config);
				}
				_g_object_unref0 (device_config);
			}
		}
		(device_config_collection == NULL) ? NULL : (device_config_collection = (_g_list_free__g_object_unref0_ (device_config_collection), NULL));
	}
	result = disk;
	return result;
}

static GVirDomainStartFlags
boxes_libvirt_machine_connect_flags_to_gvir (BoxesLibvirtMachine* self,
                                             BoxesMachineConnectFlags flags)
{
	GVirDomainStartFlags gvir_flags = 0U;
	GVirDomainStartFlags result;
	g_return_val_if_fail (self != NULL, 0U);
	gvir_flags = 0;
	if ((flags & BOXES_MACHINE_CONNECT_FLAGS_IGNORE_SAVED_STATE) == BOXES_MACHINE_CONNECT_FLAGS_IGNORE_SAVED_STATE) {
		gvir_flags |= GVIR_DOMAIN_START_FORCE_BOOT;
	}
	result = gvir_flags;
	return result;
}

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

void
boxes_libvirt_machine_start (BoxesLibvirtMachine* self,
                             BoxesMachineConnectFlags flags,
                             GCancellable* cancellable,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	BoxesLibvirtMachineStartData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	GCancellable* _tmp1_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (BoxesLibvirtMachineStartData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_machine_start_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->flags = flags;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	boxes_libvirt_machine_start_co (_data_);
}

void
boxes_libvirt_machine_start_finish (BoxesLibvirtMachine* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	BoxesLibvirtMachineStartData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

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;
		case 3:
		goto _state_3;
		case 4:
		goto _state_4;
		case 5:
		goto _state_5;
		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) {
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = boxes_machine_get_state ((BoxesMachine*) _data_->self);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_ == BOXES_MACHINE_MACHINE_STATE_PAUSED) {
		_data_->_tmp4_ = _data_->self->priv->_domain;
		_data_->_state_ = 1;
		gvir_domain_resume_async (_data_->_tmp4_, _data_->cancellable, boxes_libvirt_machine_start_ready, _data_);
		return FALSE;
		_state_1:
		gvir_domain_resume_finish (_data_->_tmp4_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
	} else {
		_data_->_tmp5_ = boxes_machine_get_state ((BoxesMachine*) _data_->self);
		_data_->_tmp6_ = _data_->_tmp5_;
		if (_data_->_tmp6_ == BOXES_MACHINE_MACHINE_STATE_SLEEPING) {
			_data_->_tmp7_ = _data_->self->priv->_domain;
			_data_->_state_ = 2;
			gvir_domain_wakeup_async (_data_->_tmp7_, (guint) 0, _data_->cancellable, boxes_libvirt_machine_start_ready, _data_);
			return FALSE;
			_state_2:
			gvir_domain_wakeup_finish (_data_->_tmp7_, _data_->_res_, &_data_->_inner_error0_);
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
		} else {
			_data_->_tmp9_ = _data_->self->priv->_domain;
			if (gvir_domain_get_saved (_data_->_tmp9_)) {
				_data_->_tmp8_ = !((_data_->flags & BOXES_MACHINE_CONNECT_FLAGS_IGNORE_SAVED_STATE) == BOXES_MACHINE_CONNECT_FLAGS_IGNORE_SAVED_STATE);
			} else {
				_data_->_tmp8_ = FALSE;
			}
			_data_->restore = _data_->_tmp8_;
			if (_data_->restore) {
				_data_->_tmp10_ = boxes_machine_get_window ((BoxesMachine*) _data_->self);
				_data_->_tmp11_ = _data_->_tmp10_;
				_data_->_tmp12_ = _data_->_tmp11_->topbar;
				_data_->_tmp13_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->self);
				_data_->_tmp14_ = _data_->_tmp13_;
				_data_->_tmp15_ = g_strdup_printf (_ ("Restoring %s from disk"), _data_->_tmp14_);
				_data_->_tmp16_ = _data_->_tmp15_;
				boxes_topbar_set_status (_data_->_tmp12_, _data_->_tmp16_);
				_g_free0 (_data_->_tmp16_);
			} else {
				_data_->_tmp17_ = boxes_machine_get_window ((BoxesMachine*) _data_->self);
				_data_->_tmp18_ = _data_->_tmp17_;
				_data_->_tmp19_ = _data_->_tmp18_->topbar;
				_data_->_tmp20_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->self);
				_data_->_tmp21_ = _data_->_tmp20_;
				_data_->_tmp22_ = g_strdup_printf (_ ("Starting %s"), _data_->_tmp21_);
				_data_->_tmp23_ = _data_->_tmp22_;
				boxes_topbar_set_status (_data_->_tmp19_, _data_->_tmp23_);
				_g_free0 (_data_->_tmp23_);
			}
			{
				_data_->_tmp24_ = _data_->self->priv->_domain;
				_data_->_state_ = 3;
				gvir_domain_start_async (_data_->_tmp24_, (guint) boxes_libvirt_machine_connect_flags_to_gvir (_data_->self, _data_->flags), _data_->cancellable, boxes_libvirt_machine_start_ready, _data_);
				return FALSE;
				_state_3:
				gvir_domain_start_finish (_data_->_tmp24_, _data_->_res_, &_data_->_inner_error0_);
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					if (g_error_matches (_data_->_inner_error0_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
						goto __catch0_g_io_error_cancelled;
					}
					goto __catch0_g_error;
				}
			}
			goto __finally0;
			__catch0_g_io_error_cancelled:
			{
				g_clear_error (&_data_->_inner_error0_);
				_data_->_tmp25_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->self);
				_data_->_tmp26_ = _data_->_tmp25_;
				g_debug ("libvirt-machine.vala:499: starting of %s was cancelled", _data_->_tmp26_);
			}
			goto __finally0;
			__catch0_g_error:
			{
				_data_->_error_ = _data_->_inner_error0_;
				_data_->_inner_error0_ = NULL;
				if (_data_->restore) {
					_data_->_tmp27_ = _data_->_error_;
					_data_->_tmp28_ = _data_->_tmp27_->message;
					_data_->_tmp29_ = g_error_new_literal (BOXES_ERROR, BOXES_ERROR_RESTORE_FAILED, _data_->_tmp28_);
					_data_->_inner_error0_ = _data_->_tmp29_;
					_g_error_free0 (_data_->_error_);
					goto __finally0;
				} else {
					_data_->_tmp30_ = _data_->_error_;
					_data_->_tmp31_ = _data_->_tmp30_->message;
					_data_->_tmp32_ = g_error_new_literal (BOXES_ERROR, BOXES_ERROR_START_FAILED, _data_->_tmp31_);
					_data_->_inner_error0_ = _data_->_tmp32_;
					_g_error_free0 (_data_->_error_);
					goto __finally0;
				}
				_g_error_free0 (_data_->_error_);
			}
			__finally0:
			if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
				g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
				g_object_unref (_data_->_async_result);
				return FALSE;
			}
			if (_data_->restore) {
				{
					_data_->_tmp33_ = _data_->self->priv->_domain;
					_data_->_state_ = 4;
					gvir_domain_set_time_async (_data_->_tmp33_, NULL, (guint) 0, NULL, boxes_libvirt_machine_start_ready, _data_);
					return FALSE;
					_state_4:
					gvir_domain_set_time_finish (_data_->_tmp33_, _data_->_res_, &_data_->_inner_error0_);
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						goto __catch1_g_error;
					}
				}
				goto __finally1;
				__catch1_g_error:
				{
					_data_->_vala1__error_ = _data_->_inner_error0_;
					_data_->_inner_error0_ = NULL;
					_data_->_tmp34_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->self);
					_data_->_tmp35_ = _data_->_tmp34_;
					_data_->_tmp36_ = _data_->_vala1__error_;
					_data_->_tmp37_ = _data_->_tmp36_->message;
					g_debug ("libvirt-machine.vala:511: Failed to update clock using RTC on %s: %s", _data_->_tmp35_, _data_->_tmp37_);
					{
						_data_->_tmp38_ = _data_->self->priv->_domain;
						_data_->_tmp39_ = g_date_time_new_now_utc ();
						_data_->_tmp40_ = _data_->_tmp39_;
						_data_->_state_ = 5;
						gvir_domain_set_time_async (_data_->_tmp38_, _data_->_tmp40_, (guint) 0, NULL, boxes_libvirt_machine_start_ready, _data_);
						return FALSE;
						_state_5:
						gvir_domain_set_time_finish (_data_->_tmp38_, _data_->_res_, &_data_->_inner_error0_);
						_g_date_time_unref0 (_data_->_tmp40_);
						if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
							goto __catch2_g_error;
						}
					}
					goto __finally2;
					__catch2_g_error:
					{
						_data_->_vala2__error_ = _data_->_inner_error0_;
						_data_->_inner_error0_ = NULL;
						_data_->_tmp41_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->self);
						_data_->_tmp42_ = _data_->_tmp41_;
						_data_->_tmp43_ = _data_->_vala2__error_;
						_data_->_tmp44_ = _data_->_tmp43_->message;
						g_debug ("libvirt-machine.vala:516: Failed to update clock using host time on %s" \
": %s", _data_->_tmp42_, _data_->_tmp44_);
						_g_error_free0 (_data_->_vala2__error_);
					}
					__finally2:
					if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
						_g_error_free0 (_data_->_vala1__error_);
						g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
						g_clear_error (&_data_->_inner_error0_);
						g_object_unref (_data_->_async_result);
						return FALSE;
					}
					_g_error_free0 (_data_->_vala1__error_);
				}
				__finally1:
				if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
					g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
					g_object_unref (_data_->_async_result);
					return FALSE;
				}
			}
		}
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static Block35Data*
block35_data_ref (Block35Data* _data35_)
{
	g_atomic_int_inc (&_data35_->_ref_count_);
	return _data35_;
}

static void
block35_data_unref (void * _userdata_)
{
	Block35Data* _data35_;
	_data35_ = (Block35Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data35_->_ref_count_)) {
		BoxesLibvirtMachine* self;
		self = _data35_->self;
		_g_object_unref0 (self);
		g_slice_free (Block35Data, _data35_);
	}
}

static void
___lambda118_ (BoxesLibvirtMachine* self,
               GObject* obj,
               GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		boxes_libvirt_machine_start_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		boxes_machine_restart ((BoxesMachine*) self);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GVirDomain* _tmp0_;
		const gchar* _tmp1_;
		GError* _tmp2_;
		const gchar* _tmp3_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = self->priv->_domain;
		_tmp1_ = gvir_domain_get_name (_tmp0_);
		_tmp2_ = _error_;
		_tmp3_ = _tmp2_->message;
		g_warning ("libvirt-machine.vala:531: Failed to start '%s': %s", _tmp1_, _tmp3_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
____lambda118__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	___lambda118_ ((BoxesLibvirtMachine*) self, source_object, res);
	g_object_unref (self);
}

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

static void
____lambda120__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	___lambda120_ ((BoxesLibvirtMachine*) self, source_object, res);
	g_object_unref (self);
}

static void
__lambda119_ (Block35Data* _data35_)
{
	BoxesLibvirtMachine* self;
	gboolean _tmp0_ = FALSE;
	BoxesMachineMachineState _tmp1_;
	BoxesMachineMachineState _tmp2_;
	self = _data35_->self;
	_tmp1_ = boxes_machine_get_state ((BoxesMachine*) self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == BOXES_MACHINE_MACHINE_STATE_STOPPED) {
		_tmp0_ = TRUE;
	} else {
		BoxesMachineMachineState _tmp3_;
		BoxesMachineMachineState _tmp4_;
		_tmp3_ = boxes_machine_get_state ((BoxesMachine*) self);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ == BOXES_MACHINE_MACHINE_STATE_FORCE_STOPPED;
	}
	if (_tmp0_) {
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp5_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
		_tmp6_ = _tmp5_;
		g_debug ("libvirt-machine.vala:545: '%s' stopped.", _tmp6_);
		boxes_libvirt_machine_start (self, BOXES_MACHINE_CONNECT_FLAGS_NONE, NULL, ____lambda120__gasync_ready_callback, g_object_ref (self));
		g_signal_handler_disconnect ((GObject*) self, _data35_->state_id);
		if (self->priv->shutdown_timeout != ((guint) 0)) {
			g_source_remove (self->priv->shutdown_timeout);
			self->priv->shutdown_timeout = (guint) 0;
		}
	}
}

static void
___lambda119__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda119_ (self);
}

static void
__lambda122_ (BoxesLibvirtMachine* self)
{
	boxes_libvirt_machine_force_shutdown (self);
}

static void
___lambda122__boxes_toast_ok_func (gpointer self)
{
	__lambda122_ ((BoxesLibvirtMachine*) self);
}

static gboolean
__lambda121_ (BoxesLibvirtMachine* self)
{
	BoxesToastOKFunc really_force_shutdown = NULL;
	gpointer really_force_shutdown_target;
	GDestroyNotify really_force_shutdown_target_destroy_notify;
	gchar* message = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	BoxesAppWindow* _tmp3_;
	BoxesAppWindow* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	BoxesToastOKFunc _tmp7_;
	gpointer _tmp7__target;
	GDestroyNotify _tmp7__target_destroy_notify;
	BoxesToast* _tmp8_ = NULL;
	BoxesToast* _tmp9_;
	gboolean result;
	really_force_shutdown = ___lambda122__boxes_toast_ok_func;
	really_force_shutdown_target = g_object_ref (self);
	really_force_shutdown_target_destroy_notify = g_object_unref;
	_tmp0_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup_printf (_ ("Restart of “%s” is taking too long. Force it to shutdown?"), _tmp1_);
	message = _tmp2_;
	_tmp3_ = boxes_machine_get_window ((BoxesMachine*) self);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strdup (message);
	_tmp6_ = g_strdup (_ ("Shutdown"));
	_tmp7_ = really_force_shutdown;
	_tmp7__target = really_force_shutdown_target;
	_tmp7__target_destroy_notify = really_force_shutdown_target_destroy_notify;
	really_force_shutdown = NULL;
	really_force_shutdown_target = NULL;
	really_force_shutdown_target_destroy_notify = NULL;
	_tmp8_ = boxes_toast_new (NULL);
	boxes_toast_set_message (_tmp8_, _tmp5_);
	_g_free0 (_tmp5_);
	boxes_toast_set_action (_tmp8_, _tmp6_);
	_g_free0 (_tmp6_);
	(_tmp8_->undo_func_target_destroy_notify == NULL) ? NULL : (_tmp8_->undo_func_target_destroy_notify (_tmp8_->undo_func_target), NULL);
	_tmp8_->undo_func = NULL;
	_tmp8_->undo_func_target = NULL;
	_tmp8_->undo_func_target_destroy_notify = NULL;
	_tmp8_->undo_func = _tmp7_;
	_tmp8_->undo_func_target = _tmp7__target;
	_tmp8_->undo_func_target_destroy_notify = _tmp7__target_destroy_notify;
	g_object_ref_sink (_tmp8_);
	_tmp9_ = _tmp8_;
	boxes_app_window_display_toast (_tmp4_, _tmp9_);
	_g_object_unref0 (_tmp9_);
	self->priv->shutdown_timeout = (guint) 0;
	result = FALSE;
	_g_free0 (message);
	(really_force_shutdown_target_destroy_notify == NULL) ? NULL : (really_force_shutdown_target_destroy_notify (really_force_shutdown_target), NULL);
	really_force_shutdown = NULL;
	really_force_shutdown_target = NULL;
	really_force_shutdown_target_destroy_notify = NULL;
	return result;
}

static gboolean
___lambda121__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda121_ ((BoxesLibvirtMachine*) self);
	return result;
}

static void
boxes_libvirt_machine_real_restart (BoxesMachine* base)
{
	BoxesLibvirtMachine * self;
	Block35Data* _data35_;
	BoxesMachineMachineState _tmp0_;
	BoxesMachineMachineState _tmp1_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	gulong _tmp6_;
	self = (BoxesLibvirtMachine*) base;
	_data35_ = g_slice_new0 (Block35Data);
	_data35_->_ref_count_ = 1;
	_data35_->self = g_object_ref (self);
	_tmp0_ = boxes_machine_get_state ((BoxesMachine*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == BOXES_MACHINE_MACHINE_STATE_SAVED) {
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		_tmp2_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
		_tmp3_ = _tmp2_;
		g_debug ("libvirt-machine.vala:525: '%s' is in saved state. Resuming it..", _tmp3_);
		boxes_libvirt_machine_start (self, BOXES_MACHINE_CONNECT_FLAGS_NONE, NULL, ____lambda118__gasync_ready_callback, g_object_ref (self));
		block35_data_unref (_data35_);
		_data35_ = NULL;
		return;
	}
	((BoxesMachine*) self)->stay_on_display = TRUE;
	_data35_->state_id = (gulong) 0;
	_tmp4_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp5_ = _tmp4_;
	g_debug ("libvirt-machine.vala:540: Rebooting '%s'..", _tmp5_);
	_tmp6_ = g_signal_connect_data ((GObject*) self, "notify::state", (GCallback) ___lambda119__g_object_notify, block35_data_ref (_data35_), (GClosureNotify) block35_data_unref, 0);
	_data35_->state_id = _tmp6_;
	self->priv->shutdown_timeout = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 5, ___lambda121__gsource_func, g_object_ref (self), g_object_unref);
	boxes_libvirt_machine_try_shutdown (self);
	block35_data_unref (_data35_);
	_data35_ = NULL;
}

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

static void
boxes_libvirt_machine_real_clone (BoxesMachine* base,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_)
{
	BoxesLibvirtMachine * self;
	BoxesLibvirtMachineCloneData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	self = (BoxesLibvirtMachine*) base;
	_data_ = g_slice_new0 (BoxesLibvirtMachineCloneData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_machine_real_clone_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	boxes_libvirt_machine_real_clone_co (_data_);
}

static void
boxes_libvirt_machine_clone_finish (BoxesMachine* base,
                                    GAsyncResult* _res_)
{
	BoxesLibvirtMachineCloneData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block36Data*
block36_data_ref (Block36Data* _data36_)
{
	g_atomic_int_inc (&_data36_->_ref_count_);
	return _data36_;
}

static void
block36_data_unref (void * _userdata_)
{
	Block36Data* _data36_;
	_data36_ = (Block36Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data36_->_ref_count_)) {
		BoxesLibvirtMachine* self;
		self = _data36_->self;
		_g_object_unref0 (_data36_->clone_machine);
		_g_object_unref0 (self);
		g_slice_free (Block36Data, _data36_);
	}
}

static void
boxes_libvirt_machine_clone_ready (GObject* source_object,
                                   GAsyncResult* _res_,
                                   gpointer _user_data_)
{
	BoxesLibvirtMachineCloneData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_machine_real_clone_co (_data_);
}

static void
___lambda123_ (Block36Data* _data36_)
{
	BoxesLibvirtMachine* self;
	BoxesLibvirtMachine* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	self = _data36_->self;
	_tmp0_ = _data36_->clone_machine;
	_tmp1_ = boxes_machine_get_under_construction ((BoxesMachine*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (!_tmp2_) {
		BoxesLibvirtMachine* _tmp3_;
		BoxesApp* _tmp4_;
		boxes_machine_set_can_delete ((BoxesMachine*) self, TRUE);
		_tmp3_ = _data36_->clone_machine;
		g_signal_handler_disconnect ((GObject*) _tmp3_, _data36_->under_construct_id);
		_tmp4_ = boxes_app_app;
		boxes_app_uninhibit (_tmp4_);
	}
}

static void
____lambda123__g_object_notify (GObject* _sender,
                                GParamSpec* pspec,
                                gpointer self)
{
	___lambda123_ (self);
}

static gboolean
boxes_libvirt_machine_real_clone_co (BoxesLibvirtMachineCloneData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_domain_config;
	_data_->_tmp1_ = gvir_config_domain_get_name (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	g_debug ("libvirt-machine.vala:583: Cloning '%s'..", _data_->_tmp2_);
	boxes_machine_set_can_delete ((BoxesMachine*) _data_->self, FALSE);
	_data_->_tmp3_ = _data_->self->priv->_domain_config;
	_data_->_tmp4_ = gvir_config_domain_get_name (_data_->_tmp3_);
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = g_strdup_printf (_ ("Cloning “%s”…"), _data_->_tmp5_);
	_data_->inhibit_reason = _data_->_tmp6_;
	_data_->_tmp7_ = boxes_app_app;
	_data_->_tmp8_ = _data_->inhibit_reason;
	boxes_app_inhibit (_data_->_tmp7_, NULL, NULL, _data_->_tmp8_);
	{
		_data_->_data36_ = g_slice_new0 (Block36Data);
		_data_->_data36_->_ref_count_ = 1;
		_data_->_data36_->self = g_object_ref (_data_->self);
		_data_->_tmp9_ = _data_->self->priv->_domain_config;
		_data_->_tmp10_ = gvir_config_object_to_xml ((GVirConfigObject*) _data_->_tmp9_);
		_data_->xml = _data_->_tmp10_;
		_data_->_tmp11_ = _data_->xml;
		_data_->_tmp12_ = gvir_config_domain_new_from_xml (_data_->_tmp11_, &_data_->_inner_error0_);
		_data_->config = _data_->_tmp12_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_free0 (_data_->xml);
			block36_data_unref (_data_->_data36_);
			_data_->_data36_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp13_ = _data_->config;
		gvir_config_domain_set_uuid (_data_->_tmp13_, NULL);
		_data_->_tmp15_ = _data_->self->priv->_storage_volume;
		_data_->_tmp16_ = gvir_storage_vol_get_path (_data_->_tmp15_, &_data_->_inner_error0_);
		_data_->_tmp14_ = _data_->_tmp16_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->config);
			_g_free0 (_data_->xml);
			block36_data_unref (_data_->_data36_);
			_data_->_data36_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp17_ = _data_->config;
		_data_->_tmp18_ = boxes_libvirt_cloned_media_new (_data_->_tmp14_, _data_->_tmp17_, &_data_->_inner_error0_);
		_data_->media = _data_->_tmp18_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->config);
			_g_free0 (_data_->xml);
			block36_data_unref (_data_->_data36_);
			_data_->_data36_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp19_ = _data_->media;
		_data_->_tmp20_ = boxes_installer_media_get_vm_creator ((BoxesInstallerMedia*) _data_->_tmp19_);
		_data_->vm_cloner = _data_->_tmp20_;
		_data_->_tmp21_ = _data_->vm_cloner;
		_data_->_state_ = 1;
		boxes_vm_creator_create_vm (_data_->_tmp21_, NULL, TRUE, boxes_libvirt_machine_clone_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp22_ = boxes_vm_creator_create_vm_finish (_data_->_tmp21_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_data36_->clone_machine = _data_->_tmp22_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->vm_cloner);
			_g_object_unref0 (_data_->media);
			_g_object_unref0 (_data_->config);
			_g_free0 (_data_->xml);
			block36_data_unref (_data_->_data36_);
			_data_->_data36_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp23_ = _data_->vm_cloner;
		_data_->_tmp24_ = _data_->_data36_->clone_machine;
		_data_->_tmp25_ = ((BoxesMachine*) _data_->self)->config;
		_data_->_tmp26_ = boxes_box_config_get_access_last_time (_data_->_tmp25_);
		_data_->_tmp27_ = _data_->_tmp26_;
		boxes_vm_creator_launch_vm (_data_->_tmp23_, _data_->_tmp24_, _data_->_tmp27_, TRUE, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->vm_cloner);
			_g_object_unref0 (_data_->media);
			_g_object_unref0 (_data_->config);
			_g_free0 (_data_->xml);
			block36_data_unref (_data_->_data36_);
			_data_->_data36_ = NULL;
			goto __catch0_g_error;
		}
		_data_->_tmp28_ = _data_->_data36_->clone_machine;
		_data_->_tmp29_ = boxes_libvirt_machine_get_acceleration_3d (_data_->self);
		_data_->_tmp30_ = _data_->_tmp29_;
		boxes_libvirt_machine_set_acceleration_3d (_data_->_tmp28_, _data_->_tmp30_);
		_data_->_tmp31_ = _data_->_data36_->clone_machine;
		_data_->_tmp32_ = _data_->self->priv->_run_in_bg;
		boxes_libvirt_machine_set_run_in_bg (_data_->_tmp31_, _data_->_tmp32_);
		_data_->_data36_->under_construct_id = (gulong) 0;
		_data_->_tmp33_ = _data_->_data36_->clone_machine;
		_data_->_tmp34_ = g_signal_connect_data ((GObject*) _data_->_tmp33_, "notify::under-construction", (GCallback) ____lambda123__g_object_notify, block36_data_ref (_data_->_data36_), (GClosureNotify) block36_data_unref, 0);
		_data_->_data36_->under_construct_id = _data_->_tmp34_;
		_g_object_unref0 (_data_->vm_cloner);
		_g_object_unref0 (_data_->media);
		_g_object_unref0 (_data_->config);
		_g_free0 (_data_->xml);
		block36_data_unref (_data_->_data36_);
		_data_->_data36_ = NULL;
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp35_ = _data_->self->priv->_domain_config;
		_data_->_tmp36_ = gvir_config_domain_get_name (_data_->_tmp35_);
		_data_->_tmp37_ = _data_->_tmp36_;
		_data_->_tmp38_ = _data_->_error_;
		_data_->_tmp39_ = _data_->_tmp38_->message;
		g_warning ("libvirt-machine.vala:614: Failed to clone %s: %s", _data_->_tmp37_, _data_->_tmp39_);
		boxes_machine_set_can_delete ((BoxesMachine*) _data_->self, TRUE);
		_g_error_free0 (_data_->_error_);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		_g_free0 (_data_->inhibit_reason);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_g_free0 (_data_->inhibit_reason);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

void
boxes_libvirt_machine_supports_accel3d (BoxesLibvirtMachine* self,
                                        GAsyncReadyCallback _callback_,
                                        gpointer _user_data_)
{
	BoxesLibvirtMachineSupportsAccel3dData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (BoxesLibvirtMachineSupportsAccel3dData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_machine_supports_accel3d_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	boxes_libvirt_machine_supports_accel3d_co (_data_);
}

gboolean
boxes_libvirt_machine_supports_accel3d_finish (BoxesLibvirtMachine* self,
                                               GAsyncResult* _res_)
{
	gboolean result;
	BoxesLibvirtMachineSupportsAccel3dData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	return result;
}

static void
boxes_libvirt_machine_supports_accel3d_ready (GObject* source_object,
                                              GAsyncResult* _res_,
                                              gpointer _user_data_)
{
	BoxesLibvirtMachineSupportsAccel3dData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_machine_supports_accel3d_co (_data_);
}

static gboolean
boxes_libvirt_machine_supports_accel3d_co (BoxesLibvirtMachineSupportsAccel3dData* _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_get_os (_data_->self, boxes_libvirt_machine_supports_accel3d_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp0_ = boxes_libvirt_machine_get_os_finish (_data_->self, _data_->_res_);
	_data_->os = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->os;
	if (_data_->_tmp1_ == NULL) {
		_data_->result = FALSE;
		_g_object_unref0 (_data_->os);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp2_ = _data_->os;
	_data_->_tmp3_ = osinfo_os_get_all_devices (_data_->_tmp2_, NULL);
	_data_->devices = _data_->_tmp3_;
	_data_->_tmp4_ = _data_->devices;
	_data_->_tmp5_ = boxes_find_device_by_prop (_data_->_tmp4_, OSINFO_DEVICE_PROP_NAME, "virtio1.0-gpu");
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _data_->_tmp6_ != NULL;
	_g_object_unref0 (_data_->_tmp6_);
	_data_->result = _data_->_tmp7_;
	_g_object_unref0 (_data_->devices);
	_g_object_unref0 (_data_->os);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

void
boxes_libvirt_machine_get_os (BoxesLibvirtMachine* self,
                              GAsyncReadyCallback _callback_,
                              gpointer _user_data_)
{
	BoxesLibvirtMachineGetOsData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (BoxesLibvirtMachineGetOsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_machine_get_os_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	boxes_libvirt_machine_get_os_co (_data_);
}

OsinfoOs*
boxes_libvirt_machine_get_os_finish (BoxesLibvirtMachine* self,
                                     GAsyncResult* _res_)
{
	OsinfoOs* result;
	BoxesLibvirtMachineGetOsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
boxes_libvirt_machine_get_os_ready (GObject* source_object,
                                    GAsyncResult* _res_,
                                    gpointer _user_data_)
{
	BoxesLibvirtMachineGetOsData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_machine_get_os_co (_data_);
}

static gboolean
boxes_libvirt_machine_get_os_co (BoxesLibvirtMachineGetOsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_domain_config;
	_data_->_tmp1_ = boxes_vm_configurator_get_os_id (_data_->_tmp0_);
	_data_->os_id = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->os_id;
	if (_data_->_tmp2_ == NULL) {
		_data_->result = NULL;
		_g_free0 (_data_->os_id);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp3_ = boxes_media_manager_get_default ();
	_data_->_tmp4_ = _data_->_tmp3_;
	_data_->_tmp5_ = boxes_media_manager_get_os_db (_data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	_data_->_tmp7_ = _g_object_ref0 (_data_->_tmp6_);
	_data_->_tmp8_ = _data_->_tmp7_;
	_g_object_unref0 (_data_->_tmp4_);
	_data_->os_db = _data_->_tmp8_;
	{
		_data_->_tmp10_ = _data_->os_db;
		_data_->_tmp11_ = _data_->os_id;
		_data_->_state_ = 1;
		boxes_os_database_get_os_by_id (_data_->_tmp10_, _data_->_tmp11_, boxes_libvirt_machine_get_os_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp12_ = boxes_os_database_get_os_by_id_finish (_data_->_tmp10_, _data_->_res_, &_data_->_inner_error0_);
		_data_->_tmp9_ = _data_->_tmp12_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			if (_data_->_inner_error0_->domain == BOXES_OS_DATABASE_ERROR) {
				goto __catch0_boxes_os_database_error;
			}
			_g_object_unref0 (_data_->os_db);
			_g_free0 (_data_->os_id);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
			g_clear_error (&_data_->_inner_error0_);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp13_ = _data_->_tmp9_;
		_data_->_tmp9_ = NULL;
		_data_->result = _data_->_tmp13_;
		_g_object_unref0 (_data_->_tmp9_);
		_g_object_unref0 (_data_->os_db);
		_g_free0 (_data_->os_id);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	goto __finally0;
	__catch0_boxes_os_database_error:
	{
		_data_->_error_ = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		_data_->_tmp14_ = _data_->os_id;
		_data_->_tmp15_ = _data_->_error_;
		_data_->_tmp16_ = _data_->_tmp15_->message;
		g_warning ("libvirt-machine.vala:638: Failed to find OS with ID '%s': %s", _data_->_tmp14_, _data_->_tmp16_);
		_data_->result = NULL;
		_g_error_free0 (_data_->_error_);
		_g_object_unref0 (_data_->os_db);
		_g_free0 (_data_->os_id);
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	__finally0:
	_g_object_unref0 (_data_->os_db);
	_g_free0 (_data_->os_id);
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
	g_clear_error (&_data_->_inner_error0_);
	g_object_unref (_data_->_async_result);
	return FALSE;
}

gchar*
boxes_libvirt_machine_get_ip_address (BoxesLibvirtMachine* self)
{
	gboolean _tmp0_ = FALSE;
	GVirConnection* _tmp1_;
	gchar* mac = NULL;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	GVirConnection* _tmp9_;
	GList* _tmp10_;
	const gchar* _tmp32_;
	const gchar* _tmp33_;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->system_virt_connection;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp2_ = boxes_machine_get_is_on ((BoxesMachine*) self);
		_tmp3_ = _tmp2_;
		_tmp0_ = !_tmp3_;
	}
	if (_tmp0_) {
		result = NULL;
		return result;
	}
	_tmp4_ = boxes_libvirt_machine_get_mac_address (self);
	mac = _tmp4_;
	_tmp5_ = mac;
	if (_tmp5_ == NULL) {
		result = NULL;
		_g_free0 (mac);
		return result;
	}
	_tmp6_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp7_ = _tmp6_;
	_tmp8_ = mac;
	g_debug ("libvirt-machine.vala:650: MAC address of '%s': %s", _tmp7_, _tmp8_);
	_tmp9_ = self->priv->system_virt_connection;
	_tmp10_ = gvir_connection_get_networks (_tmp9_);
	{
		GList* network_collection = NULL;
		GList* network_it = NULL;
		network_collection = _tmp10_;
		for (network_it = network_collection; network_it != NULL; network_it = network_it->next) {
			GVirNetwork* _tmp11_;
			GVirNetwork* network = NULL;
			_tmp11_ = _g_object_ref0 ((GVirNetwork*) network_it->data);
			network = _tmp11_;
			{
				{
					GList* leases = NULL;
					GVirNetwork* _tmp12_;
					const gchar* _tmp13_;
					GList* _tmp14_;
					gboolean _tmp15_ = FALSE;
					GList* _tmp16_;
					const gchar* _tmp20_;
					const gchar* _tmp21_;
					GVirNetwork* _tmp22_;
					const gchar* _tmp23_;
					GList* _tmp24_;
					gconstpointer _tmp25_;
					const gchar* _tmp26_;
					gchar* _tmp27_;
					_tmp12_ = network;
					_tmp13_ = mac;
					_tmp14_ = gvir_network_get_dhcp_leases (_tmp12_, _tmp13_, (guint) 0, &_inner_error0_);
					leases = _tmp14_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						goto __catch0_g_error;
					}
					_tmp16_ = leases;
					if (g_list_length (_tmp16_) == ((guint) 0)) {
						_tmp15_ = TRUE;
					} else {
						GList* _tmp17_;
						gconstpointer _tmp18_;
						const gchar* _tmp19_;
						_tmp17_ = leases;
						_tmp18_ = _tmp17_->data;
						_tmp19_ = gvir_network_dhcp_lease_get_iface ((GVirNetworkDHCPLease*) _tmp18_);
						_tmp15_ = g_strcmp0 (_tmp19_, "virbr0") != 0;
					}
					if (_tmp15_) {
						(leases == NULL) ? NULL : (leases = (_g_list_free__g_object_unref0_ (leases), NULL));
						_g_object_unref0 (network);
						continue;
					}
					_tmp20_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
					_tmp21_ = _tmp20_;
					_tmp22_ = network;
					_tmp23_ = gvir_network_get_name (_tmp22_);
					g_debug ("libvirt-machine.vala:658: Found a lease for '%s' on network '%s'", _tmp21_, _tmp23_);
					_tmp24_ = leases;
					_tmp25_ = _tmp24_->data;
					_tmp26_ = gvir_network_dhcp_lease_get_ip ((GVirNetworkDHCPLease*) _tmp25_);
					_tmp27_ = g_strdup (_tmp26_);
					result = _tmp27_;
					(leases == NULL) ? NULL : (leases = (_g_list_free__g_object_unref0_ (leases), NULL));
					_g_object_unref0 (network);
					(network_collection == NULL) ? NULL : (network_collection = (_g_list_free__g_object_unref0_ (network_collection), NULL));
					_g_free0 (mac);
					return result;
				}
				goto __finally0;
				__catch0_g_error:
				{
					GError* _error_ = NULL;
					GVirNetwork* _tmp28_;
					const gchar* _tmp29_;
					GError* _tmp30_;
					const gchar* _tmp31_;
					_error_ = _inner_error0_;
					_inner_error0_ = NULL;
					_tmp28_ = network;
					_tmp29_ = gvir_network_get_name (_tmp28_);
					_tmp30_ = _error_;
					_tmp31_ = _tmp30_->message;
					g_warning ("libvirt-machine.vala:663: Failed to get DHCP leases from network '%s':" \
" %s", _tmp29_, _tmp31_);
					_g_error_free0 (_error_);
				}
				__finally0:
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					_g_object_unref0 (network);
					(network_collection == NULL) ? NULL : (network_collection = (_g_list_free__g_object_unref0_ (network_collection), NULL));
					_g_free0 (mac);
					g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
					g_clear_error (&_inner_error0_);
					return NULL;
				}
				_g_object_unref0 (network);
			}
		}
		(network_collection == NULL) ? NULL : (network_collection = (_g_list_free__g_object_unref0_ (network_collection), NULL));
	}
	_tmp32_ = boxes_collection_item_get_name ((BoxesCollectionItem*) self);
	_tmp33_ = _tmp32_;
	g_debug ("libvirt-machine.vala:668: No lease for '%s' on any network", _tmp33_);
	result = NULL;
	_g_free0 (mac);
	return result;
}

static void
boxes_libvirt_machine_create_snapshot_data_free (gpointer _data)
{
	BoxesLibvirtMachineCreateSnapshotData* _data_;
	_data_ = _data;
	_g_free0 (_data_->description_prefix);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (BoxesLibvirtMachineCreateSnapshotData, _data_);
}

void
boxes_libvirt_machine_create_snapshot (BoxesLibvirtMachine* self,
                                       const gchar* description_prefix,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_)
{
	BoxesLibvirtMachineCreateSnapshotData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (description_prefix != NULL);
	_data_ = g_slice_new0 (BoxesLibvirtMachineCreateSnapshotData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_machine_create_snapshot_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = g_strdup (description_prefix);
	_g_free0 (_data_->description_prefix);
	_data_->description_prefix = _tmp1_;
	boxes_libvirt_machine_create_snapshot_co (_data_);
}

GVirDomainSnapshot*
boxes_libvirt_machine_create_snapshot_finish (BoxesLibvirtMachine* self,
                                              GAsyncResult* _res_,
                                              GError** error)
{
	GVirDomainSnapshot* result;
	BoxesLibvirtMachineCreateSnapshotData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
boxes_libvirt_machine_create_snapshot_ready (GObject* source_object,
                                             GAsyncResult* _res_,
                                             gpointer _user_data_)
{
	BoxesLibvirtMachineCreateSnapshotData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	boxes_libvirt_machine_create_snapshot_co (_data_);
}

static gboolean
boxes_libvirt_machine_create_snapshot_co (BoxesLibvirtMachineCreateSnapshotData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = gvir_config_domain_snapshot_new ();
	_data_->config = _data_->_tmp0_;
	_data_->_tmp1_ = g_date_time_new_now_local ();
	_data_->now = _data_->_tmp1_;
	_data_->_tmp2_ = g_date_time_format (_data_->now, "%F-%H-%M-%S");
	_data_->_tmp3_ = _data_->_tmp2_;
	gvir_config_domain_snapshot_set_name (_data_->config, _data_->_tmp3_);
	_g_free0 (_data_->_tmp3_);
	_data_->_tmp4_ = g_date_time_format (_data_->now, "%x, %X");
	_data_->_tmp5_ = _data_->_tmp4_;
	_data_->_tmp6_ = g_strconcat (_data_->description_prefix, _data_->_tmp5_, NULL);
	_data_->_tmp7_ = _data_->_tmp6_;
	gvir_config_domain_snapshot_set_description (_data_->config, _data_->_tmp7_);
	_g_free0 (_data_->_tmp7_);
	_g_free0 (_data_->_tmp5_);
	_data_->_tmp9_ = _data_->self->priv->_domain;
	_data_->_state_ = 1;
	gvir_domain_create_snapshot_async (_data_->_tmp9_, _data_->config, (guint) 0, NULL, boxes_libvirt_machine_create_snapshot_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp10_ = gvir_domain_create_snapshot_finish (_data_->_tmp9_, _data_->_res_, &_data_->_inner_error0_);
	_data_->_tmp8_ = _data_->_tmp10_;
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		_g_date_time_unref0 (_data_->now);
		_g_object_unref0 (_data_->config);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp11_ = _data_->_tmp8_;
	_data_->_tmp8_ = NULL;
	_data_->result = _data_->_tmp11_;
	_g_object_unref0 (_data_->_tmp8_);
	_g_date_time_unref0 (_data_->now);
	_g_object_unref0 (_data_->config);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

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

static void
boxes_libvirt_machine_wait_for_save (BoxesLibvirtMachine* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_)
{
	BoxesLibvirtMachineWaitForSaveData* _data_;
	BoxesLibvirtMachine* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (BoxesLibvirtMachineWaitForSaveData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, boxes_libvirt_machine_wait_for_save_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	boxes_libvirt_machine_wait_for_save_co (_data_);
}

static void
boxes_libvirt_machine_wait_for_save_finish (BoxesLibvirtMachine* self,
                                            GAsyncResult* _res_)
{
	BoxesLibvirtMachineWaitForSaveData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static Block37Data*
block37_data_ref (Block37Data* _data37_)
{
	g_atomic_int_inc (&_data37_->_ref_count_);
	return _data37_;
}

static void
block37_data_unref (void * _userdata_)
{
	Block37Data* _data37_;
	_data37_ = (Block37Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data37_->_ref_count_)) {
		BoxesLibvirtMachine* self;
		self = _data37_->self;
		_g_object_unref0 (self);
		g_slice_free (Block37Data, _data37_);
	}
}

static void
__lambda107_ (Block37Data* _data37_)
{
	BoxesLibvirtMachine* self;
	BoxesMachineMachineState _tmp0_;
	BoxesMachineMachineState _tmp1_;
	self = _data37_->self;
	_tmp0_ = boxes_machine_get_state ((BoxesMachine*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == BOXES_MACHINE_MACHINE_STATE_SAVED) {
		boxes_libvirt_machine_wait_for_save_co (_data37_->_async_data_);
	}
}

static void
___lambda107__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	__lambda107_ (self);
}

static gboolean
__lambda109_ (Block37Data* _data37_)
{
	BoxesLibvirtMachine* self;
	gboolean result;
	self = _data37_->self;
	boxes_libvirt_machine_wait_for_save_co (_data37_->_async_data_);
	result = FALSE;
	return result;
}

static gboolean
___lambda109__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda109_ (self);
	return result;
}

static void
__lambda108_ (Block37Data* _data37_)
{
	BoxesLibvirtMachine* self;
	self = _data37_->self;
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ___lambda109__gsource_func, block37_data_ref (_data37_), block37_data_unref);
}

static void
___lambda108__g_cancellable_cancelled (GCancellable* _sender,
                                       gpointer self)
{
	__lambda108_ (self);
}

static gboolean
boxes_libvirt_machine_wait_for_save_co (BoxesLibvirtMachineWaitForSaveData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_data37_ = g_slice_new0 (Block37Data);
	_data_->_data37_->_ref_count_ = 1;
	_data_->_data37_->self = g_object_ref (_data_->self);
	_data_->_data37_->_async_data_ = _data_;
	if (!_data_->self->priv->saving) {
		block37_data_unref (_data_->_data37_);
		_data_->_data37_ = NULL;
		g_task_return_pointer (_data_->_async_result, _data_, NULL);
		if (_data_->_state_ != 0) {
			while (!g_task_get_completed (_data_->_async_result)) {
				g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
			}
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp0_ = g_signal_connect_data ((GObject*) _data_->self, "notify::state", (GCallback) ___lambda107__g_object_notify, block37_data_ref (_data_->_data37_), (GClosureNotify) block37_data_unref, 0);
	_data_->state_notify_id = _data_->_tmp0_;
	_data_->_tmp1_ = boxes_machine_get_connecting_cancellable ((BoxesMachine*) _data_->self);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = g_signal_connect_data (_data_->_tmp2_, "cancelled", (GCallback) ___lambda108__g_cancellable_cancelled, block37_data_ref (_data_->_data37_), (GClosureNotify) block37_data_unref, 0);
	_data_->cancelled_id = _data_->_tmp3_;
	_data_->_tmp4_ = boxes_collection_item_get_name ((BoxesCollectionItem*) _data_->self);
	_data_->_tmp5_ = _data_->_tmp4_;
	g_debug ("libvirt-machine.vala:701: %s is being saved, delaying starting until i" \
"t's saved", _data_->_tmp5_);
	_data_->_state_ = 1;
	return FALSE;
	_state_1:
	;
	g_signal_handler_disconnect ((GObject*) _data_->self, _data_->state_notify_id);
	_data_->_tmp6_ = boxes_machine_get_connecting_cancellable ((BoxesMachine*) _data_->self);
	_data_->_tmp7_ = _data_->_tmp6_;
	g_cancellable_disconnect (_data_->_tmp7_, _data_->cancelled_id);
	block37_data_unref (_data_->_data37_);
	_data_->_data37_ = NULL;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
boxes_libvirt_machine_real_update_status (BoxesMachine* base)
{
	BoxesLibvirtMachine * self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	GVirConfigDomain* _tmp2_;
	self = (BoxesLibvirtMachine*) base;
	BOXES_MACHINE_CLASS (boxes_libvirt_machine_parent_class)->update_status (G_TYPE_CHECK_INSTANCE_CAST (self, BOXES_TYPE_MACHINE, BoxesMachine));
	_tmp0_ = boxes_machine_get_status ((BoxesMachine*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		return;
	}
	_tmp2_ = self->priv->_domain_config;
	if (boxes_vm_configurator_is_install_config (_tmp2_)) {
		boxes_machine_set_status ((BoxesMachine*) self, _ ("Installing…"));
	} else {
		GVirConfigDomain* _tmp3_;
		_tmp3_ = self->priv->_domain_config;
		if (boxes_vm_configurator_is_libvirt_cloning_config (_tmp3_)) {
			boxes_machine_set_status ((BoxesMachine*) self, _ ("Setting up clone…"));
		} else {
			GVirConfigDomain* _tmp4_;
			_tmp4_ = self->priv->_domain_config;
			if (boxes_vm_configurator_is_import_config (_tmp4_)) {
				boxes_machine_set_status ((BoxesMachine*) self, _ ("Importing…"));
			} else {
				boxes_machine_set_status ((BoxesMachine*) self, NULL);
			}
		}
	}
}

static gchar*
boxes_libvirt_machine_get_mac_address (BoxesLibvirtMachine* self)
{
	GVirConfigDomainInterface* iface_config = NULL;
	GVirConfigDomain* _tmp0_;
	GList* _tmp1_;
	GVirConfigDomainInterface* _tmp6_;
	GVirConfigDomainInterface* _tmp7_;
	const gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	iface_config = NULL;
	_tmp0_ = self->priv->_domain_config;
	_tmp1_ = gvir_config_domain_get_devices (_tmp0_);
	{
		GList* device_config_collection = NULL;
		GList* device_config_it = NULL;
		device_config_collection = _tmp1_;
		for (device_config_it = device_config_collection; device_config_it != NULL; device_config_it = device_config_it->next) {
			GVirConfigDomainDevice* _tmp2_;
			GVirConfigDomainDevice* device_config = NULL;
			_tmp2_ = _g_object_ref0 ((GVirConfigDomainDevice*) device_config_it->data);
			device_config = _tmp2_;
			{
				GVirConfigDomainDevice* _tmp3_;
				_tmp3_ = device_config;
				if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, gvir_config_domain_interface_bridge_get_type ())) {
					GVirConfigDomainDevice* _tmp4_;
					GVirConfigDomainInterface* _tmp5_;
					_tmp4_ = device_config;
					_tmp5_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, gvir_config_domain_interface_get_type ()) ? ((GVirConfigDomainInterface*) _tmp4_) : NULL);
					_g_object_unref0 (iface_config);
					iface_config = _tmp5_;
					_g_object_unref0 (device_config);
					break;
				}
				_g_object_unref0 (device_config);
			}
		}
		(device_config_collection == NULL) ? NULL : (device_config_collection = (_g_list_free__g_object_unref0_ (device_config_collection), NULL));
	}
	_tmp6_ = iface_config;
	if (_tmp6_ == NULL) {
		result = NULL;
		_g_object_unref0 (iface_config);
		return result;
	}
	_tmp7_ = iface_config;
	_tmp8_ = gvir_config_domain_interface_get_mac (_tmp7_);
	_tmp9_ = g_strdup (_tmp8_);
	result = _tmp9_;
	_g_object_unref0 (iface_config);
	return result;
}

GVirDomain*
boxes_libvirt_machine_get_domain (BoxesLibvirtMachine* self)
{
	GVirDomain* result;
	GVirDomain* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_domain;
	result = _tmp0_;
	return result;
}

void
boxes_libvirt_machine_set_domain (BoxesLibvirtMachine* self,
                                  GVirDomain* value)
{
	GVirDomain* old_value;
	g_return_if_fail (self != NULL);
	old_value = boxes_libvirt_machine_get_domain (self);
	if (old_value != value) {
		GVirDomain* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_domain);
		self->priv->_domain = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_DOMAIN_PROPERTY]);
	}
}

GVirConfigDomain*
boxes_libvirt_machine_get_domain_config (BoxesLibvirtMachine* self)
{
	GVirConfigDomain* result;
	GVirConfigDomain* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_domain_config;
	result = _tmp0_;
	return result;
}

void
boxes_libvirt_machine_set_domain_config (BoxesLibvirtMachine* self,
                                         GVirConfigDomain* value)
{
	GVirConfigDomain* old_value;
	g_return_if_fail (self != NULL);
	old_value = boxes_libvirt_machine_get_domain_config (self);
	if (old_value != value) {
		GVirConfigDomain* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_domain_config);
		self->priv->_domain_config = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_DOMAIN_CONFIG_PROPERTY]);
	}
}

GVirConnection*
boxes_libvirt_machine_get_connection (BoxesLibvirtMachine* self)
{
	GVirConnection* result;
	GVirConnection* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_connection;
	result = _tmp0_;
	return result;
}

void
boxes_libvirt_machine_set_connection (BoxesLibvirtMachine* self,
                                      GVirConnection* value)
{
	GVirConnection* old_value;
	g_return_if_fail (self != NULL);
	old_value = boxes_libvirt_machine_get_connection (self);
	if (old_value != value) {
		GVirConnection* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_connection);
		self->priv->_connection = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_CONNECTION_PROPERTY]);
	}
}

GVirStorageVol*
boxes_libvirt_machine_get_storage_volume (BoxesLibvirtMachine* self)
{
	GVirStorageVol* result;
	GVirStorageVol* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_storage_volume;
	result = _tmp0_;
	return result;
}

void
boxes_libvirt_machine_set_storage_volume (BoxesLibvirtMachine* self,
                                          GVirStorageVol* value)
{
	GVirStorageVol* old_value;
	g_return_if_fail (self != NULL);
	old_value = boxes_libvirt_machine_get_storage_volume (self);
	if (old_value != value) {
		GVirStorageVol* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_storage_volume);
		self->priv->_storage_volume = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_STORAGE_VOLUME_PROPERTY]);
	}
}

BoxesVMCreator*
boxes_libvirt_machine_get_vm_creator (BoxesLibvirtMachine* self)
{
	BoxesVMCreator* result;
	BoxesVMCreator* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_vm_creator;
	result = _tmp0_;
	return result;
}

void
boxes_libvirt_machine_set_vm_creator (BoxesLibvirtMachine* self,
                                      BoxesVMCreator* value)
{
	BoxesVMCreator* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_vm_creator);
	self->priv->_vm_creator = _tmp0_;
	_tmp1_ = boxes_libvirt_machine_get_importing (self);
	_tmp2_ = _tmp1_;
	boxes_machine_set_can_delete ((BoxesMachine*) self, !_tmp2_);
	if (value != NULL) {
		GVirConfigDomain* _tmp4_;
		_tmp4_ = self->priv->_domain_config;
		_tmp3_ = !boxes_vm_configurator_is_live_config (_tmp4_);
	} else {
		_tmp3_ = FALSE;
	}
	boxes_machine_set_under_construction ((BoxesMachine*) self, _tmp3_);
	g_object_notify ((GObject*) self, "importing");
	if (value == NULL) {
		boxes_libvirt_machine_update_domain_config (self);
	}
	boxes_machine_update_status ((BoxesMachine*) self);
	g_object_notify_by_pspec ((GObject *) self, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_VM_CREATOR_PROPERTY]);
}

const gchar*
boxes_libvirt_machine_get_title (BoxesLibvirtMachine* self)
{
	const gchar* result;
	GVirConfigDomain* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_domain_config;
	_tmp1_ = gvir_config_domain_get_title (_tmp0_);
	result = _tmp1_;
	return result;
}

void
boxes_libvirt_machine_set_title (BoxesLibvirtMachine* self,
                                 const gchar* value)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	{
		GVirConfigDomain* _tmp0_;
		GVirDomain* _tmp1_;
		GVirConfigDomain* _tmp2_;
		_tmp0_ = self->priv->_domain_config;
		gvir_config_domain_set_title (_tmp0_, value);
		_tmp1_ = self->priv->_domain;
		_tmp2_ = self->priv->_domain_config;
		gvir_domain_set_config (_tmp1_, _tmp2_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		boxes_collection_item_set_name ((BoxesCollectionItem*) self, value);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp3_ = _error_;
		_tmp4_ = _tmp3_->message;
		g_warning ("libvirt-machine.vala:34: Failed to rename box: %s", _tmp4_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	g_object_notify_by_pspec ((GObject *) self, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_TITLE_PROPERTY]);
}

gboolean
boxes_libvirt_machine_get_importing (BoxesLibvirtMachine* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	BoxesVMCreator* _tmp1_;
	BoxesVMCreator* _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp1_ = boxes_libvirt_machine_get_vm_creator (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		BoxesVMCreator* _tmp3_;
		BoxesVMCreator* _tmp4_;
		_tmp3_ = boxes_libvirt_machine_get_vm_creator (self);
		_tmp4_ = _tmp3_;
		_tmp0_ = BOXES_IS_VM_IMPORTER (_tmp4_);
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

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

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

static gboolean
boxes_libvirt_machine_real_get_suspend_at_exit (BoxesMachine* base)
{
	gboolean result;
	BoxesLibvirtMachine* self;
	gboolean _tmp0_ = FALSE;
	GVirConnection* _tmp1_;
	BoxesApp* _tmp2_;
	GVirConnection* _tmp3_;
	GVirConnection* _tmp4_;
	GVirConnection* _tmp5_;
	gboolean _tmp6_;
	self = (BoxesLibvirtMachine*) base;
	_tmp1_ = self->priv->_connection;
	_tmp2_ = boxes_app_app;
	_tmp3_ = boxes_app_get_default_connection (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp6_ = _tmp1_ == _tmp5_;
	_g_object_unref0 (_tmp5_);
	if (_tmp6_) {
		gboolean _tmp7_;
		_tmp7_ = self->priv->_run_in_bg;
		_tmp0_ = !_tmp7_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
boxes_libvirt_machine_real_get_can_save (BoxesMachine* base)
{
	gboolean result;
	BoxesLibvirtMachine* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	self = (BoxesLibvirtMachine*) base;
	if (!self->priv->saving) {
		BoxesMachineMachineState _tmp2_;
		BoxesMachineMachineState _tmp3_;
		_tmp2_ = boxes_machine_get_state ((BoxesMachine*) self);
		_tmp3_ = _tmp2_;
		_tmp1_ = _tmp3_ != BOXES_MACHINE_MACHINE_STATE_SAVED;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		gboolean _tmp4_;
		gboolean _tmp5_;
		_tmp4_ = boxes_libvirt_machine_get_importing (self);
		_tmp5_ = _tmp4_;
		_tmp0_ = !_tmp5_;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static gboolean
boxes_libvirt_machine_real_get_can_restart (BoxesMachine* base)
{
	gboolean result;
	BoxesLibvirtMachine* self;
	gboolean _tmp0_ = FALSE;
	BoxesMachineMachineState _tmp1_;
	BoxesMachineMachineState _tmp2_;
	self = (BoxesLibvirtMachine*) base;
	_tmp1_ = boxes_machine_get_state ((BoxesMachine*) self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ == BOXES_MACHINE_MACHINE_STATE_RUNNING) {
		_tmp0_ = TRUE;
	} else {
		BoxesMachineMachineState _tmp3_;
		BoxesMachineMachineState _tmp4_;
		_tmp3_ = boxes_machine_get_state ((BoxesMachine*) self);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ == BOXES_MACHINE_MACHINE_STATE_SAVED;
	}
	result = _tmp0_;
	return result;
}

static gboolean
boxes_libvirt_machine_real_get_can_clone (BoxesMachine* base)
{
	gboolean result;
	BoxesLibvirtMachine* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	self = (BoxesLibvirtMachine*) base;
	_tmp0_ = boxes_libvirt_machine_get_importing (self);
	_tmp1_ = _tmp0_;
	result = !_tmp1_;
	return result;
}

static gboolean
boxes_libvirt_machine_real_get_should_autosave (BoxesMachine* base)
{
	gboolean result;
	BoxesLibvirtMachine* self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_;
	self = (BoxesLibvirtMachine*) base;
	_tmp3_ = BOXES_MACHINE_CLASS (boxes_libvirt_machine_parent_class)->get_should_autosave (G_TYPE_CHECK_INSTANCE_CAST (self, BOXES_TYPE_MACHINE, BoxesMachine));
	if (_tmp3_) {
		GVirConnection* _tmp4_;
		BoxesApp* _tmp5_;
		GVirConnection* _tmp6_;
		GVirConnection* _tmp7_;
		GVirConnection* _tmp8_;
		_tmp4_ = self->priv->_connection;
		_tmp5_ = boxes_app_app;
		_tmp6_ = boxes_app_get_default_connection (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = _tmp7_;
		_tmp2_ = _tmp4_ == _tmp8_;
		_g_object_unref0 (_tmp8_);
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		gboolean _tmp9_;
		_tmp9_ = self->priv->_run_in_bg;
		_tmp1_ = !_tmp9_;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		BoxesVMCreator* _tmp10_;
		BoxesVMCreator* _tmp11_;
		_tmp10_ = boxes_libvirt_machine_get_vm_creator (self);
		_tmp11_ = _tmp10_;
		_tmp0_ = _tmp11_ == NULL;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

gboolean
boxes_libvirt_machine_get_run_in_bg (BoxesLibvirtMachine* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_run_in_bg;
	return result;
}

void
boxes_libvirt_machine_set_run_in_bg (BoxesLibvirtMachine* self,
                                     gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = boxes_libvirt_machine_get_run_in_bg (self);
	if (old_value != value) {
		self->priv->_run_in_bg = value;
		g_object_notify_by_pspec ((GObject *) self, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_RUN_IN_BG_PROPERTY]);
	}
}

guint64
boxes_libvirt_machine_get_ram (BoxesLibvirtMachine* self)
{
	guint64 result;
	GVirConfigDomain* _tmp0_;
	guint64 _tmp1_;
	guint64 _tmp2_;
	g_return_val_if_fail (self != NULL, 0ULL);
	_tmp0_ = self->priv->_domain_config;
	_tmp1_ = gvir_config_domain_get_memory (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

void
boxes_libvirt_machine_set_ram (BoxesLibvirtMachine* self,
                               guint64 value)
{
	GVirConfigDomain* _tmp0_;
	GVirConfigDomain* _tmp1_;
	GObjectClass* _tmp2_;
	GParamSpec* _tmp3_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_domain_config;
	gvir_config_domain_set_memory (_tmp0_, value);
	_tmp1_ = self->priv->_domain_config;
	_tmp2_ = G_OBJECT_GET_CLASS ((GObject*) _tmp1_);
	_tmp3_ = g_object_class_find_property (_tmp2_, "current-memory");
	if (_tmp3_ != NULL) {
		GVirConfigDomain* _tmp4_;
		_tmp4_ = self->priv->_domain_config;
		g_object_set ((GObject*) _tmp4_, "current-memory", value, NULL);
	}
	{
		GVirDomain* _tmp5_;
		GVirConfigDomain* _tmp6_;
		guint64 _tmp7_;
		guint64 _tmp8_;
		_tmp5_ = self->priv->_domain;
		_tmp6_ = self->priv->_domain_config;
		gvir_domain_set_config (_tmp5_, _tmp6_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp7_ = boxes_libvirt_machine_get_ram (self);
		_tmp8_ = _tmp7_;
		g_debug ("RAM changed to %" G_GUINT64_FORMAT " KiB", _tmp8_);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp9_;
		const gchar* _tmp10_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp9_ = _error_;
		_tmp10_ = _tmp9_->message;
		g_warning ("libvirt-machine.vala:81: Failed to save domain config: %s", _tmp10_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	g_object_notify_by_pspec ((GObject *) self, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_RAM_PROPERTY]);
}

gboolean
boxes_libvirt_machine_get_acceleration_3d (BoxesLibvirtMachine* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_acceleration_3d;
	return result;
}

void
boxes_libvirt_machine_set_acceleration_3d (BoxesLibvirtMachine* self,
                                           gboolean value)
{
	GList* devices = NULL;
	GVirConfigDomain* _tmp0_;
	GList* _tmp1_;
	GVirConfigDomain* _tmp15_;
	GList* _tmp16_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	self->priv->_acceleration_3d = value;
	devices = NULL;
	_tmp0_ = self->priv->_domain_config;
	_tmp1_ = gvir_config_domain_get_devices (_tmp0_);
	{
		GList* device_collection = NULL;
		GList* device_it = NULL;
		device_collection = _tmp1_;
		for (device_it = device_collection; device_it != NULL; device_it = device_it->next) {
			GVirConfigDomainDevice* _tmp2_;
			GVirConfigDomainDevice* device = NULL;
			_tmp2_ = _g_object_ref0 ((GVirConfigDomainDevice*) device_it->data);
			device = _tmp2_;
			{
				GVirConfigDomainDevice* _tmp3_;
				_tmp3_ = device;
				if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, gvir_config_domain_graphics_spice_get_type ())) {
					GVirConfigDomainGraphicsSpice* graphics_device = NULL;
					GVirConfigDomainGraphicsSpice* _tmp4_;
					GVirConfigDomainGraphicsSpice* _tmp5_;
					GVirConfigDomainDevice* _tmp6_;
					_tmp4_ = boxes_vm_configurator_create_graphics_device (self->priv->_acceleration_3d);
					graphics_device = _tmp4_;
					_tmp5_ = graphics_device;
					_tmp6_ = _g_object_ref0 ((GVirConfigDomainDevice*) _tmp5_);
					devices = g_list_prepend (devices, _tmp6_);
					_g_object_unref0 (graphics_device);
				} else {
					GVirConfigDomainDevice* _tmp7_;
					_tmp7_ = device;
					if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, gvir_config_domain_video_get_type ())) {
						GVirConfigDomainVideo* video_device = NULL;
						GVirConfigDomainDevice* _tmp8_;
						GVirConfigDomainVideo* _tmp9_;
						GVirConfigDomainVideo* _tmp10_;
						GVirConfigDomainVideo* _tmp11_;
						GVirConfigDomainDevice* _tmp12_;
						_tmp8_ = device;
						_tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, gvir_config_domain_video_get_type ()) ? ((GVirConfigDomainVideo*) _tmp8_) : NULL);
						video_device = _tmp9_;
						_tmp10_ = video_device;
						gvir_config_domain_video_set_accel3d (_tmp10_, self->priv->_acceleration_3d);
						_tmp11_ = video_device;
						_tmp12_ = _g_object_ref0 ((GVirConfigDomainDevice*) _tmp11_);
						devices = g_list_prepend (devices, _tmp12_);
						_g_object_unref0 (video_device);
					} else {
						GVirConfigDomainDevice* _tmp13_;
						GVirConfigDomainDevice* _tmp14_;
						_tmp13_ = device;
						_tmp14_ = _g_object_ref0 (_tmp13_);
						devices = g_list_prepend (devices, _tmp14_);
					}
				}
				_g_object_unref0 (device);
			}
		}
		(device_collection == NULL) ? NULL : (device_collection = (_g_list_free__g_object_unref0_ (device_collection), NULL));
	}
	devices = g_list_reverse (devices);
	_tmp15_ = self->priv->_domain_config;
	_tmp16_ = devices;
	gvir_config_domain_set_devices (_tmp15_, _tmp16_);
	{
		GVirDomain* _tmp17_;
		GVirConfigDomain* _tmp18_;
		_tmp17_ = self->priv->_domain;
		_tmp18_ = self->priv->_domain_config;
		gvir_domain_set_config (_tmp17_, _tmp18_, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* _error_ = NULL;
		GError* _tmp19_;
		const gchar* _tmp20_;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp19_ = _error_;
		_tmp20_ = _tmp19_->message;
		g_warning ("libvirt-machine.vala:118: Failed to disable 3D Acceleration: %s", _tmp20_);
		_g_error_free0 (_error_);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		(devices == NULL) ? NULL : (devices = (_g_list_free__g_object_unref0_ (devices), NULL));
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
	(devices == NULL) ? NULL : (devices = (_g_list_free__g_object_unref0_ (devices), NULL));
	g_object_notify_by_pspec ((GObject *) self, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_ACCELERATION_3D_PROPERTY]);
}

gboolean
boxes_libvirt_machine_get_firmware_is_efi (BoxesLibvirtMachine* self)
{
	gboolean result;
	GVirConfigDomainOs* os = NULL;
	GVirConfigDomain* _tmp0_;
	GVirConfigDomainOs* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_domain_config;
	_tmp1_ = gvir_config_domain_get_os (_tmp0_);
	os = _tmp1_;
	result = gvir_config_domain_os_get_firmware (os) == GVIR_CONFIG_DOMAIN_OS_FIRMWARE_EFI;
	_g_object_unref0 (os);
	return result;
}

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

static gboolean
boxes_libvirt_machine_real_get_is_local (BoxesMachine* base)
{
	gboolean result;
	BoxesLibvirtMachine* self;
	BoxesCollectionSource* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	self = (BoxesLibvirtMachine*) base;
	_tmp0_ = ((BoxesMachine*) self)->source;
	_tmp1_ = boxes_collection_source_get_uri (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = g_regex_match (_thread_safe_regex_init (&_tmp_regex_0, "^qemu(\\+unix)?:\\/\\/\\/(system|session)", 0 | G_REGEX_CASELESS), _tmp3_, 0, NULL);
	_g_free0 (_tmp3_);
	if (_tmp4_) {
		result = TRUE;
		return result;
	}
	_tmp5_ = BOXES_MACHINE_CLASS (boxes_libvirt_machine_parent_class)->get_is_local (G_TYPE_CHECK_INSTANCE_CAST (self, BOXES_TYPE_MACHINE, BoxesMachine));
	result = _tmp5_;
	return result;
}

static void
boxes_libvirt_machine_class_init (BoxesLibvirtMachineClass * klass,
                                  gpointer klass_data)
{
	boxes_libvirt_machine_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &BoxesLibvirtMachine_private_offset);
	((BoxesMachineClass *) klass)->disconnect_display = (void (*) (BoxesMachine*)) boxes_libvirt_machine_real_disconnect_display;
	((BoxesMachineClass *) klass)->connect_display = (void (*) (BoxesMachine*, BoxesMachineConnectFlags, GAsyncReadyCallback, gpointer)) boxes_libvirt_machine_real_connect_display;
	((BoxesMachineClass *) klass)->connect_display_finish = (void (*) (BoxesMachine*, GAsyncResult*, GError**)) boxes_libvirt_machine_connect_display_finish;
	((BoxesMachineClass *) klass)->take_screenshot = (void (*) (BoxesMachine*, GAsyncReadyCallback, gpointer)) boxes_libvirt_machine_real_take_screenshot;
	((BoxesMachineClass *) klass)->take_screenshot_finish = (GdkPixbuf* (*) (BoxesMachine*, GAsyncResult*, GError**)) boxes_libvirt_machine_take_screenshot_finish;
	((BoxesMachineClass *) klass)->delete = (void (*) (BoxesMachine*, gboolean)) boxes_libvirt_machine_real_delete;
	((BoxesMachineClass *) klass)->save_real = (void (*) (BoxesMachine*, GAsyncReadyCallback, gpointer)) boxes_libvirt_machine_real_save_real;
	((BoxesMachineClass *) klass)->save_real_finish = (void (*) (BoxesMachine*, GAsyncResult*, GError**)) boxes_libvirt_machine_save_real_finish;
	((BoxesMachineClass *) klass)->restart = (void (*) (BoxesMachine*)) boxes_libvirt_machine_real_restart;
	((BoxesMachineClass *) klass)->clone = (void (*) (BoxesMachine*, GAsyncReadyCallback, gpointer)) boxes_libvirt_machine_real_clone;
	((BoxesMachineClass *) klass)->clone_finish = (void (*) (BoxesMachine*, GAsyncResult*)) boxes_libvirt_machine_clone_finish;
	((BoxesMachineClass *) klass)->update_status = (void (*) (BoxesMachine*)) boxes_libvirt_machine_real_update_status;
	BOXES_MACHINE_CLASS (klass)->get_suspend_at_exit = (gboolean (*) (BoxesMachine*)) boxes_libvirt_machine_real_get_suspend_at_exit;
	BOXES_MACHINE_CLASS (klass)->get_can_save = (gboolean (*) (BoxesMachine*)) boxes_libvirt_machine_real_get_can_save;
	BOXES_MACHINE_CLASS (klass)->get_can_restart = (gboolean (*) (BoxesMachine*)) boxes_libvirt_machine_real_get_can_restart;
	BOXES_MACHINE_CLASS (klass)->get_can_clone = (gboolean (*) (BoxesMachine*)) boxes_libvirt_machine_real_get_can_clone;
	BOXES_MACHINE_CLASS (klass)->get_should_autosave = (gboolean (*) (BoxesMachine*)) boxes_libvirt_machine_real_get_should_autosave;
	BOXES_MACHINE_CLASS (klass)->get_is_local = (gboolean (*) (BoxesMachine*)) boxes_libvirt_machine_real_get_is_local;
	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)->finalize = boxes_libvirt_machine_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_DOMAIN_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_DOMAIN_PROPERTY] = g_param_spec_object ("domain", "domain", "domain", gvir_domain_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_DOMAIN_CONFIG_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_DOMAIN_CONFIG_PROPERTY] = g_param_spec_object ("domain-config", "domain-config", "domain-config", gvir_config_domain_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_CONNECTION_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_CONNECTION_PROPERTY] = g_param_spec_object ("connection", "connection", "connection", gvir_connection_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_STORAGE_VOLUME_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_STORAGE_VOLUME_PROPERTY] = g_param_spec_object ("storage-volume", "storage-volume", "storage-volume", gvir_storage_vol_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_VM_CREATOR_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_VM_CREATOR_PROPERTY] = g_param_spec_object ("vm-creator", "vm-creator", "vm-creator", BOXES_TYPE_VM_CREATOR, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_TITLE_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_IMPORTING_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_IMPORTING_PROPERTY] = g_param_spec_boolean ("importing", "importing", "importing", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_SAVE_ON_QUIT_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_SAVE_ON_QUIT_PROPERTY] = g_param_spec_boolean ("save-on-quit", "save-on-quit", "save-on-quit", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_SUSPEND_AT_EXIT_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_SUSPEND_AT_EXIT_PROPERTY] = g_param_spec_boolean ("suspend-at-exit", "suspend-at-exit", "suspend-at-exit", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_CAN_SAVE_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_CAN_SAVE_PROPERTY] = g_param_spec_boolean ("can-save", "can-save", "can-save", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_CAN_RESTART_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_CAN_RESTART_PROPERTY] = g_param_spec_boolean ("can-restart", "can-restart", "can-restart", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_CAN_CLONE_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_CAN_CLONE_PROPERTY] = g_param_spec_boolean ("can-clone", "can-clone", "can-clone", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_SHOULD_AUTOSAVE_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_SHOULD_AUTOSAVE_PROPERTY] = g_param_spec_boolean ("should-autosave", "should-autosave", "should-autosave", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_RUN_IN_BG_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_RUN_IN_BG_PROPERTY] = g_param_spec_boolean ("run-in-bg", "run-in-bg", "run-in-bg", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_RAM_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_RAM_PROPERTY] = g_param_spec_uint64 ("ram", "ram", "ram", 0, G_MAXUINT64, 0U, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_ACCELERATION_3D_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_ACCELERATION_3D_PROPERTY] = g_param_spec_boolean ("acceleration-3d", "acceleration-3d", "acceleration-3d", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_FIRMWARE_IS_EFI_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_FIRMWARE_IS_EFI_PROPERTY] = g_param_spec_boolean ("firmware-is-efi", "firmware-is-efi", "firmware-is-efi", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), BOXES_LIBVIRT_MACHINE_IS_LOCAL_PROPERTY, boxes_libvirt_machine_properties[BOXES_LIBVIRT_MACHINE_IS_LOCAL_PROPERTY] = g_param_spec_boolean ("is-local", "is-local", "is-local", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
boxes_libvirt_machine_instance_init (BoxesLibvirtMachine * self,
                                     gpointer klass)
{
	self->priv = boxes_libvirt_machine_get_instance_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->priv->_domain);
	_g_object_unref0 (self->priv->_domain_config);
	_g_object_unref0 (self->priv->_connection);
	_g_object_unref0 (self->priv->_storage_volume);
	_g_object_unref0 (self->priv->_vm_creator);
	_g_object_unref0 (self->priv->system_virt_connection);
	self->priv->saved_properties = (_vala_BoxesBoxConfigSavedProperty_array_free (self->priv->saved_properties, self->priv->saved_properties_length1), NULL);
	G_OBJECT_CLASS (boxes_libvirt_machine_parent_class)->finalize (obj);
}

static GType
boxes_libvirt_machine_get_type_once (void)
{
	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);
	BoxesLibvirtMachine_private_offset = g_type_add_instance_private (boxes_libvirt_machine_type_id, sizeof (BoxesLibvirtMachinePrivate));
	return boxes_libvirt_machine_type_id;
}

GType
boxes_libvirt_machine_get_type (void)
{
	static volatile gsize boxes_libvirt_machine_type_id__once = 0;
	if (g_once_init_enter (&boxes_libvirt_machine_type_id__once)) {
		GType boxes_libvirt_machine_type_id;
		boxes_libvirt_machine_type_id = boxes_libvirt_machine_get_type_once ();
		g_once_init_leave (&boxes_libvirt_machine_type_id__once, boxes_libvirt_machine_type_id);
	}
	return boxes_libvirt_machine_type_id__once;
}

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_DOMAIN_PROPERTY:
		g_value_set_object (value, boxes_libvirt_machine_get_domain (self));
		break;
		case BOXES_LIBVIRT_MACHINE_DOMAIN_CONFIG_PROPERTY:
		g_value_set_object (value, boxes_libvirt_machine_get_domain_config (self));
		break;
		case BOXES_LIBVIRT_MACHINE_CONNECTION_PROPERTY:
		g_value_set_object (value, boxes_libvirt_machine_get_connection (self));
		break;
		case BOXES_LIBVIRT_MACHINE_STORAGE_VOLUME_PROPERTY:
		g_value_set_object (value, boxes_libvirt_machine_get_storage_volume (self));
		break;
		case BOXES_LIBVIRT_MACHINE_VM_CREATOR_PROPERTY:
		g_value_set_object (value, boxes_libvirt_machine_get_vm_creator (self));
		break;
		case BOXES_LIBVIRT_MACHINE_TITLE_PROPERTY:
		g_value_set_string (value, boxes_libvirt_machine_get_title (self));
		break;
		case BOXES_LIBVIRT_MACHINE_IMPORTING_PROPERTY:
		g_value_set_boolean (value, boxes_libvirt_machine_get_importing (self));
		break;
		case BOXES_LIBVIRT_MACHINE_SAVE_ON_QUIT_PROPERTY:
		g_value_set_boolean (value, boxes_libvirt_machine_get_save_on_quit (self));
		break;
		case BOXES_LIBVIRT_MACHINE_SUSPEND_AT_EXIT_PROPERTY:
		g_value_set_boolean (value, boxes_machine_get_suspend_at_exit ((BoxesMachine*) self));
		break;
		case BOXES_LIBVIRT_MACHINE_CAN_SAVE_PROPERTY:
		g_value_set_boolean (value, boxes_machine_get_can_save ((BoxesMachine*) self));
		break;
		case BOXES_LIBVIRT_MACHINE_CAN_RESTART_PROPERTY:
		g_value_set_boolean (value, boxes_machine_get_can_restart ((BoxesMachine*) self));
		break;
		case BOXES_LIBVIRT_MACHINE_CAN_CLONE_PROPERTY:
		g_value_set_boolean (value, boxes_machine_get_can_clone ((BoxesMachine*) self));
		break;
		case BOXES_LIBVIRT_MACHINE_SHOULD_AUTOSAVE_PROPERTY:
		g_value_set_boolean (value, boxes_machine_get_should_autosave ((BoxesMachine*) self));
		break;
		case BOXES_LIBVIRT_MACHINE_RUN_IN_BG_PROPERTY:
		g_value_set_boolean (value, boxes_libvirt_machine_get_run_in_bg (self));
		break;
		case BOXES_LIBVIRT_MACHINE_RAM_PROPERTY:
		g_value_set_uint64 (value, boxes_libvirt_machine_get_ram (self));
		break;
		case BOXES_LIBVIRT_MACHINE_ACCELERATION_3D_PROPERTY:
		g_value_set_boolean (value, boxes_libvirt_machine_get_acceleration_3d (self));
		break;
		case BOXES_LIBVIRT_MACHINE_FIRMWARE_IS_EFI_PROPERTY:
		g_value_set_boolean (value, boxes_libvirt_machine_get_firmware_is_efi (self));
		break;
		case BOXES_LIBVIRT_MACHINE_IS_LOCAL_PROPERTY:
		g_value_set_boolean (value, boxes_machine_get_is_local ((BoxesMachine*) 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_DOMAIN_PROPERTY:
		boxes_libvirt_machine_set_domain (self, g_value_get_object (value));
		break;
		case BOXES_LIBVIRT_MACHINE_DOMAIN_CONFIG_PROPERTY:
		boxes_libvirt_machine_set_domain_config (self, g_value_get_object (value));
		break;
		case BOXES_LIBVIRT_MACHINE_CONNECTION_PROPERTY:
		boxes_libvirt_machine_set_connection (self, g_value_get_object (value));
		break;
		case BOXES_LIBVIRT_MACHINE_STORAGE_VOLUME_PROPERTY:
		boxes_libvirt_machine_set_storage_volume (self, g_value_get_object (value));
		break;
		case BOXES_LIBVIRT_MACHINE_VM_CREATOR_PROPERTY:
		boxes_libvirt_machine_set_vm_creator (self, g_value_get_object (value));
		break;
		case BOXES_LIBVIRT_MACHINE_TITLE_PROPERTY:
		boxes_libvirt_machine_set_title (self, g_value_get_string (value));
		break;
		case BOXES_LIBVIRT_MACHINE_SAVE_ON_QUIT_PROPERTY:
		boxes_libvirt_machine_set_save_on_quit (self, g_value_get_boolean (value));
		break;
		case BOXES_LIBVIRT_MACHINE_RUN_IN_BG_PROPERTY:
		boxes_libvirt_machine_set_run_in_bg (self, g_value_get_boolean (value));
		break;
		case BOXES_LIBVIRT_MACHINE_RAM_PROPERTY:
		boxes_libvirt_machine_set_ram (self, g_value_get_uint64 (value));
		break;
		case BOXES_LIBVIRT_MACHINE_ACCELERATION_3D_PROPERTY:
		boxes_libvirt_machine_set_acceleration_3d (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

