qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Albert Esteve <aesteve@redhat.com>
Cc: qemu-devel@nongnu.org, marcandre.lureau@gmail.com,
	kraxel@redhat.com, cohuck@redhat.com, Fam Zheng <fam@euphon.net>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v5 2/4] virtio-dmabuf: introduce virtio-dmabuf
Date: Wed, 6 Sep 2023 11:16:29 +0200	[thread overview]
Message-ID: <579322f6-be00-f030-1eec-8c051c6c93fc@linaro.org> (raw)
In-Reply-To: <CADSE00Jq9iJDD7ojjth4eyU=fxVvjexWp8AYKZyDZT8ZrJyDHQ@mail.gmail.com>

On 6/9/23 10:45, Albert Esteve wrote:

>          > diff --git a/include/hw/virtio/virtio-dmabuf.h
>         b/include/hw/virtio/virtio-dmabuf.h
>          > new file mode 100644
>          > index 0000000000..536e622555
>          > --- /dev/null
>          > +++ b/include/hw/virtio/virtio-dmabuf.h
>          > @@ -0,0 +1,103 @@
>          > +/*
>          > + * Virtio Shared dma-buf
>          > + *
>          > + * Copyright Red Hat, Inc. 2023
>          > + *
>          > + * Authors:
>          > + *     Albert Esteve <aesteve@redhat.com
>         <mailto:aesteve@redhat.com>>
>          > + *
>          > + * This work is licensed under the terms of the GNU GPL,
>         version 2.
>          > + * See the COPYING file in the top-level directory.
>          > + */
>          > +
>          > +#ifndef VIRTIO_DMABUF_H
>          > +#define VIRTIO_DMABUF_H
>          > +
>          > +#include "qemu/osdep.h"
>          > +
>          > +#include <glib.h>
>          > +#include "qemu/uuid.h"
>          > +#include "vhost.h"
>          > +
>          > +enum SharedObjectType {
>          > +    TYPE_INVALID = 0,
>          > +    TYPE_DMABUF,
>          > +    TYPE_VHOST_DEV,
>          > +};
>          > +
> 
>         Please declare a
> 
>         typedef
> 
>          > +struct VirtioSharedObject {
>          > +    enum SharedObjectType type;
>          > +    gpointer value;
>          > +};
> 
>         VirtioSharedObject;
> 
>         and use it instead of 'struct VirtioSharedObject'.
> 
> 
>     You mean making the struct anonymous and typedefing?
> 
> 
> So after re-reading your comment and looking for more examples in the 
> codebase, I see
> it is not uncommon to have a named struct also typedef in the same 
> declaration.
> So I will typedef, but not make it anonymous, same for the enum.

Correct (see https://qemu-project.gitlab.io/qemu/devel/style.html#typedefs

>     Should I do the same with the enum? In other files I see enums are
>     typedef too, but not anonymous (e.g., block/qcow2.h).
>     So I could do the same here.
> 
>     For the rest... Ack!

Thanks!

Phil.



  reply	other threads:[~2023-09-06  9:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02  9:08 [PATCH v5 0/4] Virtio shared dma-buf Albert Esteve
2023-08-02  9:08 ` [PATCH v5 1/4] uuid: add a hash function Albert Esteve
2023-09-06  5:06   ` Philippe Mathieu-Daudé
2023-08-02  9:08 ` [PATCH v5 2/4] virtio-dmabuf: introduce virtio-dmabuf Albert Esteve
2023-09-06  5:56   ` Philippe Mathieu-Daudé
2023-09-06  7:42     ` Albert Esteve
2023-09-06  8:45       ` Albert Esteve
2023-09-06  9:16         ` Philippe Mathieu-Daudé [this message]
2023-08-02  9:08 ` [PATCH v5 3/4] vhost-user: add shared_object msg Albert Esteve
2023-09-06  6:04   ` Philippe Mathieu-Daudé
2023-09-06  6:09     ` Philippe Mathieu-Daudé
2023-09-06  6:54       ` Albert Esteve
2023-08-02  9:08 ` [PATCH v5 4/4] vhost-user: refactor send_resp code Albert Esteve
2023-09-06  6:11   ` Philippe Mathieu-Daudé
2023-08-21 12:37 ` [PATCH v5 0/4] Virtio shared dma-buf Albert Esteve
2023-09-05 20:45   ` Michael S. Tsirkin
2023-09-06  6:13     ` Philippe Mathieu-Daudé
2023-09-06  9:39       ` Albert Esteve
2023-09-06 10:16         ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=579322f6-be00-f030-1eec-8c051c6c93fc@linaro.org \
    --to=philmd@linaro.org \
    --cc=aesteve@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=fam@euphon.net \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).