qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/4] libvhost-user: support many virtqueues


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 2/4] libvhost-user: support many virtqueues
Date: Fri, 21 Jun 2019 17:27:12 +0100
User-agent: Mutt/1.11.4 (2019-03-13)

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 <address@hidden> 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 <address@hidden>

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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]