Received: from eggs.gnu.org ([2001:4830:134:3::10]:41887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biKHH-0008UX-K4 for qemu-devel@nongnu.org; Fri, 09 Sep 2016 07:47:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biKHD-0004LX-E5 for qemu-devel@nongnu.org; Fri, 09 Sep 2016 07:47:26 -0400 References: <1473416072-7063-1-git-send-email-maxime.coquelin@redhat.com> <1473416072-7063-2-git-send-email-maxime.coquelin@redhat.com> <20160909123348.4779e59c.cornelia.huck@de.ibm.com> <20160909125536.3af41223.cornelia.huck@de.ibm.com> <74bd31bc-a4ce-295a-b138-f9ae872a618a@redhat.com> <20160909132011.7b84d4ca.cornelia.huck@de.ibm.com> From: Marcel Apfelbaum Message-ID: <7bb07837-e471-bee6-0dd0-a6b8a8459f05@redhat.com> Date: Fri, 9 Sep 2016 14:47:00 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] virtio: Add backend feature testing functionnality List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Maxime Coquelin , Cornelia Huck Cc: mst@redhat.com, qemu-devel@nongnu.org, vkaplans@redhat.com, qemu-stable@nongnu.org On 09/09/2016 02:36 PM, Maxime Coquelin wrote: > > > On 09/09/2016 01:20 PM, Cornelia Huck wrote: >> On Fri, 9 Sep 2016 14:02:17 +0300 >> Marcel Apfelbaum wrote: >> >>> I was thinking to keep the same function proposed by Maxime and change it to negate things: >>> >>> /* >>> * A missing feature before all negotiations finished will still be missing at the end. >>> */ >>> bool virtio_test_backend_unsupported_feature(VirtIODevice *vdev, >>> unsigned int fbit, Error **errp) >>> { >>> VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); >>> uint64_t feature; >>> >>> virtio_add_feature(&feature, fbit); >>> >>> assert(k->get_features != NULL); >>> feature = k->get_features(vdev, feature, errp); >>> >>> return !virtio_has_feature(feature, fbit); >>> } >>> >>> We only check if the feature was not there from the start. >> >> I think you'll still end up with the same problem (overindicating >> unsupportedness), as you start out with an otherwise empty feature >> set, causing features with dependencies to be removed. I fear that >> anything starting with an incomplete feature list will have that >> problem. >> >> Maybe it would be better to limit this to the one bit we currently want >> to test (VERSION_1)? We know the semantics of that one. Less general, >> but also less headaches. > > Yes, that could be the solution. > I agree that making it too generic might create confusion > with some features. > Sounds good to me. Let's go with it and we'll re-think it if we'll find other feature negotiation issues later. Thanks, Marcel > Thanks, > Maxime >