static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worker) { static int count = 0; qxl_screen_t *qxl = container_of(sin, qxl_screen_t, display_sin); if (++count > 1) { dprint(qxl, 0, "%s ignored\n", __FUNCTION__); return; } dprint(qxl, 1, "%s:\n", __FUNCTION__); spice_qxl_add_memslot(sin, &slot); qxl->worker = qxl_worker; }
void qemu_spice_add_memslot(SimpleSpiceDisplay *ssd, QXLDevMemSlot *memslot, qxl_async_io async) { trace_qemu_spice_add_memslot(ssd->qxl.id, memslot->slot_id, memslot->virt_start, memslot->virt_end, async); if (async != QXL_SYNC) { spice_qxl_add_memslot_async(&ssd->qxl, memslot, (uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO, QXL_IO_MEMSLOT_ADD_ASYNC)); } else { spice_qxl_add_memslot(&ssd->qxl, memslot); } }
static void attache_worker(QXLInstance *qin, QXLWorker *_qxl_worker) { Test *test = SPICE_CONTAINEROF(qin, Test, qxl_instance); if (test->qxl_worker) { if (test->qxl_worker != _qxl_worker) printf("%s ignored, %p is set, ignoring new %p\n", __func__, test->qxl_worker, _qxl_worker); else printf("%s ignored, redundant\n", __func__); return; } printf("%s\n", __func__); test->qxl_worker = _qxl_worker; spice_qxl_add_memslot(&test->qxl_instance, &slot); create_primary_surface(test, DEFAULT_WIDTH, DEFAULT_HEIGHT); spice_server_vm_start(test->server); }