mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
conf: Move definition of 'virDomainSnapshotLocation'
The snapshot location enum is also needed for the disk definition so if we house it inside domain_conf we can use the proper type for it. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
0146d70887
commit
f17da1c24b
@ -1402,6 +1402,14 @@ VIR_ENUM_IMPL(virDomainIBS,
|
|||||||
"fixed-na",
|
"fixed-na",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
VIR_ENUM_IMPL(virDomainSnapshotLocation,
|
||||||
|
VIR_DOMAIN_SNAPSHOT_LOCATION_LAST,
|
||||||
|
"default",
|
||||||
|
"no",
|
||||||
|
"internal",
|
||||||
|
"external",
|
||||||
|
);
|
||||||
|
|
||||||
/* Internal mapping: subset of block job types that can be present in
|
/* Internal mapping: subset of block job types that can be present in
|
||||||
* <mirror> XML (remaining types are not two-phase). */
|
* <mirror> XML (remaining types are not two-phase). */
|
||||||
VIR_ENUM_DECL(virDomainBlockJob);
|
VIR_ENUM_DECL(virDomainBlockJob);
|
||||||
@ -23608,7 +23616,7 @@ virDomainDiskDefFormat(virBuffer *buf,
|
|||||||
if (def->sgio)
|
if (def->sgio)
|
||||||
virBufferAsprintf(&attrBuf, " sgio='%s'", sgio);
|
virBufferAsprintf(&attrBuf, " sgio='%s'", sgio);
|
||||||
|
|
||||||
if (def->snapshot &&
|
if (def->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT &&
|
||||||
!(def->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE &&
|
!(def->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE &&
|
||||||
def->src->readonly))
|
def->src->readonly))
|
||||||
virBufferAsprintf(&attrBuf, " snapshot='%s'",
|
virBufferAsprintf(&attrBuf, " snapshot='%s'",
|
||||||
|
@ -537,6 +537,18 @@ typedef enum {
|
|||||||
} virDomainMemoryAllocation;
|
} virDomainMemoryAllocation;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT = 0,
|
||||||
|
VIR_DOMAIN_SNAPSHOT_LOCATION_NONE,
|
||||||
|
VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL,
|
||||||
|
VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL,
|
||||||
|
|
||||||
|
VIR_DOMAIN_SNAPSHOT_LOCATION_LAST
|
||||||
|
} virDomainSnapshotLocation;
|
||||||
|
|
||||||
|
VIR_ENUM_DECL(virDomainSnapshotLocation);
|
||||||
|
|
||||||
|
|
||||||
/* Stores the virtual disk configuration */
|
/* Stores the virtual disk configuration */
|
||||||
struct _virDomainDiskDef {
|
struct _virDomainDiskDef {
|
||||||
virStorageSource *src; /* non-NULL. XXX Allow NULL for empty cdrom? */
|
virStorageSource *src; /* non-NULL. XXX Allow NULL for empty cdrom? */
|
||||||
@ -581,7 +593,7 @@ struct _virDomainDiskDef {
|
|||||||
virTristateSwitch ioeventfd;
|
virTristateSwitch ioeventfd;
|
||||||
virTristateSwitch event_idx;
|
virTristateSwitch event_idx;
|
||||||
virTristateSwitch copy_on_read;
|
virTristateSwitch copy_on_read;
|
||||||
unsigned int snapshot; /* virDomainSnapshotLocation, snapshot_conf.h */
|
virDomainSnapshotLocation snapshot;
|
||||||
virDomainStartupPolicy startupPolicy;
|
virDomainStartupPolicy startupPolicy;
|
||||||
bool transient;
|
bool transient;
|
||||||
virTristateBool transientShareBacking;
|
virTristateBool transientShareBacking;
|
||||||
|
@ -67,14 +67,6 @@ virDomainSnapshotOnceInit(void)
|
|||||||
|
|
||||||
VIR_ONCE_GLOBAL_INIT(virDomainSnapshot);
|
VIR_ONCE_GLOBAL_INIT(virDomainSnapshot);
|
||||||
|
|
||||||
VIR_ENUM_IMPL(virDomainSnapshotLocation,
|
|
||||||
VIR_DOMAIN_SNAPSHOT_LOCATION_LAST,
|
|
||||||
"default",
|
|
||||||
"no",
|
|
||||||
"internal",
|
|
||||||
"external",
|
|
||||||
);
|
|
||||||
|
|
||||||
/* virDomainSnapshotState is really virDomainState plus one extra state */
|
/* virDomainSnapshotState is really virDomainState plus one extra state */
|
||||||
VIR_ENUM_IMPL(virDomainSnapshotState,
|
VIR_ENUM_IMPL(virDomainSnapshotState,
|
||||||
VIR_DOMAIN_SNAPSHOT_LAST,
|
VIR_DOMAIN_SNAPSHOT_LAST,
|
||||||
|
@ -26,17 +26,6 @@
|
|||||||
#include "moment_conf.h"
|
#include "moment_conf.h"
|
||||||
#include "virenum.h"
|
#include "virenum.h"
|
||||||
|
|
||||||
/* Items related to snapshot state */
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT = 0,
|
|
||||||
VIR_DOMAIN_SNAPSHOT_LOCATION_NONE,
|
|
||||||
VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL,
|
|
||||||
VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL,
|
|
||||||
|
|
||||||
VIR_DOMAIN_SNAPSHOT_LOCATION_LAST
|
|
||||||
} virDomainSnapshotLocation;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This enum has to map all known domain states from the public enum
|
* This enum has to map all known domain states from the public enum
|
||||||
* virDomainState, before adding one additional state possible only
|
* virDomainState, before adding one additional state possible only
|
||||||
@ -139,5 +128,4 @@ int virDomainSnapshotRedefinePrep(virDomainObj *vm,
|
|||||||
virDomainXMLOption *xmlopt,
|
virDomainXMLOption *xmlopt,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
VIR_ENUM_DECL(virDomainSnapshotLocation);
|
|
||||||
VIR_ENUM_DECL(virDomainSnapshotState);
|
VIR_ENUM_DECL(virDomainSnapshotState);
|
||||||
|
@ -637,6 +637,8 @@ virDomainSmartcardTypeFromString;
|
|||||||
virDomainSmartcardTypeToString;
|
virDomainSmartcardTypeToString;
|
||||||
virDomainSmbiosModeTypeFromString;
|
virDomainSmbiosModeTypeFromString;
|
||||||
virDomainSmbiosModeTypeToString;
|
virDomainSmbiosModeTypeToString;
|
||||||
|
virDomainSnapshotLocationTypeFromString;
|
||||||
|
virDomainSnapshotLocationTypeToString;
|
||||||
virDomainSoundDefFind;
|
virDomainSoundDefFind;
|
||||||
virDomainSoundDefFree;
|
virDomainSoundDefFree;
|
||||||
virDomainSoundDefRemove;
|
virDomainSoundDefRemove;
|
||||||
@ -1024,8 +1026,6 @@ virDomainSnapshotDiskDefFree;
|
|||||||
virDomainSnapshotDiskDefParseXML;
|
virDomainSnapshotDiskDefParseXML;
|
||||||
virDomainSnapshotFormatConvertXMLFlags;
|
virDomainSnapshotFormatConvertXMLFlags;
|
||||||
virDomainSnapshotIsExternal;
|
virDomainSnapshotIsExternal;
|
||||||
virDomainSnapshotLocationTypeFromString;
|
|
||||||
virDomainSnapshotLocationTypeToString;
|
|
||||||
virDomainSnapshotRedefinePrep;
|
virDomainSnapshotRedefinePrep;
|
||||||
virDomainSnapshotStateTypeFromString;
|
virDomainSnapshotStateTypeFromString;
|
||||||
virDomainSnapshotStateTypeToString;
|
virDomainSnapshotStateTypeToString;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user