From 59f6e226bbc95d039b867b9e74d583a16dce1dc1 Mon Sep 17 00:00:00 2001 From: Adam Julis Date: Mon, 17 Jun 2024 15:51:53 +0200 Subject: [PATCH] qemu_driver: add validation of potential dependencies on cold plug 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 Reviewed-by: Michal Privoznik --- src/qemu/qemu_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e2698c7924..67b9778c67 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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; }