From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhdVU-0007z9-JG for qemu-devel@nongnu.org; Fri, 15 Jul 2011 04:12:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QhdVS-0000O3-D4 for qemu-devel@nongnu.org; Fri, 15 Jul 2011 04:12:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhdVR-0000Nz-TL for qemu-devel@nongnu.org; Fri, 15 Jul 2011 04:12:18 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6F8CGY4003433 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 15 Jul 2011 04:12:16 -0400 Message-ID: <4E1FF65E.3040701@redhat.com> Date: Fri, 15 Jul 2011 10:12:14 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1310670801-14687-1-git-send-email-alevy@redhat.com> <1310670801-14687-10-git-send-email-alevy@redhat.com> In-Reply-To: <1310670801-14687-10-git-send-email-alevy@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv5 09/12] qxl: async io support using new spice api List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alon Levy Cc: yhalperi@redhat.com, qemu-devel@nongnu.org > case QXL_IO_DESTROY_PRIMARY: > if (val != 0) { > - qxl_guest_bug(d, "QXL_IO_DESTROY_PRIMARY: val != 0"); > - break; > + qxl_guest_bug(d, "QXL_IO_DESTROY_PRIMARY (async=%d): val != 0", > + async); > + goto cancel_async; > + } > + dprint(d, 1, "QXL_IO_DESTROY_PRIMARY (async=%d) (%s)\n", async, > + qxl_mode_to_string(d->mode)); > + qxl_destroy_primary(d, async); > +#if SPICE_INTERFACE_QXL_MINOR>= 1 > + if (d->mode == QXL_MODE_UNDEFINED&& async == QXL_ASYNC) { > + dprint(d, 1, "QXL_IO_DESTROY_PRIMARY_ASYNC in %s, ignored\n", > + qxl_mode_to_string(d->mode)); > + qxl_send_events(d, QXL_INTERRUPT_IO_CMD); > + goto cancel_async; > } Hmm? Why this is needed? > default: > fprintf(stderr, "%s: ioport=0x%x, abort()\n", __FUNCTION__, io_port); > abort(); > } > + return; > +cancel_async: > +#if SPICE_INTERFACE_QXL_MINOR>= 1 > + if (async) { > + qemu_mutex_lock(&d->async_lock); > + d->current_async = QXL_UNDEFINED_IO; > + qemu_mutex_unlock(&d->async_lock); Add "qxl_send_events(d, QXL_INTERRUPT_IO_CMD)" here? > typedef struct PCIQXLDevice { > PCIDevice pci; > SimpleSpiceDisplay ssd; > @@ -30,6 +32,11 @@ typedef struct PCIQXLDevice { > int32_t num_memslots; > int32_t num_surfaces; > > +#if SPICE_INTERFACE_QXL_MINOR>= 1 > + uint32_t current_async; > + QemuMutex async_lock; > +#endif No need to ifdef this. cheers, Gerd