]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: domain: Remove VIR_DOMAIN_DEF_PARSE_DISK_SOURCE parser flag
authorPeter Krempa <pkrempa@redhat.com>
Wed, 14 Apr 2021 16:04:31 +0000 (18:04 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 19 Apr 2021 12:43:59 +0000 (14:43 +0200)
There's no code which would assert it at this point. Remove the flag.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c
src/conf/domain_conf.h

index 1793032301629e56b3f072c5f1e7fa450a9124db..3f32e046f350003f59d732e8948dd589c7307958 100644 (file)
@@ -9603,14 +9603,13 @@ virDomainDiskDefParseXML(virDomainXMLOption *xmlopt,
      * to indicate no media present. LUN is for raw access CD-ROMs
      * that are not attached to a physical device presently */
     if (virStorageSourceIsEmpty(def->src) &&
-        (def->device == VIR_DOMAIN_DISK_DEVICE_DISK ||
-         (flags & VIR_DOMAIN_DEF_PARSE_DISK_SOURCE))) {
+        def->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
         virReportError(VIR_ERR_NO_SOURCE,
                        target ? "%s" : NULL, target);
         return NULL;
     }
 
-    if (!target && !(flags & VIR_DOMAIN_DEF_PARSE_DISK_SOURCE)) {
+    if (!target) {
         if (def->src->srcpool) {
             tmp = g_strdup_printf("pool = '%s', volume = '%s'",
                                   def->src->srcpool->pool, def->src->srcpool->volume);
@@ -9623,29 +9622,27 @@ virDomainDiskDefParseXML(virDomainXMLOption *xmlopt,
         return NULL;
     }
 
-    if (!(flags & VIR_DOMAIN_DEF_PARSE_DISK_SOURCE)) {
-        if (def->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY &&
-            !STRPREFIX(target, "fd")) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Invalid floppy device name: %s"), target);
-            return NULL;
-        }
+    if (def->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY &&
+        !STRPREFIX(target, "fd")) {
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("Invalid floppy device name: %s"), target);
+        return NULL;
+    }
 
-        /* Force CDROM to be listed as read only */
-        if (def->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
-            def->src->readonly = true;
+    /* Force CDROM to be listed as read only */
+    if (def->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
+        def->src->readonly = true;
 
-        if ((def->device == VIR_DOMAIN_DISK_DEVICE_DISK ||
-             def->device == VIR_DOMAIN_DISK_DEVICE_LUN) &&
-            !STRPREFIX((const char *)target, "hd") &&
-            !STRPREFIX((const char *)target, "sd") &&
-            !STRPREFIX((const char *)target, "vd") &&
-            !STRPREFIX((const char *)target, "xvd") &&
-            !STRPREFIX((const char *)target, "ubd")) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Invalid harddisk device name: %s"), target);
-            return NULL;
-        }
+    if ((def->device == VIR_DOMAIN_DISK_DEVICE_DISK ||
+         def->device == VIR_DOMAIN_DISK_DEVICE_LUN) &&
+        !STRPREFIX((const char *)target, "hd") &&
+        !STRPREFIX((const char *)target, "sd") &&
+        !STRPREFIX((const char *)target, "vd") &&
+        !STRPREFIX((const char *)target, "xvd") &&
+        !STRPREFIX((const char *)target, "ubd")) {
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("Invalid harddisk device name: %s"), target);
+        return NULL;
     }
 
     if (snapshot) {
@@ -9686,7 +9683,7 @@ virDomainDiskDefParseXML(virDomainXMLOption *xmlopt,
     } else {
         if (def->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
             def->bus = VIR_DOMAIN_DISK_BUS_FDC;
-        } else if (!(flags & VIR_DOMAIN_DEF_PARSE_DISK_SOURCE)) {
+        } else {
             if (STRPREFIX(target, "hd"))
                 def->bus = VIR_DOMAIN_DISK_BUS_IDE;
             else if (STRPREFIX(target, "sd"))
index 83b92889410d77926408fc58576721e8e41c9482..1a2e0fc872a8f7b89306436f498b77890d1f96c7 100644 (file)
@@ -3353,25 +3353,23 @@ typedef enum {
     VIR_DOMAIN_DEF_PARSE_ALLOW_ROM       = 1 << 4,
     /* internal flag passed to device info sub-parser to allow specifying boot order */
     VIR_DOMAIN_DEF_PARSE_ALLOW_BOOT      = 1 << 5,
-    /* parse only source half of <disk> */
-    VIR_DOMAIN_DEF_PARSE_DISK_SOURCE     = 1 << 6,
     /* perform RNG schema validation on the passed XML document */
-    VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA = 1 << 7,
+    VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA = 1 << 6,
     /* allow updates in post parse callback that would break ABI otherwise */
-    VIR_DOMAIN_DEF_PARSE_ABI_UPDATE = 1 << 8,
+    VIR_DOMAIN_DEF_PARSE_ABI_UPDATE = 1 << 7,
     /* skip definition validation checks meant to be executed on define time only */
-    VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE = 1 << 9,
+    VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE = 1 << 8,
     /* skip parsing of security labels */
-    VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL        = 1 << 10,
+    VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL        = 1 << 9,
     /* Allows updates in post parse callback for incoming persistent migration
      * that would break ABI otherwise.  This should be used only if it's safe
      * to do such change. */
-    VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION = 1 << 11,
+    VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION = 1 << 10,
     /* Allows to ignore certain failures in the post parse callbacks, which
      * may happen due to missing packages and can be fixed by re-running the
      * post parse callbacks before starting. Failure of the post parse callback
      * is recorded as def->postParseFail */
-    VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL = 1 << 12,
+    VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL = 1 << 11,
 } virDomainDefParseFlags;
 
 typedef enum {