Blame SOURCES/0030-resource-Fix-ovirt_resource_init_from_xml_real-preco.patch

546e1e
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
546e1e
From: Christophe Fergeau <cfergeau@redhat.com>
546e1e
Date: Mon, 11 Sep 2017 15:01:59 +0200
546e1e
Subject: [PATCH] resource: Fix ovirt_resource_init_from_xml_real precondition
546e1e
546e1e
When ovirt_resource_init_from_xml_real is called, the current value of
546e1e
OvirtResource::xml-node is not very relevant, what matters is whether
546e1e
the passed in xml node is NULL or not.
546e1e
546e1e
This updates the test-govirt test case to call
546e1e
ovirt_resource_refresh(ovirt_vm_get_cluster()) as this triggers this
546e1e
precondition failure.
546e1e
---
546e1e
 govirt/ovirt-resource.c | 2 +-
546e1e
 1 file changed, 1 insertion(+), 1 deletion(-)
546e1e
546e1e
diff --git a/govirt/ovirt-resource.c b/govirt/ovirt-resource.c
546e1e
index 0f4a129..ad5e8ca 100644
546e1e
--- a/govirt/ovirt-resource.c
546e1e
+++ b/govirt/ovirt-resource.c
546e1e
@@ -422,7 +422,7 @@ static gboolean ovirt_resource_init_from_xml_real(OvirtResource *resource,
546e1e
      */
546e1e
     is_api = OVIRT_IS_API(resource);
546e1e
 
546e1e
-    g_return_val_if_fail(resource->priv->xml != NULL, FALSE);
546e1e
+    g_return_val_if_fail(node != NULL, FALSE);
546e1e
 
546e1e
     guid = rest_xml_node_get_attr(node, "id");
546e1e
     if ((guid == NULL) && !is_api) {