[libvirt] [libvirt-glib] config: Fix typo preventing clock removal from a domain

Commit 1c8ce29 added a way to unset a GVirConfigDomainClock set on a GVirConfigDomain by calling gvir_config_domain_set_clock() with a NULL argument. However, a typo in a g_return_if_fail precondition prevents this code from ever being called: g_return_if_fail(clock != NULL) is used while it should have been g_return_if_fail(clock == NULL) as in all other preconditions in 1c8ce29. --- libvirt-gconfig/libvirt-gconfig-domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c b/libvirt-gconfig/libvirt-gconfig-domain.c index 3c28a4a..6cd2f86 100644 --- a/libvirt-gconfig/libvirt-gconfig-domain.c +++ b/libvirt-gconfig/libvirt-gconfig-domain.c @@ -552,7 +552,7 @@ void gvir_config_domain_set_clock(GVirConfigDomain *domain, GVirConfigDomainClock *klock) { g_return_if_fail(GVIR_CONFIG_IS_DOMAIN(domain)); - g_return_if_fail(klock != NULL || GVIR_CONFIG_IS_DOMAIN_CLOCK(klock)); + g_return_if_fail(klock == NULL || GVIR_CONFIG_IS_DOMAIN_CLOCK(klock)); gvir_config_object_attach_replace(GVIR_CONFIG_OBJECT(domain), "clock", -- 1.8.4.2

On Fri, Dec 06, 2013 at 12:10:29PM +0100, Christophe Fergeau wrote:
Commit 1c8ce29 added a way to unset a GVirConfigDomainClock set on a GVirConfigDomain by calling gvir_config_domain_set_clock() with a NULL argument. However, a typo in a g_return_if_fail precondition prevents this code from ever being called: g_return_if_fail(clock != NULL) is used while it should have been g_return_if_fail(clock == NULL) as in all other preconditions in 1c8ce29.
Ping? Christophe

On Thu, Jan 2, 2014 at 11:03 AM, Christophe Fergeau <cfergeau@redhat.com> wrote:
On Fri, Dec 06, 2013 at 12:10:29PM +0100, Christophe Fergeau wrote:
Commit 1c8ce29 added a way to unset a GVirConfigDomainClock set on a GVirConfigDomain by calling gvir_config_domain_set_clock() with a NULL argument. However, a typo in a g_return_if_fail precondition prevents this code from ever being called: g_return_if_fail(clock != NULL) is used while it should have been g_return_if_fail(clock == NULL) as in all other preconditions in 1c8ce29.
ACK Zeeshan Ali (Khattak) FSF member#5124
participants (2)
-
Christophe Fergeau
-
Zeeshan Ali (Khattak)