<commit_before>/*
 * ovirt-vm.h: oVirt virtual machine
 *
 * Copyright (C) 2012 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see
 * <http://www.gnu.org/licenses/>.
 *
 * Author: <NAME> <<EMAIL>>
 */
#ifndef __OVIRT_VM_H__
#define __OVIRT_VM_H__

#include <gio/gio.h>
#include <glib-object.h>
#include <govirt/ovirt-resource.h>
#include <govirt/ovirt-types.h>

G_BEGIN_DECLS

#define OVIRT_TYPE_VM            (ovirt_vm_get_type ())
#define OVIRT_VM(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_VM, OvirtVm))
#define OVIRT_VM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_VM, OvirtVmClass))
#define OVIRT_IS_VM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_VM))
#define OVIRT_IS_VM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_VM))
#define OVIRT_VM_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_VM, OvirtVmClass))

typedef struct _OvirtVm OvirtVm;
typedef struct _OvirtVmPrivate OvirtVmPrivate;
typedef struct _OvirtVmClass OvirtVmClass;

struct _OvirtVm
{
    OvirtResource parent;

    OvirtVmPrivate *priv;

    /* Do not add fields to this struct */
};

struct _OvirtVmClass
{
    OvirtResourceClass parent_class;

    gpointer padding[20];
};


typedef enum {
    OVIRT_VM_STATE_DOWN,
    OVIRT_VM_STATE_UP,
    OVIRT_VM_STATE_REBOOTING,
    OVIRT_VM_STATE_POWERING_UP,
    OVIRT_VM_STATE_POWERED_DOWN,
    OVIRT_VM_STATE_PAUSED,
    OVIRT_VM_STATE_MIGRATING,
    OVIRT_VM_STATE_UNKNOWN,
    OVIRT_VM_STATE_NOT_RESPONDING,
    OVIRT_VM_STATE_WAIT_FOR_LAUNCH,
    OVIRT_VM_STATE_REBOOT_IN_PROGRESS,
    OVIRT_VM_STATE_SAVING_STATE,
    OVIRT_VM_STATE_RESTORING_STATE,
    OVIRT_VM_STATE_SUSPENDED,
    OVIRT_VM_STATE_IMAGE_LOCKED,
    OVIRT_VM_STATE_POWERING_DOWN,
} OvirtVmState;

GType ovirt_vm_get_type(void);
OvirtVm *ovirt_vm_new(void);

gboolean ovirt_vm_get_ticket(OvirtVm *vm, OvirtProxy *proxy, GError **error);
gboolean ovirt_vm_start(OvirtVm *vm, OvirtProxy *proxy, GError **error);
gboolean ovirt_vm_stop(OvirtVm *vm, OvirtProxy *proxy, GError **error);

void ovirt_vm_get_ticket_async(OvirtVm *vm, OvirtProxy *proxy,
                               GCancellable *cancellable,
                               GAsyncReadyCallback callback,
                               gpointer user_data);
gboolean ovirt_vm_get_ticket_finish(OvirtVm *vm,
                                    GAsyncResult *result,
                                    GError **err);
void ovirt_vm_start_async(OvirtVm *vm, OvirtProxy *proxy,
                          GCancellable *cancellable,
                          GAsyncReadyCallback callback,
                          gpointer user_data);
gboolean ovirt_vm_start_finish(OvirtVm *vm,
                               GAsyncResult *result,
                               GError **err);
void ovirt_vm_stop_async(OvirtVm *vm, OvirtProxy *proxy,
                         GCancellable *cancellable,<commit_msg>vm: Fix nick of the OvirtVmState enum<commit_after>/*
 * ovirt-vm.h: oVirt virtual machine
 *
 * Copyright (C) 2012 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see
 * <http://www.gnu.org/licenses/>.
 *
 * Author: <NAME> <<EMAIL>>
 */
#ifndef __OVIRT_VM_H__
#define __OVIRT_VM_H__

#include <gio/gio.h>
#include <glib-object.h>
#include <govirt/ovirt-resource.h>
#include <govirt/ovirt-types.h>

G_BEGIN_DECLS

#define OVIRT_TYPE_VM            (ovirt_vm_get_type ())
#define OVIRT_VM(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), OVIRT_TYPE_VM, OvirtVm))
#define OVIRT_VM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), OVIRT_TYPE_VM, OvirtVmClass))
#define OVIRT_IS_VM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OVIRT_TYPE_VM))
#define OVIRT_IS_VM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OVIRT_TYPE_VM))
#define OVIRT_VM_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), OVIRT_TYPE_VM, OvirtVmClass))

typedef struct _OvirtVm OvirtVm;
typedef struct _OvirtVmPrivate OvirtVmPrivate;
typedef struct _OvirtVmClass OvirtVmClass;

struct _OvirtVm
{
    OvirtResource parent;

    OvirtVmPrivate *priv;

    /* Do not add fields to this struct */
};

struct _OvirtVmClass
{
    OvirtResourceClass parent_class;

    gpointer padding[20];
};


typedef enum {
    OVIRT_VM_STATE_DOWN,
    OVIRT_VM_STATE_UP,
    OVIRT_VM_STATE_REBOOTING,
    OVIRT_VM_STATE_POWERING_UP, /*< nick=powering_up >*/
    OVIRT_VM_STATE_POWERED_DOWN, /*< nick=powered_down >*/
    OVIRT_VM_STATE_PAUSED,
    OVIRT_VM_STATE_MIGRATING,
    OVIRT_VM_STATE_UNKNOWN,
    OVIRT_VM_STATE_NOT_RESPONDING, /*< nick=not_responding >*/
    OVIRT_VM_STATE_WAIT_FOR_LAUNCH, /*< nick=wait_for_launch >*/
    OVIRT_VM_STATE_REBOOT_IN_PROGRESS, /*< nick=reboot_in_progress >*/
    OVIRT_VM_STATE_SAVING_STATE, /*< nick=saving_state >*/
    OVIRT_VM_STATE_RESTORING_STATE, /*< nick=restoring_state >*/
    OVIRT_VM_STATE_SUSPENDED,
    OVIRT_VM_STATE_IMAGE_LOCKED, /*< nick=image_locked >*/
    OVIRT_VM_STATE_POWERING_DOWN, /*< nick=powering_down >*/
} OvirtVmState;

GType ovirt_vm_get_type(void);
OvirtVm *ovirt_vm_new(void);

gboolean ovirt_vm_get_ticket(OvirtVm *vm, OvirtProxy *proxy, GError **error);
gboolean ovirt_vm_start(OvirtVm *vm, OvirtProxy *proxy, GError **error);
gboolean ovirt_vm_stop(OvirtVm *vm, OvirtProxy *proxy, GError **error);

void ovirt_vm_get_ticket_async(OvirtVm *vm, OvirtProxy *proxy,
                               GCancellable *cancellable,
                               GAsyncReadyCallback callback,
                               gpointer user_data);
gboolean ovirt_vm_get_ticket_finish(OvirtVm *vm,
                                    GAsyncResult *result,
                                    GError **err);
void ovirt_vm_start_async(OvirtVm *vm, OvirtProxy *proxy,
                          GCancellable *cancellable,
                          GAsyncReadyCallback callback,
                          gpointer user_data);
gboolean ovirt_vm_start_finish(OvirtVm *vm,
                               GAsyncResult *result,
                               GError **err);
void ovirt_vm_stop_async(OvirtVm *vm, OvirtProxy *proxy,
                         GCancellable *cancellable,
{'fraction_non_alphanumeric': 0.08096280087527352, 'fraction_numerical': 0.002188183807439825, 'mean_word_length': 3.3272189349112424, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5477513', 'n_tokens_mistral': 2642, 'n_tokens_neox': 2484, 'n_words': 570}