/* This checks wui_gthread global which is actually set in the
* main thread. Of course, it might not be set if the WUI thread
- * runs first. Hence we yield for the main thread to run.
+ * runs first. Hence we sleep for the main thread to run. (XXX)
*/
- g_thread_yield ();
+ g_usleep (100000);
ASSERT_IS_WUI_THREAD ();
g_async_queue_ref (queue);
vm2 = g_memdup (vm, sizeof (*vm));
vm2->description = g_strdup (vm->description);
+ vm2->uuid = g_strdup (vm->uuid);
vm2->state = vm->state ? g_strdup (vm->state) : NULL;
- vm2->uuid = vm->uuid ? g_strdup (vm->uuid) : NULL;
vm2->mac_addr = vm->mac_addr ? g_strdup (vm->mac_addr) : NULL;
return vm2;
}
char *error_str;
GSList *new_vmlist = NULL;
struct vm *vm;
+ int len;
/*DEBUG ("XML =\n%s", xml);*/
ASSERT_IS_WUI_THREAD ();
/* We don't really expect that we won't be able to parse the XML ... */
- doc = xmlParseDoc ((const xmlChar *) xml);
+ len = strlen (xml);
+ doc = xmlReadMemory (xml, len, NULL, NULL, 0);
+
if (!doc) {
DEBUG ("error parsing XML document, xml =\n%s", xml);
error_str = g_strdup ("error parsing XML document from remote server");
DEBUG ("required field \"description\" missing from <vm> structure");
else if (vm.vnc_port == -1)
DEBUG ("required field \"vnc-port\" missing from <vm> structure");
+ else if (vm.uuid == NULL)
+ DEBUG ("required field \"uuid\" missing from <vm> structure");
else
ret = g_memdup (&vm, sizeof vm);