X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=wui_thread.c;fp=wui_thread.c;h=2500ccb8d4e83bad53b36a564a5b513439de96c6;hb=0b9477affd8b7978768ee76bc5631adbec3a2dcf;hp=060c7a24e54e167f65dee5a995e3a366a94b5d39;hpb=53c851e51c855a0493481881807d6fd8777cda93;p=ovirt-viewer.git diff --git a/wui_thread.c b/wui_thread.c index 060c7a2..2500ccb 100644 --- a/wui_thread.c +++ b/wui_thread.c @@ -245,9 +245,9 @@ wui_thread (gpointer _queue) /* 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); @@ -798,8 +798,8 @@ copy_vm (struct vm *vm) 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; } @@ -878,12 +878,15 @@ parse_vmlist_from_xml (const char *xml) 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"); @@ -1062,6 +1065,8 @@ parse_vm_from_xml (xmlNodePtr node) DEBUG ("required field \"description\" missing from structure"); else if (vm.vnc_port == -1) DEBUG ("required field \"vnc-port\" missing from structure"); + else if (vm.uuid == NULL) + DEBUG ("required field \"uuid\" missing from structure"); else ret = g_memdup (&vm, sizeof vm);