[PATCH] qemu: Check usage count of qemu:override node

Justin Gatzen posted 1 patch 2 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20220421014803.77482-1-justin.gatzen@gmail.com
src/qemu/qemu_domain.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] qemu: Check usage count of qemu:override node
Posted by Justin Gatzen 2 years ago
When <qemu:override> is the only usage of the qemu namespace the entire
section is mistakenly removed. Add check for use count.

Signed-off-by: Justin Gatzen <justin.gatzen@gmail.com>
---
 src/qemu/qemu_domain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 95134a3570..00c209313b 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3514,7 +3514,8 @@ qemuDomainDefNamespaceParse(xmlXPathContextPtr ctxt,
 
     if (nsdata->args || nsdata->num_env > 0 ||
         nsdata->capsadd || nsdata->capsdel ||
-        nsdata->deprecationBehavior)
+        nsdata->deprecationBehavior ||
+        nsdata->ndeviceOverride > 0)
         *data = g_steal_pointer(&nsdata);
 
     ret = 0;
-- 
2.35.1
Re: [PATCH] qemu: Check usage count of qemu:override node
Posted by Michal Prívozník 2 years ago
On 4/21/22 03:48, Justin Gatzen wrote:
> When <qemu:override> is the only usage of the qemu namespace the entire
> section is mistakenly removed. Add check for use count.
> 
> Signed-off-by: Justin Gatzen <justin.gatzen@gmail.com>
> ---
>  src/qemu/qemu_domain.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

and merged.

Michal