]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_driver: add validation of potential dependencies on cold plug
authorAdam Julis <ajulis@redhat.com>
Mon, 17 Jun 2024 13:51:53 +0000 (15:51 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 18 Jun 2024 06:46:28 +0000 (08:46 +0200)
Although virDomainDeviceDefValidate() is called as a part of
parsing device XML routine, it validates only that single device.
The virDomainDefValidate() function performs a more comprehensive
check. It should detect errors resulting from dependencies
between devices, or a device and some other part of XML config.
Therefore, a call to virDomainDefValidate() is added at the end
of qemuDomainAttachDeviceConfig().

Signed-off-by: Adam Julis <ajulis@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_driver.c

index e2698c792462717fbe5b413712bfb8e3bc86780f..67b9778c67470ef475656ce2b6b6e0b31fe4291a 100644 (file)
@@ -6869,6 +6869,9 @@ qemuDomainAttachDeviceConfig(virDomainDef *vmdef,
     if (virDomainDefPostParse(vmdef, parse_flags, xmlopt, qemuCaps) < 0)
         return -1;
 
+    if (virDomainDefValidate(vmdef, parse_flags, xmlopt, qemuCaps) < 0)
+        return -1;
+
     return 0;
 }