qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] io: Fix double shift usages on QIOChannel featu


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH] io: Fix double shift usages on QIOChannel features
Date: Wed, 28 Sep 2016 12:00:25 +0100
User-agent: Mutt/1.7.0 (2016-08-17)

On Wed, Sep 28, 2016 at 10:55:33AM +0000, Felipe Franciosi wrote:
> Hi Marc,
> 
> > On 27 Sep 2016, at 18:12, Marc-André Lureau <address@hidden> wrote:
> > 
> > Hi
> > 
> > ----- Original Message -----
> >> When QIOChannels were introduced in 666a3af9, the feature bits were
> >> defined shifted. However, when using them, the code was shifting them
> >> again. The incorrect use was consistent until 74b6ce43, where
> >> QIO_CHANNEL_FEATURE_LISTEN was defined shifted but tested unshifted.
> >> 
> > 
> > And by luck, QIO_CHANNEL_FEATURE_LISTEN == (1 << 
> > QIO_CHANNEL_FEATURE_LISTEN), so it works :)
> 
> Can you elaborate on that? Maybe I'm missing something obvious, but
> I'm confused as to how they are equivalent.

They're not equivalent  QIO_CHANNEL_FEATURE_LISTEN is (1 << 2) which
evaulates to 4 and 4 != (1 << 4).


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|



reply via email to

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