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