Calling gvir_config_capabilities_cpu_set_topology with a NULL topology
would not remove the topology as expected as NULL would be rejected by
this method preconditions.
---
libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c
b/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c
index 9245da9..f4753ff 100644
--- a/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c
+++ b/libvirt-gconfig/libvirt-gconfig-capabilities-cpu.c
@@ -179,7 +179,7 @@ gvir_config_capabilities_cpu_set_topology(GVirConfigCapabilitiesCpu
*cpu,
GVirConfigCapabilitiesCpuTopology *topology)
{
g_return_if_fail(GVIR_CONFIG_IS_CAPABILITIES_CPU(cpu));
- g_return_if_fail(GVIR_CONFIG_IS_CAPABILITIES_CPU_TOPOLOGY(topology));
+ g_return_if_fail(topology == NULL ||
GVIR_CONFIG_IS_CAPABILITIES_CPU_TOPOLOGY(topology));
gvir_config_object_attach_replace(GVIR_CONFIG_OBJECT(cpu),
"topology",
--
1.8.4.2