[PATCH 07/14] Rename VIR_DOMAIN_SNAPSHOT_LOCATION_NONE to VIR_DOMAIN_SNAPSHOT_LOCATION_NO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The string value associated to the enum is "no". Rename the enum
accordingly.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/conf/domain_conf.c     |  6 +++---
 src/conf/domain_conf.h     |  2 +-
 src/conf/domain_validate.c |  2 +-
 src/conf/snapshot_conf.c   | 12 ++++++------
 src/qemu/qemu_domain.c     |  2 +-
 src/qemu/qemu_snapshot.c   | 12 ++++++------
 src/test/test_driver.c     |  4 ++--
 src/vz/vz_sdk.c            |  2 +-
 8 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 721623129c..58fe24a8c1 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -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));
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 5f6b508e89..a4de46773c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -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,

diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index f0b8aa2655..d6869e8fd8 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -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;
diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index a4b3cd8c2b..f5ae2ee212 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -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;

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 6b61fefb8f..936a0c8a35 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -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)) {
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 355a2fd782..c5fc7dcf67 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -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;
     }
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 4eca5c4a65..da1c6c8f6e 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -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;
     }

diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index f149360c03..43d528820e 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -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",
-- 
2.35.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux