From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbkkC-0006jj-7X for qemu-devel@nongnu.org; Tue, 15 Sep 2015 03:33:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zbkk7-0004gL-8P for qemu-devel@nongnu.org; Tue, 15 Sep 2015 03:33:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zbkk7-0004gE-3e for qemu-devel@nongnu.org; Tue, 15 Sep 2015 03:33:31 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 7C850157773 for ; Tue, 15 Sep 2015 07:33:30 +0000 (UTC) Message-ID: <1442302408.2895.8.camel@redhat.com> From: Gerd Hoffmann Date: Tue, 15 Sep 2015 09:33:28 +0200 In-Reply-To: <55F70E9E.3020603@redhat.com> References: <1441797654-15350-1-git-send-email-kraxel@redhat.com> <1441797654-15350-6-git-send-email-kraxel@redhat.com> <55F70E9E.3020603@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/9] virtio-gpu: add 3d mode and virgl rendering support. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" Hi, > > + virtio_gpu_cleanup_mapping_iov(res_iovs, num_iovs); > > Is res_iovs leaked here? Oops, yes. Moving the iov release to virtio_gpu_cleanup_mapping_iov (so things is symmetrical to virtio_gpu_create_mapping_iov which allocates it), that'll fix it. > > + pixels = s->current_cursor->width * s->current_cursor->height; > > + memcpy(s->current_cursor->data, data, pixels * sizeof(uint32_t)); > > + free(data); > > width and height are unused; should they be compared against > s->current_cursor->{width,height} to spot discrepancies? Added. > > +static void virtio_gpu_set_features(VirtIODevice *vdev, uint64_t features) > > +{ > > + static const uint32_t virgl = (1 << VIRTIO_GPU_FEATURE_VIRGL); > > + VirtIOGPU *g = VIRTIO_GPU(vdev); > > + > > + g->use_virgl_renderer = ((features & virgl) == virgl); > > Could a non-well-behaving guest just set this feature bit even if it was > not reported by virtio_gpu_get_features() because it has been disabled? I'm pretty sure virtio core doesn't allow this. cheers, Gerd