From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qejge-0001gK-QI for qemu-devel@nongnu.org; Thu, 07 Jul 2011 04:11:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qejgd-0005jA-J4 for qemu-devel@nongnu.org; Thu, 07 Jul 2011 04:11:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58110) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qejgd-0005j3-20 for qemu-devel@nongnu.org; Thu, 07 Jul 2011 04:11:51 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p678Bnpl018948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Jul 2011 04:11:49 -0400 Date: Thu, 7 Jul 2011 10:11:42 +0200 From: Alon Levy Message-ID: <20110707081142.GR20603@bow.redhat.com> References: <1309954766-9728-1-git-send-email-alevy@redhat.com> <1309954766-9728-14-git-send-email-alevy@redhat.com> <4E1564A8.60403@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E1564A8.60403@redhat.com> Subject: Re: [Qemu-devel] [PATCH] qxl: async I/O List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: yhalperi@redhat.com, qemu-devel@nongnu.org On Thu, Jul 07, 2011 at 09:47:52AM +0200, Gerd Hoffmann wrote: > Hi, > > >+void qxl_spice_update_area_async(PCIQXLDevice *qxl, uint32_t surface_id, > >+ struct QXLRect *area, struct QXLRect *dirty_rects, > >+ uint32_t num_dirty_rects, uint32_t clear_dirty_region, > >+ int async) > >+{ > >+ qemu_mutex_lock(&qxl->ssd.wlock); > >+ if (async) { > >+ qxl->ssd.worker->update_area_async(qxl->ssd.worker, surface_id, area, dirty_rects, > >+ num_dirty_rects, clear_dirty_region); > >+ } else { > >+ qxl->ssd.worker->update_area(qxl->ssd.worker, surface_id, area, dirty_rects, > >+ num_dirty_rects, clear_dirty_region); > >+ } > >+ qemu_mutex_unlock(&qxl->ssd.wlock); > >+} > > We need a plan to handle backward compatibility here. Older > libspice-server versions don't have the update_area_async op. > Option one is to just not support async mode with older libraries. > Option two is to handle the request syncronously even though the > guest has asked for async. I'd tend to pick option one, that makes > things easier with S3 support because we just can't do that in any > way with an older libspice-server. will do. > > > switch (io_port) { > >+ case QXL_IO_UPDATE_AREA_ASYNC: > >+ case QXL_IO_NOTIFY_OOM_ASYNC: > >+ case QXL_IO_MEMSLOT_ADD_ASYNC: > >+ case QXL_IO_CREATE_PRIMARY_ASYNC: > >+ case QXL_IO_DESTROY_PRIMARY_ASYNC: > >+ case QXL_IO_DESTROY_SURFACE_ASYNC: > >+ case QXL_IO_DESTROY_ALL_SURFACES_ASYNC: > >+ async = 1; > >+ if (d->current_async != QXL_UNDEFINED_IO) { > >+ qxl_guest_bug(d, "%d async started before last (%d) complete\n", > >+ io_port, d->current_async); > > Better return here, ignoring the invalid request? I wasn't sure. Both are bound to be buggy. But yeah, I guess returning at least makes qemu correct (especially if I don't use the cookies to remember all outstanding operations). > > cheers, > Gerd