[libvirt-glib 4/5] gconfig: Fix removal of GVirConfigCapabilitiesCpu topology

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]