]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Move validation check out of postparse
authorAndrea Bolognani <abologna@redhat.com>
Fri, 17 Mar 2023 10:19:04 +0000 (11:19 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Wed, 22 Mar 2023 12:49:53 +0000 (13:49 +0100)
Suggested-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_domain.c
src/qemu/qemu_validate.c

index 0a7b30fa6523a94b0201f6199294cd939c8f1d27..6c29c8f09fc5de10fb7fe165934681437721be78 100644 (file)
@@ -4474,12 +4474,6 @@ qemuDomainDefBootPostParse(virDomainDef *def,
 {
     bool abiUpdate = !!(parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE);
 
-    if (def->os.bootloader || def->os.bootloaderArgs) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("bootloader is not supported by QEMU"));
-        return -1;
-    }
-
     /* Firmware selection can fail for a number of reasons, but the
      * most likely one is that the requested configuration contains
      * mistakes or includes constraints that are impossible to
index 12128acda6b8801f53e7b8c33785676604f34d23..b2624c913157407aebe2a1a7182ed558637cacf1 100644 (file)
@@ -766,6 +766,12 @@ static int
 qemuValidateDomainDefBoot(const virDomainDef *def,
                           virQEMUCaps *qemuCaps)
 {
+    if (def->os.bootloader || def->os.bootloaderArgs) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("bootloader is not supported by QEMU"));
+        return -1;
+    }
+
     if (def->os.loader) {
         if (def->os.loader->secure == VIR_TRISTATE_BOOL_YES) {
             /* These are the QEMU implementation limitations. But we