From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88162C433FE for ; Wed, 9 Dec 2020 19:57:50 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3AC71239D1 for ; Wed, 9 Dec 2020 19:57:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3AC71239D1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kn5av-0007Og-AZ for qemu-devel@archiver.kernel.org; Wed, 09 Dec 2020 14:57:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kn4V0-0003hE-IE for qemu-devel@nongnu.org; Wed, 09 Dec 2020 13:47:40 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59225) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kn4Uu-0003cI-8a for qemu-devel@nongnu.org; Wed, 09 Dec 2020 13:47:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607539651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Yrfjyaqj4L5BFqPSfVQQDLQ7l1oJGf/95/9z1Mukkqs=; b=fp6f7nL/ZbpJdJKA1dl9PGT7FsdYh2srTX6DNSoMrgyfqA1HRJA4JErugcsKvsdZS6J77d vFeFmOvLavFpQDDh7NX/cRa6DloVubIxfO3YH2JAP0ZfnRTs6xQtNAc3SCicAnt0UC+TtK oE7aY+hLE7NwRAGdQQCL7dLqb21Q/Gc= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-234-n8cN-dW_MkSJ8GSjvavcuA-1; Wed, 09 Dec 2020 13:47:27 -0500 X-MC-Unique: n8cN-dW_MkSJ8GSjvavcuA-1 Received: by mail-qt1-f199.google.com with SMTP id a11so863431qto.16 for ; Wed, 09 Dec 2020 10:47:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Yrfjyaqj4L5BFqPSfVQQDLQ7l1oJGf/95/9z1Mukkqs=; b=N2BnP5gKEUnOdbvSewVMtNAWNToY8obGPNtTr8ievVzmC2SSxxirqjNqtnUoDR2RtU Q+ga0jLiQWXdHYefTLMQh5k5vbuEdsWHcRFCv9Mb3HpnBFhi73ykfmVoRcyUb1yBQW2e eztpY2iY1HatfiFq/WdmOZquKLztD0zHuPVNoMaWg5Isjmtrn5oNqVmeZZbiOoRZkfCY 4BPrba/8ctPGY4v1oOH9Nl4OzoExRTsMqQi7u3EwFbFA5PESYVLtmQMUMHPy3gKWspCX zEzEMvryi2LEf83u5Ui2+5awR5qKtHpnt3P88qteyc2rKgR4knhuyeqM5+MMch+YfN29 b+FA== X-Gm-Message-State: AOAM531F+9975MHYpiDChEG03U0yYaSG+PEgLuSxQjfQNeHah9119voS 5WzSfbuL5lgoGuK6VO5rOsiC+rDj7IShbuUTP3oxnb0bm0NrgPUS3ZGtSjfp5HGz9UB2dQCeY7S MYmW//n8R26lUkZSxHobAQKH8t/j6BYo= X-Received: by 2002:aed:2742:: with SMTP id n60mr4678346qtd.221.1607539647093; Wed, 09 Dec 2020 10:47:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGw7c+xnc6N0H9X/g1O8JWP6r/KrIswT9lVGNbdosIwMEkBtS/32ZQWoZKrT4z06MWCEuozyqQRgwYBZN7ig8= X-Received: by 2002:aed:2742:: with SMTP id n60mr4678306qtd.221.1607539646912; Wed, 09 Dec 2020 10:47:26 -0800 (PST) MIME-Version: 1.0 References: <20201120185105.279030-1-eperezma@redhat.com> <20201120185105.279030-17-eperezma@redhat.com> <20201208082552.GT203660@stefanha-x1.localdomain> In-Reply-To: <20201208082552.GT203660@stefanha-x1.localdomain> From: Eugenio Perez Martin Date: Wed, 9 Dec 2020 19:46:49 +0100 Message-ID: Subject: Re: [RFC PATCH 16/27] virtio: Expose virtqueue_alloc_element To: Stefan Hajnoczi Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eperezma@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=63.128.21.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm list , "Michael S. Tsirkin" , Jason Wang , qemu-level , Daniel Daly , virtualization@lists.linux-foundation.org, Liran Alon , Eli Cohen , Nitin Shrivastav , Alex Barba , Christophe Fontaine , Juan Quintela , Lee Ballard , Lars Ganrot , Rob Miller , Stefano Garzarella , Howard Cai , Parav Pandit , vm , Salil Mehta , Stephen Finucane , Xiao W Wang , Sean Mooney , Stefan Hajnoczi , Jim Harford , Dmytro Kazantsev , Siwei Liu , Harpreet Singh Anand , Michael Lilja , Max Gurtovoy Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, Dec 8, 2020 at 9:26 AM Stefan Hajnoczi wrote: > > On Fri, Nov 20, 2020 at 07:50:54PM +0100, Eugenio P=C3=A9rez wrote: > > Specify VirtQueueElement * as return type makes no harm at this moment. > > The reason for the void * return type is that C implicitly converts void > pointers to pointers of any type. The function takes a size_t sz > argument so it can allocate a object of user-defined size. The idea is > that the user's struct embeds a VirtQueueElement field. Changing the > return type to VirtQueueElement * means that callers may need to > explicitly cast to the user's struct type. > > It's a question of coding style but I think the void * return type > communicates what is going on better than VirtQueueElement *. Right, what I meant with that is that nobody uses that feature, but I just re-check and I saw that contrib/vhost-user-blk actually uses it (not checked for more uses). I think it is better just to drop this commit. Thanks!