]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domain_validate: Move virDomainCheckVirtioOptionsAreAbsent() a few lines forward
authorKristina Hanicova <khanicov@redhat.com>
Wed, 10 Mar 2021 16:42:50 +0000 (17:42 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 18 Mar 2021 14:03:01 +0000 (15:03 +0100)
Move this function in order to use it in the next patch before
its previous declaration.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_validate.c

index ceefe18ac46f16048c8593b8ed31046530f7b113..fc97fdffb935936550858abe179d60d4fa1ebcb3 100644 (file)
@@ -78,6 +78,34 @@ virDomainDefVideoValidate(const virDomainDef *def)
 }
 
 
+static int
+virDomainCheckVirtioOptionsAreAbsent(virDomainVirtioOptionsPtr virtio)
+{
+    if (!virtio)
+        return 0;
+
+    if (virtio->iommu != VIR_TRISTATE_SWITCH_ABSENT) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("iommu driver option is only supported "
+                         "for virtio devices"));
+        return -1;
+    }
+    if (virtio->ats != VIR_TRISTATE_SWITCH_ABSENT) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("ats driver option is only supported "
+                         "for virtio devices"));
+        return -1;
+    }
+    if (virtio->packed != VIR_TRISTATE_SWITCH_ABSENT) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("packed driver option is only supported "
+                         "for virtio devices"));
+        return -1;
+    }
+    return 0;
+}
+
+
 static int
 virDomainVideoDefValidate(const virDomainVideoDef *video,
                           const virDomainDef *def)
@@ -236,34 +264,6 @@ virSecurityDeviceLabelDefValidate(virSecurityDeviceLabelDefPtr *seclabels,
 }
 
 
-static int
-virDomainCheckVirtioOptionsAreAbsent(virDomainVirtioOptionsPtr virtio)
-{
-    if (!virtio)
-        return 0;
-
-    if (virtio->iommu != VIR_TRISTATE_SWITCH_ABSENT) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("iommu driver option is only supported "
-                         "for virtio devices"));
-        return -1;
-    }
-    if (virtio->ats != VIR_TRISTATE_SWITCH_ABSENT) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("ats driver option is only supported "
-                         "for virtio devices"));
-        return -1;
-    }
-    if (virtio->packed != VIR_TRISTATE_SWITCH_ABSENT) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("packed driver option is only supported "
-                         "for virtio devices"));
-        return -1;
-    }
-    return 0;
-}
-
-
 static int
 virDomainDiskVhostUserValidate(const virDomainDiskDef *disk)
 {