mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
Rename VIR_DOMAIN_SNAPSHOT_LOCATION_NONE to VIR_DOMAIN_SNAPSHOT_LOCATION_NO
The string value associated to the enum is "no". Rename the enum accordingly. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f17da1c24b
commit
fe6e11e856
@ -5521,7 +5521,7 @@ virDomainDiskDefPostParse(virDomainDiskDef *disk,
|
||||
|
||||
if (disk->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT &&
|
||||
disk->src->readonly)
|
||||
disk->snapshot = VIR_DOMAIN_SNAPSHOT_LOCATION_NONE;
|
||||
disk->snapshot = VIR_DOMAIN_SNAPSHOT_LOCATION_NO;
|
||||
|
||||
if (disk->src->type == VIR_STORAGE_TYPE_NETWORK &&
|
||||
disk->src->protocol == VIR_STORAGE_NET_PROTOCOL_ISCSI) {
|
||||
@ -5536,7 +5536,7 @@ virDomainDiskDefPostParse(virDomainDiskDef *disk,
|
||||
/* vhost-user doesn't allow us to snapshot, disable snapshots by default */
|
||||
if (disk->src->type == VIR_STORAGE_TYPE_VHOST_USER &&
|
||||
disk->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT) {
|
||||
disk->snapshot = VIR_DOMAIN_SNAPSHOT_LOCATION_NONE;
|
||||
disk->snapshot = VIR_DOMAIN_SNAPSHOT_LOCATION_NO;
|
||||
}
|
||||
|
||||
if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
|
||||
@ -23617,7 +23617,7 @@ virDomainDiskDefFormat(virBuffer *buf,
|
||||
virBufferAsprintf(&attrBuf, " sgio='%s'", sgio);
|
||||
|
||||
if (def->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT &&
|
||||
!(def->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE &&
|
||||
!(def->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NO &&
|
||||
def->src->readonly))
|
||||
virBufferAsprintf(&attrBuf, " snapshot='%s'",
|
||||
virDomainSnapshotLocationTypeToString(def->snapshot));
|
||||
|
@ -539,7 +539,7 @@ typedef enum {
|
||||
|
||||
typedef enum {
|
||||
VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT = 0,
|
||||
VIR_DOMAIN_SNAPSHOT_LOCATION_NONE,
|
||||
VIR_DOMAIN_SNAPSHOT_LOCATION_NO,
|
||||
VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL,
|
||||
VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL,
|
||||
|
||||
|
@ -317,7 +317,7 @@ virDomainDiskVhostUserValidate(const virDomainDiskDef *disk)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (disk->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_NONE) {
|
||||
if (disk->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_NO) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("only snapshot=no is supported with vhostuser disk"));
|
||||
return -1;
|
||||
|
@ -337,11 +337,11 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
|
||||
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL;
|
||||
} else if (flags & VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE) {
|
||||
def->memory = (offline ?
|
||||
VIR_DOMAIN_SNAPSHOT_LOCATION_NONE :
|
||||
VIR_DOMAIN_SNAPSHOT_LOCATION_NO :
|
||||
VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL);
|
||||
}
|
||||
if (offline && def->memory &&
|
||||
def->memory != VIR_DOMAIN_SNAPSHOT_LOCATION_NONE) {
|
||||
def->memory != VIR_DOMAIN_SNAPSHOT_LOCATION_NO) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("memory state cannot be saved with offline or "
|
||||
"disk-only snapshot"));
|
||||
@ -681,15 +681,15 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDef *snapdef,
|
||||
if (snapdisk->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT) {
|
||||
if (domdisk->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT &&
|
||||
(!require_match ||
|
||||
domdisk->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE)) {
|
||||
domdisk->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NO)) {
|
||||
snapdisk->snapshot = domdisk->snapshot;
|
||||
} else {
|
||||
snapdisk->snapshot = default_snapshot;
|
||||
}
|
||||
} else if (require_match &&
|
||||
snapdisk->snapshot != default_snapshot &&
|
||||
!(snapdisk->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE &&
|
||||
domdisk->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE)) {
|
||||
!(snapdisk->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NO &&
|
||||
domdisk->snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NO)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("disk '%s' must use snapshot mode '%s'"),
|
||||
snapdisk->name,
|
||||
@ -728,7 +728,7 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDef *snapdef,
|
||||
|
||||
/* Don't snapshot empty drives */
|
||||
if (virStorageSourceIsEmpty(domdef->disks[i]->src))
|
||||
snapdisk->snapshot = VIR_DOMAIN_SNAPSHOT_LOCATION_NONE;
|
||||
snapdisk->snapshot = VIR_DOMAIN_SNAPSHOT_LOCATION_NO;
|
||||
else
|
||||
snapdisk->snapshot = domdef->disks[i]->snapshot;
|
||||
|
||||
|
@ -6886,7 +6886,7 @@ qemuDomainSnapshotForEachQcow2Raw(virQEMUDriver *driver,
|
||||
|
||||
/* FIXME: we also need to handle LVM here */
|
||||
if (def->disks[i]->device != VIR_DOMAIN_DISK_DEVICE_DISK ||
|
||||
snapdef->disks[i].snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE)
|
||||
snapdef->disks[i].snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_NO)
|
||||
continue;
|
||||
|
||||
if (!virStorageSourceIsLocalStorage(def->disks[i]->src)) {
|
||||
|
@ -692,7 +692,7 @@ qemuSnapshotPrepare(virDomainObj *vm,
|
||||
virDomainSnapshotDiskDef *disk = &def->disks[i];
|
||||
virDomainDiskDef *dom_disk = vm->def->disks[i];
|
||||
|
||||
if (disk->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_NONE &&
|
||||
if (disk->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_NO &&
|
||||
qemuDomainDiskBlockJobIsActive(dom_disk))
|
||||
return -1;
|
||||
|
||||
@ -757,7 +757,7 @@ qemuSnapshotPrepare(virDomainObj *vm,
|
||||
external++;
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_SNAPSHOT_LOCATION_NONE:
|
||||
case VIR_DOMAIN_SNAPSHOT_LOCATION_NO:
|
||||
/* Remember seeing a disk that has snapshot disabled */
|
||||
if (!virStorageSourceIsEmpty(dom_disk->src) &&
|
||||
!dom_disk->src->readonly)
|
||||
@ -773,7 +773,7 @@ qemuSnapshotPrepare(virDomainObj *vm,
|
||||
}
|
||||
|
||||
if (!found_internal && !external &&
|
||||
def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE) {
|
||||
def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_NO) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("nothing selected for snapshot"));
|
||||
return -1;
|
||||
@ -1657,7 +1657,7 @@ qemuSnapshotCreateAlignDisks(virDomainObj *vm,
|
||||
def->state = VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT;
|
||||
else
|
||||
def->state = VIR_DOMAIN_SNAPSHOT_SHUTOFF;
|
||||
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NONE;
|
||||
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NO;
|
||||
} else if (def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL) {
|
||||
def->state = virDomainObjGetState(vm, NULL);
|
||||
align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL;
|
||||
@ -1665,7 +1665,7 @@ qemuSnapshotCreateAlignDisks(virDomainObj *vm,
|
||||
def->state = virDomainObjGetState(vm, NULL);
|
||||
|
||||
if (virDomainObjIsActive(vm) &&
|
||||
def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE) {
|
||||
def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_NO) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("internal snapshot of a running VM "
|
||||
"must include the memory state"));
|
||||
@ -1673,7 +1673,7 @@ qemuSnapshotCreateAlignDisks(virDomainObj *vm,
|
||||
}
|
||||
|
||||
if (def->state == VIR_DOMAIN_SNAPSHOT_SHUTOFF)
|
||||
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NONE;
|
||||
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NO;
|
||||
else
|
||||
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
|
||||
}
|
||||
|
@ -8723,14 +8723,14 @@ testDomainSnapshotAlignDisks(virDomainObj *vm,
|
||||
def->state = VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT;
|
||||
else
|
||||
def->state = VIR_DOMAIN_SNAPSHOT_SHUTOFF;
|
||||
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NONE;
|
||||
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NO;
|
||||
} else if (def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL) {
|
||||
def->state = virDomainObjGetState(vm, NULL);
|
||||
align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL;
|
||||
} else {
|
||||
def->state = virDomainObjGetState(vm, NULL);
|
||||
def->memory = def->state == VIR_DOMAIN_SNAPSHOT_SHUTOFF ?
|
||||
VIR_DOMAIN_SNAPSHOT_LOCATION_NONE :
|
||||
VIR_DOMAIN_SNAPSHOT_LOCATION_NO :
|
||||
VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
|
||||
}
|
||||
|
||||
|
@ -4640,7 +4640,7 @@ prlsdkParseSnapshotTree(const char *treexml)
|
||||
|
||||
def->parent.description = virXPathString("string(./Description)", ctxt);
|
||||
|
||||
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NONE;
|
||||
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NO;
|
||||
xmlstr = virXPathString("string(./@state)", ctxt);
|
||||
if (!xmlstr) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
|
Loading…
Reference in New Issue
Block a user