From: Stefan Hajnoczi <stefanha@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: Sebastien Boeuf <sebastien.boeuf@intel.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/4] libvhost-user: support many virtqueues
Date: Fri, 21 Jun 2019 17:27:12 +0100 [thread overview]
Message-ID: <20190621162712.GA10947@stefanha-x1.localdomain> (raw)
In-Reply-To: <CAMxuvaz64dd00mhoZ4QjOZ_eGPMw_WBJQN1tWS0ueUhpSsN1SQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]
On Fri, Jun 21, 2019 at 03:48:36PM +0200, Marc-André Lureau wrote:
> On Fri, Jun 21, 2019 at 11:40 AM Stefan Hajnoczi <stefanha@redhat.com> wrote:
> > diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c
> > index 86a3987744..ae61034656 100644
> > --- a/contrib/vhost-user-blk/vhost-user-blk.c
> > +++ b/contrib/vhost-user-blk/vhost-user-blk.c
> > @@ -25,6 +25,10 @@
> > #include <sys/ioctl.h>
> > #endif
> >
> > +enum {
> > + VHOST_USER_BLK_MAX_QUEUES = 8,
> > +};
>
> why do you use enum,(and not const int) ? (similarly for other devices)
>
> other than than
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This is how I was taught when I was a little boy.
With an actual variable there's a risk that the compiler reserves space
for a variable when you actually just need a constant. Whether modern
compilers do that or not, I don't know.
The type is clearer when a variable is used instead of an enum.
Pros and cons...
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-06-21 16:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-21 9:40 [Qemu-devel] [PATCH 0/4] libvhost-user: VHOST_USER_PROTOCOL_F_MQ support Stefan Hajnoczi
2019-06-21 9:40 ` [Qemu-devel] [PATCH 1/4] libvhost-user: add vmsg_set_reply_u64() helper Stefan Hajnoczi
2019-06-21 13:48 ` Marc-André Lureau
2019-06-21 9:40 ` [Qemu-devel] [PATCH 2/4] libvhost-user: support many virtqueues Stefan Hajnoczi
2019-06-21 13:48 ` Marc-André Lureau
2019-06-21 16:27 ` Stefan Hajnoczi [this message]
2019-06-21 9:40 ` [Qemu-devel] [PATCH 3/4] libvhost-user: implement VHOST_USER_PROTOCOL_F_MQ Stefan Hajnoczi
2019-06-21 13:48 ` Marc-André Lureau
2019-06-21 9:40 ` [Qemu-devel] [PATCH 4/4] docs: avoid vhost-user-net specifics in multiqueue section Stefan Hajnoczi
2019-06-21 13:52 ` Marc-André Lureau
2019-07-03 9:20 ` [Qemu-devel] [PATCH 0/4] libvhost-user: VHOST_USER_PROTOCOL_F_MQ support Stefan Hajnoczi
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=20190621162712.GA10947@stefanha-x1.localdomain \
--to=stefanha@redhat.com \
--cc=dgilbert@redhat.com \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sebastien.boeuf@intel.com \
/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).