Re: [PATCH 3/4] qemu: add missing break in qemuDomainDeviceCalculatePCIConnectFlags

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

 



On Wed, Feb 22, 2017 at 02:52:08PM -0600, Eric Blake wrote:
> On 02/22/2017 11:52 AM, Daniel P. Berrange wrote:
> > One of the conditions in qemuDomainDeviceCalculatePCIConnectFlags
> > was missing a break that could result it in falling through to
> > an incorrect codepath.
> > 
> > Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> > ---
> >  src/qemu/qemu_domain_address.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
> > index 5b75044..27ca010 100644
> > --- a/src/qemu/qemu_domain_address.c
> > +++ b/src/qemu/qemu_domain_address.c
> > @@ -553,6 +553,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
> >              return pciFlags;
> >          }
> >      }
> > +        break;
> 
> Indentation looks weird.  I guess its because we have an extra {} scope
> for allowing declaration of variables?  Would hoisting the declaration
> (not initialization) of
> 
>     case VIR_DOMAIN_DEVICE_CONTROLLER: {
>         virDomainControllerDefPtr cont = dev->data.controller;
> 
> allow us to get rid of the weird {}?

Yes, though this style is not that unusual - we've got it in a number
of other places in libvirt already where we want to isolate the
variable declaration, so I think this is ok as is.

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/ :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux