Re: [libvirt] [PATCH v3 1/1] qemu_command: tidy up qemuBuildHostdevCommandLine loop

2019-12-18 Thread Michal Prívozník
On 12/18/19 10:28 AM, Daniel Henrique Barboza wrote: > The current 'for' loop with 5 consecutive 'ifs' inside > qemuBuildHostdevCommandLine can be a bit smarter: > > - all 5 'ifs' fails if hostdev->mode is not equal to > VIR_DOMAIN_HOSTDEV_MODE_SUBSYS. This check can be moved to the > start of the

[libvirt] [PATCH v3 1/1] qemu_command: tidy up qemuBuildHostdevCommandLine loop

2019-12-18 Thread Daniel Henrique Barboza
The current 'for' loop with 5 consecutive 'ifs' inside qemuBuildHostdevCommandLine can be a bit smarter: - all 5 'ifs' fails if hostdev->mode is not equal to VIR_DOMAIN_HOSTDEV_MODE_SUBSYS. This check can be moved to the start of the loop, failing to the next element immediately in case it fails;