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

Eric Blake eblake at redhat.com
Wed Feb 22 20:52:08 UTC 2017


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 at redhat.com>
> ---
>  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 {}?


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170222/ccd2ea38/attachment-0001.sig>


More information about the libvir-list mailing list