1 /*
2  * libvirt-gconfig-domain-snapshot-disk.h: libvirt snapshot disk configuration
3  *
4  * Copyright (C) 2010-2013 Red Hat, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library. If not, see
18  * <http://www.gnu.org/licenses/>.
19  *
20  * Author: Christophe Fergeau <cfergeau@redhat.com>
21  */
22 
23 #if !defined(__LIBVIRT_GCONFIG_H__) && !defined(LIBVIRT_GCONFIG_BUILD)
24 #error "Only <libvirt-gconfig/libvirt-gconfig.h> can be included directly."
25 #endif
26 
27 #ifndef __LIBVIRT_GCONFIG_DOMAIN_SNAPSHOT_DISK_H__
28 #define __LIBVIRT_GCONFIG_DOMAIN_SNAPSHOT_DISK_H__
29 
30 G_BEGIN_DECLS
31 
32 #define GVIR_CONFIG_TYPE_DOMAIN_SNAPSHOT_DISK            (gvir_config_domain_snapshot_disk_get_type ())
33 #define GVIR_CONFIG_DOMAIN_SNAPSHOT_DISK(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GVIR_CONFIG_TYPE_DOMAIN_SNAPSHOT_DISK, GVirConfigDomainSnapshotDisk))
34 #define GVIR_CONFIG_DOMAIN_SNAPSHOT_DISK_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GVIR_CONFIG_TYPE_DOMAIN_SNAPSHOT_DISK, GVirConfigDomainSnapshotDiskClass))
35 #define GVIR_CONFIG_IS_DOMAIN_SNAPSHOT_DISK(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GVIR_CONFIG_TYPE_DOMAIN_SNAPSHOT_DISK))
36 #define GVIR_CONFIG_IS_DOMAIN_SNAPSHOT_DISK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GVIR_CONFIG_TYPE_DOMAIN_SNAPSHOT_DISK))
37 #define GVIR_CONFIG_DOMAIN_SNAPSHOT_DISK_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GVIR_CONFIG_TYPE_DOMAIN_SNAPSHOT_DISK, GVirConfigDomainSnapshotDiskClass))
38 
39 typedef struct _GVirConfigDomainSnapshotDisk GVirConfigDomainSnapshotDisk;
40 typedef struct _GVirConfigDomainSnapshotDiskPrivate GVirConfigDomainSnapshotDiskPrivate;
41 typedef struct _GVirConfigDomainSnapshotDiskClass GVirConfigDomainSnapshotDiskClass;
42 
43 struct _GVirConfigDomainSnapshotDisk
44 {
45     GVirConfigObject parent;
46 
47     GVirConfigDomainSnapshotDiskPrivate *priv;
48 
49     /* Do not add fields to this struct */
50 };
51 
52 struct _GVirConfigDomainSnapshotDiskClass
53 {
54     GVirConfigObjectClass parent_class;
55 
56     gpointer padding[20];
57 };
58 
59 
60 GType gvir_config_domain_snapshot_disk_get_type(void);
61 
62 GVirConfigDomainSnapshotDisk *gvir_config_domain_snapshot_disk_new(void);
63 GVirConfigDomainSnapshotDisk *gvir_config_domain_snapshot_disk_new_from_xml(const gchar *xml,
64                                                                             GError **error);
65 
66 const char *gvir_config_domain_snapshot_disk_get_name(GVirConfigDomainSnapshotDisk *disk);
67 void gvir_config_domain_snapshot_disk_set_name(GVirConfigDomainSnapshotDisk *disk,
68                                                const char *name);
69 
70 GVirConfigDomainDiskSnapshotType gvir_config_domain_snapshot_disk_get_snapshot_type(GVirConfigDomainSnapshotDisk *disk);
71 void gvir_config_domain_snapshot_disk_set_snapshot_type(GVirConfigDomainSnapshotDisk *disk,
72                                                         GVirConfigDomainDiskSnapshotType type);
73 
74 const char *gvir_config_domain_snapshot_disk_get_source_file(GVirConfigDomainSnapshotDisk *disk);
75 void gvir_config_domain_snapshot_disk_set_source_file(GVirConfigDomainSnapshotDisk *disk,
76                                                       const char *filename);
77 
78 GVirConfigDomainDiskFormat gvir_config_domain_snapshot_disk_get_driver_format(GVirConfigDomainSnapshotDisk *disk);
79 void gvir_config_domain_snapshot_disk_set_driver_format(GVirConfigDomainSnapshotDisk *disk,
80                                                         GVirConfigDomainDiskFormat format);
81 
82 G_END_DECLS
83 
84 #endif /* __LIBVIRT_GCONFIG_DOMAIN_SNAPSHOT_DISK_H__ */
85