]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
XML validate that 'ramfb' has no address
authorKristina Hanicova <khanicov@redhat.com>
Fri, 5 Mar 2021 12:01:21 +0000 (13:01 +0100)
committerJán Tomko <jtomko@redhat.com>
Wed, 10 Mar 2021 19:07:09 +0000 (20:07 +0100)
With this, XML fails if config video type 'ramfb' contains
address, since address is not supported for 'ramfb' video
devices. Previously it didn't raise error.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1891416
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/conf/domain_validate.c

index 00e02165472e2667118be5ed73fa4af879dd1c8c..ceefe18ac46f16048c8593b8ed31046530f7b113 100644 (file)
@@ -151,6 +151,14 @@ virDomainVideoDefValidate(const virDomainVideoDef *video,
         }
     }
 
+    if (video->type == VIR_DOMAIN_VIDEO_TYPE_RAMFB) {
+        if (video->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("address not supported for video type ramfb"));
+            return -1;
+        }
+    }
+
     return 0;
 }